Introduction to Arka
Intro
Arka is Etherspot’s implementation of a paymaster.
In short, the paymaster component let’s us implement gasless transactions. This means we can let the user pay with ERC-20 tokens, or pay for specific user transactions ourselves.
Using Arka
When estimating a transaction with the SDK we can pass in paymaster values and choose one of two modes:
- sponsor
- erc20
- multitoken
For either mode we need to pass in a url as non optional parameters. In this url we include the url of the Arka instance, the apiKey, and the chainId.
We can create the arguements like so:
Then we can use this in either sponsor or erc20 mode.
mode: ‘sponsor’
This works by having Arka pay for the transaction fee.
validUntil / validAfter
validUntil and validAfter are relevant only with mode: sponsor transactions and not for mode: erc20.
validUntil and validAfter are optional defaults to 10 mins of expiry from send call and should be passed in terms of milliseconds. For example purpose, the valid is fixed as expiring in 100 mins once the paymaster data is generated.
mode: ‘erc20’
This works by having the gas fee paid with whatever token is specified.
mode: ‘multitoken’
This works by having the gas fees paid with whatever token is specified but unlike erc20, each chain would have the same paymaster address across different tokens supported on that contract.
Please note that the above token is from Ancient8 testnet(28122024) which is available on arka_public_key
apiKey. Request 0x453478E2E0c846c069e544405d5877086960BEf2
tokens if you unable to fetch it on discord
Please get in touch if you wish to get an api key for development.