Send NFT
Sending an NFT allows you to transfer ownership of the unique digital asset to another user. By sending an NFT you grant the new owner full control and possession of the token, including its associated collectible or token value and any other attributes it defines.
Example Code
- Rust
- Typescript (Node.js)
- Python
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Set
nft_id
as the first NFT Id in the balance.
- Define the outputs for the transaction as the
SendNftParams
.
- Send the NFT transaction using the
Account.send_nft()
function.
The following example will:
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Set
nftId
as the first NFT Id in the balance.
- Define the outputs for the transaction as the
SendNftParams
.
- Create the transaction that will send the NFT using the
Account.sendNft()
function.
The following example will:
- Instantiate a
Wallet
, get Alice'sAccount
which was created in the first guide and sync it. - Create the
SendNFTParams
settingnft_id
as the first NFT Id in the balance.
- Prepare the transaction that will mint the NFT using the
Account.prepare_send_nft()
function and send the prepared transaction using theAccount.send()
function.
Full Example Code
- Rust
- Typescript (Node.js)
- Python
sdk/examples/how_tos/nfts/send_nft.rs
loading...
bindings/nodejs/examples/how_tos/nfts/send_nft.ts
loading...
bindings/python/examples/how_tos/nfts/send_nft.py
loading...
Expected Output
Transaction sent: 0x58716bf9c7d3b36276a3ce9b57b43693c03bd6816198a7fe8ee1b814c424dae6
Block included: https://explorer.shimmer.network/testnet/block/0xd7ccfb7922a719dcee7e4bf15eaf3a6983c378b7a4c16adf34a3eb001cfc5773