Skip to content

Commit 6395f7a

Browse files
committed
chenged result param
1 parent d47037c commit 6395f7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/read.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ async function main() {
9595
const headerResponse = await chain.nextJsonRpcResponse();
9696
const headerParsed = JSON.parse(headerResponse);
9797
console.log("Current head block number:", parseInt(headerParsed.result.number, 16));
98+
99+
chain.sendJsonRpc(`{"jsonrpc":"2.0","id":2,"method":"author_submitAndWatchExtrinsic","params":["${signedTx.toHex()}"]}`);
98100
return chain;
99101
})
100102
.then(async (chain) => {
@@ -108,8 +110,8 @@ async function main() {
108110
console.log("Transaction status:", parsed);
109111

110112
// Check if transaction is finalized
111-
if (parsed.params?.result?.Finalized) {
112-
console.log("✅ Transaction finalized in block:", parsed.params.result.Finalized);
113+
if (parsed.params?.result?.inBlock) {
114+
console.log("✅ Transaction finalized in block:", parsed.params.result.inBlock);
113115
break;
114116
}
115117

0 commit comments

Comments
 (0)