supra-ts-sdk - v2.0.0
    Preparing search index...

    Interface ExtendedRawTransaction

    A RawTransaction bound to the client's network configuration. The Build methods return it; it serializes the transaction and signs it, which checks the chain ID first.

    interface ExtendedRawTransaction {
        sender: AccountAddress;
        sequence_number: bigint;
        payload: TransactionPayload;
        max_gas_amount: bigint;
        gas_unit_price: bigint;
        expiration_timestamp_secs: bigint;
        chain_id: ChainId;
        serialize(serializer: Serializer): void;
        toBytes(): Uint8Array;
        toHexString(): HexString;
        signedTransaction(senderAccount: SupraAccount): Promise<SignedTransaction>;
        sendTxnPayload(senderAccount: SupraAccount): Promise<SendTxnPayload>;
        simulate(
            senderAccountOrAuthenticator: MoveInnerAuthenticator | SupraAccount,
        ): Promise<TransactionResponse>;
        submitTransaction(
            args: {
                senderAccount: SupraAccount;
                enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
            },
        ): Promise<SubmitTransactionResponse>;
        submitTransactionAndSignature(
            args: {
                senderPubkey: HexString;
                signature: HexString;
                enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
            },
        ): Promise<SubmitTransactionResponse>;
        submitSponsorTransaction(
            args: {
                feePayerAddress: AccountAddressInput;
                secondarySignersAccountAddress: string[];
                senderAuthenticator: AccountAuthenticatorEd25519;
                feePayerAuthenticator: AccountAuthenticatorEd25519;
                secondarySignersAuthenticator: AccountAuthenticatorEd25519[];
                enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
            },
        ): Promise<SubmitTransactionResponse>;
        submitMultiAgentTransaction(
            args: {
                secondarySignersAccountAddress: string[];
                senderAuthenticator: AccountAuthenticatorEd25519;
                secondarySignersAuthenticator: AccountAuthenticatorEd25519[];
                enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
            },
        ): Promise<SubmitTransactionResponse>;
        signTransaction(senderAccount: SupraAccount): Promise<HexString>;
    }

    Hierarchy (View Summary)

    Index
    • Parameters

      • serializer: Serializer

      Returns void

    • Create a signed transaction

      Parameters

      Returns Promise<SignedTransaction>

      SignedTransaction

      SupraChainIdMismatchError before signing when the client's or the transaction's chain ID is not the node's (see SupraConfig.verifyChainId)

      RangeError before signing when the transaction's expiration time is more than the node's maximum time to live after the current time (the maximum is read once per client; see getTransactionParameters()), and the error of a failed read of that maximum

    • Create a send transaction payload

      Parameters

      Returns Promise<SendTxnPayload>

      SendTxnPayload

      SupraChainIdMismatchError before signing when the client's or the transaction's chain ID is not the node's (see SupraConfig.verifyChainId)

      RangeError before signing when the transaction's expiration time is more than the node's maximum time to live after the current time (the maximum is read once per client; see getTransactionParameters()), and the error of a failed read of that maximum

    • Simulate the transaction

      Parameters

      Returns Promise<TransactionResponse>

      TransactionResponse of the simulation, whose status is Success

      SupraSimulationFailedError when the simulated status is not Success

      SupraGasUnitPriceBelowMinimumError instead when the status is Invalid because the gas unit price is below the node's minimum; the SupraSimulationFailedError is its cause

      SupraChainIdMismatchError before signing with a SupraAccount when the client's or the transaction's chain ID is not the node's (see SupraConfig.verifyChainId)

    • Submit the transaction

      Parameters

      Returns Promise<SubmitTransactionResponse>

      SubmitTransactionResponse; Submit describes the statuses and errors of a submission

      SupraChainIdMismatchError before signing when the client's or the transaction's chain ID is not the node's (see SupraConfig.verifyChainId)

      RangeError before signing when the transaction's expiration time is more than the node's maximum time to live after the current time (the maximum is read once per client; see getTransactionParameters()), and the error of a failed read of that maximum

      SupraGasUnitPriceBelowMinimumError when the node refuses the submission or an enabled simulation because the gas unit price is below its minimum (see Submit)

      SupraSubmissionOutcomeUnknownError when the outcome of the submission request is unknown (see Submit)

    • Submit the sponsor transaction. A sender with no Account resource uses sequence number 0, which a v12 node admits and a v11.7.x node refuses with HTTP 400 (see Submit.submitSponsorTransaction).

      Parameters

      • args: {
            feePayerAddress: AccountAddressInput;
            secondarySignersAccountAddress: string[];
            senderAuthenticator: AccountAuthenticatorEd25519;
            feePayerAuthenticator: AccountAuthenticatorEd25519;
            secondarySignersAuthenticator: AccountAuthenticatorEd25519[];
            enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
        }
        • feePayerAddress: AccountAddressInput

          Fee payer address

        • secondarySignersAccountAddress: string[]

          Secondary signers address

        • senderAuthenticator: AccountAuthenticatorEd25519

          Sender authenticator

        • feePayerAuthenticator: AccountAuthenticatorEd25519

          Fee payer authenticator

        • secondarySignersAuthenticator: AccountAuthenticatorEd25519[]

          Secondary signers authenticator

        • OptionalenableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs

      Returns Promise<SubmitTransactionResponse>

      SubmitTransactionResponse; Submit describes the statuses and errors of a submission

      SupraGasUnitPriceBelowMinimumError when the node refuses the submission or an enabled simulation because the gas unit price is below its minimum (see Submit)

      SupraSubmissionOutcomeUnknownError when the outcome of the submission request is unknown (see Submit)

      RangeError before submitting when the fee payer address or a secondary signer address is not 1 to 64 hex digits after an optional 0x or 0X

    • Submit the multi agent transaction

      Parameters

      • args: {
            secondarySignersAccountAddress: string[];
            senderAuthenticator: AccountAuthenticatorEd25519;
            secondarySignersAuthenticator: AccountAuthenticatorEd25519[];
            enableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs;
        }
        • secondarySignersAccountAddress: string[]

          Secondary signers address

        • senderAuthenticator: AccountAuthenticatorEd25519

          Sender authenticator

        • secondarySignersAuthenticator: AccountAuthenticatorEd25519[]

          Secondary signers authenticator

        • OptionalenableTransactionWaitAndSimulationArgs?: EnableTransactionWaitAndSimulationArgs

      Returns Promise<SubmitTransactionResponse>

      SubmitTransactionResponse; Submit describes the statuses and errors of a submission

      SupraGasUnitPriceBelowMinimumError when the node refuses the submission or an enabled simulation because the gas unit price is below its minimum (see Submit)

      SupraSubmissionOutcomeUnknownError when the outcome of the submission request is unknown (see Submit)

      RangeError before submitting when a secondary signer address is not 1 to 64 hex digits after an optional 0x or 0X

    • Sign the transaction

      Parameters

      Returns Promise<HexString>

      A promise of the ed25519 signature in HexString

      SupraChainIdMismatchError before signing when the client's or the transaction's chain ID is not the node's (see SupraConfig.verifyChainId)

      RangeError before signing when the transaction's expiration time is more than the node's maximum time to live after the current time (the maximum is read once per client; see getTransactionParameters()), and the error of a failed read of that maximum

    sender: AccountAddress
    sequence_number: bigint
    payload: TransactionPayload
    max_gas_amount: bigint
    gas_unit_price: bigint
    expiration_timestamp_secs: bigint
    chain_id: ChainId