getGuardianConfig
Get the current guardian configuration for an account, including counts, weights, and threshold.
Usage
const config = await getGuardianConfig({
account: {
address: '0x123...',
type: 'safe',
deployedOnChains: [8453],
initCode: '0x...' // optional
},
client: publicClient
})
Parameters
account
- Type:
Account
The account object.
client
- Type:
PublicClient
The public client instance used to interact with the blockchain.
Returns
config
- Type:
Promise<{ guardianCount: bigint; totalWeight: bigint; acceptedWeight: bigint; threshold: bigint }>
Object containing:
guardianCount
: Number of guardians configured for the accounttotalWeight
: Sum of all guardian weightsacceptedWeight
: Sum of weights from guardians who have accepted their rolethreshold
: Required weight threshold for recovery actions
If the contract call fails, returns all values as 0n
.