Documentation
    Preparing search index...

    Function parseTransactionBcs

    • Decode transaction data from BCS. Unlike the transport mappers, which return Unknown, this throws on a transaction kind or variant this SDK version does not recognize.

      Parameters

      • bytes: Uint8Array
      • OptionalonlyTransactionKind: false

      Returns SuiClientTypes.TransactionData

    • Parameters

      • bytes: Uint8Array
      • onlyTransactionKind: true

      Returns {
          commands: EnumOutputShapeWithKeys<
              {
                  $Intent: {
                      data: { [key: string]: unknown };
                      inputs: {
                          [key: string]:
                              | { $kind: "GasCoin"; GasCoin: true }
                              | {
                                  $kind: "Input";
                                  Input: number;
                                  type?: "object" | "pure" | "withdrawal";
                              }
                              | { $kind: "Result"; Result: number }
                              | { $kind: "NestedResult"; NestedResult: [number, number] }
                              | (
                                  | { $kind: "GasCoin"; GasCoin: true }
                                  | {
                                      $kind: "Input";
                                      Input: number;
                                      type?: (...) | (...) | (...) | (...);
                                  }
                                  | { $kind: "Result"; Result: number }
                                  | { $kind: "NestedResult"; NestedResult: [(...), (...)] }
                              )[];
                      };
                      name: string;
                  };
                  MakeMoveVec: {
                      elements: (
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] }
                      )[];
                      type: string | null;
                  };
                  MergeCoins: {
                      destination: | { $kind: "GasCoin"; GasCoin: true }
                      | {
                          $kind: "Input";
                          Input: number;
                          type?: "object" | "pure" | "withdrawal";
                      }
                      | { $kind: "Result"; Result: number }
                      | { $kind: "NestedResult"; NestedResult: [number, number] };
                      sources: (
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] }
                      )[];
                  };
                  MoveCall: {
                      _argumentTypes?: | {
                          body: OpenSignatureBody;
                          reference: "mutable"
                          | "unknown"
                          | "immutable"
                          | null;
                      }[]
                      | null;
                      arguments: (
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] }
                      )[];
                      function: string;
                      module: string;
                      package: string;
                      typeArguments: string[];
                  };
                  Publish: { dependencies: string[]; modules: string[] };
                  SplitCoins: {
                      amounts: (
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] }
                      )[];
                      coin:
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] };
                  };
                  TransferObjects: {
                      address: | { $kind: "GasCoin"; GasCoin: true }
                      | {
                          $kind: "Input";
                          Input: number;
                          type?: "object" | "pure" | "withdrawal";
                      }
                      | { $kind: "Result"; Result: number }
                      | { $kind: "NestedResult"; NestedResult: [number, number] };
                      objects: (
                          | { $kind: "GasCoin"; GasCoin: true }
                          | {
                              $kind: "Input";
                              Input: number;
                              type?: "object" | "pure" | "withdrawal";
                          }
                          | { $kind: "Result"; Result: number }
                          | { $kind: "NestedResult"; NestedResult: [number, number] }
                      )[];
                  };
                  Upgrade: {
                      dependencies: string[];
                      modules: string[];
                      package: string;
                      ticket: | { $kind: "GasCoin"; GasCoin: true }
                      | {
                          $kind: "Input";
                          Input: number;
                          type?: "object" | "pure" | "withdrawal";
                      }
                      | { $kind: "Result"; Result: number }
                      | { $kind: "NestedResult"; NestedResult: [number, number] };
                  };
              },
              | "MoveCall"
              | "TransferObjects"
              | "SplitCoins"
              | "MergeCoins"
              | "Publish"
              | "MakeMoveVec"
              | "Upgrade"
              | "$Intent",
          >[];
          expiration?: | EnumOutputShapeWithKeys<
              {
                  Epoch: string
                  | number;
                  None: true;
                  ValidDuring: {
                      chain: string;
                      maxEpoch: string | number | null;
                      maxTimestamp: string | number | null;
                      minEpoch: string | number | null;
                      minTimestamp: string | number | null;
                      nonce: number;
                  };
                  Validity: {
                      allowedProposers: | { epoch: string
                      | number; proposers: number[] }
                      | null;
                      chain: string;
                      maxEpoch: string | number | null;
                      maxTimestamp: string | number | null;
                      minEpoch: string | number | null;
                      minTimestamp: string | number | null;
                      nonce: number;
                  };
              },
              "None"
              | "ValidDuring"
              | "Validity"
              | "Epoch",
          >
          | null;
          gasData: {
              budget: string | number | null;
              owner: string | null;
              payment:
                  | { digest: string; objectId: string; version: string
                  | number }[]
                  | null;
              price: string | number | null;
          };
          inputs: EnumOutputShapeWithKeys<
              {
                  FundsWithdrawal: {
                      reservation: { $kind: "MaxAmountU64"; MaxAmountU64: string
                      | number };
                      typeArg: { $kind: "Balance"; Balance: string };
                      withdrawFrom: EnumOutputShapeWithKeys<
                          {
                              Sender: true;
                              SenderAllowance: { allowance: string; funder: string };
                              Sponsor: true;
                          },
                          "Sender"
                          | "Sponsor"
                          | "SenderAllowance",
                      >;
                  };
                  Object: EnumOutputShapeWithKeys<
                      {
                          ImmOrOwnedObject: {
                              digest: string;
                              objectId: string;
                              version: string
                              | number;
                          };
                          Receiving: {
                              digest: string;
                              objectId: string;
                              version: string
                              | number;
                          };
                          SharedObject: {
                              initialSharedVersion: string
                              | number;
                              mutability?: "NonExclusiveWrite";
                              mutable: boolean;
                              objectId: string;
                          };
                      },
                      "ImmOrOwnedObject"
                      | "SharedObject"
                      | "Receiving",
                  >;
                  Pure: { bytes: string };
                  UnresolvedObject: {
                      digest?: string | null;
                      initialSharedVersion?: string | number | null;
                      mutable?: boolean | null;
                      objectId: string;
                      version?: string | number | null;
                  };
                  UnresolvedPure: { value: unknown };
              },
              | "FundsWithdrawal"
              | "Pure"
              | "Object"
              | "UnresolvedPure"
              | "UnresolvedObject",
          >[];
          sender?: string
          | null;
          version: 2;
      }

      Use Transaction.fromKind(bytes).getData() to decode transaction kind bytes.