LogoLogo
  • CrossCurve MetaLayer
    • βš™οΈWhat is CrossCurve MetaLayer
      • CrossCurve Consensus bridge
      • CrossCurve Pools v2
    • πŸ—ΊοΈRoadmap
      • 2024
  • 🏒CrossCurve DAO
    • Overview of CrossCurve DAO
    • Voting
    • Obtaining veEYWA and Calculating the Boost
    • Staking mechanics
    • NFTs
      • CrossCurve DAO NFT
      • EYWA NFT Collection
  • πŸ’ΌEarn with CrossCurve
    • Staking in CrossCurve
    • Providing Liquidity to CrossCurve Pools
    • Voting for Incentives
  • πŸ“–user documentation
    • πŸ›ΈMigration to Sonic
      • Why are we moving to Sonic
      • Sonic Upgrade Stages
      • Liquidity transfer from Fantom to Sonic
      • Sonic Incentives on CrossCurve MetaLayer
    • πŸ”ƒSwap interface
      • How to trade
      • Slippage settings
      • Routing
    • 🌊Liquidity Interface
      • Easy mode
      • via Curve (Balanced)
      • Liquidity provision use cases
        • Deposit
          • Easy mode (Imbalanced)
          • via Curve (Balanced)
        • Withdraw
          • Easy mode (Imbalanced)
          • via Curve (Balanced)
        • Curve Knowledge Database
          • Balanced liquidity provision
          • Guide to transferring CRV from Fantom chain to Ethereum mainnet
          • Disclamer
    • 🏒DAO
      • Locker Interface
      • Vote Interface
      • Incentives Interface
      • Working with the EYWA Locker contract in Arbiscan.
    • 🌾Yield
      • Farms Interface
        • Staking liquidity and earning rewards
      • APR Calculator
    • πŸ’ΌVesting
      • Claim portal interface
      • Early farming program interface
    • EYWA NFT
      • Bridge interface in the Aurora chain
      • Merge interface in the Arbitrum chain
      • EYWA NFT Manager interface
      • Dashboard interface
    • Leaderboard
    • ❄️Outdated
      • Early farming program
  • πŸ“–Developer documentation
    • Pools/asset contracts
      • Hubchain Pools and Assets
      • πŸ’±Supported tokens
    • πŸ”—CrossCurve smart contracts
    • πŸ’»Guide for Developers
      • Technical Documentation for CrossCurve DAO Smart Contracts
        • CalldataHelperV1
        • DelegationManagerV1
        • DelegationConditionValidatorV1
        • EmissionManagerV1
        • EscrowManager
        • EscrowVoteManagerV1
        • GaugeFactoryV1
        • GaugeV1
        • IncentiveRewardsDistributor
        • LockHolderFactoryV1
        • LockHolderV1
        • ProposalManager
        • RebaseRewardsDistributorV1
        • RewardsDistributorFactoryV1
        • Treasury
      • πŸ”ƒMake cross-chain swap
      • πŸ”¦Tracking cross-chain swap
      • πŸ“”Pusher API Reference
      • πŸ“Glossary
      • API Specification
  • πŸ“£About CrossCurve
    • πŸ›‘οΈSecurity audits
    • 🧠Team
    • Project History
    • Website
    • Telegram
    • Twitter
    • Medium
    • Discord
    • YouTube
    • LinkedIn
    • GitHub
Powered by GitBook
On this page
  • Searching for requestId
  • Getting details about the cross-chain transition by its requestId
Export as PDF
  1. Developer documentation
  2. Guide for Developers

Tracking cross-chain swap

After initiating the cross-chain swap (sending the transaction), it is necessary to ensure that it reaches the destination network and is executed successfully. Each cross-chain swap involves several transactions and the number of transactions may vary depending on the operation.

For swapping two stablecoins from Network A to Network B, the route can be depicted as:

Chain A -----> Hubchain -----> Chain B

Each transaction is linked with another by a unique identifier, requestId, which represents the cross-chain transition identifier and can be used to track the source status and transaction destinations.

Searching for requestId

You can get requestId of a transaction using its hash with the Pusher API:

Copy

const searchParams = new URLSearchParams({
search: '0x...', // transaction hash
limit: 1,
}).toString();
const response = await fetch(`https://api.crosscurve.fi/?${searchParams}`, {
method: 'GET',
})
const result = await response.json()
const details = result.result[0]
const requestId = details.requestId
TypeScript

Getting details about the cross-chain transition by its requestId

Copy

const response = await fetch(`https://api.crosscurve.fi/search?search=%7BhashOrReqId%7D&limit=%7Blimit%7D`, {
method: 'GET',
})
const details = await response.json()
const destination = details.destination
TypeScript

In the results, we are interested in the values of destination.status and destination.transactionHash. If destination.transactionHash is empty, this means that the transaction has not yet been executed and the request should be repeated at intervals until the hash appears.

Then there are 3 scenarios:

  1. Both details.inconsistency and destination.emergency are false This scenario is considered the most correct and will occur in most cases. It means the cross-chain operation has been completed and we have the hash of the destination transaction. Now, using this hash, similarly, you can track the status of the next cross-chain transition (if there is one) and continue doing so until all cross-chain transitions are completed.

  2. details.inconsistency is true This means that the destination transaction was successfully completed, but the token swap did not occur due to slippage. An intermediate result has been returned to your address in this network. The cross-chain operation is considered complete at this point.

  3. The value of destination.emergency is true In this case, the destination network operation could not be executed and your tokens are stuck in the contract. To retrieve them, you need to contact support to request a refund.

PreviousMake cross-chain swapNextPusher API Reference

Last updated 29 days ago

πŸ“–
πŸ’»
πŸ”¦