Widget Config Reference
Config
url: https://api.0xgen.io/v1/:code/config
method: GET
params:
// The success response example:
{
"code": 200,
"data": {
"dexes": [
{
"name": "openOcean",
"amount": "1614773503060146858429"
},
{
"name": "1inch",
"amount": "1614222924617714762008"
}
],
"maxOutAmount": "1614773503060146858429",
"minOutAmount": "1614222924617714762008",
"inToken": {
"symbol": "BNB",
"name": "Binance Coin",
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"decimals": 18
},
"outToken": {
"symbol": "1INCH",
"name": "1INCH Token",
"address": "0x111111111117dc0aa78b770fa6a738034120c302",
"decimals": 18
},
"inAmount": "5000000000000000000"
}
}method: get
params:
parameter
type
example
description
code
string
test
you need contract
example:
request: https://api.0xgen.io/v1/test/config
response:
Custom Mode
If you choose to integrate an iframe from https://app.0xgen.io, some wallets (Phantom, Sollet, Solflare) might not work properly.
To address this issue, you can configure your server nginx like below, and the frontend iframe config should be the same as the 0xgen widget.
Step 1 - Config nginx
Step 2 - Config Front-end (for example: 0xgen.net)
Last updated
