claimEligibleEarnings([payload,])

Claim eligible cryptocurrency earnings for a user of your campaign

This method allows you request a user's earnings to be paid out from your Gnosis Safe.

Note - this endpoint is asynchronous of the actual payouts from your Gnosis Safe, which occur on-chain. ChainVine handles reconciling earnings owed with those that are transferred successfully on-chain via this SDK method.

const campaignId = 'aSlug123';

const campaign = {
  id: campaignId
}

const claim = await userClient.claimEligibleEarnings({campaign});

Params

ParamRequiredTypeDescription

campaign.id

required

string

the id of the program/campaign requirement belongs to Note: this campaign/program must belong to your account

Response

FieldTypeDescription

message

String

Ok status message on success

How this method claims earnings for your user

  • All unpaid earnings are flagged for pay-out

  • Pay-outs are reflected on ChainVine asynchronously of the request

  • Earnings that are paid out successfully on chain are marked as paid out ChainVine side

  • Earnings that fail on-chain are not marked as failed on ChainVine and can be re-attempted

  • Earnings that are being paid out will not be retried while on-chain transfer confirmation is pending

Examples

In this approach, we claim a user's earnings on their behalf.

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 campaign = {
  id: campaignId
}

const claim = await userClient.claimEligibleEarnings({campaign});

Last updated