After receiving the typedData structure, the user must sign it using their wallet or signing tool (e.g., MetaMask, hardware wallets). This signature proves the user’s intent to perform the trade.
3. Create the Order
Endpoint: /v1/gasless/create
Send the signature obtained from the user, along with the trade details, to this endpoint to create the order.
Request:
{"chainFrom":42161,"order": { // result of /v1/gasless/typed-data (message object)"user":"0x2472d3EF4bF71af00c3dE490a5a53A99CbAC0791","receiver":"0x2472d3EF4bF71af00c3dE490a5a53A99CbAC0791","srcToken":"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9","dstToken":"0x0000000000000000000000000000000000000000","amountIn":"6623429","fee":"19898","amountOutMin":"1972679740777741","deadline":1734963690,"tradeHash":"0x8748ade4edde06...e40b4dbc11fa47" },"call": [ // call array from transactionData object of the quote {"targetExchange":"0x1F721E2E82F6676FCE4eA07A5958cF098D339e18","targetExchangeID":"camelotv3","sellToken":"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9","buyToken":"0x0000000000000000000000000000000000000000","amountDelta":"1972679740777741","amount":"6603531","data":"0xac9650d8000000000000000000000...00000000" } ],"permitData": { // if use Permit2"user":"0x2472d3EF4bF71af00c3dE490a5a53A99CbAC0791","amount":"6623429","deadline":1734963223,"nonce":569626219515420,"sign":"0xb43dbbcdcf610ff77fd17ab0630d5e85391086...04121f1b" },"signature":"0x2728c5bd1d666623533d899f6f6...7387b9e41c"// signature from step 2}
Once the order is created, it will be processed by our gasless trade processor. The system will cover the gas fees and execute the trade on behalf of the user.
4. Cancel the Order (Optional)
If the order has not been processed yet (this typically happens very quickly), it can be cancelled.