Class TxClient

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
chainId: string
coinType: string
restUrl: string
signer: Signer

Methods

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

    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>

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

  • Signs a transaction using the Amino signing method.

    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>

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

  • Signs and broadcasts a transaction.

    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>

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

  • Signs a transaction using the direct signing method.

    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>

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

  • Submits a transaction using the Skip API.

    Parameters

    • chainId: string

      The blockchain chain ID.

    • txBytesString: string

      The signed transaction as a base64 encoded string.

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

    A Promise resolving to the result of the transaction submission.