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