import{a as n,m as c}from"./chunk-CVKDPNYM.js";var d="";function A(t){d=t}n(A,"setDerivationPath");function u(){return d}n(u,"getDerivationPath");import{dynamicImportWithRefinedError as f,ETHEREUM_CHAIN_ID as l,Networks as a}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 E(t){return p[t]?p[t]:c(t)?c(t):`Ledger device unknown error 0x${t.toString(y)}`}n(E,"getLedgerErrorMessage");function g(t){return t?.statusCode?new Error(E(t.statusCode)):t?.code==="INSUFFICIENT_FUNDS"?new Error("Insufficient funds for transaction"):t}n(g,"getLedgerError");function N(){let t=new Map;return t.set(a.ETHEREUM,{chainId:l}),t.set(a.SOLANA,{chainId:a.SOLANA}),t}n(N,"getLedgerInstance");async function C(){try{let t=await w(),r=u(),i=new(await f(async()=>await import("./Eth-5PCPPYSI.js"))).default(t),e=[],s=await i.getAddress(r,!1,!0);return e.push(s.address),{accounts:e,chainId:l,derivationPath:r}}catch(t){throw g(t)}finally{await h()}}n(C,"getEthereumAccounts");async function D(){try{let t=await w(),r=u(),i=new(await f(async()=>await import("./Solana-NJS3LWGA.js"))).default(t),e=[],s=await i.getAddress(r);return e.push(m.encode(s.address)),{accounts:e,chainId:a.SOLANA,derivationPath:r}}catch(t){throw g(t)}finally{await h()}}n(D,"getSolanaAccounts");var o=null;async function w(){return o=await(await import("./TransportWebHID-JLT4ETY3.js")).default.create(),o}n(w,"transportConnect");async function h(){o&&(await o.close(),o=null)}n(h,"transportDisconnect");export{A as a,u as b,g as c,N as d,C as e,D as f,w as g,h};
//# sourceMappingURL=chunk-PVLX7NBP.js.map
