API calls
Check an address is whitelisted
Using this API call we can check if an address is whitelisted for a specific paymaster address.
const sponsorAddress = ('0x8350355c08aDAC387b443782124A30A8942BeC2e');
const accountAddress = ('0xE008De2fc3D19B51dC6Ff5379Af9b970fB21E43D');
const chainId = 80001;
const api_key = '';
const returnedValue = await fetch('https://arka.etherspot.io/checkWhitelist', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({ "params": [sponsorAddress, accountAddress, 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);
You should see an output like this if the address has been whitelisted:
Value returned: { message: 'Already added' }