package Ġjp . co . sor am its u . runtime . extr insic Ċ Ċ import Ġjp . co . sor am its u . common . data . map pers . map Crypto Type To Encryption Ċ import Ġjp . co . sor am its u . common . data . map pers . map Signing DataTo Key pair Ċ import Ġjp . co . sor am its u . common . data . network . runtime . calls . Rpc Calls Ċ import Ġjp . co . sor am its u . common . utils . Suspend able Property Ċ import Ġjp . co . sor am its u . common . utils . network Type Ċ import Ġjp . co . sor am its u . core . model . Crypto Type Ċ import Ġjp . co . sor am its u . fe ar less _ utils . encrypt . Key pair Factory Ċ import Ġjp . co . sor am its u . fe ar less _ utils . encrypt . model . Key pair Ċ import Ġjp . co . sor am its u . fe ar less _ utils . extensions . from Hex Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . Runtime Snapshot Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . definitions . types . gener ics . multi Address From Id Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . extr insic . Extr insic Builder Ċ import Ġjp . co . sor am its u . fe ar less _ utils . ss 5 8 . SS 5 8 Encoder . to AccountId Ċ import Ġjp . co . sor am its u . feature _ account _ api . domain . interfaces . Account Repository Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . with Context Ċ Ċ private Ġval ĠFA KE _ CRYPTO _ TYPE Ġ= ĠCrypto Type . SR 2 5 5 1 9 Ċ Ċ class ĠEx tr insic BuilderFactory ( ĊĠĠĠ Ġprivate Ġval Ġaccount Repository : ĠAccount Repository , ĊĠĠĠ Ġprivate Ġval Ġrpc Calls : ĠRpc Calls , ĊĠĠĠ Ġprivate Ġval Ġkey pair Factory : ĠKey pair Factory , ĊĠĠĠ Ġprivate Ġval Ġruntime Property : ĠS uspend able Property < Runtime Snapshot >, ĊĠĠĠ Ġprivate Ġval Ġmort ality Constructor : ĠM ort ality Constructor , Ċ ) Ġ{ ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠCan Ġbe Ġexecuted Ġwith Ġar bit ary Ġaddress ĊĠĠĠĠ Ġ* ĠShould Ġbe Ġprimarily Ġused Ġfor Ġfee Ġcalculation ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġsuspend Ġfun Ġcreate With Fake KeyPair ( ĊĠĠĠĠĠĠĠ Ġaccount Address : ĠString , ĊĠĠĠ Ġ) Ġ= Ġcreate ( account Address , Ġgenerate Fake KeyPair (), ĠFA KE _ CRYPTO _ TYPE ) ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠRequire Ġaccount Ġto Ġbe Ġpresent Ġin Ġdatabase Ġand Ġhave Ġkey pair Ġsaved Ġlocally ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġsuspend Ġfun Ġcreate ( ĊĠĠĠĠĠĠĠ Ġaccount Address : ĠString , ĊĠĠĠ Ġ): ĠEx tr insic Builder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġaccount Ġ= Ġaccount Repository . get Account ( account Address ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsecurity Source Ġ= Ġaccount Repository . get Security Source ( account . address ) ĊĠĠĠĠĠĠĠ Ġval Ġkey pair Ġ= Ġmap Signing DataTo Key pair ( security Source . signing Data ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġcreate ( account Address , Ġkey pair , Ġaccount . crypto Type ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġsuspend Ġfun Ġcreate ( ĊĠĠĠĠĠĠĠ Ġaccount Address : ĠString , ĊĠĠĠĠĠĠĠ Ġkey pair : ĠKey pair , ĊĠĠĠĠĠĠĠ Ġcrypto Type : ĠCrypto Type , ĊĠĠĠ Ġ): ĠEx tr insic Builder Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnonce Ġ= Ġrpc Calls . get Nonce ( account Address ) ĊĠĠĠĠĠĠĠ Ġval Ġruntime Version Ġ= Ġrpc Calls . get Runtime Version () ĊĠĠĠĠĠĠĠ Ġval Ġmort ality Ġ= Ġmort ality Constructor . construct M ort ality () ĊĊĠĠĠĠĠĠĠ Ġval Ġruntime Configuration Ġ= Ġaccount Address . network Type (). runtime Configuration ĊĊĠĠĠĠĠĠĠ Ġreturn ĠEx tr insic Builder ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġruntime Ġ= Ġruntime Property . get (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġkey pair Ġ= Ġkey pair , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnonce Ġ= Ġnonce , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġruntime Version Ġ= Ġruntime Version , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġgenesis Hash Ġ= Ġruntime Configuration . genesis Hash . from Hex (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Hash Ġ= Ġmort ality . block Hash . from Hex (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġera Ġ= Ġmort ality . era , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġencryption Type Ġ= Ġmap Crypto Type To Encryption ( crypto Type ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaccount Identifier Ġ= Ġmulti Address From Id ( account Address . to AccountId ()) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġsuspend Ġfun Ġgenerate Fake KeyPair () Ġ= Ġwith Context ( Dispatch ers . Default ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcrypto Type Ġ= Ġmap Crypto Type To Encryption ( FA KE _ CRYPTO _ TYPE ) ĊĠĠĠĠĠĠĠ Ġval Ġempty Seed Ġ= ĠByteArray ( 3 2 ) Ġ{ Ġ 1 Ġ} ĊĊĠĠĠĠĠĠĠ Ġkey pair Factory . generate ( crypto Type , Ġempty Seed , Ġ"") ĊĠĠĠ Ġ} Ċ } Ċ