There will be specific addresses we want to sponsor transactions for.

Using Arka we can whitelist these addresses using our project specific API key.

You can add up to 10 addresses at a time using this API call.

  	const addresses = ['0xE008De2fc3D19B51dC6Ff5379Af9b970fB21E43D'];
	const api_key = '';
	const chainId = 80001;
	const returnedValue = await fetch('https://arka.etherspot.io/whitelist', {
		method: 'POST',
		headers: {
			'Accept': 'application/json',
			'Content-Type': 'application/json',
		},
		body: JSON.stringify({ "params": [addresses, chainId, api_key] })
	})
		.then((res) => {
			return res.json()
		}).catch((err) => {
			console.log(err);
			// throw new Error(JSON.stringify(err.response))
		});
	console.log('Value returned: ', returnedValue);

This will whitelist the addresses using the addBatchToWhitelist method.

You should see an output like this if the call has worked:

Value returned:  {
  message: 'Successfully whitelisted with transaction Hash 0x91575dc46283aee04bab45763b5ea77250ac84232d6a38095f8ed08d1feef5d3'
}