LogoLogo
1.4.x
1.4.x
  • Documentation
    • Introduction
    • Overview
      • Authorization
      • Rate limits and quotas
      • Pagination
      • Sorting
      • Filtering
      • Optional properties
      • Errors
    • Getting started
    • Highlights
      • Including related entities
      • Including CSPR rates
      • Including account info
      • Accessing auction data
      • Accessing token data
      • Accessing NFT data
      • De-anonymizing account hashes
      • De-anonymizing account purses
      • Receiving contract-level events
      • Resolving CSPR.name
    • Changelog
  • REST API
    • Reference
    • Account
      • Get account
      • Get accounts
    • Account Info
      • Get account info
      • Get account infos
    • Auction metrics
      • Get auction metrics
    • Awaiting deploy
      • Create Awaiting Deploy
      • Add Awaiting Deploy signatures
      • Get Awaiting Deploy
    • Block
      • Get block
      • Get blocks
      • Get validator blocks
    • Bidder
      • Get bidder
      • Get bidders
    • Centralized account info
      • Get centralized account info
      • Get centralized account infos
    • Contract
      • Get contract
      • Get contracts
      • Get contracts by contract package
      • Get contract types
    • Contract entry point
      • Get contract entry points
      • Get contract entry point costs
    • Contract package
      • Get contract package
      • Get contract packages
      • Get account contract packages
    • Delegation
      • Get account delegations
      • Get validator delegations
    • Delegator reward
      • Get account delegator rewards
      • Get total account delegation rewards
      • Get total validator delegators' rewards
    • Deploy
      • Get deploy
      • Get deploys
      • Get account deploys
      • Get block deploys
      • Get deploy execution types
    • Fungible token action
      • Get fungible token actions
      • Get fungible token action types
      • Get account fungible token actions
      • Get contract package fungible token actions
    • Fungible token ownership
      • Get account fungible token ownership
      • Get contract package fungible token ownership
    • Non-fungible token (NFT)
      • Get NFT
      • Get account NFTs
      • Get contract package NFTs
      • Get NFT standards
      • Get off-chain NFT metadata statuses
    • Non-fungible token (NFT) action
      • Get contract package NFT actions for a token
      • Get account NFT actions
      • Get contract package NFT actions
      • Get NFT action types
    • Non-fungible token (NFT) ownership
      • Get contract package NFT ownership
      • Get account NFT ownership
    • CSPR.name resolution
      • Get CSPR.name resolution
    • CSPR rate
      • Get the current currency rate
      • Get historical currency rates
      • Get currencies
    • CSPR supply
      • Get supply
    • Transfer
      • Get account transfers
      • Get deploy transfers
    • Validator
      • Get validator
      • Get validators
    • Validator performance
      • Get historical validator performance
      • Get historical average validator performance
      • Get historical average validators performance
    • Validator reward
      • Get validator rewards
      • Get validator total rewards
  • Streaming API
    • Reference
    • Account balance
    • Block
    • Contract
    • Contract package
    • Contract-level events
    • Deploy
    • Fungible token action
    • Non-fungible token (NFT)
    • Non-fungible token (NFT) action
    • Transfer
  • Casper Node API
    • Connecting with an SDK
Powered by GitBook
On this page
Export as PDF
  1. Documentation
  2. Highlights

Resolving CSPR.name

PreviousReceiving contract-level eventsNextChangelog

Last updated 3 months ago

CSPR.cloud REST API provides the possibility to resolve CSPR.name names either directly by calling the or by including CSPR.name names as .

At the moment of writing this page (August 27th, 2024), the CSPR.name is not launched yet. That's why we added a test CSPR.name for the Faucet account to allow developers to implement and test their CSPR.name integration before the launch.

Direct CSPR.name to account hash resolution can be done using the and is recommended for the situations when you receive the name outside CSPR.cloud and want to resolve it to the corresponding account hash:

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/cspr-name-resolutions/faucet.cspr' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": {
    "name_token_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "name": "faucet.cspr",
    "resolved_hash": "b383c7cc23d18bc1b42406a1b2d29fc8dba86425197b6f553d7fd61375b5e446",
    "expires_at": "2124-08-27T12:00:00Z"
  }
}

In situations, when you want to resolve account hashes to the corresponding CSPR.name names, in most of the cases it's possible to do by requesting CSPR.name as in the includes query parameter:

curl -X 'GET' \
  'https://api.testnet.cspr.cloud/deploys/872394dcb8ac58b61f543e6fa0e3425b1db6b83a03d9d46cbf55c9d4b736624f?includes=caller_cspr_name' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": {
    "args": {
      "amount": {
        "cl_type": "U512",
        "parsed": "1000000000000"
      },
      "target": {
        "cl_type": {
          "ByteArray": 32
        },
        "parsed": "3234c6a8e17a19976300d18d6dcc444839ff981c5bfcd0d8724e3a0c018f61f3"
      }
    },
    "block_hash": "b8e7c74faed73e54be402a5f575a6cd8adf7382ed58bdb0ed48271464a122415",
    "block_height": 3618748,
    "caller_cspr_name": "faucet.cspr",
    "caller_public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
    "contract_hash": null,
    "contract_package_hash": null,
    "cost": "2976291766",
    "deploy_hash": "872394dcb8ac58b61f543e6fa0e3425b1db6b83a03d9d46cbf55c9d4b736624f",
    "entry_point_id": null,
    "error_message": null,
    "execution_type_id": 1,
    "payment_amount": "4000000000",
    "status": "processed",
    "timestamp": "2024-08-26T14:34:56Z"
  }
}
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/accounts/018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02?includes=cspr_name' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
{
  "data": {
    "account_hash": "b383c7cc23d18bc1b42406a1b2d29fc8dba86425197b6f553d7fd61375b5e446",
    "balance": 9516302858997050000,
    "cspr_name": "faucet.cspr",
    "deployment_threshold": 1,
    "key_management_threshold": 1,
    "main_purse_uref": "uref-b06a1ab0cfb52b5d4f9a08b68a5dbe78e999de0b0484c03e64f5c03897cf637b-007",
    "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02"
  }
}

If you want to find the primary CSPR.name for an account, you can include it in the :

CSPR.name Resolution API
optional properties
Get CSPR.name resolution API
optional property
Get account API