Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.
Version: v1.10

Incentives

Defined in: incentives/incentives.ts:24

Internal

Incentives can be used for fetching and claiming Obol incentives.

Access it through Client.incentives.

Example

const obolClient = new Client(config);
await obolClient.incentives.claimIncentives(address);

Methods

claimIncentives()

claimIncentives(address): Promise<ClaimIncentivesResponse>

Defined in: incentives/incentives.ts:65

Claims Obol incentives from a Merkle Distributor contract using an address.

This method automatically fetches incentive data and verifies whether the incentives have already been claimed. If txHash is null, it indicates that the incentives were already claimed.

Note: This method is not yet enabled and will throw an error if called.

Parameters

ParameterTypeDescription
addressstringThe address to claim incentives for

Returns

Promise<ClaimIncentivesResponse>

The transaction hash or already claimed status

Remarks

⚠️ Important: If you're storing the private key in an .env file, ensure it is securely managed and not pushed to version control.

Throws

Will throw an error if the incentives data is not found or the claim fails

An example of how to use claimIncentives: obolClient


isClaimed()

isClaimed(contractAddress, index): Promise<boolean>

Defined in: incentives/incentives.ts:124

Read isClaimed.

Parameters

ParameterTypeDescription
contractAddressstringAddress of the Merkle Distributor Contract
indexnumberoperator index in merkle tree

Returns

Promise<boolean>

true if incentives are already claime

An example of how to use isClaimed: obolClient


getIncentivesByAddress()

getIncentivesByAddress(address): Promise<ClaimableIncentives>

Defined in: incentives/incentives.ts:143

Parameters

ParameterTypeDescription
addressstringOperator address

Returns

Promise<ClaimableIncentives>

The matched incentives from DB

Throws

On not found if address not found.

An example of how to use getIncentivesByAddress: obolClient