package Ġio . ex zo coin . wallet . modules . wallet connect . request Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . activity . add Callback Ċ import Ġandroidx . fragment . app . view Models Ċ import Ġandroidx . navigation . nav Graph ViewModels Ċ import Ġio . ex zo coin . wallet . R Ċ import Ġio . ex zo coin . wallet . core . App Logger Ċ import Ġio . ex zo coin . wallet . core . Base Fragment Ċ import Ġio . ex zo coin . wallet . core . ethereum . E thereum Fee ViewModel Ċ import Ġio . ex zo coin . wallet . core . setOn Single ClickListener Ċ import Ġio . ex zo coin . wallet . modules . sen dev m transaction . Send E vm Transaction ViewModel Ċ import Ġio . ex zo coin . wallet . modules . wallet connect . Wallet Connect ViewModel Ċ import Ġio . ex zo coin . core . find Nav Controller Ċ import Ġio . ex zo coin . core . helpers . Hud Helper Ċ import Ġkotlinx . android . synt hetic . main . fragment _ wallet _ connect _ request .* Ċ Ċ class ĠWallet Connect Send E thereum Transaction Request Fragment Ġ: ĠBase Fragment () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠApp Logger (" wallet - connect ") ĊĠĠĠ Ġprivate Ġval Ġbase ViewModel Ġby Ġnav Graph ViewModels < Wallet Connect ViewModel >( R . id . wallet Connect Main Fragment ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ wallet _ connect _ request , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval Ġvm Factory Ġ= ĠWallet Connect Request Module . Factory ( base ViewModel . shared Send E thereum Transaction Request !! , Ġbase ViewModel . service ) ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġby Ġview Models < Wallet Connect Send E thereum Transaction Request ViewModel > Ġ{ Ġvm Factory Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġsend ViewModel Ġby Ġview Models < Send E vm Transaction ViewModel > Ġ{ Ġvm Factory Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġfee ViewModel Ġby Ġview Models < E thereum Fee ViewModel > Ġ{ Ġvm Factory Ġ} ĊĊĠĠĠĠĠĠĠ Ġbtn Approve . setOn Single ClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . info (" click Ġapprove Ġbutton ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsend ViewModel . send ( logger ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbtn Reject . setOn Single ClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . reject () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclose () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġrequire Activity (). on Back Pressed Dispatcher . add Callback ( view Lifecycle Owner ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . reject () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclose () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġsend ViewModel . send Enabled LiveData . observe ( view Lifecycle Owner , Ġ{ Ġenabled Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbtn Approve . isEnabled Ġ= Ġenabled ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġsend ViewModel . sending LiveData . observe ( view Lifecycle Owner , Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbtn Reject . isEnabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġsend ViewModel . send Success LiveData . observe ( view Lifecycle Owner , Ġ{ Ġtransaction Hash Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . approve ( transaction Hash ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠH ud Helper . show Success Message ( require Activity (). findViewById ( android . R . id . content ), ĠR . string . Hud _ Text _ Success ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclose () ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġsend ViewModel . send Failed LiveData . observe ( view Lifecycle Owner , Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠH ud Helper . show ErrorMessage ( require Activity (). findViewById ( android . R . id . content ), Ġit ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġsend E vm Transaction View . init ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsend ViewModel , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfee ViewModel , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġview Lifecycle Owner , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġparent FragmentManager , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshow Speed Info Listener Ġ= Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfind Nav Controller (). navigate ( R . id . wallet Connect Request Fragment _ to _ fee Speed Info , Ġnull , Ġnav Options ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġclose () Ġ{ ĊĠĠĠĠĠĠĠ Ġbase ViewModel . shared Send E thereum Transaction Request Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġfind Nav Controller (). pop Back Stack () ĊĠĠĠ Ġ} Ċ Ċ } Ċ