XDC Network Querying API

About XDC Network

Decentralized, Hybrid, Interoperable & Liquid Network

eXchange inFinite (XinFin), is a Delegated Proof of Stake Consensus network (XDPoS), enabling Hybrid Relay Bridges, Instant Block Finality and Interoperability with ISO20022 messaging standards, making XinFin's Hybrid Architecture Developer friendly. XinFin XDPoS Hybrid Network, Powered by XDC Protocol

Interoperable Blockchain Network for Global Trade & Finance which enables Digitization, Tokenization and instant settlement of trade transactions, increases efficiency and reduces reliance on complex FX infrastructures, allowing for increased flexibility in liquidity management for financial institutions.

Unmarshal's Current Infrastructure Support

GET TOKEN BALANCES

GET https://stg-api.unmarshal.io/v1/xinfin/address/:address/assets

The token balance API provides all the assets on the XDC chain for the given wallet address. A user will be able to view all the details of of assets in one's wallet. The below sample response should be able to give a fair idea on the details of our API could fetch. Eg: https://stg-api.unmarshal.io/v1/xinfin/address/ xdc9c4732b0431d5d4df255eb63782a0a3f466d6c59/assets?auth_key=VGVtcEtleQ%3D%3D

Path Parameters

[
  {
    "contract_name": "XinFin",
    "contract_ticker_symbol": "XDC",
    "contract_decimals": 18,
    "contract_address": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "coin": 62,
    "type": "XDC",
    "balance": "8622000000000000",
    "quote": 0.001073939076,
    "quote_rate": 0.124558,
    "logo_url": "https://assets.unmarshal.io/tokens/0xxdcEeEeeeEeeEeeEeEeeeEEEeeEEEeEEeeEeEeeEE.png",
    "quote_rate_24h": "0",
    "quote_pct_change_24h": 0
  }
]

GET TOKEN TRANSACTIONS

GET https://stg-api.unmarshal.io/v1/xinfin/address/:address/transactions?page="*"&pagesize="*"&auth_key=authkey

The token transactions provide detail insight of all the transactions that has happened on the particular wallet address. This particular end point is important when it comes to understanding the history of the wallet. A sample API below will shed more light about the API. Sample API & Response : https://stg-api.unmarshal.io/v1/xinfin/ address/xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae/transactions?page=2&pageSize=2&auth_key=VGVtcEtleQ==

Path Parameters

{
  "page": 2,
  "total_pages": 13,
  "items_on_page": 2,
  "total_txs": 25,
  "transactions": [
    {
      "id": "0x67fac8a6310482f920d97939646a84271879cf4960902ebf85bd4dee665bf19d",
      "from": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
      "to": "xdcfa32cfcd71d42d223e11c375b918c04eb5d635c4",
      "fee": "420000000000000",
      "date": 1628751786,
      "status": "completed",
      "type": "send",
      "block": 33708074,
      "value": "20946000000000000000000",
      "description": "Sent 20946 XDC",
      "sent": [
        {
          "name": "XinFin",
          "symbol": "XDC",
          "token_id": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "decimals": 18,
          "value": "20946000000000000000000",
          "logo_url": "https://assets.unmarshal.io/tokens/0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
          "from": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
          "to": "xdcfa32cfcd71d42d223e11c375b918c04eb5d635c4"
        }
      ]
    },
    {
      "id": "0x2b05b61ae88b2f1fca1fdf9c95c7349b8682317f36c3eb9802b7129f700153e4",
      "from": "xdcdc4e56837cf3bf2d0e9cc54e97f06f2b844d3bb1",
      "to": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
      "fee": "210000000000000",
      "date": 1628741508,
      "status": "completed",
      "type": "receive",
      "block": 33703008,
      "value": "19801100000000000000000",
      "description": "Received 19801.1 XDC",
      "received": [
        {
          "name": "XinFin",
          "symbol": "XDC",
          "token_id": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "decimals": 18,
          "value": "19801100000000000000000",
          "logo_url": "https://assets.unmarshal.io/tokens/0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
          "from": "xdcdc4e56837cf3bf2d0e9cc54e97f06f2b844d3bb1",
          "to": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae"
        }
      ]
    }
  ]
}

