• Retrieve the last extrinsic from a block that matches the provided filter.

    The function ignores failed extrinsics and, if multiple extrinsics from the block match the provided filter, it only takes the last one.

    Parameters

    • blockNumber: BN

      The number of the block to parse.

    • filter: ((tx) => boolean)

      The filter to apply to the transactions in the block.

        • (tx): boolean
        • Parameters

          • tx: TxWithEvent

          Returns boolean

    • Optional api: ApiPromise

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

    Returns Promise<Extrinsic | null>

    The last extrinsic in the block matching the filter, or null if no extrinsic is found.