Skip to main content

contracts/handlers/puffer-withdrawal-manager-handler

Classes

PufferWithdrawalManagerHandler

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:18

Handler for the PufferWithdrawalsManager contract exposing methods to interact with the contract.

Constructors

Constructor

new PufferWithdrawalManagerHandler(chain, walletClient, publicClient): PufferWithdrawalManagerHandler

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:32

Create the handler for the PufferWithdrawalsManager 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

PufferWithdrawalManagerHandler

Methods

completeQueuedWithdrawal()

completeQueuedWithdrawal(walletAddress, withdrawalIdx): Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:132

Complete a withdrawal from the queue.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`-
withdrawalIdxbigintThe index of the withdrawal to complete.
Returns

Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

The transaction hash of the withdrawal.

getContract()

getContract(): object

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:50

Get the contract.

Returns

object

The viem contract.

getWithdrawal()

getWithdrawal(withdrawalIdx): Promise<{ pufETHAmount: bigint; pufETHToETHExchangeRate: bigint; recipient: `0x${string}`; }>

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:157

Get the withdrawal at the given index.

Parameters
ParameterTypeDescription
withdrawalIdxbigintThe index of the withdrawal to get.
Returns

Promise<{ pufETHAmount: bigint; pufETHToETHExchangeRate: bigint; recipient: `0x${string}`; }>

The withdrawal at the given index.

requestWithdrawal()

requestWithdrawal(walletAddress, amount): Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:70

Request a withdrawal of the given amount to the given address, with a permit.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`The account address to request the withdrawal for.
amountbigintThe pufETH amount to request the withdrawal for.
Returns

Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

The transaction hash of the withdrawal.

requestWithdrawalWithPermit()

requestWithdrawalWithPermit(walletAddress, amount): Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

Defined in: lib/contracts/handlers/puffer-withdrawal-manager-handler.ts:96

Request a withdrawal of the given amount to the given address.

Parameters
ParameterTypeDescription
walletAddress`0x${string}`The account address to request the withdrawal for.
amountbigintThe pufETHamount to request the withdrawal for.
Returns

Promise<{ estimate: () => Promise<bigint>; transact: () => Promise<`0x${string}`>; }>

The transaction hash of the withdrawal.