NFT series functions

Change methods

Mint from series (creator only)

Series' creator can mint NFT without paying the price amount (only storage fee)
1
pub fn nft_mint(
2
&mut self,
3
token_series_id: TokenSeriesId,
4
receiver_id: ValidAccountId
5
) -> TokenId
Copied!
1
$ near call --accountId projectp.testnet paras-token-v2.testnet nft_mint '{"token_series_id":"3","receiver_id":"projectp.testnet"}' --depositYocto 11280000000000000000000
2
Scheduling a call: paras-token-v2.testnet.nft_mint({"token_series_id":"3","receiver_id":"projectp.testnet"}) with attached 0.01128 NEAR
3
Doing account.functionCall()
4
Retrying request to broadcast_tx_commit as it has timed out [
5
'EAAAAHByb2plY3RwLnRlc3RuZXQAuynjmDl6NdBDCMT5dF2xYarS9Vqrz+vFVHKgECnOOlo+AAAAAAAAABYAAABwYXJhcy10b2tlbi12Mi50ZXN0bmV0IihSHMhGqAzPnSXvPiKv2wluJ1RrE9eNCX8griTVXWIBAAAAAggAAABuZnRfbWludDgAAAB7InRva2VuX3Nlcmllc19pZCI6IjMiLCJyZWNlaXZlcl9pZCI6InByb2plY3RwLnRlc3RuZXQifQDgV+tIGwAAAABApv9Lcn1jAgAAAAAAAAC1kwF0MUfraBqMwli6x5i34zaJxG4C5GjWWcWkK5vCWY2j2Mh2lH3Po8VbF58nVXRm0Gnda8LIwES6NPoS1iEJ'
6
]
7
Receipts: 6UQNmmFu4K83G378VhPzQMQjVs9rVqug5ptAqhFjhxd8, 2KZhKcLngzCKTDPnmyL8TiDYFBQGhyi9ULTJS7ap5Np3
8
Log [paras-token-v2.testnet]: {"type":"nft_transfer","params":{"token_id":"3:1","sender_id":"","receiver_id":"projectp.testnet"}}
9
Transaction Id FBvb6C94dMYD8egTts7NZBPeTwLg1ipdsvvEp9GtsWTs
10
To see the transaction in the transaction explorer, please open this url in your browser
11
https://explorer.testnet.near.org/transactions/FBvb6C94dMYD8egTts7NZBPeTwLg1ipdsvvEp9GtsWTs
12
'3:1'
Copied!

Buy from series

1
pub fn nft_buy(
2
&mut self,
3
token_series_id: TokenSeriesId,
4
receiver_id: ValidAccountId
5
) -> TokenId
Copied!
1
$ near call --accountId gnaor.testnet paras-token-v2.testnet nft_buy '{"token_series_id":"3","receiver_id":"gnaor.testnet"}' --depositYocto 1011280000000000000000000
2
Scheduling a call: paras-token-v2.testnet.nft_buy({"token_series_id":"3","receiver_id":"gnaor.testnet"}) with attached 1.01128 NEAR
3
Doing account.functionCall()
4
Retrying request to broadcast_tx_commit as it has timed out [
5
'DQAAAGduYW9yLnRlc3RuZXQA1ppnEtFtCLv528lk5cawPJOIuphC0tVOpkvnRGSqibieAQAAAAAAABYAAABwYXJhcy10b2tlbi12Mi50ZXN0bmV0stNNRelJ2szwNnkDAtMsXjGMA+6SrfyWjjA19ZWcRJ8BAAAAAgcAAABuZnRfYnV5NQAAAHsidG9rZW5fc2VyaWVzX2lkIjoiMyIsInJlY2VpdmVyX2lkIjoiZ25hb3IudGVzdG5ldCJ9AOBX60gbAAAAAEBH7RhBmSXWAAAAAAAAAHRSP51cK2+1pdbJlOz5qXVFuDP0vP6s9iqE/mzlaWfrSlfnfzMl1hzWHb+JEXoqBqWKM8vvY4KsBwqaVj3FDwE='
6
]
7
Receipts: BFQHCLGHPY9NVrnBEPRMrw4q1q2b2JDQP7AQbfenZy4R, 3LcKgvhKT3Cu47HUS7u9emqJL4SHLEcX6qhT59FGcMmX, HQsGYcxspL8TKFGnFCeqPsjR3jKQpAWS7iLxRZnNnATL, 9Uc46dQeVJrreXTdeWQojwQiwdp7668vooiQRuWdoJ8n
8
Log [paras-token-v2.testnet]: {"type":"nft_transfer","params":{"token_id":"3:2","sender_id":"","receiver_id":"gnaor.testnet","price":"1000000000000000000000000"}}
9
Transaction Id Fn1v1hz6gHH42Yi1nM92PgsdqKT5DVjmMkJB7VmujBDY
10
To see the transaction in the transaction explorer, please open this url in your browser
11
https://explorer.testnet.near.org/transactions/Fn1v1hz6gHH42Yi1nM92PgsdqKT5DVjmMkJB7VmujBDY
12
'3:2'
Copied!

Set NFT series mint price

