• Flatten all nested calls into a single array following a DFS approach.

    For example, given the calls [[N1, N2], [N3, [N4, N5], N6]], the final list will look like [N1, N2, N3, N4, N5, N6].

    The following extrinsics are recognized as containing nested calls and will be unpacked:

    • pallet utility: batch, batchAll, forceBatch.
    • pallet did: submitDidCall, dispatchAs.
    • pallet proxy: proxy, proxyAnnounced.

    Parameters

    • call: IMethod<AnyTuple, FunctionMetadataLatest>

      The Call which can potentially contain nested calls.

    • Optional api: ApiPromise

      The optional ApiPromise. If not provided, the one returned by the ConfigService is used.

    Returns IMethod[]

    A list of Call nested according to the rules above.