Class Tx

A class for batching and sending transaction to circuit. The main functionality here is signAndSendSafe, which takes care of nonce incrementation and error decoding. This is supposed to act as a default way of dealing with extrinsics.

Hierarchy

  • Tx

Constructors

  • Parameters

    • api: ApiPromise

      The ApiPromise instance

    • signer: any

      The signer to use for signing Transactions

    • exportMode: boolean

    Returns Tx

Properties

exportMode: boolean
signer: any

Methods

  • Batches transactions into a single batch object.

    Parameters

    • txs: any[]

      The transactions to batch

    Returns SubmittableExtrinsic<"promise", ISubmittableResult>

  • Wraps a transaction object into sudo

    Parameters

    • tx: any

      The transaction to sudo

    Returns SubmittableExtrinsic<"promise", ISubmittableResult>

  • Returns

    {Promise}

    Memberof

    Tx

    Parameters

    • tx: SubmittableExtrinsic
    • options: Partial<SignerOptions>

    Returns Promise<any>

  • Parameters

    • tx: SubmittableExtrinsic

    Returns Promise<any>

  • Recommended when looking to send multiple TXs in a single block. This function queries the correct nonce and then submits the transaction. This should not be used when submitting transactions in fast succession as the nonce won't have time to update. In that case use the optimistic send or batch the transaction. If an error occurs, it is decoded and returned in the promise. Returns the block height the transaction was included in.

    Returns

    The block height the transaction was included in

    Parameters

    • tx: SubmittableExtrinsic

      The transaction to send

    Returns Promise<string>

  • Parameters

    • dispatchError: DispatchError
    • exportObj: ExtrinsicExport
    • reject: any

    Returns void

  • Parameters

    • events: EventRecord[]
    • status: ExtrinsicStatus
    • exportObj: ExtrinsicExport
    • resolve: any
    • reject: any

    Returns void

  • Parameters

    • status: ExtrinsicStatus
    • returnType: "events" | "blockHash" | "statusEventsAndError"
    • resolve: any
    • Optional dataToReturn: DataToReturnFromSignAndSendTx

    Returns any

  • Parameters

    • status: ExtrinsicStatus
    • reject: any

    Returns void

Generated using TypeDoc