fetch static method

Future<MultisigStorage?> fetch({
  1. required Provider provider,
  2. required Uint8List multisigPubkey,
  3. required Uint8List callHash,
})

Fetch multisig storage from chain

Returns null if no pending transaction exists.

Parameters:

  • provider: Chain connection
  • multisigPubkey: The multisig account address
  • callHash: Hash of the call being executed

Example:

final storage = await MultisigStorage.fetch(
  provider: provider,
  multisigAddress: signatories.multisigAddress,
  callHash: Hasher.blake2b256.hash(callData),
  registry: chainInfo.registry,
);

if (storage == null) {
  // No pending transaction - this would be the first approval
}

Implementation

static Future<MultisigStorage?> fetch({
  required final Provider provider,
  required final Uint8List multisigPubkey,
  required final Uint8List callHash,
}) async {
  // Create storage key
  final storageKey = _createStorageKey(multisigPubkey, callHash);

  // Fetch from chain
  final storageData = await StateApi(provider).getStorage(storageKey);

  if (storageData == null || storageData.isEmpty) {
    return null;
  }

  // Decode the storage
  return _decode(storageData);
}