Learn how to execute actions on the user’s behalf, like transferring NFTs, and signing messages and transactions.

These APIs should be run from a server and NOT in the browser. Using these APIs in the client exposes your client secret, which WILL result in unauthorized access to your project.

For more detailed information, visit the API reference.

  • Fetching and Displaying Content

  • Transferring NFTs

  • Signing Messages

  • Signing Transactions

Visualizing the NFTs

API scope required: wallets:nfts.read

The following API retrieves the NFTs stored in a wallet so you can display them in your frontend:

const baseUrl = "https://staging.crossmint.com/api";
const chain = "polygon";
const wallet = "0x1234abcd...";
const options = { method: "GET", headers: { "X-API-KEY": "YOUR_API_KEY" } };

fetch(
  `${baseUrl}/2022-06-09/wallets/${chain}:${wallet}/nfts?page=1&perPage=20`,
  options
)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));

Wallet UI Components available

Leverage pre-made components to launch faster.

How to Retrieve a User’s Wallets

You can retrieve a list of your user’s wallet addresses with the fetch wallets endpoint.

const baseUrl = "https://staging.crossmint.com/api";
const email = "testy@test.xyz";
const options = { method: "GET", headers: { "X-API-KEY": "YOUR_API_KEY" } };

fetch(`${baseUrl}/v1-alpha1/wallets?email=${email}`, options)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));