Skip to main content

contracts/handlers/puffer-protocol-handler

Classes

PufferProtocolHandler

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:38

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

Constructors

Constructor

new PufferProtocolHandler(chain, walletClient, publicClient): PufferProtocolHandler

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:51

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

PufferProtocolHandler

Methods

batchHandleWithdrawals()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:306

Batch handle withdrawals.

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

Promise<`0x${string}`>

The transaction.

createPufferModule()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:215

Create a new puffer module.

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

Promise<`0x${string}`>

The transaction.

depositValidatorTickets()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:275

Deposit validator tickets.

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

Promise<`0x${string}`>

The transaction.

getContract()

getContract(): object

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:64

Get the contract.

Returns

object

The viem contract.

getDepositDataRoot()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:197

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.

getMinimumVtAmount()

getMinimumVtAmount(): Promise<bigint>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:81

Get the minimum VT amount required.

Returns

Promise<bigint>

The minimum VT amount.

getModuleAddress()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:110

Get module address by name.

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

Promise<`0x${string}`>

The module address.

getModuleLimitInformation()

getModuleLimitInformation(moduleName): Promise<{ allowedLimit: bigint; numberOfRegisteredValidators: bigint; }>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:175

Get module limit information.

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

Promise<{ allowedLimit: bigint; numberOfRegisteredValidators: bigint; }>

The module limit information.

getModuleWeights()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:119

Get module weights.

Returns

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

The module weights.

getNextValidatorToProvision()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:128

Get the next validator to be provisioned.

Returns

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

Tuple of module name and index.

getNodeInfo()

getNodeInfo(node): Promise<{ activeValidatorCount: bigint; pendingValidatorCount: bigint; vtBalance: bigint; }>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:138

Get node information.

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

Promise<{ activeValidatorCount: bigint; pendingValidatorCount: bigint; vtBalance: bigint; }>

The node information.

getValidatorInfo()

getValidatorInfo(moduleName, pufferModuleIndex): Promise<{ bond: bigint; module: `0x${string}`; node: `0x${string}`; pubKey: `0x${string}`; status: number; }>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:159

Get validator information.

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

Promise<{ bond: bigint; module: `0x${string}`; node: `0x${string}`; pubKey: `0x${string}`; status: number; }>

The validator information.

getValidators()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:148

Get validators for a module.

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

Promise<readonly object[]>

The validators array.

getValidatorTicketsBalance()

getValidatorTicketsBalance(owner): Promise<bigint>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:100

Get validator tickets balance for an owner.

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

Promise<bigint>

The validator tickets balance.

getVTPenalty()

getVTPenalty(): Promise<bigint>

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:90

Get the VT penalty amount.

Returns

Promise<bigint>

The VT penalty amount.

getWithdrawalCredentials()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:185

Get withdrawal credentials for a module.

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

Promise<`0x${string}`>

The withdrawal credentials.

provisionNode()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:254

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.

registerValidatorKey()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:231

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.

skipProvisioning()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:326

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.

withdrawValidatorTickets()

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

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:289

Withdraw validator tickets.

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

Promise<`0x${string}`>

The transaction.

Type Aliases

StoppedValidatorInfo

StoppedValidatorInfo = object

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:24

Properties

PropertyTypeDefined in
endEpochbigintlib/contracts/handlers/puffer-protocol-handler.ts:27
moduleAddresslib/contracts/handlers/puffer-protocol-handler.ts:25
moduleName`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:29
pufferModuleIndexbigintlib/contracts/handlers/puffer-protocol-handler.ts:30
startEpochbigintlib/contracts/handlers/puffer-protocol-handler.ts:26
wasSlashedbooleanlib/contracts/handlers/puffer-protocol-handler.ts:28
withdrawalAmountbigintlib/contracts/handlers/puffer-protocol-handler.ts:31

ValidatorKeyData

ValidatorKeyData = object

Defined in: lib/contracts/handlers/puffer-protocol-handler.ts:15

Properties

PropertyTypeDefined in
blsEncryptedPrivKeyShares`0x${string}`[]lib/contracts/handlers/puffer-protocol-handler.ts:19
blsPubKey`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:16
blsPubKeySet`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:20
depositDataRoot`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:18
raveEvidence`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:21
signature`0x${string}`lib/contracts/handlers/puffer-protocol-handler.ts:17