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>

  • Returns ChainDetailsMap containing a list of supported tokens groped by chain.

    Parameters

    • type: "swap" | "pool" = "swap"

      A string value which specifies ChainDetailsMap to retrieve. Can be either 'swap' for send or 'pool' for liquidity pools setup. Defaults to 'swap'.

    Returns Promise<ChainDetailsMap>

  • Check address and show gas balance

    Deprecated

    Parameters

    • chainSymbol: string

      The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: ChainSymbol.

    • recipientAddress: string
    • Optional tokenAddress: string

    Returns Promise<CheckAddressResponse>

  • 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

  • Get gas balance

    Parameters

    • chainSymbol: string

      The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: ChainSymbol.

    • address: string

    Returns Promise<GasBalanceResponse>

  • Fetches information about tokens transfer by chosen chainSymbol and transaction Id from the Allbridge Core API.

    Parameters

    • chainSymbol: string

      The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: ChainSymbol.

    • txId: string

    Returns Promise<TransferStatusResponse>

  • 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>

  • Returns a list of supported tokens.

    Returns

    A promise that resolves to an array of TokenWithChainDetails.

    Parameters

    • type: "swap" | "pool" = "swap"

      A string value which specifies a set of tokens to retrieve. Can be either 'swap' for tokens to send or 'pool' for liquidity pools operations. Defaults to 'swap'.

    Returns Promise<TokenWithChainDetails[]>

  • Returns a list of supported tokens on the selected chain.

    Parameters

    • chainSymbol: string

      The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: ChainSymbol.

    • type: "swap" | "pool" = "swap"

      A string value which specifies a set of tokens to retrieve. Can be either 'swap' for tokens to send or 'pool' for liquidity pools operations. Defaults to 'swap'.

    Returns Promise<TokenWithChainDetails[]>

Generated using TypeDoc