Here, we provide the WALLET_TYPE.ALCHEMY_SIMPLE_ACCOUNT to fetch the Light Account addresses associated with the EOA.
In the response, we will see the addresses associated with the EOA for Alchemy's Light Account. No Light Account may be deployed, so it will only generate and return the Light Account address, mentioning its deployment status and the walletIndex.
Example response when no Smart Account is deployed!
const { ethers,BigNumber } =require("ethers");const {Migrator,WALLET_TYPE}=require("@aarc-xyz/migrator");let provider =newethers.providers.JsonRpcProvider("YOUR_RPC_URL");let signer =newethers.Wallet("YOUR_PRIVATE_KEY", provider);let eoaAddress =signer.address;let aarcSDK =newMigrator({ rpcUrl:"YOUR_RPC_URL", chainId:80001,// Mumbai Testnet apiKey:"YOUR_AARC_API_KEY"});asyncfunctionmain() {try {constsmartWalletAddresses=awaitaarcSDK.getSmartWalletAddresses(WALLET_TYPE.ALCHEMY_SIMPLE_ACCOUNT, eoaAddress );console.log(' smartWalletAddresses ', smartWalletAddresses); } catch (error) {console.error(' error ', error); }try {constresponse=awaitaarcSDK.transferNativeAndDeploy({ walletType:WALLET_TYPE.ALCHEMY_SIMPLE_ACCOUNT, owner: eoaAddress, receiver:"0x5d3848F6CDB26F2b158c19D47a0c325d30734367",//Change the receiver address to the SA address signer: signer, deploymentWalletIndex:0,// Change the index to the index of the SA amount:BigNumber.from("10000")._hex // Change the string to the amount you want to transfer });console.log("Transfer and Deploy Response: ", response); }catch(error){console.error(' error ', error); }}main();
nodesrc/index.js
You will see the following response after deploying the Alchemy Smart Wallet.