NFT

Make magic happen with your NFT superpowers

Create

Create a master edition NFT.

POST /sol/v1/nft/create_detach

Creating an NFT is just 1 simple API call, which internally does all the heavy lifting for you.

  • Uploads the image or anything you want to your choice of storage (IPFS or S3).

  • Creates an appropriate Metadata json file.

  • Uploads the metadata json file again to your choice of storage (IPFS or S3).

  • Finally mints your favorite NFT.

Body Params

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

  • wallet: Your wallet address who will be signing and paying the transaction fee

  • name: NFT Name

  • symbol: NFT Symbol

  • description: (optional) NFT description

  • attributes: (optional) attributes associated to this NFT. (You can create the attributes as an array of objects and then stringify it using JSON.stringify)

  • external_url: (optional) any url to associate with the NFT

  • max_supply: (optional) Maximum number of clones/edition mints possible for this NFT. Default 0 for one-of-a-kind NFT.

  • royalty: (optional) represents how much percentage of secondary sales the original creator gets. Ranges from (0-100), 0 being the original creator gets nothing and 100 being the original creator gets the entire amount from the secondary sales

  • file: NFT Image

  • data: (Optional) Any digital data (.mp3/.wav/.mp4/.pdf/.json etc) that you want to put in the NFT

  • receiver: (optional) Account address which will receive the newly created NFT.

  • service_charge : (optional) - Transaction fee to be paid by the NFT creator for creating an NFT. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.

    • receiver: string - An address that will receive the service charge amount.

    • amount: number - The amount of currency to be charged.

    • token (optional): string - The address of the SPL token, the service charge currency. By default SOL is charged.

Charging Service charge in USDC:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe", 
    "token": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", 
    "amount": 0.01
}

Charging Service charge in SOL:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe",
    "amount": 0.01
}

Response

You will get an encoded transaction in response which you can sign in your front end or back end using the same wallet used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

var myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");
myHeaders.append("Content-Type", "multipart/form-data");

var formdata = new FormData();
formdata.append("network", "devnet");
formdata.append("wallet", "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc");
formdata.append("name", "SHYFT NFT");
formdata.append("symbol", "SH");
formdata.append("description", "Shyft makes Web3 so easy!");
formdata.append("attributes", '[{"trait_type":"dev power","value":"over 900"}]');
formdata.append("external_url", "https://shyft.to");
formdata.append("max_supply", "0");
formdata.append("royalty", "5");
formdata.append("file", fileInput.files[0], "index.png");
formdata.append("nft_receiver", "5KW2twHzRsAaiLeEx4zYNV35CV2hRrZGw7NYbwMfL4a2");
formdata.append('service_charge', '{ "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe",  "token": "DjMA5cCK95X333t7SgkpsG5vC9wMk7u9JV4w8qipvFE8",  "amount": 0.01}');

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

fetch("https://api.shyft.to/sol/v1/nft/create_detach", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Ta-da 🎉, a transaction has been created for you to sign and send to the blockchain after which your NFT will be created. The metadata is stored in an immutable form in decentralized storage (IPFS).

Create V2

This API call allows an external wallet to pay the gas fee for creating NFT on behalf of the NFT creator. Moreover, this API is capable of performing everything that the V1 Create NFT API does.

This API is an improved version of the original Create NFT API. This API request allows an external wallet to pay the gas fee for creating NFT on behalf of the NFT creator.

NOTE: If your product is creating an end-user-facing platform for creating NFTs, then this API will be your best friend for onboarding users initially where, you can pay the gas fees for the NFTs that your users will create.

POST /sol/v2/nft/create

Creating an NFT, and is just 1 simple API call, which internally does all the heavy lifting for you.

  • Uploads the image or anything you want to your choice of storage (IPFS or S3).

  • Creates an appropriate Metadata json file.

  • Uploads the metadata json file again to your choice of storage (IPFS or S3).

  • If mentioned also pays the gas fee for the transaction from the mentioned account.

  • Finally mints your favorite NFT.

Body Params

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

  • creator_wallet: Your NFT creator's wallet address. By default, this address pays the transaction gas fee.

  • name: NFT Name

  • symbol: NFT Symbol

  • description: (optional) NFT description

  • collection_address: (optional) on-chain address of the collection represented by an NFT, with max_supply of 0.

  • attributes: (optional) attributes associated to this NFT. (You can create the attributes as an array of objects and then stringify it using JSON.stringify)

  • external_url: (optional) any url to associate with the NFT

  • max_supply: (optional) Maximum number of clones/edition mints possible for this NFT. Default 0 for one-of-a-kind NFT.

  • royalty: (optional) represents how much percentage of secondary sales the original creator gets. Ranges from (0-100), 0 being the original creator gets nothing and 100 being the original creator gets the entire amount from the secondary sales

  • image: NFT Image

  • data: (Optional) Any digital data (.mp3/.wav/.mp4/.pdf/.json etc) that you want to put in the NFT

  • receiver: (optional) Account address which will receive the newly created NFT.

  • fee_payer: (optonal) If mentioned this is the account that will be used for paying the transaction gas fee.

  • service_charge : (optional) - Transaction fee to be paid by the NFT creator for creating an NFT. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.

    • receiver: string - An address that will receive the service charge amount.

    • amount: number - The amount of currency to be charged.

    • token(optional): string - The address of the SPL token, the service charge currency. By default SOL is charged.

  • priority_fee: (optional) Prioritization fee of transaction in micro Lamports. A micro Lamport is 0.000001 Lamports.

Charging Service charge in USDC:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe", 
    "token": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", 
    "amount": 0.01
}

