Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2603: Add support for nucleus contracts to stake with unifiETH #45

Merged
merged 11 commits into from
Oct 2, 2024
10 changes: 8 additions & 2 deletions docs/docs/handlers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ We currently have the following handlers.
For interacting with the `ERC20Permit` contract for any supported token.
- [PufLockerHandler](../api/contracts/handlers/puf-locker-handler.md)\
For interacting with Puffer's `PufLocker` contract.
- [PufTokenHandler](../api/contracts/handlers/puf-token-handler.md)\
For interacting with Puffer's `PufToken` contract for wrapped tokens.
- [PufferDepositorHandler](../api/contracts/handlers/puffer-depositor-handler.md)\
For interacting with Puffer's `PufferDepositor` contract.
- [PufferL2DepositorHandler](../api/contracts/handlers/puffer-l2-depositor-handler.md)\
Expand All @@ -26,6 +24,14 @@ We currently have the following handlers.
For interacting with Puffer's `L1RewardManager` contract.
- [L2RewardManagerHandler](../api/contracts/handlers/l2-reward-manager-handler.md)\
For interacting with Puffer's `L2RewardManager` contract.
- [L2RewardManagerHandler](../api/contracts/handlers/l2-reward-manager-handler.md)\
For interacting with Puffer's `L2RewardManager` contract.
- [NucleusBoringVaultHandler](../api/contracts/handlers/nucleus-boring-vault-handler.md)\
For interacting with Nucleus's `BoringVault` contract.
- [NucleusTellerHandler](../api/contracts/handlers/nucleus-teller-handler.md)\
For interacting with Nucleus's `Teller` contract.
- [NucleusAccountantHandler](../api/contracts/handlers/nucleus-accountant-handler.md)\
For interacting with Nucleus's `Accountant` contract.

More details about each handler can be found in their respective API documentation.

Expand Down
33 changes: 25 additions & 8 deletions lib/api/puffer-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import {
import { Chain, VIEM_CHAINS } from '../chains/constants';
import { PufferVaultHandler } from '../contracts/handlers/puffer-vault-handler';
import { PufferDepositorHandler } from '../contracts/handlers/puffer-depositor-handler';
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';
import { L1RewardManagerHandler } from '../contracts/handlers/l1-reward-manager-handler';
import { PufferWithdrawalManagerHandler } from '../contracts/handlers/puffer-withdrawal-manager-handler';
import { NucleusBoringVaultHandler } from '../contracts/handlers/nucleus-boring-vault-handler';
import { NucleusTellerHandler } from '../contracts/handlers/nucleus-teller-handler';
import { NucleusAccountantHandler } from '../contracts/handlers/nucleus-accountant-handler';

/**
* The core class and the main entry point of the Puffer SDK.
*/
Expand All @@ -31,8 +34,6 @@ export class PufferClient {
public depositor: PufferDepositorHandler;
/** Handler for the `PufferL2Depositor` contract. */
public l2Depositor: PufferL2DepositorHandler;
/** Handler for the `PufToken` contract. */
public pufToken: PufTokenHandler;
/** Handler for the `PufLocker` contract. */
public pufLocker: PufLockerHandler;
/** Handler for the `L2RewardManager` contract. */
Expand All @@ -41,6 +42,12 @@ export class PufferClient {
public l1RewardManager: L1RewardManagerHandler;
/** Handler for the `PufferWithdrawalManager` contract. */
public pufferWithdrawalManager: PufferWithdrawalManagerHandler;
/** Handler for the `NucleusBoringVault` contract. */
public nucleusBoringVault: NucleusBoringVaultHandler;
/** Handler for the `NucleusTeller` contract. */
public nucleusTeller: NucleusTellerHandler;
/** Handler for the `NucleusAccountant` contract. */
public nucleusAccountant: NucleusAccountantHandler;

/**
* Create the Puffer Client.
Expand Down Expand Up @@ -87,11 +94,6 @@ export class PufferClient {
this.walletClient,
this.publicClient,
);
this.pufToken = new PufTokenHandler(
chain,
this.walletClient,
this.publicClient,
);
this.l2Depositor = new PufferL2DepositorHandler(
chain,
this.walletClient,
Expand All @@ -117,6 +119,21 @@ export class PufferClient {
this.walletClient,
this.publicClient,
);
this.nucleusBoringVault = new NucleusBoringVaultHandler(
chain,
this.walletClient,
this.publicClient,
);
this.nucleusTeller = new NucleusTellerHandler(
chain,
this.walletClient,
this.publicClient,
);
this.nucleusAccountant = new NucleusAccountantHandler(
chain,
this.walletClient,
this.publicClient,
);
}

/**
Expand Down
Loading
Loading