1
pub fn nft_set_series_price(
2
&mut self,
3
token_series_id: TokenSeriesId,
4
price: Option<U128>
5
) -> Option<U128
Copied!
1
$ near call --accountId projectp.testnet paras-token-v2.testnet nft_set_series_price '{"token_series_id":"3","price":"1000000000000000000000000"}' --depositYocto 1
2
Scheduling a call: paras-token-v2.testnet.nft_set_series_price({"token_series_id":"3","price":"1000000000000000000000000"}) with attached 0.000000000000000000000001 NEAR
3
Doing account.functionCall()
4
Receipt: 4XWrSBbmePNgvSuYy8TK6ztLcC9pwUhrWeuJufPchETn
5
Log [paras-token-v2.testnet]: {"type":"nft_set_series_price","params":{"token_series_id":"3","price":"1000000000000000000000000"}}
6
Transaction Id 2t9VfRaTST6fJbkQEZwvL1A5t94fZtLhRgiwRRM9EsGD
7
To see the transaction in the transaction explorer, please open this url in your browser
8
https://explorer.testnet.near.org/transactions/2t9VfRaTST6fJbkQEZwvL1A5t94fZtLhRgiwRRM9EsGD
9
'1000000000000000000000000'
Copied!

Set NFT series as non-mintable (WARNING: this action cannot be undone)

If you want to set your series as not for sale, please use the Set NFT series mint price and set price as null. You cannot do this function while the NFT series still has mintable copies available, you have to call nft_decrease_series_supply.
1
pub fn nft_set_series_non_mintable(
2
&mut self,
3
token_series_id: TokenSeriesId
4
)
Copied!
1
near call --accountId gnaor.testnet paras-token-v2.testnet nft_set_series_non_mintable '{"token_series_id":"3"}' --depositYocto 1
Copied!

Decrease NFT series copies

1
pub fn nft_decrease_series_copies(
2
&mut self,
3
token_series_id: TokenSeriesId,
4
decrease_copies: U64
5
) -> U64
Copied!
1
$ near call --accountId projectp.testnet paras-token-v2.testnet nft_decrease_series_copies '{"token_series_id":"3","decrease_copies":"10"}' --depositYocto 1
2
Scheduling a call: paras-token-v2.testnet.nft_decrease_series_copies({"token_series_id":"3","decrease_copies":"10"}) with attached 0.000000000000000000000001 NEAR
3
Doing account.functionCall()
4
Retrying request to broadcast_tx_commit as it has timed out [
5
'EAAAAHByb2plY3RwLnRlc3RuZXQAuynjmDl6NdBDCMT5dF2xYarS9Vqrz+vFVHKgECnOOlo8AAAAAAAAABYAAABwYXJhcy10b2tlbi12Mi50ZXN0bmV0m0pmTA+VvjbSD2SWlshJgpp5qIlt8Z3tGRbK+pYP5REBAAAAAhoAAABuZnRfZGVjcmVhc2Vfc2VyaWVzX2NvcGllcy4AAAB7InRva2VuX3Nlcmllc19pZCI6IjMiLCJkZWNyZWFzZV9jb3BpZXMiOiIxMCJ9AOBX60gbAAABAAAAAAAAAAAAAAAAAAAAAJnp5b6FaMjzuhFuHko37SEtxtdNfViEQNGHaWjx62h8pNQyjKN1yR4/bDBzB/e2Kb5BD24xgF1qPHg0nhJRbAY='
6
]
7
Receipt: 4TSiB3E8cMGyavNWLKCrLNeBowG2f73uEu6WUZ1YR57v
8
Log [paras-token-v2.testnet]: {"type":"nft_decrease_series_copies","params":{"token_series_id":"3","copies":"90","is_non_mintable":false}}
9
Transaction Id GWrnR9uMsGaaVYJWT2goKD4Kd2JR6wQSxu9ZUicZd5rA
10
To see the transaction in the transaction explorer, please open this url in your browser
11
https://explorer.testnet.near.org/transactions/GWrnR9uMsGaaVYJWT2goKD4Kd2JR6wQSxu9ZUicZd5rA
12
'90'
Copied!

View methods

Getting information about NFT series

1
pub fn nft_get_series_single(
2
&self,
3
token_series_id: TokenSeriesId
4
) -> TokenSeriesJson
Copied!
1
$ NEAR_ENV=mainnet near view x.paras.near nft_get_series_single '{"token_series_id":"1"}'
2
View call: x.paras.near.nft_get_series_single({"token_series_id":"1"})
3
{
4
token_series_id: '1',
5
metadata: {
6
title: 'Key to Paras',
7
description: null,
8
media: 'bafybeigi3kbgcqj2ss65engjjs5qkxrws3rfbc3f2wlo73jukujqyqjveu',
9
media_hash: null,
10
copies: 50,
11
issued_at: null,
12
expires_at: null,
13
starts_at: null,
14
updated_at: null,
15
extra: null,
16
reference: 'bafybeifcl2kswgwm3h57da7yqtluukkyd6nnxaaedm57lmqfbqy7mg4374',
17
reference_hash: null
18
},
19
creator_id: 'paras.near',
20
royalty: {}
21
}
Copied!

Getting NFT series price

1
pub fn nft_get_series_price(
2
self,
3
token_series_id: TokenSeriesId
4
) -> Option<U128>
Copied!
1
$ near view paras-token-v2.testnet nft_get_series_price '{"token_series_id":"3"}'
2
View call: paras-token-v2.testnet.nft_get_series_price({"token_series_id":"3"})
3
'1000000000000000000000000'
Copied!

Getting NFT series minted copies

1
pub fn nft_supply_for_series(
2
&self,
3
token_series_id: TokenSeriesId
4
) -> U64
Copied!
1
$ near view paras-token-v2.testnet nft_supply_for_series '{"token_series_id":"3"}'
2
View call: paras-token-v2.testnet.nft_supply_for_series({"token_series_id":"3"})
3
'0'
Copied!