🔗sol
Description
The txStatus
function is used to check the status of a transaction on the Solana blockchain. It takes a transaction hash and an environment as inputs and returns the status of the transaction. The function first validates the transaction hash and environment inputs, then uses the Solana RPC URL corresponding to the given environment to connect to the Solana blockchain. Finally, it retrieves the transaction status and returns it.
Parameters
txHash
string
The hash of the transaction to check the status for
env
string
The environment to connect to (e.g. 'devnet', 'mainnet')
Response
code
number
A code indicating the result of the function (1 for success, 0 for failure)
result
string
The status of the transaction ('confirmed' if successful, 'failed' if not)
error
string
An error message, returned if code is 0
Example Request and Response
Prerequisites
Before making requests with Nest SDK, you must have it installed.
You can install Nest SDK using either npm
or yarn
. Use the following commands to install Nest SDK:
Request
Here is an example of how to make a txStatus
request using the Nest SDK:
Response
Use Cases
Wallet Applications: Wallet applications can use this function to retrieve the status of transactions made by the user and update the transaction history accordingly.
Explorers: Blockchain explorers can use this function to provide information on the status of transactions on the Solana blockchain.
Last updated