Skip to main content

Refuel Integration

Refuel can be used in two ways via the Bungee API:

  1. Refuel as a bridge
  2. Refuel as a middleware

Refuel as a bridge​

For bridging small amounts of native tokens, Bungee's quote API returns direct Refuel routes. Hence, Refuel is the bridge in this case.

This amount however needs to be within refuel's min/max limits for a given chain. These limits can be fetched using the Refuel limits API

GET https://refuel.socket.tech/chains

{
"success": true,
"result": [
{
"_id": "string",
"name": "string",
"chainId": 1,
"icon": "https://movricons.s3.ap-south-1.amazonaws.com/Ether.svg",
"isSendingEnabled": true,
"isReceivingEnabled": false,
"blockExplorer": "string",
"nativeAsset": "string",
"limits": [
{
"chainId": 137,
"isEnabled": true,
"minAmount": "string",
"maxAmount": "string"
},
{
"chainId": 250,
"isEnabled": true,
"minAmount": "string",
"maxAmount": "string"
}
],
"__v": 0
}
]
}
  • The limits array returned for a given chain highlights minAmount and maxAmount in the given chain's native token can be sent to destination chain.
  • The amount entered in quote must be within the range of minAmount and maxAmount returned in the response above.

Refuel as a middleware​

For receiving gas tokens on destination chain in addition to the Swap+Bridge transaction.

  • Users receive their tokens via the Bridge and Gas via Refuel.
  • Integrators can enable this functionality by setting bridgeWithGas param in the /quote endpoint to true.
  • Users will need to deposit 2x the minAmount returned by the limits API specified above on the source chain.
  • In return, they'll receive equivalent amount of destination native tokens.
  • A refuel object is returned by the /quote API which needs to be passed in addition to the route object when calling the /build-tx and /route/start endpoints for Single Tx bridging and Multi Tx Bridging respectively.
  • The status of a Swap+Bridge+Refuel tx can be retrieved from /bridge-status endpoint.