Skip to main content

FAQ-and-Debugging

FAQ

  1. Why does fetchData return empty data?

    • Ensure the API key and bridge parameters are correctly configured.
    • Check network connection or API server status.
  2. Transfer failed with "Insufficient Balance"?

    • Verify the user wallet has enough tokens and gas fees.
    • Use useCrossChainFee to check fee requirements.
  3. How long does a cross-chain transaction take?

    • Usually 1-5 minutes, depending on the confirmation speed of the source and destination chains.
  4. How to debug a failed transaction?

    • Check the error object's detailed information.
    • Use a blockchain explorer (such as Etherscan) to trace the source_tx_hash.
  5. What to do if a smart contract call fails?

    • Check if the contract address is correct.
    • Verify if the ABI matches the contract.
    • Ensure function parameter types and counts are correct.
  6. Reasons for token swap failure?

    • Check if the token is approved.
    • Verify if the slippage setting is reasonable.
    • Ensure there is enough token balance.

Debugging Recommendations

  • Logging: Add console.log to print input and output in fetchData and transfer.
  • Testnet Testing: Verify functionality on testnets (such as Sepolia) to reduce costs.
  • State Tracking: Use the loading state to show loading animations and avoid duplicate operations.
  • Error Boundaries: Use React Error Boundary to catch component errors.