transferEvent([payload,])

const campaignId = 'aSlud3293';

const amount = 100; // required, this is the amount of token you want us to convert
const usd_value = 100; //required, 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 chain_id = '1'; // optional
const fee = 20; // optional
const transaction_hash = '0x1234567890'; //optional
const token_address = '0x1234567890'; //optional
const requirement_id = 'abc123def'; //optional

const completion = await userClient.transferEvent({
    requirement_id,
    campaign: {
        id: campaignId
    },
    transaction_hash,
    chain_id,
    network,
    token_address,
    amount,
    usd_value
    external_identifier
    fee,
});

Params

Response

Examples

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

const userWalletAddress = '0x293kdo0ij0';

const campaignId = 'aSlug123';

// Generate your ChainvineClient instance
const client = new ChainvineClient(); //Make sure to whitelist your domain
const userClient = await client.syncUser(userWalletAddress);

const amount = 100; // required, this is the amount of token you want us to convert
const usd_value = 100; //required, 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 chain_id = '1'; // optional
const fee = 20; // optional
const transaction_hash = '0x1234567890'; //optional
const token_address = '0x1234567890'; //optional
const requirement_id = 'abc123def'; //optional

const completion = await userClient.transferEvent({
    requirement_id,
    campaign: {
        id: campaignId
    },
    transaction_hash,
    chain_id,
    network,
    token_address,
    amount,
    usd_value
    external_identifier
    fee,
});

Last updated