Skip to main content

Babylon - gRPC Gateway docs (1.0.0)

Download OpenAPI specification:Download

A REST interface for state queries

BTCCheckpoint

The REST API for the BTC Checkpoint RPC Gateway module.

BtcCheckpointsInfo

BtcCheckpointsInfo returns checkpoint info for a range of epochs

query Parameters
start_epoch
string <uint64>
end_epoch
string <uint64>
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btccheckpoint/v1?start_epoch=babylond12345&end_epoch=babylond6789&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "info_list": [
    ],
  • "pagination": {
    }
}

params

Parameters queries the parameters of the module.

Responses

Response samples

Content type
application/json
{
  • "params": {
    }
}

BtcCheckpointInfo

BtcCheckpointInfo returns checkpoint info for a given epoch

path Parameters
epoch_num
required
string <uint64>

Number of epoch for which the earliest checkpointing btc height is requested

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btccheckpoint/v1/127778958'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "info": {
    }
}

submissions

path Parameters
epoch_num
required
string <uint64>

Number of epoch for which submissions are requested

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btccheckpoint/v1/127778958/submissions?&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "keys": [
    ],
  • "pagination": {
    }
}

BTCLightClient

The REST API for the BTC Light Client RPC Gateway module.

baseheader

Responses

Response samples

Content type
application/json
{
  • "header": {
    }
}

contains

Contains checks whether a hash is maintained by the module.

query Parameters
hash
string <byte>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btclightclient/v1/contains?hash=qwrrasf345df'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "contains": false
}

containsBytes

ContainsBytes is a temporary method that checks whether a hash is maintained by the module. See discussion at https://github.com/babylonchain/babylon/pull/132 for more details.

query Parameters
hash
string <byte>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btclightclient/v1/containsBytes?hash=babylond345d32f'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "contains": true
}

hashes

Hashes retrieves the hashes maintained by the module.

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btclightclient/v1/hashes?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "hashes": [
    ],
  • "pagination": {
    }
}

mainchain

MainChain returns the canonical chain

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/btclightclient/v1/mainchain?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "headers": [
    ],
  • "pagination": {
    }
}

params

Parameters queries the parameters of the module.

Responses

Response samples

Content type
application/json
{
  • "params": { }
}

tip

Tip return best header on canonical chain

Responses

Response samples

Content type
application/json
{
  • "header": {
    }
}

Epoching

The REST API for the Epoching RPC Gateway module.

current_epoch

CurrentEpoch queries the current epoch

Responses

Response samples

Content type
application/json
{
  • "current_epoch": "114",
  • "epoch_boundary": "22800"
}

delegation_lifecycle

DelegationLifecycle queries the lifecycle of a given delegation

path Parameters
del_addr
required
string

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/delegation_lifecycle/qeewr6778fnjgdth'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "del_life": {
    }
}

epochs_info

EpochsInfo queries the metadata of epochs in a given range, depending on the parameters in the pagination request. Th main use case will be querying the latest epochs in time order.

query Parameters
start_epoch
string <uint64>
end_epoch
string <uint64>
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/epochs?start_epoch=babylond12345&end_epoch=babylond6789&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "epoch": {
    },
  • "pagination": {
    }
}

epoch_info

EpochInfo queries the information of a given epoch

path Parameters
epoch_num
required
string <uint64>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/epochs/127767843567'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "epoch": {
    }
}

epoch_msgs

EpochMsgs queries the messages of a given epoch

path Parameters
epoch_num
required
string <uint64>

epoch_num is the number of epoch of the requested msg queue

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/epochs/127767843567/messages?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "msgs": [
    ],
  • "pagination": {
    }
}

epoch_val_set

EpochValSet queries the validator set of a given epoch

path Parameters
epoch_num
required
string <uint64>
query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/epochs/127767843567/validator_set?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "validators": [
    ],
  • "total_voting_power": "500",
  • "pagination": {
    }
}

latest_epoch_msgs

LatestEpochMsgs queries the messages within a given number of most recent epochs

query Parameters
end_epoch
string <uint64>

end_epoch is the number of the last epoch to query.

epoch_count
string <uint64>

epoch_count is the number of epochs to query.

pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/epochs:latest/messages?end_epoch=babylond12345&epoch_count=5&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "latest_epoch_msgs": [
    ],
  • "pagination": {
    }
}

params

Params queries the parameters of the module.

Responses

Response samples

Content type
application/json
{
  • "params": {
    }
}

validator_lifecycle

ValidatorLifecycle queries the lifecycle of a given validator

path Parameters
val_addr
required
string

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/epoching/v1/validator_lifecycle/babylonddev877876'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "val_life": {
    }
}

Checkpointing

The REST API for the Checkpointing RPC Gateway module.

bls_public_key_list

BlsPublicKeyList queries a list of bls public keys of the validators at a given epoch number.

path Parameters
epoch_num
required
string <uint64>

epoch_num defines the epoch for the queried bls public keys

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/bls_public_keys/127767843567?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "validator_with_bls_keys": [
    ],
  • "pagination": {
    }
}

epoch_status

