import{a as r,m as c}from"./chunk-CVKDPNYM.js";var d="";function E(t){d=t}r(E,"setDerivationPath");function u(){return d}r(u,"getDerivationPath");import{ETHEREUM_CHAIN_ID as l,Networks as a,retryLazyImport as f}from"@rango-dev/wallets-shared";import m from"bs58";var y=16,p={21781:"The device is locked",25871:"Related application is not ready on your device",27013:"Action denied by user"};function A(t){return p[t]?p[t]:c(t)?c(t):`Ledger device unknown error 0x${t.toString(y)}`}r(A,"getLedgerErrorMessage");function g(t){return t?.statusCode?new Error(A(t.statusCode)):t?.code==="INSUFFICIENT_FUNDS"?new Error("Insufficient funds for transaction"):t}r(g,"getLedgerError");function N(){let t=new Map;return t.set(a.ETHEREUM,{chainId:l}),t.set(a.SOLANA,{chainId:a.SOLANA}),t}r(N,"getLedgerInstance");async function C(){try{let t=await w(),n=u(),s=new(await f(async()=>await import("./Eth-5PCPPYSI.js"))).default(t),e=[],i=await s.getAddress(n,!1,!0);return e.push(i.address),{accounts:e,chainId:l,derivationPath:n}}catch(t){throw g(t)}finally{await h()}}r(C,"getEthereumAccounts");async function D(){try{let t=await w(),n=u(),s=new(await f(async()=>await import("./Solana-NJS3LWGA.js"))).default(t),e=[],i=await s.getAddress(n);return e.push(m.encode(i.address)),{accounts:e,chainId:a.SOLANA,derivationPath:n}}catch(t){throw g(t)}finally{await h()}}r(D,"getSolanaAccounts");var o=null;async function w(){return o=await(await import("./TransportWebHID-JLT4ETY3.js")).default.create(),o}r(w,"transportConnect");async function h(){o&&(await o.close(),o=null)}r(h,"transportDisconnect");export{E as a,u as b,g as c,N as d,C as e,D as f,w as g,h};
//# sourceMappingURL=chunk-DCWKMLDG.js.map
