import { BlockHash } from '@polkadot/types/interfaces' ; import { Observable } from '@polkadot/types/types' ; export const getSubscribeOrAtQuery = < T extends ( ... arg : any [ ] ) => Observable < any > = any > ( query , at ? ) : T => { return ( ( ... params ) => { if ( at ) ( query as unknown as any ) . at ( at , ... params ) ; return query ( ... params ) ; } ) as any as T ; } ; export const getPromiseOrAtQuery = < T extends ( ... arg : any [ ] ) => Promise < any > = any > ( query , at ? ) : T => { return ( ( ... params ) => { if ( at ) ( query as unknown as any ) . at ( at , ... params ) ; return query ( ... params ) ; } ) as any as T ; } ;