approveAsMultiMethod static method

Uint8List approveAsMultiMethod({
  1. required ChainInfo chainInfo,
  2. required List<Uint8List> otherSignatories,
  3. required int threshold,
  4. required Uint8List callHash,
  5. required Weight maxWeight,
  6. required MultisigStorage? multiSigStorage,
})

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();
}