Skip to main content

Class: Transaction

Transaction Builder

Constructors

Constructor

new Transaction(): Transaction

Returns

Transaction

Properties

object

object: {(value): object; system: object; clock: object; random: object; denyList: object; option: (tx) => TransactionResult; }

Add a new object input to the transaction.

Parameters

value

TransactionObjectInput

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"

system()

system(options?): object

Parameters
options?
mutable?

boolean

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"

clock()

clock(): object

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"

random()

random(): object

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"

denyList()

denyList(options?): object

Parameters
options?
mutable?

boolean

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"

option()

option(__namedParameters): (tx) => TransactionResult

Parameters
__namedParameters
type

string

value

TransactionObjectInput | null

Returns

(tx): TransactionResult

Parameters
tx

Transaction

Returns

TransactionResult

Accessors

blockData

Get Signature

get blockData(): object

Deprecated

Use getData() instead.

Returns

object

version

version: 1

sender?

optional sender: string

expiration?

optional expiration: { Epoch: number; } | { None: true | null; } | null

gasConfig

gasConfig: object = GasConfig

gasConfig.budget?

optional budget: string | number | bigint

gasConfig.price?

optional price: string | number | bigint

gasConfig.payment?

optional payment: object[]

gasConfig.owner?

optional owner: string

inputs

inputs: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; })[]

transactions

transactions: ({ kind: "MoveCall"; target: `${string}::${string}::${string}`; typeArguments: string[]; arguments: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]; } | { kind: "TransferObjects"; objects: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]; address: { kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }; } | { kind: "SplitCoins"; coin: { kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }; amounts: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]; } | { kind: "MergeCoins"; destination: { kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }; sources: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]; } | { kind: "Publish"; modules: number[][]; dependencies: string[]; } | { kind: "Upgrade"; modules: number[][]; dependencies: string[]; packageId: string; ticket: { kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; }; } | { kind: "MakeMoveVec"; type: { Some: TypeTag; } | { None: true | null; }; objects: ({ kind: "Input"; index: number; value: unknown; type?: "object"; } | { kind: "Input"; index: number; value: unknown; type: "pure"; } | { kind: "GasCoin"; } | { kind: "Result"; index: number; } | { kind: "NestedResult"; index: number; resultIndex: number; })[]; })[]


pure

Get Signature

get pure(): {<Type>(type, 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]; }; u8: { $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: { $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: { $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: { $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: { $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: { $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: { $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: { $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: { $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]; }; 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]; }; vector: { $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]; }; option: { $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]; }; }

Returns

<Type>(type, 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]; }

Type Parameters
Type

Type extends PureTypeName

Parameters
type

Type extends PureTypeName ? ValidPureTypeName<Type> : Type

value

ShapeFromPureTypeName<Type>

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]; }

(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

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.

Uint8Array | SerializedBcs<any, any>

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()

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]; }

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]; }

u16()

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]; }

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]; }

u32()

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]; }

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()

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]; }

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]; }

u128()

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]; }

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]; }

u256()

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]; }

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]; }

bool()

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]; }

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()

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]; }

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()

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]; }

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]; }

id()

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]; }

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]; }

vector()

vector<Type>(type, 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]; }

Type Parameters
Type

Type extends PureTypeName

Parameters
type

Type extends PureTypeName ? ValidPureTypeName<Type> : Type

value

Iterable<ShapeFromPureTypeName<Type>, any, any> & object

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]; }

option()

option<Type>(type, 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]; }

Type Parameters
Type

Type extends PureTypeName

Parameters
type

Type extends PureTypeName ? ValidPureTypeName<Type> : Type

value

ShapeFromPureTypeName<Type> | null | undefined

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]; }


gas

Get Signature

get gas(): object

Returns an argument for the gas coin, to be used in a transaction.

Returns

object

$kind

$kind: "GasCoin"

GasCoin

GasCoin: true

Methods

fromKind()

static fromKind(serialized): 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


from()

