API Implementation
Base URL
api.gasyard.fi/api/sdk
Authentication
All API requests must include the following headers:
{
    "x-api-key": "<insert api key>"
}Need Help?
If you're looking to integrate our API or SDK and need assistance, feel free to reach out on Telegram: t.me/qimchi. 🚀
1. GET /quote
Description: Fetches a quote for token swaps between networks.
Request Example:
/quote?inputNetwork=2&outputNetwork=5&inputTokenAmount=5000000000000000&outputTokenContract=0xaf88d065e77c8cC2239327C5EDb3A432268e5831Query Parameters:
- inputNetwork(integer) - ID of the source network
- outputNetwork(integer) - ID of the destination network
- inputTokenAmount(string) - Amount of input tokens in the smallest unit
- outputTokenContract(string) - Contract address of the output token
Response Example:
{
    "message": "Success",
    "inputTokenAmount": 5000000000000000,
    "outputTokenAmount": 10924737.493205206,
    "outputValueInUSD": 10.923662826778001,
    "feesInToken": 1388222000000,
    "feesInUSD": 0.000001388222
}2. GET /config
Description: Retrieves configuration details for a specified blockchain network.
Request Example:
/config?chainId=4Query Parameters:
- chainId(integer) - The ID of the blockchain network
Response Example:
{
    "networkName": "arbitrum",
    "networkChainID": 42161,
    "baseToken": "ETH",
    "decimals": 18,
    "gatewayContract": "0xe11A5E282B3B42bBFF665309536b6F787c2d3F38",
    "solverContract": "0x8263d2E25b25478c93c541fCcFc85eA2665B2193",
    "logoURL": "https://hl-mainnet-api.gasyard.fi/uploads/arb-network.png"
}3. GET /status
Description: Checks the status of a transaction based on its hash.
Request Example:
/status?sourceHash=0x50aa2de06b9a386a6f87ac0c509a088240e129c71503e7c323e4e27f7fcaeec4Query Parameters:
- sourceHash(string) - The hash of the transaction to check status
Response Example:
{
    "result": [
        {
            "inputTxHash": "0x50aa2de06b9a386a6f87ac0c509a088240e129c71503e7c323e4e27f7fcaeec4",
            "outputTxHash": "0x9380160cac171ccae9ec624d46c206c6ca902262486ba40446a68a492320ca3b",
            "managerHash": "0x1f0e18a16ab5add4654f40476f63d7a9da31735f0fc52ebce185e0939506330d",
            "outputChainAmount": 10818160,
            "collateral": 10.8718448,
            "status": "success",
            "solver": "0x0000000000000000000000008263d2e25b25478c93c541fccfc85ea2665b2193",
            "inputChainID": 2,
            "outputChainID": 5,
            "inputToken": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "outputToken": "0x000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831",
            "inputChainAmount": 4300000000000000,
            "inputAddress": "0x000000000000000000000000c442b6d1367c901e196bc7ddf6dd9e11d3851c52",
            "outputAddress": "0x000000000000000000000000c442b6d1367c901e196bc7ddf6dd9e11d3851c52",
            "orderID": "0xf4ee4d15c9446130377e3eb8d57263e96633a1c99f863e34addaad21968b82e5",
            "createdAt": "2025-03-02T22:53:26.683Z",
            "updatedAt": "2025-03-02T22:53:31.530Z",
            "id": "67c4e166f40406001a0b6be6"
        }
    ]
}4. GET /history
Description: Fetches transaction history for a given address.
Request Example:
/history?inputAddress=0xc5218F7e68f800c45c4BF49D87BE56b6a2692efBQuery Parameters:
- inputAddress(string) - The wallet address to fetch history for
Response Example:
{
    "results": [
        {
            "inputTxHash": "0x084df25993026445f1aecd25352d51db827bc00db91a9b96f3f66e6fd8ef42d4",
            "outputTxHash": "0x2e2484962d7d14ac66f7172952ea2b0a6153cd5bbef50ed287916d9fba542625",
            "managerHash": "0x73936ad45b0f70dca888e5539dcc1f88de7e32d3940195b7b447b8e54493859f",
            "outputChainAmount": 12452195,
            "fees": 12500000000000,
            "collateral": 12.5147,
            "status": "success",
            "solver": "0x0000000000000000000000008263d2e25b25478c93c541fccfc85ea2665b2193",
            "_id": "67bd531e95681f001af3be9b",
            "inputChainID": 2,
            "outputChainID": 5,
            "inputToken": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "outputToken": "0x000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831",
            "inputChainAmount": 5000000000000000,
            "inputAddress": "0x000000000000000000000000c5218f7e68f800c45c4bf49d87be56b6a2692efb",
            "outputAddress": "0x000000000000000000000000c5218f7e68f800c45c4bf49d87be56b6a2692efb",
            "orderID": "0x0fa68e9548c8d8a2bada3e3d4cb262e415237e1dbb8c0dffcb82208af9ce9ac5",
            "createdAt": "2025-02-25T05:20:30.990Z",
            "updatedAt": "2025-02-25T05:20:35.886Z",
            "filledAt": "2025-02-25T05:20:35.886Z"
        }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
}5. GET /bridge
Description: Initiates a token bridging transaction between two networks.
Request Example:
/bridge?sourceNetwork=2&destinationNetwork=5&tokenOutAddress=0xaf88d065e77c8cC2239327C5EDb3A432268e5831&destinationAddress=0x28172273CC1E0395F3473EC6eD062B6fdFb15940&tokenInAddress=0x0000000000000000000000000000000000000000&sourceTokenAmount=15000000Last updated
