Broadcast | Developers

Broadcast

Estimated reading time: One minute

Introduction

To broadcast a transaction, you will need to use the broadcastSignedTransaction function.

broadcastSignedtransaction:

  async broadcastSignedTransaction(
    accountId: string,
    signedTransaction: RawSignedTransaction
  ): Promise<string>

As you can see, you need the accountId and the signedTransaction.

Account Id

To get the accountId, you have two options. You can either use the listAccounts or the requestAccount functions.

List account

List the accounts added by the user on Ledger Live.

listAccounts:

async listAccounts(): Promise<Account[]> 

Request account

Let the user choose an account in Ledger Live, providing filters for choosing currency or allowing add account.

requestAccount:

async requestAccount(
    params: {
      currencies?: string[];
      allowAddAccount?: boolean;
    } = {}
  ): Promise<Account> 

Signed Transaction

Refer to the page How to: sign.


Did you find this page helpful?


How would you improve this page for developers?



Getting Started
Theme Features
Customization

Non-Dapps