Reporting API Everyone loves seeing the additional crypto they are earning. Staked provides an API for full access to the details.
Get Balance Of All Provisioned Nodes
GET
https://mainnet.staked.cloud/api/reports/:chain/balance
Get the balance of all nodes provisioned through the Node Provisioning API .
Path Parameters
Query Parameters
200: OK
Copy {
"total_balance" : 32000000000000000000 ,
"balances" : [
{ // active validator
"balance" : 32000000000000000000 ,
"block" : 62421 ,
"timestamp" : "2021-09-15T22:25:25.737607" ,
"address" : "validator public key" ,
"currency" : "ETH2.0" ,
"conversion_factor_power" : 18 ,
"attributes" : {
"status" : "ACTIVE" ,
}
} ,
{ // validator provisioned but not deposited into
"balance" : null ,
"block" : null ,
"timestamp" : "2021-09-15T22:25:25.737607" ,
"address" : "validator public key" ,
"currency" : "ETH2.0" ,
"conversion_factor_power" : 18 ,
"attributes" : {}
}
]
}
Get Balance Of Address
GET
https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/balance
Get the balance of an address that has delegated to Staked.
Path Parameters
Query Parameters
200
Copy {
"balance" : 5000000 ,
"timestamp" : "2019-07-08T17:09:08.753866" ,
"address" : "KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr"
}
Balance Object Schema
React w/ Axios jQuery Node.js Swift
Copy import axios from "axios" ;
const api_key = 'YOUR API KEY' ;
const chain = 'TEZOS' ;
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr' ;
var api = axios .create ({
baseURL : "https://mainnet.staked.cloud/api" ,
timeout : 1000000
});
api . defaults . headers .post[ "Content-Type" ] = "application/json" ;
api .get ( `/reports/ ${ chain } /delegator/ ${ address } /balance?api_key= ${ api_key } ` ) .then (response => {
console .log (res);
})
Copy const api_key = 'YOUR API KEY' ;
const chain = 'TEZOS' ;
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr' ;
var request = {
"url" : `https://mainnet.staked.cloud/api/reports/ ${ chain } /delegator/ ${ address } /balance?api_key= ${ api_key } ` ,
"method" : "GET" ,
"timeout" : 0 ,
};
$ .ajax (request) .done ( function (response) {
console .log (response);
});
Copy var http = require ( 'http' );
const api_key = 'YOUR API KEY' ;
const chain = 'TEZOS' ;
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr' ;
var options = {
'method' : 'GET' ,
'hostname' : 'mainnet.staked.cloud' ,
'path' : `/api/reports/ ${ chain } /delegator/ ${ address } /balance?api_key= ${ api_key } `
};
var req = http .request (options , function (res) {
var chunks = [];
res .on ( "data" , function (chunk) {
chunks .push (chunk);
});
res .on ( "end" , function (chunk) {
var body = Buffer .concat (chunks);
console .log ( body .toString ());
});
res .on ( "error" , function (error) {
console .error (error);
});
});
req .end ();
Copy import Alamofire
let api_key = 'YOUR API KEY';
let chain = 'TEZOS';
let address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr';
AF.request("https://mainnet.staked.cloud/api/reports/\(chain)/delegator/\(address)/balance?api_key=\(api_key)").response { response in
debugPrint ( response )
}
Get Detailed Balance of Address
GET
https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/detailed_balance
Get the detailed balance (summary view of rewards and the staked balance) of an address. The detail param is used to describe the results - "monthly" returns an array of detailed balance objects aggregated by month, "by_period" returns an array of detailed balance objects for each state change (delegation or reward).
Path Parameters
Query Parameters
200
Copy {
"results": [
{
"timestamp": "2020-08-27T14:12:31.722731",
"block": null,
"total_delegation": 3874585409425.0,
"delegation": 3876252281981.0,
"balance": 3897899084922.0,
"total_reward_and_fees": 23313675497.0,
"reward_and_fees": 23313675497.0,
"total_reward": 23304218223.0,
"reward": 23304218223.0,
"total_fees": 9457274.0,
"fees": 9457274.0,
"total_gross_return": 0.006681130527750926,
"gross_return": 0.006681130527750926,
"annualized_gross_return": 0.016456788919817385,
"block_explorer_url": null,
"kind": null,
"conversion_factor_power": 6,
"currency": "Tezos"
}
],
"page": 1,
"pages": 1,
"per_page": 10,
"total": 1
}
Response Object Schema
Detailed Balance Object Schema
Detailed balance objects are returned for every state change of an account (stake, reward, unstake).
Get Transactions (and rewards) of All Provisioned Nodes
GET
https://mainnet.staked.cloud/api/reports/:chain/txns
Get the transactions for all nodes provisioned through the Staked API associated with your API key. Use the kind parameter to specify which type of transactions to query.
Path Parameters
Query Parameters
200: OK
Copy [
{
"id" : id ,
"kind" : Transaction Kind ,
"transaction_time" : Transaction Time ,
"transaction_address" : Transaction Address ,
"holding_address" : Holding Address ,
"amount" : Amount ,
"reward" : Reward ,
"fees" : Fees ,
"total" : Total ,
"denom" : Denomination ,
"block_reference" : Block Reference
}
]
Get Transactions (and rewards) of Address
GET
https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/txns
Get the transactions for an address that has delegated to Staked. Use the kind parameter to specify which type of transactions to query.
Path Parameters
Query Parameters
200
Copy [
{
"id": id,
"kind": Transaction Kind,
"transaction_time": Transaction Time,
"transaction_address": Transaction Address,
"holding_address": Holding Address,
"amount": Amount,
"reward": Reward,
"fees": Fees,
"total": Total,
"denom": Denomination,
"block_reference": Block Reference
}
]
Transaction Object Schema
Transaction Kind Enum