POST /leokit/save-transaction
Save the transaction hash after signing and broadcasting the unsigned transaction.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
quote_id | string | Yes | UUID from quote response |
tx_hash | string | Yes | Transaction hash from blockchain |
Success Response
Status Code:200 OK
Error Response
Status Code:400 Bad Request
Database Behavior
- Upserts to
tx_statustable - Links transaction to deposit via quote_id
- Initial status:
"indexing" - Used by status endpoint to track swap progress
POST /leokit/status
Get the current status of a swap transaction.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
quote_id | string | Yes | UUID from quote response |
tx_id | string | Conditional | Required if not previously saved via save-transaction |
Response
Status Code:200 OK
Response Fields
| Field | Type | Description |
|---|---|---|
protocol | string | Protocol used for the swap |
network | string | Source blockchain network |
req_id | string | Protocol-specific request ID |
hash | string | Transaction hash on source chain |
status | string | Current transaction status (see Status Values below) |
status_url | string | Protocol-specific tracking URL |
scanner | string | Block explorer URL for destination chain |
native_scanner | string | Block explorer URL for source chain |
type | string | Transaction type (usually “swap”) |
in_amount | number | Input amount in base units |
from_token | string | Source asset identifier |
to_token | string | Destination asset identifier |
from_address | string | Source wallet address |
to_address | string | Destination wallet address |
date | number | Unix timestamp of transaction creation |
Status Values
| Status | Description |
|---|---|
indexing | Transaction submitted, waiting for blockchain confirmation |
success | Transaction confirmed on source chain |
completed | Swap fully executed, output received |
failed | Transaction failed or reverted |
Status Flow
The status endpoint follows this flow:- Check Cache: Queries
tx_statustable for cached status - If Completed: Returns cached data immediately
- If Pending: Fetches from protocol-specific API
- Update Database: Saves new status to cache
Protocol-Specific Status URLs
Each protocol provides its own tracking interface:- THORChain:
https://track.ninerealms.com/tx/{req_id} - MAYAChain:
https://track.mayachain.info/tx/{req_id} - Chainflip:
https://scan.chainflip.io/tx/{tx_hash} - Relay:
https://relay.link/status/{req_id} - NEAR:
https://1click.chaindefuser.com/status/{req_id}
Example Usage
Complete Transaction Flow
-
Get Quote:
-
Generate Deposit:
- Sign & Broadcast Transaction (client-side)
-
Save Transaction Hash:
-
Check Status (polling):
Status Polling Best Practices
- Initial Poll: Wait 10-15 seconds after broadcast before first status check
- Polling Interval: Check every 15-30 seconds for pending transactions
- Stop Condition: Stop polling when status is
completedorfailed - Timeout: Consider transaction failed if status remains
indexingfor > 30 minutes