The solana web3 connection with Xandeum-compatible JSON-RPC endpoint (e.g., 'https://api.devnet.solana.com'
).
The transaction ID you want to listen for results from.
Callback to handle incoming result messages. Triggered when a valid response is received.
Optional
onError: (err: any) => void(Optional) Callback triggered if a WebSocket error occurs.
Optional
onClose: () => void(Optional) Callback triggered when the WebSocket connection closes.
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 withfsid
,status
, ordata
is received.