/* Ċ Ġ* ĠCopyright Ġ 2 0 2 2 ĠP era ĠWallet , ĠL DA Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense Ċ Ġ*/ Ċ Ċ package Ġcom . al gor and . android . dependency injection Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . al gor and . android . R Ċ import Ġcom . al gor and . android . models . Base Wallet Connect Error Provider Ċ import Ġcom . al gor and . android . network . Al god Interceptor Ċ import Ġcom . al gor and . android . utils . wallet connect . WC Wallet Connect Client Ċ import Ġcom . al gor and . android . utils . wallet connect . WC Wallet Connect Mapper Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Client Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Custom Transaction Handler . Companion . MAX _ TRANSACTION _ COUNT Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Event Logger Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Firebase Event Logger Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Session Builder Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Session Cached Data Handler Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Transaction Error Provider Ċ import Ġcom . google . firebase . analytics . Firebase Analytics Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . android . components . Application Component Ċ import Ġdagger . h ilt . android . qual ifiers . ApplicationContext Ċ import Ġjava . io . File Ċ import Ġjavax . inject . Named Ċ import Ġjavax . inject . Singleton Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġorg . wallet connect . impl s . File WC Session Store Ċ Ċ @ Module Ċ @ Install In ( Application Component :: class ) Ċ object ĠWallet Connect Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide M oshi (): ĠM oshi Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠM oshi . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Last ( Kotlin Json Adapter Factory ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Named (" wc Wallet Client ") ĊĠĠĠ Ġfun Ġprovide Wallet Connect Client ( ĊĠĠĠĠĠĠĠ Ġwallet Connect Session Builder : ĠWallet Connect Session Builder , ĊĠĠĠĠĠĠĠ Ġwallet Connect Mapper : ĠWC Wallet Connect Mapper , ĊĠĠĠĠĠĠĠ Ġcached Data Handler : ĠWallet Connect Session Cached Data Handler ĊĠĠĠ Ġ): ĠWallet Connect Client Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠWC Wallet Connect Client ( wallet Connect Session Builder , Ġwallet Connect Mapper , Ġcached Data Handler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Wallet Connect Session Builder ( ĊĠĠĠĠĠĠĠ Ġ@ Named (" wallet Connect HttpClient ") Ġok HttpClient : ĠOk HttpClient , ĊĠĠĠĠĠĠĠ Ġ@ ApplicationContext Ġapp Context : ĠContext , ĊĠĠĠĠĠĠĠ Ġm oshi : ĠM oshi , ĊĠĠĠĠĠĠĠ Ġwallet Connect Mapper : ĠWC Wallet Connect Mapper ĊĠĠĠ Ġ): ĠWallet Connect Session Builder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstorage File Ġ= ĠFile ( app Context . cacheDir , ĠWC Wallet Connect Client . CACHE _ STORAGE _ NAME ). apply Ġ{ Ġcreate New File () Ġ} ĊĠĠĠĠĠĠĠ Ġreturn ĠWallet Connect Session Builder ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm oshi , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġok HttpClient , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFile WC Session Store ( storage File , Ġm oshi ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Connect Mapper ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Wallet Connect Event Logger ( ĊĠĠĠĠĠĠĠ Ġfirebase Analytics : ĠFirebase Analytics , ĊĠĠĠĠĠĠĠ Ġal god Interceptor : ĠAl god Interceptor ĊĠĠĠ Ġ): ĠWallet Connect Event Logger Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠWallet Connect Firebase Event Logger ( firebase Analytics , Ġal god Interceptor ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide Wallet Connect Transaction Error Provider ( ĊĠĠĠĠĠĠĠ Ġ@ ApplicationContext Ġapp Context : ĠContext ĊĠĠĠ Ġ): ĠWallet Connect Transaction Error Provider Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( app Context ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrejected Error Provider Ġ= ĠBase Wallet Connect Error Provider . Request Rejected Error Provider ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuser Rejection ErrorMessage Ġ= ĠgetString ( R . string . transaction _ request _ rejected _ user _ rejected ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfailed Group Transaction ErrorMessage Ġ= ĠgetString ( R . string . transaction _ request _ rejected _ transaction _ group ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpending Transaction ErrorMessage Ġ= ĠgetString ( R . string . transaction _ request _ rejected _ user _ currently ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġun authorized Request Error Provider Ġ= ĠBase Wallet Connect Error Provider . Unauthorized Request Error Provider ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmis matching Nodes ErrorMessage Ġ= ĠgetString ( R . string . signing _ error _ network _ mismatch ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmissing Signer ErrorMessage Ġ= ĠgetString ( R . string . signing _ error _ transaction _ in _ request ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġunsupported Error Provider Ġ= ĠBase Wallet Connect Error Provider . Unsupported Request Error Provider ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunknown Transaction Type ErrorMessage Ġ= ĠgetString ( R . string . transaction _ request _ contains _ unsupported ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmultis ig Transaction ErrorMessage Ġ= ĠgetString ( R . string . transaction _ request _ contains _ unsupported _ multis ig ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinvalid Input Error Provider Ġ= ĠBase Wallet Connect Error Provider . Invalid Input Error Provider ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmax Transaction Limit ErrorMessage Ġ= ĠgetString ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . string . invalid _ input _ transaction _ request , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠMAX _ TRANSACTION _ COUNT ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunable To Parse ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ unable _ to _ parse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinvalid PublicKey ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ invalid _ public _ key ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinvalid Asset ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ invalid _ asset ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunable To Sign ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ unable _ to _ be ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġatomic Txn No Need ToBe Signed ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ group _ transaction ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinvalid Signer ErrorMessage Ġ= ĠgetString ( R . string . invalid _ input _ requested _ signer ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠWallet Connect Transaction Error Provider ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrejected Ġ= Ġrejected Error Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġun authorized Ġ= Ġun authorized Request Error Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunsupported Ġ= Ġunsupported Error Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinvalid Input Ġ= Ġinvalid Input Error Provider ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