Aarc
Aarc
Aarc is a set of tools built to simplify the use of smart accounts.
Etherspot’s infrastructure is included within this tooling and available to use within it.
In this tutorial we’ll learn how to use an Etherspot smart account with the Aarc SDK.
We’ll setup the Smart Account in two steps using Aarc SDK:
- Fetch the Smart Account address for the EOA.
- Deploy and transfer native funds to the Smart Account.
Guide
- Create a new directory, initialize npm in it and install Aarc Migrator Package and ethers
- Create a new file index.js in src folder.
- Import the dependencies.
-
Get the Aarc API Key (you can learn how to get it from here), your EOA private key, and the RPC URL.
-
Initialize the provider and Aarc SDK
- Fetch the Smart Account addresses of the EOA.
Here, we provide the WALLET_TYPE.ETHERSPOT to fetch the Smart Account addresses associated with the EOA. In the response, we will see the addresses associated with the EOA for Etherspot’s Smart Accounts. No Smart Account may be deployed, so it will only generate and return the Smart Account address, mentioning its deployment status and the walletIndex.
- Deploy the Smart Account.
To deploy the smart account, use aarcSDK.transferNativeAndDeploy this will take a few parameters, as shown below.
- deploymentWalletIndex and receiver can be fetched from the above response.
- amount should be in hex string, which can be easily done by usingBigNumbers from ethers.
- Run the script.
You will see the following response after deploying the Etherspot Smart Wallet.