Arka Paymaster
Intro
Paymasters are used to sponsor transactions and enable paying for gas with ERC20 Tokens.
This section will cover how to use Arka within the SDK, for a more detailed look at Arka and it’s API calls and how to send requests manually, you can check out this part of the docs.
How-to guide
- Import the ArkaPaymaster object.
- Initialise the object.
This takes the chainId, Arka API key, and Arka Paymaster URL as parameters.
- Use arkaPaymaster to call functions.
Function list
Here is a list of the functions we can call and what they do.
metadata()
Returns information about the paymaster.
Example output:
getTokenPaymasterAddress(“USDC”)
Accepts a string of a token ticker as input and outputs the address of the token paymaster if it is supported.
addWhitelist([“0xB3aF6CFDDc444B948132753AD8214a20605692eF”])
Accepts an array of strings (valid addresses) and whitelists them on the paymaster.
removeWhitelist([“0xB3aF6CFDDc444B948132753AD8214a20605692eF”])
Accepts an array of strings (valid addresses) and removes them from the whitelist.
checkWhitelist(“0xB3aF6CFDDc444B948132753AD8214a20605692eF”)
Accepts a valid address as a string and returns whether or not an address is whitelisted.
deposit(0.000000001)
Accepts a number and deposits this to the paymaster.