Hierarchy

  • pTokensSwap

Constructors

Properties

_amount: BigNumber
_destinationAssets: DestinationInfo[]
_sourceAsset: pTokensAsset
controller: AbortController

Accessors

Methods

  • Execute a swap. The function returns a PromiEvent, i.e. a Promise that can also emit events. In particular, the events fired during the execution are the following:

    • depositAddress -> fired with the deposit address where a user would transfer the source asset (applies for source pTokensUtxoAsset only);
    • inputTxBroadcasted -> fired with hash of the transaction initiating the swap when it is broadcasted;
    • inputTxConfirmed -> fired with hash of the transaction initiating the swap when it is confirmed;
    • inputTxDetected -> fired with a InnerTransactionStatus object related to the input transaction, when the pNetwork detects the swap request;
    • outputTxDetected -> fired with a InnerTransactionStatus object related to the output transaction, when the pNetwork builds the output transaction;
    • outputTxBroadcasted -> fired with a InnerTransactionStatus object related to the output transaction, when the pNetwork broadcasts the output transaction;
    • outputTxConfirmed -> fired with a InnerTransactionStatus object related to the output transaction, when it is confirmed, only when the destination asset has a provider;

    Returns

    A PromiEvent that resolves with the transaction status of the resulting output transactions. If the destination asset has a provider, the PromiEvent resolves when the output transaction is confirmed; otherwise when it is broadcasted.

    Returns default<InnerTransactionStatus[]>

Generated using TypeDoc