> For the complete documentation index, see [llms.txt](https://pluri.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pluri.gitbook.io/untitled/pluri-methods/transferwithdata.md).

# TransferWithData

{% hint style="info" %}
**IMPORTANT:** All data transfer methods have a <mark style="color:yellow;">**100000000000n**</mark> (0.0000001) Pluri tax to prevent Zero-Value Token Transfer Phishing Attacks. This tax is distributed back to the faucet and stakeholders. This tax is automatically transferred at the contract level.
{% endhint %}

\
**Method**: PluriContract.transferWithData(<mark style="color:red;">type 1</mark>, <mark style="color:purple;">type 2</mark>, <mark style="color:green;">type 3</mark>)

**Types**

1. String - Address of recipient to send Pluri to. Can be a wallet address or a smart contract address. <mark style="color:red;">Example:</mark> "0X959FD7Ef9089B7142B6B908Dc3A8af7Aa8ff0FA1"
2. BigInt - The amount of Pluri to send. \ <mark style="color:purple;">Example:</mark> 4n
3. Hex string - Convert the desired data to send as metadata from utf8 to bytes, then convert the bytes to a hex string. \ <mark style="color:green;">Example:</mark> "0X7b2248656c6c6f223a22576f726c64227d" originates from hexlify(toUtf8Bytes(JSON.stringify({"Hello","World"}))&#x20;

<pre class="language-javascript"><code class="lang-javascript">let targetAddress = '0x959FD7Ef9089B7142B6B908Dc3A8af7Aa8ff0FA1'
let senderAddress = '0x4E90a36B45879F5baE71B57Ad525e817aFA54890'
let data = {"Hello","World"}
let amount = 1n

//Web3.js 4.8 Example
<strong>let metadata = web3.utils.utf8ToHex(data);
</strong>
// Check user whom inititated the transaction has enough to pay the Pluri tax + chosen application fee
const balance = await PluriContract.methods.balanceOf(senderAddress).call();
if(balance >= (100000000000n + amount)){
    PluriContract.methods.transferWithData(targetAddress, amount, metadata).send({ from: senderAddress })
}

//Ethers.js 6.12.1 Example
let metadata = hexlify(toUtf8Bytes(JSON.stringify({"Hello","World"}))

// Check if the user has enought to pay the Pluri tax + chosen application fee
const balance = await PluriContract.balanceOf(senderAddress)
if(balance >= (100000000000n + amount)){
   PluriContract.transferWithData(targetAddress, amount, metadata)
}

</code></pre>
