-
Notifications
You must be signed in to change notification settings - Fork 0
API : Block & Node
王辰 edited this page Jan 3, 2020
·
5 revisions
const api = new boxdjs.Api(fetch, <http://xxx>, 'http')Get current block height.
-
block-height <number>
const { height } = await api.getCurrentBlockHeight()Get block-hash by block-height.
* block-height <number>
block-hash <string>
const { hash } = await api.getBlockHashByHeight(11001)View block-detail by (hash | height).
* type <'block_hash' | 'block_height'>
* value <string | number>
block-detail <object>
await api.viewBlockDetail('block_hash', 'd9984d512645a95899a703b8ba962a8d24f1f5efc9206ec652ede9126b0e58c4')
await api.viewBlockDetail('block_height', 11001)Get block-header by (hash | height).
* type <'block_hash' | 'block_height'>
* value <string | number>
block-header <object>
await api.getBlockHeader('block_hash', 'd9984d512645a95899a703b8ba962a8d24f1f5efc9206ec652ede9126b0e58c4')
await api.getBlockHeader('block_height', 11001)By Contentbox