referralConversion([payload,])

Sends referral conversion event.

Warning - May 25, 2023

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

Before implementing this approach, be sure to have whitelisted your domain.

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,
});

Payload

Response

void

Last updated