如何将 NFT 发送或转移到 NEAR 协议上的另一个帐户?

How do you send or transfer an NFT to another account on NEAR protocol?

目标是从我控制的帐户向另一个用户的帐户发送 NFT。 NFT 遵循标准,但现在钱包的 UI 似乎不支持此功能,因此我们必须执行 shell 命令才能实现转账。这是怎么做到的?

如果合同遵守 NEP-171 standard, then you can use the near-cli and call nft_transfer. You also need to use the mainnet, and login to the wallet. Caller of the method must attach a deposit of 1 yoctoNear for security purposes (see requirements for more details)

export NEAR_ENV=mainnet
near login
near call contractName nft_transfer '{"receiver_id": "someNearAccount", "token_id": "someTokenId"}' --accountId yourAccountId --depositYocto 1

现在,如果调用returns没有任何错误,NFT应该已经转移了。在终端中,你还会得到一个 link 到浏览器以查看交易。 也可以调用另一个方法nft_token,查看更新后的信息:

near view contractName nft_token '{"tokenId": "someTokenId"}'

您会看到 owner_id 已更改。