Gas Station
Before any minting or smart contract deployment a Gas Station needs to be created and configured for your organization. The Gas Station enables integrators to pay for gas fees on smart contract deployment and minting. To start using a Gas Station an integrator should create a gas account with wallet addresses for supported networks, configure the gas station for each network, and top up the wallet with the network's native token.
Create Gas Station Account
First you need to create the Gas Station account. Specify what network(s) you are adding. You can add more networks to the account at anytime with a separate endpoint.
POST /api/gas-station/v1/account?networks=polygonMainnet
//Sample Response
{
"id": "3ba8h64-5017-4562-b3fc-2c963766afa6",
"wallets": [
{
"network": "polygonMainnet",
"asset": "matic",
"totalBalance": 0,
"address": "0xD57297C5e504D7c6A70Ba860ba24264b83fd358"
}
]
}
Add network to gas station
POST /api/gas-station/v1/account/assets
//Sample Request
[
{
"network": "Mainnet",
"asset": "Eth"
}
]
You will receive the address to the wallet created on the added network in the response.
Retrieve all addresses and balance
Each network will need to be topped up with its native token to pay for gas fees.
GET /api/gas-station/v1/account
//Sample Response
{
"id": "0517cb2b-fr32-4e12-a8cc-9e22d907bb",
"wallets": [
{
"network": "solanaDevnet",
"asset": "sol",
"totalBalance": 0,
"address": "HxXLjRnhmYj348eguf2g8RJ2uQBa41LGoix9sZjYXn"
},
{
"network": "goerli",
"asset": "eth",
"totalBalance": 0.356333560056672171,
"address": "0xdE37Dd5356t175k73766326Cc377150B8c3408D"
}
]
}
Configure Gas Station
After creation you can configure your Gas Station to have an "overpriceMultiplier" for each network. This is a value that will be multiplied with the estimated gas fee. The calculated value will be used for fueling transactions. You can add 1 configuration at a time.
POST /api/gas-station/v1/gas-configuration
// Sample Request
{
"network": "polygonMumbai",
"asset": "matic",
"overpriceMultiplier": 1.35
}
Retrieve Gas Station Configuration
GET /api/gas-station/v1/gas-configuration?Assets=matic&Networks=polygonMumbai
//Sample Response
{
"meta": {
"pageCount": 1,
"resourceCount": 1
},
"data": [
{
"id": "77d4dba-3ao8-46ed-b3e7-7705482e7sad1",
"network": "polygonMumbai",
"asset": "matic",
"overpriceMultiplier": 1.35000000
}
]
}
Update Gas Configuration
To update a configuration grab the id for the specific network and use the PATCH call below.
PATCH /api/gas-station/v1/gas-configuration/{{gasConfigId}}
//Sample Request
{
"network": "polygonMumbai",
"asset": "matic",
"overpriceMultiplier": 1.50
}
That's it now your Gas Station is ready to go. Next steps are deploying your smart contract and creating your tokens!
Updated 3 months ago