{"_id":"@ledgerhq/connect-kit-loader","_rev":"42-55981b2c97f52d4a82b50617ccef9b32","name":"@ledgerhq/connect-kit-loader","dist-tags":{"beta":"1.1.1-beta.1","latest":"1.1.8"},"versions":{"1.0.0-beta.2":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.2","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.2","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"e40eb4f942f62ef46ae45f522d37ba2d55ea2990","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.2.tgz","fileCount":9,"integrity":"sha512-Vqpo5XmLAldXXJTLlTG4x9/srZy6hGmJrrpq4GvIixAn9Y7ZcpqlJuU4LjCWHpd94ZGOyRXKk8pImJLGWcGiQQ==","signatures":[{"sig":"MEUCIBQkNqT5xF86/y0YlxC5EMJoTPXB3WgIwOCnnDbBWGRoAiEAjz4Zn93aDr5AqhUwTHl/G/CI7GVO0r29jcnIaXj3VjM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW/SXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqcow/8Caz+3JOWYEPpYWUbQKf2RU1tGGOoY8rRoA1Xk27Tf5T+iyqT\r\nFRICSK+apVBy+h1qZzWM0gpT7y5+vrl/jTyB319rkuOUA4x2QR+ytkvTGfTx\r\nUDaCX7jJ+SQPPV8A1Va76czZsWRfTjHkwsYX7jv9kPcqqBE3CnXLiTr4IIpd\r\nzCKT74hwN1VQDrvdbi4kgaE9Tf6kkhFiUJgMMoDJoLuaT0Ixu7fmm/hmsjeA\r\n6eAbfu9+KyHxwEau2Ko7FBKE3MFZtgSvN93lJE5fZB83xtFwN+j2kNnSkMp1\r\neZI3Us4xy9HMej8WHZZWFicWsPY0Y9006nPrgENTLRoNUofghIUf7DOPmgoH\r\nhRnf6ukEIgad7A1qud96ZgM5kl9tIgueGoTaemk/kD3r5kfwWvLChYXwXqb2\r\nuqibngWZkpU3dhS2Fu9lyrPkxAHhtC7k11zkoMiSD4Kw/VxvbkhqZdBDSUQ9\r\nK0rPKJ62/RVAlYcnarBoEYYix3mqu+xacV/qnNaO1lDz5OdKIlIIaGrlk6zA\r\n9h3nog7AGuFcjHLnsTh+kNZA9g9e2Dn+l4XTxfusAsPDQ83iJidPTp0s0Rb2\r\nwJ24TPRNK1ejzaiPRuBSKvq/SQuCbxffv+8YF5VjG/CShXgoQEf4Dxw4K324\r\nm8sPuSzbfD/o7VrorG6plKQiIuvy8cmukSw=\r\n=guD6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"dependencies":{"@rollup/plugin-alias":"^3.1.9"},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.2_1666970775479_0.6021576991411672","host":"s3://npm-registry-packages"}},"1.0.0-beta.3":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.3","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.3","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"6b3cdcf87e79eedb1364ee18398b89c91d043e6e","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.3.tgz","fileCount":8,"integrity":"sha512-1ysAze8UQatiKc9AirsoAzcPgW4V8siRgRoJjzxNGak3oaUBEgX+NBvai7ACLseQwziCqxXWMkOK2KizEACUQA==","signatures":[{"sig":"MEUCIQCtWCZdJeSYRga/hzeW8uypQYjDZVrqcp9MKNOLPmvP3gIgMOuEICx/NzbkadB1BMPkXNzczhxTjCd9th1DqIXwybI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYUctACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+hQ/9FQCwK0Ews+OJRtyG33DCG2BMP1RPADk8i8pEj0RGuLtyHASm\r\nUNYpovYnbuCLPSHvdDDaP1IqE792VONRLk+R/0a3gal4yIW+YKsc3uOxAUX4\r\nshraqGcErINpHeOLjIh0GS2YoEaAj+n2VymN9Aqp8yTsk+i55QFxMHkz1Eik\r\nOYc6GuCeP7lkItu9xkaJsHcxDzdsS1j6PTKKemzk3tKvXkUSU2BZKxSAeSIW\r\nH6dwHL//Q+m6CixErNrXvxWEaRo1yP8MxAoax2xd1W9r19cmPfZ2Uwf8MdCJ\r\nOBZMbHTyxrvdDfx9qitBxLQ+WEv6Vhy59/bjL9BMhO5TzR+W15zEsPSxbtyO\r\nb96IbUN5XLAQgMTIaURuVDA7i199p1p0GypWbFeTPhul/q1CseDvru8PuBBx\r\nZRIpj270muoxB7+ZujtWrtrM15nTcvhVXvO/6tbKLvGPP4XQ0HieC897+mt7\r\nSK2Tdi48sCC2oH52sllUcH6Am+ii3cWY2+HpOqE5pg0cRKu74HwhAjcKAP7n\r\nJUX8NV6rXGC8viKI70sNaWnzpscJhLi1R7rKl+AYO9sCfZQZKNLUJ2w8m/iO\r\nlSk9ScclxYHWiKSRxK5kHsGWTgnYUG1YcSiX+B8upYgtzL8aycoB7vl3CB+D\r\nME5PoRg20yNaNAy0Wsl8TAxYrERejTiCsew=\r\n=CoWk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger Connect Kit can be used to check the level of support for [Ledger\nConnect](https://get-connect.ledger.com) on the user's platform. We will guide\nthe user to install Connect or use a fallback connection to the Ledger Live\napp. The code is designed to be loaded at runtime from a CDN so that the logic\nand UI can be updated as we release new updates to Connect without the wait for\nwallet libraries and dapps updating package versions and releasing new builds.\n\nThe `@ledgerhq/connect-kit-loader` allows developers to consume Connect Kit in\na transparent way.\n\n\n## Support status\n\nLedger Connect is currently only supported on Safari iOS. There are two edge\ncases in the detection logic:\n\n- Safari on iPadOS is shown as supported if the user requests the mobile\n  website, as it sets the userAgent string to be the same as iOS, otherwise\n  the userAgent string is the same as Safari on MacOS, which is not supported\n  yet.\n- Brave on iOS is shown as supported because it sets the userAgest string to\n  be the same as Safari on iOS, but Connect will not work.\n\n\n## Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an example\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      // load Connect Kit, check support and show a UI modal if not supported\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the console in case you need to diagnose a possible\nproblem. Just reload the dapp to disable them.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the messages.\n\n### `checkSupport`\n\n#### Parameters\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  chainId: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nLets you know the level of support for Ledger Connect on the user's platform,\nand shows a UI to guide the user.\n\nIf the Connect extension is installed and enabled you will just get the response\nand no UI will be shown. If Connect is not available on the user's platform one\nof these modals will be shown:\n\n- Try Ledger Connect, in case the user's platform supports Connect but\n  it is not installed or enabled; a button will be shown to let the user\n  install the browser extension.\n- Connect with Ledger Live, in case the user's platform does not support\n  Connect they will be able to use Ledger Live Mobile or Desktop to connect.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider | SolanaProvider>`\n\n#### Description\n\nBased on the options passed to `checkSupport` it returns a promise to a Ledger\nConnect Ethereum provider, Ledger Connect Solana Provider or a WalletConnect\nprovider.\n\n### Example\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setLibrary`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to keep app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      chainId: 1,\n      providerType: SupportedProviders.Ethereum,\n      rpc: {\n        1: `https://cloudflare-eth.com`, // Mainnet\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      }\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n    const provider = await connectKit.getProvider();\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const accounts = await library.listAccounts();\n    const network = await library.getNetwork();\n\n    setProvider(provider);\n    setLibrary(library);\n\n    if (accounts) setAccount(accounts[0]);\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.3_1667319597456_0.18531933059286487","host":"s3://npm-registry-packages"}},"1.0.0-beta.4":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.4","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.4","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"c29d8b1a8dc4b0d179ac740f13379a024f2b2893","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.4.tgz","fileCount":8,"integrity":"sha512-qfGhkrPjTlXMQLI3+jj/KyHObn6BRjVRWlckndj9NCsjJJmUHvtFa8f3eV8czf5TvujXkDejpK1boNzCMV/3Jw==","signatures":[{"sig":"MEYCIQD0J+xib86jvyAa6NaOE3kOP8JuK3qujbiocLdK1eFeXAIhAKrPYud9D84HpOIoofFO8nXk6rzkF8bGwaVfbB+czPob","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYZWHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaqA/7Bsbmv1szl5yNcfLNlm3mF8WuYNlT30oSchX+WlFhYR6gvewW\r\na460oBpoOgYKC545p9Va12SYMPVUDFsZeyA0kxOSfV3mdPuBVQaEojRz28kk\r\nx6PCThRdCHXDLCYA3n+2IgzamWGpEhwkCimGFkoWDqpv1T3M3WdpTC68jZmD\r\nevkqE8vxdUePDafRB5klJ3LYSaAltKkxqaSC6S77SWtQYzeaZRnHwEv2JP8o\r\nUdHLPJAWl7atx3KaGgFfOF0i55HVNk/HP+FR9/P0dMnmunBL7EBUvz6lx89F\r\nv+T2BcDiEBT5tc/kVNeFpnJyYSNnR0viJ3IiOrio0PK/+FhFHNwp5n+82O99\r\nJO1vNuU74ecbUbZdsYR5g6/k4yoGSvq5Dyel65ZDGTh7Gc5oVYTp5VQ9iPh3\r\nl8//z+Pxcdu7POi2JIttkpGmigbWSmiIkL95G9uNU5B3k9DdN9m+d60M5bSb\r\nEXdp5tKiop2RhDy/cOFxBlIFKy6EBRYrqdfpqK+QP+qM+jIp2wAQ+sYOJe1t\r\nMd8LOrrc0LYhXWGpx+bxyo1CrNmPytTG8EFPL+JBcstBo2/b9eedNLvx1CF5\r\n3tOkCMgjnPxuxJHRiTST2ENMzmtSTlbD/A/p696roJNKY1M04AegCdE52mgN\r\nFRp4yxTkUpOg/rUgHAPRRQHfafEtIeaUs1k=\r\n=sN2c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.4_1667339655586_0.3930671824380274","host":"s3://npm-registry-packages"}},"1.0.0-beta.5":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.5","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.5","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"af8534468aabb6128b9637fcd5a3ade4c170b23a","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.5.tgz","fileCount":8,"integrity":"sha512-zNO6GktIjiec5JEgLirxPqSvJf9ZldCNXj6FbsTRO+B8ynYOE5+RUv90CvLwCA/GZLhtrXsczmz2fX0vxjknWQ==","signatures":[{"sig":"MEUCIQDjVjKkGxdrt7lfkBiAn1KkmRu55c/a78F/TsHqEhfPkgIgbN1CeKVhf8m5Jr13fA8kAMKHGdq0UkRyW0IS2k/uCAk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbTLzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz0BAAgplZmz8ZK3Gs87azcDvJ1Ii0lqHU3vQWVtz/UzRxC2HVFqCk\r\nn9wwAqGqREfjXRtwZ2TuXfYCKyH6UkfzK/EzXimGOwMgS/kz/a4DUYqE7l+O\r\n/0x1DHKwMXaApu+VzTZ1HsWusZidMonDDVCKtxmAPhMTJnoVbeG51h/5FV2V\r\nr3wUyndqDtd0CZyIrKF/+8wc6bPSQTSc4+mZroNvq2gR1PmccK+bsqi5pi35\r\nqP1JUKvyTy0kQA5NRcSjNNQX4zLZ5ZNa0bw+acqjQNJqJXNhqT7Y0sMOg/Ai\r\nQqsznRppBTgnEwHbaSU8b5ReXlO3LwsI5CvnaR6Ll2e/r8rKYnEeAQh5ws0N\r\n/sOYn+ReUzmcZbhbAfQO21oZl9I6GMkxeSvEG99/4yqswkPYWleEZhANZn6y\r\nb/AcV2RnKMJiG+BOiBjt15VXxHQNu/ZAThAzsNakOE/c90mAwEPj9RDNbCFE\r\nFR6aeO7KmjP0tYVrx5hw8URmEERdqvNIxNivqGWsCiqIhGWnv09xJdorrzgz\r\nOuYKPfrl47HIVplsetnvx9egiMTCSsztd0LOYI/ZUCJxB6c3Ng+pPqHje5yA\r\nt3qsYJqHZ/zTqiZaFYi7bE/G89Ys6aNR0aBGI67saDwb4HfNhfcI7B9+Pgiv\r\nfXD+gD/xSLBfXJtYwP7J2zWXi1J8aZfISnM=\r\n=2dDB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.5_1668100851717_0.7418720670742389","host":"s3://npm-registry-packages"}},"1.0.0-beta.6":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.6","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.6","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"9c8f498b53bf39d428ee03c0bbbfe292be6012ca","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.6.tgz","fileCount":8,"integrity":"sha512-wb9sG9GFQw/TDqh1LRJeXxwsKoD55dXw2+HWYWoMTGApfLtK4YTzPar3k7SDMk5eC+MU/+kziuaSo3JCxynRrg==","signatures":[{"sig":"MEQCIDAkaIaOYQASFuF7rdjpW28lZ5cfTpLmuCFrAdUwlAREAiAdGAP4h+4v/RwB6RAI3RDcN0FXsDAjFII55ndPa+5Pgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcnxZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoezQ/8DPQIW21vndWZ/LCxPHLEu6rcGcEHpvjUYKdIVHGT9RhLlCt4\r\nf0mYXHM2Fjmp/vbjfbdAu6BZB/N78vPqdXuOWpYE3aZzSjbHgAnz9b3LFHOT\r\nCJkZuR30XTbtkiMvrKXLhJSvoFBHjtKbT80ZXDL9QWD2NyomiUnKO3WtwSq+\r\nQqVgDROap5KorQ5itoVGK0aEuDfHvKbiIDxppi77Ra7ZfNHX7e3ZIDnRjCgr\r\nzZGt07uwLJDxYVlfc16pSlL8Cdh4KwTOJZgVbihAFXMd9sjqpNBWV0i0PS9U\r\nwJjXULBadwUAzDsBI3akbT7VAXcYCo8vvHidZ6Ni3KSTOWe1GPLGnv4UM+Oh\r\nXICOVF8WShkBWQqs40vgyThX+VYgO9cJYAJ6LKjyASxgXnvm6O6LaielKBDI\r\nrWzFA9GixnTZ5+yhWicpOOwrI8UJYnrY702AejRUrEAigAfk5QvoJ08354Sr\r\nJo7UGDDglaAJtsNZhuTQzXxgdMu37Ap1crAJUAjwyr84ub9qtKzj34jrjrst\r\nori/u0VogY2kOpPsxIRQjUjWG+N77CXRggujEGEs7Q/2U0Jw32RpWbinTi54\r\nGfpJ3DyxcLX+uX72KFj/CIVAkwW9jEFLUI61BLeEz0+tGQjvzGjhbEUhoLQ6\r\nHNBYLYnxaRI6PZ+Yb9y0koDKTTjCdfdxUOI=\r\n=0EMJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.6_1668447321790_0.047013014523345165","host":"s3://npm-registry-packages"}},"1.0.0-beta.7":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.7","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.7","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"9e5e6052806339b63d532552b0c6c28c82ddb320","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.7.tgz","fileCount":8,"integrity":"sha512-3iBmTjEv6LKMxMCM+srjq3HWFRtiFIaUw03BFvoz9oOnSALXqrj7d9rTaRa5TUTVG+kMq9/g4SckJh8faOy7eg==","signatures":[{"sig":"MEYCIQDadrUmBgxyN508NfXJonkRld6kWIB0ruP47uSugrshXwIhALWHnp1yUrPVhjIqhf3WFGuP82K88/qKxRzsiUXr81k4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc4ngACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDHw/9F9a0oAPTaKY/0KBT6HFKrrNcdsWKw4D7mRitrQYjT8RRI7Mw\r\nGNzTtcwR2Qal8NGPPcBQ4blGmk2W0BHufJPwwKcQiCgjl/NkVQTvZ7M6jVJe\r\n3m9MJQG76nzJoi3u4JrvNAQnwSNCjZteFOUNjEhYxoe/UBUGiI0TKv8UipsH\r\nvzkXpFYMOnqS8WQXtPO58j8Selo9uDZaACiEOb9Lbb7vtZWeG8vGt5WpIUQL\r\nc0ZF5VtBG5Depu9p/ROzs/O5BSeBWiff2siLb7ERb2/ko7UVO0AGWLuIlDPa\r\nJ7Nyne91ZUeZk2Cm9nwXKkfDzz2TXQn3ivxUpc6w/h+vfgaDWE0ISfb8QwUO\r\nuc1f5lNRzCE7CfpBNERA3pi8nZBa0Uu+lwtQu/eY5aXoAXNFWTyfNWxSbiIz\r\nF8cYHrccuQsMmyYIOgmcXbm9vIXbcO7RaoBLSdT5WrZ2I8/gUwGR+7xenPor\r\ni6z/xCU5GxvuKlnCXapQi61bptYIserkV/gAB4vQ911guu4GfUVAHGy54LMT\r\no+N8/KCnrnHtIBlGyxDPKSgVLqtIlgIU3+KwqK+ATCLQEorrv7i7B4kI+IV1\r\nVkMFZEdb5RTDlPEEJKezJtJAJ2notsrVlGy2xG0XQPQX+1mgJoGWKScocul9\r\nbw0XBHln5O5GgCsZCzexZHS5Rd7zse6nvts=\r\n=0Cb5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.7_1668516320064_0.14164225896237426","host":"s3://npm-registry-packages"}},"1.0.0-beta.8":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0-beta.8","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0-beta.8","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"682be1a5bb88f1a51b4b61df33dc48da609618a7","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0-beta.8.tgz","fileCount":8,"integrity":"sha512-n18STEdj62izrZjOi5spyIlsEMtVTbYpA1RfqRwW6TkQupjvteB0TbeE0/+tJ4x/I8CzsA4Ej0ZF4G0GphTpUw==","signatures":[{"sig":"MEUCIAvVYeRItWHpDfdHsoNb0kuYzz+N2Z92oDZMmG7zICg5AiEA9LL1S5GBgAX5/ZChL+EulXYWX3u0ze1V2GIhkiIHJ7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdhQUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqX6Q/8C2QnxPLQsNw5oJQoGwib8ebse32wBSYtgHKV3k1tqWuIfmAT\r\nAgVv4p/+2G4UzN4sVqEH5avnyDolWr/jdm0bWUI3vAR3o/F2MSVAKWyWbrVv\r\nuTSTVmeGvm8JXsKp2hcFg6pNE9fv08YPsOj4l3zBPBaF4moB/YJb/NvFitrj\r\n74f4sAZg5Px6gWdKl7YWKjQOjLXgNPbqL7Vv7IUFy9JrYxfbzGUmaiTOQl2e\r\nR6xedGa6zbGQcv+kzjAu2/Mfgv1bLx0WoXDuKb1rcTGeCj8CXvjmc06XRSIU\r\nxoe4cM4T200yyxv1L9QRNdVWq031yfdd3wy6bf0Y9ODsdRwAyuP6s01M/7q3\r\n8ux4K+/x9tA7mRAv2z+AQbxMpbzK92BZPKM/Wn5TX2Ne+qpTIBfytqywNZxw\r\n4kcJQRjCGV2TyKGJDiw2pP8mHvc8DJjQRafW4FHIL/D+1wTjpObd/+rmKNOP\r\njRoTVU10gTNJve6HmM8qDWZzbm1bxNeQa32wEnrDZXvkdvs1/Yjd21JoYneb\r\n2CYjloWC5+tijjmd+izGGR0o5F31FeOyTLKuErEzwiZGZER/e3Nz4yYtjpCE\r\nJYCe4Y0XfXsQFdUz9YkpG1HlsQlDRAAksYrR88vdGtqi+yhAd3bN0obiytCK\r\nS4yFmiHyrOTZsDzhXxxhZWUw+eKYqfTDubM=\r\n=EYEQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger Connect Kit can be used to check the level of support for [Ledger\nConnect](https://get-connect.ledger.com) on the user's platform. We will guide\nthe user to install Connect or use a fallback connection to the Ledger Live\napp. The code is designed to be loaded at runtime from a CDN so that the logic\nand UI can be updated as we release new updates to Connect without the wait for\nwallet libraries and dapps updating package versions and releasing new builds.\n\nThe `@ledgerhq/connect-kit-loader` allows developers to consume Connect Kit in\na transparent way.\n\n\n## Support status\n\nLedger Connect is currently only supported on Safari iOS. There are two edge\ncases in the detection logic:\n\n- Safari on iPadOS is shown as supported if the user requests the mobile\n  website, as it sets the userAgent string to be the same as iOS, otherwise\n  the userAgent string is the same as Safari on MacOS, which is not supported\n  yet.\n- Brave on iOS is shown as supported because it sets the userAgest string to\n  be the same as Safari on iOS, but Connect will not work.\n\n\n## Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an example\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dapp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  chainId: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nLets you know the level of support for Ledger Connect on the user's platform,\nand shows a UI to guide the user.\n\nIf the Connect extension is installed and enabled you will just get the response\nand no UI will be shown. If Connect is not available on the user's platform one\nof these modals will be shown:\n\n- Try Ledger Connect, in case the user's platform supports Connect but\n  it is not installed or enabled; a button will be shown to let the user\n  install the browser extension.\n- Connect with Ledger Live, in case the user's platform does not support\n  Connect they will be able to use Ledger Live Mobile or Desktop to connect.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider | SolanaProvider>`\n\n#### Description\n\nBased on the options passed to `checkSupport` it returns a promise to a Ledger\nConnect Ethereum provider, Ledger Connect Solana Provider or a WalletConnect\nprovider.\n\n### Example\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setLibrary`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to keep app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      chainId: 1,\n      providerType: SupportedProviders.Ethereum,\n      rpc: {\n        1: `https://cloudflare-eth.com`, // Mainnet\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      }\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    setLibrary(library);\n\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0-beta.8_1668682772811_0.06956275175092208","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.0","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.0","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"94e846537adbec6e19546583626b35b9d508cc0b","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.0.tgz","fileCount":8,"integrity":"sha512-TQnVSwg8WKUx5WUQtGKJurFpnpeaVHmJfKdElVMBgccfHska6+4XA+554NjHQ46GvI/V0wknFShnudTRqc5JXg==","signatures":[{"sig":"MEUCIG9YYH6o5W0p2R+/SSDylc9JJTUfWWu2P6s3mVqtXb/gAiEAmQdwtQiM/rbOrEtKbnmpHCcb+unnNuah/rYWZHcTtz8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdjAsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5GA/9GajwQMeeTkKTydnKq0swU0f6JGrcXUKqrS4IlZxR7USxQcOW\r\neZxRvqtY5kEpl/2HZsBoWafk9nWdVBwLBIum6n7DFrXks+fa8Kes41r0Nj0q\r\nfSOyhB5h1a981bWLFSWbhSObpB3noRfq7b/jYrWNNbojYqcuozXtzkAI/Wa/\r\nQUqixQa0F3ILJCFyjqdUYC8WbPucsL6JXHjj92EGM/R2xc4dAMolW0PLKUgf\r\n4h7letgeMi4BkviLF8t1njhCQyWPZB/ZSUlJWFvbk5wdzbEtnrxRxpEw0Okj\r\nuyaNgPl/kcLx1mqF0CLNP1s61I8rFtwg2JNJVRg8rg+rcMSAs2AKeL95zPcr\r\nURSO4XbLFj6idac5nflunZSDha35K+x9abZxrOozAc7TgydzMM/OwGJEpU1B\r\nNCqmziwjHOJTkolqUysKjOkhAXwXCfbU7NjISKpP7WjflSkXIsoSm/t3hlp+\r\ndJX/V77a86it02yMIkbfc7UY4jwWDKtfyuE/4ATXGFIRip5FqTVDYpN2O+Ve\r\nNUctWxovbHdRGeM2SMjY1b929gt4TZkf8wit0r7ciiOAMQkYPoACdae0KuUe\r\nMZwRG1FQJSyBQeii0oiXiE8gdlSiDXdTX/h+G+H3+PDmIGQz854B1sjhTi63\r\n5mcSBjGgJCRJDxLq4F1KbWEm8flEkkrHkSQ=\r\n=Asir\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.0_1668689964354_0.29231967784213286","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.1","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.1","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"fce00582e92b666c8b33d4e5ec4f52c2e05c7e46","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.1.tgz","fileCount":8,"integrity":"sha512-OAJh9rMaypS1ttrSMwPznXqglJGcP3WPTTgz9YAKfkaMyUtZcHx7hCj4d6f7DdSVZOgWcyEYfZ8M2QrA2gtvgQ==","signatures":[{"sig":"MEUCIQDjDx0z2MLSyvw2n7Eab+EFhQJWt2Dxy/WF1yKHZxV1fwIgWaygQ2uGT/K1PPd/kEas9sLAbmi0QfVlTfRVuoe1WJ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmYxyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCag//Z5lNQjv63QY0oFu8IPc1aoHWWLytNEEoJJtM/6gR7rUdstIr\r\nyhNeP0SkxEpoEwjx5yxIahrVnrZc77XfaC2RZ4I87tJemcY5l3hAmri57nKW\r\nhU6vr5Yt5lfCSd2YEBjdojaXEC4PHpefOk/hdsGq3wgKZL3APCKODBljDPJ7\r\nLtWs1BzxyHBizd1YI6lK5lDkvg2H85pAdSMFlHW1bznVlagjuMlG9BDrCUjZ\r\nOupnttGYhViy2VFSAnSxuY9IeZop9gy4Nr3ErE1QRbgrVeN/nhXtiJU3zy/P\r\nTTNMGPCawmSabQ4qsz96lgBm6inkhjlTSEyHJJmfVS9UyW9rOZMaYXzBFdO4\r\nYjaK56A6o3JUnVmqYuapz14cqTqWHVd4bLGJB/aZcwxDc9jHDIhtTVac/MMT\r\ng+Sz61DGX3vybHI2gDErQM6lW65V9UjXlf2dslDwDCuBVlHodnA0Tqy63B5n\r\nidW9ZhDFJKTCSBnVqkcL7Gr72zN0d04nnIJ9wgHq3znY76PUMMW3ahC4R8+p\r\n206sFJfYFcGMbAWRL7elk5sSqp8XXhAHhElbUmFUzovjoq6qufUVdn/60jbw\r\nIM1jFdl8ypNH0n3MMILjSqWcYuRk2dG/x13ZIsK8i4ygPJD7JLenm4H7FBri\r\nlRJIAifKgYxP7fyt1cOvI+1pAtKLLv7BJ68=\r\n=fU/P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.1_1671007346251_0.8041606611690761","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@ledgerhq/connect-kit-loader","version":"1.0.2","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Hugo Lopes"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.0.2","maintainers":[{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"amougel","email":"alix.mougel@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"lfbarreto","email":"barreto.luiz.f@gmail.com"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://get-connect.ledger.com/","dist":{"shasum":"8554e16943f86cc2a5f6348a14dfe6e5bd0c572a","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.0.2.tgz","fileCount":8,"integrity":"sha512-TQ21IjcZOw/scqypaVFY3jHVqI7X7Hta3qN/us6FvTol3AY06UmrhhXGww0E9xHmAbdX241ddwXEiMBSQZFr9g==","signatures":[{"sig":"MEYCIQDPqqPhH8hxn2AXkoEcV5xlT8bvQNXRx4mnBgohyDxoZwIhANOBSJ0lMO1YVlGJSBI5h/8XY3KBsns7Xzu5YrqqrbqX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjozAdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraAw//bjsepMggQo78QKUzoIjDVL+l4Zs7dX8hoF0QQdgxFLdps4tJ\r\nTtnNs0K/63mi9f/BTGZM48NQ48VALPdlyKvi4asQYWdQUGMEIyNcDdc+TGAm\r\npsL74KbrqV5gDKEFV819IoHU7uw6panHaoPmXG5pU0W6OOMKyKJYCosR/XOv\r\nQL59kU8EAaBXhcuN0FDeTCNFYqEt1r5vFXTQpkpHJQVdOZonBXbdrKj61nk4\r\nBiaoP5Z1yITbx2FmYp11EqBXUG8fz5CnjerWhJkJj92KZ//TwAqJuEJc/tVt\r\n5uXFRoTrVYxTNT3TP3ydL5xKEoMYak4zsZc/9N7aaE8HIxsIScV1SnqBwE9w\r\nfZ+S+RIxZCefe8VhjQp9PCZx/9VyKDJQYW0m0spJUHzDOZrLQ5TMk+ionFUZ\r\n0erXaEbcjn9A+D20btjvdCdisz2KQM0S/0+3aqp56I4Pm+FUtvjkhCI38dSS\r\n+olpgytnJxAau2ke/kHeKrDP04My4/lxbhoslNrS4w3U9kQCwQBK6bP3CogZ\r\nxK7D4EPbsnBPmigfSrqVL8gV7M0ar14nT3jypmvpOax5fs1Itb4DhuQFCq+A\r\nEy4QjGlp660NI7aJmr/WRT6I3EQMwXn3dU/EJazX0Tb0HP26+Zj44pU+ZVP8\r\nAAl++9wo8NHsuiTxFfCH1w9FTOhzY1vzeMU=\r\n=47SB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dapps to integrate with Ledger Connect and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.0.2_1671639068912_0.88956475001549","host":"s3://npm-registry-packages"}},"1.1.0-beta.1":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.0-beta.1","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.0-beta.1","maintainers":[{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"3371586065e4f229928b750d61bbb7d405954628","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.0-beta.1.tgz","fileCount":8,"integrity":"sha512-dk0XM8Z4YVkZfnfnOGXu/yCROY2KaFzularAfwdK36JtBb0BKSj6O6k2RJ5MAHH3os3JX69TNIIolM3yv6qAxA==","signatures":[{"sig":"MEUCICJl/ZBxSTLXFmC7FVRdBISq2E3kFr/yq233hKhCYYwgAiEAgJuWnLM/ngp5+2OY153Y1pNzDLYcBH/NVuah6EtLmWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16052},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger dApps Connect Kit enables developers to connect their dApps to\nLedger hardware wallets using the Ledger Extension or Ledger Live.\nWe will guide the user to install the Ledger Extension in case it is supported\non the platform they're on, or install Ledger Live if it's not.\n\nThe `@ledgerhq/connect-kit-loader` allows dApps to load Connect Kit at runtime\nfrom a CDN so that we can improve the logic and UI without users having to wait\nfor wallet libraries and dApps updating package versions and releasing new builds.\n\n\n## Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an\nexample\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dApp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters for WalletConnect v2\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  version?: number;\n\n  // WalletConnect v2 init parameters\n  projectId?: string;              // REQUIRED WC v2 project id\n  chains?: number[];               // REQUIRED ethereum chains\n  optionalChains?: number[];       // OPTIONAL ethereum chains\n  methods?: string[];              // REQUIRED ethereum methods\n  optionalMethods?: string[];      // OPTIONAL ethereum methods\n  events?: string[];               // REQUIRED ethereum events\n  optionalEvents?: string[];       // OPTIONAL ethereum events\n  rpcMap?: { [chainId: string]: string; };  // OPTIONAL rpc urls for each chain\n  metadata?: CoreTypes.Metadata;   // OPTIONAL metadata of your app\n}\n```\n\nTo enable WalletConnect v2 you should update to version 1.1.0 of Connect Kit\nLoader.\n\nThe simplest use case is to just specify the `providerType`, `version` and\n`projectId` parameters.\n\n- `providerType: SupportedProviders.Ethereum`\n- `version: 2` - use WallertConnect v2, default is 1\n- `projectId` - required for WalletConnect v2 projects, create one at\n  [WalletConnect Cloud](https://cloud.walletconnect.com/)\n\nYou can also specify these parameters\n\n- `chains` - an array of integer chain ids that the wallet must support, the\n  connection will be refused if not all ids are supported, defaults to `[1]`\n- `rpcMap` - a map of chainIds to URLs\n- `optionalChains` - an array of integer chain ids that the wallet might connect to\n- `methods` - an array of method names that the wallet must support\n- `optionalMethods` - an array of method names that the wallet may support\n- `events` - an array of event names that the wallet must support\n- `optionalEvents` - an array of method names that the wallet may support\n\n#### Parameters for WalletConnect v1\n\nNote that WalletConnect v1 is deprecated and will stop working on June 28.\nVersion 1 is still the default in Connect Kit in order to not break existing\napps.\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n\n  // WalletConnect v1 init parameters\n  chainId?: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nThis call initializes Connect Kit and lets you know if the user's platform\nsupports the Ledger Extension.\n\nBased on the parameters that you pass and on the user's platform, Connect Kit\nwill decide what provider will be returned when you call `getProvider`.\n\nIf the Ledger Extension is installed and enabled it will pop up when the dApp\ncalls the provider's `eth_requestAccounts`, else the user will be presented one\nof two modals.\n\n- \"Try the Ledger Extension\", in case the user's platform supports the Extension\n  but it is not installed or enabled; a button will be shown to let the user\n  install the Extension.\n- \"Connect with Ledger Live\", in case the user's platform does not support\n  the Extension they will be able to use or install Ledger Live Mobile or Desktop.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider>`\n\n#### Description\n\nBased on the parameters passed to `checkSupport` it will return an instance of the\nLedger Extension provider or a WalletConnect provider.\n\n\n## Migration to WalletConnect v2\n\nTo migrate from WaletConnect version 1 to version 2:\n\n- Get a project id from the WalletConnect Cloud, it's free\n- Update Connect Kit loader to the latest version\n- Add `version: 2` and `projectId: 'id from step 1'` and rename `rpc` to `rpcMap` on your `checkSupport` parameters\n\nHave a look at the example velow and the full list of WalletConnect v2 options above.\n\n\n## Examples\n\n### Example for WalletConnect v2\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```ts\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      version: 2,\n      projectId: 'YOUR_PROJECT_ID',\n      chains: [1, 137],\n      optionalChains: [5],\n      rpcMap: {\n        '1': 'https://cloudflare-eth.com/',\n        '5': 'https://goerli.optimism.io',\n        '137': 'https://polygon-rpc.com/',\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n### Example for WalletConnect v1\n\nIf you are currently using WalletConnect version 1 you should migrate to version 2 as soon as possible, as the servers for version 1 are going to be shutdown on 28 June.\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      chainId: 1,\n      rpc: {\n        1: `https://cloudflare-eth.com`,                 // Mainnet\n        5: 'https://goerli.optimism.io',                 // Goerli\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.0-beta.1_1687175068948_0.5861998303501526","host":"s3://npm-registry-packages"}},"1.1.0-beta.2":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.0-beta.2","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.0-beta.2","maintainers":[{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"16d73763a08220d32a73455530dbfee5a7d4986b","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.0-beta.2.tgz","fileCount":8,"integrity":"sha512-PTz7+Ge+Q+fmyU62BAuJe036DNE2zCwF+s8Yo8UCxmE9X/dWUHv9nmZrUKXgc6TUx9e4jtTbCr0s8amepJHA8Q==","signatures":[{"sig":"MEUCIFzLLQrS7aQOlcu3b6WAMUb4HfqHHmEdcM6jwfhOHSyPAiEAsdzjJKQWwFV0Mjrv3ILIfwQ7m8qkrq1ydwfScanzWUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16038},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger dApps Connect Kit enables developers to connect their dApps to\nLedger hardware wallets using the Ledger Extension or Ledger Live.\nWe will guide the user to install the Ledger Extension in case it is supported\non the platform they're on, or install Ledger Live if it's not.\n\nThe `@ledgerhq/connect-kit-loader` allows dApps to load Connect Kit at runtime\nfrom a CDN so that we can improve the logic and UI without users having to wait\nfor wallet libraries and dApps updating package versions and releasing new builds.\n\n\n## Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an\nexample\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dApp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters for WalletConnect v2\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  walletConnectVersion?: number;\n\n  // WalletConnect v2 init parameters\n  projectId?: string;              // REQUIRED WC v2 project id\n  chains?: number[];               // REQUIRED ethereum chains\n  optionalChains?: number[];       // OPTIONAL ethereum chains\n  methods?: string[];              // REQUIRED ethereum methods\n  optionalMethods?: string[];      // OPTIONAL ethereum methods\n  events?: string[];               // REQUIRED ethereum events\n  optionalEvents?: string[];       // OPTIONAL ethereum events\n  rpcMap?: { [chainId: string]: string; };  // OPTIONAL rpc urls for each chain\n}\n```\n\nTo enable WalletConnect v2 you should update to version 1.1.0 of Connect Kit\nLoader.\n\nThe simplest use case is to just specify the `providerType`, `walletConnectVersion` and\n`projectId` parameters.\n\n- `providerType: SupportedProviders.Ethereum`\n- `walletConnectVersion: 2` - use WallertConnect v2, default is 1\n- `projectId` - required for WalletConnect v2 projects, create one at\n  [WalletConnect Cloud](https://cloud.walletconnect.com/)\n\nYou can also specify these parameters\n\n- `chains` - an array of integer chain ids that the wallet must support, the\n  connection will be refused if not all ids are supported, defaults to `[1]`\n- `rpcMap` - a map of chainIds to URLs\n- `optionalChains` - an array of integer chain ids that the wallet might connect to\n- `methods` - an array of method names that the wallet must support\n- `optionalMethods` - an array of method names that the wallet may support\n- `events` - an array of event names that the wallet must support\n- `optionalEvents` - an array of method names that the wallet may support\n\n#### Parameters for WalletConnect v1\n\nNote that WalletConnect v1 is deprecated and will stop working on June 28.\nVersion 1 is still the default in Connect Kit in order to not break existing\napps.\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n\n  // WalletConnect v1 init parameters\n  chainId?: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nThis call initializes Connect Kit and lets you know if the user's platform\nsupports the Ledger Extension.\n\nBased on the parameters that you pass and on the user's platform, Connect Kit\nwill decide what provider will be returned when you call `getProvider`.\n\nIf the Ledger Extension is installed and enabled it will pop up when the dApp\ncalls the provider's `eth_requestAccounts`, else the user will be presented one\nof two modals.\n\n- \"Try the Ledger Extension\", in case the user's platform supports the Extension\n  but it is not installed or enabled; a button will be shown to let the user\n  install the Extension.\n- \"Connect with Ledger Live\", in case the user's platform does not support\n  the Extension they will be able to use or install Ledger Live Mobile or Desktop.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider>`\n\n#### Description\n\nBased on the parameters passed to `checkSupport` it will return an instance of the\nLedger Extension provider or a WalletConnect provider.\n\n\n## Migration to WalletConnect v2\n\nTo migrate from WaletConnect version 1 to version 2:\n\n- Get a project id from the WalletConnect Cloud, it's free\n- Update Connect Kit loader to the latest version\n- Add `walletConnectVersion: 2` and `projectId: 'id from step 1'` and rename `rpc` to `rpcMap` on your `checkSupport` parameters\n\nHave a look at the example velow and the full list of WalletConnect v2 options above.\n\n\n## Examples\n\n### Example for WalletConnect v2\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```ts\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 2,\n      projectId: 'YOUR_PROJECT_ID',\n      chains: [1, 137],\n      optionalChains: [5],\n      rpcMap: {\n        '1': 'https://cloudflare-eth.com/',\n        '5': 'https://goerli.optimism.io',\n        '137': 'https://polygon-rpc.com/',\n      },\n    });\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n### Example for WalletConnect v1\n\nIf you are currently using WalletConnect version 1 you should migrate to version 2 as soon as possible, as the servers for version 1 are going to be shutdown on 28 June.\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 1,\n      chainId: 1,\n      rpc: {\n        1: `https://cloudflare-eth.com`,                 // Mainnet\n        5: 'https://goerli.optimism.io',                 // Goerli\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.0-beta.2_1687360704035_0.7960344019887522","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.0","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.0","maintainers":[{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"10343b78ef13436818bf3453568a559c0eeb9d48","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.0.tgz","fileCount":8,"integrity":"sha512-HUy12FEczoWY2FPubnsm1uOA8tkVWc0j90i47suThV3C9NL2xx69ZAIEU3Ytzs2bwLek9S1Q2S1VQJvA+3Ygkg==","signatures":[{"sig":"MEYCIQCqAX1UUzwByrmGJGcPK31kZdM1f9i+ZxA3K9Vh6dD05wIhAMvjg/z1DRZBrf2BlhG+2cVsBtTNdbEGIjfLOzdx9akq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17561},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.0_1687442986005_0.0888295891527131","host":"s3://npm-registry-packages"}},"1.1.1-beta.0":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.1-beta.0","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.1-beta.0","maintainers":[{"name":"crema-ledger","email":"thomas.brillard@ledger.fr"},{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"69cddb0cacc849fbba7cf375c8a713ea33466814","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.1-beta.0.tgz","fileCount":8,"integrity":"sha512-DwPuIS8vB74OBJbIpUBsdCut8CR4NeuooCx61UvaPzzx1FE/eR0+Bd6lKzKB7Bl3DLIU1+0EoD79+y43VECtaQ==","signatures":[{"sig":"MEYCIQCN1rZnRTPPVZ+x44GzBXxZbRqjxFRENOr0JqpULi8w4AIhAKaHXeHYtUgAVzhQHd+023wbB4g5yjDxVc90r/smZTiu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17429},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger dApps Connect Kit enables developers to connect their dApps to\nLedger hardware wallets using the Ledger Extension or Ledger Live.\nWe will guide the user to install the Ledger Extension in case it is supported\non the platform they're on, or install Ledger Live if it's not.\n\nThe `@ledgerhq/connect-kit-loader` allows dApps to load Connect Kit at runtime\nfrom a CDN so that we can improve the logic and UI without users having to wait\nfor wallet libraries and dApps updating package versions and releasing new builds.\n\n\n## Using Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an\nexample\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dApp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters for WalletConnect v2\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  walletConnectVersion?: number;\n\n  // WalletConnect v2 init parameters\n  projectId?: string;              // REQUIRED WC v2 project id\n  chains?: number[];               // REQUIRED ethereum chains\n  optionalChains?: number[];       // OPTIONAL ethereum chains\n  methods?: string[];              // REQUIRED ethereum methods\n  optionalMethods?: string[];      // OPTIONAL ethereum methods\n  events?: string[];               // REQUIRED ethereum events\n  optionalEvents?: string[];       // OPTIONAL ethereum events\n  rpcMap?: { [chainId: string]: string; };  // OPTIONAL rpc urls for each chain\n}\n```\n\nTo enable WalletConnect v2 you should update to version 1.1.0 of Connect Kit\nLoader.\n\nThe simplest use case is to just specify the `providerType`, `walletConnectVersion` and\n`projectId` parameters.\n\n- `providerType: SupportedProviders.Ethereum`\n- `walletConnectVersion: 2` - use WallertConnect v2, default is 1\n- `projectId` - required for WalletConnect v2 projects, create one at\n  [WalletConnect Cloud](https://cloud.walletconnect.com/)\n\nYou can also specify these parameters\n\n- `chains` - an array of integer chain ids that the wallet must support, the\n  connection will be refused if not all ids are supported, defaults to `[1]`\n- `rpcMap` - a map of chainIds to URLs\n- `optionalChains` - an array of integer chain ids that the wallet might connect to\n- `methods` - an array of method names that the wallet must support\n- `optionalMethods` - an array of method names that the wallet may support\n- `events` - an array of event names that the wallet must support\n- `optionalEvents` - an array of method names that the wallet may support\n\n#### Parameters for WalletConnect v1\n\nNote that WalletConnect v1 is deprecated and will stop working on June 28.\nVersion 1 is still the default in Connect Kit in order to not break existing\napps.\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n\n  // WalletConnect v1 init parameters\n  chainId?: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nThis call initializes Connect Kit and lets you know if the user's platform\nsupports the Ledger Extension.\n\nBased on the parameters that you pass and on the user's platform, Connect Kit\nwill decide what provider will be returned when you call `getProvider`.\n\nIf the Ledger Extension is installed and enabled it will pop up when the dApp\ncalls the provider's `eth_requestAccounts`, else the user will be presented one\nof two modals.\n\n- \"Try the Ledger Extension\", in case the user's platform supports the Extension\n  but it is not installed or enabled; a button will be shown to let the user\n  install the Extension.\n- \"Connect with Ledger Live\", in case the user's platform does not support\n  the Extension they will be able to use or install Ledger Live Mobile or Desktop.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider>`\n\n#### Description\n\nBased on the parameters passed to `checkSupport` it will return an instance of the\nLedger Extension provider or a WalletConnect provider.\n\n\n## Migration to WalletConnect v2\n\nTo migrate from WaletConnect version 1 to version 2:\n\n- Create a project id from the [WalletConnect Cloud](https://cloud.walletconnect.com/),\n  it's free\n- Update Connect Kit loader to the latest version\n- Add `walletConnectVersion: 2` and `projectId: 'id from step 1'` and rename `rpc` to `rpcMap` on your `checkSupport` parameters\n\nHave a look at the example velow and the full list of WalletConnect v2 options above.\n\n\n## Examples\n\n### Example for WalletConnect v2\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```ts\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 2,\n      projectId: 'YOUR_PROJECT_ID',\n      chains: [1, 137],\n      optionalChains: [5],\n      rpcMap: {\n        '1': 'https://cloudflare-eth.com/',\n        '5': 'https://goerli.optimism.io',\n        '137': 'https://polygon-rpc.com/',\n      },\n    });\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n### Example for WalletConnect v1\n\nIf you are currently using WalletConnect version 1 you should migrate to version 2 as soon as possible, as the servers for version 1 are going to be shutdown on 28 June.\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 1,\n      chainId: 1,\n      rpc: {\n        1: `https://cloudflare-eth.com`,                 // Mainnet\n        5: 'https://goerli.optimism.io',                 // Goerli\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n\n## Development\n\nIf you want to fix a bug or develop a new feature for Connect Kit follow these steps:\n\n- clone the repository\n\n    git clone https://github.com/LedgerHQ/connect-kit\n\n- build the Connect Kit package\n\n    cd packages/connect-kit\n    yarn && yarn build\n\n- deploy it somewhere by using a service like vercel or netlify for test builds; e.g.\n\n    netlify deploy -d dist/ --prod\n\n- update the URL on the Connect Kit loader\n\n    // packages/connect-kit-loader/src/index.ts\n    const src = \"https://DEPLOY_ADDRESS/umd/index.js\";\n\n- build and link it locally; e.g.\n\n    yarn build && yarn link\n\n- use the linked loader package on your app\n\n    cd <my_app>\n    yarn\n    yarn link @ledgerhq/connect-kit-loader\n\nYour app will now use the local version of the Connect Kit loader and you just need to deploy new changes to the same URL and reload the app to test them.\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.1-beta.0_1690876621053_0.960607263884051","host":"s3://npm-registry-packages"}},"1.1.1-beta.1":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.1-beta.1","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.1-beta.1","maintainers":[{"name":"crema-ledger","email":"thomas.brillard@ledger.fr"},{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"ba9355940bcb19abcc7dbb56fab4db251bddaf54","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.1-beta.1.tgz","fileCount":8,"integrity":"sha512-eGMoWjl4SwPhx/pdMVaaLzkzumdRBKFx1WinasGi98ehNRMTGVsbDhvB2pt29aVLwpnht+lEbiQvQEPfGPcl2g==","signatures":[{"sig":"MEUCIQD5wm7duwfQxELl2G2V56qC4GojYzMzbcrbj3dCZaWoKwIgELrvmdW1kB/vDEgr+aLTwtxd57a9pMxaIjGy6UW3pCc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17529},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","readme":"# Ledger Connect Kit\n\nThe Ledger dApps Connect Kit enables developers to connect their dApps to\nLedger hardware wallets using the Ledger Extension or Ledger Live.\nWe will guide the user to install the Ledger Extension in case it is supported\non the platform they're on, or install Ledger Live if it's not.\n\nThe `@ledgerhq/connect-kit-loader` allows dApps to load Connect Kit at runtime\nfrom a CDN so that we can improve the logic and UI without users having to wait\nfor wallet libraries and dApps updating package versions and releasing new builds.\n\n\n## Using Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an\nexample\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dApp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters for WalletConnect v2\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  walletConnectVersion?: number;\n\n  // WalletConnect v2 init parameters\n  projectId?: string;              // REQUIRED WC v2 project id\n  chains?: number[];               // REQUIRED ethereum chains\n  optionalChains?: number[];       // OPTIONAL ethereum chains\n  methods?: string[];              // REQUIRED ethereum methods\n  optionalMethods?: string[];      // OPTIONAL ethereum methods\n  events?: string[];               // REQUIRED ethereum events\n  optionalEvents?: string[];       // OPTIONAL ethereum events\n  rpcMap?: { [chainId: string]: string; };  // OPTIONAL rpc urls for each chain\n}\n```\n\nTo enable WalletConnect v2 you should update to version 1.1.0 of Connect Kit\nLoader.\n\nThe simplest use case is to just specify the `providerType`, `walletConnectVersion` and\n`projectId` parameters.\n\n- `providerType: SupportedProviders.Ethereum`\n- `walletConnectVersion: 2` - use WallertConnect v2, default is 1\n- `projectId` - required for WalletConnect v2 projects, create one at\n  [WalletConnect Cloud](https://cloud.walletconnect.com/)\n\nYou can also specify these parameters\n\n- `chains` - an array of integer chain ids that the wallet must support, the\n  connection will be refused if not all ids are supported, defaults to `[1]`\n- `rpcMap` - a map of chainIds to URLs\n- `optionalChains` - an array of integer chain ids that the wallet might connect to\n- `methods` - an array of method names that the wallet must support\n- `optionalMethods` - an array of method names that the wallet may support\n- `events` - an array of event names that the wallet must support\n- `optionalEvents` - an array of method names that the wallet may support\n\n#### Parameters for WalletConnect v1\n\nNote that WalletConnect v1 is deprecated and will stop working on June 28.\nVersion 1 is still the default in Connect Kit in order to not break existing\napps.\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n\n  // WalletConnect v1 init parameters\n  chainId?: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nThis call initializes Connect Kit and lets you know if the user's platform\nsupports the Ledger Extension.\n\nBased on the parameters that you pass and on the user's platform, Connect Kit\nwill decide what provider will be returned when you call `getProvider`.\n\nIf the Ledger Extension is installed and enabled it will pop up when the dApp\ncalls the provider's `eth_requestAccounts`, else the user will be presented one\nof two modals.\n\n- \"Try the Ledger Extension\", in case the user's platform supports the Extension\n  but it is not installed or enabled; a button will be shown to let the user\n  install the Extension.\n- \"Connect with Ledger Live\", in case the user's platform does not support\n  the Extension they will be able to use or install Ledger Live Mobile or Desktop.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider>`\n\n#### Description\n\nBased on the parameters passed to `checkSupport` it will return an instance of the\nLedger Extension provider or a WalletConnect provider.\n\n\n## Migration to WalletConnect v2\n\nTo migrate from WaletConnect version 1 to version 2:\n\n- Create a project id from the [WalletConnect Cloud](https://cloud.walletconnect.com/),\n  it's free\n- Update Connect Kit loader to the latest version\n- Add `walletConnectVersion: 2` and `projectId: 'id from step 1'` and rename `rpc` to `rpcMap` on your `checkSupport` parameters\n\nHave a look at the example velow and the full list of WalletConnect v2 options above.\n\n\n## Examples\n\n### Example for WalletConnect v2\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```ts\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 2,\n      projectId: 'YOUR_PROJECT_ID',\n      chains: [1, 137],\n      optionalChains: [5],\n      rpcMap: {\n        '1': 'https://cloudflare-eth.com/',\n        '5': 'https://goerli.optimism.io',\n        '137': 'https://polygon-rpc.com/',\n      },\n    });\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n### Example for WalletConnect v1\n\nIf you are currently using WalletConnect version 1 you should migrate to version 2 as soon as possible, as the servers for version 1 are going to be shutdown on 28 June.\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 1,\n      chainId: 1,\n      rpc: {\n        1: `https://cloudflare-eth.com`,                 // Mainnet\n        5: 'https://goerli.optimism.io',                 // Goerli\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n\n## Development\n\nIf you want to fix a bug or develop a new feature for Connect Kit follow these steps:\n\n- clone the repository\n\n    git clone https://github.com/LedgerHQ/connect-kit\n\n- build the Connect Kit package\n\n    cd packages/connect-kit\n    yarn && yarn build\n\n- deploy it somewhere by using a service like vercel or netlify for test builds; e.g.\n\n    netlify deploy -d dist/ --prod\n\n- update the URL on the Connect Kit loader\n\n    // packages/connect-kit-loader/src/index.ts\n    const src = \"https://DEPLOY_ADDRESS/umd/index.js\";\n\n- build and link it locally; e.g.\n\n    yarn build && yarn link\n\n- use the linked loader package on your app\n\n    cd <my_app>\n    yarn\n    yarn link @ledgerhq/connect-kit-loader\n\nYour app will now use the local version of the Connect Kit loader and you just need to deploy new changes to the same URL and reload the app to test them.\n","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.1-beta.1_1690889017520_0.2937297859233625","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.1","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.1","maintainers":[{"name":"crema-ledger","email":"thomas.brillard@ledger.fr"},{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"7f495de1565e393d2d3a9d54c5831ed045e403a2","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.1.tgz","fileCount":8,"integrity":"sha512-Jq/CMEw+o5+u6YEcVtkE5UiEDhTjyqro1vo0hDDScf1WdDkxBHahYn/1bL9QEhA4nG5JyfygcL1+CKT+2BilWw==","signatures":[{"sig":"MEYCIQD5nZi9AZhiAZZRZZ/EPK51O7xIHoyOJ4RdxjiVyGj92gIhAJjNkIc4EJEit8CrXlMWdq1HGMFLbivN91sGAiAOUDAT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17561},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.1_1690900408880_0.1110913997294174","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.2","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.2","maintainers":[{"name":"crema-ledger","email":"thomas.brillard@ledger.fr"},{"name":"chrisd-ledger","email":"cristian.dumas-ext@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"jelbaz-ledger","email":"julien.el-baz@ledger.fr"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"btchip","email":"nicolas+npmjs@ledger.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"juan-cortes","email":"juan@bohem.io"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"iammorrow","email":"hugo.morosini@gmail.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"junsugiura","email":"jun.sugiura.jp@gmail.com"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"d550e3c1f046e4c796f32a75324b03606b7e226a","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.2.tgz","fileCount":8,"integrity":"sha512-mscwGroSJQrCTjtNGBu+18FQbZYA4+q6Tyx6K7CXHl6AwgZKbWfZYdgP2F+fyZcRUdGRsMX8QtvU61VcGGtO1A==","signatures":[{"sig":"MEUCIBS8vSh9GepUqE6bSbQHVMb5otTq7UvZ4jMAp3HSKr/FAiEA5v8eFFdX3jVV3dEPNhkOeVrxIyZQGZSBmVhHCJ6iSys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17634},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"sideEffects":false,"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.2_1691658994150_0.7519386155114962","host":"s3://npm-registry-packages"}},"1.1.8":{"name":"@ledgerhq/connect-kit-loader","version":"1.1.8","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","_id":"@ledgerhq/connect-kit-loader@1.1.8","maintainers":[{"name":"thomas.coudray","email":"thomas.coudray@ledger.fr"},{"name":"ldg-github-ci","email":"infra-purchasing@ledger.fr"},{"name":"aboissiere","email":"alexandrine.boissiere@ledger.com"},{"name":"vbouzon","email":"vincent.bouzon@live.fr"},{"name":"mmejdoub-ledger","email":"mejdi.mejdoub@ledger.com"},{"name":"crema-ledger","email":"thomas.brillard@ledger.fr"},{"name":"gbrahm-ledger","email":"gandalf.brahm@ledger.fr"},{"name":"sergii-shkolin","email":"sergii.shkolin-ext@ledger.fr"},{"name":"yogh","email":"jerome.caporossi@ledger.fr"},{"name":"haammar-ledger","email":"hakim.aammar-ext@ledger.fr"},{"name":"kvn-ledger","email":"kevin.lambert@ledger.fr"},{"name":"ofreyssinet","email":"olivier.freyssinet@gmail.com"},{"name":"achabrolin-ledger","email":"alexandre.chabrolin@ledger.fr"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"meriadec","email":"meriadec.pillet@gmail.com"},{"name":"flocks","email":"teissierflorent@gmail.com"},{"name":"val_pinkman","email":"valentin.d.pinkman@icloud.com"},{"name":"phenry-ledger","email":"pascal.henry@ledger.fr"},{"name":"jdecussy-ledger","email":"jerome.decussy@ledger.fr"},{"name":"hzheng_ledger","email":"huiqi.zheng@ledger.fr"}],"homepage":"https://ledger.com/","dist":{"shasum":"6cc32191660dd9d6e8f89047af09b0f201e30190","tarball":"https://registry.npmjs.org/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.8.tgz","fileCount":8,"integrity":"sha512-mDJsOucVW8m3Lk2fdQst+P74SgiKebvq1iBk4sXLbADQOwhL9bWGaArvO+tW7jPJZwEfSPWBdHcHoYi11XAwZw==","signatures":[{"sig":"MEQCIGsNE/15qHo5qR5oeTYP9V7EKkdpu5In7LBnsmtPONbyAiBipG2fBbutY/DyNOJGU92WtNCQ6tJ72xONsx4mImHG3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17803},"main":"dist/esm/index.js","type":"module","types":"index","module":"dist/esm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c --compact"},"typings":"dist/esm/index.d.ts","_npmUser":{"name":"ldg-github-ci","email":"infra-purchasing@ledger.fr"},"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","directories":{},"sideEffects":false,"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.4.0","rollup":"^2.75.6","typescript":"^4.7.3","@rollup/plugin-alias":"^3.1.9","@walletconnect/types":"^2.3.2","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-typescript":"^8.3.3","@rollup/plugin-node-resolve":"^13.3.0"},"_npmOperationalInternal":{"tmp":"tmp/connect-kit-loader_1.1.8_1702635524554_0.11244958177800646","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-10-28T15:26:15.352Z","modified":"2026-08-10T17:18:37.299Z","1.0.0-beta.2":"2022-10-28T15:26:15.614Z","1.0.0-beta.3":"2022-11-01T16:19:57.607Z","1.0.0-beta.4":"2022-11-01T21:54:15.768Z","1.0.0-beta.5":"2022-11-10T17:20:51.962Z","1.0.0-beta.6":"2022-11-14T17:35:21.960Z","1.0.0-beta.7":"2022-11-15T12:45:20.257Z","1.0.0-beta.8":"2022-11-17T10:59:32.942Z","1.0.0":"2022-11-17T12:59:24.528Z","1.0.1":"2022-12-14T08:42:26.444Z","1.0.2":"2022-12-21T16:11:09.083Z","1.1.0-beta.1":"2023-06-19T11:44:29.067Z","1.1.0-beta.2":"2023-06-21T15:18:24.245Z","1.1.0":"2023-06-22T14:09:46.167Z","1.1.1-beta.0":"2023-08-01T07:57:01.190Z","1.1.1-beta.1":"2023-08-01T11:23:37.708Z","1.1.1":"2023-08-01T14:33:29.067Z","1.1.2":"2023-08-10T09:16:34.303Z","1.1.8":"2023-12-15T10:18:44.760Z"},"author":{"name":"Ledger SAS","email":"ledger.com"},"license":"MIT","homepage":"https://ledger.com/","keywords":["ledger","hardware wallet","ethereum","blockchain","provider","dapps","onboarding"],"repository":{"url":"https://github.com/LedgerHQ/connect-kit","type":"git","directory":"packages/connect-kit-loader"},"description":"Load Ledger Connect Kit at runtime, a library for dApps to integrate with the Ledger Extension and Ledger Live","maintainers":[{"email":"pascal.henry@ledger.fr","name":"phenry-ledger"},{"email":"sergii.shkolin-ext@ledger.fr","name":"sergii-shkolin"},{"email":"gandalf.brahm@ledger.fr","name":"gbrahm-ledger"},{"email":"infra-purchasing@ledger.fr","name":"ldg-github-ci"},{"email":"vincent.bouzon@live.fr","name":"vbouzon"},{"email":"team-secops+ledger-releaser-npmjs@ledger.fr","name":"ledger-releaser"}],"readme":"# Ledger Connect Kit\n\nThe Ledger dApps Connect Kit enables developers to connect their dApps to\nLedger hardware wallets using the Ledger Extension or Ledger Live.\nWe will guide the user to install the Ledger Extension in case it is supported\non the platform they're on, or install Ledger Live if it's not.\n\nThe `@ledgerhq/connect-kit-loader` allows dApps to load Connect Kit at runtime\nfrom a CDN so that we can improve the logic and UI without users having to wait\nfor wallet libraries and dApps updating package versions and releasing new builds.\n\n### Content Security Policy (CSP)\n\nIf your app uses CSP, please make sure to add `https://proxyseg.api.live.ledger.com/` to your settings\n\n## Using Connect Kit loader\n\nTo use Connect Kit you just have to add the `@ledgerhq/connect-kit-loader`\npackage as a dependency using your preferred package manager, using yarn as an\nexample\n\n```sh\nyarn add @ledgerhq/connect-kit-loader\n```\n\nand use it as below\n\n```js\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nconst connectKit = await loadConnectKit()\n```\n\nIf you are using classes you can get the promise on the class constructor and\nits value where you need it\n\n```ts\nimport { loadConnectKit } from '@ledgerhq/connect-kit-loader'\n\nexport class LedgerConnector {\n  private provider: any\n  private connectKitPromise: Promise<LedgerConnectKit>\n\n  constructor() {\n    super()\n\n    this.connectKitPromise = loadConnectKit()\n  }\n\n  public async connect(): Promise<Connector> {\n    if (!this.provider) {\n      const connectKit = await this.connectKitPromise\n```\n\nYou can check that Connect Kit is loaded by looking at the network tab on the\ndeveloper tools. You should see a request for `https://<CDN>/umd/index.js`.\n\nSee what functions are provided by the Connect Kit API below.\n\n\n## Connect Kit API\n\nConnect Kit exports three functions, `enableDebugLogs`, `checkSupport` and\n`getProvider`.\n\n### `enableDebugLogs`\n\n#### Description\n\nEnables debug messages on the browser console in case you need to diagnose a\npossible problem.\n\nOnce Connect Kit is loaded you can call it from the browser's developer tools\nconsole with `window.ledgerConnectKit.enableDebugLogs()` and call the other\nConnect Kit functions to see the debug messages. Just reload the dApp to\ndisable them.\n\n### `checkSupport`\n\n#### Parameters for WalletConnect v2\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n  walletConnectVersion?: number;\n\n  // WalletConnect v2 init parameters\n  projectId?: string;              // REQUIRED WC v2 project id\n  chains?: number[];               // REQUIRED ethereum chains\n  optionalChains?: number[];       // OPTIONAL ethereum chains\n  methods?: string[];              // REQUIRED ethereum methods\n  optionalMethods?: string[];      // OPTIONAL ethereum methods\n  events?: string[];               // REQUIRED ethereum events\n  optionalEvents?: string[];       // OPTIONAL ethereum events\n  rpcMap?: { [chainId: string]: string; };  // OPTIONAL rpc urls for each chain\n}\n```\n\nTo enable WalletConnect v2 you should update to version 1.1.0 of Connect Kit\nLoader.\n\nThe simplest use case is to just specify the `providerType`, `walletConnectVersion` and\n`projectId` parameters.\n\n- `providerType: SupportedProviders.Ethereum`\n- `walletConnectVersion: 2` - use WallertConnect v2, default is 1\n- `projectId` - required for WalletConnect v2 projects, create one at\n  [WalletConnect Cloud](https://cloud.walletconnect.com/)\n\nYou can also specify these parameters\n\n- `chains` - an array of integer chain ids that the wallet must support, the\n  connection will be refused if not all ids are supported, defaults to `[1]`\n- `rpcMap` - a map of chainIds to URLs\n- `optionalChains` - an array of integer chain ids that the wallet might connect to\n- `methods` - an array of method names that the wallet must support\n- `optionalMethods` - an array of method names that the wallet may support\n- `events` - an array of event names that the wallet must support\n- `optionalEvents` - an array of method names that the wallet may support\n\n#### Parameters for WalletConnect v1\n\nNote that WalletConnect v1 is deprecated and will stop working on June 28.\nVersion 1 is still the default in Connect Kit in order to not break existing\napps.\n\n```ts\ntype CheckSupportOptions = {\n  providerType: SupportedProviders;\n\n  // WalletConnect v1 init parameters\n  chainId?: ConnectSupportedChains;\n  bridge?: string;\n  infuraId?: string;\n  rpc: { [chainId: number]: string; };\n}\n```\n\n#### Returns\n\n```ts\ntype ConnectSupport = type CheckSupportResult = {\n  isLedgerConnectSupported?: boolean;\n  isLedgerConnectEnabled?: boolean;\n  isChainIdSupported?: boolean;\n  providerImplementation: 'LedgerConnect' | 'WalletConnect';\n}\n```\n\n#### Description\n\nThis call initializes Connect Kit and lets you know if the user's platform\nsupports the Ledger Extension.\n\nBased on the parameters that you pass and on the user's platform, Connect Kit\nwill decide what provider will be returned when you call `getProvider`.\n\nIf the Ledger Extension is installed and enabled it will pop up when the dApp\ncalls the provider's `eth_requestAccounts`, else the user will be presented one\nof two modals.\n\n- \"Try the Ledger Extension\", in case the user's platform supports the Extension\n  but it is not installed or enabled; a button will be shown to let the user\n  install the Extension.\n- \"Connect with Ledger Live\", in case the user's platform does not support\n  the Extension they will be able to use or install Ledger Live Mobile or Desktop.\n\n### `getProvider`\n\n#### Returns\n\n`Promise<EthereumProvider>`\n\n#### Description\n\nBased on the parameters passed to `checkSupport` it will return an instance of the\nLedger Extension provider or a WalletConnect provider.\n\n\n## Migration to WalletConnect v2\n\nTo migrate from WaletConnect version 1 to version 2:\n\n- Create a project id from the [WalletConnect Cloud](https://cloud.walletconnect.com/),\n  it's free\n- Update Connect Kit loader to the latest version\n- Add `walletConnectVersion: 2` and `projectId: 'id from step 1'` and rename `rpc` to `rpcMap` on your `checkSupport` parameters\n\nHave a look at the example velow and the full list of WalletConnect v2 options above.\n\n\n## Examples\n\n### Example for WalletConnect v2\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```ts\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 2,\n      projectId: 'YOUR_PROJECT_ID',\n      chains: [1, 137],\n      optionalChains: [5],\n      rpcMap: {\n        '1': 'https://cloudflare-eth.com/',\n        '5': 'https://goerli.optimism.io',\n        '137': 'https://polygon-rpc.com/',\n      },\n    });\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n### Example for WalletConnect v1\n\nIf you are currently using WalletConnect version 1 you should migrate to version 2 as soon as possible, as the servers for version 1 are going to be shutdown on 28 June.\n\nAn example function using the *Ledger Connect Kit* and *ethers.js*, that would\nbe called when pressing the connect button on a React app.\n\n`setProvider`, `setAccount`, `setChainId` and `setError` are just\nsimple `useState` functions to manage the app state.\n\n```js\n// JSX code\n<Button onClick={() => connectWallet()}>Connect With Ledger</Button>\n```\n\n```js\n// click handler function\nconst connectWallet = async () => {\n  try {\n    const connectKit = await loadConnectKit();\n    connectKit.enableDebugLogs();\n    const checkSupportResult = connectKit.checkSupport({\n      providerType: SupportedProviders.Ethereum,\n      walletConnectVersion: 1,\n      chainId: 1,\n      rpc: {\n        1: `https://cloudflare-eth.com`,                 // Mainnet\n        5: 'https://goerli.optimism.io',                 // Goerli\n        137: \"https://matic-mainnet.chainstacklabs.com\", // Polygon\n      },\n    });\n    console.log('checkSupportResult is', checkSupportResult);\n\n    const provider = await connectKit.getProvider();\n    setProvider(provider);\n\n    const accounts = await provider.request({ method: 'eth_requestAccounts' });\n    if (accounts) setAccount(accounts[0]);\n\n    const library = new ethers.providers.Web3Provider(provider);\n    const network = await library.getNetwork();\n    setChainId(network.chainId);\n  } catch (error) {\n    setError(error);\n  }\n}\n```\n\n\n## Development\n\nIf you want to fix a bug or develop a new feature for Connect Kit follow these steps:\n\n- clone the repository\n\n    git clone https://github.com/LedgerHQ/connect-kit\n\n- build the Connect Kit package\n\n    cd packages/connect-kit\n    yarn && yarn build\n\n- deploy it somewhere by using a service like vercel or netlify for test builds; e.g.\n\n    netlify deploy -d dist/ --prod\n\n- update the URL on the Connect Kit loader\n\n    // packages/connect-kit-loader/src/index.ts\n    const src = \"https://DEPLOY_ADDRESS/umd/index.js\";\n\n- build and link it locally; e.g.\n\n    yarn build && yarn link\n\n- use the linked loader package on your app\n\n    cd <my_app>\n    yarn\n    yarn link @ledgerhq/connect-kit-loader\n\nYour app will now use the local version of the Connect Kit loader and you just need to deploy new changes to the same URL and reload the app to test them.\n","readmeFilename":"README.md"}