MultisigAccount class
Represents a multisig account configuration with signatories and approval threshold.
This class manages the creation and configuration of multisig accounts on Substrate-based blockchains. It handles signatory validation, automatic sorting of public keys, and derivation of the multisig account address using Substrate's standard algorithm.
The multisig address is deterministically derived from:
- The sorted list of signatory public keys
- The approval threshold
This ensures that all signatories derive the same multisig address regardless of the order in which addresses were provided.
Example:
final multisigAccount = MultisigAccount(
addresses: [alice.address, bob.address, charlie.address],
threshold: 2,
);
print('Multisig address: ${Address.encode(multisigAccount.multisigPubkey)}');
- Annotations
-
- @JsonSerializable.new(constructor: '_', createToJson: true)
Constructors
-
MultisigAccount({required List<
String> addresses, required int threshold}) -
Creates a new MultisigAccount instance with automatic address derivation.
factory
-
MultisigAccount.fromJson(Map<
String, dynamic> json) -
Creates a MultisigAccount from a JSON representation.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- multisigPubkey → Uint8List
-
The derived multisig account public key (32 bytes).
final
-
props
→ List<
Object> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
-
publicKeys
→ List<
Uint8List> -
Sorted list of signatory public keys (32 bytes each).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - threshold → int
-
Number of approvals required for transaction execution.
final
Methods
-
containsAddress(
String address) → bool - Checks if an address is a signatory of this multisig account.
-
containsPubkey(
Uint8List pubkey) → bool - Checks if a public key is a signatory of this multisig account.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
otherSignatoriesForAddress(
String signerAddress) → List< Uint8List> - Returns the list of other signatories excluding the current signer.
-
otherSignatoriesForPubkey(
Uint8List signerPubkey) → List< Uint8List> - Returns the list of other signatories excluding the current signer (using public key).
-
toJson(
) → Map< String, dynamic> - Converts this MultisigAccount to a JSON representation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
toJsonMethod(
MultisigAccount multisigAccount) → Map< String, dynamic> - Static helper method for JSON serialization.