Transaction Builder

Constructors

  • Returns Transaction

Accessors

  • get [TRANSACTION_BRAND](): boolean
  • Returns boolean

  • get blockData(): {
        expiration: undefined | null | {
            Epoch: number;
        } | {
            None: null | true;
        };
        gasConfig: {
            budget?: string | number | bigint;
            owner?: string;
            payment?: {
                digest: string;
                objectId: string;
                version: string | number | bigint;
            }[];
            price?: string | number | bigint;
        };
        inputs: ({
            index: number;
            kind: "Input";
            type?: "object";
            value: unknown;
        } | {
            index: number;
            kind: "Input";
            type: "pure";
            value: unknown;
        })[];
        sender?: string;
        transactions: ({
            arguments: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            kind: "MoveCall";
            target: `${string}::${string}::${string}`;
            typeArguments: string[];
        } | {
            address: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "TransferObjects";
            objects: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
        } | {
            amounts: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            coin: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "SplitCoins";
        } | {
            destination: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "MergeCoins";
            sources: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
        } | {
            kind: "MakeMoveVec";
            objects: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            type: {
                Some: TypeTag;
            } | {
                None: null | true;
            };
        } | {
            dependencies: string[];
            kind: "Publish";
            modules: number[][];
        } | {
            dependencies: string[];
            kind: "Upgrade";
            modules: number[][];
            packageId: string;
            ticket: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
        })[];
        version: 1;
    }
  • Returns {
        expiration: undefined | null | {
            Epoch: number;
        } | {
            None: null | true;
        };
        gasConfig: {
            budget?: string | number | bigint;
            owner?: string;
            payment?: {
                digest: string;
                objectId: string;
                version: string | number | bigint;
            }[];
            price?: string | number | bigint;
        };
        inputs: ({
            index: number;
            kind: "Input";
            type?: "object";
            value: unknown;
        } | {
            index: number;
            kind: "Input";
            type: "pure";
            value: unknown;
        })[];
        sender?: string;
        transactions: ({
            arguments: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            kind: "MoveCall";
            target: `${string}::${string}::${string}`;
            typeArguments: string[];
        } | {
            address: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "TransferObjects";
            objects: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
        } | {
            amounts: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            coin: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "SplitCoins";
        } | {
            destination: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
            kind: "MergeCoins";
            sources: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
        } | {
            kind: "MakeMoveVec";
            objects: ({
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            })[];
            type: {
                Some: TypeTag;
            } | {
                None: null | true;
            };
        } | {
            dependencies: string[];
            kind: "Publish";
            modules: number[][];
        } | {
            dependencies: string[];
            kind: "Upgrade";
            modules: number[][];
            packageId: string;
            ticket: {
                index: number;
                kind: "Input";
                type?: "object";
                value: unknown;
            } | {
                index: number;
                kind: "Input";
                type: "pure";
                value: unknown;
            } | {
                kind: "GasCoin";
            } | {
                index: number;
                kind: "Result";
            } | {
                index: number;
                kind: "NestedResult";
                resultIndex: number;
            };
        })[];
        version: 1;
    }

    • expiration: undefined | null | {
          Epoch: number;
      } | {
          None: null | true;
      }
    • gasConfig: {
          budget?: string | number | bigint;
          owner?: string;
          payment?: {
              digest: string;
              objectId: string;
              version: string | number | bigint;
          }[];
          price?: string | number | bigint;
      }
      • Optional budget?: string | number | bigint
      • Optional owner?: string
      • Optional payment?: {
            digest: string;
            objectId: string;
            version: string | number | bigint;
        }[]
      • Optional price?: string | number | bigint
    • inputs: ({
          index: number;
          kind: "Input";
          type?: "object";
          value: unknown;
      } | {
          index: number;
          kind: "Input";
          type: "pure";
          value: unknown;
      })[]
    • Optional sender?: string
    • transactions: ({
          arguments: ({
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          })[];
          kind: "MoveCall";
          target: `${string}::${string}::${string}`;
          typeArguments: string[];
      } | {
          address: {
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          };
          kind: "TransferObjects";
          objects: ({
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          })[];
      } | {
          amounts: ({
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          })[];
          coin: {
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          };
          kind: "SplitCoins";
      } | {
          destination: {
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          };
          kind: "MergeCoins";
          sources: ({
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          })[];
      } | {
          kind: "MakeMoveVec";
          objects: ({
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          })[];
          type: {
              Some: TypeTag;
          } | {
              None: null | true;
          };
      } | {
          dependencies: string[];
          kind: "Publish";
          modules: number[][];
      } | {
          dependencies: string[];
          kind: "Upgrade";
          modules: number[][];
          packageId: string;
          ticket: {
              index: number;
              kind: "Input";
              type?: "object";
              value: unknown;
          } | {
              index: number;
              kind: "Input";
              type: "pure";
              value: unknown;
          } | {
              kind: "GasCoin";
          } | {
              index: number;
              kind: "Result";
          } | {
              index: number;
              kind: "NestedResult";
              resultIndex: number;
          };
      })[]
    • version: 1

    Deprecated

    Use getData() instead.

  • get gas(): {
        $kind: "GasCoin";
        GasCoin: true;
    }
  • Returns an argument for the gas coin, to be used in a transaction.

    Returns {
        $kind: "GasCoin";
        GasCoin: true;
    }

    • $kind: "GasCoin"
    • GasCoin: true
  • get pure(): {
        id: ((value) => {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        });
        address(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        bool(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        string(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u128(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u16(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u256(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u32(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u64(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u8(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        (value): Argument;
    }
  • Returns {
        id: ((value) => {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        });
        address(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        bool(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        string(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u128(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u16(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u256(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u32(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u64(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        u8(value): {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        };
        (value): Argument;
    }

      • (value): Argument
      • Parameters

        • value: Uint8Array | SerializedBcs<any, any>

          The pure value, serialized to BCS. If this is a Uint8Array, then the value is assumed to be raw bytes, and will be used directly.

        Returns Argument

    • id: ((value) => {
          $kind: "GasCoin";
          GasCoin: true;
      } | {
          $kind: "Input";
          Input: number;
          type?: "pure";
      } | {
          $kind: "Input";
          Input: number;
          type?: "object";
      } | {
          $kind: "Result";
          Result: number;
      } | {
          $kind: "NestedResult";
          NestedResult: [number, number];
      })
        • (value): {
              $kind: "GasCoin";
              GasCoin: true;
          } | {
              $kind: "Input";
              Input: number;
              type?: "pure";
          } | {
              $kind: "Input";
              Input: number;
              type?: "object";
          } | {
              $kind: "Result";
              Result: number;
          } | {
              $kind: "NestedResult";
              NestedResult: [number, number];
          }
        • Parameters

          • value: string

          Returns {
              $kind: "GasCoin";
              GasCoin: true;
          } | {
              $kind: "Input";
              Input: number;
              type?: "pure";
          } | {
              $kind: "Input";
              Input: number;
              type?: "object";
          } | {
              $kind: "Result";
              Result: number;
          } | {
              $kind: "NestedResult";
              NestedResult: [number, number];
          }

    • address:function
      • Parameters

        • value: string

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • bool:function
      • Parameters

        • value: boolean

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • string:function
      • Parameters

        • value: string

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u128:function
      • Parameters

        • value: string | number | bigint

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u16:function
      • Parameters

        • value: number

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u256:function
      • Parameters

        • value: string | number | bigint

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u32:function
      • Parameters

        • value: number

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u64:function
      • Parameters

        • value: string | number | bigint

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

    • u8:function
      • Parameters

        • value: number

        Returns {
            $kind: "GasCoin";
            GasCoin: true;
        } | {
            $kind: "Input";
            Input: number;
            type?: "pure";
        } | {
            $kind: "Input";
            Input: number;
            type?: "object";
        } | {
            $kind: "Result";
            Result: number;
        } | {
            $kind: "NestedResult";
            NestedResult: [number, number];
        }

Methods

  • Add a transaction to the transaction

    Type Parameters

    Parameters

    Returns T

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Build the transaction to BCS bytes.

    Parameters

    Returns Promise<Uint8Array>

  • Get a snapshot of the transaction data, in JSON form:

    Returns {
        commands: EnumOutputShapeWithKeys<{
            $Intent: {
                data: {};
                inputs: {};
                name: string;
            };
            MakeMoveVec: {
                elements: ({
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                })[];
                type: null | string;
            };
            MergeCoins: {
                destination: {
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                };
                sources: ({
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                })[];
            };
            MoveCall: {
                _argumentTypes?: null | {
                    body: OpenMoveTypeSignatureBody;
                    ref: null | "&" | "&mut";
                }[];
                arguments: ({
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $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?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                })[];
                coin: {
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                };
            };
            TransferObjects: {
                address: {
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                };
                objects: ({
                    $kind: "GasCoin";
                    GasCoin: true;
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $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?: "pure";
                } | {
                    $kind: "Input";
                    Input: number;
                    type?: "object";
                } | {
                    $kind: "Result";
                    Result: number;
                } | {
                    $kind: "NestedResult";
                    NestedResult: [number, number];
                };
            };
        }, "MoveCall" | "TransferObjects" | "SplitCoins" | "MergeCoins" | "Publish" | "MakeMoveVec" | "Upgrade" | "$Intent">[];
        expiration: undefined | null | EnumOutputShapeWithKeys<{
            Epoch: string | number;
            None: true;
        }, "None" | "Epoch">;
        gasData: {
            budget: null | string | number;
            owner: null | string;
            payment: null | {
                digest: string;
                objectId: string;
                version: string | number;
            }[];
            price: null | string | number;
        };
        inputs: EnumOutputShapeWithKeys<{
            Object: EnumOutputShapeWithKeys<{
                ImmOrOwnedObject: {
                    digest: string;
                    objectId: string;
                    version: string | number;
                };
                Receiving: {
                    digest: string;
                    objectId: string;
                    version: string | number;
                };
                SharedObject: {
                    initialSharedVersion: string | number;
                    mutable: boolean;
                    objectId: string;
                };
            }, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
            Pure: {
                bytes: string;
            };
            UnresolvedObject: {
                digest?: null | string;
                initialSharedVersion?: null | string | number;
                objectId: string;
                version?: null | string | number;
            };
            UnresolvedPure: {
                value: unknown;
            };
        }, "Pure" | "Object" | "UnresolvedPure" | "UnresolvedObject">[];
        sender: undefined | null | string;
        version: 2;
    }

    • commands: EnumOutputShapeWithKeys<{
          $Intent: {
              data: {};
              inputs: {};
              name: string;
          };
          MakeMoveVec: {
              elements: ({
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              })[];
              type: null | string;
          };
          MergeCoins: {
              destination: {
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              };
              sources: ({
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              })[];
          };
          MoveCall: {
              _argumentTypes?: null | {
                  body: OpenMoveTypeSignatureBody;
                  ref: null | "&" | "&mut";
              }[];
              arguments: ({
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $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?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              })[];
              coin: {
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              };
          };
          TransferObjects: {
              address: {
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              };
              objects: ({
                  $kind: "GasCoin";
                  GasCoin: true;
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $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?: "pure";
              } | {
                  $kind: "Input";
                  Input: number;
                  type?: "object";
              } | {
                  $kind: "Result";
                  Result: number;
              } | {
                  $kind: "NestedResult";
                  NestedResult: [number, number];
              };
          };
      }, "MoveCall" | "TransferObjects" | "SplitCoins" | "MergeCoins" | "Publish" | "MakeMoveVec" | "Upgrade" | "$Intent">[]
    • expiration: undefined | null | EnumOutputShapeWithKeys<{
          Epoch: string | number;
          None: true;
      }, "None" | "Epoch">
    • gasData: {
          budget: null | string | number;
          owner: null | string;
          payment: null | {
              digest: string;
              objectId: string;
              version: string | number;
          }[];
          price: null | string | number;
      }
      • budget: null | string | number
      • owner: null | string
      • payment: null | {
            digest: string;
            objectId: string;
            version: string | number;
        }[]
      • price: null | string | number
    • inputs: EnumOutputShapeWithKeys<{
          Object: EnumOutputShapeWithKeys<{
              ImmOrOwnedObject: {
                  digest: string;
                  objectId: string;
                  version: string | number;
              };
              Receiving: {
                  digest: string;
                  objectId: string;
                  version: string | number;
              };
              SharedObject: {
                  initialSharedVersion: string | number;
                  mutable: boolean;
                  objectId: string;
              };
          }, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
          Pure: {
              bytes: string;
          };
          UnresolvedObject: {
              digest?: null | string;
              initialSharedVersion?: null | string | number;
              objectId: string;
              version?: null | string | number;
          };
          UnresolvedPure: {
              value: unknown;
          };
      }, "Pure" | "Object" | "UnresolvedPure" | "UnresolvedObject">[]
    • sender: undefined | null | string
    • version: 2
  • Derive transaction digest

    Parameters

    Returns Promise<string>

  • Add a new object input to the transaction.

    Parameters

    Returns {
        $kind: "Input";
        Input: number;
        type?: "object";
    }

    • $kind: "Input"
    • Input: number
    • Optional type?: "object"
  • Add a new object input to the transaction using the fully-resolved object reference. If you only have an object ID, use builder.object(id) instead.

    Parameters

    • Rest ...args: [{
          digest: string;
          objectId: string;
          version: string | number;
      }]

    Returns {
        $kind: "Input";
        Input: number;
        type?: "object";
    }

    • $kind: "Input"
    • Input: number
    • Optional type?: "object"
  • Parameters

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          dependencies: string[];
          modules: string[] | number[][];
      }
      • dependencies: string[]
      • modules: string[] | number[][]

    Returns TransactionResult

  • Add a new receiving input to the transaction using the fully-resolved object reference. If you only have an object ID, use builder.object(id) instead.

    Parameters

    • Rest ...args: [{
          digest: string;
          objectId: string;
          version: string | number;
      }]

    Returns {
        $kind: "Input";
        Input: number;
        type?: "object";
    }

    • $kind: "Input"
    • Input: number
    • Optional type?: "object"
  • Returns string

    Deprecated

    Use toJSON instead. For synchronous serialization, you can use getData()

  • Parameters

    • Optional expiration: null | EnumInputShape<{
          Epoch: string | number;
          None: true;
      }>

    Returns void

  • Parameters

    • budget: number | bigint

    Returns void

  • Parameters

    • owner: string

    Returns void

  • Parameters

    • payments: {
          digest: string;
          objectId: string;
          version: string | number;
      }[]

    Returns void

  • Parameters

    • price: number | bigint

    Returns void

  • Parameters

    • sender: string

    Returns void

  • Sets the sender only if it has not already been set. This is useful for sponsored transaction flows where the sender may not be the same as the signer address.

    Parameters

    • sender: string

    Returns void

  • Add a new shared object input to the transaction using the fully-resolved shared object reference. If you only have an object ID, use builder.object(id) instead.

    Parameters

    • Rest ...args: [{
          initialSharedVersion: string | number;
          mutable: boolean;
          objectId: string;
      }]

    Returns {
        $kind: "Input";
        Input: number;
        type?: "object";
    }

    • $kind: "Input"
    • Input: number
    • Optional type?: "object"
  • Build the transaction to BCS bytes, and sign it with the provided keypair.

    Parameters

    • options: SignOptions

    Returns Promise<SignatureWithBytes>

  • Parameters

    Returns Promise<string>

  • Parameters

    • __namedParameters: {
          dependencies: string[];
          modules: string[] | number[][];
          package: string;
          ticket: string | TransactionObjectArgument;
      }

    Returns TransactionResult

  • Converts from a serialized transaction format to a Transaction class. There are two supported serialized formats:

    • A string returned from Transaction#serialize. The serialized format must be compatible, or it will throw an error.
    • A byte array (or base64-encoded bytes) containing BCS transaction data.

    Parameters

    Returns Transaction

  • Converts from a serialize transaction kind (built with build({ onlyTransactionKind: true })) to a Transaction class. Supports either a byte array, or base64-encoded bytes.

    Parameters

    • serialized: string | Uint8Array

    Returns Transaction