Shyft
Start BuildingSupportWebsite
  • Welcome
    • 👋Introducing Shyft
    • 🏗️Start Building
  • Solana Infrastructure
    • 🚁Shyft RPCs
  • Yellowstone gRPC Network
    • Decoding gRPC Latency
    • ⚡gRPC Docs
      • Introduction
      • Authentication
      • Subscribe Requests
      • FAQ
      • Getting Started
        • Initializing the Yellowstone Client
        • Making a gRPC connection
        • Adding a Reconnection Mechanism
        • 🔥Replaying Slots with Solana yellowstone gRPCs
        • Modifying your Subscribe Request
        • Closing a gRPC Connection
      • Subscribing to Transactions
        • All Transactions of an address
        • Subscribing to all transactions of a Liquidity Pool
        • Subscribing to all transactions of multiple addresses
        • Subscribing to all transactions of a Token
      • Subscribing to Accounts
        • Account Updates for a Program
        • Account Updates for an Address
        • Account updates using memcmp
      • Streaming Blocks & BlocksMeta
        • Streaming Block Updates
        • Subscribing to BlocksMeta
      • Modifying & Unsubscribing
  • Solana defi data
    • DeFI APIs
      • Get Pool By Address
      • Get Pools By Token Pair
      • Get All Pools for a Token
      • Get Liquidity Details of a Pool
  • Callbacks
    • ☎️What are Callbacks?
      • Transaction Callbacks
      • Account Callbacks
    • 📔Callback APIs
      • Response Structure
      • List Callbacks
      • Register callback
      • Remove callback
      • 🔥Pause a callback
      • 🔥Resume a callback
      • Update Callbacks
      • Add Addresses
      • Remove addresses
  • Solana Super Indexers
    • 🌩️GraphQL APIs
      • Getting Started
      • Building Queries
      • Paginating Response
      • Applying Filters
      • Ordering and Sorting Data
    • 📀Case Studies
      • Tensor
        • Get Active Listings of a Wallet
        • Get Active Bids of a Wallet
        • Get Active Listings of a Collection
        • Get all Bids of a Collection
        • Get all Pools of a Margin Account
        • Get all Pools by Owner
      • Raydium
        • Get Pool By Address
        • Get Pools By Token Address
        • Get Pools Created Between Time
        • Get Pool Burn Percentage
        • Get Liquidity Details of a Pool
        • Get Pool and OpenBook Market Info
        • Get Token Supply Percentage In Pool
      • Orca Whirlpool
        • Get Pool by Address
        • Get Pool by Token Address
        • Get Positions for a Pool
        • Get Positions for a Wallet
        • Get Liquidity Details of a Pool
      • Kamino
        • Get Borrow Details of a Wallet
        • Get Deposit Details of a Wallet
        • Get Reserve Details
      • Cross Marketplace Queries
        • Get active listings across marketplaces for a wallet
        • Get listings for a collection across marketplaces
        • Get floor price of a collection
      • Cross Defi Queries
        • Fetch Liquidity Pools for Token
      • Native Staking
        • Get Stakes for a Wallet
        • Get Stakes For Validator
      • Governance/Realms
        • Get DAO Token Owners
        • Get Proposals For Governing Mint
        • Get All Proposals For DAO
        • Get DAO Treasury Info
        • Get All Active Proposals For Wallet
      • Meteora
        • Get All LB Position Pairs
        • Get Position of a User Wallet
        • Get Pool by Token Addresses
        • Get All Deposits for a User
        • Get All Withdraws for a User
        • Get All Fees Claimed by a User
        • Get All User Positions and Deposits for a Pool
        • Get All User Positions and Withdrawals for a Pool
      • Fluxbeam
        • Get Pool by Address
        • Get Pool by Token Addresses
      • Drift
        • Get User account for Delegate
        • Get User accounts based on authority
        • Get User details based on Referrer
        • Get Borrow/Deposit Amount for an User
        • Get PrepPositions for an User Account
        • Getting OrderId and userOrderId
        • Get OpenOrders for a User Account
      • 🔥Pumpswap
        • 🔥Get Pool by Address
        • 🔥Get Pool by Creator Address
        • 🔥Get Pools by Token Addresses
      • Raydium Launchpad
        • Get Bonding Curve Details by Pool Address
        • Get All Pools for a Creator
        • Get Pools by Token Addresses
        • Get Migration details of a Pool
  • Solana APIs
    • API Reference
    • Transactions
      • Parsed Transaction Structure
      • Transaction APIs
        • History
        • Parse Signature
        • Parse Multiple Signatures
        • Send
        • Send Multiple
    • NFT
      • 🔥Create Gasless
      • Create
      • Read All
      • Burn
      • 🔥Burn Multiple NFTs V2
      • Update
      • 🔥Create NFT from Metadata
      • 🔥Read Wallet Nfts
      • 🔥Read Selected NFTs
      • 🔥Get NFT Owners
      • 🔥Update NFT Metadata Uri
      • 🔥Update V2
      • Search
      • Transfer
      • Transfer Multiple NFTs
      • Mint
      • Read
    • Wallet
      • Get Balance
      • Get Token Balance
      • Get All Tokens Balance
      • Get Portfolio
      • Resolve Address
      • Get All Domains
      • Get Stake Accounts
    • Fungible Tokens
      • Create
      • Mint
      • Burn
      • 🔥Update
      • Get Token Info
      • Transfer
      • Airdrop
  • 📀gRPC Case Studies
    • Pumpfun
      • Streaming and Parsing Real-Time Pump.fun Transactions with Solana Yellowstone gRPC
