contracts/handlers/puffer-l2-depositor-handler
Classes
PufferL2DepositorHandler
Defined in: lib/contracts/handlers/puffer-l2-depositor-handler.ts:28
Handler for the PufferL2Depositor contract exposing methods to
interact with the contract.
Constructors
Constructor
new PufferL2DepositorHandler(
chain,walletClient,publicClient):PufferL2DepositorHandler
Defined in: lib/contracts/handlers/puffer-l2-depositor-handler.ts:42
Create the handler for the PufferL2Depositor contract exposing
methods to interact with the contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
chain | Chain | Chain to use for the client. |
walletClient | { } | The wallet client to use for wallet interactions. |
publicClient | { } | The public client to use for public interactions. |
Returns
Methods
deposit()
deposit(
depositParams):Promise<{estimate: () =>Promise<bigint>;transact: () =>Promise<`0x${string}`>; }>
Defined in: lib/contracts/handlers/puffer-l2-depositor-handler.ts:97
Deposit the given token in exchange for the wrapped PufToken. This
doesn't make the transaction but returns two methods namely
transact and estimate.
Note that not all token contracts support permit signatures (e.g.
USDC). If a token's contract doesn't support permit signatures, use
Token.approve() and be sure to set the option isPreapproved to
true.
Parameters
| Parameter | Type |
|---|---|
depositParams | L2DepositParams |
Returns
Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>
transact: () => Promise<Address> - Used to make the
transaction.
estimate: () => Promise<bigint> - Gas estimate of the
transaction.
getContract()
getContract():
object
Defined in: lib/contracts/handlers/puffer-l2-depositor-handler.ts:61
Get the contract. This is a method because the typings are complex and lost when trying to make it a member.
Returns
object
The viem contract.
Type Aliases
L2DepositParams
L2DepositParams =
object
Defined in: lib/contracts/handlers/puffer-l2-depositor-handler.ts:15
Properties
| Property | Type | Defined in |
|---|---|---|
account | Address | lib/contracts/handlers/puffer-l2-depositor-handler.ts:17 |
isPreapproved? | boolean | lib/contracts/handlers/puffer-l2-depositor-handler.ts:21 |
lockPeriod? | bigint | lib/contracts/handlers/puffer-l2-depositor-handler.ts:20 |
referralCode? | bigint | lib/contracts/handlers/puffer-l2-depositor-handler.ts:19 |
token | Token | lib/contracts/handlers/puffer-l2-depositor-handler.ts:16 |
value | bigint | lib/contracts/handlers/puffer-l2-depositor-handler.ts:18 |