> For the complete documentation index, see [llms.txt](https://somi.gitbook.io/somi-network-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://somi.gitbook.io/somi-network-api-docs/somi-exchange-integration/important-ensuring-transaction-finality/the-alternative-way-via-rpc-polling.md).

# 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>
