Skip to content

Commit

Permalink
Add L2RewardManager to the main PufferClient
Browse files Browse the repository at this point in the history
  • Loading branch information
9inpachi committed Aug 27, 2024
1 parent 51e8337 commit bad64dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/api/puffer-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { PufTokenHandler } from '../contracts/handlers/puf-token-handler';
import { PufferL2DepositorHandler } from '../contracts/handlers/puffer-l2-depositor-handler';
import { ERC20PermitHandler } from '../contracts/handlers/erc20-permit-handler';
import { PufLockerHandler } from '../contracts/handlers/puf-locker-handler';
import { L2RewardManagerHandler } from '../contracts/handlers/l2-reward-manager-handler';

/**
* The core class and the main entry point of the Puffer SDK.
Expand All @@ -33,6 +34,8 @@ export class PufferClient {
public pufToken: PufTokenHandler;
/** Handler for the `PufLocker` contract. */
public pufLocker: PufLockerHandler;
/** Handler for the `L2RewardManager` contract. */
public l2RewardManager: L2RewardManagerHandler;

/**
* Create the Puffer Client.
Expand Down Expand Up @@ -94,6 +97,11 @@ export class PufferClient {
this.walletClient,
this.publicClient,
);
this.l2RewardManager = new L2RewardManagerHandler(
chain,
this.walletClient,
this.publicClient,
);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/contracts/handlers/l2-reward-manager-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ export class L2RewardManagerHandler {
}

/**
* Claims the rewards for a specific epoch range based on the `ClaimOrder`.
* Claims the rewards for a specific epoch range based on the
* `ClaimOrder`.
*
* @param account The account using which to claim the rewards.
* @param claimOrders One or more claim orders.
* @param claimOrders[].account Account of the claim order.
* @param claimOrders[].amount Amount of the claim order.
* @param claimOrders[].intervalId Interval ID of the claim order. See `getIntervalId`.
* @param claimOrders[].intervalId Interval ID of the claim order. See
* `getIntervalId`.
* @param claimOrders[].merkleProof Merkle proof of the claim order.
* @returns `transact: () => Promise<Address>` - Used to make the
* transaction.
Expand Down

0 comments on commit bad64dd

Please sign in to comment.