Class: Transfer

Represents a generic balance transfer in various lifecycle stages

Note

To create and submit new transfers, it is recommended to use the AccountAsset send method.

Constructors

Transfer(transactionHash, hasCompleted)

Create a Transfer instance for a unique transaction hash.

transactionHash

string

Unique transaction identifier provided by an underlying ledger.

hasCompleted

bool

Whether the transfer has alredy been completed i.e. in the case of historical transfers

Properties

transfer.asset

Asset

The AccountAsset used to initiate the tranfer

transfer.hasCompleted

bool

Whether the transfer has been completed on the underlying ledger.

transfer.params

Object

Parameters of the transfer with respect to the underlying asset.

transfer.transactionHash

string

The unique transaction identifier provided by the underlying ledger.

Methods

transfer.onCompleted()

Listens for a the transfer completion event. Resolves instantly if the transfer has aleady been completed as determined by the hasCompleted property.

Returns:Promise resolves when the transfer event has occurred.

Example

1
2
3
transfer.onCompleted().then(() => {
    console.log("Transfer has completed")
})