Welcome! In this guide we will be diving into wallet creation on Arbitrum. By the end, you will be able to onboard your users into your onchain application by creating embedded custodial wallets on Arbitrum for them using the Crossmint Wallet API.
These wallets can then be managed end-to-end using Crossmint Auth which allows for users to authenticate using web3 or traditional sign-in methods like Email OTP, Social Accounts (Google, Apple, X, etc) and Farcaster. Head over to Popset to see how Crossmint powers their user onboarding using Crossmint Auth and Crossmint Wallet API.
If you're looking to onboard users with non-custodial smart wallets, check out our quickstart guides.
For any assistance, reach out to us on Discord or Twitter where we're happy to answer any question you may have!
Prerequisites for Creating Arbitrum Wallets
Before you start, you will need to create a Crossmint Account so that you can access Crossmint's suite of onchain developer and no-code tools.
Next, navigate to the "Developers" section and create a Server-side API Key:
- Select essential scopes:
- "wallets.read"
- "wallets.create"
You need the scopes specified above to create Arbitrum wallets.
Creating Custodial Wallets on Arbitrum
Now that you have everything set up, let's look at how you can create an embedded Arbitrum wallet.
First, create a Javascript code file on your computer and then paste the below boilerplate-code within that code file. Use this to create wallets via email:
const options = {
method: "POST",
headers: {
"X-API-KEY": "<your-api-key-here>",
"Content-Type": "application/json"
},
body: '{"email":"yourEmail@email.com","chain":"arbitrum"}'
};
fetch("<https://www.crossmint.com/api/v1-alpha2/wallets>", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
Alternatively, you can create wallets by UserID:
const options = {
method: "POST",
headers: {
"X-API-KEY": "<your-api-key-here>",
"Content-Type": "application/json"
},
body: '{"userId":"anyUserId","chain":"arbitrum"}'
};
fetch("<https://www.crossmint.com/api/v1-alpha2/wallets>", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
- Replace "<your-api-key-here>" with the API key that you created earlier.
- Replace "yourEmail@email.com" with the actual email address of the user that you are trying to create the wallet for.
- With UserID, replace "anyUserId" with any value of userId that you want to assign to a user. This value is of String type.
Pro Tips
- Use the staging environment (staging.crossmint.com/console) for testing
- Replace placeholders with your actual API key and user information
- Run the script using Node.js: node createWallet.js
Next Steps
Now that you have wallets for your users, you can transfer tokens between wallets, check wallet balances, fetch NFTs that are held by wallets and more.
Ready to dive deeper? Learn how to create and mint NFTs on Arbitrum.
Need Support?
- Join the Crossmint Discord Server
- Visit the Crossmint Help Page