Monitoring Broadcasted Transactions with KMS
When using Tatum KMS to sign and manage transactions, you receive a signature ID upon submission. However, monitoring the transaction's status requires additional steps.
Steps
Step_1: Checking Pending Transactions
To verify if your transaction is signed and ready for broadcasting, use the endpoint: Get Pending Transactions to Sign
This endpoint retrieves a list of pending transactions for your blockchain. The txId
field indicates a successfully signed transaction. If this field is empty, it may mean:
- The transaction is still pending.
- The transaction failed or it was dropped entirely from the mempool.
Step_2: Monitoring Failed Transactions
For failed transactions, you must subscribe to the KMS_FAILED_TX
webhook type. This webhook notifies you whenever Tatum KMS encounters an error during the signing process.
Creating a Failed Transaction Subscription:
- Use the following endpoint: Create Subscription
- Set the
type
toKMS_FAILED_TX
.
Webhook notifications will contain details like:
{
"signatureId": "6082ab462936b4478117c###",
"error": "Error message from the KMS"
}
Step_3: Monitoring Successful Transactions
To monitor successful transactions, subscribe to the KMS_COMPLETED_TX
webhook type. This webhook notifies you when a transaction is successfully signed.
Creating a Completed Transaction Subscription
- Use the following endpoint: Create Subscription
- Set the type to
KMS_COMPLETED_TX
.
Webhook notifications will provide details like:
{
"signatureId": "6082ab462936b4478117c###",
"txId": "0x7bb7d3b90567e89f999f2e3d263bc3738a018dbbcfa9f5397678cf17cdf0235f"
}
Good to Know
- Webhook Notifications: Always use webhook subscriptions for real-time updates on transaction statuses.
- Error Handling: Implement robust error handling for scenarios like insufficient gas fees or low balances.
- Polling: Use the Get Pending Transactions to Sign endpoint for periodic checks if webhook notifications are not viable.
- Find more about Unconfirmed, Pending and Dropped transactions HERE
Updated about 1 month ago