以下是在Elrond文档中传输NFT的示例:
TransferTransaction {
Sender: <account address of the sender>
Receiver: <same as sender>
Value: 0
GasLimit: 1000000 + length of Data field in bytes * 1500
Data: "ESDTNFTTransfer" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <the NFT nonce in hexadecimal encoding> +
"@" + <quantity to transfer in hexadecimal encoding> +
"@" + <destination address in hexadecimal encoding>
}来源:https://docs.elrond.com/developers/nft-tokens/#transfers
nonce在上面扮演什么角色?它是如何检索的?
发布于 2021-10-05 17:08:49
在Elrond上,单个NFT由(token id, nonce)对定义,其中token id对应于与发布类(例如,NFT-TICKER-123456)相关联的id,并且nonce对应于一个特定的NFT (具有各种属性和url数据等)。在那个股票行情下发行。
您可以使用Elrond网关API检索与帐户持有的NFT关联的随机数。例如,在Devnet上:
https://devnet-gateway.elrond.com/address/ACCOUNT_ADDRESS/esdt返回的数据将如下所示:
{
"data":{
"esdts":{
"ABA-eea2e8-01":{
"attributes":"AAAAA09rIQ==",
"balance":"1",
"creator":"erd1qqqqqqqqqqqqqpgq7t2u...",
"hash":"YSBoYXNo",
"name":"NFT",
"nonce":1,
"royalties":"0",
"tokenIdentifier":"ABA-eea2e8-01",
"uris":[
"aHR0cDo6Ly9ldGhhbmZhc3QuY29t"
]
}
}
},
"error":"",
"code":"successful"
}每个键、值对对应于ESDT的余额或特定的NFT。例如,这里的密钥"ABA-eea2e8-01"由一个NFT令牌id和用"-“连接的现时值组成,它的值包括NFT的相关属性。
https://stackoverflow.com/questions/69454497
复制相似问题