Interact and manage your wallet
Once a wallet is created for your end user, you have the flexibility to create unique experiences out of the box. Those include:
- Visualizing your user's NFTs in their wallet
- Transferring NFTs between wallets
- Sign in with Crossmint
- Tokengating
Haven't created a wallet yet? Start here
Visualizing your user’s NFTs in wallet
In order to create a robust front-end wallet experience, you need to know which NFTs your users are holding. We provide an API that helps here - by fetching the NFT contents of a user’s wallet:
const fetch = require('node-fetch');
const url = 'https://staging.crossmint.com/api/v1-alpha1/wallets/chain:wallet/nfts?page=xx&perPage=xx';
const options = {
method: 'GET',
headers: {
accept: 'application/json',
'X-CLIENT-SECRET': '<YOUR_CLIENT_SECRET>',
'X-PROJECT-ID': '<YOUR_PROJECT_ID>'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Parameter | Type | Description |
---|---|---|
walletAddress | string | Wallet address for which assets should be fetched |
chain | string | Chain for which wallet should be fetched. Options are: [ Ethereum , Polygon , BSC , Solana , Cardano ] |
page | int | Page index, starting with 1 |
perPage (optional) | int | Number of items to display per page. Default: 20 |
Transferring NFTs between wallets
Give your users full control over their NFTs by allowing them to move them as needed between wallets or to give a 3rd party non-custodial wallet. This is a gas-less experience for your users.
Supports ERC-721, ERC-1155, Solana, and Cardano transfers.
const fetch = require('node-fetch');
const url = 'https://staging.crossmint.com/api/v1-alpha1/transfer';
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
'X-CLIENT-SECRET': '',
'X-PROJECT-ID': ''
},
body: JSON.stringify({
chain:'',
tokenId:'',
toAddress: '',
tokenMintAddress: '',
fromAddress: ''
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Parameter | Type | Description |
---|---|---|
chain | string | Chain for which wallet should be fetched. Options are: [ Ethereum , Polygon , BSC , Solana , Cardano ] |
tokenId | string | The identifier of the NFT from the contract |
toAddress | string | The target address for where the NFT should go. |
tokenMintAddress | string | Contract address |
fromAddress | string | The wallet address for the current owner. |
Updated about 1 month ago