2018-09-27 07:06:40 -07:00
---
swagger : '2.0'
info :
version : 1.1 .0
title : Gaia-Lite (former LCD) to interface with Cosmos BaseServer via REST
description : Specification for Gaia-lite provided by `gaiacli rest-server`
tags :
- name : ICS0
description : Tendermint APIs, such as query blocks, transactions and validatorset
- name : ICS20
description : Create and sign a send tx
- name : version
description : Information about the app version
2018-09-29 20:42:12 -07:00
schemes :
- https
2018-09-27 07:06:40 -07:00
securityDefinitions :
kms :
type : basic
paths :
/version :
get :
summary : Version of Gaia-lite
tags :
- version
description : Get the version of gaia-lite running locally to compare against expected
responses :
200 :
description : Plaintext version i.e. "v0.5.0"
/node_version :
get :
summary : Version of the connected node
tags :
- ICS0
description : Get the version of the SDK running on the connected node to compare against expected
responses :
200 :
description : Plaintext version i.e. "v0.5.0"
/node_info :
get :
description : Information about the connected node
summary : The properties of the connected node
tags :
- ICS0
produces :
- application/json
responses :
200 :
description : Node status
schema :
type : object
properties :
2018-09-29 20:42:12 -07:00
id :
type : string
2018-09-27 07:06:40 -07:00
moniker :
type : string
2018-09-29 20:42:12 -07:00
example : validator-name
2018-09-27 07:06:40 -07:00
network :
type : string
example : gaia-2
2018-09-29 20:42:12 -07:00
channels :
2018-09-27 07:06:40 -07:00
type : string
listen_addr :
type : string
example : 192.168 .56 .1 : 26656
version :
description : Tendermint version
type : string
example : 0.15 .0
other :
description : more information on versions
type : array
items :
type : string
/syncing :
get :
summary : Syncing state of node
tags :
- ICS0
description : Get if the node is currently syning with other nodes
responses :
200 :
description : '"true" or "false"'
/blocks/latest :
get :
summary : Get the latest block
tags :
- ICS0
produces :
- application/json
responses :
200 :
description : The latest block
schema :
2018-09-29 20:42:12 -07:00
$ref : "#/definitions/QueryBlock"
2018-09-27 07:06:40 -07:00
/blocks/{height}:
get :
summary : Get a block at a certain height
tags :
- ICS0
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : path
name : height
description : Block height
required : true
type : number
2018-09-27 07:06:40 -07:00
responses :
200 :
description : The block at a specific height
schema :
2018-09-29 20:42:12 -07:00
$ref : "#/definitions/QueryBlock"
2018-09-27 07:06:40 -07:00
404 :
description : Block at height is not available
/validatorsets/latest :
get :
summary : Get the latest validator set
tags :
- ICS0
produces :
- application/json
responses :
200 :
description : The validator set at the latest block height
schema :
type : object
properties :
block_height :
type : number
validators :
type : array
items :
$ref : "#/definitions/Validator"
/validatorsets/{height}:
get :
summary : Get a validator set a certain height
tags :
- ICS0
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : path
name : height
description : Block height
required : true
type : number
2018-09-27 07:06:40 -07:00
responses :
200 :
description : The validator set at a specific block height
schema :
type : object
properties :
block_height :
type : number
validators :
type : array
items :
$ref : "#/definitions/Validator"
404 :
description : Block at height not available
/txs/{hash}:
get :
summary : Get a Tx by hash
tags :
- ICS0
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : path
name : hash
description : Tx hash
required : true
type : string
2018-09-27 07:06:40 -07:00
responses :
200 :
description : Tx with the provided hash
schema :
2018-09-29 20:42:12 -07:00
$ref : "#/definitions/TxQuery"
2018-09-27 07:06:40 -07:00
404 :
description : Tx not available for provided hash
2018-09-29 21:35:06 -07:00
/txs :
2018-09-29 20:42:12 -07:00
get :
tags :
- ICS0
2018-09-29 21:35:06 -07:00
summary : Search transactions
description : Search transactions by tag
2018-09-29 22:26:44 -07:00
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
2018-09-27 07:06:40 -07:00
- in : query
name : tag
2018-09-29 20:42:12 -07:00
type : string
2018-09-29 21:35:06 -07:00
description : "transaction tag, for instance: sender_bech32=`'cosmos1g9ahr6xhht5rmqven628nklxluzyv8z9jqjcmc'`"
2018-09-27 07:06:40 -07:00
required : true
- in : query
name : page
description : Pagination page
2018-09-29 20:42:12 -07:00
type : integer
2018-09-27 07:06:40 -07:00
- in : query
name : size
description : Pagination size
2018-09-29 20:42:12 -07:00
type : integer
2018-09-27 07:06:40 -07:00
responses :
200 :
description : All Tx matching the provided tags
2018-09-29 20:42:12 -07:00
schema :
type : array
items :
$ref : "#/definitions/TxQuery"
2018-09-27 07:06:40 -07:00
404 :
description : Pagination is out of bounds
post :
tags :
- ICS0
summary : broadcast Tx
2018-09-29 21:35:06 -07:00
description : broadcast tx with tendermint rpc
2018-09-29 22:26:44 -07:00
consumes :
- application/json
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : body
name : txBroadcast
2018-09-30 18:24:53 -07:00
description : Build a StdTx transaction and serilize it to a byte array with amino, then the `"tx"` field in the post body will be the base64 encoding of the byte array. The supported return types includes `"block"`(return after tx commit), `"sync"`(return afer CheckTx) and `"async"`(return right away).
2018-09-29 20:42:12 -07:00
required : true
schema :
$ref : "#/definitions/TendertmintTx"
2018-09-27 07:06:40 -07:00
responses :
200 :
description : Broadcast tx result
2018-09-29 22:26:44 -07:00
schema :
$ref : "#/definitions/BroadcastTxCommitResult"
2018-09-29 20:42:12 -07:00
/tx/sign :
2018-09-27 07:06:40 -07:00
post :
tags :
- ICS20
summary : Sign a Tx
description : Sign a Tx providing locally stored account and according password
2018-09-29 22:26:44 -07:00
consumes :
- application/json
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : body
name : sendToken
description : sign tx
required : true
schema :
$ref : "#/definitions/TxSign"
2018-09-27 07:06:40 -07:00
responses :
200 :
description : The signed Tx
2018-09-29 20:42:12 -07:00
schema :
$ref : "#/definitions/StdTx"
2018-09-27 07:06:40 -07:00
401 :
description : Account name and/or password where wrong
2018-09-29 20:42:12 -07:00
/tx/broadcast :
2018-09-27 07:06:40 -07:00
post :
tags :
- ICS20
2018-09-29 22:26:44 -07:00
summary : Send a signed Tx
description : Send a signed Tx to a Gaiad full node
2018-09-29 20:42:12 -07:00
consumes :
- application/json
2018-09-29 22:26:44 -07:00
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : body
name : txBroadcast
description : broadcast tx
required : true
schema :
$ref : "#/definitions/TxBroadcast"
2018-09-27 07:06:40 -07:00
responses :
202 :
description : Tx was send and will probably be added to the next block
2018-09-29 22:26:44 -07:00
schema :
$ref : "#/definitions/BroadcastTxCommitResult"
2018-09-27 07:06:40 -07:00
400 :
description : The Tx was malformated
/bank/balances/{address}:
get :
summary : Get the account balances
tags :
- ICS20
produces :
- application/json
2018-09-29 20:42:12 -07:00
parameters :
- in : path
name : address
description : Account address in bech32 format
required : true
type : string
2018-09-27 07:06:40 -07:00
responses :
200 :
description : Account balances
schema :
2018-09-29 20:42:12 -07:00
type : array
items :
$ref : "#/definitions/Coin"
2018-09-27 07:06:40 -07:00
204 :
description : There is no data for the requested account. This is not a 404 as the account might exist, just does not hold data.
/bank/accounts/{address}/transfers:
post :
summary : Send coins (build -> sign -> send)
2018-09-29 20:42:12 -07:00
description : Send coins (build -> sign -> send)
2018-09-27 07:06:40 -07:00
tags :
- ICS20
consumes :
- application/json
2018-09-29 22:26:44 -07:00
produces :
- application/json
2018-09-27 07:06:40 -07:00
parameters :
2018-09-29 20:42:12 -07:00
- in : query
name : simulate
description : if true, ignore the gas field and perform a simulation of a transaction, but don't broadcast it
required : false
2018-09-29 22:26:44 -07:00
type : boolean
2018-09-29 20:42:12 -07:00
- in : query
name : generate_only
description : if true, build an unsigned transaction and write it back
required : false
2018-09-29 22:26:44 -07:00
type : boolean
2018-09-29 20:42:12 -07:00
- in : path
name : address
description : Account address in bech32 format
required : true
type : string
2018-09-27 07:06:40 -07:00
- in : body
name : account
description : The password of the account to remove from the KMS
2018-09-29 20:42:12 -07:00
required : true
2018-09-27 07:06:40 -07:00
schema :
type : object
properties :
2018-09-29 22:26:44 -07:00
base_req :
$ref : "#/definitions/BaseReq"
2018-09-27 07:06:40 -07:00
amount :
type : array
items :
2018-09-29 20:42:12 -07:00
$ref : "#/definitions/Coin"
2018-09-27 07:06:40 -07:00
responses :
202 :
description : Tx was send and will probably be added to the next block
2018-09-29 22:26:44 -07:00
schema :
$ref : "#/definitions/BroadcastTxCommitResult"
2018-09-27 07:06:40 -07:00
400 :
description : The Tx was malformated
definitions :
2018-09-29 22:26:44 -07:00
CheckTxResult :
type : object
properties :
code :
type : integer
data :
type : string
gas_used :
type : integer
gas_wanted :
type : integer
info :
type : string
log :
type : string
tags :
type : array
items :
"$ref": "#/definitions/KVPair"
example :
code : 0
data : data
log : log
gas_used : 5000
gas_wanted : 10000
info : info
tags :
- ''
- ''
DeliverTxResult :
type : object
properties :
code :
type : integer
data :
type : string
gas_used :
type : integer
gas_wanted :
type : integer
info :
type : string
log :
type : string
tags :
type : array
items :
"$ref": "#/definitions/KVPair"
example :
code : 5
data : data
log : log
gas_used : 5000
gas_wanted : 10000
info : info
tags :
- ''
- ''
BroadcastTxCommitResult :
type : object
properties :
check_tx :
$ref : "#/definitions/CheckTxResult"
deliver_tx :
$ref : "#/definitions/DeliverTxResult"
hash :
$ref : "#/definitions/Hash"
height :
type : integer
2018-09-29 20:42:12 -07:00
KVPair :
type : object
properties :
key :
type : string
value :
type : string
Fee :
type : object
properties :
gas :
type : string
amount :
type : array
items :
$ref : "#/definitions/Coin"
Msg :
type : string
2018-09-27 07:06:40 -07:00
Address :
type : string
description : bech32 encoded addres
2018-09-29 20:42:12 -07:00
example : cosmoszgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
2018-09-27 07:06:40 -07:00
ValidatorAddress :
type : string
description : bech32 encoded addres
example : cosmosvaloper:zgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
PubKey :
2018-09-29 20:42:12 -07:00
type : object
properties :
type :
type : string
example : "tendermint/PubKeySecp256k1"
value :
type : string
example : "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH"
2018-09-27 07:06:40 -07:00
ValidatorPubKey :
type : string
description : bech32 encoded public key
example : cosmosvalconspub:zgnkwr7eyyv643dllwfpdwensmgdtz89yu73zq
2018-09-29 20:42:12 -07:00
Coin :
2018-09-27 07:06:40 -07:00
type : object
properties :
denom :
type : string
example : steak
amount :
2018-09-29 22:26:44 -07:00
type : string
example : "50"
2018-09-27 07:06:40 -07:00
Hash :
type : string
example : EE5F3404034C524501629B56E0DDC38FAD651F04
2018-09-29 20:42:12 -07:00
Result :
2018-09-27 07:06:40 -07:00
type : object
properties :
2018-09-29 20:42:12 -07:00
log :
2018-09-27 07:06:40 -07:00
type : string
2018-09-29 20:42:12 -07:00
gas_wanted :
type : string
example : "0"
gas_used :
type : string
example : "0"
tags :
type : array
items :
$ref : "#/definitions/KVPair"
TxQuery :
2018-09-27 07:06:40 -07:00
type : object
properties :
2018-09-29 20:42:12 -07:00
hash :
2018-09-27 07:06:40 -07:00
type : string
2018-09-29 20:42:12 -07:00
height :
type : number
tx :
$ref : "#/definitions/StdTx"
result :
$ref : "#/definitions/Result"
TendertmintTx :
2018-09-27 07:06:40 -07:00
type : object
properties :
2018-09-29 20:42:12 -07:00
tx :
2018-09-27 07:06:40 -07:00
type : string
2018-09-29 20:42:12 -07:00
return :
type : string
example : block
TxBroadcast :
2018-09-27 07:06:40 -07:00
type : object
properties :
2018-09-29 20:42:12 -07:00
tx :
$ref : "#/definitions/StdTx"
TxSign :
type : object
properties :
tx :
$ref : "#/definitions/StdTx"
name :
type : string
password :
type : string
chain_id :
2018-09-27 07:06:40 -07:00
type : string
2018-09-29 20:42:12 -07:00
account_number :
type : string
example : "0"
sequence :
type : string
example : "0"
append_sig :
type : boolean
example : true
StdTx :
type : object
properties :
msg :
type : array
items :
$ref : "#/definitions/Msg"
fee :
$ref : "#/definitions/Fee"
memo :
type : string
signature :
2018-09-27 07:06:40 -07:00
type : object
properties :
signature :
2018-09-29 20:42:12 -07:00
type : string
example : MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=
pub_key :
$ref : "#/definitions/PubKey"
account_number :
type : string
example : "0"
sequence :
type : string
example : "0"
2018-09-27 07:06:40 -07:00
Account :
type : object
properties :
name :
type : string
example : Main Account
address :
$ref : "#/definitions/Address"
pub_key :
$ref : "#/definitions/PubKey"
BlockID :
type : object
properties :
hash :
$ref : "#/definitions/Hash"
parts :
type : object
properties :
total :
type : number
example : 0
hash :
$ref : "#/definitions/Hash"
2018-09-29 20:42:12 -07:00
BlockHeader :
type : object
properties :
chain_id :
type : string
example : gaia-2
height :
type : number
example : 1
time :
type : string
example : '2017-12-30T05:53:09.287+01:00'
num_txs :
type : number
example : 0
last_block_id :
$ref : "#/definitions/BlockID"
total_txs :
type : number
example : 35
last_commit_hash :
$ref : "#/definitions/Hash"
data_hash :
$ref : "#/definitions/Hash"
validators_hash :
$ref : "#/definitions/Hash"
consensus_hash :
$ref : "#/definitions/Hash"
app_hash :
$ref : "#/definitions/Hash"
last_results_hash :
$ref : "#/definitions/Hash"
evidence_hash :
$ref : "#/definitions/Hash"
2018-09-27 07:06:40 -07:00
Block :
type : object
properties :
header :
2018-09-29 20:42:12 -07:00
$ref : "#/definitions/BlockHeader"
2018-09-27 07:06:40 -07:00
txs :
type : array
items :
2018-09-29 20:42:12 -07:00
type : string
2018-09-27 07:06:40 -07:00
evidence :
type : array
items :
2018-09-29 20:42:12 -07:00
type : string
2018-09-27 07:06:40 -07:00
last_commit :
type : object
properties :
2018-09-29 20:42:12 -07:00
block_id :
2018-09-27 07:06:40 -07:00
$ref : "#/definitions/BlockID"
precommits :
type : array
items :
type : object
2018-09-29 20:42:12 -07:00
properties :
validator_address :
type : string
validator_index :
type : string
example : "0"
height :
type : string
example : "0"
round :
type : string
example : "0"
timestamp :
type : string
example : '2017-12-30T05:53:09.287+01:00'
type :
type : number
example : 2
block_id :
$ref : "#/definitions/BlockID"
signature :
type : string
example : '7uTC74QlknqYWEwg7Vn6M8Om7FuZ0EO4bjvuj6rwH1mTUJrRuMMZvAAqT9VjNgP0RA/TDp6u/92AqrZfXJSpBQ=='
BlockMeta :
type : object
properties :
header :
$ref : "#/definitions/BlockHeader"
block_id :
$ref : "#/definitions/BlockID"
QueryBlock :
type : object
properties :
block_meta :
$ref : "#/definitions/BlockMeta"
block :
$ref : "#/definitions/Block"
2018-09-29 22:26:44 -07:00
BaseReq :
type : object
properties :
name :
type : string
password :
type : string
chain_id :
type : string
account_number :
type : string
example : "0"
sequence :
type : string
example : "0"
gas :
type : string
example : "200000"
gas_adjustment :
type : string
example : "1.2"
2018-09-27 07:06:40 -07:00
Validator :
type : object
properties :
address :
$ref : '#/definitions/ValidatorAddress'
pub_key :
$ref : "#/definitions/ValidatorPubKey"
power :
type : number
example : 1000
accum :
type : number
example : 1000