Skip API

Overview

The Skip API is a powerful tool designed to facilitate seamless cross-chain transactions, allowing users to perform asset transfers efficiently across different blockchain networks. This document provides detailed instructions and examples on how to leverage the Skip API to enhance cross-chain functionalities within the Initia ecosystem.

API and Reference Materials

Available Functions

Currently, the API supports the transferring of assets. Swapping assets will be introduced in the future, coinciding with the addition of Initia DEX as a swap venue.

Example Usages

Route ( mahalo USDC → minimove USDC)

curl --request POST \\
--url <https://solve-dev.skip.money/v2/fungible/route> \\
--header 'accept: application/json' \\
--header 'content-type: application/json' \\
--data '
{
"amount_in": "10000",
"source_asset_denom": "uusdc",
"source_asset_chain_id": "mahalo-1",
"dest_asset_denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"dest_asset_chain_id": "minimove-1"
}'

{"source_asset_denom":"uusdc","source_asset_chain_id":"mahalo-1","dest_asset_denom":"ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5","dest_asset_chain_id":"minimove-1","amount_in":"10000","amount_out":"10000","operations":[{"transfer":{"port":"transfer","channel":"channel-0","from_chain_id":"mahalo-1","to_chain_id":"minimove-1","pfm_enabled":true,"dest_denom":"ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5","supports_memo":true,"bridge_id":"IBC","chain_id":"mahalo-1"}}],"chain_ids":["mahalo-1","minimove-1"],"does_swap":false,"estimated_amount_out":"10000","txs_required":1

Msg (mahalo USDC → minimove USDC)

curl --request POST \\
--url <https://solve-dev.skip.money/v2/fungible/msgs_direct> \\
--header 'accept: application/json' \\
--header 'content-type: application/json' \\
--data '
{"chain_ids_to_addresses": {
"mahalo-1": "init178rtzyke2gjrgnjgjdgfmq8ak2lzatza53fdq5",
"minimove-1": "init1rh03awuuy7t82n4pmtdaa6gj4duneaj8gghkqp"
},
"amount_in": "10000",
"source_asset_denom": "uusdc",
"source_asset_chain_id": "mahalo-1",
"dest_asset_denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
"dest_asset_chain_id": "minimove-1"}
'

{"msgs":[{"multi_chain_msg":{"chain_id":"mahalo-1","path":["mahalo-1","minimove-1"],"msg":"{\\"source_port\\":\\"transfer\\",\\"source_channel\\":\\"channel-0\\",\\"token\\":{\\"denom\\":\\"uusdc\\",\\"amount\\":\\"10000\\"},\\"sender\\":\\"init178rtzyke2gjrgnjgjdgfmq8ak2lzatza53fdq5\\",\\"receiver\\":\\"init1rh03awuuy7t82n4pmtdaa6gj4duneaj8gghkqp\\",\\"timeout_height\\":{},\\"timeout_timestamp\\":1709017830149972820}","msg_type_url":"/ibc.applications.transfer.v1.MsgTransfer"}}],"route":{"source_asset_denom":"uusdc","source_asset_chain_id":"mahalo-1","dest_asset_denom":"ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5","dest_asset_chain_id":"minimove-1","amount_in":"10000","amount_out":"10000","operations":[{"transfer":{"port":"transfer","channel":"channel-0","from_chain_id":"mahalo-1","to_chain_id":"minimove-1","pfm_enabled":true,"dest_denom":"ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5","supports_memo":true,"bridge_id":"IBC","chain_id":"mahalo-1"}}],"chain_ids":["mahalo-1","minimove-1"],"does_swap":false,"estimated_amount_out":"10000","txs_required":1}}

Assets between chains (mahalo ↔ minimove)

curl --request POST \\
     --url <https://solve-dev.skip.money/v2/fungible/assets_between_chains> \\
     --header 'accept: application/json' \\
     --header 'content-type: application/json' \\
     --data '
{
  "source_chain_id": "mahalo-1",
  "dest_chain_id": "minimove-1"
}
'

{
  "assets_between_chains": [
    {
      "asset_on_source": {
        "denom": "ibc/82EB1C694C571F954E68BFD68CFCFCD6123B0EBB69AAA8BAB7A082939B45E802",
        "chain_id": "mahalo-1",
        "origin_denom": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
        "origin_chain_id": "minimove-1",
        "trace": "transfer/channel-0",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "INIT",
        "name": "INIT",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/minimove/images/INIT.png>",
        "decimals": 6,
        "recommended_symbol": "INIT"
      },
      "asset_on_dest": {
        "denom": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
        "chain_id": "minimove-1",
        "origin_denom": "l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd",
        "origin_chain_id": "minimove-1",
        "trace": "",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "INIT",
        "name": "INIT",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/minimove/images/INIT.png>",
        "decimals": 6,
        "description": "The native token of Initia",
        "recommended_symbol": "INIT"
      },
      "txs_required": 1,
      "bridges": [
        "IBC"
      ]
    },
    {
      "asset_on_source": {
        "denom": "ueth",
        "chain_id": "mahalo-1",
        "origin_denom": "ueth",
        "origin_chain_id": "mahalo-1",
        "trace": "",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "ETH",
        "name": "ETH",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/mahalo/images/ETH.png>",
        "decimals": 6,
        "description": "The fake ETH",
        "recommended_symbol": "ETH"
      },
      "asset_on_dest": {
        "denom": "ibc/0E98D4D1D907597448FD3A7C33DDAE10A90FA86FC8A9F5A0B175393783F249CD",
        "chain_id": "minimove-1",
        "origin_denom": "ueth",
        "origin_chain_id": "mahalo-1",
        "trace": "transfer/channel-0",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "ETH",
        "name": "ETH",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/mahalo/images/ETH.png>",
        "decimals": 6,
        "description": "The fake ETH",
        "recommended_symbol": "ETH"
      },
      "txs_required": 1,
      "bridges": [
        "IBC"
      ]
    },
    {
      "asset_on_source": {
        "denom": "uusdc",
        "chain_id": "mahalo-1",
        "origin_denom": "uusdc",
        "origin_chain_id": "mahalo-1",
        "trace": "",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "USDC",
        "name": "USDC",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/mahalo/images/USDC.png>",
        "decimals": 6,
        "description": "The fake USDC",
        "recommended_symbol": "USDC"
      },
      "asset_on_dest": {
        "denom": "ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5",
        "chain_id": "minimove-1",
        "origin_denom": "uusdc",
        "origin_chain_id": "mahalo-1",
        "trace": "transfer/channel-0",
        "is_cw20": false,
        "is_evm": false,
        "symbol": "USDC",
        "name": "USDC",
        "logo_uri": "<https://raw.githubusercontent.com/initia/initia-registry/main/mahalo/images/USDC.png>",
        "decimals": 6,
        "description": "The fake USDC",
        "recommended_symbol": "USDC"
      },
      "txs_required": 1,
      "bridges": [
        "IBC"
      ]
    }
  ]
}

Conclusion

The Skip API stands out as a crucial development in the blockchain domain, simplifying the complexities involved in cross-chain transactions. By following the provided examples and utilizing the detailed documentation, users can effectively engage with various blockchain networks within the Initia ecosystem, thereby enhancing their transactional capabilities and experiences.

Last updated

Logo

© 2024 Initia Foundation, All rights reserved.