Secret Network
Secret Network API is available on Web3 API platform.
Secret Network is the first blockchain with customizable privacy. You get to choose what you share, who you share with, and how long you share it for. This protects users and empowers developers to build a better Web3.
We support the following networks and protocols for Secret Network:
Currently, we provide two interfaces to query Secret Network API — JSON-RPC and REST. Responses for both of them come in JSON format.
Here is the request/response structure to use for querying:
- Tendermint JSON-RPC request
- Tendermint REST request
- Cosmos REST request
- JSON response
curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "block",
"params": ["1"],
"id": 1
}'
curl https://rpc.ankr.com/http/scrt/block?height=1
curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/blocks/{height}
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"block_id": {
"hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
"parts": {
"total": 1,
"hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
},
"block": {
"header": {
"version": {
"block": "10",
"app": "0"
},
"chain_id": "cosmoshub-2",
"height": "12",
"time": "2019-04-22T17:01:51.701356223Z",
"last_block_id": {
"hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
"parts": {
"total": 1,
"hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
},
"last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812",
"data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73",
"validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
"next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0",
"consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8",
"app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C",
"last_results_hash": "",
"evidence_hash": "",
"proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E"
},
"data": [
"yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0="
],
"evidence": [
{
"type": "string",
"height": 0,
"time": 0,
"total_voting_power": 0,
"validator": {
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
},
"voting_power": 0,
"address": "string"
}
}
],
"last_commit": {
"height": 0,
"round": 0,
"block_id": {
"hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
"parts": {
"total": 1,
"hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
},
"signatures": [
{
"type": 2,
"height": "1262085",
"round": 0,
"block_id": {
"hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7",
"parts": {
"total": 1,
"hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
},
"timestamp": "2019-08-01T11:39:38.867269833Z",
"validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F",
"validator_index": 0,
"signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg=="
}
]
}
}
}
}
Tendermint JSON-RPC/REST methods
Info — node information:
blockchain— retrieves block headers (max: 20) forminHeight <= height <= maxHeight.block— retrieves a block at a specified height.block_by_hash— retrieves a block by hash.block_results— retrieves block results at a specified height.commit— retrieves commit results at a specified height.validators— retrieves a validator set at a specified height.genesis_chunked— retrieves the Genesis in multiple chunks.dump_consensus_state— retrieves consensus state.consensus_state— retrieves consensus state.consensus_params— retrieves consensus parameters.unconfirmed_txs— retrieves the list of unconfirmed transactions.num_unconfirmed_txs— retrieves data about unconfirmed transactions.tx_search— searches for transactions.block_search— searches for blocks byBeginBlockandEndBlockevents.tx— retrieves transactions by hash.
Tx — transactions broadcast information:
broadcast_tx_sync— returns with the response fromCheckTx. Does not wait forDeliverTxresult.broadcast_tx_async— returns right away, with no response. Does not wait forCheckTxnorDeliverTxresults.broadcast_tx_commit— returns with the responses fromCheckTxandDeliverTx.check_tx— checks the transaction without executing it.
ABCI — ABCI info:
abci_info— retrieves info about the application.abci_query— queries the application for some information.
Cosmos REST methods
Gaia REST:
/node_info— retrieves the properties of the connected node.
Transactions:
/txs— broadcasts a signed transaction to a full node.
Staking:
/staking/delegators/{delegatorAddr}/delegations— submits a delegation./staking/delegators/{delegatorAddr}/unbonding_delegations— submits an unbonding delegation.
Query:
/cosmos/auth/v1beta1/accounts— retrieves all the existing accounts./cosmos/auth/v1beta1/accounts/{address}— retrieves account details based on address./cosmos/auth/v1beta1/params— retrieves all parameters./cosmos/bank/v1beta1/balances/{address}— retrieves the balance of all coins for a single account./cosmos/bank/v1beta1/balances/{address}/{denom}— retrieves the balance of a single coin for a single account./cosmos/bank/v1beta1/denoms_metadata— retrieves the client metadata for all registered coin denominations./cosmos/bank/v1beta1/denoms_metadata/{denom}— retrieves the client metadata of a given coin denomination./cosmos/bank/v1beta1/params— retrieves the parameters of x/bank module./cosmos/bank/v1beta1/supply— retrieves the total supply of all coins./cosmos/distribution/v1beta1/community_pool— retrieves the community pool coins./cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards— retrieves the total rewards accrued by each validator./cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}— retrieves the total rewards accrued by a delegation./cosmos/distribution/v1beta1/delegators/{delegator_address}/validators— retrieves the validators of a delegator./cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address— retrieves a withdrawal address of a delegator./cosmos/distribution/v1beta1/params— retrieves parameters of the distribution module./cosmos/distribution/v1beta1/validators/{validator_address}/commission— retrieves accumulated commission for a validator./cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards— retrieves rewards of a validator address./cosmos/distribution/v1beta1/validators/{validator_address}/slashes— retrieves slash events of a validator./cosmos/evidence/v1beta1/evidence— retrieves all evidence./cosmos/evidence/v1beta1/evidence/{evidence_hash}— retrieves evidence based on evidence hash./cosmos/gov/v1beta1/params/{params_type}— retrieves all parameters of the gov module./cosmos/gov/v1beta1/proposals— retrieves all proposals based on given status./cosmos/gov/v1beta1/proposals/{proposal_id}— retrieves proposal details based on proposal ID./cosmos/gov/v1beta1/proposals/{proposal_id}/deposits— retrieves all deposits of a single proposal./cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}— retrieves single deposit information based on proposal ID and deposit address./cosmos/gov/v1beta1/proposals/{proposal_id}/tally— retrieves the tally of a proposal vote./cosmos/gov/v1beta1/proposals/{proposal_id}/votes— retrieves votes of a given proposal./cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}— retrieves voted information based on proposal ID and voter address./cosmos/mint/v1beta1/annual_provisions— retrieves the current minting annual provisions value./cosmos/mint/v1beta1/inflation— retrieves the current minting inflation value./cosmos/mint/v1beta1/params— retrieves the total set of minting parameters./cosmos/slashing/v1beta1/params— retrieves the parameters of a slashing module./cosmos/slashing/v1beta1/signing_infos— retrieves signing info of all validators./cosmos/slashing/v1beta1/signing_infos/{cons_address}— retrieves the signing info of given cons address./cosmos/staking/v1beta1/delegations/{delegator_addr}— retrieves all delegations of a given delegator address./cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations— retrieves redelegations of a given address./cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations— retrieves all unbonding delegations of a given delegator address./cosmos/staking/v1beta1/delegators/{delegator_addr}/validators— retrieves all validators info for a given delegator address./cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}— retrieves validator info by given delegator validator pair./cosmos/staking/v1beta1/historical_info/{height}— retrieves the historical info for a given height./cosmos/staking/v1beta1/params— retrieves the staking parameters./cosmos/staking/v1beta1/pool— retrieves the pool info./cosmos/staking/v1beta1/validators— retrieves all validators that match the given status./cosmos/staking/v1beta1/validators/{validator_addr}— retrieves validator info for a given validator address./cosmos/staking/v1beta1/validators/{validator_addr}/delegations— retrieves delegate info for a given validator./cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}— retrieves delegate info for given validator delegator pair./cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation— retrieves unbonding info for given validator delegator pair./cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations— retrieves unbonding delegations of a given validator address./cosmos/upgrade/v1beta1/applied_plan/{name}— retrieves a previously applied upgrade plan by its name./cosmos/upgrade/v1beta1/current_plan— retrieves the current upgrade plan./cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}— retrieves the consensus state that will serve as a trusted kernel for the next version of this chain./cosmos/authz/v1beta1/grants— retrieves the list ofAuthorization, granted to the grantee by the granter./cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}— retrieves the fee granted to the grantee by the granter./cosmos/feegrant/v1beta1/allowances/{grantee}— retrieves all the grants for an address.
Services:
/cosmos/base/tendermint/v1beta1/blocks/latest— retrieves the latest block./cosmos/base/tendermint/v1beta1/blocks/{height}— retrieves the block for a given height./cosmos/base/tendermint/v1beta1/validatorsets/latest— retrieves the latest validator-set./cosmos/base/tendermint/v1beta1/validatorsets/{height}— retrieves the validator-set at a given height./cosmos/tx/v1beta1/simulate— simulates executing a transaction to estimate gas usage./cosmos/tx/v1beta1/txs— retrieves transactions by event./cosmos/tx/v1beta1/txs— broadcasts a transaction./cosmos/tx/v1beta1/txs/{hash}— retrieves a transaction by hash.
Methods
Information, Transactions, ABCI, Gaia REST, Staking
blockchainblockblock_by_hashblock_resultscommitvalidatorsgenesis_chunkeddump_consensus_stateconsensus_stateconsensus_paramsunconfirmed_txsnum_unconfirmed_txstx_searchblock_searchtxbroadcast_tx_syncParametersbroadcast_tx_asyncbroadcast_tx_commitcheck_txabci_infoabci_query/node_info/txs/staking/delegators/{delegatorAddr}/delegations/staking/delegators/{delegatorAddr}/unbonding_delegations
Query
/cosmos/auth/v1beta1/accounts/cosmos/auth/v1beta1/accounts/{address}/cosmos/auth/v1beta1/params/cosmos/bank/v1beta1/balances/{address}/cosmos/bank/v1beta1/balances/{address}/{denom}/cosmos/bank/v1beta1/denoms_metadata/cosmos/bank/v1beta1/denoms_metadata/{denom}/cosmos/bank/v1beta1/params/cosmos/bank/v1beta1/supply/cosmos/distribution/v1beta1/community_pool/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address/cosmos/distribution/v1beta1/params/cosmos/distribution/v1beta1/validators/{validator_address}/commission/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards/cosmos/distribution/v1beta1/validators/{validator_address}/slashes/cosmos/evidence/v1beta1/evidence/cosmos/evidence/v1beta1/evidence/{evidence_hash}/cosmos/gov/v1beta1/params/{params_type}/cosmos/gov/v1beta1/proposals/cosmos/gov/v1beta1/proposals/{proposal_id}/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}/cosmos/gov/v1beta1/proposals/{proposal_id}/tally/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}/cosmos/mint/v1beta1/annual_provisionsResponse example/cosmos/mint/v1beta1/inflation/cosmos/mint/v1beta1/params/cosmos/slashing/v1beta1/params/cosmos/slashing/v1beta1/signing_infos/cosmos/slashing/v1beta1/signing_infos/{cons_address}/cosmos/staking/v1beta1/delegations/{delegator_addr}/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}/cosmos/staking/v1beta1/historical_info/{height}/cosmos/staking/v1beta1/params/cosmos/staking/v1beta1/pool/cosmos/staking/v1beta1/validators/cosmos/staking/v1beta1/validators/{validator_addr}/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations/cosmos/upgrade/v1beta1/applied_plan/{name}/cosmos/upgrade/v1beta1/current_plan/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}/cosmos/authz/v1beta1/grants/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}/cosmos/feegrant/v1beta1/allowances/{grantee}
Services
/cosmos/base/tendermint/v1beta1/blocks/latest/cosmos/base/tendermint/v1beta1/blocks/{height}/cosmos/base/tendermint/v1beta1/validatorsets/latest/cosmos/base/tendermint/v1beta1/validatorsets/{height}/cosmos/tx/v1beta1/simulate/cosmos/tx/v1beta1/txs/cosmos/tx/v1beta1/txs/cosmos/tx/v1beta1/txs/{hash}