Skip to main content

POST /leokit/save-transaction

Save the transaction hash after signing and broadcasting the unsigned transaction.

Request Body

Success Response

Status Code: 200 OK

Error Response

Status Code: 400 Bad Request

Database Behavior

  • Upserts to tx_status table
  • 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

Response

Status Code: 200 OK

Response Fields

Status Values

Status Flow

The status endpoint follows this flow:
  1. Check Cache: Queries tx_status table for cached status
  2. If Completed: Returns cached data immediately
  3. If Pending: Fetches from protocol-specific API
  4. Update Database: Saves new status to cache
This caching mechanism ensures fast response times for completed transactions while providing real-time updates for pending swaps.

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

  1. Get Quote:
  2. Generate Deposit:
  3. Sign & Broadcast Transaction (client-side)
  4. Save Transaction Hash:
  5. 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 completed or failed
  • Timeout: Consider transaction failed if status remains indexing for > 30 minutes