multiversx / mx-sdk-js-core

MultiversX SDK for interacting with the MultiversX blockchain (in general) and Smart Contracts (in particular).
https://multiversx.github.io/mx-sdk-js-core/
Other
58 stars 37 forks source link

Send NFT Functionality Not Working in MultiversX SDK-Core #379

Closed karthik-durai closed 6 months ago

karthik-durai commented 6 months ago

Upon implementing the send NFT functionality using MultiversX SDK-Core, it's observed that the sender and destination addresses in the transaction call are identical, leading to unsuccessful transfers.

Steps to Reproduce:

  1. create tokenTransfer object using nonFungible function from TokenTransfer with token identifier and nonce.
  2. create transaction object using createESDTNFTTransfer by passing a. tokenTransfer b. nonce c. sender address d. destination address e. chain id
  3. sign the transaction by passing transaction object.
  4. broadcast transaction.
  5. Inspect the transaction call parameters in the network tab of the browser and also transaction explorer of multiversx.
  6. Notice that sender and destination addresses are the same.
andreibancioiu commented 6 months ago

Hello @karthik-durai,

On MultiversX, for NFT transfers, transaction.sender == transaction.receiver, while the actual destination address is encoded in the transaction payload.

Therefore, point (6) is expected.

E.g.

NFT transfer transaction = {
    Sender: <account address of the sender>
    Receiver: <same as sender>
    Data: "ESDTNFTTransfer ... ... (actual destination is encoded here) ... ..."
    ...
}

Additional resources:

karthik-durai commented 6 months ago

thanks @andreibancioiu , close this issue.