NFT functions
Change methods
NFT transfer
pub fn nft_transfer(
&mut self,
receiver_id: ValidAccountId,
token_id: TokenId,
approval_id: Option<u64>,
memo: Option<String>,
)
$ near call --accountId gnaor.testnet paras-token-v2.testnet nft_transfer '{"token_id":"3:2","receiver_id":"projectp.testnet"}' --depositYocto 1
Scheduling a call: paras-token-v2.testnet.nft_transfer({"token_id":"3:2","receiver_id":"projectp.testnet"}) with attached 0.000000000000000000000001 NEAR
Doing account.functionCall()
Receipt: C4VX4zUEZQhwFMzgAiuFU4iEhgzB8adbqVe3Sc3yA4F1
Log [paras-token-v2.testnet]: Transfer 3:2 from gnaor.testnet to projectp.testnet
Log [paras-token-v2.testnet]: {"type":"nft_transfer","params":{"token_id":"3:2","sender_id":"gnaor.testnet","receiver_id":"projectp.testnet"}}
Transaction Id 4Pe7ymVjFKXAft9fLScvCWxXtz2AptwTejXSJR31H6fU
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/4Pe7ymVjFKXAft9fLScvCWxXtz2AptwTejXSJR31H6fU
''
NFT burn
pub fn nft_burn(
&mut self,
token_id: TokenId
)
$ near call --accountId projectp.testnet paras-token-v2.testnet nft_burn '{"token_id":"3:2"}' --depositYocto 1
Scheduling a call: paras-token-v2.testnet.nft_burn({"token_id":"3:2"}) with attached 0.000000000000000000000001 NEAR
Doing account.functionCall()
Receipt: 3im6sEQ2fjUgid46w86HFEmUsFmAeX8HJn5j6B18K3mc
Log [paras-token-v2.testnet]: {"type":"nft_transfer","params":{"token_id":"3:2","sender_id":"projectp.testnet","receiver_id":""}}
Transaction Id 7ZXfiiYoSmhstdUh29rrTU2WLso1SLq3UUVPcEPwzktf
To see the transaction in the transaction explorer, please open this url in your browser
https://explorer.testnet.near.org/transactions/7ZXfiiYoSmhstdUh29rrTU2WLso1SLq3UUVPcEPwzktf
''
View methods
NFT information
pub fn nft_token(
&self,
token_id: TokenId
) -> Option<Token>
$ near view paras-token-v2.testnet nft_token '{"token_id":"3:1"}'
View call: paras-token-v2.testnet.nft_token({"token_id":"3:1"})
{
token_id: '3:1',
owner_id: 'projectp.testnet',
metadata: {
title: 'Dark #1',
description: null,
media: 'bafybeifdbvb6yzajogbe4dbn3bgxoli3sp7ol7upfmu2givpvbwufydthu',
media_hash: null,
copies: 90,
issued_at: '1637976923487702140',
expires_at: null,
starts_at: null,
updated_at: null,
extra: null,
reference: 'bafybeifvzitvju4ftwnkf7w7yakz7i5colcey223uk2ui4t5z3ss7l2od4',
reference_hash: null
},
approved_account_ids: {}
}
Last updated