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
| Parameter | Type | Description |
|---|---|---|
address | string | The 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
| Parameter | Type | Description |
|---|---|---|
contractAddress | string | Address of the Merkle Distributor Contract |
index | number | operator 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
| Parameter | Type | Description |
|---|---|---|
address | string | Operator 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