Skip to main content

contracts/handlers/guardian-module-handler

Classes

GuardianModuleHandler

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

Constructors

new GuardianModuleHandler()

new GuardianModuleHandler(chain, walletClient, publicClient): GuardianModuleHandler

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

GuardianModuleHandler

Source

lib/contracts/handlers/guardian-module-handler.ts:31

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

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/guardian-module-handler.ts:45

getEjectionThreshold()

getEjectionThreshold(): Promise<bigint>

Get the ejection threshold.

Returns

Promise<bigint>

The ejection threshold.

Source

lib/contracts/handlers/guardian-module-handler.ts:62

getGuardians()

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

Get the guardians.

Returns

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

The guardians.

Source

lib/contracts/handlers/guardian-module-handler.ts:71

getGuardiansEnclaveAddress()

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

Get the enclave address for a guardian.

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

Promise<`0x${string}`>

The enclave address.

Source

lib/contracts/handlers/guardian-module-handler.ts:81

getGuardiansEnclaveAddresses()

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

Get the enclave addresses for all guardians.

Returns

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

The enclave addresses.

Source

lib/contracts/handlers/guardian-module-handler.ts:90

getGuardiansEnclavePubkeys()

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

Get the enclave pubkeys for all guardians.

Returns

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

The enclave pubkeys.

Source

lib/contracts/handlers/guardian-module-handler.ts:99

getMrenclave()

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

Get the mrenclave.

Returns

Promise<`0x${string}`>

The mrenclave.

Source

lib/contracts/handlers/guardian-module-handler.ts:125

getMrsigner()

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

Get the mrsigner.

Returns

Promise<`0x${string}`>

The mrsigner.

Source

lib/contracts/handlers/guardian-module-handler.ts:134

getThreshold()

getThreshold(): Promise<bigint>

Get the threshold.

Returns

Promise<bigint>

The threshold.

Source

lib/contracts/handlers/guardian-module-handler.ts:143

isConsumingScheduledOp()

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

Check if the guardian module is consuming scheduled operations.

Returns

Promise<`0x${string}`>

True if the guardian module is consuming scheduled operations, false otherwise.

Source

lib/contracts/handlers/guardian-module-handler.ts:153

isGuardian()

isGuardian(account): Promise<boolean>

Check if an account is a guardian.

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

Promise<boolean>

True if the account is a guardian, false otherwise.

Source

lib/contracts/handlers/guardian-module-handler.ts:163

removeGuardian()

removeGuardian(guardian, account): Promise<`0x${string}`>

Remove a guardian.

Parameters
ParameterTypeDescription
guardian`0x${string}`The guardian address.
account`0x${string}`The account address to make the transaction with.
Returns

Promise<`0x${string}`>

The transaction receipt.

Source

lib/contracts/handlers/guardian-module-handler.ts:174

validateGuardiansEnclaveSignatures()

validateGuardiansEnclaveSignatures(enclaveSignatures, signedMessageHash): Promise<boolean>

Validate the enclave signatures for a signed message.

Parameters
ParameterTypeDescription
enclaveSignatures`0x${string}`[]The enclave signatures.
signedMessageHash`0x${string}`The signed message hash.
Returns

Promise<boolean>

The validation result.

Source

lib/contracts/handlers/guardian-module-handler.ts:110