package Ġco . nil in . op ex . chain scanner . ethereum . service Ċ Ċ import Ġco . nil in . op ex . chain scanner . core . spi . Chain Service Ċ import Ġco . nil in . op ex . chain scanner . ethereum . utils . Exception Handling Ċ import Ġkotlinx . coroutines . reactor . await Single Ċ import Ġorg . springframework . stereotype . Service Ċ import Ġorg . web 3 j . protocol . Web 3 j Ċ import Ġorg . web 3 j . protocol . core . Default Block Parameter Number Ċ import Ġorg . web 3 j . protocol . core . methods . response . Transaction Ċ import Ġreactor . kotlin . core . publisher . to Mono Ċ import Ġjava . math . BigInteger Ċ Ċ @ Service Ċ class ĠChain ServiceImpl ( private Ġval Ġweb 3 j : ĠWeb 3 j ) Ġ: ĠChain Service < List < Transaction >> Ġ{ ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Transactions ( block Number : ĠBigInteger ): ĠList < Transaction > Ġ= Ġrun Catch ing Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbn Ġ= ĠDefault Block Parameter Number ( block Number ) ĊĠĠĠĠĠĠĠ Ġweb 3 j . eth Get Block By Number ( bn , Ġtrue ). send Async (). to Mono (). await Single (). block ĊĠĠĠ Ġ}. on Failure ( Exception Handling :: detect RateLimit ). map Ġ{ Ġblock Ġ-> ĊĠĠĠĠĠĠĠ Ġblock . transactions . filter Is Instance < Transaction >(). filter Ġ{ Ġ! it . to . isNull Or Blank () Ġ}. toList () ĊĠĠĠ Ġ}. get OrThrow () ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Latest Block (): ĠBigInteger Ġ= Ġrun Catch ing Ġ{ ĊĠĠĠĠĠĠĠ Ġweb 3 j . eth Block Number (). send Async (). to Mono (). await Single (). block Number ĊĠĠĠ Ġ}. on Failure ( Exception Handling :: detect RateLimit ). get OrThrow () Ċ } Ċ