Powered by GitBook
On this page
  • Get All NFT addresses
  • GET /sol/v1/candy_machine/nft_addresses
  • Get All NFTs
  • GET /sol/v1/candy_machine/nfts
  • Create Candy Machine V3
  • POST /sol/v1/candy_machine/create
  • Insert Items in Candy Machine V3
  • POST /sol/v1/candy_machine/insert
  • Mint NFTs from Candy Machine V3
  • POST /sol/v1/candy_machine/mint
  • Create monitor (Deprecated)
  • POST /sol/v1/candy_machine/monitor
  • Unmonitor candy machine (Deprecated)
  • DELETE /sol/v1/candy_machine/monitor
  • Get Candy Machine V3 Details
  • GET /sol/v1/candy_machine/details

Was this helpful?

  1. Solana APIs

Candy Machine

Candy machine APIs to create, mint and list nfts from the same. Currently we support reading from all the versions of candy machine. For creating and minting we support Candy Machine V3 account V1

Get All NFT addresses

Get All NFT addresses minted using a particular candy machine by providing a Candy machine address.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • address: Candy machine address

  • version (optional): Candy machine version (v2/v3). By default, it takes v3 if no query is passed.

GET /sol/v1/candy_machine/nft_addresses

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<YOUR_API_KEY>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch(
  "https://api.shyft.to/sol/v1/candy_machine/nft_addresses?network=devnet&address=CZ7zmhqpUSFAtaW7BsyXmgsRaLjKBb6gWHiEnNFE9DNj&version=v3",
  requestOptions
)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
  "success": true,
  "message": "All NFTs minted on this candy machine address: CZ7zmhqpUSFAtaW7BsyXmgsRaLjKBb6gWHiEnNFE9DNj",
  "result": [
    "94jvevKQyKJ4CY3hSeup9vKYhM3eRFwtcy8uCnbCrMzq",
    "9s1FUT6CVLUcSx3LU2swiWQNQzKCbwPaoda7wpBQjhoz",
    "CC54wYuG24bF58MLiNEA8oR9Ce3hujWCEPX4JoUbQeSU",
    "7CYx1C9zEmn5cmCbKrc438YRKztugw1DSwe6K3FGopCt",
    "3sr7srXWr3G4U8EjyfKMAHixoiM2ndk7duy9deBaDSGk",
    "6sTP34JhL1aoeGBajfnwDUML4x7n49KYH32mTtCDUpCp"
  ]
}

Get All NFTs

Get All NFTs minted using a particular candy machine by providing a Candy machine address. Returns on-chain and off-chain NFT data. This is a paginated API.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • address: Candy machine address

  • version (optional): Candy machine version (v2/v3). By default, it takes v3 if no query is passed.

  • page (optional): From which page want to traverse, by default page is 1

  • size (optional): How many NFTs want to get on one page, by default size is 10

