🔒 Wallets API
Crossmint's custodial wallet solution. Create wallets for your users and get the NFTs contents of those wallets
White Label / Enterprise Access Required
Crossmint Whitelabel is offered as an enterprise solution and requires evaluation of your use case before approval. Reach out to sales support to get started.
API Details
import fetch from 'node-fetch';
const params = new URLSearchParams({ userId: "<YOUR_USER_ID>" });
const response = await fetch(
`https://www.crossmint.com/api/v1-alpha1/wallets?${params.toString()}`,
{
method: 'GET',
headers: {
'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>'
}
}
);
const wallets = await response.json();
curl \
'https://www.crossmint.com/api/v1-alpha1/wallets?userId=some-user-identifer'
-H 'X-PROJECT-ID: <YOUR_PROJECT_ID>' \
-H 'X-CLIENT-SECRET: <YOUR_CLIENT_SECRET>'
Create user wallets
import fetch from 'node-fetch';
const body = {
userId: "<YOUR_USER_ID>", // an identifier you provide for your customer. Can be an email, phone number, or an arbitrary identification string. This will map your user to their wallet
chain: "solana|ethereum|polygon", // specify one of the three
}
const response = await fetch(
`https://www.crossmint.com/api/v1-alpha1/wallets`,
{
method: 'POST',
headers: {
'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>'
},
body: JSON.stringify(body),
}
);
const wallets = await response.json();
Fetch the contents of a wallet
Once you have the user's wallet address, use /wallets/{locator}/nfts
endpoint to fetch the NFTs in the wallet
import fetch from 'node-fetch';
const locator = `sol:A9vzqFSxKVasf55GdZCAFKhKW9zckzx6ekhhsQTretTa`;
const locator = `eth:0xA5058fbcD09425e922E3E9e78D569aB84EdB88Eb`;
const locator = `poly:0xA5058fbcD09425e922E3E9e78D569aB84EdB88Eb`;
const response = await fetch(
`https://www.crossmint.com/api/v1-alpha1/wallets/${locator}/nfts`,
{
method: 'GET',
headers: {
'X-PROJECT-ID': '<YOUR_PROJECT_ID>',
'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>'
}
}
);
const data = await response.json();
const contractAddress = data.address;
curl \
'https://www.crossmint.com/api/v1-alpha1/wallets/solana:A9vzqFSxKVasf55GdZCAFKhKW9zckzx6ekhhsQTretTa/nfts' \
-H 'X-PROJECT-ID: <YOUR_PROJECT_ID>' \
-H 'X-CLIENT-SECRET: <YOUR_CLIENT_SECRET>'
Updated 18 days ago