Multisig class

Main class for managing multisig operations on a Substrate-based blockchain.

This class provides methods for creating, funding, and managing multisig accounts, as well as approving and executing multisig transactions. It handles the complete lifecycle of multisig operations including initiating transfers, collecting approvals, and executing transactions when the threshold is met.

Example:

final multisig = Multisig(
  provider: provider,
  chainInfo: chainInfo,
  multisigAccount: multisigAccount,
);

// Fund the multisig account
await multisig.createAndFundMultisig(
  fundingAmount: BigInt.from(1000000000000),
  depositorAddress: alice.address,
  signingCallback: alice.sign,
);

Constructors

Multisig({required Provider provider, required ChainInfo chainInfo, required MultisigAccount multisigAccount})
Creates a new Multisig instance.
const

Properties

chainInfo ChainInfo
The chain metadata and configuration information
final
hashCode int
The hash code for this object.
no setterinherited
multisigAccount MultisigAccount
The multisig account configuration with signatories and threshold
final
provider Provider
The provider for connecting to the blockchain
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

approveAsMulti({required String approverAddress, required SigningCallback signingCallback, required Uint8List callData, int eraPeriod = 64, BigInt? tip, int? nonce, Weight? maxWeight}) Future<MultisigResponse>
Approves a pending multisig transaction (non-final approval).
asMulti({required Uint8List callData, required String approverAddress, required SigningCallback signingCallback, int eraPeriod = 64, BigInt? tip, int? nonce, Weight? maxWeight}) Future<MultisigResponse>
Submits the final approval and executes the multisig transaction.
cancel({required String signerAddress, required SigningCallback signingCallback, required Uint8List callHash, int eraPeriod = 64, int? nonce}) Future<Uint8List>
Cancels a pending multisig transaction and refunds the deposit.
createAndFundMultisig({required BigInt fundingAmount, required String depositorAddress, required SigningCallback signingCallback, int eraPeriod = 64, BigInt? tip}) Future<MultisigResponse>
Creates and funds a multisig account by transferring the specified amount from the depositor's account.
createCallData({required String recipientAddress, required BigInt transferAmount, bool keepAlive = true}) Uint8List
Creates SCALE-encoded call data for a balance transfer operation.
initiateTransfer({required String senderAddress, required SigningCallback signingCallback, required String recipientAddress, required BigInt transferAmount, bool keepAlive = true, int eraPeriod = 64, BigInt? tip, int? nonce, Weight? maxWeight}) Future<MultisigResponse>
Initiates a transfer from the multisig account by creating the first approval.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited