Skip to main content

Transaction

@iota/iota-sdk


@iota/iota-sdk / transactions / Transaction

Class: Transaction

Defined in: sdk/typescript/src/transactions/Transaction.ts:137

Transaction Builder

Indexable

[key: number]: boolean

Constructors

Constructor

new Transaction(): Transaction

Defined in: sdk/typescript/src/transactions/Transaction.ts:301

Returns

Transaction

Properties

object

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

Defined in: sdk/typescript/src/transactions/Transaction.ts:316

Add a new object input to the transaction.

Parameters

value

TransactionObjectInput

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"

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

random()

random(): object

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"

Accessors

gas

Get Signature

get gas(): object

Defined in: sdk/typescript/src/transactions/Transaction.ts:309

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

Returns

object

$kind

$kind: "GasCoin"

GasCoin

GasCoin: true


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]; }; 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: { $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]; }; 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]; }; 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]; }; 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]; }; 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]; }; 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]; }; 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]; }; 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]; }; 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]; }; }

Defined in: sdk/typescript/src/transactions/Transaction.ts:273

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

Uint8Array<ArrayBufferLike> | 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

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

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

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

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

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

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

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

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

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

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

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

Methods

add()

add<T>(command): T

Defined in: sdk/typescript/src/transactions/Transaction.ts:379

Add a transaction to the transaction

Type Parameters

T

T = TransactionResult

Parameters

command

Command | ((tx) => T)

Returns

T


addBuildPlugin()

addBuildPlugin(step): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:212

Parameters

step

TransactionPlugin

Returns

void


addIntentResolver()

addIntentResolver(intent, resolver): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:216

Parameters

intent

string

resolver

TransactionPlugin

Returns

void


addSerializationPlugin()

addSerializationPlugin(step): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:208

Parameters

step

TransactionPlugin

Returns

void


build()

build(options?): Promise<Uint8Array<ArrayBufferLike>>

Defined in: sdk/typescript/src/transactions/Transaction.ts:546

Build the transaction to BCS bytes.

Parameters

options?

BuildTransactionOptions = {}

Returns

Promise<Uint8Array<ArrayBufferLike>>


getData()

getData(): object

Defined in: sdk/typescript/src/transactions/Transaction.ts:262

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

Returns

object

commands

commands: EnumOutputShapeWithKeys<{ $Intent: { data: {[key: string]: unknown; }; 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: [..., ...]; })[]; }; 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: string | null; }; 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?: object[] | null; 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?

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

gasData

gasData: object = GasData

gasData.budget

budget: string | number | null

gasData.owner

owner: string | null

gasData.payment

payment: object[] | null

gasData.price

price: string | number | null

inputs

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?: string | null; initialSharedVersion?: string | number | null; mutable?: boolean | null; objectId: string; version?: string | number | null; }; UnresolvedPure: { value: unknown; }; }, "Pure" | "Object" | "UnresolvedPure" | "UnresolvedObject">[]

sender?

optional sender?: string | null

version

version: 2


getDigest()

getDigest(options?): Promise<string>

Defined in: sdk/typescript/src/transactions/Transaction.ts:556

Derive transaction digest

Parameters

options?
client?

IotaClient

Returns

Promise<string>


getSigningDigest()

getSigningDigest(): Promise<string>

Defined in: sdk/typescript/src/transactions/Transaction.ts:569

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

Returns

Promise<string>


makeMoveVec()

makeMoveVec(__namedParameters): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:514

Parameters

__namedParameters
elements

(string | TransactionObjectArgument)[]

type?

string

Returns

TransactionResult


mergeCoins()

mergeCoins(destination, sources): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:437

Parameters

destination

string | TransactionObjectArgument

sources

(string | TransactionObjectArgument)[]

Returns

TransactionResult


moveCall()

moveCall(__namedParameters): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:476

Parameters

__namedParameters

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

Returns

TransactionResult


objectRef()

objectRef(...args): object

Defined in: sdk/typescript/src/transactions/Transaction.ts:358

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

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type?: "object"


