approveAsMultiMethod static method
Creates the approval method call for the multisig transaction.
Note: It does not submit the transaction to the chain.
Implementation
static Uint8List approveAsMultiMethod(
{required ChainInfo chainInfo,
required List<Uint8List> otherSignatories,
required int threshold,
required Uint8List callHash,
required Weight maxWeight,
required MultisigStorage? multiSigStorage}) {
final approvalArgument = MapEntry(
'Multisig',
MapEntry(
'approve_as_multi',
{
'threshold': threshold,
'other_signatories': otherSignatories,
'maybe_timepoint': multiSigStorage?.timePoint != null
? Option<Map<String, dynamic>>.some(
multiSigStorage!.timePoint.toMap())
: Option<Map<String, dynamic>>.none(),
'call_hash': callHash,
'max_weight': maxWeight.toMap(),
},
),
);
final ByteOutput output = ByteOutput();
chainInfo.scaleCodec.registry.codecs['Call']!
.encodeTo(approvalArgument, output);
return output.toBytes();
}