EpochStatus queries the status of the checkpoint at a given epoch

path Parameters
epoch_num
required
string <uint64>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/epochs/12777895643/status'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "status": "CKPT_STATUS_ACCUMULATING"
}

recent_epoch_status_count

RecentEpochStatusCount queries the number of epochs with each status in recent epochs

query Parameters
epoch_count
string <uint64>

epoch_count is the number of the most recent epochs to include in the aggregation.

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/epochs:status_count?epoch_count=12'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "tip_epoch": "115",
  • "epoch_count": "12",
  • "status_count": {
    }
}

last_checkpoint_with_status

LastCheckpointWithStatus queries the last checkpoint with a given status or a more matured status

path Parameters
status
required
string
Enum: "CKPT_STATUS_ACCUMULATING" "CKPT_STATUS_SEALED" "CKPT_STATUS_SUBMITTED" "CKPT_STATUS_CONFIRMED" "CKPT_STATUS_FINALIZED"

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/last_raw_checkpoint/CKPT_STATUS_SUBMITTED'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "raw_checkpoint": {
    }
}

params

Parameters queries the parameters of the module.

Responses

Response samples

Content type
application/json
{
  • "params": { }
}

raw_checkpoint

RawCheckpoint queries a checkpoints at a given epoch number.

path Parameters
epoch_num
required
string <uint64>

epoch_num defines the epoch for the queried checkpoint

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/raw_checkpoint/12777895643'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "raw_checkpoint": {
    }
}

raw_checkpoint_list

RawCheckpointList queries all checkpoints that match the given status.

path Parameters
status
required
string
Enum: "CKPT_STATUS_ACCUMULATING" "CKPT_STATUS_SEALED" "CKPT_STATUS_SUBMITTED" "CKPT_STATUS_CONFIRMED" "CKPT_STATUS_FINALIZED"

status defines the status of the raw checkpoints of the query

query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/checkpointing/v1/raw_checkpoint/CKPT_STATUS_SUBMITTED?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "raw_checkpoints": [
    ],
  • "pagination": {
    }
}

ZoneConcierge

The REST API for the Zone Concierge RPC Gateway module.

chain_info

ChainInfo queries the latest info of a chain in Babylon's view

path Parameters
chain_id
required
string

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/chain_info/qwertydev55667734'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "chain_info": {
    }
}

epoch_chain_info

EpochChainInfo queries the latest info of a chain in a given epoch of Babylon's view

path Parameters
chain_id
required
string
epoch_num
required
string <uint64>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/chain_info/qwertydev55667734/epochs/12778899564'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "chain_info": {
    }
}

header

Header queries the CZ header and fork headers at a given height.

path Parameters
chain_id
required
string
height
required
string <uint64>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/chain_info/qwertydev55667734/header/20'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "header": {
    },
  • "fork_headers": {
    }
}

chain_list

ChainList queries the list of chains that checkpoint to Babylon

Responses

Response samples

Content type
application/json
{
  • "chain_ids": [
    ]
}

finalized_chain_info

FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs

path Parameters
chain_id
required
string

chain_id is the ID of the CZ

query Parameters
prove
boolean

prove indicates whether the querier wants to get proofs of this timestamp.

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/finalized_chain_info/qwertydev55667734?prove=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "finalized_chain_info": {
    },
  • "epoch_info": {
    },
  • "raw_checkpoint": {
    },
  • "btc_submission_key": {
    },
  • "proof": {
    }
}

finalized_chain_info_until_height

FinalizedChainInfoUntilHeight queries the BTC-finalised info no later than the provided CZ height, with proofs

path Parameters
chain_id
required
string

chain_id is the ID of the CZ

height
required
string <uint64>

height is the height of the CZ chain such that the returned finalised chain info will be no later than this height

query Parameters
prove
boolean

prove indicates whether the querier wants to get proofs of this timestamp.

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/finalized_chain_info/qwertydev55667734/height/20?prove=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "finalized_chain_info": {
    },
  • "epoch_info": {
    },
  • "raw_checkpoint": {
    },
  • "btc_submission_key": {
    },
  • "proof": {
    }
}

list_headers

ListHeaders queries the headers of a chain in Babylon's view, with pagination support

path Parameters
chain_id
required
string
query Parameters
pagination.key
string <byte>

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offset
string <uint64>

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limit
string <uint64>

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_total
boolean

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverse
boolean

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/headers/127767843567?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "headers": [
    ],
  • "pagination": {
    }
}

list_epoch_headers

ListEpochHeaders queries the headers of a chain timestamped in a given epoch of Babylon, with pagination support

path Parameters
chain_id
required
string
epoch_num
required
string <uint64>

Responses

Request samples

curl --request GET \
--url 'http://api.testnet.babylonchain.io/api/babylon/zoneconcierge/v1/headers/qwertydev55667734/epochs/12778967855'\
--header 'accept: application/json' \

Response samples

Content type
application/json
{
  • "headers": [
    ]
}

params

Parameters queries the parameters of the module.

Responses

Response samples

Content type
application/json
{
  • "params": { }
}