@rango-dev/provider-ledger 0.10.1-next.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as s,d as c,e as p,f as l,h as m}from"./chunk-2KLLAGCE.js";import{a as r}from"./chunk-CVKDPNYM.js";import{Networks as h,WalletTypes as d}from"@rango-dev/wallets-shared";import"rango-types";import{DefaultSignerFactory as u,TransactionType as g}from"rango-types";async function i(){let t=new u,{EthereumSigner:n}=await import("./ethereum-V2WNWA6L.js"),{SolanaSigner:o}=await import("./solana-GJWCIU6R.js");return t.registerSigner(g.EVM,new n),t.registerSigner(g.SOLANA,new o),t}r(i,"getSigners");var x={type:d.LEDGER},L=c,k=r(async({namespaces:t})=>{let n=[],o=t?.find(e=>e.namespace==="Solana"),a=t?.find(e=>e.namespace==="EVM");if(o)if(o.derivationPath){s(o.derivationPath);let e=await l();n.push(e)}else throw new Error("Derivation Path can not be empty.");else if(a)if(a.derivationPath){s(a.derivationPath);let e=await p();n.push(e)}else throw new Error("Derivation Path can not be empty.");else throw new Error(`It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${t?.map(e=>e.namespace)}`);return n},"connect"),M=r(async()=>{m()},"disconnect"),A=i,T=r(t=>{let n=[],o=t.find(e=>e.name===h.ETHEREUM);o&&n.push(o);let a=t.find(e=>e.name===h.SOLANA);return a&&n.push(a),{name:"Ledger",img:"https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg",installLink:{DEFAULT:"https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true"},color:"black",supportedChains:n,namespaces:["EVM","Solana"],singleNamespace:!0,showOnMobile:!1,needsDerivationPath:!0}},"getWalletInfo");export{x as config,k as connect,M as disconnect,L as getInstance,A as getSigners,T as getWalletInfo};
1
+ import{a as i,d as p,e as l,f as m,h as g}from"./chunk-2KLLAGCE.js";import{a as r}from"./chunk-CVKDPNYM.js";import{Namespace as s,Networks as u,WalletTypes as f}from"@rango-dev/wallets-shared";import"rango-types";import{DefaultSignerFactory as d,TransactionType as h}from"rango-types";async function c(){let t=new d,{EthereumSigner:n}=await import("./ethereum-V2WNWA6L.js"),{SolanaSigner:o}=await import("./solana-GJWCIU6R.js");return t.registerSigner(h.EVM,new n),t.registerSigner(h.SOLANA,new o),t}r(c,"getSigners");var L={type:f.LEDGER},k=p,A=r(async({namespaces:t})=>{let n=[],o=t?.find(e=>e.namespace===s.Solana),a=t?.find(e=>e.namespace===s.Evm);if(o)if(o.derivationPath){i(o.derivationPath);let e=await m();n.push(e)}else throw new Error("Derivation Path can not be empty.");else if(a)if(a.derivationPath){i(a.derivationPath);let e=await l();n.push(e)}else throw new Error("Derivation Path can not be empty.");else throw new Error(`It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${t?.map(e=>e.namespace)}`);return n},"connect"),N=r(async()=>{g()},"disconnect"),T=c,b=r(t=>{let n=[],o=t.find(e=>e.name===u.ETHEREUM);o&&n.push(o);let a=t.find(e=>e.name===u.SOLANA);return a&&n.push(a),{name:"Ledger",img:"https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg",installLink:{DEFAULT:"https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true"},color:"black",supportedChains:n,namespaces:[s.Evm,s.Solana],singleNamespace:!0,showOnMobile:!1,needsDerivationPath:!0}},"getWalletInfo");export{L as config,A as connect,N as disconnect,k as getInstance,T as getSigners,b as getWalletInfo};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/signer.ts"],
4
- "sourcesContent": ["import type {\n Connect,\n Disconnect,\n ProviderConnectResult,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\n\nimport { Networks, WalletTypes } from '@rango-dev/wallets-shared';\nimport { type BlockchainMeta, type SignerFactory } from 'rango-types';\n\nimport {\n getEthereumAccounts,\n getLedgerInstance,\n getSolanaAccounts,\n transportDisconnect,\n} from './helpers.js';\nimport signer from './signer.js';\nimport { setDerivationPath } from './state.js';\n\nexport const config = {\n type: WalletTypes.LEDGER,\n};\n\nexport const getInstance = getLedgerInstance;\nexport const connect: Connect = async ({ namespaces }) => {\n const results: ProviderConnectResult[] = [];\n\n const solanaNamespace = namespaces?.find(\n (namespaceItem) => namespaceItem.namespace === 'Solana'\n );\n const evmNamespace = namespaces?.find(\n (namespaceItem) => namespaceItem.namespace === 'EVM'\n );\n\n if (solanaNamespace) {\n if (solanaNamespace.derivationPath) {\n setDerivationPath(solanaNamespace.derivationPath);\n const accounts = await getSolanaAccounts();\n results.push(accounts);\n } else {\n throw new Error('Derivation Path can not be empty.');\n }\n } else if (evmNamespace) {\n if (evmNamespace.derivationPath) {\n setDerivationPath(evmNamespace.derivationPath);\n const accounts = await getEthereumAccounts();\n results.push(accounts);\n } else {\n throw new Error('Derivation Path can not be empty.');\n }\n } else {\n throw new Error(\n `It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${namespaces?.map(\n (namespaceItem) => namespaceItem.namespace\n )}`\n );\n }\n\n return results;\n};\n\nexport const disconnect: Disconnect = async () => {\n void transportDisconnect();\n};\n\nexport const getSigners: (provider: any) => Promise<SignerFactory> = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const supportedChains: BlockchainMeta[] = [];\n\n const ethereumBlockchain = allBlockChains.find(\n (chain) => chain.name === Networks.ETHEREUM\n );\n if (ethereumBlockchain) {\n supportedChains.push(ethereumBlockchain);\n }\n\n const solanaBlockchain = allBlockChains.find(\n (chain) => chain.name === Networks.SOLANA\n );\n if (solanaBlockchain) {\n supportedChains.push(solanaBlockchain);\n }\n\n return {\n name: 'Ledger',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg',\n installLink: {\n DEFAULT:\n 'https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true',\n },\n color: 'black',\n supportedChains,\n namespaces: ['EVM', 'Solana'],\n singleNamespace: true,\n showOnMobile: false,\n needsDerivationPath: true,\n };\n};\n", "import type { SignerFactory } from 'rango-types';\n\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default async function getSigners(): Promise<SignerFactory> {\n const signers = new DefaultSignerFactory();\n const { EthereumSigner } = await import('./signers/ethereum.js');\n const { SolanaSigner } = await import('./signers/solana.js');\n signers.registerSigner(TxType.EVM, new EthereumSigner());\n signers.registerSigner(TxType.SOLANA, new SolanaSigner());\n return signers;\n}\n"],
5
- "mappings": "4GAOA,OAAS,YAAAA,EAAU,eAAAC,MAAmB,4BACtC,MAAwD,cCNxD,OAAS,wBAAAC,EAAsB,mBAAmBC,MAAc,cAEhE,eAAOC,GAA4D,CACjE,IAAMC,EAAU,IAAIC,EACd,CAAE,eAAAC,CAAe,EAAI,KAAM,QAAO,wBAAuB,EACzD,CAAE,aAAAC,CAAa,EAAI,KAAM,QAAO,sBAAqB,EAC3D,OAAAH,EAAQ,eAAeI,EAAO,IAAK,IAAIF,CAAgB,EACvDF,EAAQ,eAAeI,EAAO,OAAQ,IAAID,CAAc,EACjDH,CACT,CAP8BK,EAAAN,EAAA,cDevB,IAAMO,EAAS,CACpB,KAAMC,EAAY,MACpB,EAEaC,EAAcC,EACdC,EAAmBC,EAAA,MAAO,CAAE,WAAAC,CAAW,IAAM,CACxD,IAAMC,EAAmC,CAAC,EAEpCC,EAAkBF,GAAY,KACjCG,GAAkBA,EAAc,YAAc,QACjD,EACMC,EAAeJ,GAAY,KAC9BG,GAAkBA,EAAc,YAAc,KACjD,EAEA,GAAID,EACF,GAAIA,EAAgB,eAAgB,CAClCG,EAAkBH,EAAgB,cAAc,EAChD,IAAMI,EAAW,MAAMC,EAAkB,EACzCN,EAAQ,KAAKK,CAAQ,CACvB,KACE,OAAM,IAAI,MAAM,mCAAmC,UAE5CF,EACT,GAAIA,EAAa,eAAgB,CAC/BC,EAAkBD,EAAa,cAAc,EAC7C,IAAME,EAAW,MAAME,EAAoB,EAC3CP,EAAQ,KAAKK,CAAQ,CACvB,KACE,OAAM,IAAI,MAAM,mCAAmC,MAGrD,OAAM,IAAI,MACR,2GAA2GN,GAAY,IACpHG,GAAkBA,EAAc,SACnC,CAAC,EACH,EAGF,OAAOF,CACT,EAnCgC,WAqCnBQ,EAAyBV,EAAA,SAAY,CAC3CW,EAAoB,CAC3B,EAFsC,cAIzBC,EAAwDA,EAExDC,EAAkEb,EAC7Ec,GACG,CACH,IAAMC,EAAoC,CAAC,EAErCC,EAAqBF,EAAe,KACvCG,GAAUA,EAAM,OAASC,EAAS,QACrC,EACIF,GACFD,EAAgB,KAAKC,CAAkB,EAGzC,IAAMG,EAAmBL,EAAe,KACrCG,GAAUA,EAAM,OAASC,EAAS,MACrC,EACA,OAAIC,GACFJ,EAAgB,KAAKI,CAAgB,EAGhC,CACL,KAAM,SACN,IAAK,uFACL,YAAa,CACX,QACE,uGACJ,EACA,MAAO,QACP,gBAAAJ,EACA,WAAY,CAAC,MAAO,QAAQ,EAC5B,gBAAiB,GACjB,aAAc,GACd,oBAAqB,EACvB,CACF,EAjC+E",
6
- "names": ["Networks", "WalletTypes", "DefaultSignerFactory", "TxType", "getSigners", "signers", "DefaultSignerFactory", "EthereumSigner", "SolanaSigner", "TxType", "__name", "config", "WalletTypes", "getInstance", "getLedgerInstance", "connect", "__name", "namespaces", "results", "solanaNamespace", "namespaceItem", "evmNamespace", "setDerivationPath", "accounts", "getSolanaAccounts", "getEthereumAccounts", "disconnect", "transportDisconnect", "getSigners", "getWalletInfo", "allBlockChains", "supportedChains", "ethereumBlockchain", "chain", "Networks", "solanaBlockchain"]
4
+ "sourcesContent": ["import type {\n Connect,\n Disconnect,\n ProviderConnectResult,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\n\nimport { Namespace, Networks, WalletTypes } from '@rango-dev/wallets-shared';\nimport { type BlockchainMeta, type SignerFactory } from 'rango-types';\n\nimport {\n getEthereumAccounts,\n getLedgerInstance,\n getSolanaAccounts,\n transportDisconnect,\n} from './helpers.js';\nimport signer from './signer.js';\nimport { setDerivationPath } from './state.js';\n\nexport const config = {\n type: WalletTypes.LEDGER,\n};\n\nexport const getInstance = getLedgerInstance;\nexport const connect: Connect = async ({ namespaces }) => {\n const results: ProviderConnectResult[] = [];\n\n const solanaNamespace = namespaces?.find(\n (namespaceItem) => namespaceItem.namespace === Namespace.Solana\n );\n const evmNamespace = namespaces?.find(\n (namespaceItem) => namespaceItem.namespace === Namespace.Evm\n );\n\n if (solanaNamespace) {\n if (solanaNamespace.derivationPath) {\n setDerivationPath(solanaNamespace.derivationPath);\n const accounts = await getSolanaAccounts();\n results.push(accounts);\n } else {\n throw new Error('Derivation Path can not be empty.');\n }\n } else if (evmNamespace) {\n if (evmNamespace.derivationPath) {\n setDerivationPath(evmNamespace.derivationPath);\n const accounts = await getEthereumAccounts();\n results.push(accounts);\n } else {\n throw new Error('Derivation Path can not be empty.');\n }\n } else {\n throw new Error(\n `It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${namespaces?.map(\n (namespaceItem) => namespaceItem.namespace\n )}`\n );\n }\n\n return results;\n};\n\nexport const disconnect: Disconnect = async () => {\n void transportDisconnect();\n};\n\nexport const getSigners: (provider: any) => Promise<SignerFactory> = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const supportedChains: BlockchainMeta[] = [];\n\n const ethereumBlockchain = allBlockChains.find(\n (chain) => chain.name === Networks.ETHEREUM\n );\n if (ethereumBlockchain) {\n supportedChains.push(ethereumBlockchain);\n }\n\n const solanaBlockchain = allBlockChains.find(\n (chain) => chain.name === Networks.SOLANA\n );\n if (solanaBlockchain) {\n supportedChains.push(solanaBlockchain);\n }\n\n return {\n name: 'Ledger',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/ledger/icon.svg',\n installLink: {\n DEFAULT:\n 'https://support.ledger.com/hc/en-us/articles/4404389606417-Download-and-install-Ledger-Live?docs=true',\n },\n color: 'black',\n supportedChains,\n namespaces: [Namespace.Evm, Namespace.Solana],\n singleNamespace: true,\n showOnMobile: false,\n needsDerivationPath: true,\n };\n};\n", "import type { SignerFactory } from 'rango-types';\n\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default async function getSigners(): Promise<SignerFactory> {\n const signers = new DefaultSignerFactory();\n const { EthereumSigner } = await import('./signers/ethereum.js');\n const { SolanaSigner } = await import('./signers/solana.js');\n signers.registerSigner(TxType.EVM, new EthereumSigner());\n signers.registerSigner(TxType.SOLANA, new SolanaSigner());\n return signers;\n}\n"],
5
+ "mappings": "4GAOA,OAAS,aAAAA,EAAW,YAAAC,EAAU,eAAAC,MAAmB,4BACjD,MAAwD,cCNxD,OAAS,wBAAAC,EAAsB,mBAAmBC,MAAc,cAEhE,eAAOC,GAA4D,CACjE,IAAMC,EAAU,IAAIC,EACd,CAAE,eAAAC,CAAe,EAAI,KAAM,QAAO,wBAAuB,EACzD,CAAE,aAAAC,CAAa,EAAI,KAAM,QAAO,sBAAqB,EAC3D,OAAAH,EAAQ,eAAeI,EAAO,IAAK,IAAIF,CAAgB,EACvDF,EAAQ,eAAeI,EAAO,OAAQ,IAAID,CAAc,EACjDH,CACT,CAP8BK,EAAAN,EAAA,cDevB,IAAMO,EAAS,CACpB,KAAMC,EAAY,MACpB,EAEaC,EAAcC,EACdC,EAAmBC,EAAA,MAAO,CAAE,WAAAC,CAAW,IAAM,CACxD,IAAMC,EAAmC,CAAC,EAEpCC,EAAkBF,GAAY,KACjCG,GAAkBA,EAAc,YAAcC,EAAU,MAC3D,EACMC,EAAeL,GAAY,KAC9BG,GAAkBA,EAAc,YAAcC,EAAU,GAC3D,EAEA,GAAIF,EACF,GAAIA,EAAgB,eAAgB,CAClCI,EAAkBJ,EAAgB,cAAc,EAChD,IAAMK,EAAW,MAAMC,EAAkB,EACzCP,EAAQ,KAAKM,CAAQ,CACvB,KACE,OAAM,IAAI,MAAM,mCAAmC,UAE5CF,EACT,GAAIA,EAAa,eAAgB,CAC/BC,EAAkBD,EAAa,cAAc,EAC7C,IAAME,EAAW,MAAME,EAAoB,EAC3CR,EAAQ,KAAKM,CAAQ,CACvB,KACE,OAAM,IAAI,MAAM,mCAAmC,MAGrD,OAAM,IAAI,MACR,2GAA2GP,GAAY,IACpHG,GAAkBA,EAAc,SACnC,CAAC,EACH,EAGF,OAAOF,CACT,EAnCgC,WAqCnBS,EAAyBX,EAAA,SAAY,CAC3CY,EAAoB,CAC3B,EAFsC,cAIzBC,EAAwDA,EAExDC,EAAkEd,EAC7Ee,GACG,CACH,IAAMC,EAAoC,CAAC,EAErCC,EAAqBF,EAAe,KACvCG,GAAUA,EAAM,OAASC,EAAS,QACrC,EACIF,GACFD,EAAgB,KAAKC,CAAkB,EAGzC,IAAMG,EAAmBL,EAAe,KACrCG,GAAUA,EAAM,OAASC,EAAS,MACrC,EACA,OAAIC,GACFJ,EAAgB,KAAKI,CAAgB,EAGhC,CACL,KAAM,SACN,IAAK,uFACL,YAAa,CACX,QACE,uGACJ,EACA,MAAO,QACP,gBAAAJ,EACA,WAAY,CAACX,EAAU,IAAKA,EAAU,MAAM,EAC5C,gBAAiB,GACjB,aAAc,GACd,oBAAqB,EACvB,CACF,EAjC+E",
6
+ "names": ["Namespace", "Networks", "WalletTypes", "DefaultSignerFactory", "TxType", "getSigners", "signers", "DefaultSignerFactory", "EthereumSigner", "SolanaSigner", "TxType", "__name", "config", "WalletTypes", "getInstance", "getLedgerInstance", "connect", "__name", "namespaces", "results", "solanaNamespace", "namespaceItem", "Namespace", "evmNamespace", "setDerivationPath", "accounts", "getSolanaAccounts", "getEthereumAccounts", "disconnect", "transportDisconnect", "getSigners", "getWalletInfo", "allBlockChains", "supportedChains", "ethereumBlockchain", "chain", "Networks", "solanaBlockchain"]
7
7
  }