# The Alternative Way (via RPC Polling)

Some of the SDKs do not yet support WebSocket subscriptions for RPC queries, so this may be the preferable option in some use cases.

You can use the Tx RPC method to query for the transaction and get its block height. Here is an example using the JavaScript SDK:

\> rpc.tx({

&#x20;hash: Buffer.from('B2EF71DAEB86385E64F6C0B923636ADE5510B3C34C07D19EE5A114FC9075273D', 'hex'),

&#x20;prove:false

}).then(x => console.log('',x))

{

&#x20;hash: 'B2EF71DAEB86385E64F6C0B923636ADE5510B3C34C07D19EE5A114FC9075273D',

&#x20;height: '30261607',

&#x20;index: 0,

&#x20;tx\_result: { log: 'Msg 0: ', tags: \[ \[Object], \[Object], \[Object] ] },

&#x20;tx: '0AHwYl3uCkwqLIf6CiIKFLjeOPB9sCxE5v+lpkRhnPu+K1ahEgoKA0JOQhCMy5ZfEiIKFI6nDX0uqKFLorM9GNXfvW+uCm6oEgoKA0JOQhCMy5ZfEnEKJuta6YchA6Xy63LJBSKNsW1nkGMbPyvWl7VDeD/lVByJrtnB3v1kEkA243QKSCn5GxFSTFbh6EA8ZuqdO+0UTR8+Vq7CDikOzCIpuRo95Ww7zak0qXRmL3/shGkwHcvB4l9ofF61mSQgGKfQCSDDARoJMTAxNzg5MTEz'

}

If the Transaction does not yet exist in the blockchain, this attempt will return with an error.

You should check for an absent "code" field in the tx\_result: this indicates a code of 0. You could also perform further checks on the log to make sure that it matches the expected value.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://somi.gitbook.io/somi-network-api-docs/somi-exchange-integration/important-ensuring-transaction-finality/the-alternative-way-via-rpc-polling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
