@aptos-labs/ts-sdk - v7.4.0
    Preparing search index...

    Function generateSignedTransactionForSimulation

    • Generate a signed transaction for simulation before submitting it to the chain. This function helps in preparing a transaction that can be simulated, allowing users to verify its validity and expected behavior.

      Parameters

      • args: InputSimulateTransactionData

        The input data required to generate the signed transaction for simulation.

        The data required to simulate a transaction, typically generated by generateTransaction().

        • OptionalfeePayerPublicKey?: PublicKey

          The public key for the fee payer in a sponsored transaction. Omit it to skip the fee payer's public/authentication-key check during simulation.

        • Optionaloptions?: InputSimulateTransactionOptions
        • OptionalsecondarySignersPublicKeys?: (PublicKey | undefined)[]

          For a fee payer or multi-agent transaction that requires additional signers in

        • OptionalsignerPublicKey?: PublicKey

          The primary sender's public key. Omit it to skip the sender's public/authentication-key check during simulation.

        • transaction: AnyRawTransaction

          The transaction to simulate, probably generated by generateTransaction(). Encrypted payloads (options.encrypted when building) are not supported: simulation throws before the request is sent; simulate a plaintext build of the same entry function instead.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      A signed serialized transaction that can be simulated.