Skip to content

Commit 83e670c

Browse files
committed
refactor: use chain's exported qry lib module
1 parent 5a4b656 commit 83e670c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
Node,
2121
TreasuryId,
2222
client,
23-
getTxnState,
23+
qry,
2424
} from "chain";
2525
import { IPFSNode } from "./ipfs";
2626
import { TxHandler } from "./tx";
@@ -614,7 +614,7 @@ const executeCommand = async (
614614
.command("getTxnState <hash>")
615615
.description("get the state of a transaction")
616616
.action(async (hash: string) => {
617-
const data = await getTxnState(hash);
617+
const data = await qry.sequencer.getTxnState(hash);
618618
callback({ id, status: SUCCESS, data });
619619
});
620620

src/tx.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PrivateKey, PublicKey } from "o1js";
22
import { CommandResponse, FAILURE, PENDING } from "./types";
3-
import { getTxnStatus } from "chain";
3+
import { qry } from "chain";
44

55
interface TxTask {
66
txfn: () => Promise<void>;
@@ -65,10 +65,10 @@ export class TxHandler {
6565
// but enables submission of many txns without waiting for their confirmation.
6666
if (this.opts.nonce) this.nonce = Number(tx.transaction.nonce) + 1;
6767

68-
const { status, statusMessage } = await getTxnStatus(
69-
tx.transaction,
68+
const { status, statusMessage } = await qry.indexer.getTxStatus(
69+
tx.transaction.hash().toString(),
7070
() => {
71-
console.log("⏳ waiting for tx to be confirmed...");
71+
console.log("⏳ Waiting for tx status...");
7272
},
7373
parseInt(this.opts.txStatusInterval),
7474
parseInt(this.opts.txStatusRetries),

0 commit comments

Comments
 (0)