prepareForSerialization()

prepareForSerialization(options): Promise<void>

Defined in: sdk/typescript/src/transactions/Transaction.ts:624

Parameters

options

SerializeTransactionOptions

Returns

Promise<void>


publish()

publish(__namedParameters): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:448

Parameters

__namedParameters
dependencies

string[]

modules

string[] | number[][]

Returns

TransactionResult


receivingRef()

receivingRef(...args): object

Defined in: sdk/typescript/src/transactions/Transaction.ts:366

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

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type?: "object"


setExpiration()

setExpiration(expiration?): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:236

Parameters

expiration?

EnumSchemaInput<{ Epoch: SchemaWithPipe<readonly [UnionSchema<[StringSchema<undefined>, SchemaWithPipe<readonly [NumberSchema<undefined>, IntegerAction<number, undefined>]>], undefined>, CheckAction<string | number, "Invalid u64">]>; None: LiteralSchema<true, undefined>; }> | null

Returns

void


setGasBudget()

setGasBudget(budget): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:242

Parameters

budget

number | bigint

Returns

void


setGasBudgetIfNotSet()

setGasBudgetIfNotSet(budget): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:246

Parameters

budget

number | bigint

Returns

void


setGasOwner()

setGasOwner(owner): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:252

Parameters

owner

string

Returns

void


setGasPayment()

setGasPayment(payments): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:255

Parameters

payments

object[]

Returns

void


setGasPrice()

setGasPrice(price): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:239

Parameters

price

number | bigint

Returns

void


setSender()

setSender(sender): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:224

Parameters

sender

string

Returns

void


setSenderIfNotSet()

setSenderIfNotSet(sender): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:231

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


sharedObjectRef()

sharedObjectRef(...args): object

Defined in: sdk/typescript/src/transactions/Transaction.ts:374

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

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

Returns

object

$kind

$kind: "Input"

Input

Input: number

type?

optional type?: "object"


sign()

sign(options): Promise<SignatureWithBytes>

Defined in: sdk/typescript/src/transactions/Transaction.ts:539

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

Parameters

options

SignOptions

Returns

Promise<SignatureWithBytes>


splitCoins()

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

Defined in: sdk/typescript/src/transactions/Transaction.ts:410

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


toJSON()

toJSON(options?): Promise<string>

Defined in: sdk/typescript/src/transactions/Transaction.ts:529

Parameters

options?

SerializeTransactionOptions = {}

Returns

Promise<string>


transferObjects()

transferObjects(objects, address): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:500

Parameters

objects

(string | TransactionObjectArgument)[]

address

string | SerializedBcs<any, any> | TransactionArgument

Returns

TransactionResult


upgrade()

upgrade(__namedParameters): TransactionResult

Defined in: sdk/typescript/src/transactions/Transaction.ts:456

Parameters

__namedParameters
dependencies

string[]

modules

string[] | number[][]

package

string

ticket

string | TransactionObjectArgument

Returns

TransactionResult


from()

static from(transaction): Transaction

Defined in: sdk/typescript/src/transactions/Transaction.ts:162

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<ArrayBufferLike> | Transaction

Returns

Transaction


fromKind()

static fromKind(serialized): Transaction

Defined in: sdk/typescript/src/transactions/Transaction.ts:146

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<ArrayBufferLike>

Returns

Transaction


registerGlobalBuildPlugin()

static registerGlobalBuildPlugin(name, step): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:193

Parameters

name

string

step

TransactionPlugin

Returns

void


registerGlobalSerializationPlugin()

static registerGlobalSerializationPlugin(name, step): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:178

Parameters

name

string

step

TransactionPlugin

Returns

void


unregisterGlobalBuildPlugin()

static unregisterGlobalBuildPlugin(name): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:204

Parameters

name

string

Returns

void


unregisterGlobalSerializationPlugin()

static unregisterGlobalSerializationPlugin(name): void

Defined in: sdk/typescript/src/transactions/Transaction.ts:189

Parameters

name

string

Returns

void