API Integration

Tokens that support permit

  1. Get a quote from odos

  2. POST https://api.smolrefuel.com/quotearrow-up-right with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER_ADDRESS","amount":"1000000000000000000"}}

  3. POST https://api.smolrefuel.com/refuelarrow-up-right 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:{...}}

  4. Trade will be sent and you'll get back a tx hash

Tokens that don't support permit

  1. POST https://api.smolrefuel.com/loan-quotearrow-up-right with body {"chainId":1,"token":"0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5","from":"USER_ADDRESS","amount":"100000000"}

  2. Have user sign the message

    I commit to completing the swap on smolrefuel.com after receiving my loan
  3. Send that signature to POST https://api.smolrefuel.com/get-loanarrow-up-right, with body

    {
            chainId,
            token,
            from,
            amount,
            signature,
            partner
     }
  4. Have user send an approve() transaction on the token approving our contract

  5. POST https://api.smolrefuel.com/execute-swaparrow-up-right with body

    {
            chainId,
            token,
            from,
            partner
    }

Last updated