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