Skip to main content

contracts/handlers/l2-reward-manager-handler

Classes

L2RewardManagerHandler

Handler for the L2RewardManager contract.

Constructors

new L2RewardManagerHandler()

new L2RewardManagerHandler(chain, walletClient, publicClient): L2RewardManagerHandler

Create the handler for the L2RewardManager contract exposing methods to interact with the contract.

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClientobjectThe wallet client to use for wallet interactions.
publicClientobjectThe public client to use for public interactions.
Returns

L2RewardManagerHandler

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:37

Properties

PropertyModifierTypeDescription
chainprivateChainChain to use for the client.
publicClientprivateobjectThe public client to use for public interactions.
viemChainprivateChain-
walletClientprivateobjectThe wallet client to use for wallet interactions.

Methods

authority()

authority(): Promise<`0x${string}`>

Get the authority address.

Returns

Promise<`0x${string}`>

The authority address.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:68

claimRewards()

claimRewards(account, claimOrders): object

Claims the rewards for a specific epoch range based on the ClaimOrder.

Parameters
ParameterTypeDescription
account`0x${string}`The account using which to claim the rewards.
claimOrdersClaimOrder[]One or more claim orders.
Returns

object

transact: () => Promise<Address> - Used to make the transaction.

estimate: () => Promise<bigint> - Gas estimate of the transaction.

estimate()

estimate: () => Promise<bigint>

Returns

Promise<bigint>

transact()

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

Returns

Promise<`0x${string}`>

Throws

If claimOrders is empty.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:156

getClaimingDelay()

getClaimingDelay(): Promise<bigint>

Get the claiming delay.

Returns

Promise<bigint>

The claiming delay.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:77

getContract()

getContract(): object

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.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:51

getEpochRecord()

getEpochRecord(intervalId): Promise<object>

Get the epoch record for a specific period.

Parameters
ParameterTypeDescription
intervalId`0x${string}`The interval ID for a given start and end epoch. See getInternvalId.
Returns

Promise<object>

The epoch record of exchange rate and reward root.

endEpoch

endEpoch: bigint

ethAmount

ethAmount: bigint

ethToPufETHRate

ethToPufETHRate: bigint

pufETHAmount

pufETHAmount: bigint

rewardRoot

rewardRoot: `0x${string}`

startEpoch

startEpoch: bigint

timeBridged

timeBridged: number

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:88

getIntervalId()

getIntervalId(startEpoch, endEpoch): Promise<`0x${string}`>

Returns the interval ID for a given start and end epoch.

Parameters
ParameterTypeDescription
startEpochbigintStart epoch of the interval.
endEpochbigintEnd epoch of the interval.
Returns

Promise<`0x${string}`>

Interval ID for the given start and end epoch.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:99

getRewardsClaimer()

getRewardsClaimer(account): Promise<`0x${string}`>

Get the rewards claimer for a specific account.

Parameters
ParameterTypeDescription
account`0x${string}`Account for which to get the rewards claimer.
Returns

Promise<`0x${string}`>

Rewards claimer address.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:109

isClaimed()

isClaimed(account, intervalId): Promise<boolean>

Check if the reward has been claimed for an account and a specific interval.

Parameters
ParameterTypeDescription
account`0x${string}`The address of the account to check.
intervalId`0x${string}`The claiming interval ID. See getIntervalId.
Returns

Promise<boolean>

Whether the reward has been claimed.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:121

isClaimingLocked()

isClaimingLocked(intervalId): Promise<boolean>

Check whether the claiming is locked for the given interval.

Parameters
ParameterTypeDescription
intervalId`0x${string}`The interval to check the claiming lock for. See getIntervalId.
Returns

Promise<boolean>

Whether the claiming is locked for the given interval.

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:132

Type Aliases

ClaimOrder

ClaimOrder: object

Type declaration

account

account: Address

amount

amount: bigint

intervalId

intervalId: Address

isL1Contract

isL1Contract: boolean

merkleProof

merkleProof: Address[]

Source

lib/contracts/handlers/l2-reward-manager-handler.ts:13