Accessing token data

Fungible tokens are one of the most used abstractions implemented on blockchains. CSPR.cloud allows dApp developers to focus on the core logic of their applications by tracking the token activity on the Casper Network for CEP-18 compatible tokens and providing APIs to query that data. CSPR.cloud provides a possibility to:

Below is an example, that demonstrated fetching list of tokens owned by an account. Note, that we are including optional data about the contract package using the includes query parameter.

curl -X 'GET' -G \
  'https://api.testnet.cspr.cloud/accounts/013ff7b986fd1ebd176692825035f1fefa20fb89796dc533219ad307e56ed97439/ft-token-ownership' \
  --data-urlencode 'includes=contract_package{name,metadata}' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
"data": [
    {
      "balance": "198689800",
      "contract_package": {
        "metadata": {
          "balances_uref": "uref-75c2ee03c1982fc514336a38271a9748cee0994a11f16f8b750c68f142c8a957-007",
          "decimals": 3,
          "name": "Nexfi App Token",
          "symbol": "NFI",
          "total_supply_uref": "uref-6e641bea3588986637bd7a5bd2b80f141bf79d21a5be54152a6dc9ac6f9b42a4-007"
        },
        "name": "Nexfi App Token"
      },
      "contract_package_hash": "04ff7ad6975508fffb5a2f364323503fb045b6d1eaeb9aeaa7283c046e0b6710",
      "owner_hash": "a3caf9628418b3a35bd4a92d62d35e8a244898cdea26c269bf75a2d82ad221f0"
    },
    {
      "balance": "50",
      "contract_package": {
        "metadata": {
          "balances_uref": "uref-897fd9713fa3f57c741a3488d7c1a8a24ac0a1cb273eb861e03491698b6e198d-007",
          "decimals": 1,
          "name": "MP1",
          "symbol": "MonoPoint",
          "total_supply_uref": "uref-7c05f307f0f1f7d3b47ea207cdad169d03e554007efc8646d40c5e87002d1ae1-007"
        },
        "name": "MP1"
      },
      "contract_package_hash": "0ed344ff11750d965f6188eb6bb62dcabc51b20f3900b3c7d2f19463cda23378",
      "owner_hash": "a3caf9628418b3a35bd4a92d62d35e8a244898cdea26c269bf75a2d82ad221f0"
    },
    {
      "balance": "9970000",
      "contract_package": {
        "metadata": {
          "balances_uref": "uref-1db06ca66b714a032b2da27476ae8574656105565cb4990633049e483bc2e52a-007",
          "decimals": 3,
          "name": "ENFLOW TOKEN",
          "symbol": "ENF",
          "total_supply_uref": "uref-874fd7504edc780853175536c76025697fa5f4223c63d1e47e075cad2eadf592-007"
        },
        "name": "ENFLOW TOKEN"
      },
      "contract_package_hash": "223e8b0e3101a7d7671279a08abd38a86cefd590536d0aaa5a068c2c616e11da",
      "owner_hash": "a3caf9628418b3a35bd4a92d62d35e8a244898cdea26c269bf75a2d82ad221f0"
    }
  ],
  "item_count": 3,
  "page_count": 1
}

Last updated