/* Ċ Ġ* ĠCopyright Ġ 2 0 1 9 ĠAl gor and , ĠInc . Ċ Ġ* Ġ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 . mapper Ċ Ċ import Ġcom . al gor and . android . models . Base Asset Configuration Transaction . Base Asset Re configuration Transaction Ċ import Ġcom . al gor and . android . models . Base Asset Configuration Transaction . Base Asset Re configuration Transaction . Companion . is Transaction With Close To Ċ import Ġcom . al gor and . android . models . Base Asset Configuration Transaction . Base Asset Re configuration Transaction . Companion . is Transaction With Close To And Re keyed Ċ import Ġcom . al gor and . android . models . Base Asset Configuration Transaction . Base Asset Re configuration Transaction . Companion . is Transaction With Re keyed Ċ import Ġcom . al gor and . android . models . WC Algo Transaction Request Ċ import Ġcom . al gor and . android . models . Wallet Connect Account Ċ import Ġcom . al gor and . android . models . Wallet Connect Asset Information Ċ import Ġcom . al gor and . android . models . Wallet Connect Peer Meta Ċ import Ġcom . al gor and . android . models . Wallet Connect Signer Ċ import Ġcom . al gor and . android . models . Wallet Connect Transaction Request Ċ import Ġcom . al gor and . android . utils . Account CacheManager Ċ import Ġcom . al gor and . android . utils . wallet connect . Wallet Connect Transaction Error Provider Ċ import Ġjavax . inject . Inject Ċ Ċ @ SuppressWarnings (" Return Count ") Ċ class ĠBase Asset Re configuration Transaction Mapper Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġaccount CacheManager : ĠAccount CacheManager , ĊĠĠĠ Ġprivate Ġval Ġerror Provider : ĠWallet Connect Transaction Error Provider Ċ ) Ġ: ĠBase Wallet Connect Transaction Mapper () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Transaction ( ĊĠĠĠĠĠĠĠ Ġpeer Meta : ĠWallet Connect Peer Meta , ĊĠĠĠĠĠĠĠ Ġtransaction Request : ĠWallet Connect Transaction Request , ĊĠĠĠĠĠĠĠ Ġraw Txn : ĠWC Algo Transaction Request ĊĠĠĠ Ġ): ĠBase Asset Re configuration Transaction ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Transaction With Close To And Re keyed ( transaction Request ) Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcreate Asset Re configuration Transaction With Close To And Re key ( peer Meta , Ġtransaction Request , Ġraw Txn ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Transaction With Close To ( transaction Request ) Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcreate Asset Re configuration Transaction With Close ( peer Meta , Ġtransaction Request , Ġraw Txn ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Transaction With Re keyed ( transaction Request ) Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcreate Asset Re configuration Transaction With Re key ( peer Meta , Ġtransaction Request , Ġraw Txn ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcreate Asset Re configuration Transaction ( peer Meta , Ġtransaction Request , Ġraw Txn ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Asset Re configuration Transaction ( ĊĠĠĠĠĠĠĠ Ġpeer Meta : ĠWallet Connect Peer Meta , ĊĠĠĠĠĠĠĠ Ġtransaction Request : ĠWallet Connect Transaction Request , ĊĠĠĠĠĠĠĠ Ġraw Txn : ĠWC Algo Transaction Request ĊĠĠĠ Ġ): ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( transaction Request ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsender Wallet Connect Address Ġ= Ġcreate Wallet Connect Address ( sender Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġaccount Cache Data Ġ= Ġaccount CacheManager . getCache Data ( sender Wallet Connect Address ?. decoded Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Connect Transaction Params Ġ= Ġcreate Transaction Params ( transaction Request ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsender Address Ġ= Ġsender Wallet Connect Address Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnote Ġ= Ġdecoded Note , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Meta Ġ= Ġpeer Meta , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġraw Transaction Payload Ġ= Ġraw Txn , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsigner Ġ= ĠWallet Connect Signer . create ( raw Txn , Ġsender Wallet Connect Address , Ġerror Provider ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġauth Address Ġ= Ġaccount Cache Data ?. auth Address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Ġ= ĠWallet Connect Account . create ( account Cache Data ?. account ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Information Ġ= ĠWallet Connect Asset Information . create ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Cache Data ?. assets Information ?. find Ġ{ Ġit . asset Id Ġ== Ġasset Id Being Configured Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Id Ġ= Ġasset Id Being Configured Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġurl Ġ= Ġasset Config Params ?. url , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmanager Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. manager Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreserve Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. reserve Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfrozen Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. frozen Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcl aw back Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. cl aw back Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠgroupId Ġ= ĠgroupId ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Asset Re configuration Transaction With Close ( ĊĠĠĠĠĠĠĠ Ġpeer Meta : ĠWallet Connect Peer Meta , ĊĠĠĠĠĠĠĠ Ġtransaction Request : ĠWallet Connect Transaction Request , ĊĠĠĠĠĠĠĠ Ġraw Txn : ĠWC Algo Transaction Request ĊĠĠĠ Ġ): ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Close To ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( transaction Request ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsender Wallet Connect Address Ġ= Ġcreate Wallet Connect Address ( sender Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġaccount Cache Data Ġ= Ġaccount CacheManager . getCache Data ( sender Wallet Connect Address ?. decoded Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Close To ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Connect Transaction Params Ġ= Ġcreate Transaction Params ( transaction Request ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsender Address Ġ= Ġsender Wallet Connect Address Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnote Ġ= Ġdecoded Note , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Meta Ġ= Ġpeer Meta , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġraw Transaction Payload Ġ= Ġraw Txn , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsigner Ġ= ĠWallet Connect Signer . create ( raw Txn , Ġsender Wallet Connect Address , Ġerror Provider ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġauth Address Ġ= Ġaccount Cache Data ?. auth Address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Ġ= ĠWallet Connect Account . create ( account Cache Data ?. account ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Information Ġ= ĠWallet Connect Asset Information . create ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Cache Data ?. assets Information ?. find Ġ{ Ġit . asset Id Ġ== Ġasset Id Being Configured Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclose To Address Ġ= Ġcreate Wallet Connect Address ( close To Address ) Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Id Ġ= Ġasset Id Being Configured Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġurl Ġ= Ġasset Config Params ?. url , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmanager Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. manager Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreserve Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. reserve Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfrozen Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. frozen Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcl aw back Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. cl aw back Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠgroupId Ġ= ĠgroupId ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Asset Re configuration Transaction With Re key ( ĊĠĠĠĠĠĠĠ Ġpeer Meta : ĠWallet Connect Peer Meta , ĊĠĠĠĠĠĠĠ Ġtransaction Request : ĠWallet Connect Transaction Request , ĊĠĠĠĠĠĠĠ Ġraw Txn : ĠWC Algo Transaction Request ĊĠĠĠ Ġ): ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Re key ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( transaction Request ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsender Wallet Connect Address Ġ= Ġcreate Wallet Connect Address ( sender Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġaccount Cache Data Ġ= Ġaccount CacheManager . getCache Data ( sender Wallet Connect Address ?. decoded Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Re key ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Connect Transaction Params Ġ= Ġcreate Transaction Params ( transaction Request ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsender Address Ġ= Ġsender Wallet Connect Address Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnote Ġ= Ġdecoded Note , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Meta Ġ= Ġpeer Meta , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġraw Transaction Payload Ġ= Ġraw Txn , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsigner Ġ= ĠWallet Connect Signer . create ( raw Txn , Ġsender Wallet Connect Address , Ġerror Provider ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġauth Address Ġ= Ġaccount Cache Data ?. auth Address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Ġ= ĠWallet Connect Account . create ( account Cache Data ?. account ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Information Ġ= ĠWallet Connect Asset Information . create ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Cache Data ?. assets Information ?. find Ġ{ Ġit . asset Id Ġ== Ġasset Id Being Configured Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġre key Address Ġ= Ġcreate Wallet Connect Address ( re key Address ) Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Id Ġ= Ġasset Id Being Configured Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġurl Ġ= Ġasset Config Params ?. url , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmanager Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. manager Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreserve Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. reserve Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfrozen Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. frozen Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcl aw back Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. cl aw back Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠgroupId Ġ= ĠgroupId ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Asset Re configuration Transaction With Close To And Re key ( ĊĠĠĠĠĠĠĠ Ġpeer Meta : ĠWallet Connect Peer Meta , ĊĠĠĠĠĠĠĠ Ġtransaction Request : ĠWallet Connect Transaction Request , ĊĠĠĠĠĠĠĠ Ġraw Txn : ĠWC Algo Transaction Request ĊĠĠĠ Ġ): ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Close To And Re key ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwith ( transaction Request ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsender Wallet Connect Address Ġ= Ġcreate Wallet Connect Address ( sender Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġaccount Cache Data Ġ= Ġaccount CacheManager . getCache Data ( sender Wallet Connect Address ?. decoded Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠBase Asset Re configuration Transaction . Asset Re configuration Transaction With Close To And Re key ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Connect Transaction Params Ġ= Ġcreate Transaction Params ( transaction Request ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsender Address Ġ= Ġsender Wallet Connect Address Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnote Ġ= Ġdecoded Note , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Meta Ġ= Ġpeer Meta , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġraw Transaction Payload Ġ= Ġraw Txn , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsigner Ġ= ĠWallet Connect Signer . create ( raw Txn , Ġsender Wallet Connect Address , Ġerror Provider ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġauth Address Ġ= Ġaccount Cache Data ?. auth Address , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Ġ= ĠWallet Connect Account . create ( account Cache Data ?. account ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Information Ġ= ĠWallet Connect Asset Information . create ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Cache Data ?. assets Information ?. find Ġ{ Ġit . asset Id Ġ== Ġasset Id Being Configured Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclose To Address Ġ= Ġcreate Wallet Connect Address ( close To Address ) Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġre key Address Ġ= Ġcreate Wallet Connect Address ( re key Address ) Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Id Ġ= Ġasset Id Being Configured Ġ?: Ġreturn Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġurl Ġ= Ġasset Config Params ?. url , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmanager Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. manager Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreserve Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. reserve Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfrozen Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. frozen Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcl aw back Address Ġ= Ġcreate Wallet Connect Address ( asset Config Params ?. cl aw back Address ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠgroupId Ġ= ĠgroupId ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