Methods
# static new() → {TransferOperationBuilder}
Create a new transfer operation builder.
# add_cosignature(kp) → {TransferOperationBuilder}
Co-sign an input index
Parameters:
Name | Type | Description |
---|---|---|
kp |
XfrKeyPair | Co-signature key. |
# 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:
-
- Network.getUtxo for details on fetching blind asset records.
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.
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 |
|
conf_type |
boolean |
|
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 |
|
conf_type |
boolean |
|
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.
Will throw an error if the transaction cannot be balanced.
# create() → {TransferOperationBuilder}
Wraps around TransferOperationBuilder to finalize the transaction.
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. |
# transaction() → {string}
Wraps around TransferOperationBuilder to extract an operation expression as JSON.