Developer API
...
WebSocket Functions
Function: subscribeResult()
5 min
docid\ wxgxpnpidcz6 2b6gh786 docid\ l2rwyc57gjg6s93mcecr9 / subscriberesult subscriberesult ( connection , tx , onresult , onerror? , onclose? ) void defined in https //github com/xandeum/xandeum web3 js/blob/master/src/websocket ts#l40 opens a websocket connection and subscribes to the result of a transaction via the custom xandeumresultsubscribe method this is useful for receiving asynchronous results tied to an on chain operation, such as file creation, modification, or deletion the subscription sends a json rpc request with method "xandeumresultsubscribe" params \[txid, { commitment "finalized" }] the websocket listens for result messages and invokes the onresult callback if a valid result with fsid , status , or data is received parameters connection connection the solana web3 connection with xandeum compatible json rpc endpoint (e g , 'https //api devnet solana com' ) tx string the transaction id you want to listen for results from onresult ( value ) => void callback to handle incoming result messages triggered when a valid response is received onerror? ( err ) => void (optional) callback triggered if a websocket error occurs onclose? () => void (optional) callback triggered when the websocket connection closes returns void