Using the Hedgey APIs for Token Claims

Use these instructions to build your own claim button.

The simplest way to get started is to use the Hedgey Claims app to setup your token claim. Then you can use our API endpoint to pull the merkle tree proof and data to display the amount of tokens claimable, and format the proof and information required to create and send the on-chain transaction for your users to make their claim of tokens or vesting stream.

Once you have setup your claim, we will auto-generate a claim page for you. The claim page URL contains the unique UUID required by the API and the smart contract for making claims. This unique ID can be found in the URL or in the space for copying the claim page URL.

For example the id value will look something like fe48cfdd-5809-4bc1-a47f-1c526b36cf5f

The token claim product uses a merkle tree to compress the information to claim, as a result the wallet claiming needs a proof value. This proof value can be obtained by using an API.

The endpoint URL is

A post request should be made to this endpoint with the following JSON data.


The uuid value is the id of the claim and the address is the address of the wallet that is making the claim.

Below is a response example, if the wallet can carry out a claim.

	"canClaim": true,
	"proof": [
	"amount": "1000000000000000000"

Below is a response example, if the wallet cannot carry out a claim.

  "canClaim": false,
  "amount": "0"

Once the user has the proof value from the above call they can then make a web3 call using the wallet that is eligible to claim.

A stripped down version of the ABI required to make the call

		inputs: [
				internalType: 'bytes16',
				name: 'campaignId',
				type: 'bytes16',
				internalType: 'bytes32[]',
				name: 'proof',
				type: 'bytes32[]',
				internalType: 'uint256',
				name: 'claimAmount',
				type: 'uint256',
		name: 'claimTokens',
		outputs: [],
		stateMutability: 'nonpayable',
		type: 'function',

campaignId: The uuid converted to a hex array.

proof: The proof string array retrieved from the endpoint.

claimAmount: The claim amount retrieved from the endpoint.

Converting the uuid to a hex array using viem and uuid

Step one, parse the uuid string into a byte array using parse

Step two, parse the byte array into a hex value.

import { parse } from 'uuid';
import { bytesToHex } from 'viem';

const bytesArray = parse('fe48cfdd-5809-4bc1-a47f-1c526b36cf5f');
const hexId = bytesToHex(bytesArray);

The hexId value can then be used in the contract call.

An example of calling this web3 method using viem:

const hash = await walletClient.writeContract({
  abi: claimCampaignAbi,
  address: contractAddress,
  functionName: 'claimTokens',
  args: [hexId, proof, amount],
  account: claimant,

For AirVest and AirStream the wallet will receive a plan they can use to redeem locked tokens according to the configured schedule.

For AirClaim there is an option for the tokens to be transferred directly to the claimant.

Last updated