Hot answers tagged

14

Unfortunately there is no way to directly query just the delegator's reward from TzScan API. But you can easily use this API call with some extra calculations: //This is what the baker got var total_reward = rewards + extra_rewards - losses; //This is the delegator's share in the staking balance var share = balance / staking_balance; //This is the ...


12

TzScan has a service for that, but only for the current value: https://api1.tzscan.io/v1/supply returns { "dls":"76431859801260", "foundation":"76431859801260", "early_bakers":"3156502294100", "contributors":"608297709519372", "unfrozen_rewards":"19546676770764", "missing_revelation":0, "revelation_rewards":968500000, "...


12

<block_id> - is a hash or a level of the block at which you ask for balance. If you want to get a simple balance at the specific point in the cycle: (this is pseudocode, I hope you figure it out) var cycle = 60; var p1 = (cycle * 4096 + 1) + 0; //beginning of the cycle var p2 = (cycle * 4096 + 1) + 4095; //end of the cycle var balance_at_p1 = get('...


8

You can use TzScan API for this: /v3/balance_history/KT1..., the documentation is here: balance history doc. For example https://api6.tzscan.io/v3/balance_history/KT1GgUJwMQoFayRYNwamRAYCvHBLzgorLoGo


7

You've encountered a mixed content error. Requests can't be a mixture of http and https, they need to be all of the same, preferably https. Just change the const url = 'http://api6.tzscan.io/v3/supply'; to be https const url = 'https://api6.tzscan.io/v3/supply'; fetch(url) .then(resp => resp.json()) .then(({dls}) => { let span = createNode('span')...


6

The current protocol does not keep track of a tally of all tez on the network. It would be a good idea to do so, as it permits computing proportional reward, it can serve as a canari against money printing bugs, and it can be used to refine the governance model. Since the protocol doesn't keep track of it, there's no node RPC that will give you that ...


6

Here the RPC API method: /chains/main/blocks/head/context/delegates/tz1.../delegated_contracts Worth to know: If you are working on baking-related software, you should be careful with the level of the block where you get the context. Probably, you might want to use snapshot blocks instead of head, as in example above.


6

This happened directly as part of the context "stitching". When a new protocol is activated, an initialization function is called which lets the new protocol performs some housekeeping on the context to make it compatible with the new code base. This can include changing some of the data structures involved in representing the ledger (e.g. roll base) but, in ...


5

As of the current Babylon protocol and the upcoming Carthage, the RPC only provides you the ability to retrieve the value for a known key that you provide to the RPC. But even in this scenario you need to provide not the readable key you stored, but a hash of that key as that is how it is represented internally. This answer describes how to call the RPC The ...


5

You can stop delegating using the following command: tezos-client withdraw delegate from See here for a list of all client commands.


5

I think this will help you find what you're looking for. https://tzstats.com/docs/api/index.html#introduction. I've searched this resource and found numerous endpoints related to delegates, rewards, account hashes, delegation, etc. EDIT: Yesterday, they've also announced plans to go open-source. https://tzstats.com/blog/next-gen-blockchain-indexing-for-...


4

You can use the operations endpoint, filtering for transactions: https://api1.tzscan.io/v1/operations/$address?type=Transaction Obviously swap address for the address in question. You can retreive the amount, destination, source, fee, gas limit, storage limit, if the tx was internal and also if the tx failed or not.


4

From my understanding, yes and no. There are four groups of operations: Baking - endorsements Voting - proposals and ballots Annonymous - seed_nonce_revelation, double_bake/endorse, activate_account Manager - reveal, delegation, transaction, origination I believe you can combine different operations from the same group.


4

You can use the HTTP-RPC interface on your local node. http://localhost:8732/chains/main/blocks/{BLOCK}/context/contracts/{ADDRESS}/balance On a default node, this is only good for the previous 5 cycles. If you want balances older than that, you need to use an archive node. Other options are to use the API provided by most block explorers like tzstats.com ...


4

The tezos-client transfer command takes the --dry-run flag that will simulate a transaction instead of injecting it. It will show you any updates of storage and balances that would've been performed if the transaction is successful and immediately applied on node's blockchain state. If you want to do this programmatically using the node's RPC API, you can ...


3

There are two representations of timestamps in the Tezos protocol: The one defined in Time_repr module: timestamps are 64-bits integers The one defined in Script_timestamp_repr module: timestamps are unbounded integers The Michelson interpreter uses the second representation so timestamp arithmetics in Michelson cannot fail. The rest of the protocol uses ...


3

We maintain an index of all historic bigmap data at TzStats. To fetch all current keys and values in a bigmap call https://api.tzstats.com/explorer/bigmap/:id/values If your bigmap is very large you can page through the result with limit and offset parameters (default is 100 entries, max is 500). See our bigmap docu for more details and examples. If you ...


3

https://api.tzstats.com/tables/account?delegate=tz1ADDRESS The full API used for the 'Delegators' tab: curl 'https://api.tzstats.com/tables/account?delegate=tz1ADDRESS&is_funded=1&columns=row_id,address,delegated_balance,spendable_balance,unclaimed_balance,delegated_since_time,delegated_since&limit=60'


3

The first element returned from https://api6.tzscan.io/v3/rolls_history/tz1NortRftucvAkD1J58L32EhSVrQEWJCEnB?number=1 is the data from the latest cycle. HTML <h1>Last Cycle</h1> <div id="cycle"></div> <div id="rollCount"></div> <div id="rollTotal"></div> JavaScript const url = 'https://api6.tzscan.io/v3/...


2

Thanks to our friend Klassare, who helped me in Riot channel, we've got an answer: https://api3.tzscan.io/v3/delegated_contracts/[account]?p=0&number=50


2

The protocol by itself does not track that number (though it would be useful if it did, for many reasons). This leaves one option, use an indexer that tracks the total supply, and updates it block by block by analyzing how many tokens were created, and how many were burned.


2

There is the "streaming" RPC /monitor/heads/[chain_id] that tells you every time the node changes its head. It returns a stream of JSON objects looking like {"hash":[...],"level":[...],"proto":[...],"predecessor":[...],"timestamp":[...],"validation_pass":4,[...]} When no reorg occurred, ...


2

Seems like it is application/octet-stream - found that just after posting


1

Turns out the the chain_id returned from the /chains/main/chain_id looks like this: ""Net...\n"" which the run_operation did not like


1

There is documentation on serialization here: https://tezos.gitlab.io/api/p2p.html And a usefull implementation from the Airgap Team at: https://github.com/airgap-it/airgap-coin-lib/tree/master/src/protocols/tezos RPC call for Injection (<=> publishing) is: POST node_url/injection/operation with Body: "rax_transaction_bytes_as_hex_string"


1

The babylonnet.sh script accepts node options. You can inspect the node options via tezos-node run --help. The option you're looking for is: --cors-origin=ORIGIN: CORS origin allowed by the RPC server via Access-Control-Allow-Origin; may be used multiple times


1

You can export a .csv file from the arronax block explorer: https://arronax-beta.cryptonomic.tech/ You can also pull the data directly from the API: https://github.com/Cryptonomic/Conseil


1

I wrote simple html with JS script: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="eztz.min.js"></script> </head> <body> <h3>Wallets:</h3> <p id = "text-id"></p> </body> <script> let text = ""; for (...


1

Tezos.ID's APIs should exist already, but are not yet available for public use. See https://tezos.id/roadmap saying that they will be released around the end of July 2019.


1

It's on the site. Just go tzscan and click API, or here you go https://tzscan.io/api


Only top voted, non community-wiki answers of a minimum length are eligible