Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How do I get the result and status of transactions with the TonWeb SDK?

Can anyone explain how to get the result of transaction after sending it? The TonSDK send transaction method is returning .boc. Also, how can I get the status of this kind of response?

When I check TON API & Toncenter they only accept transaction of hashes for querying transaction information.

Votes Newest

Answers


In my personal experience, I would use code like this to track the result of a transaction:

=== Your Code Parameters === 
.....

console.log("============================");
console.log("Interacting with Collection Contract: \n" + contract_address);
let seqno: number = await wallet_address.getSeqno();
let transfer = await wallet_address.sendTransfer({
    seqno: seqno,
    secretKey: keyPair.secretKey,
    messages: [
        internal({
            value: toNano("0.75"),
            to: contract_address,
            init: { code: init.code, data: init.data },
            bounce: true,
            body: packed, 
        }),
    ],
});



console.log("Transaction sent. Waiting for confirmation...");
let intervalId = setInterval(async () => {
    let seqno2 = await wallet_address.getSeqno();
    if (seqno2 > seqno) {
        console.log("✅ Transaction confirmed!\n");
        clearInterval(intervalId);
    }
}, 1000);

To wait for the seqno back, you can confirm that the transaction has been packed by the validator. I hope this is helpful."

5
5
Posted one year ago