Class

TransferOperationBuilder

TransferOperationBuilder()

Structure that enables clients to construct complex transfers.

Constructor

# new TransferOperationBuilder()

View Source pkg/wasm.js, line 2134

Methods

# static new() → {TransferOperationBuilder}

Create a new transfer operation builder.

View Source pkg/wasm.js, line 2153

# add_cosignature(kp) → {TransferOperationBuilder}

Co-sign an input index

Parameters:
Name Type Description
kp XfrKeyPair

Co-signature key.

View Source pkg/wasm.js, line 2370

# add_input_no_tracking(txo_ref, asset_record, owner_memo, key, amount, owner_memo) → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to add an input to a transfer operation builder.

Parameters:
Name Type Description
txo_ref TxoRef

Absolute or relative utxo reference

asset_record string

Serialized client asset record to serve as transfer input. This record must exist on the ledger for the transfer to be valid

owner_memo OwnerMemo

Opening parameters.

key XfrKeyPair

Key pair associated with the input.

amount BigInt

Amount of input record to transfer or TxoRef.create_relative_txo_ref for details on txo references.

owner_memo OwnerMemo | undefined
See:

View Source pkg/wasm.js, line 2239

Will throw an error if oar or txo_ref fail to deserialize.

# add_input_with_tracking(txo_ref, asset_record, owner_memo, tracing_key, key, amount, owner_memo) → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to add an input to a transfer operation builder.

Parameters:
Name Type Description
txo_ref TxoRef

Absolute or relative utxo reference

asset_record string

Serialized client asset record to serve as transfer input. This record must exist on the ledger for the transfer to be valid.

owner_memo OwnerMemo

Opening parameters.

tracing_key AssetTracerKeyPair

Tracing key, must be added to traceable assets.

key XfrKeyPair

Key pair associated with the input.

amount BigInt

Amount of input record to transfer.

owner_memo OwnerMemo | undefined
See:
  • TxoRef.create_absolute_txo_ref or TxoRef.create_relative_txo_ref for details on txo references.
  • Network.getUtxo for details on fetching blind asset records.

View Source pkg/wasm.js, line 2197

Will throw an error if oar or txo_ref fail to deserialize.

# add_output_no_tracking(amount, recipient, code, conf_amount, conf_type) → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to add an output to a transfer operation builder.

Parameters:
Name Type Description
amount BigInt

amount to transfer to the recipient

recipient XfrPublicKey

public key of the recipient

code string

String representaiton of the asset token code

conf_amount boolean

true means the output's asset amount is confidential, and false means it's nonconfidential.

conf_type boolean

true means the output's asset type is confidential, and false means it's nonconfidential.

View Source pkg/wasm.js, line 2309

Will throw an error if code fails to deserialize.

# add_output_with_tracking(amount, recipient, tracing_key, code, conf_amount, conf_type) → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to add an output to a transfer operation builder.

Parameters:
Name Type Description
amount BigInt

amount to transfer to the recipient.

recipient XfrPublicKey

public key of the recipient.

tracing_key AssetTracerKeyPair

Optional tracing key, must be added to traced assets.

code string

String representation of the asset token code.

conf_amount boolean

true means the output's asset amount is confidential, and false means it's nonconfidential.

conf_type boolean

true means the output's asset type is confidential, and false means it's nonconfidential.

View Source pkg/wasm.js, line 2280

Will throw an error if code fails to deserialize.

# balance() → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to ensure the transfer inputs and outputs are balanced. This function will add change outputs for all unspent portions of input records.

View Source pkg/wasm.js, line 2327

Will throw an error if the transaction cannot be balanced.

# builder() → {string}

View Source pkg/wasm.js, line 2380

string

# create() → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to finalize the transaction.

View Source pkg/wasm.js, line 2340

Will throw an error if input and output amounts do not add up.

Will throw an error if not all record owners have signed the transaction.

# sign(kp) → {TransferOperationBuilder}

Wraps around TransferOperationBuilder to add a signature to the operation.

All input owners must sign.

Parameters:
Name Type Description
kp XfrKeyPair

key pair of one of the input owners.

View Source pkg/wasm.js, line 2355

# transaction() → {string}

Wraps around TransferOperationBuilder to extract an operation expression as JSON.

View Source pkg/wasm.js, line 2397

string