Skip to main content

Documentation Index

Fetch the complete documentation index at: https://direkt.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Status lifecycle

AWAITING_DEPOSIT → DEPOSIT_RECEIVED → EXECUTING → COMPLETED
                                               ↘ FAILED
AWAITING_DEPOSIT → EXPIRED
StatusMeaningAction
AWAITING_DEPOSITNo on-chain activity yetKeep polling
DEPOSIT_RECEIVEDDeposit seen on source chainKeep polling
EXECUTINGCross-chain swap in progressKeep polling
COMPLETEDFunds delivered to recipientFulfil order
EXPIREDQuote timed out (5 min window)Show retry UI
FAILEDExecution failedShow error

Request

curl --location 'https://godirekt.xyz/api/status/5af8532c-5bf4-45c2-b099-1b36e96e91a3' \
  --header 'x-api-key: YOUR_API_KEY'

Response

{
  "success": true,
  "quoteId": "5af8532c-5bf4-45c2-b099-1b36e96e91a3",
  "status": "AWAITING_DEPOSIT",
  "createdAt": 1780010048,
  "expiresAt": 1780010348,
  "depositAddress": "0x7fa491b5765b5eea6b113a9121c311d780f8c61b",
  "deposit": null,
  "gas": null,
  "execution": {
    "startedAt": null,
    "completedAt": null,
    "outputTxHash": null,
    "steps": []
  },
  "route": {
    "from": { "chainId": 8453, "chainName": "Base", "token": "0x000...000" },
    "to": { "chainId": 56, "chainName": "BNB Chain", "token": "0x000...000" },
    "amount": "1000000000000000000",
    "recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
  },
  "error": null
}
execution.outputTxHash is populated once the swap executes on the destination chain. Use it to link to a block explorer.

Polling implementation

async function pollStatus(quoteId, apiKey) {
  const res = await fetch(
    `https://godirekt.xyz/api/status/${quoteId}`,
    { headers: { Authorization: `Bearer ${apiKey}` } }
  );
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  return res.json();
}

// Poll every 7 seconds
const interval = setInterval(async () => {
  const data = await pollStatus(quoteId, apiKey);

  if (data.status === 'COMPLETED') {
    clearInterval(interval);
    fulfilOrder(data.execution.outputTxHash);
  } else if (data.status === 'EXPIRED' || data.status === 'FAILED') {
    clearInterval(interval);
    showError(data.error);
  }
}, 7000);