Appearance
Fetching transaction status
INFO
This endpoint is not yet live in production. This guide is intended to be a preview of upcoming functionality.
Privy supports fetching transaction status by the transaction ID.
To do so, make a GET
request to
bash
https://api.privy.io/v1/transactions/<transaction_id>
replacing <transaction_id>
with the ID of your desired transaction.
Response
Privy will send the following in the response body:
Field | Type | Description |
---|---|---|
transaction_id | string | ID for the transaction. |
wallet_id | string | ID for the wallet that sent the transaction. |
status | 'broadcasted' | 'confirmed' | 'execution_reverted' | Current status of the transaction. |
hash | string | Hash for the transaction. |
caip2 | string | CAIP-2 chain ID for the network the transaction was broadcasted on. |
'broadcasted'
refers to when a transaction has been submitted to the network but has not yet been included in a block'confirmed'
refers to when a transaction has been included in a block that has been confirmed on the network. You can additionally configure Privy to wait for more than one block confirmation before updating a transaction's status to'confirmed'
.'execution_reverted'
refers to when a transaction has reverted in execution.
Example
For example, you might fetch a transactions status using transaction ID using the cURL request below.
bash
$ curl --request GET https://api.privy.io/v1/transactions/<transaction_id> \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>" \
-H 'Content-Type: application/json' \
The response might look like
json
{
"transaction_id": "<transaction_id>",
"wallet_id": "fmfdj6yqly31huorjqzq38zc",
"status": "confirmed",
"hash": "0x2446f1fd773fbb9f080e674b60c6a033c7ed7427b8b9413cf28a2a4a6da9b56c",
"caip2": "eip155:8453"
}