package Ġio . nova foundation . nova . feature _ staking _ impl . presentation . pay outs . list Ċ Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġio . nova foundation . nova . common . base . Base ViewModel Ċ import Ġio . nova foundation . nova . common . mixin . api . Ret ri able Ċ import Ġio . nova foundation . nova . common . mixin . api . Retry Payload Ċ import Ġio . nova foundation . nova . common . resources . ResourceManager Ċ import Ġio . nova foundation . nova . common . utils . Event Ċ import Ġio . nova foundation . nova . common . utils . format As Currency Ċ import Ġio . nova foundation . nova . common . utils . in Background Ċ import Ġio . nova foundation . nova . common . utils . require Exception Ċ import Ġio . nova foundation . nova . common . utils . require Value Ċ import Ġio . nova foundation . nova . common . utils . single Replay Shared Flow Ċ import Ġio . nova foundation . nova . common . utils . with Loading Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . R Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . domain . St aking Interactor Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . domain . model . Pending Pay out Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . domain . model . Pending Pay outs Statistics Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . St aking Router Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . pay outs . confirm . model . Confirm Pay out Payload Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . pay outs . list . model . Pending Pay out Model Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . pay outs . list . model . Pending Pay outs Statistics Model Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . pay outs . model . Pending Pay out Parcelable Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . domain . model . Token Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . domain . model . amount From Pl anks Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . presentation . format ters . format Token Amount Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . presentation . format ters . format Token Change Ċ import Ġkotlinx . coroutines . flow . first Ċ import Ġkotlinx . coroutines . flow . map Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠPay outs List ViewModel ( ĊĠĠĠ Ġprivate Ġval Ġrouter : ĠSt aking Router , ĊĠĠĠ Ġprivate Ġval Ġresource Manager : ĠResourceManager , ĊĠĠĠ Ġprivate Ġval Ġinter actor : ĠSt aking Interactor , Ċ ) Ġ: ĠBase ViewModel (), ĠRet ri able Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġretry Event : ĠMutable LiveData < Event < Retry Payload >> Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġprivate Ġval Ġpay outs Statistics Flow Ġ= Ġsingle Replay Shared Flow < Pending Pay outs Statistics >() ĊĊĠĠĠ Ġval Ġpay outs Statistics State Ġ= Ġpay outs Statistics Flow ĊĠĠĠĠĠĠĠ Ġ. map (:: convertTo Ui Model ) ĊĠĠĠĠĠĠĠ Ġ. with Loading () ĊĠĠĠĠĠĠĠ Ġ. in Background () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġload Pay outs () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġback Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . back () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġpay out All Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpay out Statistics Ġ= Ġpay outs Statistics Flow . first () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpayload Ġ= ĠConfirm Pay out Payload ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtotal Reward In Pl anks Ġ= Ġpay out Statistics . total Amount In Pl anks , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpay outs Ġ= Ġpay out Statistics . pay outs . map Ġ{ Ġmap Pay out To Parcelable ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġrouter . open Confirm Pay out ( payload ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġpay out Clicked ( index : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpay outs Ġ= Ġpay outs Statistics Flow . first (). pay outs ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpay out Ġ= Ġpay outs [ index ] ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpay out Parcelable Ġ= Ġmap Pay out To Parcelable ( pay out ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġrouter . open Pay out Details ( pay out Parcelable ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġload Pay outs () Ġ{ ĊĠĠĠĠĠĠĠ Ġlaunch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġinter actor . calculate Pending Pay outs () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( result . is Success ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpay outs Statistics Flow . emit ( result . require Value ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval ĠerrorMessage Ġ= Ġresult . require Exception (). message Ġ?: Ġresource Manager . getString ( R . string . common _ undefined _ error _ message ) ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretry Event . value Ġ= ĠEvent ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠRetry Payload ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtitle Ġ= Ġresource Manager . getString ( R . string . common _ error _ general _ title ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmessage Ġ= ĠerrorMessage , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġon Retry Ġ= Ġ:: load Pay outs , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġon Cancel Ġ= Ġ:: back Clicked ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġsuspend Ġfun ĠconvertTo Ui Model ( ĊĠĠĠĠĠĠĠ Ġstatistics : ĠPending Pay outs Statistics , ĊĠĠĠ Ġ): ĠPending Pay outs Statistics Model Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtoken Ġ= Ġinter actor . current Asset Flow (). first (). token ĊĠĠĠĠĠĠĠ Ġval Ġtotal Amount Ġ= Ġtoken . amount From Pl anks ( statistics . total Amount In Pl anks ). format Token Amount ( token . configuration ) ĊĊĠĠĠĠĠĠĠ Ġval Ġpay outs Ġ= Ġstatistics . pay outs . map Ġ{ Ġmap Pay out To Pay out Model ( token , Ġit ) Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn ĠPending Pay outs Statistics Model ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpay outs Ġ= Ġpay outs , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpay out All Title Ġ= Ġresource Manager . getString ( R . string . staking _ reward _ pay outs _ pay out _ all , Ġtotal Amount ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġplaceholder Visible Ġ= Ġpay outs . isEmpty () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmap Pay out To Pay out Model ( token : ĠToken , Ġpay out : ĠPending Pay out ): ĠPending Pay out Model Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( pay out ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġamount Ġ= Ġtoken . amount From Pl anks ( amount In Pl anks ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Pay out Model ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidator Title Ġ= Ġvalidator Info . identity Name Ġ?: Ġvalidator Info . address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtime Left Ġ= Ġtime Left , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠcreatedAt Ġ= Ġtime Left Calculated At , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdays Left Color Ġ= Ġif Ġ( close To Expire ) ĠR . color . red Ġelse ĠR . color . white _ 6 4 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġamount Ġ= Ġamount . format Token Change ( token . configuration , Ġis Income Ġ= Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġamount Fi at Ġ= Ġtoken . fi at Amount ( amount ). format As Currency () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmap Pay out To Parcelable ( pay out : ĠPending Pay out ): ĠPending Pay out Parcelable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( pay out ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPending Pay out Parcelable ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidator Info Ġ= ĠPending Pay out Parcelable . Validator Info Parcelable ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaddress Ġ= Ġvalidator Info . address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġidentity Name Ġ= Ġvalidator Info . identity Name ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġera Ġ= Ġera , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġamount In Pl anks Ġ= Ġamount In Pl anks , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtime Left Calculated At Ġ= Ġtime Left Calculated At , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtime Left Ġ= Ġtime Left , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclose To Expire Ġ= Ġclose To Expire ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