# 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](broken://pages/ydVDK8wbPPeSTZhAVgqw).

```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="/pages/662saYlawwXwhdwSI4rC">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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainvine.xyz/developers/sdk/classes-and-functions/chainvineclient/referralconversion-payload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
