Skip to content

Instantly share code, notes, and snippets.

@aaroncox aaroncox/get_client Secret
Last active Dec 12, 2019

Embed
What would you like to do?
example calls to the Fuel API layer
# get client information
curl http://eos.greymass.com/v1/fuel/get_client -d '{"client":"teamgreymass"}'
{
"balance": 500,
"cosigner": "greymassfuel",
"rules": [
{
"accounts": [
"teamgreymass"
],
"quota_cpu": 999999999,
"quota_net": 999999999,
"quota_expire": 86400,
"whitelist": []
}
]
}
# get client usage
curl http://eos.greymass.com/v1/fuel/get_client_usage -d '{"client":"teamgreymass"}'
[
{
"transaction_id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"accounts": [
"greymassfuel",
"jesta.game"
],
"billed_at": 35,
"billed_to": "teamgreymass",
"datetime": "2019-12-09T20:54:16.656Z",
"estimated": true,
"estimates": {
"billed": 68,
"cpu": 1949,
"net": 136
},
"billed": 39,
"response": {
"id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"block_num": 94154123,
"block_time": "2019-12-09T20:54:16.500",
"cpu": 1101,
"net": 160
}
}
]
# get client usage by a specific account (estimated = true, showing pending information)
curl http://eos.greymass.com/v1/fuel/get_client_usage -d '{"client":"teamgreymass", "account": "jesta.game"}'
[
{
"transaction_id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"accounts": [
"greymassfuel",
"jesta.game"
],
"billed_at": 35,
"billed_to": "teamgreymass",
"datetime": "2019-12-09T20:54:16.656Z",
"estimated": true,
"estimates": {
"billed": 68,
"cpu": 1949,
"net": 136
},
"billed": 39,
"response": {
"id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"block_num": 94154123,
"block_time": "2019-12-09T20:54:16.500",
"cpu": 1101,
"net": 160
}
}
]
# get client usage by a specific account (estimated = null, actual = actual information)
curl http://eos.greymass.com/v1/fuel/get_client_usage -d '{"client":"teamgreymass", "account": "jesta.game"}'
[
{
"transaction_id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"accounts": [
"greymassfuel",
"jesta.game"
],
"billed_at": 35,
"billed_to": "teamgreymass",
"datetime": "2019-12-09T20:54:16.656Z",
"estimates": {
"billed": 68,
"cpu": 1949,
"net": 136
},
"billed": 44,
"response": {
"id": "7fa882e22f99d8f0c0f9c8b06a46792d6c3c29d8da671ebc2a627adcc7ea941c",
"block_num": 94154123,
"block_time": "2019-12-09T20:54:16.500",
"cpu": 1101,
"net": 160
},
"actual": {
"block_num": 94154124,
"cpu": 1260,
"net": 160,
"updated": "2019-12-09T20:57:57.223Z"
}
}
]
# get quota usage for account
curl http://eos.greymass.com/v1/fuel/get_quota_usage -d '{"account":"gu2deojsgmge"}'
[
{
"cpu": 1530,
"net": 360,
"ruleset": {
"account": "gu2deojsgmge",
"cosigner": "greymassfuel"
}
}
]
# get transaction and billing information
curl http://eos.greymass.com/v1/fuel/get_transaction -d '{"transaction_id": "dd0a5177893bb0a1fef76ac443dce93bdf140b79264e1f0c16894e9cfd078654"}'
{
"transaction_id": "dd0a5177893bb0a1fef76ac443dce93bdf140b79264e1f0c16894e9cfd078654",
"accounts": [
"greymassfuel",
"gu2deojsgmge"
],
"cosigner": "greymassfuel",
"datetime": "2019-12-09T20:37:10.746Z",
"estimates": {
"billed": 34,
"cpu": 962,
"net": 144
},
"sig0": "SIG_K1_Kheftv943nRdpTaceAC8Y4jQb4XYLdedwDKdo8LSDCNZrsS38yusoKFDi3crqVoeN7GUgkKaRyxCNSgNbyQtxRAZYbHTio",
"sig1": "SIG_K1_KB7fnUYSfrMQ4MtN2McQP7iqwc7N2pFqhwkKnHWRDTesTzD1pgcJyy3463bQUKFqRwnvcJaiEtNxyaxKRnZfAX9jaZnLYt",
"updated": "2019-12-09T20:40:01.068Z",
"response": {
"id": "dd0a5177893bb0a1fef76ac443dce93bdf140b79264e1f0c16894e9cfd078654",
"block_num": 94152083,
"block_time": "2019-12-09T20:37:10.500",
"cpu": 486,
"net": 168
},
"success": true,
"actual": {
"block_num": 94152084,
"cpu": 527,
"net": 168,
"updated": "2019-12-09T20:40:01.898Z"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.