Charging Service charge in SOL:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe",
    "amount": 0.01
}

Response

You will get an encoded transaction in response which you can sign in your front end or back end. 2 wallet address are needed to sign this txn:

  1. creator_wallet

  2. fee_payer, only if specified in the API request.

  3. collection_address's collection_authority address, which is the update Authority of the collection NFT. Needed when, the txn was created with collection_address.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

var myHeaders = new Headers();
myHeaders.append("x-api-key", "20CcwuFeQOIcfuHx");

var formdata = new FormData();
formdata.append("network", "devnet");
formdata.append("creator_wallet", "8hDQqsj9o2LwMk2FPBs7Rz5jPuzqKpRvkeeo6hMJm5Cv");
formdata.append("name", "papaya");
formdata.append("symbol", "P2");
formdata.append("description", "papita");
formdata.append("attributes", '[{"trait_type":"dev power","value":"over 900"}]');
formdata.append("external_url", "https://shyft.to");
formdata.append("max_supply", "1");
formdata.append("royalty", "5");
formdata.append("image", fileInput.files[0], "papaya.jpeg");
formdata.append("fee_payer", "AaYFExyZuMHbJHzjimKyQBAH1yfA9sKTxSzBc6Nr5X4s");

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

fetch("https://api.shyft.to/sol/v2/nft/create", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Ta-da 🎉, a transaction has been created for you to sign and send to the blockchain after which your user would have created an NFT without having any SOL in his/her account.

Create NFT from Metadata

This API allows you to create an NFT from an already uploaded metadata URI. The metadata_uri should open a JSON document complying with Metaplex Non-Fungible Token Standard. If the JSON doesn't follow the Metaplex standard then the API returns an error. The on-chain metadata of the NFT is fetched from the off-chain metadata present at the given URI.

POST /sol/v1/nft/create_from_metadata

Body Params

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

  • metadata_uri: URI that contains metadata of the NFT (metaplex non-fungible-standard) in JSON file format.

  • max_supply: (optional) Maximum number of clones/edition mints possible for this NFT. Default 0 for one-of-a-kind NFT.

  • collection_address: (optional) on-chain address of the collection represented by an NFT, with max_supply of 0.

  • receiver: (optional) Account address which will receive the newly created NFT.

  • fee_payer: (optional) If mentioned this is the account that will be used for paying the transaction gas fee.

  • service_charge : (optional) - Transaction fee to be paid by the NFT creator for creating an NFT. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.

    • receiver: string - An address that will receive the service charge amount.

    • amount: number - The amount of currency to be charged.

    • token(optional): string - The address of the SPL token, the service charge currency. By default, SOL is charged.

  • priority_fee: (optional) Prioritization fee of transaction in micro Lamports. A micro Lamport is 0.000001 Lamports.

This API followed some rules and has some limitations:

Rules:

  • Inside metadata JSON the properties key should have a creators array. The 0th index of the creator address is the verified creator and if the array holds more than one creator inside it then others also are added in the on-chain metadata creators array with { verified: false }.

  • 0th index creator is also considered the update_authority of the NFT.

Limitation:

Solana transaction size is limited to 1232 bytes. This might result into Transaction too large error if creators are present in the JSON and collection_address is mentioned in the API request. Below are some limitations of the API:

  • If the API request has service_charge, collection_address then metadata at the URI should have at max 2 creators.

  • If the API request has service_charge, and no collection_address, then metadata at URI can have up to 8 creators.

  • If the API request has collection_address and no service_charge then the metadata URI can have up to 5 creators.

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

var raw = JSON.stringify({
  "network": "devnet",
  "metadata_uri": "https://brown-loyal-stoat-734.mypinata.cloud/ipfs/QmR5Tyx3MvpiCKtjTVC4wVzRigpujCv9bnvQKU4ZMQzN5N",
  "max_supply": 0,
  "collection_address": "3F3G122hfRQ6E7aRQLhdXvabxtfhGHF89UVLvHR4pmn9",
  "receiver": "3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf",
  "fee_payer": "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc",
  "service_charge": {
    "receiver": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R",
    "amount": 0.01
  },
  "priority_fee": 100
});

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

fetch("https://api.shyft.to/sol/v1/nft/create_from_metadata", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Read All

Returns on chain and off chain data of all NFTs in the wallet.

First call might be slightly slow, we cache automatically so that subsequent calls are lightning-fast.

Query Params

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

  • address: Your wallet address

  • update_authority: (optional) Public key of update authority. Filters only those nfts in your wallet which have this update_authority.

  • refresh:(optional) Include this if the cached NFTs for this wallet need to be refreshed.

GET /sol/v1/nft/read_all

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/nft/read_all?network=devnet&address=BvzKvn6nUUAYtKu2pH3h5SbUkUNcRPQawg4bURBiojJx", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Read Wallet Nfts

Paginated version of Read All API, returns the list of NFTs in a wallet. A maximum of 50 NFTs are returned in a single API request.

Query Params

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

  • address: Your wallet address

  • update_authority: (optional) Public key of update authority. Filters only those NFTs in your wallet that have this update_authority.

  • refresh:(optional) Include this if the cached NFTs for this wallet need to be refreshed.

  • page:(optional) Default value is 1.

  • size:(optional) Default value is 50.

GET /sol/v2/nft/read_all

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/v2/nft/read_all?network=mainnet-beta&address=Bme4LRYLq199vosFJcP2YrHSduMj27tmqdTNadYDma9A&page=1&size=32&update_authority=vfF76HkUH4pF6Uoc1WZ8BcViiQVkazcQuC6fkeLMWvi", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Read

Returns on-chain and off-chain NFT data. We also cache NFT images in our CDN for super fast reads and an amazing UX, which web3 sorely needs.

First call might be slightly slow, we cache automatically so that subsequent calls are lightning-fast.

Query Params

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

  • token_address: address of the NFT that you want to read

  • token_record: (optional) Set it true if need to get additional token_record info along with requested NFTs.

GET /sol/v1/nft/read

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/nft/read?network=mainnet-beta&token_address=Dx2XXfTUoTRsqRrBmB4dESraEeQy8Uby2XsLCtHW7GNS&refresh=true&token_record=true", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Read Selected NFTs

Returns on-chain and off-chain data of selected NFTs.

First call might be slightly slow, we cache automatically so that subsequent calls are lightning-fast.

Body Params

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

  • token_addresses: (array of strings) Selected token addresses (minimum 1 and maximum 10 NFTs could be fetched)

  • refresh:(optional) Include this if the cached NFTs need to be refreshed.

  • token_record: (optional) Set it true if need to get additional token_record info along with requested NFTs.

POST /sol/v1/nft/read_selected

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

var raw = JSON.stringify({
  "network": "mainnet-beta",
  "token_addresses": [
    "3nd5gaYmu1oVdqthPrv8SWzvBaHgWPjn2npAGwPjhuQz",
    "FW5peLvKtJhCykHqfA2E1GDGVCLsJrJYKkWPKXa8SZuL",
    "Dx2XXfTUoTRsqRrBmB4dESraEeQy8Uby2XsLCtHW7GNS"
  ],
  "refresh": false,
  "token_record": true
});

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

fetch("https://api.shyft.to/sol/v1/nft/read_selected", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get NFT Owners

Returns NFT Owners for the provided NFT mint address list.

Body Params

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

  • nft_addresses: NFT mint addresses (array of strings, maximum 10, minimum 1)

POST /sol/v1/nft/get_owners

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

var raw = JSON.stringify({
  "network": "devnet",
  "nft_addresses": [
    "B9YonmJk175GfFCDMMKWDc18YpFgmHCmj2HQNkvvjeVw",
    "BxMqbSQaccjZn2bVD13PzyP8DJ3BW3u1dEiD9WQmysGW",
    "85q1xdTVMAF8S1MEF6yuJaSnyFhDjzVg8rgyppdt6bLn"
  ]
});

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

fetch("https://api.shyft.to/sol/v1/nft/get_owners", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Burn

Burn a particular NFT.

You will get an encoded transaction in response which you can sign in your front end or back end using the same wallet as used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

Body Params

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

  • token_address: NFT mint address

  • wallet: Owner of the NFT

  • parent_token_address: (optional) Parent NFT mint address (Master Edition)

If token_address is a print edition NFT and wanted to burn and get full rebates on burn (~ 0.01022 SOL) send parent_token_address with request params. Otherwise, you would get less amount (~ 0.00204 SOL)

DEL /sol/v1/nft/burn_detach

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

var raw = JSON.stringify({
  "network": "devnet",
  "wallet": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R",
  "token_address": "2dZyhdAXP6bgwUaaoKmAPjeXZ5eHfUUGbTCDCL5QDs9r",
  "parent_token_address": "48rLtqWcGros2eJ1anmYydTecxvkyErfaeD3dmNx1dUM"
});

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

fetch("https://api.shyft.to/sol/v1/nft/burn_detach", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Burn Multiple Nfts

Burn as many NFTs from a wallet as you want. This API endpoint returns one or multiple encoded transaction strings, which have to be signed by the NFT owner's wallet and submitted to the blockchain for successful burns.

Solana lets you burn multiple NFTs in one go, efficiently bundling up to an ideal number of burns based on the blockchain's transaction size of 1232 bytes. Any extra burn requests are packed into separate transactions, following the same principle.

DEL /sol/v1/nft/burn_many

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

var raw = JSON.stringify({
  "network": "devnet",
  "wallet": "AaYFExyZuMHbJHzjimKyQBAH1yfA9sKTxSzBc6Nr5X4s",
  "nft_addresses": [
    "DVMi11ELBuJB9oGJnr2N9LhfKQNfPQ3nqMGhxnoZxAaE",
    "5r2rJ37qUGYCqqHzvjBTjMBh4Pu2VD9wSiUnsky8UzYS",
    "CafGfg1bk66dMEy8FUmRNnQokJ6Be2uGXH75JpDesVcS",
    "BouqF1CYN7L2GFrXTZ4LC3AKe4VhWi7JDy7G2fjTr79d",
    "GpLzvmQYcQM3USH7RGehoriEzmJLJ8AfKVdLFZRoVBsz",
    "53pjayfUf7NjEFXRKuLTij3r6ujm7yPinGdTYm3chojA",
    "3w5NntmXKPRYokj2QFnrcKayomAbEvGFjDJpvJygU6Jw",
    "CdaApFxgx3rFwRx7RGrSCiiCHfXj51c9KbtKxMiyAUAm",
    "B6wQuXUXkKZu5n3WEfDfdRQKNUpdwstUUErJsb1wmXB",
    "K7Abse16g3wQUJ3jQemTtFknzG7yk7TTqvgRU1Zm8Mv",
    "DcxcgowdRg2bXFP4CcgFMaeppYY7GFquNhbZ5RwTVz3L",
    "Hctkh5FUQ373zYHLt9bP4M3xwHsqgMj1qVsPeaSAsULq",
    "5V5XCyeeHyqWKgBBMsHw7tBvjkN3f8J2KqPSRXwRDoN7",
    "9TtCMxEAkuZw7tUjKZuuxZ4H8jHEQu86P4TC9CmkCYbb",
    "FKEqnUGNnjsaxN8bgJuvuZngmNPXqSxHTN4AsjSHeoTV",
    "BKS7xiPKmTYbZU6rcdaBZR7uHurMAm57JRxHRCRFxxz1",
    "7TfGPrbJrMP2WH4b1GY8MTZX1iNKNSgHrgEiVjjSomUM",
    "DvzDwcgHopqNJ5ByugjWspgNn9MHcSmjuBKnMHoQcona",
    "JAUj6qV9L19Xn4ie3gXsPooXMTeKMDuu7oC8RoT331rS",
    "5mTU6SMxDeDwwpub7HuFxaQzWfLnpGZe6vMBsTocPTEd",
    "Cv7M1ErRsh4vxSraetUfbbDiHri7dntE4GM78fcmgB4G",
    "4rvG9CHGL88Kr76ido6NHYcxxvDwAxv4WHYRwNeSo2X6",
    "GUPG872ogatdP6to4b7rpEfWGRkMbzu7EWKZSx1ney1L",
    "5L1E1vCzHWRXeNjBGqNDwsiF6tZM9gY8V3comZTsiTUo",
    "7KsBpeQB41h98VBLchNkqsgNCRY2gNRYDwwz3KLpqJTU",
    "7bRsavYDEy3sBTBYda5g5hrVz7ZFDnBF9U7JWXFQYJJU",
    "CPcoAibSFpB2CA1ZFhi1cnoYkb3Y6sERswvQiwoyFSMs",
    "7q8DqUNzrmDdvbxf3Dg75HGN1CWtYkuPSUj7x1G6jU5p",
    "6KAid91HnwZTrQyRBr5XyVrbKTfXpVMf7V3AGRPRCDow",
    "qKi7RU529xuL1JhRp2We23NmNcLEoVJQmPgmdzHNbF9"
  ],
  "close_accounts": true
});

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

fetch("https://api.shyft.to/sol/v1/nft/burn_many", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Burn Multiple NFTs V2

Burn as many NFTs from a wallet as you want. This API endpoint returns one or multiple encoded transaction strings, which have to be signed by the NFT owner's wallet and submitted to the blockchain for successful burns.

Solana lets you burn multiple NFTs in one go, efficiently bundling up to an ideal number of burns based on the blockchain's transaction size of 1232 bytes. Any extra burn requests are packed into separate transactions, following the same principle.

Body Params

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

  • wallet: Owner of the NFTs

  • nfts: (minimum 1 and maximum 50 NFTs burn in a single call) Addresses of the NFTs to transfer and parent_token_address (optional) if the selected NFT is a Print Edition NFT. E.g., Array<{ address: string; parent_token_address?: string }>

  • priority_fee: (optional) Prioritization fee of transaction in micro Lamports. A micro Lamport is 0.000001 Lamports.

If address is a print edition NFT and wanted to burn and get full rebates on burn (~ 0.01022 SOL) send parent_token_address with address. Otherwise, you would get less amount (~ 0.00204 SOL)

DEL /sol/v2/nft/burn_many

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

var raw = JSON.stringify({
  "network": "devnet",
  "wallet": "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc",
  "nfts": [
    {
      "address": "5AdD7ymtsUmbxNLTaVrHTfaA5epfbtSFyFkHQRsHQrFP"
    },
    {
      "address": "12BiLHRfcwRMYUwH6PAmRgPtSKkmBD8igytGqkKaBeha"
    },
    {
      "address": "4XFemriyzC63nKRr6ZCS7Jq8v6d2TfCYTSrHBXrKYRDm"
    },
    {
      "address": "7knDtyCSJExnBi9V1eaHRjcYV9XdhRiTYqSLNXsSkNgb"
    },
    {
      "address": "6RXZGEmQmUJUXR4jKqb9xJ4dPGbviiHfXgpYHWs81fM8",
      "parent_token_address": "48rLtqWcGros2eJ1anmYydTecxvkyErfaeD3dmNx1dUM"
    },
    {
      "address": "Gf1FtkccnjgA53whMKfm1xJyAx2MDgMgkn7A5W9ZdVmK"
    },
    {
      "address": "G4EchjyB4zXq98kVHygbwaVNnBGEfsQZC1v33SSfUNjE"
    }
  ]
});

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

fetch("https://api.shyft.to/sol/v2/nft/burn_many", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Update

Once an NFT is minted, you can update only a few parts of it, which are

  • Name

  • Symbol

  • Description

  • Royalty

  • Attributes

  • Update Authority

  • Image/File

You can also take service_charge on this API call.

Update call works like a patch call. You can selectively specify any of the above fields to update.

Note: In order to update any NFT, you should have the updateAuthority of that NFT.

You will get an encoded transaction in response which you can sign in your front end or back end using the same wallet as used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

POST /sol/v1/nft/update_detach

var myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");
myHeaders.append("Content-Type", "multipart/form-data");

var formdata = new FormData();
formdata.append("network", "devnet");
formdata.append("wallet", "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc");
formdata.append("token_address", "HJ32KZye152eCFQYrKDcoyyq77dVDpa8SXE6v8T1HkBP");
formdata.append("name", "Shyft");
formdata.append("symbol", "SH");
formdata.append("description", "Shyft makes web3 development easy");
formdata.append("attributes", "[{ \"trait_type\": \"power\", \"value\": \"100\" }]");
formdata.append("royalty", "10");
formdata.append("file", fileInput.files[0], "FZLnMeiXgAIlB-4.png");
formdata.append('service_charge', '{ "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe",  "token": "DjMA5cCK95X333t7SgkpsG5vC9wMk7u9JV4w8qipvFE8",  "amount": 0.01}');

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

fetch("https://api.shyft.to/sol/v1/nft/update_detach", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Update NFT Metadata URI

This API call allows updating NFT's on-chain metadata_uri field.

POST /sol/v1/nft/update_metadata_uri

Body Params

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

  • token_address: Address of the NFT token that needs to be updated.

  • update_authority_address: Address of update authority of NFT. This address pays the transaction gas fee.

  • metadata_uri: NFT metadata URL that contains metadata of NFT (metaplex non-fungible-standard) in JSON file format.

  • fee_payer: (optional) If mentioned this is the account that will be used for paying the update transaction gas fee. If not mentioned, update authority address pays the gas fee.

  • service_charge : (optional) - Transaction fee to be paid by the fee_payer. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.

    • receiver: string - An address that will receive the service charge amount.

    • amount: number - The amount of currency to be charged.

    • token(optionl): string - The address of the SPL token, the service charge currency, by default SOL is charged.

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

var raw = JSON.stringify({
  "network": "devnet",
  "token_address": "3DaK7VKf7kfSKPXWYTVzSThkuuoT8H5tiJP7QSfadeMJ",
  "update_authority_address": "5KW2twHzRsAaiLeEx4zYNV35CV2hRrZGw7NYbwMfL4a2",
  "metadata_uri": "https://bafkreiee5px4jug3l5wy3lg2lfc3oawni7e3bdatap23kqppoce7zbqhdq.ipfs.nftstorage.link",
  "fee_payer": "61NtTMTdvKQNL1aWicgVExrhEDFpWjjPNgiWz3CDcy8U",
  "service_charge": {
    "receiver": "6wNpsxL2JPnqehXeGdoAkJUKQk2Kyirby48PVYv3suT5",
    "token": "EhYMcBkY9umSJq8WaUGs1Dy1TcGAKvpo2TX1VNwX37rj",
    "amount": 0.1
  }
});

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

fetch("https://api.shyft.to/sol/v1/nft/update_metadata_uri", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Response

You will get an encoded transaction in response which you can sign in your front end or back end, with update_authority_address wallet.

Update V2

This API call allows an external wallet to pay the gas fee for updating NFT on behalf of the NFT update authority.

POST /sol/v2/nft/update

Body Params

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

  • token_address: Address of the NFT token that needs to be updated.

  • update_authority_address: Address of update authority of NFT. By default, this address pays the transaction gas fee.

  • name: (optional) NFT Name, if names has to be updated.

  • symbol: (optional) NFT Symbol

  • description: (optional) NFT description

  • attributes: (optional) attributes associated to this NFT. (stringify it)

  • royalty: (optional) represents how much percentage of secondary sales the original creator gets. Ranges from (0-100), 0 being the original creator gets nothing and 100 being the original creator gets the entire amount from the secondary sales

  • image: (optional) NFT Image

  • data: (Optional) Any digital data (.mp3/.wav/.mp4/.pdf/.json etc) that you want to put in the NFT

  • fee_payer: (optional) If mentioned this is the account that will be used for paying the update transaction gas fee. If not mentioned, update authority address pays the gas fee.

  • service_charge : (optional) - Transaction fee to be paid by the fee_payer. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.

    • receiver: string - An address that will receive the service charge amount.

    • amount: number - The amount of currency to be charged.

    • token(optionl): string - The address of the SPL token, the service charge currency, by default SOL is charged.

Charging Service charge in USDC:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe", 
    "token": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", 
    "amount": 0.01
}

Charging Service charge in SOL:

{
    "receiver": "499qpPLdqgvVeGvvNjsWi27QHpC8GPkPfuL5Cn2DtZJe",
    "amount": 0.01
}

Response

You will get an encoded transaction in response which you can sign in your front end or back end. 2 wallet address are needed to sign this txn:

  1. fee_payer, only if specified in the API request.

  2. update_authority_address

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

var myHeaders = new Headers();
myHeaders.append("x-api-key", "20CcwuFeQOIcfuHx");

var formdata = new FormData();
formdata.append("network", "\"devnet\"");
formdata.append("update_authority_address", "\"5KW2twHzRsAaiLeEx4zYNV35CV2hRrZGw7NYbwMfL4a2\"");
formdata.append("token_address", "\"3DaK7VKf7kfSKPXWYTVzSThkuuoT8H5tiJP7QSfadeMJ\"");
formdata.append("name", "\"LonaMO\"");
formdata.append("symbol", "\"LPL\"");
formdata.append("description", "\"My Collection\"");
formdata.append("attributes", "\"[{ \"trait_type\": \"edification\", \"value\": \"100\" }]\"");
formdata.append("royalty", "\"10\"");
formdata.append("image", fileInput.files[0], "file");
formdata.append("data", fileInput.files[0], "file");
formdata.append("service_charge", "\"{\"receiver\": \"3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf\",  \"amount\": 0.01}\"");
formdata.append("fee_payer", "\"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc\"");

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

fetch("https://api.shyft.to/sol/v2/nft/update", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Ta-da 🎉, a transaction has been created for you to sign and send to the blockchain after which your user would have updated an NFT.

Apply filtering on your NFTs based on network and their wallet address, creators, royalty, attribute values. We index all your NFTs in your databases therefore these queries are super fast.

Let's say while creating your NFT you supplied the below attribute values:

[
    {"trait_type": "speed", "value": 100},
    {"trait_type": "aggression", "value": "crazy"},
    {"trait_type": "energy", "value": "very high"}
]

Then you can apply filters using GET query parameters like:

Query Params:

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

  • wallet: (required) Your wallet address

  • creators: (optional) Public key of creators. Filters only those nfts in your wallet which have these creators.

  • royalty: (optional) Royalty of NFTs. Filter only those nfts in your wallet which have the royalty (e.g., royalty=5). More filters are there such as greater than (gt), less than (lt) and equal (gte, lte) method. You can pass query like this royalty={"gte":5}.

  • attributes: (optional) Attributes associated to this NFT. Filter only those nfts in your wallet which have these attributes (e.g., attributes{"energy":"crazy"}). Similarly, royalty attributes have those methods as well. You can search multiple attributes in one query parameter such as attributes={"edification":{"gt":"10"},"energy":"very high"}.

  • collection: (optional) NFT collection address. Filters only those nfts in your wallet which have include this collection address.

  • page: (optional) Search API is a paginated API. So you need to mention page number from you want to search. By default the page no. is 1.

  • size: (optional) You can metion maximum no. of item you need on a perticular search result. By default it is 10.

You can search this way.

var myHeaders = new Headers();
myHeaders.append("x-api-key", "20CcwuFeQOIcfuHx");

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

fetch("https://api.shyft.to/sol/v1/nft/search?wallet=5xSbS5PCkxPeZeJLHRBw57hMbCBNzSRoRaVfpQt5rxAg&network=devnet&attributes={"edification":{"gt":"10"},"energy":"very high"}&creators=5xSbS5PCkxPeZeJLHRBw57hMbCBNzSRoRaVfpQt5rxAg&creators=2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc&royalty={"lte":6}&page=1&size=10",requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Transfer

Transfer an already minted NFT from one wallet to another.

Optionally, you can transfer update authority to the new owner as well.

Body (raw)

  • from_address: Public key of the wallet to transfer from,

  • token_address: Address of the token to transfer

  • to_address: Wallet address of the receiver,

  • transfer_authority: true //(optional, true by default)

  • fee_payer: (optional) The account that pays the transaction gas fee.

You will get an encoded transaction in response which you can sign in your front end or back end using the same wallet as used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

POST /sol/v1/nft/transfer_detach

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

var raw = JSON.stringify({
  "network": "devnet",
  "token_address": "2XqF9fZAxubwNc9WBcsuknDyQFrMGrNdaNzLS44SLh2C",
  "from_address": "GE4kh5FsCDWeJfqLsKx7zC9ijkqKpCuYQxh8FYBiTJe",
  "to_address": "AaYFExyZuMHbJHzjimKyQBAH1yfA9sKTxSzBc6Nr5X4s",
  "transfer_authority": true,
  "fee_payer": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R"
});

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

fetch("https://api.shyft.to/sol/v1/nft/transfer_detach", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Transfer Multiple NFTs

Transfer multiple NFTs from one wallet to another.

Body (raw)

  • from_address: Source wallet address, holding the NFTs.

  • token_addresses: (array of strings) Addresses of the token to transfer (minimum 1 and maximum 50 NFTs transfer transactions created)

  • to_address: Wallet address of the receiver

  • priority_fee: (optional) Prioritization fee of transaction in micro Lamports. A micro Lamport is 0.000001 Lamports.

Solana lets you send multiple NFTs in one go, efficiently bundling up to an ideal number of transfers based on the blockchain's transaction size of 1232 bytes. Any extra transfers are packed into separate transactions, following the same principle.

You will get encoded transactions in response which you can sign in your front end or back end using the same wallet as used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

POST /sol/v1/nft/transfer_many

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

var raw = JSON.stringify({
  "network": "devnet",
  "token_addresses": [
    "GFxYSwRPWxDBdGex4DhrY2dStHPMn4UoocJyBAdfypsa",
    "6RXZGEmQmUJUXR4jKqb9xJ4dPGbviiHfXgpYHWs81fM8",
    "8pNjm9UmY6RhGQaLuCdtDt6uXhqXg5rFQX9t2oWq3PL1",
    "CHqQS4sZCqKvkvgsKnar5FB4aQ1Ps6mLxBfdNjRgHYqS",
    "FSwx4c1qhuwr3YpBHHCneWkvo2R9uPuHoqjfr6qgixTh",
    "AmeH6zUfie2gkFrT7ZZJcimsCCMhtk8PtTKD3Yxitvs5",
    "9eEJEUwsuHDDXPv6LZf84xAYJM8wRkQt56zDB1oig5za",
    "CxKYibvYT9H8qBw827LvGuz6BWvXSsSJSeCsbm5t27hN"
  ],
  "from_address": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R",
  "to_address": "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc"
});

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

fetch("https://api.shyft.to/sol/v1/nft/transfer_many", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Mint

Creates a clone of a master NFT and mints it into the specified wallet. Each time you mint, the current supply of master NFT increases. In order for the mint to succeed, the current supply should be less than the max supply specified for the master NFT.

You can also specify whether to give update_authority to the new receiver for the minted NFT.

How to create a Master NFT.

Body (raw)

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

  • wallet: Wallet address that has the mint authority of the NFT

  • master_nft_address: Address of the master NFT to mint

  • receiver: Wallet address of the receiver,

  • transfer_authority: true //(optional, false by default)

  • message: (optional) Add memo on transaction

  • service_charge: (optional)

  • fee_payer: (optional) If mentioned this is the account that will be used for paying the transaction gas fee.

You will get an encoded transaction in response which you can sign in your front end or back end using the same wallet as used in the API.

We have already deployed a dev tool to sign and send transactions for quick testing https://shyft-insider.vercel.app/

POST /sol/v1/nft/mint_detach

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

var raw = JSON.stringify({
  "network": "devnet",
  "wallet": "3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf",
  "master_nft_address": "4ra2ePdzTJt7oQeL4txCqpNq16PrsxnzL1DWAi4DkjWR",
  "receiver": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R",
  "transfer_authority": true,
  "message": "Thank you",
  "service_charge": {
    "receiver": "sxm1BiYrJmSYZP3qUUcSLkzoPwKMKeEKFFoZ7c9Heg7",
    "token": "HqGEZaxqpoKgDqoRaKQYEnttWi1ptnB4PhKU4PCLHxah",
    "amount": 1
  },
  "fee_payer": "5KW2twHzRsAaiLeEx4zYNV35CV2hRrZGw7NYbwMfL4a2"
});

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

fetch("https://api.shyft.to/sol/v1/nft/mint_detach", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Last updated