create Weighted Threshold Params
fun createWeightedThresholdParams(threshold: Int, signerWeights: Map<SmartAccountSigner, Int>): WeightedThresholdParams
Creates weighted threshold policy parameters.
Weighted threshold assigns different weights to different signers. Authorization succeeds when the sum of weights of authenticated signers meets or exceeds the threshold.
Return
Policy parameters for weighted threshold
Parameters
threshold
Total weight required for authorization (must be >= 1)
signer Weights
Map of signers to their weights (all weights must be >= 1)
Throws
if threshold is less than 1, signer weights is empty, any weight is less than 1, or total weight is less than threshold
Example:
val weights = mapOf(adminSigner to 100, userSigner to 50)
val params = SmartAccountBuilders.createWeightedThresholdParams(100, weights)Content copied to clipboard