API Details
How to authenticate with the SafeSwap API, the chain names it accepts, and its endpoints.
API Keys
All calls require an API Key. Contact us to get one. Include this API Key in the X-API-KEY header of all requests to our service.
Chain Options
For API calls that require a chain name, the available chain names are: ETHEREUM, VECHAIN, BSC, MATIC, BASE, OPTIMISM.
API Endpoints
-
GET /swaps: Returns swap details. Must contain a query string of
?swapId=345...or?firstAddress=0x123...&firstChain=VECHAIN&secondAddress=0x234...&secondChain=ETHEREUM -
POST /swaps: Create a Swap. Payload is
SwapDetails {sourceChain: ChainName;sourceContractId: string; // prefixed with 0xsourceSender: string; // prefixed with 0xtargetChain: ChainName;targetTokenAddress: string; // prefixed with 0xtargetReceiver: string; // prefixed with 0xsourceFeeTx: string; // prefixed with 0xtargetFeeTx: string; // prefixed with 0x} -
GET /gas-estimates: Shows the required fees for a Swap. Requires query string of
?sourceChain=VECHAIN&targetChain=ETHEREUM -
GET /tokens: Shows the available tokens for swapping.