contracts/handlers/guardian-module-handler
Classes
GuardianModuleHandler
Defined in: lib/contracts/handlers/guardian-module-handler.ts:18
Handler for the GuardianModule contract exposing methods to
interact with the contract.
Constructors
Constructor
new GuardianModuleHandler(
chain,walletClient,publicClient):GuardianModuleHandler
Defined in: lib/contracts/handlers/guardian-module-handler.ts:31
Create the handler for the PufLocker contract exposing methods to
interact with the contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
chain | Chain | Chain to use for the client. |
walletClient | { } | The wallet client to use for wallet interactions. |
publicClient | { } | The public client to use for public interactions. |
Returns
Methods
getContract()
getContract():
object
Defined in: lib/contracts/handlers/guardian-module-handler.ts:45
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.
getEjectionThreshold()
getEjectionThreshold():
Promise<bigint>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:62
Get the ejection threshold.
Returns
Promise<bigint>
The ejection threshold.
getGuardians()
getGuardians():
Promise<readonly`0x${string}`[]>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:71
Get the guardians.
Returns
Promise<readonly `0x${string}`[]>
The guardians.
getGuardiansEnclaveAddress()
getGuardiansEnclaveAddress(
guardian):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:81
Get the enclave address for a guardian.
Parameters
| Parameter | Type | Description |
|---|---|---|
guardian | `0x${string}` | The guardian address. |
Returns
Promise<`0x${string}`>
The enclave address.
getGuardiansEnclaveAddresses()
getGuardiansEnclaveAddresses():
Promise<readonly`0x${string}`[]>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:90
Get the enclave addresses for all guardians.
Returns
Promise<readonly `0x${string}`[]>
The enclave addresses.
getGuardiansEnclavePubkeys()
getGuardiansEnclavePubkeys():
Promise<readonly`0x${string}`[]>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:99
Get the enclave pubkeys for all guardians.
Returns
Promise<readonly `0x${string}`[]>
The enclave pubkeys.
getMrenclave()
getMrenclave():
Promise<`0x${string}`>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:125
Get the mrenclave.
Returns
Promise<`0x${string}`>
The mrenclave.
getMrsigner()
getMrsigner():
Promise<`0x${string}`>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:134
Get the mrsigner.
Returns
Promise<`0x${string}`>
The mrsigner.
getThreshold()
getThreshold():
Promise<bigint>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:143
Get the threshold.
Returns
Promise<bigint>
The threshold.
isConsumingScheduledOp()
isConsumingScheduledOp():
Promise<`0x${string}`>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:153
Check if the guardian module is consuming scheduled operations.
Returns
Promise<`0x${string}`>
True if the guardian module is consuming scheduled operations, false otherwise.
isGuardian()
isGuardian(
account):Promise<boolean>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:163
Check if an account is a guardian.
Parameters
| Parameter | Type | Description |
|---|---|---|
account | `0x${string}` | The account address. |
Returns
Promise<boolean>
True if the account is a guardian, false otherwise.
removeGuardian()
removeGuardian(
guardian,account):Promise<`0x${string}`>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:174
Remove a guardian.
Parameters
| Parameter | Type | Description |
|---|---|---|
guardian | `0x${string}` | The guardian address. |
account | `0x${string}` | The account address to make the transaction with. |
Returns
Promise<`0x${string}`>
The transaction receipt.
validateGuardiansEnclaveSignatures()
validateGuardiansEnclaveSignatures(
enclaveSignatures,signedMessageHash):Promise<boolean>
Defined in: lib/contracts/handlers/guardian-module-handler.ts:110
Validate the enclave signatures for a signed message.
Parameters
| Parameter | Type | Description |
|---|---|---|
enclaveSignatures | `0x${string}`[] | The enclave signatures. |
signedMessageHash | `0x${string}` | The signed message hash. |
Returns
Promise<boolean>
The validation result.