fetch static method
Fetch multisig storage from chain
Returns null if no pending transaction exists.
Parameters:
provider: Chain connectionmultisigPubkey: The multisig account addresscallHash: 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);
}