description |
---|
Standard NFT API. |
mint NFT by metadata
Parameters:
<object>
- a JSON object containing:owner: <string>
- the account to mint NFTmetadata: <object>
- the metadata of the NFT. Follow The Non-Fungible StandardupdateAuthority: <string>
- (optional, default owner) An account with metadata update authority
Results:
<object>
- a JSON object containing:mint: <string>
- the mint address of the NFTmintAssociatedTokenAccount: <string>
- The token account associated with the ownertransaction: <object>
- the transaction struct is to be signed with the owner
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_mint',
params: [
{
owner: '8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ',
metadata: {
name: 'Test: e17Ij',
symbol: 'TEST',
description: 'Test description',
seller_fee_basis_points: 100,
image: 'https://gateway.pinata.cloud/ipfs/QmY21xP5qjz866TBovLH2Px5fLEyfU1uBg69BfDpdQu4KJ',
animation_url: '',
external_url: '',
attributes: [
{
trait_type: 'Type',
value: 'Skeleton',
},
],
properties: {
creators: [
{
address: '8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ',
share: 50,
},
{
address: '7quN8ZdQYkXyWzSpytv9xK5ngzq32UapNbFSz91tpmvA',
share: 30,
},
{
address: 'Bx5GU8y6oYtTE3ESL469YTjuto8zxPn2xTTvo6BBdt1V',
share: 20,
},
],
},
},
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"mint": "29nPkoZPcSCnGhfKKvcPB29joUa7iRfcUSyWk3qoZB37",
"mintAssociatedTokenAccount": "87sjCifEip3hNPhLJQ3rNayWvP5zgjL6bjGnsgPpN2iR",
"transaction": {
"isPartialSigned": true,
"serialized": "3upXthSvHwVVCdrM9euWVNhZ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HEraayxpf8WVJG5H4Eg2vzFLzKL8BomNoUVbYFHG8ELXK1mJbC3WEeafxYUb8Qc8b9wic3AjkwPCHbL7hqgm3qsKs8Ej8DPkqi3U426bM5jJVGXZyTD2Gksy",
"signers": [
"7NtyMZAYfmJzFVAXRrHptm7AXJwBmFErQGRphQWtU3vsKU9eipyyWfAiLfK6gbhMBcbDTsNYTgd4moUf2hoCYGh"
]
}
},
"chainId": 103
}
mint NFT by metadata uri
Parameters:
<object>
- a JSON object containing:owner: <string>
- the account to mint NFT.metadataUri: <object>
- the uri associated with metadata.updateAuthority: <string>
- (optional, default owner) An account with metadata update authority.
Results:
<object>
- a JSON object containing:mint: <string>
- the mint address of the NFT.mintAssociatedTokenAccount: <string>
- The token account associated with the owner.transaction: <object>
- the transaction struct is to be signed with the owner.
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_mintByUrl',
params: [
{
owner: '8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ',
metadataUri: 'https://bafybeichqewhbuj6zbbil2adnvdj4wvk62n2czgmqidpjxp7lxyuoh374a.ipfs.nftstorage.link',
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"mint": "9nqTYkboxC8X6LT5pxKDApZXFSHiHsJVfHLeBdbasqF9",
"mintAssociatedTokenAccount": "F1TpWa88c3G9goyCPeiPQkUjCKa7pBtRqYwJYWwqx3GP",
"transaction": {
"isPartialSigned": true,
"serialized": "3upXthSvHwVVCdrM9euWVNhZRZUekYgt1BxoHaEGWRwyZkVk5Ro3BbVNEJjDMMCthVYZc2YCFeScwL3cAHtftWw7iiiAAuHyeRxYuRJonRx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6zhCr22nrizr1ip7FLqB6o5EvqtR1N38kf",
"signers": [
"2eH4ZEBTaNwU3NVZEiv1rQTTurUf6fwFF7t4mCndVTBzRVopyK44PD3tgX57ucD3sUFKRpqLBnd8QUNXjsbyQnbu"
]
}
},
"chainId": 103
}
get NFT info
Parameters:
<object>
- a JSON object containing:mint: <string>
- the mint address of the NFT.parseMetadataUri: <boolean>
- (optional, default false) If true, the API will parse the metadata's uri that can get the image url and other info.
Results:
<object>
- a JSON object about metadata
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_info',
params: [
{
mint: '2aqWDYDeZaMdqkYQcd79tXiWrpSAzwj2J8Uf4GqoB7dg',
parseMetadataUri: true,
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"key": 4,
"updateAuthority": "8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ",
"mint": "2aqWDYDeZaMdqkYQcd79tXiWrpSAzwj2J8Uf4GqoB7dg",
"data": {
"name": "Test: ZlNae",
"symbol": "TEST",
"uri": "https://gateway.pinata.cloud/ipfs/Qmd8U94CJjaihLYo2TrDfgcLRJAbGEBfD1gYWfSSXWjb9J",
"sellerFeeBasisPoints": 100,
"creators": [
{
"address": "8FE27ioQh3T7o22QsYVT5Re8NnHFqmFNbdqwiF3ywuZQ",
"verified": true,
"share": 50
},
{
"address": "Bx5GU8y6oYtTE3ESL469YTjuto8zxPn2xTTvo6BBdt1V",
"verified": false,
"share": 50
}
],
"uriData": null
},
"primarySaleHappened": true,
"isMutable": true,
"editionNonce": 255,
"tokenStandard": 0
},
"chainId": 103
}
update the data of NFT metadata
Parameters:
<object>
- a JSON object containing:mint: <string>
- the mint address of the NFT.metadata: <object>
- fields from the data of NFT metadata.name: <string>
symbol: <string>
uri: <string>
sellerFeeBasisPoints: <int>
newUpdateAuthority: <string>
primarySaleHappened: <boolean>
isMutable: <string>
Results:
<object>
- a JSON object containing:transaction: <object>
- the transaction struct is to be signed with the NFT owner.
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_update',
params: [
{
mint: 'EkGWiw9zrqbGj8iFueGBnDE7g3yQZCKuDneHSvLmR6wY',
metadata: {
name: 'Test NFT name',
},
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"transaction": {
"isPartialSigned": false,
"serialized": "6fPvCMgpMTwLsAX7W2WEz9hwXV32Cnk3LbfBFZLEsDA2jZgC9QxiSHWfoXXMfUYXqZHBGhtu4YvPuhfXVtZoBwKdT37C7f6D9dv4wEmSdRjHiHAt8Cr2sZZAoiGvqJkVzEqSjnNh5rTXQG7Z43oDPtskheZo2hVWiqirgJpogbQ36Sko5J53dNtagR4fUJTnNDgq3m6yRqCT5Vq9wN8r131Yz9C9GtKKkpk2EBBPDEuqdxFcwcN1QRs8gNhmkm4McKaXkmVp6s9oS9Gphu2j441Dv2rcnt9VbZrjv9GBgEkMSZLKueMCxH1FvpBKLBGLfwPyJHxsC3YzdWxjiyTe9uykRuE3Y8ku59j95VSXVDbsUm23J4jsmak6LnN8x7o4WBL2S3NYdEuxKaSSfU6y48NgAYrCCTCvYXYrPT832Yyg7pcub48L4TL9Dj4DVp9Sh9r85zvqKGmuV7NtQ68VAzHhKuxzvHktKRC8AESYjapgYv1JPd8jFEQn5J29XAb3zaPqddBE8Ere5aKC8MAWo8KwVygGgieSvnQpXQRbWLGeqNKDXJiCAmfW1GXgyGEYGr8WieRPNdCX2GieMoAo",
"signers": []
}
},
"chainId": 103
}
Set a creator is verified for the NFT
{% hint style="info" %} It is important to check this field to ensure the authenticity of the creator.
Without certification, creators can't share royalties. {% endhint %}
Parameters:
<object>
- a JSON object containing:creator: <string>
- the creator account from the NFT metadatamint: <string>
- the mint address of the NFTverified: <boolean>
- (optional, default true) verified or not
Results:
<object>
- a JSON object containing:transaction: <object>
- the transaction struct is to be signed with the creator
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_setCreatorVerified',
params: [
{
creator: 'Bx5GU8y6oYtTE3ESL469YTjuto8zxPn2xTTvo6BBdt1V',
mint: '7LvE3zUYSmowFGEW6pxCUjwtnMgaGqGpxB1XXvVfn7wq',
verified: false,
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"transaction": {
"isPartialSigned": false,
"serialized": "3XkfoeU1FeyQ6spTnBHnipD3eiPgcqvBecXPST439B43gtvxJA6UuTp4YEWtDhSNcgt1b5CkjuWkKn47F5rNcuKT7uZ3cfxmMBtg2P5XfTqftSYub94K5AJQmzLnoNSn2bPYvrgxFLiDZRaKLQHDm4d7PD3bQCK1JqQ1745vJxP6M3sPKfimXm98ZJzaNn61fPQ5SopNQjG6CwkVthnn1EYNqezJBtv2ADpBZdcK9rLjN27p1ufpjsrbrGesqggEYmU6qHLavHe9WFNtH3gjSK",
"signers": []
}
},
"chainId": 103
}
check whether the creator is verified or not for the NFT
Parameters:
<object>
- a JSON object containing:creator: <string>
- the creator account from the NFT metadatamint: <string>
- the mint address of the NFT
Results:
<boolean>
- is verified or not for the NFT
Request Example
{% tabs %} {% tab title="Node.js" %}
const axios = require('axios');
// chainId: 101 => mainnet; 102 => testnet; 103 => devnet;
const RPC_URL = 'https://rpc.particle.network/solana?chainId=103';
const auth = {
username: 'Your Project Id',
password: 'Your Project Server Key',
};
(async () => {
const response = await axios.post(
RPC_URL,
{
method: 'NFT_isCreatorVerified',
params: [
{
creator: 'Bx5GU8y6oYtTE3ESL469YTjuto8zxPn2xTTvo6BBdt1V',
mint: '7LvE3zUYSmowFGEW6pxCUjwtnMgaGqGpxB1XXvVfn7wq',
},
],
},
{ auth },
);
console.log(response.data);
})();
{% endtab %} {% endtabs %}
Response Example
{
"jsonrpc": "2.0",
"id": 0,
"result": false,
"chainId": 103
}