GET
https://api.gasyard.fi
/
api
/
sdk
/
v2
/
quote
curl -X GET "https://api.gasyard.fi/api/sdk/v2/quote" \
  -H "x-api-key: YOUR_API_KEY" \
  -G \
  -d "inputNetwork=1" \
  -d "outputNetwork=4" \
  -d "inputTokenAmount=1000000000000000000" \
  -d "sourceAddress=0xYourAddress" \
  -d "destinationAddress=0xYourAddress" \
  -d "slippage=10"
{
  "success": true,
  "data": {
    "tokenIn": {
      "symbol": "ETH",
      "address": "0x0000000000000000000000000000000000000000",
      "decimals": 18,
      "amount": "1000000000000000000",
      "amountUSD": "2500.00"
    },
    "tokenOut": {
      "symbol": "USDC",
      "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "decimals": 6,
      "amount": "2493750000",
      "minAmount": "2481281250",
      "amountUSD": "2493.75"
    },
    "fees": {
      "platform": "6.25",
      "builder": "0.00",
      "solverIncentive": "0.00",
      "total": "6.25",
      "percentage": "0.25"
    },
    "priceImpact": "0.02",
    "rewardPoints": 250,
    "balanceCheck": {
      "sufficient": true,
      "balance": "1500000000000000000",
      "required": "1000000000000000000"
    },
    "transactions": [
      {
        "type": "bridge",
        "to": "0x6a2A5B7D0434CC5b77e304bc9D68C20Dee805152",
        "data": "0x...",
        "value": "1000000000000000000",
        "gasLimit": "150000"
      }
    ],
    "expiry": 1735693200
  }
}
Generates a bridge quote with comprehensive fee information, price impact analysis, and ready-to-sign transaction data.

Authentication

x-api-key
string
required
Your API authentication key

Query Parameters

inputNetwork
integer
required
Source chain Gasyard ID (1-12)
outputNetwork
integer
required
Destination chain Gasyard ID (1-12)
inputTokenAmount
string
required
Amount to bridge in smallest unit (wei for ETH, 6 decimals for USDC)
sourceAddress
string
required
Sender’s wallet address
destinationAddress
string
required
Recipient’s wallet address
inputTokenContract
string
Source token contract address. Use 0x0000...0000 for native token.
outputTokenContract
string
Destination token contract address. Use 0x0000...0000 for native token.
slippage
integer
default:"5"
Slippage tolerance in basis points (5 = 0.05%)
showBridgeData
boolean
default:"true"
Include transaction array in response

Response

success
boolean
Indicates if the request was successful
data
object
Quote data object
curl -X GET "https://api.gasyard.fi/api/sdk/v2/quote" \
  -H "x-api-key: YOUR_API_KEY" \
  -G \
  -d "inputNetwork=1" \
  -d "outputNetwork=4" \
  -d "inputTokenAmount=1000000000000000000" \
  -d "sourceAddress=0xYourAddress" \
  -d "destinationAddress=0xYourAddress" \
  -d "slippage=10"
{
  "success": true,
  "data": {
    "tokenIn": {
      "symbol": "ETH",
      "address": "0x0000000000000000000000000000000000000000",
      "decimals": 18,
      "amount": "1000000000000000000",
      "amountUSD": "2500.00"
    },
    "tokenOut": {
      "symbol": "USDC",
      "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "decimals": 6,
      "amount": "2493750000",
      "minAmount": "2481281250",
      "amountUSD": "2493.75"
    },
    "fees": {
      "platform": "6.25",
      "builder": "0.00",
      "solverIncentive": "0.00",
      "total": "6.25",
      "percentage": "0.25"
    },
    "priceImpact": "0.02",
    "rewardPoints": 250,
    "balanceCheck": {
      "sufficient": true,
      "balance": "1500000000000000000",
      "required": "1000000000000000000"
    },
    "transactions": [
      {
        "type": "bridge",
        "to": "0x6a2A5B7D0434CC5b77e304bc9D68C20Dee805152",
        "data": "0x...",
        "value": "1000000000000000000",
        "gasLimit": "150000"
      }
    ],
    "expiry": 1735693200
  }
}

Usage Notes

Quotes are valid until the expiry timestamp. Request a fresh quote if expired.

Executing Transactions

The transactions array contains ready-to-sign transaction objects:
  1. If the first transaction has type: "approval", execute it first
  2. Execute the type: "bridge" transaction to initiate the bridge
// Execute approval if needed
if (quote.data.transactions[0].type === 'approval') {
  await signer.sendTransaction(quote.data.transactions[0]);
}

// Execute bridge
const bridgeTx = quote.data.transactions.find(t => t.type === 'bridge');
await signer.sendTransaction(bridgeTx);

Balance Verification

Use balanceCheck to validate before prompting users:
if (!quote.data.balanceCheck.sufficient) {
  alert('Insufficient balance');
  return;
}