How to verify token holder eligibility in the campaign
When you create a campaign on a platform like TaskOn, you often need to set the eligibility requirements for the campaign, such as users needing to own an APE token.
Step 1: Get specified ERC20 balance by address
Here you'll need three parameters: chain, token_address and wallet_address.
Once you have obtained all parameters, you can copy the following code:
curl --request GET \
--url 'https://api.footprint.network/api/v3/address/getWalletERC20TokenBalance?chain=Ethereum&token_address=0x4d224452801aced8b2f0aebe155379bb5d594381&wallet_address=0x46efbaedc92067e6d60e84ed6395099723252496' \
--header 'API-KEY: your-api-key' \
--header 'accept: application/json'
Step 2: Run the script
In your terminal, you should see the following JSON response:
{
"message": "success",
"code": 0,
"data": [
{
"chain": "Ethereum",
"token_address": "0x4d224452801aced8b2f0aebe155379bb5d594381",
"wallet_address": "0x46efbaedc92067e6d60e84ed6395099723252496",
"amount": 12986,
"token_symbol": "APE",
"value": 27797.275081634507
}
]
}
Step 3: Deploy your validation API
After successfully testing the previous two steps, you can now embed it into your API server and deploy a public API to start using it.
API Reference
If you want to know more details on the endpoint and optional parameters, check out:
Updated 8 months ago