package Ġjp . co . sor am its u . feature _ staking _ api . domain . model Ċ Ċ import Ġjp . co . sor am its u . common . utils . sum By BigInteger Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . AccountId Ċ import Ġjava . math . BigInteger Ċ Ċ class ĠSt aking Ledger ( ĊĠĠĠ Ġval Ġst ash Id : ĠAccount Id , ĊĠĠĠ Ġval Ġtotal : ĠBigInteger , ĊĠĠĠ Ġval Ġactive : ĠBigInteger , ĊĠĠĠ Ġval Ġunlock ing : ĠList < Unlock Chunk >, ĊĠĠĠ Ġval Ġclaimed Rewards : ĠList < BigInteger > Ċ ) Ċ Ċ class ĠUn lock Chunk ( val Ġamount : ĠBigInteger , Ġval Ġera : ĠBigInteger ) Ċ Ċ fun ĠSt aking Ledger . sum St aking ( ĊĠĠĠ Ġcondition : Ġ( chunk : ĠUn lock Chunk ) Ġ-> ĠBoolean Ċ ): ĠBigInteger Ġ{ ĊĠĠĠ Ġreturn Ġunlock ing ĊĠĠĠĠĠĠĠ Ġ. filter Ġ{ Ġcondition ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ. sum By BigInteger ( Unlock Chunk :: amount ) Ċ } Ċ Ċ fun ĠUn lock Chunk . is Un bon ding In ( active E ra Index : ĠBigInteger ) Ġ= Ġera Ġ> Ġactive E ra Index Ċ fun ĠUn lock Chunk . is Re deem able In ( active E ra Index : ĠBigInteger ) Ġ= Ġera Ġ<= Ġactive E ra Index Ċ