getBlock()
Retrieving a blockchain block is not a transaction; it's simply a request executed by a single node. Sometimes, it might be necessary to send the same request multiple times to obtain the right copy
Method Signature
async function getBlock(blockchain, num)
Parameters
Name
Type
Description
blockchain
string
Blockchain address in hex
num
int
The number of the block you're looking for
Example
var blockchain = "0x8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2";
var block = await CircularProtocolAPI.getBlock(blockchain, 29);
Result
The result will be of type JSON
.
{
"Result": 200,
"Response": {
"Block": {
"BlockID": 29,
"Blockchain": "8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2",
"Nonce": 1530,
"Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4",
"PreviousBlockHash": "0002e21b0a2e2eaa8dfecb9925ab4dbbcf95c0411c0ce2b706df7ffce9ed18eb",
"TimeStamp": "2024:04:08-21:31:10",
"Payload": {
"Transactions": [
{
"ID": "64583b70f57f47640b25d42df6ba99dd6956db6d9972b3c71a9400fc374e46dc",
"From": "e2e86db8f44ceae4750a2a055b38cb3ae326bc1c282f09e7c0cc1f585984bdf2",
"To": "e2e86db8f44ceae4750a2a055b38cb3ae326bc1c282f09e7c0cc1f585984bdf2",
"Timestamp": "2024:04:08-21:30:57",
"Type": "C_TYPE_ASSET",
"Payload": "7b22416374696f6e223a2243505f435245415445222c224e616d65223a224d544b222c224465736372697074696f6e223a2231222c2254797065223a224352435f544f4b454e5f30313233222c2255524c223a22222c2255524c54797065223a224e6f6e65222c22416d6f756e74223a22313131222c2256616c7565223a2231222c22456e61626c6553776170223a2253776170222c22526f79616c74696573223a2230227d",
"Nonce": "17",
"OSignature": "304502206113c781fc6c88b787b2fb1219bbaef2ce8559dadcdaad3af4c8ffc41b803a0c022100db0bb7b78d001291d039f23b04a2959415d1a66b08bf4d1101d73ae2fba8a589",
"NodeID": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4",
"GasLimit": 0.000000,
"NagFee": 0.000000,
"BroadcastFee": 0.000000,
"ProcessingFee": 0.000000,
"DeveloperFee": 0.000000,
"ProtocolFee": 0.000000,
"Instructions": 0,
"Status": "Rejected: Asset Already Minted"
}
],
"BlockReward": 166.670000
}
},
"Hash": "00054c1dd524137cfdad62c491a2f975a564b89523850420e239afdcd83dce21",
"Signature": "30460221009164d45e5a78324eb7d6d473e2cecd6e3075678c58b1e2acc2401d1f5cc23d3a022100b425ec6a01023fab21765cbd6c7a6e685072f1aaa26674a14ef8b7b857b26254",
"SelectedNode": "fc8fe5ee103dafe353c98ce90a1cb2956fd51a109512e074bd3d26a06d268e81"
},
"Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}
Block not found:
{
"Result": 116,
"Response": "Block Not Found",
"Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}
Wrong blockchain address:
{
"Result": 117,
"Response": "Blockchain Not Found",
"Node": "fc8fe5ee103dafe353c98ce90a1cb2956fd51a109512e074bd3d26a06d268e81"
}
Last updated