Package com.klaytn.caver.account
Class WeightedMultiSigOptions
- java.lang.Object
-
- com.klaytn.caver.account.WeightedMultiSigOptions
-
public class WeightedMultiSigOptions extends java.lang.Object
Representing an options for AccountKeyWeightedMultiSig. This class will define threshold and weights.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_COUNT_WEIGHTED_PUBLIC_KEY
-
Constructor Summary
Constructors Constructor Description WeightedMultiSigOptions()
Creates a empty WeightedMultiSIgOptions instance This instance used when setting AccountKeyPublic to AccountKeyRoleBased component.WeightedMultiSigOptions(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
Creates a WeightedMultiSigOptions instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<WeightedMultiSigOptions>
getDefaultOptionsForRoleBased(java.util.List<java.lang.String[]> roleBasedPublicKeys)
Creates a List that has WeightedMultiSigOptions instance with default value.(threshold, weight has 1)static WeightedMultiSigOptions
getDefaultOptionsForWeightedMultiSig(java.lang.String[] publicKeyArr)
Create a WeightedMultiSigOptions instance with default value.(threshold, weight has 1)java.math.BigInteger
getThreshold()
Getter function for thresholdjava.util.List<java.math.BigInteger>
getWeights()
Getter function for list of weightboolean
isEmpty()
boolean
isValidateOptions(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
Before creating an instance, check whether the passed option is valid.
-
-
-
Field Detail
-
MAX_COUNT_WEIGHTED_PUBLIC_KEY
public static final int MAX_COUNT_WEIGHTED_PUBLIC_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WeightedMultiSigOptions
public WeightedMultiSigOptions()
Creates a empty WeightedMultiSIgOptions instance This instance used when setting AccountKeyPublic to AccountKeyRoleBased component.
-
WeightedMultiSigOptions
public WeightedMultiSigOptions(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
Creates a WeightedMultiSigOptions instance.- Parameters:
threshold
- a thresholdweights
- a List contains weight value of key
-
-
Method Detail
-
getDefaultOptionsForWeightedMultiSig
public static WeightedMultiSigOptions getDefaultOptionsForWeightedMultiSig(java.lang.String[] publicKeyArr)
Create a WeightedMultiSigOptions instance with default value.(threshold, weight has 1)- Parameters:
publicKeyArr
- public key array- Returns:
- WeightedMultiSigOptions
-
getDefaultOptionsForRoleBased
public static java.util.List<WeightedMultiSigOptions> getDefaultOptionsForRoleBased(java.util.List<java.lang.String[]> roleBasedPublicKeys)
Creates a List that has WeightedMultiSigOptions instance with default value.(threshold, weight has 1)- Parameters:
roleBasedPublicKeys
- Public key list instance for using AccountKeyRolebased.- Returns:
- List
-
isValidateOptions
public boolean isValidateOptions(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
Before creating an instance, check whether the passed option is valid. - check threshold value bigger than zero - weights has weight up to 10 - threshold must have value smaller than sum of weights item- Parameters:
threshold
- a thresholdweights
-- Returns:
-
isEmpty
public boolean isEmpty()
-
getThreshold
public java.math.BigInteger getThreshold()
Getter function for threshold- Returns:
- threshold
-
getWeights
public java.util.List<java.math.BigInteger> getWeights()
Getter function for list of weight- Returns:
- weights
-
-