Setting up a gas tank

As we are using Biconomy, you should first create an account on the Biconomy Dashboard. Now you can find your Auth Token on the Account page. You are going to use it to create gas tanks for your application(s).

In order to create a gas tank, you need to use this typescript function (Do not create a dapp directly on Biconomy Dashboard)

const addGasTank = async(dappName: string, networkId: string, authToken: string) => {

	const url = 'https://api.biconomy.io/api/v1/dapp/public-api/create-dapp'

	const formData = new URLSearchParams({
		'dappName': dappName,
		'networkId': networkId,
		'enableBiconomyWallet': 'true'
	})

	const requestOptions = {
		method: 'POST',
		headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'authToken': authToken },
		body: formData
	}

	const res = await fetch(url, requestOptions)
	const resJson = await res.json()

	return { apiKey: resJson.data.apiKey, fundingKey: resJson.data.fundingKey.toString() }
}

You should pass the Auth Token (that you got from the dashboard), name, and network ID, to this function. After running this function, you will find your gastank created on the dashboard. If you press on the gas tank block, you can see all details related to your gas tank, including the API Key. This API Key will be passed to the backend service (we'll talk more about this in the next sections).

In order to fill the gas tank, you should first connect your wallet to the dashboard (the button in the left bottom corner) and then you can fill the gas. Note that you'll need to fill the gas in the native token of the network you created the gas tank on.

You also can add limits on using your gas tank under Meta Transactions Limit section.

For more details you can check biconomy docs.

Last updated