Wanchain - We Are All Connected!
WebsiteBridgeExplorerEcosystem
  • 👋 Welcome to Wanchain
  • Products
    • WanBridge
      • Bridge-to-Earn
      • XP
    • XFlows
      • XP
    • XPort
      • XPort developer handbook
      • Supported chains
    • XStake
  • Cross-Chain Infrastructure
    • Wanchain Bridge Node Group
    • Wanchain L1 blockchain
      • Network information
    • WAN coin
      • How to get WAN coins
      • WAN coin faucets
      • xWAN
  • The Convert n' Burn System
    • Overview
    • Bridge fees
      • Conversion and distribution
    • Discounts
  • Developers
    • WanBridge API
      • 1. Information Retrieval
        • 1.1 Supported Chains and Tokense 1
        • 1.2 Cross-chain Quota and Fees
        • 1.3 Asset Lock Address
        • 1.4 Storeman Group ID (smgID)
      • 2. Creating Cross-chain Transactions for WanBridge
        • 2.1 Direct Interaction with On-chain Contracts
        • 2.2 Creating Cross-Chain Transactions Using API
      • 3. Circle CCTP Cross-Chain
        • 3.1 EVM Compatible Chains
      • 4. Status Query
    • XFlows API
      • 1.1 Basic Information
      • 1.2 Request Parameters
      • 1.3 Response Parameters
      • 1.4 Examples
      • 1.5 Notes
      • 1.6 Status Query
    • XPort Developer Handbook
  • PoS Validator Nodes
    • Important Terms and Parameter
    • Recommended Hardware & Software
    • Mainnet Node Setup (Quick Start)
    • Mainnet Node Setup (Manually)
    • Getting Started With AWS
    • Common Operations (CLI)
    • Delegation Guide
    • Commonly Used Scripts
    • GWAN PoS API
    • Partner Model Staking Guide
    • Staking FAQ
  • Wanchain Bridge Nodes
    • Fact Sheet
    • How to deploy a Bridge Node
  • External Links
    • Blog
    • Email
    • GitHub
    • Telegram
    • Telegram Tech Support
    • Twitter/X
    • WanBridge
    • XFlows
    • XStake
    • WanScan
    • Website
Powered by GitBook
On this page
  1. Developers
  2. WanBridge API
  3. 1. Information Retrieval

1.2 Cross-chain Quota and Fees

Previous1.1 Supported Chains and Tokense 1Next1.3 Asset Lock Address

Last updated 1 day ago

1.2.1. Querying Cross-chain Quota

The available quota for each token must be queried separately. The API endpoint is as follows:

<https://bridge-api.wanchain.org/api/quota?fromChainType=[fromChainType]&toChainType=[toChainType]&symbol=[symbol]>

Use the values returned by the tokenPairs API for fromChainType, toChainType, and symbol in the request parameters.

Example:

Response Example:

{
  "success": true,
  "data": {
    "symbol": "USDC",
    "minQuota": "0",
    "maxQuota": "5000000000"
  }
}

Usage Notes

  • Choose the appropriate chainType based on the desired cross-chain direction.

  • For instance, when transferring from Arbitrum to BSC, set fromChainType=ARETH and toChainType=BNB. Conversely, when transferring from BSC to Arbitrum, use fromChainType=BNB and toChainType=ARETH.

  • The maxQuota value in the response is expressed using the decimals of fromToken.

1.2.2 Querying Cross-chain Fees

The fee API returns two types of fees:

  • networkFee: Charged in the native token of the blockchain (e.g., ETH on Ethereum, BNB on BSC).

  • operationFee: Charged in the token being transferred (e.g., USDT is charged when it is being transferred).

Fee Calculation Rules

  • If isPercent is false, the fee is charged as a fixed amount based on the value field.

  • If isPercent is true, the value represents a percentage and must be multiplied by the transfer amount.

  • When fees are percentage-based, minFeeLimit and maxFeeLimit define the minimum and maximum fee thresholds.

API Endpoint:

<https://bridge-api.wanchain.org/api/fee?fromChainType=[fromChainType]&toChainType=[toChainType]&tokenPairID=[tokenPairID]>

Use the values from tokenPairs for fromChainType, toChainType, and tokenPairID.

Example 1: Querying Fees for USDT Transfer from Arbitrum to Ethereum

<https://bridge-api.wanchain.org/api/fee?fromChainType=ARETH&toChainType=ETH&tokenPairID=191>

Response Example:

{
  "success": true,
  "data": {
    "networkFee": {
      "value": "7000000000000000",
      "isPercent": false
    },
    "operationFee": {
      "value": "0",
      "isPercent": true
    }
  }
}

This means a network fee of 7000000000000000 wei (0.007 ETH) is charged on Arbitrum.

Example 2: Querying Fees for BTC Transfer from Ethereum to Bitcoin

<https://bridge-api.wanchain.org/api/fee?fromChainType=ETH&toChainType=BTC&tokenPairID=14>

Response Example:

{
  "success": true,
  "data": {
    "networkFee": {
      "value": "0",
      "isPercent": false
    },
    "operationFee": {
      "value": "0.006",
      "isPercent": true,
      "minFeeLimit": "35000",
      "maxFeeLimit": "50000000"
    }
  }
}

This means no network fee is charged, and BTC is charged at 0.6% of the transfer amount, with a minimum fee of 35000 satoshis (0.00035 BTC) and a maximum fee of 50000000 satoshis (0.5 BTC).

1.2.3 Aggregated Query for Cross-chain Quota and Fees (quotaAndFee API)

API Endpoint:

Example:

<https://bridge-api.wanchain.org/api/quotaAndFee?fromChainType=ETH&toChainType=BTC&tokenPairID=14&symbol=BTC>

Response Example:

{
  "success": true,
  "data": {
    "symbol": "BTC",
    "minQuota": "0",
    "maxQuota": "5061694752",
    "networkFee": {
      "value": "0",
      "isPercent": false
    },
    "operationFee": {
      "value": "0.006",
      "isPercent": true,
      "minFeeLimit": "35000",
      "maxFeeLimit": "50000000"
    }
  }
}

https://bridge-api.wanchain.org/api/quota?fromChainType=WAN&toChainType=ARETH&symbol=USDC
https://bridge-api.wanchain.org/api/quotaAndFee?fromChainType=[fromChainType]&toChainType=[toChainType]&tokenPairID=[tokenPairID]&symbol=[symbol]