@multiversx/sdk-core - v14.0.1
    Preparing search index...

    Class Transaction

    An abstraction for creating and signing transactions.

    Index

    Constructors

    • Creates a new Transaction object.

      Parameters

      • options: {
            chainID: string;
            data?: Uint8Array<ArrayBufferLike>;
            gasLimit: bigint;
            gasPrice?: bigint;
            guardian?: Address;
            guardianSignature?: Uint8Array<ArrayBufferLike>;
            nonce?: bigint;
            options?: number;
            receiver: Address;
            receiverUsername?: string;
            relayer?: Address;
            relayerSignature?: Uint8Array<ArrayBufferLike>;
            sender: Address;
            senderUsername?: string;
            signature?: Uint8Array<ArrayBufferLike>;
            value?: bigint;
            version?: number;
        }

      Returns Transaction

    Properties

    chainID: string

    The chain ID of the Network (e.g. "1" for Mainnet).

    data: Uint8Array

    The payload of the transaction.

    gasLimit: bigint

    The maximum amount of gas to be consumed when processing the transaction.

    gasPrice: bigint

    The gas price to be used.

    guardian: Address

    The address of the guardian, in bech32 format.

    guardianSignature: Uint8Array

    The signature of the guardian.

    nonce: bigint

    The nonce of the transaction (the account sequence number of the sender).

    options: number

    The options field, useful for describing different settings available for transactions.

    receiver: Address

    The address of the receiver.

    receiverUsername: string

    The username of the receiver.

    relayer: Address

    The relayer address. Note: in the next major version, sender, receiver and guardian will also have the type Address, instead of string.

    relayerSignature: Uint8Array

    The signature of the relayer.

    sender: Address

    The address of the sender.

    senderUsername: string

    The username of the sender.

    signature: Uint8Array

    The signature.

    value: bigint

    The value to transfer.

    version: number

    The version, required by the Network in order to correctly interpret the contents of the transaction.

    Methods

    • Parameters

      • guardianSignature: Uint8Array

        The signature, as computed by a signer.

      Returns void

      method, use guardianSignature property instead. Applies the guardian signature on the transaction.

    • Parameters

      • signature: Uint8Array

        The signature, as computed by a signer.

      Returns void

      method, use signature property instead. Applies the signature on the transaction.

    • Returns Buffer

      method, use "TransactionComputer.computeBytesForSigning()" instead. Serializes a transaction to a sequence of bytes, ready to be signed. This function is called internally by signers.

    • Parameters

      • nonce: bigint

      Returns void

      method, use nonce property instead. Sets the account sequence number of the sender. Must be done prior signing.

    • Parameters

      • options: number

      Returns void

      method, use options property instead.

      Question for review: check how the options are set by sdk-dapp, wallet, ledger, extension.

    • Converts a transaction to a ready-to-broadcast object. Called internally by the network provider.

      Returns any