# SendNFT

## Description

Send an NFT to the destination address.

## Declaration

```csharp
public static void SendNFT(string destinationAddress, string collectionIdentifier, ulong nftNonce, int quantity, UnityAction<CompleteCallback<string[]>> completeMethod)
```

## Parameters

<table><thead><tr><th width="234">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>destinationAddress</strong></td><td>The address to send the NFT to.</td></tr><tr><td><strong>collectionIdentifier</strong></td><td>The collection ID.</td></tr><tr><td><strong>nftNonce</strong></td><td>Nonce of the NFT in decimal format.</td></tr><tr><td><strong>quantity</strong></td><td>Number of units to send.</td></tr><tr><td><strong>completeMethod</strong></td><td>Callback to track the status of the transaction. At complete, the message will be the transaction hash.</td></tr></tbody></table>

Check the following image for a better understanding of how to get the parameters:

<figure><img src="https://3669395863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQYzBYzh6QMdCejkB7kRc%2Fuploads%2Fl70dXiTH2rmxZLDFeZkD%2FParameters.jpg?alt=media&#x26;token=72681785-703d-41a2-8249-e0618b5cdbea" alt=""><figcaption></figcaption></figure>

The nonce parameter shown is in hex format, and it is needed in the decimal format, so use an external converter like this to get it:\
[Hex to Decimal Converter](https://www.rapidtables.com/convert/number/hex-to-decimal.html)\
19 in decimal = 25

## Example

```csharp
public class Test : MonoBehaviour
{
    private string destinationAddress = "erd1jza9qqw0l24svfmm2u8wj24gdf84hksd5xrctk0s0a36leyqptgs5whlhf";

    public void SendNFT()
    {
        //send transaction
        MultiversX.UnityTools.API.SendNFT(destinationAddress, "CLOTHES-35c061", 25, 1, CompleteMethod);
    }

    private void CompleteMethod(CompleteCallback<string[]> result)
    {
        switch (result.status)
        {
            case OperationStatus.InProgress:
                Debug.Log($"Waiting for xPortal signature");
                break;
            case OperationStatus.Error:
                Debug.LogError($"{result.errorMessage}");
                break;
            case OperationStatus.Success:
                //result.data contains the hash of the transaction
                //at this point transaction is broadcasted to the blockchain to be processed
                //use this method to check if it was processed succesfully or not
                MultiversX.UnityTools.API.CheckTransactionStatus(result.data, TransactionProcessed, 1);
                break;
        }
    }

    private void TransactionProcessed(CompleteCallback<Transaction[]> result)
    {
        switch (result.status)
        {
            case OperationStatus.InProgress:
                foreach (Transaction transaction in result.data)
                {
                    Debug.Log($"Tx: {transaction.TxHash} : {transaction.Status}");
                }
                break;
            case OperationStatus.Success:
                Debug.Log("Success");
                break;

            case OperationStatus.Error:
                Debug.LogError($"{result.status} {result.errorMessage}");
                foreach (Transaction transaction in result.data)
                {
                    //the GetLogs() will return additional info about why the transaction failed.
                    Debug.Log($"Tx: {transaction.TxHash} : {transaction.Status} {transaction.GetLogs()}");
                }
                break;
        }
    }
}
```
