GET
https://api.gasyard.fi
/
api
/
sdk
/
v2
/
status
curl -X GET "https://api.gasyard.fi/api/sdk/v2/status" \
  -H "x-api-key: YOUR_API_KEY" \
  -G \
  -d "sourceHash=0xabc123..."
{
  "success": true,
  "data": {
    "orderId": "0x7f8e9d...",
    "status": "completed",
    "input": {
      "chainId": 1,
      "txHash": "0xabc123...",
      "token": "0x0000000000000000000000000000000000000000",
      "amount": "1000000000000000000",
      "address": "0xUserAddress...",
      "timestamp": 1735689600
    },
    "output": {
      "chainId": 4,
      "txHash": "0xdef456...",
      "token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "2493750000",
      "address": "0xUserAddress...",
      "timestamp": 1735689612
    },
    "solver": {
      "address": "0xSolverAddress...",
      "assignedAt": 1735689602
    },
    "timing": {
      "createdAt": 1735689600,
      "expiry": 1735693200,
      "completedAt": 1735689612,
      "duration": 12
    }
  }
}
Retrieves the current status of a bridge transaction, including solver information and completion details.

Authentication

x-api-key
string
required
Your API authentication key

Query Parameters

sourceHash
string
required
The transaction hash from the source chain (the bridge initiation transaction)

Response

success
boolean
Indicates if the request was successful
data
object
Transaction status data

Status States

StatusDescription
pendingOrder created, waiting for solver
executingSolver assigned and processing
completedSuccessfully bridged
refundedExpired or failed, funds returned
failedPermanent failure
curl -X GET "https://api.gasyard.fi/api/sdk/v2/status" \
  -H "x-api-key: YOUR_API_KEY" \
  -G \
  -d "sourceHash=0xabc123..."
{
  "success": true,
  "data": {
    "orderId": "0x7f8e9d...",
    "status": "completed",
    "input": {
      "chainId": 1,
      "txHash": "0xabc123...",
      "token": "0x0000000000000000000000000000000000000000",
      "amount": "1000000000000000000",
      "address": "0xUserAddress...",
      "timestamp": 1735689600
    },
    "output": {
      "chainId": 4,
      "txHash": "0xdef456...",
      "token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "2493750000",
      "address": "0xUserAddress...",
      "timestamp": 1735689612
    },
    "solver": {
      "address": "0xSolverAddress...",
      "assignedAt": 1735689602
    },
    "timing": {
      "createdAt": 1735689600,
      "expiry": 1735693200,
      "completedAt": 1735689612,
      "duration": 12
    }
  }
}

Usage Notes

Typical bridge completion time is 5-15 seconds. If pending for more than 5 minutes, it may be refunded.

Polling for Completion

async function waitForCompletion(sourceHash, maxAttempts = 60) {
  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `https://api.gasyard.fi/api/sdk/v2/status?sourceHash=${sourceHash}`,
      { headers: { 'x-api-key': API_KEY } }
    );
    const { data } = await response.json();

    if (data.status === 'completed') {
      return data;
    }

    if (data.status === 'failed' || data.status === 'refunded') {
      throw new Error(`Transaction ${data.status}`);
    }

    // Wait 5 seconds before next poll
    await new Promise(resolve => setTimeout(resolve, 5000));
  }

  throw new Error('Transaction timeout');
}

Display Progress UI

const statusMessages = {
  pending: 'Finding the best solver...',
  executing: 'Solver is processing...',
  completed: 'Transaction complete!',
  refunded: 'Funds refunded to your wallet',
  failed: 'Transaction failed'
};

function updateUI(status) {
  document.getElementById('status').textContent = statusMessages[status];
}