"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[2027],{676073(e,a,r){r.d(a,{f$:()=>b,kL:()=>m,sG:()=>g});var d=r(460714),s=r(614147),n=r(787916),t=r(973594),c=r(114328),i=r(818896);if(5864==r.j)var o=r(198589);var l=r(766527),f=r(916794).Buffer;let u="03752603a8131fd03fe726434e82a181c3a6bc227a44660ab774a482d29d1172c3",y="2b73df9ce5df820c728c8f77d51a72ec578e25c6a3c5e32b65fd43d2b4fb0e63",p=[{address:"0xF68464152d7289D7eA9a2bEC2E0035c45188223c",balance:null,index:0},{address:"0x9EE70472c9D1B1679A33f2f0549Ab5BFFCE118eF",balance:null,index:1},{address:"0x3185aC9266D3DF3D95dC847e2B88b52F12A34C21",balance:null,index:2},{address:"0x49EED7a86c1C404e2666Ac12BF00Af63804AC78d",balance:null,index:3},{address:"0x1d374341feBd02C2F30929d2B4a767676799E1f2",balance:null,index:4}];class h{async init(){return Promise.resolve()}}class b extends h{#e;constructor(){super(),this.#e={success:!0,payload:{publicKey:u,chainCode:y,address:p[0].address}}}async getPublicKey(){return this.#e}async dispose(){return Promise.resolve()}async ethereumSignMessage(e){let{message:a}=e,r=(0,s.personalSign)({privateKey:"d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3",data:(0,t.mu)(a)});return{id:1,success:!0,payload:{address:p[0].address,signature:(0,t.nF)(r)}}}async ethereumSignTransaction({transaction:e}){let a,r=Number(e.type);switch(r){case 0:a="muirGlacier";break;case 1:throw Error("Unsupported transaction type: EIP-2930 (type 1) not yet implemented in FakeTrezorBridge.");case 2:a="london";break;default:throw Error(`Unsupported transaction type: ${r}`)}let s=l.y.custom({chain:{name:"localhost",chainId:e.chainId,networkId:e.chainId},chainId:e.chainId,hardfork:a}),t=d.dF.fromTxData(e,{common:s}).sign(f.from("d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3","hex"));return{id:1,success:!0,payload:{v:(0,c.Q9)(t.v),r:(0,c.Q9)(t.r),s:(0,c.Q9)(t.s),serializedTx:(0,n.My)(t.serialize())}}}async ethereumSignTypedData(e){let a={types:e.data.types,domain:e.data.domain,primaryType:e.data.primaryType,message:e.data.message},r=(0,s.signTypedData)({privateKey:"d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3",data:a,version:s.SignTypedDataVersion.V4});return{id:1,success:!0,payload:{address:p[0].address,signature:r}}}}class m extends(5864==r.j?h:null){async getPublicKey(e){let{hdPath:a}=e,r=a.split("/"),d=parseInt(r[r.length-3],10),s=!isNaN(d)&&d>=0&&d<p.length?d:0,{address:n}=p[s];return{publicKey:u,chainCode:y,address:n}}async destroy(){return Promise.resolve()}async deviceSignTransaction({tx:e}){let a,r,s,t=f.from(e,"hex"),o=t[0];if(1===o)throw a=1,Error("Unsupported transaction type: EIP-2930 (type 1) not yet implemented in FakeLedgerBridge.");if(2===o){a=2,r=t.slice(1);let e=i.rlp.decode(r);s=(0,n.U8)(e[0])}else{a=0,r=t;let e=i.rlp.decode(r);s=(0,n.U8)(e[6])}let u=l.y.custom({chain:{name:"localhost",chainId:s,networkId:s},chainId:s,hardfork:2===a?"london":"muirGlacier"});if(0===a){let e=i.rlp.decode(r),a=d.cI.fromValuesArray(e.slice(0,6),{common:u}).sign(f.from("d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3","hex"));return{v:(0,c.Q9)(a.v),r:(0,c.Q9)(a.r),s:(0,c.Q9)(a.s)}}if(2===a){let e=i.rlp.decode(r),a=d.nx.fromValuesArray(e,{common:u}).sign(f.from("d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3","hex"));return{v:(0,c.Q9)(a.v),r:(0,c.Q9)(a.r),s:(0,c.Q9)(a.s)}}throw Error("Unsupported transaction type.")}updateTransportMethod(){return!0}async deviceSignTypedData(e){let{domain:a,types:r,primaryType:d,message:n}=e.message,c=(0,s.signTypedData)({privateKey:"d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3",data:{types:r,domain:a,primaryType:d,message:n},version:s.SignTypedDataVersion.V4}),{r:i,s:l,v:f}=o.splitSignature(c);return{r:(0,t.nF)(i),s:(0,t.nF)(l),v:f}}async deviceSignMessage(e){let{message:a}=e,r=(0,s.personalSign)({privateKey:"d41051826c32a548e55aa3e0dee93e96425b0f355df1e06d1595ed69385f8dc3",data:(0,t.mu)(a)}),{r:d,s:n,v:c}=o.splitSignature(r);return{r:(0,t.nF)(d),s:(0,t.nF)(n),v:c}}}class g{async requestScan(){return{type:"crypto-hdkey",cbor:"a503582103abc7af7fd5cd4fd1ec4c0f67f4bca461efb9dfc2578f8ed347d31201050377a0045820672f2b2bfda55552f56f5421d2bd106e55f2e94e73337d5f3f219906b39bfa4a06d90130a20186182cf5183cf500f5021a65174ca1081a65633532096d416972476170202d2074657374"}}}},766527(e,a,r){r.d(a,{y:()=>d});class d{constructor({chain:e,hardfork:a}){this.chain=e,this.hardfork=a,this.customCrypto={}}static custom({chain:e,chainId:a,networkId:r},s={}){return new d({chain:{name:e.name||"custom-chain",chainId:a||e.chainId,networkId:r||e.networkId},hardfork:s.hardfork||"istanbul"})}copy(){return new d({chain:this.chain,hardfork:this.hardfork})}gteHardfork(){return!0}chainId(){return BigInt(this.chain.chainId)}isActivatedEIP(){return!0}param(e){return({gasLimitBoundDivisor:1024,baseFeeChangeDenominator:8,elasticityMultiplier:2,maxPriorityFeePerGas:0,maxFeePerGas:0})[e]||0}}}}]);