Hierarchy

  • AllbridgeCoreSdk

Constructors

Properties

service: AllbridgeCoreSdkService
utils: Utils

Methods

  • Convert APR to percentage view

    Returns

    aprPercentageView

    Parameters

    • apr: string

    Returns string

  • Deprecated

    Calculates the percentage of fee that is charged when swapping to the selected destination chain. The destination chain fee percent applies to the amount after the source chain fee. (Does not include fee related to the source chain. Does not include gas fee)

    See

    calculateFeePercentOnSourceChain

    Returns

    fee percent

    Parameters

    • amountFloat: BigSource

      initial amount of tokens to swap

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    Returns Promise<number>

  • Deprecated

    Calculates the percentage of fee from the initial amount that is charged when swapping from the selected source chain. (Does not include fee related to the destination chain. Does not include gas fee)

    Returns

    fee percent

    Parameters

    • amountFloat: BigSource

      initial amount of tokens to swap

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    Returns Promise<number>

  • Calculates the amount of tokens to be received as a result of transfer.

    Parameters

    • amountToSendFloat: BigSource

      the amount of tokens that will be sent

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • Optional messenger: Messenger

      Optional. selected messenger

    Returns Promise<string>

  • Calculates the amount of tokens to be received as a result of transfer based on actual blockchain pool state.

    Parameters

    • amountToSendFloat: BigSource

      the amount of tokens that will be sent

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • Optional messenger: Messenger

      Optional. selected messenger

    • Optional sourceProvider: Provider

      Optional. source chain Provider

    • Optional destinationProvider: Provider

      Optional. destination chain Provider

    Returns Promise<string>

  • Calculates the amount of tokens to be received as a result of transfer based on passed pool state.

    Parameters

    • amountToSendFloat: BigSource

      the amount of tokens that will be sent

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • sourcePool: PoolInfo

      source token pool state

    • destinationPool: PoolInfo

      destination token pool state

    • Optional messenger: Messenger

      Optional. selected messenger

    Returns string

  • Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer.

    Parameters

    • amountToBeReceivedFloat: BigSource

      the amount of tokens that should be received

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • Optional messenger: Messenger

      Optional. selected messenger

    Returns Promise<string>

  • Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on actual blockchain pool state.

    Parameters

    • amountToBeReceivedFloat: BigSource

      the amount of tokens that should be received

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • Optional messenger: Messenger

      Optional. selected messenger

    • Optional sourceProvider: Provider

      Optional. source chain Provider

    • Optional destinationProvider: Provider

      Optional. destination chain Provider

    Returns Promise<string>

  • Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on passed pool state.

    Parameters

    • amountToBeReceivedFloat: BigSource

      the amount of tokens that should be received

    • sourceChainToken: TokenWithChainDetails

      selected token on the source chain

    • destinationChainToken: TokenWithChainDetails

      selected token on the destination chain

    • sourcePool: PoolInfo

      source token pool state

    • destinationPool: PoolInfo

      destination token pool state

    • Optional messenger: Messenger

      Optional. selected messenger

    Returns string

  • Gets the average time in ms to complete a transfer for given tokens and messenger.

    Returns

    Average transfer time in milliseconds or null if a given combination of tokens and messenger is not supported.

    Parameters

    Returns null | number

  • Forces refresh of cached information about the state of liquidity pools. Outdated cache leads to calculated amounts being less accurate. The cache is invalidated at regular intervals, but it can be forced to be refreshed by calling this method.+

    Parameters

    Returns Promise<void>

Generated using TypeDoc