我想使用api.rpc.payment.queryFeeDetails
api 调用(https://polkadot.js.org/docs/substrate/rpc#queryfeedetailsextrinsic-bytes-at-blockhash-feedetails)来获取有关 Substrate 区块链中特定外部费用的信息。
我正在使用这段代码来做到这一点:
const blockHash = '0x8ad4960941190d155b22bf3c1c6aeacb4cdcfcc87b519a87106be7dfd342ae1d';
const { block } = await api.rpc.chain.getBlock(blockHash);
const info = await api.rpc.payment.queryFeeDetails(block.extrinsics[1], blockHash);
console.log(JSON.stringify(info, null, 2));
但我收到了这个错误:
2021-04-05 18:37:35 RPC-CORE: queryInfo(extrinsic: Bytes, at?: BlockHash): RuntimeDispatchInfo:: 1: Unable to query dispatch info.: Execution, ApiCould not convert parameter `uxt` between node and runtime: Invalid transaction version
Error: 1: Unable to query dispatch info.: Execution, ApiCould not convert parameter `uxt` between node and runtime: Invalid transaction version
at RpcCoder._checkError (/root/test/node_modules/@polkadot/rpc-provider/coder/index.cjs:84:13)
at RpcCoder.decodeResponse (/root/test/node_modules/@polkadot/rpc-provider/coder/index.cjs:47:10)
at WsProvider.value (/root/test/node_modules/@polkadot/rpc-provider/ws/index.cjs:231:90)
at W3CWebSocket.value [as onmessage] (/root/test/node_modules/@polkadot/rpc-provider/ws/index.cjs:211:153)
at W3CWebSocket._dispatchEvent [as dispatchEvent] (/root/test/node_modules/yaeti/lib/EventTarget.js:107:17)
at W3CWebSocket.onMessage (/root/test/node_modules/websocket/lib/W3CWebSocket.js:234:14)
at WebSocketConnection.<anonymous> (/root/test/node_modules/websocket/lib/W3CWebSocket.js:205:19)
at WebSocketConnection.emit (events.js:315:20)
at WebSocketConnection.processFrame (/root/test/node_modules/websocket/lib/WebSocketConnection.js:554:26)
at /root/test/node_modules/websocket/lib/WebSocketConnection.js:323:40
我做错了什么?