我正在编写打字稿代码来获取块信息。我已连接到wss://kusama-rpc.polkadot.io。我正在关注官方 polkadot js api文档。
我正在调用api.rpc.chain.getBlock方法获取块信息,它以 json 形式返回块信息:
{
"header": {
"parentHash": "0xf292579563eb2f12e7a1571643d5285a072f04694397758cae76b38075daf631",
"number": 1134,
"stateRoot": "0x468de0ef831c96f56d518017b18d76a89f35f30371c45866d12c12ca2116a407",
"extrinsicsRoot": "0x4875f3ab89c2a3c30f5de8be2ac40cfaee02059fd69ea76115550a418db5fcc8",
"digest": {
"logs": [
"0x066175726120d86ae01200000000",
"0x05617572610101be3d6d596445d3cb3b711da09e22f9f24c283306744657ce397d17ff1dbf9859051def7406cd356b2d3d2add155d76618f6b098de0c4ce6b7620106ec00e1188"
]
}
},
"extrinsics": [
"0x280401000bc0ca26af7001"
]
}
我如何获得外部细节 -
{
"method": {
"callIndex": "0x0200",
"section":"timestamp",
"method": "set",
"args" : [
"1,582,827,870,000"
]
},
"isSigned": false
}
我假设我得到的外部编码是编码的,解码它的方法是什么?