What’s the best way to fund a new user’s wallet automatically? I am using the vanilla js modal sdk
Hi REMSee,
It’s great to see you’re exploring automated funding for new user wallets using the Web3Auth Plug and Play SDK with the Vanilla JavaScript modal!
To fund a new user’s wallet automatically, you can consider a few approaches based on your specific requirements and set up:
-
Using Faucets: You can integrate a faucet service that allows sending a small amount of cryptocurrency to new wallets for free. This is commonly used for test networks.
-
Smart Contracts: Deploy a smart contract that automatically funds new wallets when they sign up or reach a certain condition. This can be programmed to trigger transactions based on specific actions.
-
Funding Wallet via Backend: Set up a server-side script that listens for wallet creations and initiates a transfer from a pre-funded wallet you control.
-
Third-Party Services: Utilize third-party API services that offer wallet funding mechanisms, which can tie into your user onboarding process.
I encourage you to explore these options and choose the one that aligns best with your implementation needs. If you need further guidance on any of these methods or have specific constraints, feel free to share more details!
Happy integrating!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours
I am looking for an example of this. Ideally I would like to implement it as a smart contract listener, but I dont know where that would be listening to. Does web3auth offer this sort of an API?
Hey @remseechannel can you briefly describe the usecase? By funding, do you mean upon first login, you want to fund user’s wallet with some ETH to carry out transaction?
If you can explain the usecase why you want to fund, I can evaluate and give the other best options for the usecase.
The use case is like a free trial. So I give $1 for a user for signing up and they get to try out the service. I have built a faucet that addresses the issue and is secured by cors, but it would have been nice for web3auth to enable this capability in the account dashboard
Yeah, we don’t have such capability as of now, and I don’t think we are planning to add it in near future since implementation differs from client to client.
One other way you can achieve the same is using the Paymaster and 4337 accounts. Instead of the EOAs, you can generate the Smart Accounts 4337 for the users, and use the Paymaster service to sponsor their transaction. Advantage? You can define the custom parameters which transaction should be sponsored, and which not. You can also add the limit, like Paymaster can only sponsor upto 2 transactions per user. And since paymaster will calculate the gas dynamically, you’ll also save on the fees to transfer the funds to user’s EOA wallet.