@allbridge/bridge-core-sdk
    Preparing search index...

    Class AllbridgeCoreSdk

    Index

    Constructors

    Properties

    Do not use.

    utils: Utils

    Methods

    • Convert APR to percentage view

      Parameters

      • apr: string

      Returns string

      aprPercentageView

      Do not use.

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

      fee percent

      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)

    • Parameters

      • amountFloat: BigSource

        initial amount of tokens to swap

      • sourceChainToken: TokenWithChainDetails

        selected token on the source chain

      Returns Promise<number>

      fee percent

      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)

    • Check address and show 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.

      • _recipientAddress: string
      • Optional_tokenAddress: string

      Returns Promise<CheckAddressResponse>

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

      Parameters

      Returns number | null

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

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

      Do not use.