Constructors

  • Constructs a TxClient instance.

    Parameters

    • chainId: string

      The blockchain chain ID.

    • restUrl: string

      The REST URL of the blockchain node.

    • coinType: string

      The coin type identifier.

    • signer: Signer

      The object responsible for signing transactions (Signer).

    • account: Account

      The account information (Account).

    Returns TxClient

Properties

account: Account
broadcastTx: ((txBytesString) => Promise<SignAndBroadcastResponse>)

Broadcasts a signed transaction to the blockchain.

Type declaration

Returns

A Promise resolving to the broadcast transaction response (SignAndBroadcastResponse).

chainId: string
coinType: string
restUrl: string
sign: ((address, messages, fee, memo?) => Promise<string>)

Signs a transaction using the appropriate method based on the account type.

Type declaration

    • (address, messages, fee, memo?): Promise<string>
    • Parameters

      • address: string

        The address of the account.

      • messages: EncodeObject[]

        An array of messages to be included in the transaction (EncodeObject[]).

      • fee: StdFee

        The transaction fee information (StdFee).

      • Optional memo: string

        Optional transaction memo.

      Returns Promise<string>

Returns

A Promise resolving to the signed transaction as a base64 encoded string.

signAmino: ((address, messages, fee, memo?) => Promise<string>)

Signs a transaction using the Amino signing method.

Type declaration

    • (address, messages, fee, memo?): Promise<string>
    • Parameters

      • address: string

        The address of the account.

      • messages: EncodeObject[]

        An array of messages to be included in the transaction (EncodeObject[]).

      • fee: StdFee

        The transaction fee information (StdFee).

      • Optional memo: string

        Optional transaction memo.

      Returns Promise<string>

Returns

A Promise resolving to the signed transaction as a base64 encoded string.

signAndBroadcastTx: ((address, messages, fee, memo?) => Promise<SignAndBroadcastResponse>)

Signs and broadcasts a transaction.

Type declaration

    • (address, messages, fee, memo?): Promise<SignAndBroadcastResponse>
    • Parameters

      • address: string

        The address of the account.

      • messages: EncodeObject[]

        An array of messages to be included in the transaction (EncodeObject[]).

      • fee: StdFee

        The transaction fee information (StdFee).

      • Optional memo: string

        Optional transaction memo.

      Returns Promise<SignAndBroadcastResponse>

Returns

A Promise resolving to the broadcast transaction response (SignAndBroadcastResponse).

signDirect: ((address, messages, fee, memo?) => Promise<string>)

Signs a transaction using the direct signing method.

Type declaration

    • (address, messages, fee, memo?): Promise<string>
    • Parameters

      • address: string

        The address of the account.

      • messages: DecodeObject[]

        An array of messages to be included in the transaction (DecodeObject[]).

      • fee: StdFee

        The transaction fee information (StdFee).

      • Optional memo: string

        Optional transaction memo.

      Returns Promise<string>

Returns

A Promise resolving to the signed transaction as a base64 encoded string.

signer: Signer
submitTx: ((chainId, txBytesString) => Promise<{
    response: TransactionResponse;
    success: true;
}>)

Submits a transaction using the Skip API.

Type declaration

    • (chainId, txBytesString): Promise<{
          response: TransactionResponse;
          success: true;
      }>
    • Parameters

      • chainId: string

        The blockchain chain ID.

      • txBytesString: string

        The signed transaction as a base64 encoded string.

      Returns Promise<{
          response: TransactionResponse;
          success: true;
      }>

Returns

A Promise resolving to the result of the transaction submission.