# referralConversion(\[payload,])

### Warning - May 25, 2023

This method is deprecated, and will be sunset in upcoming versions of the SDK.

{% tabs %}
{% tab title="Browser" %}
Before implementing this approach, be sure to have [whitelisted your domain](https://docs.chainvine.xyz/developers/sdk/classes-and-functions/chainvineclient/broken-reference).

```typescript
import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient({
    apiKey: '9dj022didj', //your api key
});

const wallet_address = '0x1234567890' //<-- supplied by your systems
const transaction_hash = '0x1234567890'; //optional
const token_address = '0x1234567890'; //optional
const amount = 100; // this is the amount of token you want us to convert
const usd_value = 100; //optional, the USD value of the token at the time of the conversion
const external_identifier = 'ABC123'; //optional (e.g. a user ID in your system)

const campaign = {
  id: 'aSlug123'
}

const result = await client.referralConversion({
  campaign,
  wallet_address,
  amount,
  transaction_hash,
  token_address,
  usd_value,
  external_identifier,
});
```

{% endtab %}

{% tab title="Server" %}

```typescript
import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient({
    apiKey: '9dj022didj', //your api key
});

const wallet_address = '0x1234567890' //<-- supplied by your systems
const transaction_hash = '0x1234567890'; //optional
const token_address = '0x1234567890'; //optional
const amount = 100; // this is the amount of token you want us to convert
const usd_value = 100; //optional, the USD value of the token at the time of the conversion
const external_identifier = 'ABC123'; //optional (e.g. a user ID in your system)

const campaign = {
  id: 'aSlug123'
}

const result = await client.referralConversion({
  campaign,
  wallet_address,
  amount,
  transaction_hash,
  token_address,
  usd_value,
  external_identifier,
});
```

{% endtab %}
{% endtabs %}

#### Payload

<table data-full-width="true"><thead><tr><th width="188">Param</th><th width="141">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>wallet_address</td><td>required</td><td>String</td><td>the wallet of the user being referred</td></tr><tr><td>chain_prefix</td><td>optional</td><td>String</td><td>a wallet address prefix - provide this if you are passing in a wallet address </td></tr><tr><td>amount</td><td>required</td><td>Number</td><td>an amount to pass in</td></tr><tr><td>campaign_id</td><td>required</td><td>String</td><td>the <a href="broken-reference">campaign or program id</a></td></tr><tr><td>usd_value</td><td>optional</td><td>number</td><td>The USD Value of the token(s) or value being transferred, please supply this if available</td></tr><tr><td>transaction_hash</td><td>optional</td><td>String</td><td>a transaction hash to associate with the conversion</td></tr><tr><td>token_address</td><td>optional (defaults to Ethereum if not provided)</td><td>String</td><td>the token address of the token that was transfered</td></tr><tr><td>fee</td><td>optional</td><td>String</td><td>the usd value of the fee earned from the transaction</td></tr><tr><td>external_identifier</td><td>optional</td><td>String</td><td>An external identifier associated to the <code>wallet_address</code>  in your system</td></tr></tbody></table>

#### Response

```typescript
void
```
