Skip to content
On this page

NFT module

The nft module can be accessed via candypay.nft() and provides the following methods:


The airdrop method allows you to airdrop certain NFT without having to create an NFT beforehand.


  • payer: The public key of the wallet which would pay gas fees of the transaction
  • owner: The public key of user to whom the NFT would be airdropped
  • network: The cluster where the transaction would take place i.e either mainnet-beta, devnet or testnet
  • metadata: The metadata regarding the NFT
  • rpc_url: Custom RPC URL


  • signature: The signature of the NFT airdrop transaction
  • accounts: The accounts related to the NFT airdrop transaction i.e mint account, metadata account, master edition account and token account
  • blockhash: The blockhash which is being used in the transaction


import { CandyPay } from "@candypay/sdk";
import * as anchor from "@project-serum/anchor";
import dotenv from "dotenv";
import base58 from "bs58";


const sdk = new CandyPay();

const PAYER = anchor.web3.Keypair.fromSecretKey(
const USER = new anchor.web3.PublicKey(

const { signature } = await sdk.nft.airdrop({
  metadata: {
    name: "DeGod",
    uri: "",
    symbol: "DEGOD",
    collection: null,
    sellerFeeBasisPoints: 1000,
    creators: [
        address: PAYER.publicKey,
        share: 100,
    uses: null,
  network: "devnet",
  owner: USER,
  payer: PAYER,

console.log(`Signature - ${signature}`);