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

    Class AllbridgeCoreSdk

    Index

    Constructors

    Properties

    lifiIntents: LifiIntentsService

    LI.FI Intents (Messenger.LIFI_INTENTS) quotes and orders, see LifiIntentsService.

    nearIntents: NearIntentsService

    NEAR Intents (Messenger.NEAR_INTENTS) quotes and deposits, see NearIntentsService.

    Do not use.

    utils: Utils

    Do not use.

    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>

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

      Parameters

      Returns Promise<string>

      Do not use.

    • Calculates the amount of tokens to be received as a result of transfer after applying the fee of the selected messenger. For Messenger.NEAR_INTENTS the amount is the amountOut of an EXACT_INPUT quote: live (the Core API waits for NEAR Intents solvers, about 3 s) or estimated from recent quotes on the route; see NearIntentsService.getQuote for minAmountOut and estimated. For Messenger.LIFI_INTENTS the amount is the amountOut of an EXACT_INPUT quote from the Core API; see LifiIntentsService.getQuote for the Allbridge fee.

      Parameters

      Returns Promise<string>

      CCTPDoesNotSupportedError, OFTDoesNotSupportedError, NearIntentsDoesNotSupportedError, LifiIntentsDoesNotSupportedError or SdkError if the route is not supported by the messenger; NearIntentsAmountTooLowError, NearIntentsNoLiquidityError or NearIntentsQuoteError if NEAR Intents has no quote; LifiIntentsAmountTooLowError, LifiIntentsAmountTooHighError, LifiIntentsNoQuoteError or LifiIntentsQuoteError if LI.FI Intents has no quote

    • 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

      • messenger: Messenger

        selected messenger

      • OptionalsourceProvider: Provider

        Optional. source chain Provider

      • OptionaldestinationProvider: Provider

        Optional. destination chain Provider

      Returns Promise<string>

      Do not use.

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

      Parameters

      Returns Promise<string>

      Do not use.

    • Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer after applying the fee of the selected messenger. For Messenger.NEAR_INTENTS the amount is the amountIn of an EXACT_OUTPUT quote: live (the Core API waits for NEAR Intents solvers, about 3 s) or estimated from recent quotes on the route; see NearIntentsService.getQuote for estimated. For Messenger.LIFI_INTENTS the amount is the amountIn of an EXACT_OUTPUT quote from the Core API (the Allbridge fee included); see LifiIntentsService.getQuote.

      Parameters

      Returns Promise<string>

      CCTPDoesNotSupportedError, OFTDoesNotSupportedError, NearIntentsDoesNotSupportedError, LifiIntentsDoesNotSupportedError or SdkError if the route is not supported by the messenger; NearIntentsAmountTooLowError, NearIntentsNoLiquidityError or NearIntentsQuoteError if NEAR Intents has no quote; LifiIntentsAmountTooLowError, LifiIntentsAmountTooHighError, LifiIntentsNoQuoteError or LifiIntentsQuoteError if LI.FI Intents has no quote

    • 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

      • messenger: Messenger

        selected messenger

      • OptionalsourceProvider: Provider

        Optional. source chain Provider

      • OptionaldestinationProvider: Provider

        Optional. destination chain Provider

      Returns Promise<string>

      Do not use.

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

    • Returns a list of tokens for liquidity pools operations 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: "pool"

        'pool'

      Returns Promise<TokenWithChainDetails[]>

      Do not use.

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

      • Optionaltype: "swap"

        Optional. 'swap' (tokens to send) is the only supported value and the default.

      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: "pool" | "swap"

        'swap' for tokens to send. The 'pool' value (liquidity pools operations) is deprecated. Do not use.

      Returns Promise<TokenWithChainDetails[]>