cip-0144
CIP-139
This document defines the API for the Query Layer API
as defined in CIP-139. Enabling this extension, alongside the cip-30
extension, would give you a full-data wallet.
Utxos
Asset
{
"operation": "getUtxosByAsset",
"request": {
"type": "object",
"properties": {
"asset_name": {
"$ref": "#/cip-116/AssetName"
},
"minting_policy_hash": {
"$ref": "#/cip-116/ScriptHash"
}
},
"required": [
"asset_name",
"minting_policy_hash"
]
},
"response": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": {
"$ref": "#/cip-116/TransactionUnspentOutput"
}
}
},
"required": [
"utxos"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all UTxOs that contain some of the specified asset.
Transaction Hash
{
"operation": "getUtxosByTransactionHash",
"request": {
"$ref": "#/cip-139/TransactionHash"
},
"response": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": {
"$ref": "#/cip-116/TransactionUnspentOutput"
}
}
},
"required": [
"utxos"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all UTxOs produced by the transaction.
Address
{
"operation": "getUtxosByAddress",
"request": {
"$ref": "#/cip-116/Address"
},
"response": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": {
"$ref": "#/cip-116/TransactionUnspentOutput"
}
}
},
"required": [
"utxos"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all UTxOs present at the address.
Payment Credential
{
"operation": "getUtxosByPaymentCredential",
"request": {
"$ref": "#/cip-116/Credential"
},
"response": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": {
"$ref": "#/cip-116/TransactionUnspentOutput"
}
}
},
"required": [
"utxos"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all UTxOs present at the addresses which use the payment credential.
Stake Credential
{
"operation": "getUtxosByStakeCredential",
"request": {
"$ref": "#/cip-116/RewardAddress"
},
"response": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": {
"$ref": "#/cip-116/TransactionUnspentOutput"
}
}
},
"required": [
"utxos"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all UTxOs present at the addresses which use the stake credential.
Block
Number
{
"operation": "getBlockByNumber",
"request": {
"$ref": "#/cip-139/UInt64"
},
"response": {
"$ref": "#/cip-116/Block"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the block with the supplied block number.
Hash
{
"operation": "getBlockByHash",
"request": {
"$ref": "#/cip-116/BlockHash"
},
"response": {
"$ref": "#/cip-116/Block"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the block with the supplied block hash.
Transaction
Hash
{
"operation": "getTransactionByHash",
"request": {
"$ref": "#/cip-139/TransactionHash"
},
"response": {
"$ref": "#/cip-116/Transaction"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the transaction with the supplied transaction hash.
Block Number
{
"operation": "getTransactionByBlockNumber",
"request": {
"$ref": "#/cip-139/UInt64"
},
"response": {
"type": "object",
"properties": {
"transactions": {
"type": "array",
"items": {
"$ref": "#/cip-116/Transaction"
}
}
},
"required": [
"transactions"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all transactions contained in the block with the supplied block number [].
Block Hash
{
"operation": "getTransactionByBlockHash",
"request": {
"$ref": "#/cip-116/BlockHash"
},
"response": {
"type": "object",
"properties": {
"transactions": {
"type": "array",
"items": {
"$ref": "#/cip-116/Transaction"
}
}
},
"required": [
"transactions"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all transactions contained in the block with the supplied block hash.
Datum
Hash
{
"operation": "getDatumByHash",
"request": {
"$ref": "#/cip-116/DataHash"
},
"response": {
"$ref": "#/cip-116/PlutusData"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the datum that hashes to the supplied data hash.
Plutus Script
Hash
{
"operation": "getPlutusScriptByHash",
"request": {
"$ref": "#/cip-116/ScriptHash"
},
"response": {
"$ref": "#/cip-116/PlutusScript"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the plutus script that hashes to the supplied script hash.
Native Script
Hash
{
"operation": "getNativeScriptByHash",
"request": {
"$ref": "#/cip-116/ScriptHash"
},
"response": {
"$ref": "#/cip-116/NativeScript"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the native script that hashes to the supplied script hash.
Metadata
Transaction Hash
{
"operation": "getMetadataByTransactionHash",
"request": {
"$ref": "#/cip-139/TransactionHash"
},
"response": {
"$ref": "#/cip-116/TransactionMetadatum"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the metadata present on the transaction with the supplied transaction hash.
Protocol Parameters
Latest
{
"operation": "getProtocolParametersByLatest",
"request": {},
"response": {
"$ref": "#/cip-139/ProtocolParams"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the latest protocol parameters.
Epoch
{
"operation": "getProtocolParametersByEpoch",
"request": {
"$ref": "#/cip-139/UInt32"
},
"response": {
"$ref": "#/cip-139/ProtocolParams"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the protocol parameters at the supplied epoch number.
Votes
Cc Id
{
"operation": "getVotesByCcId",
"request": {
"$ref": "#/cip-139/CCHotId"
},
"response": {
"type": "object",
"properties": {
"votes": {
"type": "array",
"items": {
"$ref": "#/cip-139/VoteInfo"
}
}
},
"required": [
"votes"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Votes cast by the supplied cc credential.
Spo Id
{
"operation": "getVotesBySpoId",
"request": {
"$ref": "#/cip-139/PoolPubKeyHash"
},
"response": {
"type": "object",
"properties": {
"votes": {
"type": "array",
"items": {
"$ref": "#/cip-139/VoteInfo"
}
}
},
"required": [
"votes"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Votes cast by the supplied stake pool operator.
Drep Id
{
"operation": "getVotesByDrepId",
"request": {
"$ref": "#/cip-139/DRepId"
},
"response": {
"type": "object",
"properties": {
"votes": {
"type": "array",
"items": {
"$ref": "#/cip-139/VoteInfo"
}
}
},
"required": [
"votes"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Votes cast by the supplied DRep.
Proposal Id
{
"operation": "getVotesByProposalId",
"request": {
"$ref": "#/cip-139/ProposalId"
},
"response": {
"type": "object",
"properties": {
"votes": {
"type": "array",
"items": {
"$ref": "#/cip-139/VoteInfo"
}
}
},
"required": [
"votes"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Votes cast on the supplied proposal.
Drep
All
{
"operation": "getAllDreps",
"request": {},
"response": {
"type": "object",
"properties": {
"dreps": {
"type": "array",
"items": {
"$ref": "#/cip-139/DRepInfo"
}
}
},
"required": [
"dreps"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all the known DReps.
Id
{
"operation": "getDrepById",
"request": {
"$ref": "#/cip-139/DRepId"
},
"response": {
"$ref": "#/cip-139/DRepInfo"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get a specific DRep by id.
Stake Credential
{
"operation": "getDrepByStakeCredential",
"request": {
"$ref": "#/cip-116/RewardAddress"
},
"response": {
"$ref": "#/cip-139/DRepInfo"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the DRep that the stake credential has delegated to.
Committee Member
All
{
"operation": "getAllCommitteeMembers",
"request": {},
"response": {
"type": "object",
"properties": {
"cc_members": {
"type": "array",
"items": {
"$ref": "#/cip-139/CCMember"
}
}
},
"required": [
"cc_members"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all known committee members.
Id
{
"operation": "getCommitteeMemberById",
"request": {
"$ref": "#/cip-139/CCHotId"
},
"response": {
"$ref": "#/cip-139/CCMember"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get a specific Committee member by id.
Pool
All
{
"operation": "getAllPools",
"request": {},
"response": {
"type": "object",
"properties": {
"pools": {
"type": "array",
"items": {
"$ref": "#/cip-139/Pool"
}
}
},
"required": [
"pools"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all known stake pools.
Id
{
"operation": "getPoolById",
"request": {
"$ref": "#/cip-139/PoolPubKeyHash"
},
"response": {
"$ref": "#/cip-139/Pool"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get a specific stake pool by id.
Proposal
All
{
"operation": "getAllProposals",
"request": {},
"response": {
"type": "object",
"properties": {
"proposals": {
"type": "array",
"items": {
"$ref": "#/cip-139/Proposal"
}
}
},
"required": [
"proposals"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get all known proposals.
Id
{
"operation": "getProposalById",
"request": {
"$ref": "#/cip-139/ProposalId"
},
"response": {
"$ref": "#/cip-139/Proposal"
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get a specific proposal by id.
Era
Summary
{
"operation": "getEraBySummary",
"request": {},
"response": {
"type": "object",
"properties": {
"summary": {
"type": "array",
"items": {
"$ref": "#/cip-139/EraSummary"
}
}
},
"required": [
"summary"
]
},
"errors": [
{
"$ref": "#/appendix/APIError"
}
]
}
Get the start and end of each era along with parameters that can vary between hard forks.
Versioning
While the CIP is in preparation, the version shall be set to 0.0.0
. The moment this CIP is merged the versions shall be set to 1.0.0
, and all implementations should consider that the current version. Any changes to the API should come in form of PRs to this CIP.
API | Version |
---|---|
CIP-144 | 0.0.0 |