How to check if a token is gas sponsored on Viction
This guide will show you how to check if a token is gas sponsored on Viction
Last updated
This guide will show you how to check if a token is gas sponsored on Viction
Last updated
Objective: Verify if the token is eligible for gas sponsorship.
Function: Use the tokens
function from the .
Steps:
Call the tokens
function with the token address or identifier.
If the token exists in the sponsor list, proceed to Step 2. Otherwise, it is not sponsored.
Objective: Determine if the token has remaining gas sponsorship capacity.
Function: Use the getTokenCapacity
function.
Steps:
Call getTokenCapacity
with the token address or identifier.
Interpret the response:
If > 0: Token can sponsor gas.
If = 0: Token sponsorship is exhausted. Transactions will be failed.
Simple flow:
Call tokens
to check sponsorship eligibility.
If eligible, call getTokenCapacity
to validate capacity:
0: Sponsored.
= 0: Not sponsored.
Cache results for faster future checks.