Skip to main content

contracts/handlers/puffer-protocol-handler

Classes

PufferProtocolHandler

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

Constructors

new PufferProtocolHandler()

new PufferProtocolHandler(chain, walletClient, publicClient): PufferProtocolHandler

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

PufferProtocolHandler

Source

lib/contracts/handlers/puffer-protocol-handler.ts:57

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

batchHandleWithdrawals()

batchHandleWithdrawals(validatorInfos, guardianEOASignatures): Promise<`0x${string}`>

Batch handle withdrawals.

Parameters
ParameterTypeDescription
validatorInfosStoppedValidatorInfo[]The validator infos.
guardianEOASignatures`0x${string}`[]The guardian EOA signatures.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:312

createPufferModule()

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

Create a new puffer module.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:221

depositValidatorTickets()

depositValidatorTickets(permit, node): Promise<`0x${string}`>

Deposit validator tickets.

Parameters
ParameterTypeDescription
permitPermitDataThe permit data.
node`0x${string}`The node address.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:281

getContract()

getContract(): object

Get the contract.

Returns

object

The viem contract.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:70

getDepositDataRoot()

getDepositDataRoot(pubKey, signature, withdrawalCredentials): Promise<`0x${string}`>

Get deposit data root.

Parameters
ParameterTypeDescription
pubKey`0x${string}`The public key.
signature`0x${string}`The signature.
withdrawalCredentials`0x${string}`The withdrawal credentials.
Returns

Promise<`0x${string}`>

The deposit data root.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:203

getMinimumVtAmount()

getMinimumVtAmount(): Promise<bigint>

Get the minimum VT amount required.

Returns

Promise<bigint>

The minimum VT amount.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:87

getModuleAddress()

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

Get module address by name.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
Returns

Promise<`0x${string}`>

The module address.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:116

getModuleLimitInformation()

getModuleLimitInformation(moduleName): Promise<object>

Get module limit information.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
Returns

Promise<object>

The module limit information.

allowedLimit

allowedLimit: bigint

numberOfRegisteredValidators

numberOfRegisteredValidators: bigint

Source

lib/contracts/handlers/puffer-protocol-handler.ts:181

getModuleWeights()

getModuleWeights(): Promise<readonly `0x${string}`[]>

Get module weights.

Returns

Promise<readonly `0x${string}`[]>

The module weights.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:125

getNextValidatorToProvision()

getNextValidatorToProvision(): Promise<readonly [`0x${string}`, bigint]>

Get the next validator to be provisioned.

Returns

Promise<readonly [`0x${string}`, bigint]>

Tuple of module name and index.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:134

getNodeInfo()

getNodeInfo(node): Promise<object>

Get node information.

Parameters
ParameterTypeDescription
node`0x${string}`The node address.
Returns

Promise<object>

The node information.

activeValidatorCount

activeValidatorCount: bigint

pendingValidatorCount

pendingValidatorCount: bigint

vtBalance

vtBalance: bigint

Source

lib/contracts/handlers/puffer-protocol-handler.ts:144

getVTPenalty()

getVTPenalty(): Promise<bigint>

Get the VT penalty amount.

Returns

Promise<bigint>

The VT penalty amount.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:96

getValidatorInfo()

getValidatorInfo(moduleName, pufferModuleIndex): Promise<object>

Get validator information.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
pufferModuleIndexbigintThe puffer module index.
Returns

Promise<object>

The validator information.

bond

bond: bigint

module

module: `0x${string}`

node

node: `0x${string}`

pubKey

pubKey: `0x${string}`

status

status: number

Source

lib/contracts/handlers/puffer-protocol-handler.ts:165

getValidatorTicketsBalance()

getValidatorTicketsBalance(owner): Promise<bigint>

Get validator tickets balance for an owner.

Parameters
ParameterTypeDescription
owner`0x${string}`The owner address.
Returns

Promise<bigint>

The validator tickets balance.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:106

getValidators()

getValidators(moduleName): Promise<readonly object[]>

Get validators for a module.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
Returns

Promise<readonly object[]>

The validators array.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:154

getWithdrawalCredentials()

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

Get withdrawal credentials for a module.

Parameters
ParameterTypeDescription
module`0x${string}`The module address.
Returns

Promise<`0x${string}`>

The withdrawal credentials.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:191

provisionNode()

provisionNode(guardianEnclaveSignatures, validatorSignature, depositRootHash): Promise<`0x${string}`>

Provision a node.

Parameters
ParameterTypeDescription
guardianEnclaveSignatures`0x${string}`[]The guardian enclave signatures.
validatorSignature`0x${string}`The validator signature.
depositRootHash`0x${string}`The deposit root hash.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:260

registerValidatorKey()

registerValidatorKey(data, moduleName, pufETHPermit, vtPermit): Promise<`0x${string}`>

Register validator key.

Parameters
ParameterTypeDescription
dataValidatorKeyDataThe validator key data.
moduleName`0x${string}`The module name.
pufETHPermitPermitDataThe pufETH permit data.
vtPermitPermitDataThe VT permit data.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:237

skipProvisioning()

skipProvisioning(moduleName, guardianEOASignatures): Promise<`0x${string}`>

Skip provisioning for a module.

Parameters
ParameterTypeDescription
moduleName`0x${string}`The module name.
guardianEOASignatures`0x${string}`[]The guardian EOA signatures.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:332

withdrawValidatorTickets()

withdrawValidatorTickets(amount, recipient): Promise<`0x${string}`>

Withdraw validator tickets.

Parameters
ParameterTypeDescription
amountbigintThe amount to withdraw.
recipient`0x${string}`The recipient address.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/puffer-protocol-handler.ts:295

Type Aliases

PermitData

PermitData: object

Type declaration

amount

amount: bigint

deadline

deadline: bigint

r

r: Address

s

s: Address

v

v: number

Source

lib/contracts/handlers/puffer-protocol-handler.ts:13


StoppedValidatorInfo

StoppedValidatorInfo: object

Type declaration

endEpoch

endEpoch: bigint

module

module: Address

moduleName

moduleName: `0x${string}`

pufferModuleIndex

pufferModuleIndex: bigint

startEpoch

startEpoch: bigint

wasSlashed

wasSlashed: boolean

withdrawalAmount

withdrawalAmount: bigint

Source

lib/contracts/handlers/puffer-protocol-handler.ts:30


ValidatorKeyData

ValidatorKeyData: object

Type declaration

blsEncryptedPrivKeyShares

blsEncryptedPrivKeyShares: `0x${string}`[]

blsPubKey

blsPubKey: `0x${string}`

blsPubKeySet

blsPubKeySet: `0x${string}`

depositDataRoot

depositDataRoot: `0x${string}`

raveEvidence

raveEvidence: `0x${string}`

signature

signature: `0x${string}`

Source

lib/contracts/handlers/puffer-protocol-handler.ts:21