import { assertExists } from '../../utils' ; import { RunHandlersOnTransaction } from "../../utils/run.handlers.on.transaction" ; export type RunTransaction = ( txHash : string ) => Promise < void > ; export function provideRunTransaction ( runHandlersOnTransaction ) { assertExists ( runHandlersOnTransaction , 'runHandlersOnTransaction' ) ; return async function runTransaction ( txHash ) { let hashes = [ txHash ] ; if ( txHash . includes ( "," ) ) { hashes = txHash . split ( "," ) ; } for ( const hash of hashes ) { await runHandlersOnTransaction ( hash ) ; } } ; }