GET /sol/v1/candy_machine/nfts

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<YOUR_API_KEY>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch(
  "https://api.shyft.to/sol/v1/candy_machine/nfts?network=devnet&address=H2oYLkXdkX38eQ6VTqs26KAWAvEpYEiCtLt4knEUJxpu&version=v2&page=1&size=3",
   requestOptions
)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
    "success": true,
    "message": "All NFTs minted on this candy machine address: H2oYLkXdkX38eQ6VTqs26KAWAvEpYEiCtLt4knEUJxpu",
    "result": {
        "nfts": [
            {
                "name": "Cet #4892",
                "symbol": "CoC+",
                "royalty": 5,
                "image_uri": "https://arweave.net/sebifUQ3lHJDpGsMUf9amqGJ4O5mM-ow9ehYdD8gavA?ext=png",
                "cached_image_uri": "https://arweave.net/sebifUQ3lHJDpGsMUf9amqGJ4O5mM-ow9ehYdD8gavA?ext=png",
                "metadata_uri": "https://arweave.net/4hw1VhoFIziLvugabTI0ioDEKqgU2q7hAjKc-3Qe4hs",
                "mint": "537d3MhYLiYemihaWH1PQLvUhnBpMJRLjnTVrJEAWnAW",
                "owner": "FP8nkppERnEPCH2psZb9J3Jv3PeXQDnZRqNCsKDR3iNp",
                "update_authority": "FP8nkppERnEPCH2psZb9J3Jv3PeXQDnZRqNCsKDR3iNp",
                "creators": [
                    {
                        "address": "EcUAwbpczgPqqhG1zVuPnojkCSR4faiyNyAE98jp57P1",
                        "share": 50,
                        "verified": false
                    },
                    {
                        "address": "FP8nkppERnEPCH2psZb9J3Jv3PeXQDnZRqNCsKDR3iNp",
                        "share": 50,
                        "verified": false
                    }
                ],
                "collection": {
                    "name": "Cets on Creck",
                    "family": "Cets on Creck"
                },
                "attributes": {
                    "Background": "Olive",
                    "Skin": "IDGAF tatt",
                    "Clothing": "Haul of fall",
                    "Mouth": "grrr",
                    "Eye": "IDGAF",
                    "Headgear": "Cet cap"
                },
                "attributes_array": [
                    {
                        "trait_type": "Background",
                        "value": "Olive"
                    },
                    {
                        "trait_type": "Skin",
                        "value": "IDGAF tatt"
                    },
                    {
                        "trait_type": "Clothing",
                        "value": "Haul of fall"
                    },
                    {
                        "trait_type": "Mouth",
                        "value": "grrr"
                    },
                    {
                        "trait_type": "Eye",
                        "value": "IDGAF"
                    },
                    {
                        "trait_type": "Headgear",
                        "value": "Cet cap"
                    }
                ],
                "files": [
                    {
                        "uri": "4891.png",
                        "type": "image/png"
                    }
                ],
                "is_loaded_metadata": true,
                "primary_sale_happened": false,
                "is_mutable": true
            },
            {
                "name": "Cet #6616",
                "symbol": "CoC+",
                "royalty": 5,
                "image_uri": "https://arweave.net/q8IqJw54FUcUblCFjC8IYquhmq7i1ZW0Y-PEL5HH1fQ?ext=png",
                "cached_image_uri": "https://arweave.net/q8IqJw54FUcUblCFjC8IYquhmq7i1ZW0Y-PEL5HH1fQ?ext=png",
                "metadata_uri": "https://arweave.net/Npx4gncKY4Tk0aI44hKYrOcDPleKI-mXeb8jisVIhGI",
                "mint": "HBXeDf9V77DCo6dMFbL4vUfThF7rb1oUZewE9eYZP1he",
                "owner": "4i7ZrpYC2duUXrss8QCf2Xe8DttdF2nXm9o6MMd4J67s",
                "update_authority": "4i7ZrpYC2duUXrss8QCf2Xe8DttdF2nXm9o6MMd4J67s",
                "creators": [
                    {
                        "address": "EcUAwbpczgPqqhG1zVuPnojkCSR4faiyNyAE98jp57P1",
                        "share": 100,
                        "verified": false
                    }
                ],
                "collection": {
                    "name": "Cets on Creck",
                    "family": "Cets on Creck"
                },
                "attributes": {
                    "Background": "Sky",
                    "Skin": "peblo",
                    "Clothing": "Cop drops",
                    "Mouth": "Cig pig",
                    "Eye": "What's up",
                    "Headgear": "Piercing 1"
                },
                "attributes_array": [
                    {
                        "trait_type": "Background",
                        "value": "Sky"
                    },
                    {
                        "trait_type": "Skin",
                        "value": "peblo"
                    },
                    {
                        "trait_type": "Clothing",
                        "value": "Cop drops"
                    },
                    {
                        "trait_type": "Mouth",
                        "value": "Cig pig"
                    },
                    {
                        "trait_type": "Eye",
                        "value": "What's up"
                    },
                    {
                        "trait_type": "Headgear",
                        "value": "Piercing 1"
                    }
                ],
                "files": [
                    {
                        "uri": "6615.png",
                        "type": "image/png"
                    }
                ],
                "is_loaded_metadata": true,
                "primary_sale_happened": false,
                "is_mutable": true
            },
            {
                "name": "Cet #6616",
                "symbol": "CoC+",
                "royalty": 5,
                "image_uri": "https://arweave.net/q8IqJw54FUcUblCFjC8IYquhmq7i1ZW0Y-PEL5HH1fQ?ext=png",
                "cached_image_uri": "https://arweave.net/q8IqJw54FUcUblCFjC8IYquhmq7i1ZW0Y-PEL5HH1fQ?ext=png",
                "metadata_uri": "https://arweave.net/Npx4gncKY4Tk0aI44hKYrOcDPleKI-mXeb8jisVIhGI",
                "mint": "6tCgReRPbcjd5ECA9K8H4bvEYD7NDyLNpYQxwV6Adtte",
                "owner": "4i7ZrpYC2duUXrss8QCf2Xe8DttdF2nXm9o6MMd4J67s",
                "update_authority": "4i7ZrpYC2duUXrss8QCf2Xe8DttdF2nXm9o6MMd4J67s",
                "creators": [
                    {
                        "address": "EcUAwbpczgPqqhG1zVuPnojkCSR4faiyNyAE98jp57P1",
                        "share": 100,
                        "verified": false
                    }
                ],
                "collection": {
                    "name": "Cets on Creck",
                    "family": "Cets on Creck"
                },
                "attributes": {
                    "Background": "Sky",
                    "Skin": "peblo",
                    "Clothing": "Cop drops",
                    "Mouth": "Cig pig",
                    "Eye": "What's up",
                    "Headgear": "Piercing 1"
                },
                "attributes_array": [
                    {
                        "trait_type": "Background",
                        "value": "Sky"
                    },
                    {
                        "trait_type": "Skin",
                        "value": "peblo"
                    },
                    {
                        "trait_type": "Clothing",
                        "value": "Cop drops"
                    },
                    {
                        "trait_type": "Mouth",
                        "value": "Cig pig"
                    },
                    {
                        "trait_type": "Eye",
                        "value": "What's up"
                    },
                    {
                        "trait_type": "Headgear",
                        "value": "Piercing 1"
                    }
                ],
                "files": [
                    {
                        "uri": "6615.png",
                        "type": "image/png"
                    }
                ],
                "is_loaded_metadata": true,
                "primary_sale_happened": false,
                "is_mutable": true
            }
        ],
        "page": 1,
        "size": 3,
        "total_data": 11,
        "total_page": 4
    }
}

