ChainVine API Docs
  • Chainvine
    • Product and Features
    • Technical Overview
  • ⚙️Developers
    • 🔨Use Cases
      • Leverage cookies
      • Link Claimer/Referrer
      • Record Link Click
      • Generate a Referrer Link
      • Record a Transfer Event
      • Complete a Requirement
    • 🖼️Embedded Widget
      • Implementation
      • FAQ
    • 🧰SDK
      • Implementation
      • Configuring the Client
      • Classes and Functions
        • Utility Methods
        • ChainvineClient
          • getReferralUrl(walletAddress)
          • recordClick(referrer)
          • linkReferrer([payload,])
          • referralConversion([payload,])
          • syncUser(walletAddress)
          • getCampaignReferralStats([payload,])
        • ChainvineUser
          • Initializing the client
          • joinCampaign([campaignParams,])
          • getRequirement([payload,])
          • getUserStats([payload,])
          • verifyRequirement([payload,])
          • completeRequirement([payload,])
          • claimEligibleEarnings([payload,])
          • transferEvent([payload,])
          • referral([campaignParams,])
            • linkToReferrer(referrer)
            • url()
          • setRewardTiersOverride([payload,])
        • Errors
        • Authentication
          • Getting your API Key
          • Allow-listing a domain
      • FAQ
    • 🪝Webhooks
    • 📔Open API Specification
  • Rewards
    • Claiming For Users
      • On ChainVine
Powered by GitBook
On this page
  1. Developers
  2. Use Cases

Record a Transfer Event

For when you intend to complete a requirement for a user programmatically.

PreviousGenerate a Referrer LinkNextComplete a Requirement

Last updated 1 year ago

Intended uses

When you are dealing with a requirement that can only be completed by your system, and not ChainVine's, some examples can include, but is not limited to:

  • a user interacts with a chain that ChainVine does not support

  • a user replies to a message on your app

  • a user signs up for an off-chain feature on your app

To better understand how a reward is issued to a user when calling this method, please refer to the method

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

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

const client = new ChainvineClient();

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 fee = 390;

const campaign = {
  id: 'aSlug123'
}

const userClient = await client.syncUser(wallet_address);

const res = await userClient.transferEvent({
    campaign,
    transaction_hash,
    token_address,
    amount,
    usd_value,
    external_identifier,
    fee,
});
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 userClient = await client.syncUser(wallet_address);

const res = await userClient.completeRequirement({
    campaign,
    id: requirementId,
    referrer_id,
    transaction_hash,
    token_address,
    amount,
    usd_value,
    external_identifier,
});

Before implementing this approach, be sure to have gotten a copy of .

⚙️
🔨
completeRequirement
your API Key