Constructors

Properties

stacksAddressFromStacksToken: ((chain: `${string} (XLinkSDK ChainId)`, token:
    | "stx-susdt (XLinkSDK TokenId)"
    | "stx-slunr (XLinkSDK TokenId)"
    | "stx-abtc (XLinkSDK TokenId)"
    | "stx-alex (XLinkSDK TokenId)"
    | "stx-ssko (XLinkSDK TokenId)"
    | "stx-vlistx (XLinkSDK TokenId)"
    | "stx-vlialex (XLinkSDK TokenId)"
    | "stx-ubtc (XLinkSDK TokenId)"
    | "stx-db20 (XLinkSDK TokenId)"
    | "stx-dog (XLinkSDK TokenId)") => Promise<undefined | StacksContractAddress>) = stacksAddressFromStacksToken

Type declaration

    • (chain, token): Promise<undefined | StacksContractAddress>
    • This function retrieves the contract address associated with a specific token on the Stacks blockchain.

      Parameters

      • chain: `${string} (XLinkSDK ChainId)`

        The ID of the Stacks blockchain.

      • token:
            | "stx-susdt (XLinkSDK TokenId)"
            | "stx-slunr (XLinkSDK TokenId)"
            | "stx-abtc (XLinkSDK TokenId)"
            | "stx-alex (XLinkSDK TokenId)"
            | "stx-ssko (XLinkSDK TokenId)"
            | "stx-vlistx (XLinkSDK TokenId)"
            | "stx-vlialex (XLinkSDK TokenId)"
            | "stx-ubtc (XLinkSDK TokenId)"
            | "stx-db20 (XLinkSDK TokenId)"
            | "stx-dog (XLinkSDK TokenId)"

        The specific token ID for which the contract address is to be retrieved.

      Returns Promise<undefined | StacksContractAddress>

      A promise that resolves with the contract address associated with the specified token, or undefined if the chain is not a Stacks chain or if the contract address cannot be retrieved.

stacksAddressToStacksToken: ((chain: `${string} (XLinkSDK ChainId)`, address: StacksContractAddress) => Promise<undefined | StacksToken>) = stacksAddressToStacksToken

Type declaration

    • (chain, address): Promise<undefined | StacksToken>
    • This function maps a given Stacks contract address to its corresponding known token ID.

      Parameters

      • chain: `${string} (XLinkSDK ChainId)`

        The ID of the Stacks blockchain.

      • address: StacksContractAddress

        The contract address on the Stacks blockchain.

      Returns Promise<undefined | StacksToken>

      A promise that resolves with the known token ID corresponding to the provided contract address, or undefined if the chain is not a Stacks chain or if the token ID cannot be found.

