Skip to content

Commit

Permalink
Merge pull request #19 from PufferFinance/1767/puffer-l2-depositor
Browse files Browse the repository at this point in the history
1767: Add support for the PufferL2Depositor contract
  • Loading branch information
guestn authored Jul 4, 2024
2 parents d8287fa + 3dbee0d commit d9c3bf7
Show file tree
Hide file tree
Showing 21 changed files with 1,313 additions and 87 deletions.
26 changes: 24 additions & 2 deletions lib/api/puffer-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ 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';

/**
* The core class and the main entry point of the Puffer SDK.
Expand All @@ -18,12 +21,18 @@ export class PufferClient {
private publicClient: PublicClient;

// Contract Handlers
/** Handler for the `ERC20Permit` contract. */
public erc20Permit: ERC20PermitHandler;
/** Handler for the `PufferVaultV2` contract. */
public vault: PufferVaultHandler;
/** Handler for the `PufferDepositor` contract. */
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;

/**
* Create the Puffer Client.
Expand Down Expand Up @@ -54,23 +63,36 @@ export class PufferClient {
transport: http(),
});

this.erc20Permit = new ERC20PermitHandler(
chain,
this.walletClient,
this.publicClient,
);
this.vault = new PufferVaultHandler(
chain,
this.walletClient,
this.publicClient,
);

this.depositor = new PufferDepositorHandler(
chain,
this.walletClient,
this.publicClient,
);

this.pufToken = new PufTokenHandler(
chain,
this.walletClient,
this.publicClient,
);
this.l2Depositor = new PufferL2DepositorHandler(
chain,
this.walletClient,
this.publicClient,
);
this.pufLocker = new PufLockerHandler(
chain,
this.walletClient,
this.publicClient,
);
}

/**
Expand Down
Loading

0 comments on commit d9c3bf7

Please sign in to comment.