aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Simulates transactions with the configured Sui gRPC client and exposes command return values as byte arrays.

    These helpers perform network I/O through simulateTransaction. They use gRPC response types and do not require the optional JSON-RPC client.

    Index
    constants: { devInspectSigner: string } = ...

    Default signer used when an inspection input does not provide a sender.

    Type Declaration

    • devInspectSigner: string

      Sender assigned to a cloned transaction for default simulations.

    • Simulates tx and returns the BCS bytes each command returned.

      Parameters

      • inputs: { sender?: string; tx: Transaction }

        The transaction and optional Sui sender address. When the sender is omitted, the fixed inspection signer in constants is used.

      Returns Promise<
          { allBytes: number[][][]; effects: TransactionEffects; events: Event[] },
      >

      gRPC events, transaction effects, and BCS return bytes for every command.

      Ported from JSON-RPC's devInspectTransactionBlock to gRPC's simulateTransaction. Three things differ:

      • the sender is taken from the transaction (tx.setSenderIfNotSet), not passed as a separate option;
      • checksEnabled: false is what makes inspecting non-entry / non-public Move functions possible (with checks on, the node rejects an unsigned transaction touching objects the sender does not own);
      • return values arrive as commandResults[i].returnValues[j].bcs (Uint8Array) instead of JSON-RPC's [number[], type] tuples. Note commandResults is requested inside include.

      events and effects are now gRPC-shaped (SuiClientTypes.Event / SuiClientTypes.TransactionEffects) rather than the JSON-RPC types — a success: boolean status instead of status: "success" | "failure", and BCS bytes rather than parsedJson on events. Nothing in this SDK reads either field.

      The method performs network I/O through the configured gRPC client. It clones tx before assigning the sender, so the caller's transaction keeps its original sender. allBytes[commandIndex][returnValueIndex] is a byte array containing the BCS value returned by that command.

      An Error with the simulation status message when the simulation fails, or when the response has no commandResults.

    • Simulates a transaction and returns all returned byte values from its last command.

      The method performs gRPC network I/O and uses the optional sender, or InspectionsApiHelpers.constants.devInspectSigner when it is omitted. The transaction is cloned before simulation. Each inner array is one BCS return value, and each number is a byte from 0 through 255.

      Parameters

      • inputs: { sender?: string; tx: Transaction }

        The transaction and optional Sui sender address.

      Returns Promise<number[][]>

      The last command's returned BCS values. A simulation with an empty commandResults array has no last command and yields no value.

      An Error when simulation fails or returns no command results.

    • Simulates a transaction and returns the first returned byte value from its last command.

      The method performs gRPC network I/O and uses sender as the simulation sender. When sender is omitted, it uses InspectionsApiHelpers.constants.devInspectSigner. The transaction is cloned before the sender is set, so the input transaction is not modified.

      Parameters

      • inputs: { sender?: string; tx: Transaction }

        The transaction and optional Sui sender address.

      Returns Promise<number[]>

      The first BCS return value from the last command, represented as a number array whose entries are bytes from 0 through 255. A simulation with an empty commandResults array has no last command and yields no value.

      An Error when simulation fails or returns no command results.