NFT series functions

Change methods

Mint from series (creator only)

Series' creator can mint NFT without paying the price amount (only storage fee)

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

Buy from series

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

Set NFT series mint price

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

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.

pub fn nft_set_series_non_mintable(
        &mut self, 
        token_series_id: TokenSeriesId
)
near call --accountId gnaor.testnet paras-token-v2.testnet nft_set_series_non_mintable '{"token_series_id":"3"}' --depositYocto 1

Decrease NFT series copies

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

View methods

Getting information about NFT series

pub fn nft_get_series_single(
        &self, 
        token_series_id: TokenSeriesId
) -> TokenSeriesJson
$ NEAR_ENV=mainnet near view x.paras.near nft_get_series_single '{"token_series_id":"1"}'
View call: x.paras.near.nft_get_series_single({"token_series_id":"1"})
{
  token_series_id: '1',
  metadata: {
    title: 'Key to Paras',
    description: null,
    media: 'bafybeigi3kbgcqj2ss65engjjs5qkxrws3rfbc3f2wlo73jukujqyqjveu',
    media_hash: null,
    copies: 50,
    issued_at: null,
    expires_at: null,
    starts_at: null,
    updated_at: null,
    extra: null,
    reference: 'bafybeifcl2kswgwm3h57da7yqtluukkyd6nnxaaedm57lmqfbqy7mg4374',
    reference_hash: null
  },
  creator_id: 'paras.near',
  royalty: {}
}

Getting NFT series price

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

Getting NFT series minted copies

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

Last updated