Methods

  • Parameters

    • fromChain: `${string} (XLinkSDK ChainId)`
    • toChain: `${string} (XLinkSDK ChainId)`

    Returns Promise<undefined | {
        address: string;
        scriptPubKey: Uint8Array;
    }>

  • Parameters

    • chain: `${string} (XLinkSDK ChainId)`
    • token: "a brc20 token (XLinkSDK TokenId)"

    Returns Promise<undefined | string>

  • Parameters

    • chain: `${string} (XLinkSDK ChainId)`
    • tick: string

    Returns Promise<undefined | "a brc20 token (XLinkSDK TokenId)">

  • This function facilitates the transfer of tokens from the Bitcoin network to other supported blockchain networks. It checks the validity of the route and then calls the appropriate bridging function based on the destination chain.

    Parameters

    • input: BridgeFromBitcoinInput

      An object containing the input parameters required for the bridging operation:

      • fromChain: ChainId - The ID of the source blockchain.
      • toChain: ChainId - The ID of the destination blockchain (Stacks, EVM, etc.).
      • fromToken: TokenId - The token being transferred from the Bitcoin network.
      • toToken: TokenId - The token expected on the destination chain.
      • fromAddress: string - The source address on the Bitcoin network.
      • fromAddressScriptPubKey: Uint8Array - The script public key corresponding to the fromAddress.
      • toAddress: string - The recipient's address on the destination blockchain.
      • amount: SDKNumber - The amount of tokens to transfer.
      • networkFeeRate: bigint - The network fee rate to be used for the transaction.
      • reselectSpendableUTXOs: ReselectSpendableUTXOsFn.
      • signPsbt: BridgeFromBitcoinInput_signPsbtFn.

    Returns Promise<BridgeFromBitcoinOutput>

    A promise that resolves with the transaction ID (tx) of the bridging operation.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function facilitates the transfer of tokens from an EVM-compatible blockchain to other supported blockchain networks, including Stacks, Bitcoin, and other EVM-compatible chains. It validates the route and calls the appropriate bridging function based on the destination chain and tokens involved.

    Parameters

    • input: BridgeFromEVMInput

      An object containing the input parameters required for the bridging operation:

      • fromChain: ChainId - The ID of the source blockchain (an EVM-compatible chain in this case).
      • toChain: ChainId - The ID of the destination blockchain (Stacks, Bitcoin, or another EVM-compatible chain).
      • fromToken: TokenId - The token being transferred from the EVM-compatible blockchain.
      • toToken: TokenId - The token expected on the destination chain.
      • fromAddress: string - The sender's address on the source chain.
      • toAddress: string - The recipient's address on the destination blockchain.
      • toAddressScriptPubKey?: Uint8Array - The script public key for the toAddress, required when the destination is a Bitcoin chain.
      • amount: SDKNumber - The amount of tokens to transfer.
      • sendTransaction - // Implementation for sending transaction from EVM chain.

    Returns Promise<BridgeFromEVMOutput>

    A promise that resolves with the transaction hash (txHash) of the bridging operation.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function facilitates the transfer of tokens from the Stacks network to other supported blockchain networks, including Bitcoin and EVM-compatible chains. It validates the route and calls the appropriate bridging function based on the destination chain and tokens involved.

    Parameters

    • input: BridgeFromStacksInput

      An object containing the input parameters required for the bridging operation:

      • fromChain: ChainId - The ID of the source blockchain.
      • toChain: ChainId - The ID of the destination blockchain (Bitcoin, EVM, etc.).
      • fromToken: TokenId - The token being transferred from the source chain.
      • toToken: TokenId - The token expected on the destination chain.
      • fromAddress: string - The sender's address on the source chain.
      • toAddress: string - The recipient's address on the destination blockchain.
      • amount: SDKNumber - The amount of tokens to transfer.
      • sendTransaction - // Implementation for sending transaction from Stacks mainnet.

    Returns Promise<BridgeFromStacksOutput>

    A promise that resolves with the transaction ID (txid) of the bridging operation.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function provides detailed information about token transfers from the Bitcoin network to other supported blockchain networks, including Stacks and EVM-compatible chains. It verifies the validity of the transfer route and retrieves bridge information based on the destination chain.

    Returns Promise<BridgeInfoFromBitcoinOutput>

    A promise that resolves with an object containing detailed information about the token transfer, including:

    • fromChain: KnownChainId.KnownChain - The source blockchain.
    • fromToken: KnownTokenId.KnownToken - The token being transferred from the Bitcoin network.
    • toChain: KnownChainId.KnownChain - The destination blockchain.
    • toToken: KnownTokenId.KnownToken - The token expected on the destination chain.
    • fromAmount: SDKNumber - The amount of tokens being transferred.
    • toAmount: SDKNumber - The amount of tokens expected on the destination chain after the transfer.
    • feeAmount: SDKNumber - The fee amount deducted during the transfer.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains is unsupported.

  • This function provides detailed information about token transfers from an EVM-compatible blockchain to other supported blockchain networks, including Stacks, Bitcoin, and other EVM-compatible chains. It verifies the validity of the transfer route and retrieves bridge information based on the destination chain and tokens.

    Parameters

    • input: BridgeInfoFromEVMInput

      An object containing the input parameters required for retrieving bridge information:

      • fromChain: ChainId - The ID of the source blockchain (Stacks in this case).
      • toChain: ChainId - The ID of the destination blockchain (Bitcoin, EVM-compatible chains, etc.).
      • fromToken: TokenId - The token being transferred from the Stacks network.
      • toToken: TokenId - The token expected on the destination chain.
      • amount: SDKNumber - The amount of tokens involved in the transfer.

    Returns Promise<BridgeInfoFromEVMOutput>

    A promise that resolves with an object containing detailed information about the token transfer, including:

    • fromChain: KnownChainId.KnownChain - The source blockchain.
    • fromToken: KnownTokenId.KnownToken - The token being transferred from the Stacks network.
    • toChain: KnownChainId.KnownChain - The destination blockchain.
    • toToken: KnownTokenId.KnownToken - The token expected on the destination chain.
    • fromAmount: SDKNumber - The amount of tokens being transferred.
    • toAmount: SDKNumber - The amount of tokens expected on the destination chain after the transfer.
    • feeAmount: SDKNumber - The fee amount deducted during the transfer.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function provides detailed information about token transfers from the Stacks network to other supported blockchain networks, including Bitcoin and EVM-compatible chains. It verifies the validity of the transfer route and retrieves bridge information based on the destination chain and tokens.

    Parameters

    • input: BridgeInfoFromStacksInput

      An object containing the input parameters required for retrieving bridge information:

      • fromChain: ChainId - The ID of the source blockchain (Stacks in this case).
      • toChain: ChainId - The ID of the destination blockchain (Bitcoin, EVM-compatible chains, etc.).
      • fromToken: TokenId - The token being transferred from the Stacks network.
      • toToken: TokenId - The token expected on the destination chain.
      • amount: SDKNumber - The amount of tokens involved in the transfer.

    Returns Promise<BridgeInfoFromStacksOutput>

    A promise that resolves with an object containing detailed information about the token transfer, including:

    • fromChain: KnownChainId.KnownChain - The source blockchain.
    • fromToken: KnownTokenId.KnownToken - The token being transferred from the Stacks network.
    • toChain: KnownChainId.KnownChain - The destination blockchain.
    • toToken: KnownTokenId.KnownToken - The token expected on the destination chain.
    • fromAmount: SDKNumber - The amount of tokens being transferred.
    • toAmount: SDKNumber - The amount of tokens expected on the destination chain after the transfer.
    • feeAmount: SDKNumber - The fee amount deducted during the transfer.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function facilitates the claiming of time-locked assets on EVM-compatible chains. It uses smart contract functions to execute the release of locked assets based on predefined conditions.

    Parameters

    • input: ClaimTimeLockedAssetsInput

      An object containing the input parameters required for claiming time-locked assets:

      • chain: KnownChainId.EVMChain - The ID of the EVM-compatible blockchain where the assets are locked.
      • lockedAssetIds: string[] - An array of IDs representing the locked assets to be claimed.
      • sendTransaction - // Implementation for sending transaction from EVM chain.

    Returns Promise<undefined | ClaimTimeLockedAssetsOutput>

    A promise that resolves with the transaction hash (txHash) of the claiming operation, or undefined if the operation fails.

    UnsupportedChainError - If the provided EVM chain is unsupported or invalid.

  • This function estimates the transaction fee and vSize for move or swap tokens from the Bitcoin network to other supported blockchain networks, including Stacks and EVM-compatible chains.

    Parameters

    • input: EstimateBridgeTransactionFromBitcoinInput

      An object containing the input parameters required for estimating the transaction:

      • fromChain: ChainId - The ID of the source blockchain (Bitcoin in this case).
      • toChain: ChainId - The ID of the destination blockchain (Stacks, EVM-compatible chains, etc.).
      • fromToken: TokenId - The token being transferred from the Bitcoin network.
      • toToken: TokenId - The token expected on the destination chain.
      • fromAddress: string - The source address on the Bitcoin network.
      • fromAddressScriptPubKey: Uint8Array - The script public key of the source address.
      • toAddress: string - The destination address on the target blockchain.
      • amount: SDKNumber - The amount of tokens to be transferred.
      • networkFeeRate: bigint - The fee rate for the Bitcoin network.
      • reselectSpendableUTXOs - // Implementation for reselect UTXOs.

    Returns Promise<EstimateBridgeTransactionFromBitcoinOutput>

    A promise that resolves with an object containing the estimated transaction details:

    • fee: SDKNumber - The estimated transaction fee.
    • estimatedVSize: SDKNumber - The estimated vSize of the transaction.

    UnsupportedBridgeRouteError - If the provided route between the source and destination chains or tokens is unsupported.

  • This function retrieves the contract address of a specific token on a given EVM-compatible blockchain.

    Parameters

    • chain: `${string} (XLinkSDK ChainId)`

      The ID of the EVM-compatible blockchain where the token contract is deployed.

    • token:
          | "evm-susdt (XLinkSDK TokenId)"
          | "evm-usdt (XLinkSDK TokenId)"
          | "evm-usdc (XLinkSDK TokenId)"
          | "evm-abtc (XLinkSDK TokenId)"
          | "evm-wbtc (XLinkSDK TokenId)"
          | "evm-btcb (XLinkSDK TokenId)"
          | "evm-cbbtc (XLinkSDK TokenId)"
          | "evm-lunr (XLinkSDK TokenId)"
          | "evm-alex (XLinkSDK TokenId)"
          | "evm-sko (XLinkSDK TokenId)"
          | "evm-vlistx (XLinkSDK TokenId)"
          | "evm-vlialex (XLinkSDK TokenId)"
          | "evm-ubtc (XLinkSDK TokenId)"
          | "evm-wubtc (XLinkSDK TokenId)"
          | "evm-db20 (XLinkSDK TokenId)"
          | "evm-dog (XLinkSDK TokenId)"

      The specific token ID for which the contract address is to be retrieved.

    Returns Promise<undefined | `0x${string}` | typeof evmNativeCurrencyAddress>

    A promise that resolves with the contract address of the token, or undefined if the chain is not EVM-compatible or if the contract address cannot be retrieved.

  • This function maps a given contract address on an EVM-compatible blockchain to its corresponding known token ID.

    Parameters

    • chain: `${string} (XLinkSDK ChainId)`

      The ID of the EVM-compatible blockchain where the contract is deployed.

    • address: `0x${string}` | typeof evmNativeCurrencyAddress

      The contract address on the EVM-compatible blockchain.

    Returns Promise<
        | undefined
        | "evm-susdt (XLinkSDK TokenId)"
        | "evm-usdt (XLinkSDK TokenId)"
        | "evm-usdc (XLinkSDK TokenId)"
        | "evm-abtc (XLinkSDK TokenId)"
        | "evm-wbtc (XLinkSDK TokenId)"
        | "evm-btcb (XLinkSDK TokenId)"
        | "evm-cbbtc (XLinkSDK TokenId)"
        | "evm-lunr (XLinkSDK TokenId)"
        | "evm-alex (XLinkSDK TokenId)"
        | "evm-sko (XLinkSDK TokenId)"
        | "evm-vlistx (XLinkSDK TokenId)"
        | "evm-vlialex (XLinkSDK TokenId)"
        | "evm-ubtc (XLinkSDK TokenId)"
        | "evm-wubtc (XLinkSDK TokenId)"
        | "evm-db20 (XLinkSDK TokenId)"
        | "evm-dog (XLinkSDK TokenId)">

    A promise that resolves with the known token ID corresponding to the provided contract address, or undefined if the token ID cannot be found or if the chain is not EVM-compatible.

  • This function retrieves the contract address of a specific type of contract (e.g., a bridge endpoint) on a given EVM-compatible blockchain.

    Parameters

    • chain: `${string} (XLinkSDK ChainId)`

      The ID of the EVM-compatible blockchain where the contract is deployed.

    • contractType: "BridgeEndpoint"

      The type of contract (e.g., PublicEVMContractType.BridgeEndpoint) for which the address is to be retrieved.

    Returns Promise<undefined | `0x${string}`>

    A promise that resolves with the contract address of the specified type, or undefined if the chain is not EVM-compatible or if the address cannot be retrieved.

  • This function retrieves the list of supported routes for token transfers between blockchain networks, filtered based on optional conditions. It aggregates the results from different blockchain networks (Stacks, EVM, Bitcoin) to return a list of possible routes.

    Parameters

    • Optionalconditions: GetSupportedRoutesFn_Conditions

      An optional object containing the conditions for filtering the supported routes:

      • fromChain?: ChainId - The ID of the source blockchain (optional).
      • toChain?: ChainId - The ID of the destination blockchain (optional).
      • fromToken?: TokenId - The ID of the token being transferred from the source blockchain (optional).
      • toToken?: TokenId - The ID of the token expected on the destination blockchain (optional).

    Returns Promise<KnownRoute[]>

    A promise that resolves with an array of KnownRoute objects, each representing a possible route for the token transfer.

  • This function retrieves a list of time-locked assets for a given wallet address across multiple EVM-compatible blockchain networks. It queries smart contracts to find and return information about the assets that are currently locked in time-based agreements.

    Parameters

    • input: GetTimeLockedAssetsInput

      An object containing the input parameters required for retrieving time-locked assets:

      • walletAddress: EVMAddress - The address of the wallet for which to retrieve the time-locked assets.
      • chains: KnownChainId.EVMChain[] - An array of EVM-compatible blockchains to query for locked assets.

    Returns Promise<GetTimeLockedAssetsOutput>

    A promise that resolves with an object containing a list of time-locked assets:

    • assets: TimeLockedAsset[] - An array of objects, each representing a time-locked asset, including:
      • id: string - The unique identifier of the time-locked agreement.
      • chain: KnownChainId.EVMChain - The blockchain where the asset is locked.
      • token: KnownTokenId.EVMToken - The token that is locked.
      • amount: SDKNumber - The amount of the token that is locked.
      • releaseTime: Date - The time when the asset is scheduled to be released.

    UnsupportedChainError - If any of the provided EVM chains is unsupported or invalid.

  • Parameters

    • route: DefinedRoute

    Returns Promise<boolean>

  • Parameters

    • chain: `${string} (XLinkSDK ChainId)`
    • token: "a runes token (XLinkSDK TokenId)"

    Returns Promise<undefined | `${number}:${number}`>

  • Parameters

    • chain: `${string} (XLinkSDK ChainId)`
    • id: `${number}:${number}`

    Returns Promise<undefined | "a runes token (XLinkSDK TokenId)">