Create Candy Machine V3

POST /sol/v1/candy_machine/create

Body

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: The public key of the creator of candy machine

  • symbol: The symbol for NFT's which are to be minted from candy machine

  • max_supply: Maximum number for edition NFTs that can be minted from each NFT individually minted NFT

  • royalty: The secondary sale royalties to be set on minted NFT's eg. 300 will give 3% royalty to the creator

  • collection: The address of the collection NFT. All the minted NFT's will have collection NFT set pointing to this address

  • items_available: Total number of tokens that can be minted from the candy machine

  • amount: The amount which has to be transferred to owner on each mint in SOL

  • creators (optional): Array of creators, default is creator address with 100% share

[
    { "address": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY", "share": 100}
]
  • item_settings (optional): Config for each token which is minted from the candy machine. Either of item_settings or bulk_item_settings has to be set not both.

{
   prefix_name: 'My token BYAC'              // String, name set for all the tokens
   name_length: 32                           // Number, max length for each token name excluding prefix_name length
   prefix_uri: 'https://some.uri/abc/path'   // String, metadata path prefix for each token minted from candy machine
   uri_length: 12                            // Number, max length for each token metadata uri excluding prefix_uri length
   is_sequential: false                      // Boolean, should candy machine mint tokens by the order in which they are inserted
}

Default values for item settings:

{
   prefix_name: ''
   name_length: 32 
   prefix_uri: ''
   uri_length: 200
   is_sequential: false
}
  • bulk_item_settings: (Optional) Item settings for bulk nft creation. Name and uri of metadata file. Either of item_settings or bulk_item_settings has to be set not both.

  • guards: (optional) An object containing guard configuration for different candy machine guards.

  • groups: (Optional) Array of candy guard groups with their configs to allow users to mint for different use cases

  • fee_payer (optional): Public key of the account from which all the fees for creating candy machine has to be taken. If providing this option, the resulting transaction must be signed by both, creator of candy machine (wallet field) and fee payer of this transaction (fee payer field)

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<YOUR_API_KEY>");

var raw = JSON.stringify({
    "network": "devnet",
    "wallet": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
    "symbol": "TSTSWG2",
    "max_supply": 0,
    "royalty": 333,
    "collection": "7KnYuwbcG3EDLBnpYTovGN1WjpB1WvvyNuMgjRezG33s",
    "items_available": 3,
    "amount": 0.4
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/create", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));javas
var myHeaders = new Headers();
myHeaders.append("x-api-key", "<api-key>");

var raw = "{\n    \"network\": \"devnet\",\n    \"wallet\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\",\n    \"symbol\": \"CAYB BS\",\n    \"max_supply\": 0,\n    \"royalty\": 333,\n    \"collection\": \"7KnYuwbcG3EDLBnpUTovGN1WjpB1WvvyNuMgjRezG33s\",\n    \"items_available\": 3,\n    \"bulk_item_settings\": {\n        \"name\": \"CAYB BS #$ID+1$\",\n        \"uri\": \"https: //some.uri/abc/path\"\n    },\n    \"amount\": 0.4\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{{url}}/candy_machine/create", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var myHeaders = new Headers();
myHeaders.append("x-api-key", "<api-key>");

var raw = "{\n    \"network\": \"devnet\",\n    \"wallet\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\",\n    \"symbol\": \"CAYB BS\",\n    \"max_supply\": 0,\n    \"royalty\": 333,\n    \"collection\": \"7KnYuwbcG3EDLBnpUTovGN1WjpB1WvvyNuMgjRezG33s\",\n    \"items_available\": 3,\n    \"guards\": {\n        \"solPayment\": { \"amount\": 0.5, \"destination\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\"},\n        \"addressGate\": { \"address\": \"Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj\"},\n        \"allowList\": { \"allowList\": [\"Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj\"]},\n        \"botTax\": { \"lamports\": 10 },\n        \"mintLimit\": { \"limit\": 1 },\n        \"startDate\": { \"date\": \"2023-01-18T17:00:00Z\" },\n        \"endDate\": { \"date\": \"2023-03-21T17:00:00Z\" },\n        \"tokenPayment\": { \"amount\": 1, \"destination\": \"AUE3Z8m8HDg8fLaho1XcQzxmmM9bNwKkdLqqkWAdR5Et\", \"mint\": \"4831mWZ5kJxer8VbLVfARG4jz7zgXKdwkDrGp5Lf4xbY\"},\n        \"tokenBurn\": { \"amount\": 2, \"mint\": \"qKi7RU529xuL1JhRp2We23NmNcLEoVJQmPgmdzHNbF9\"}\n    },\n    \"amount\": 0.4\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{{url}}/candy_machine/create", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var myHeaders = new Headers();
myHeaders.append("x-api-key", "<api-key>");

var raw = "{\n    \"network\": \"devnet\",\n    \"wallet\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\",\n    \"symbol\": \"GRGP\",\n    \"max_supply\": 0,\n    \"royalty\": 333,\n    \"collection\": \"7KnYuwbcG3EDLBnpUTovGN1WjpB1WvvyNuMgjRezG33s\",\n    \"items_available\": 3,\n    \"bulk_item_settings\": {\n        \"name\": \"GURDGRUOP #$ID+1$\",\n        \"uri\": \"https: //some.uri/abc/path\"\n    },\n    \"groups\": [\n        {\n            \"label\": \"early\",\n            \"guards\": {\n                \"solPayment\": {\n                    \"amount\": 0.5,\n                    \"destination\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\"\n                },\n                \"addressGate\": {\n                    \"address\": \"Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj\"\n                },\n                \"tokenPayment\": {\n                    \"amount\": 1,\n                    \"destination\": \"AUE3Z8m8HDg8fLaho1XcQzxmmM9bNwKkdLqqkWAdR5Et\",\n                    \"mint\": \"4831mWZ5kJxer8VbLVfARG4jz7zgXKdwkDrGp5Lf4xbY\"\n                }\n            }\n        },\n        {\n            \"label\": \"late\",\n            \"guards\": {\n                \"solPayment\": {\n                    \"amount\": 0.5,\n                    \"destination\": \"7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY\"\n                },\n                \"mintLimit\": {\n                    \"limit\": 1\n                }\n            }\n        }\n    ],\n    \"amount\": 0.4\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{{url}}/candy_machine/create", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.shyft.to/sol/v1/candy_machine/create',
  'headers': {
    'x-api-key': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "network": "devnet",
    "wallet": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
    "symbol": "CAYB BS",
    "max_supply": 0,
    "royalty": 333,
    "collection": "7KnYuwbcG3EDLBnpUTovGN1WjpB1WvvyNuMgjRezG33s",
    "items_available": 3,
    "bulk_item_settings": {
      "name": "CAYB #$ID+1$",
      "uri": "https: //some.uri/abc/path"
    },
    "guards": {
      "solPayment": {
        "amount": 0.5,
        "destination": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY"
      }
    },
    "fee_payer": "Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
{
    "success": true,
    "message": "Created a candy machine",
    "result": {
        "encoded_transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACui8B+18T1zpPuetq1/AMhXw5io9ildaltVspLJSQueR9phCn1YdK7cdto7bReR/DjZTvHULYsExLNFYjaWrUHAgAHDGPjqzVIuCP/v6/WrvtBX/4zMJrKp+ecAZZ/cohLlP6LsjrAD1FriSeOEj1GLISVrJ7wTpW41SNfCDH3fQosesMP7lMdIiOTLbUhqmZn5cICmn+sI9G6XUIJM9/JND7u3yooKwh66GXAOLyC+yKhOT8b3cq0VwIFkJ0nI+gihJE3VKtBAcAXUnyqBCDPrQh8zxkVMqrDoiNbkIoZUFoY47kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC9zxe9FsEN/+HjqovSGHaSVFBNyXP1FOtIdt0vDQngEUM0TL/e8u8g25DF0JRBZ01rXF+kL68aj0vrWFmka6HZd9hR1oE5nreowBoK6+huGhroE9cx0+Q3udOQxnkqh9q8hf8LWR+Em3McdMurEVO/KSfAdV6JPEZaZUt6s5K2S7FfJWoq7a/zPX9c2CSE9M1/P3+jgkanX2mxlJ5fdIysLcGWx49F8RTidUn9rBMPNWLhscxqg/bVJttG8A/gpRm/BDgX/gVu2+mXZQJr3hpyT3G0E6FPmw6Tv9A78V9oYBAoFAgEAAAVAr69tHw2Ym+00AAAAAgAAAAAAAAAAhNcXAAAAAGPjqzVIuCP/v6/WrvtBX/4zMJrKp+ecAZZ/cohLlP6LAAAAAAUCAAE0AAAAABBPggAAAAAASwQAAAAAAACvIX/C1kfhJtzHHTLqxFTvyknwHVeiTxGWmVLerOStkgkLAQQAAAYIBwADCwVfr69tHw2Ym+0BAAAAAAAAAAcAAABUU1RTV0cyTQEAAAAAAAAAAAEBAAAAY+OrNUi4I/+/r9au+0Ff/jMwmsqn55wBln9yiEuU/osAZAEAAAAAIAAAAAAAAADIAAAAAAAKBQIAAQkACLIoCr3kgbqM",
        "candy_machine": "CzjXhFT5zzeuMJ61Fb6GSdkqnhk64uMcHPWviZnSREEE",
        "signers": [
            "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY"
        ]
    }
}

Insert Items in Candy Machine V3

POST /sol/v1/candy_machine/insert

Body

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: The public key of the creator of candy machine

  • candy_machine: Address of the candy machine V3

  • index (optional): index from which items should be entered in the candy machine

  • items: Array of items to be inserted in candy machine

[
    {
        "name": "TOKEN #30", // String, name of the token excluding prefix_name specified while creating candy machine
        "uri": "https://example.com/path/to/some/json/metadata.json" // String, metadata uri of the token excluding prefix_uri
    }
]
var myHeaders = new Headers();
myHeaders.append("x-api-key", "<YOUR_API_KEY>");

var raw = JSON.stringify({
  "network": "devnet",
  "wallet": "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc",
  "candy_machine": "7yPeRofJpfPkjLJ8CLB7czuk4sKG9toXWVq8CcHr4DcU",
  "items": [
    {
      "name": "Token #21",
      "uri": "https://example.com/path/to/some/json/metadata.json"
    }
  ]
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/insert", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));javas
{
    "success": true,
    "message": "Items added in candy machine",
    "result": {
        "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDY+OrNUi4I/+/r9au+0Ff/jMwmsqn55wBln9yiEuU/ouyOsAPUWuJJ44SPUYshJWsnvBOlbjVI18IMfd9Cix6w68hf8LWR+Em3McdMurEVO/KSfAdV6JPEZaZUt6s5K2SKlAXVa2qR8Tp5g0vJSL/+HvQKG5pJbOpuQ3kjm+5qa4BAgIBAFTfMuDjlwhzagAAAAABAAAACQAAAFRPS0VOICMzMDMAAABodHRwczovL2V4YW1wbGUuY29tL3BhdGgvdG8vc29tZS9qc29uL21ldGFkYXRhLmpzb24=",
        "signers": [
            "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY"
        ]
    }
}

Mint NFTs from Candy Machine V3

POST /sol/v1/candy_machine/mint

Mint items from a ready candy machine V3. Items cannot be minted unless the candy machine is fully inserted with all the token details

Body

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: The public key of the person who wants to mint token from candy machine

  • authority: The public key of the owner of the candy machine

  • candy_machine: The public key of candy machine V3

  • mint_group: (Optional) The group label from which token should be minted from candy machine

  • guard_settings: (Optional) Additional candy guard settings

  • fee_payer: (Optional) Public key of the account who should be charged the transaction costs. If this option is specified then the transaction has to be signed by this address and not the wallet address

Response:

  • encoded_tranaction: A base64 encoded transaction string to be signed with the buyer_wallet.

  • transaction_version: returns either 'lagacy' or 0. To overcome legacy transaction size (1232 bytes), in some special condition returns 'v0' transaction.

  • mint: NFT mint address

  • signers (array of addresses): Generated transaction should be signed by these wallets before send the transaction.

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<YOUR_API_KEY>");

var raw = JSON.stringify({
    "network": "devnet",
    "wallet": "Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj",
    "authority": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
    "candy_machine": "6gWE4aRFEicA6WRdebax3Gfp7ya7ZVExHM8kLE1Kk38Q",
    "fee_payer": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/mint", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
    "success": true,
    "message": "Token minted from candy machine",
    "result": {
        "encoded_transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqxby7IOoy4bNaCOL5kDcG2HhoikbgeTWb3mWBVgKBMq0DZRLP1jW32ZEIKZGiYXsT3HBqFy99bv8xTgqX4+sIAgAPF2PjqzVIuCP/v6/WrvtBX/4zMJrKp+ecAZZ/cohLlP6Lz1osbHWpJPkyKbRQjzLNCyE+2b/RtJgLHowX2BeeXC0vc8XvRbBDf/h46qL0hh2klRQTclz9RTrSHbdLw0J4BE0R3tO/rcEEx16L8z6UBzAVt186MdLpe6Fpt7MLQgmyVGkhmAPIn8+3gbuGW2xrjDczSqNn/Qbg58csQ5nFJY1jqluBA8pIIN34r3pvz4XmjmWxcfvFrilsRWi3iJWRrHzwYd1+07mmqK2U/VOePsdzQ/QPqLv02Z+EaRmF85uSoMdNvXK3x2fzJ+RtxIq3+s1dvNEQXcRKzA4CkANdkC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB6KrJ+7PI5nVi1On3xexfgq7TKa7sK48wnCaC6hMWsdHvf3iDeC3jA7wYzOJFg7xiT9fjiJw3etocvZG6Dp+QBQzRMv97y7yDbkMXQlEFnTWtcX6QvrxqPS+tYWaRrodl32FHWgTmet6jAGgrr6G4aGugT1zHT5De505DGeSqH2ke4070ix+K2khG8Q942YdNVeJkIFhIojdMwyvXbp2ZyMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4Wa8hf8LWR+Em3McdMurEVO/KSfAdV6JPEZaZUt6s5K2SAwZGb+UhFzL/7K26csOb57yM5bvF9xJrLEObOkAAAADsV8lairtr/M9f1zYJIT0zX8/f6OCRqdfabGUnl90jKwtwZbHj0XxFOJ1Sf2sEw81YuGxzGqD9tUm20bwD+ClGBqfVFxh70WY12tQEVf3CwMEkxo8hVnWl27rLXwgAAAAGp9UXGSxcUSGMyUw9SvF/WNruCJuh/UTj29mKAAAAAAan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKmjzWHoEHsiPT8qt3xEbgm9PzlK+r8x3S6skv6+LWTBDAYQAAUCADUMAAgCAAE0AAAAAGBNFgAAAAAAUgAAAAAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqRYCARRDAABj46s1SLgj/7+v1q77QV/+MzCayqfnnAGWf3KIS5T+iwFj46s1SLgj/7+v1q77QV/+MzCayqfnnAGWf3KIS5T+iw4HAAYNAQgWFAAWAwEGAAkHAQAAAAAAAAARGgkPBAcAAAEABQMGEQoMAgsAEhYOCBMVEREADXh5F5KtbsfNAAAAAAA=",
        "transaction_version": "legacy",
        "mint": "ExR9KGxcmwEaLXHUcUDHEjC1azeqsiNdK895EjwfVGt4",
        "signers": [
            "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY"
        ]
    }
}

Create monitor (Deprecated)

⚠️ Soon it no longer be available.

POST /sol/v1/candy_machine/monitor

All mints from candy machine are watched and updated real time

Body

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • address: The public key of candy machine

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<api-key>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "network": "devnet",
  "address": "Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj",
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/monitor", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
    "success": true,
    "message": "Monitor started for candy machine",
    "result": {
        "address": "8UeV17qdr9pCXB8mMssWnAWUiYVpaaDZVgvZzmE2KMrA",
        "network": "devnet",
        "type": "CANDY_MACHINE"
    }
}

Unmonitor candy machine (Deprecated)

⚠️ Soon it no longer be available.

DELETE /sol/v1/candy_machine/monitor

Stop monitoring candy machine

Body

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • address: The public key of candy machine

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<api-key>");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "network": "devnet",
  "address": "Apeng15Pm8EjpAcaAXpNUxZjS2jMmGqikfs281Fz9hNj",
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/unmonitor", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
    "success": true,
    "message": "Monitor stopped for candy machine"
}

Get Candy Machine V3 Details

Get details of a V3 candy machine along with all the guards.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • address: Candy machine V3 address

GET /sol/v1/candy_machine/details

var myHeaders = new Headers();
myHeaders.append("x-api-key", "<your-api-key>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/candy_machine/details?network=devnet&address=J4XzzSmwTfRBF2HdB2vRY99FdMpgLf5BS51wVZJrWhjz", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
{
    "success": true,
    "message": "Candy machine details for J4XzzSmwTfRBF2HdB2vRY99FdMpgLf5BS51wVZJrWhjz",
    "result": {
        "model": "candyMachine",
        "address": "J4XzzSmwTfRBF2HdB2vRY99FdMpgLf5BS51wVZJrWhjz",
        "accountInfo": {
            "executable": false,
            "owner": "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR",
            "lamports": {
                "basisPoints": "69e1f0",
                "currency": {
                    "symbol": "SOL",
                    "decimals": 9
                }
            },
            "rentEpoch": 0
        },
        "authorityAddress": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
        "mintAuthorityAddress": "GyymUiJcokYrTSgTQ7JqjqQvaFUZ8wu86WAaHC4wWE7m",
        "collectionMintAddress": "7KnYuwbcG3EDLBnpUTovGN1WjpB1WvvyNuMgjRezG33s",
        "symbol": "TSTV",
        "sellerFeeBasisPoints": 333,
        "isMutable": true,
        "maxEditionSupply": "00",
        "creators": [
            {
                "address": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
                "verified": false,
                "percentageShare": 100,
                "share": 100
            }
        ],
        "itemsAvailable": "01",
        "itemsMinted": "01",
        "itemsRemaining": "00",
        "itemsLoaded": 1,
        "isFullyLoaded": true,
        "itemSettings": {
            "prefixName": "TST Verison #$ID+1$",
            "nameLength": 1,
            "prefixUri": "https: //some.uri/abc/path",
            "uriLength": 1,
            "isSequential": false,
            "type": "configLines"
        },
        "featureFlags": [
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false,
            false
        ],
        "candyGuard": {
            "model": "candyGuard",
            "address": "GyymUiJcokYrTSgTQ7JqjqQvaFUZ8wu86WAaHC4wWE7m",
            "accountInfo": {
                "executable": false,
                "owner": "Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g",
                "lamports": {
                    "basisPoints": "1ade70",
                    "currency": {
                        "symbol": "SOL",
                        "decimals": 9
                    }
                },
                "rentEpoch": 0
            },
            "baseAddress": "J4XzzSmwTfRBF2HdB2vRY99FdMpgLf5BS51wVZJrWhjz",
            "authorityAddress": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
            "guards": {
                "botTax": null,
                "solPayment": {
                    "lamports": "17d78400",
                    "destination": "7iviPE2HZ15QCvHHCm8QzYdXKt9qReeT5P4aqSRAp7oY",
                    "amount": {
                        "basisPoints": "17d78400",
                        "currency": {
                            "symbol": "SOL",
                            "decimals": 9
                        }
                    }
                },
                "tokenPayment": null,
                "startDate": null,
                "thirdPartySigner": null,
                "tokenGate": null,
                "gatekeeper": null,
                "endDate": null,
                "allowList": null,
                "mintLimit": null,
                "nftPayment": null,
                "redeemedAmount": null,
                "addressGate": null,
                "nftGate": null,
                "nftBurn": null,
                "tokenBurn": null,
                "freezeSolPayment": null,
                "freezeTokenPayment": null,
                "programGate": null
            },
            "groups": []
        }
    }
}

Last updated 1 year ago

Was this helpful?

For more details on groups and guards

To see how to sign encoded_transaction see the .

https://docs.metaplex.com/programs/candy-machine/available-guards
https://docs.metaplex.com/programs/candy-machine/minting#introduction
guide