Skip to main content

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
ParameterTypeDescription
chainChainChain to use for the client.
walletClient{ }The wallet client to use for wallet interactions.
publicClient{ }The public client to use for public interactions.
Returns

PufferL2DepositorHandler

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
ParameterType
depositParamsL2DepositParams
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

PropertyTypeDefined in
accountAddresslib/contracts/handlers/puffer-l2-depositor-handler.ts:17
isPreapproved?booleanlib/contracts/handlers/puffer-l2-depositor-handler.ts:21
lockPeriod?bigintlib/contracts/handlers/puffer-l2-depositor-handler.ts:20
referralCode?bigintlib/contracts/handlers/puffer-l2-depositor-handler.ts:19
tokenTokenlib/contracts/handlers/puffer-l2-depositor-handler.ts:16
valuebigintlib/contracts/handlers/puffer-l2-depositor-handler.ts:18