asMultiMethod static method
Creates the asMulti
approval method call for the multisig transaction.
Implementation
static Uint8List asMultiMethod(
{required ChainInfo chainInfo,
required List<Uint8List> otherSignatories,
required int threshold,
required Uint8List callData,
required Weight maxWeight,
required MultisigStorage multiSigStorage}) {
final decodedCall = chainInfo.scaleCodec.registry.codecs['Call']!
.decode(ByteInput.fromBytes(callData));
final approvalArgument = MapEntry(
'Multisig',
MapEntry(
'as_multi',
{
'threshold': threshold,
'other_signatories': otherSignatories,
'maybe_timepoint': Option<Map<String, dynamic>>.some(
multiSigStorage.timePoint.toMap()),
'call': decodedCall,
'max_weight': maxWeight.toMap(),
},
),
);
final ByteOutput output = ByteOutput();
chainInfo.scaleCodec.registry.codecs['Call']!
.encodeTo(approvalArgument, output);
return output.toBytes();
}