static from(transaction): Transaction

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

transaction

string | Uint8Array | Transaction

Returns

Transaction


registerGlobalSerializationPlugin()

Call Signature

static registerGlobalSerializationPlugin(step): void

Parameters
step

TransactionPlugin

Returns

void

Deprecated

global plugins should be registered with a name

Call Signature

static registerGlobalSerializationPlugin(name, step): void

Parameters
name

string

step

TransactionPlugin

Returns

void

Deprecated

global plugins should be registered with a name


unregisterGlobalSerializationPlugin()

static unregisterGlobalSerializationPlugin(name): void

Parameters

name

string

Returns

void


registerGlobalBuildPlugin()

Call Signature

static registerGlobalBuildPlugin(step): void

Parameters
step

TransactionPlugin

Returns

void

Deprecated

global plugins should be registered with a name

Call Signature

static registerGlobalBuildPlugin(name, step): void

Parameters
name

string

step

TransactionPlugin

Returns

void

Deprecated

global plugins should be registered with a name


unregisterGlobalBuildPlugin()

static unregisterGlobalBuildPlugin(name): void

Parameters

name

string

Returns

void


addSerializationPlugin()

addSerializationPlugin(step): void

Parameters

step

TransactionPlugin

Returns

void


addBuildPlugin()

addBuildPlugin(step): void

Parameters

step

TransactionPlugin

Returns

void


addIntentResolver()

addIntentResolver(intent, resolver): void

Parameters

intent

string

resolver

TransactionPlugin

Returns

void


setSender()

setSender(sender): void

Parameters

sender

string

Returns

void


setSenderIfNotSet()

setSenderIfNotSet(sender): 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


setExpiration()

setExpiration(expiration?): void

Parameters

expiration?

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

Returns

void


setGasPrice()

setGasPrice(price): void

Parameters

price

number | bigint

Returns

void


setGasBudget()

setGasBudget(budget): void

Parameters

budget

number | bigint

Returns

void


setGasBudgetIfNotSet()

setGasBudgetIfNotSet(budget): void

Parameters

budget

number | bigint

Returns

void


setGasOwner()

setGasOwner(owner): void

Parameters

owner

string

Returns

void


setGasPayment()

setGasPayment(payments): void

Parameters

payments

object[]

Returns

void


getData()

getData(): object

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

Returns

object

version

version: 2

sender?

optional sender: string | null

expiration?

optional expiration: EnumOutputShapeWithKeys<{ None: true; Epoch: string | number; }, "None" | "Epoch"> | null

gasData

gasData: object = GasData

gasData.budget

budget: string | number | null

gasData.price

price: string | number | null

gasData.owner

owner: string | null

gasData.payment

payment: object[] | null

inputs

inputs: EnumOutputShapeWithKeys<{ Object: EnumOutputShapeWithKeys<{ ImmOrOwnedObject: { objectId: string; version: string | number; digest: string; }; SharedObject: { objectId: string; initialSharedVersion: string | number; mutable: boolean; }; Receiving: { objectId: string; version: string | number; digest: string; }; }, "ImmOrOwnedObject" | "SharedObject" | "Receiving">; Pure: { bytes: string; }; UnresolvedPure: { value: unknown; }; UnresolvedObject: { objectId: string; version?: string | number | null; digest?: string | null; initialSharedVersion?: string | number | null; mutable?: boolean | null; }; }, "Pure" | "Object" | "UnresolvedPure" | "UnresolvedObject">[]

commands

