SDK API

Api module, method through HTTP interface query data

Go to the detailed interface documentation

https://docs.0xgen.io/api/api

// Base code block
import { GenSdk } from '@gen-io/gen-sdk';
const genSdk = new GenSdk({
  apiUrl: "https://api.0xgen.io",
});
const { api } = genSdk

getGasPrice

let data = await api.getGasPrice({
   chain: 'bsc'
})

getTokenPrice

let data = api.getTokenPrice({
       ids: 'bitcoin',
       vs_currencies: 'usd'
})
       

getTokenList

quote

swapQuote

dex: 1inch,matcha、openocean、jupiter

slippage: 3=3%

Last updated