GET TOKEN TRANSACTIONS V2

GET https://stg-api.unmarshal.io/v2/xinfin/address/:address/transactions?page="*"&pagesize="*"&auth_key=authkey

The difference between the previous API and this one is that the response will have some additional details. The users will see a quote and quote rate of the token Sample API & Response : https://stg-api.unmarshal.io/v2/xinfin/ address/xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae/transactions?page=2&pageSize=2&auth_key=VGVtcEtleQ==

Path Parameters

{
  "page": 2,
  "total_pages": 13,
  "items_on_page": 2,
  "total_txs": 25,
  "transactions": [
    {
      "id": "0x67fac8a6310482f920d97939646a84271879cf4960902ebf85bd4dee665bf19d",
      "from": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
      "to": "xdcfa32cfcd71d42d223e11c375b918c04eb5d635c4",
      "fee": "420000000000000",
      "date": 1628751786,
      "status": "completed",
      "type": "send",
      "block": 33708074,
      "value": "20946000000000000000000",
      "description": "Sent 20946 XDC",
      "sent": [
        {
          "name": "XinFin",
          "symbol": "XDC",
          "token_id": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "decimals": 18,
          "value": "20946000000000000000000",
          "quote": 2544.0619532772002,
          "quoteRate": 0.1214581282,
          "logo_url": "https://assets.unmarshal.io/tokens/0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
          "from": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
          "to": "xdcfa32cfcd71d42d223e11c375b918c04eb5d635c4"
        }
      ]
    },
    {
      "id": "0x2b05b61ae88b2f1fca1fdf9c95c7349b8682317f36c3eb9802b7129f700153e4",
      "from": "xdcdc4e56837cf3bf2d0e9cc54e97f06f2b844d3bb1",
      "to": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae",
      "fee": "210000000000000",
      "date": 1628741508,
      "status": "completed",
      "type": "receive",
      "block": 33703008,
      "value": "19801100000000000000000",
      "description": "Received 19801.1 XDC",
      "received": [
        {
          "name": "XinFin",
          "symbol": "XDC",
          "token_id": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "decimals": 18,
          "value": "19801100000000000000000",
          "quote": 2507.94409316726,
          "quoteRate": 0.1266568066,
          "logo_url": "https://assets.unmarshal.io/tokens/0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
          "from": "xdcdc4e56837cf3bf2d0e9cc54e97f06f2b844d3bb1",
          "to": "xdcf4971c4d214da9a78c2d2700da176aa899c9a1ae"
        }
      ]
    }
  ]
}

GET TRANSACTION DETAILS

GET https://stg-api.unmarshal.io/v1/xinfin/transactions/:txID

When someone requires to understand in detail about the a particular transaction and all we have is a transaction hash, this API will come in handy. We try to fetch the minuscule of details possible. The sample API request and response will give you a better understanding of the API. Sample API: https://stg-api.unmarshal.io/v1/xinfin/ transactions/0x30bca12fcecf7df7987c9643414a78d3023ad2775e39ca555a525da54f565ebc?auth_key=VGVtcEtleQ==

Path Parameters

{
  "id": "0x30bca12fcecf7df7987c9643414a78d3023ad2775e39ca555a525da54f565ebc",
  "from": "xdc70735d32b4ca3f148c7d0bc7f9f53901695dc2af",
  "to": "xdc3f55bfd246e9c5aca686afbc986d3a55d6053fbb",
  "fee": "1814400000000000",
  "date": 1631682331,
  "status": "completed",
  "type": "send",
  "block": 35140772,
  "value": "4000000000000000000",
  "description": "Sent 4 XDC",
  "sent": [
    {
      "name": "XinFin",
      "symbol": "XDC",
      "token_id": "0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
      "decimals": 18,
      "value": "4000000000000000000",
      "logo_url": "https://assets.unmarshal.io/tokens/0xxdceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.png",
      "from": "xdc70735d32b4ca3f148c7d0bc7f9f53901695dc2af",
      "to": "xdc3f55bfd246e9c5aca686afbc986d3a55d6053fbb"
    }
  ]
}

Last updated