API Integration
Tokens that support permit
Get a quote from odos
POST https://api.smolrefuel.com/quote with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER_ADDRESS","amount":"1000000000000000000"}}
POST https://api.smolrefuel.com/refuel with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER_ADDRESS","amount":"1000000000000000000", deadline:string, v:number, r:string, s:string}, partner: "your name", tokenPrices:{...}}
Trade will be sent and you'll get back a tx hash
Tokens that don't support permit
POST https://api.smolrefuel.com/loan-quote with body {"chainId":1,"token":"0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5","from":"USER_ADDRESS","amount":"100000000"}
Have user sign the message
I commit to completing the swap on smolrefuel.com after receiving my loanSend that signature to POST https://api.smolrefuel.com/get-loan, with body
{ chainId, token, from, amount, signature, partner }Have user send an approve() transaction on the token approving our contract
POST https://api.smolrefuel.com/execute-swap with body
{ chainId, token, from, partner }
Last updated