commands: EnumOutputShapeWithKeys<{ MoveCall: { package: string; module: string; function: string; typeArguments: string[]; 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]; })[]; _argumentTypes?: object[] | null; }; TransferObjects: { 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]; })[]; 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]; }; }; SplitCoins: { 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]; }; 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]; })[]; }; 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]; })[]; }; Publish: { modules: string[]; dependencies: string[]; }; MakeMoveVec: { type: string | null; 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]; })[]; }; Upgrade: { modules: string[]; dependencies: 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]; }; }; $Intent: { name: string; inputs: {[key: string]: { $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]; } | ({ $kind: "GasCoin"; GasCoin: true; } | { $kind: "Input"; Input: number; type?: ... | ...; } | { $kind: "Input"; Input: number; type?: ... | ...; } | { $kind: "Result"; Result: number; } | { $kind: "NestedResult"; NestedResult: [..., ...]; })[]; }; data: {[key: string]: unknown; }; }; }, "MoveCall" | "TransferObjects" | "SplitCoins" | "MergeCoins" | "Publish" | "MakeMoveVec" | "Upgrade" | "$Intent">[]


objectRef()

objectRef(...args): 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

args

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"


receivingRef()

receivingRef(...args): object

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

args

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"


sharedObjectRef()

sharedObjectRef(...args): object

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

args

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type: "object"


add()

add<T>(command): T

Add a transaction to the transaction

Type Parameters

T

T = TransactionResult

Parameters

command

Command | (tx) => T

Returns

T


splitCoins()

splitCoins<Amounts>(coin, amounts): object & { [K in string | number | symbol]: { $kind: "NestedResult"; NestedResult: [number, number] } }

Type Parameters

Amounts

Amounts extends (string | number | bigint | SerializedBcs<any, any> | TransactionArgument)[]

Parameters

coin

string | TransactionObjectArgument

amounts

Amounts

Returns

object & { [K in string | number | symbol]: { $kind: "NestedResult"; NestedResult: [number, number] } }


mergeCoins()

mergeCoins(destination, sources): TransactionResult

Parameters

destination

string | TransactionObjectArgument

sources

(string | TransactionObjectArgument)[]

Returns

TransactionResult


publish()

publish(__namedParameters): TransactionResult

Parameters

__namedParameters
modules

string[] | number[][]

dependencies

string[]

Returns

TransactionResult


upgrade()

upgrade(__namedParameters): TransactionResult

Parameters

__namedParameters
modules

string[] | number[][]

dependencies

string[]

package

string

ticket

string | TransactionObjectArgument

Returns

TransactionResult


moveCall()

moveCall(__namedParameters): TransactionResult

Parameters

__namedParameters

{ package: string; module: string; function: string; arguments?: (SerializedBcs<any, any> | TransactionArgument)[]; typeArguments?: string[]; } | { target: string; arguments?: (SerializedBcs<any, any> | TransactionArgument)[]; typeArguments?: string[]; }

Returns

TransactionResult


transferObjects()

transferObjects(objects, address): TransactionResult

Parameters

objects

(string | TransactionObjectArgument)[]

address

string | SerializedBcs<any, any> | TransactionArgument

Returns

TransactionResult


makeMoveVec()

makeMoveVec(__namedParameters): TransactionResult

Parameters

__namedParameters
elements

(string | TransactionObjectArgument)[]

type?

string

Returns

TransactionResult


serialize()

serialize(): string

Returns

string

Deprecated

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


toJSON()

toJSON(options?): Promise<string>

Parameters

options?

SerializeTransactionOptions = {}

Returns

Promise<string>


sign()

sign(options): Promise<SignatureWithBytes>

Build the transaction to BCS bytes, and sign it with the provided keypair.

Parameters

options

SignOptions

Returns

Promise<SignatureWithBytes>


build()

build(options?): Promise<Uint8Array>

Build the transaction to BCS bytes.

Parameters

options?

BuildTransactionOptions = {}

Returns

Promise<Uint8Array>


getDigest()

getDigest(options?): Promise<string>

Derive transaction digest

Parameters

options?
client?

IotaClient

Returns

Promise<string>


getSigningDigest()

getSigningDigest(): Promise<string>

Get the signing digest for transaction bytes. This is the Blake2b hash of the intent message that Ledger displays.

Returns

Promise<string>


prepareForSerialization()

prepareForSerialization(options): Promise<void>

Parameters

options

SerializeTransactionOptions

Returns

Promise<void>