Owlto cross-chain integration API

Overview

This document provides a step-by-step guide on how to use the Owlto Finance API to transfer cryptocurrency pairs between different blockchain networks.

Basic Information

Scenario Example

Assuming you want to transfer ETH 0.001 from BaseMainnet to ArbitrumOneMainnet:Firstly, retrieve chain data:

  • BaseMainnet:

    • ChainId: 8453

    • NetworkCode: 12

  • ArbitrumOneMainnet:

    • ChainId: 42161

    • NetworkCode: 4

Retrieve supported token information:

  • ETH on BaseMainnet:

    • ChainId: 8453

    • Decimal: 18

  • ETH on ArbitrumOneMainnet:

    • ChainId: 42161

    • Decimal: 18

Query supported cross-chain information:

  • Supported Cross-Chain Info

    • Input values:

    • base_chainid:1 represents EthereumMainnet,BaseMainnet or chains similar to EthereumMainnet.

    • base_chainid:56 represents BnbMainnet, OpbnbMainnet or chains similar to BnbMainnet.

    • base_chainid:137 represents PolygonPoSMainnet or chains similar to PolygonPoSMainnet.

    • response:

    • {
        "symbol": "ETH",
        "decimal": 18,
        "fromChainId": 8453,
        "fromAddress": "0x0000000000000000000000000000000000000000",
        "toChainId": 42161,
        "toAddress": "0x0000000000000000000000000000000000000000",
        "minValue": 0,
        "maxValue": 0.5
      }

Interacting with Wallets

Get LP (Liquidity Provider) information:

Input values:

  • from_chainid: BaseMainnet (ChainId: 8453)

  • to_chainid: ArbitrumOneMainnet (ChainId: 42161)

  • user: wallet address('0x2729348Bfca4a22D4acbc25b1CE00cb74F1a2301')

Obtain transfer details:

  • Maker Address: 0x45A318273749d6eb00f5F6cA3bC7cD3De26D642A

  • Token Decimal: 18

  • Gas Token Name: ETH

  • Estimated Gas: 100000000000

  • Token Price: 2374.76

Calculate transfer value:

Input values:

  • From: BaseMainnet (ChainId: 8453)

  • To: ArbitrumOneMainnet (ChainId: 42161)

  • Token: ETH

  • Amount: 0.001

  • DTC Value: 0.00065

Calculate input value:

  • 0.001 + 0.00065 = 0.00165 ETH

  • Convert to Wei: 1650000000000000

  • Add the target chain's NetworkCode 4, 4 becomes a 4-digit string, if it's less than four digits, pad zeros in front, and then replace the last four digits after 1650000000000000: 1650000000000004

'165000000000'+'0004'='1650000000000004'

Now, you have the values MetaMask and other wallets need for the transfer:

  • Maker Address: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

  • Token Decimal: 18

  • Gas Token Name: ETH

  • Estimated Gas: 100000000000

  • Token Price: 2374.76

  • Value: 1650000000000004

Querying Transaction Information

If the BaseMainnet transfer hash is:

Query the transfer nonce:

Check if the transfer is successful based on the nonce:

If successful, you will obtain the destination chain's transfer information:

By following these steps, you can successfully transfer cryptocurrency pairs between different blockchain networks.

Last updated