{"_id":"@alayanetwork/eth-ledger-bridge-keyring","_rev":"7-e36a6b761ad49e7b3f81e51bf000cfa5","time":{"0.3.0":"2021-09-02T03:42:43.007Z","0.3.1":"2021-09-02T03:42:43.007Z","created":"2021-09-06T02:51:11.979Z","0.3.2":"2021-09-06T02:51:12.172Z","modified":"2022-04-04T12:33:52.668Z","0.4.0":"2021-09-14T02:29:53.369Z","0.4.1":"2021-09-16T08:29:25.616Z"},"name":"@alayanetwork/eth-ledger-bridge-keyring","dist-tags":{"latest":"0.4.1"},"versions":{"0.3.2":{"name":"@alayanetwork/eth-ledger-bridge-keyring","version":"0.3.2","description":"A MetaMask compatible keyring, for ledger hardware wallets","main":"index.js","scripts":{"test":"mocha","lint":"eslint . --ext .js","lint:fix":"eslint --fix . --ext .js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"repository":{"type":"git","url":"git+https://github.com/AlayaNetwork/samurai-eth-method-registry.git"},"keywords":["platon","ethereum","keyring","ledger","samurai"],"author":{"name":"Bruno Barbieri"},"license":"ISC","bugs":{"url":"https://github.com/AlayaNetwork/samurai-eth-method-registry/issues"},"homepage":"https://github.com/AlayaNetwork/samurai-eth-method-registry#readme","resolutions":{"mocha/**/mkdirp":"^0.5.3"},"dependencies":{"eth-sig-util":"^1.4.2","ethereumjs-tx":"^1.3.4","ethereumjs-util":"^5.1.5","events":"^2.0.0","hdkey":"0.8.0"},"devDependencies":{"@metamask/eslint-config":"^3.0.0","babel-eslint":"^10.1.0","chai":"^4.1.2","chai-spies":"^1.0.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.1","eslint-plugin-json":"^1.2.0","eslint-plugin-mocha":"^6.2.2","mocha":"^5.0.4"},"gitHead":"2f465dfedf4972505add318ea6ed27d95339cf39","_id":"@alayanetwork/eth-ledger-bridge-keyring@0.3.2","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-7KPgH26wgSZO1jjmIvygqUbND4mjEz0n9WDUTuybxRPoWRGVZNP4RmofbkdunE2rr/sd5Tm30JBpCSUcolx+fA==","shasum":"0fd17a8b67f4b673be1db2f226eddfaab229177b","tarball":"https://registry.npmjs.org/@alayanetwork/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.3.2.tgz","fileCount":4,"unpackedSize":19252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNYIgCRA9TVsSAnZWagAA+cwP/2tXwXfviTSr6E1/oRhO\ntpgTS2z3ALIw37NgoS2DnYHFi7oN0SuqTlJLqh+SeHsiJ+fvpo8ImLEVXu1i\nHpSTRqBXLY6e5a0dYa+YTJqDQVbilKmHnc26ByhxNs4H3K+VJ25QYsNE2TO0\n1UoB/NiDOCxmtqVvPH6JSEKETdRh7Y8OshU9xko77J8sD53iAaaxqy7DyEks\n63b/+ms/uflMFQtGnZIWKpkB9hofiCV75dSK0W8iSw/9uY3vKKS89tDAH0UJ\ngMKY2pT5qoplGD4gs7YvdeerS3Gxd16K9hUOn0WhZF+jgVsBDaheUHn8S69O\nRRtUGfDbuiU7OT10PgWKs91ITaqyeTp2obm3jhIVJDeTqONryubqiAYn8/DO\n8d/7yX//k6w0cBFkJuiGtYxwX79ERrCgnKoywBnL0VAy7Fo3BDICD1oBzJM1\nJvAd3hnnsL2KpLm7FrkR5dgNWV2p0PiUNPrGOUifF5QwJMahY8APgHVH13xl\ny/muZ3Qijj9GKpDjrpE98g7i3/VQ3dvXXhQksrxiYeJ8Y0ELK87G/q0huIi8\nN5G1SHhS2JFMa5XMBW65A9tldIbZk1TH7n7EdZO2a5mlxkDNqmEF1QX+7NOs\nP0/3oAsUk4czqFq4260Oyu8nvvsMQ1mPU7bqcDr41uQ2ZI1UnuBcYxOd9eB+\nR5WE\r\n=aS+3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnME6zv9dhE8ANZJEocGOrPw2AhTVVYhX5AzEarKPINAiEAtsH6onBYqmWj8oKYZaJ7mLLwQYidD5FpM0lTTW73n2s="}]},"_npmUser":{"name":"alayanetwork","email":"npm@latticex.foundation"},"directories":{},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eth-ledger-bridge-keyring_0.3.2_1630896672024_0.6472778632734792"},"_hasShrinkwrap":false},"0.4.0":{"name":"@alayanetwork/eth-ledger-bridge-keyring","version":"0.4.0","description":"A MetaMask compatible keyring, for ledger hardware wallets","main":"index.js","scripts":{"test":"mocha","lint":"eslint . --ext .js","lint:fix":"eslint --fix . --ext .js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"repository":{"type":"git","url":"git+https://github.com/AlayaNetwork/samurai-eth-method-registry.git"},"keywords":["platon","ethereum","keyring","ledger","samurai"],"author":{"name":"Bruno Barbieri"},"license":"ISC","bugs":{"url":"https://github.com/AlayaNetwork/samurai-eth-method-registry/issues"},"homepage":"https://github.com/AlayaNetwork/samurai-eth-method-registry#readme","resolutions":{"mocha/**/mkdirp":"^0.5.3"},"dependencies":{"@ethereumjs/tx":"^3.1.1","@ledgerhq/hw-app-eth":"^6.2.0","@ledgerhq/hw-transport-webhid":"^6.2.0","@alayanetwork/ethereumjs-util":"^5.2.0","eth-sig-util":"^1.4.2","ethereumjs-tx":"^1.3.4","ethereumjs-util":"^5.1.5","events":"^2.0.0","hdkey":"0.8.0"},"devDependencies":{"@metamask/eslint-config":"^3.0.0","babel-eslint":"^10.1.0","chai":"^4.1.2","chai-spies":"^1.0.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.1","eslint-plugin-json":"^1.2.0","eslint-plugin-mocha":"^6.2.2","mocha":"^5.0.4"},"gitHead":"6c0d7f6780e2656512f5aafdb3ce050e960b0763","_id":"@alayanetwork/eth-ledger-bridge-keyring@0.4.0","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-LdkTnFTLrSYvL3w2spEtvs6RWgO/hlpTXmwDmPjOf1iEW5O6v+RIxNjadw036D+ipvJ4JinwLhp6LzjXjsPrWg==","shasum":"0435626f10d8311f68a68077ddc9ef9860eecbab","tarball":"https://registry.npmjs.org/@alayanetwork/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.4.0.tgz","fileCount":4,"unpackedSize":24036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQAkhCRA9TVsSAnZWagAAAhgP/RPjUsHToceQgAWu2Daj\no8CZr24jXYutKudezasbFDoSlKaqctprMMeIrDJ3wz0WyU/I2G3uhihwNwip\nNW9ObICYnYqN0fr25uSvv6hytsp5i8gbCAfga3CfiKBFhs8jcpd5tk2b5ynG\ncnWm/iaLWLdBZOrP832zdgJDsD9kIPcJa+bCQLlnZPd6n/C4Pbf2wPKb8pc1\nkVPDMv9Pnkalomh5Ft1UXCqmrqb7jgK4NZn1UVasspug8k6xLD5TbPbTFKXM\nvIu1V9YZgW4m86NcUOEh0ll5+ScuRSIH+tXKasMZqMpJH7E+WuvLhWk/BZZ7\n+blrGpC1PCD9UvN5xKBiS9+VO65lnvDZLXTRmrtrXMTSi3Kz+DgsK2kQrDI5\navJOPwrrP70nq12GHkS0ayx0NCfXagOWPWFdJGFCnKFCVrADAR0BSZBNEeTq\nkpvPSk9yvHFssRnrMGfAAgyN0jcmnDXUCh5AmsdDEa1rSjvF2cTh8guiXZ0c\nFXx3Egg+m74PWnjtj3SnU4EvLLQLv0OoF3LeZ7SjVO5ehOQBzoF6Hbz1+9Xj\n6RIylZ3RIlGqaoli+9ZfQ7a2jePOkWcfCrm9BMuml+R8P7QtLQfLGd9gC3wx\ni+3FnpOTY6nFJN5Pyp94z+R2aqmvDSInYEgIOOYfwXLchT++LJK7k01pRqsk\ni8B0\r\n=Oows\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxrhAUQBa1jvLAiqgJoWu7HXE6XOjYT4KfTKwSJTCYhAIgBzYKElKPg8b70/eHO1b4W3CgkH3gTjRtjTnroGG7vZg="}]},"_npmUser":{"name":"alayanetwork","email":"npm@latticex.foundation"},"directories":{},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eth-ledger-bridge-keyring_0.4.0_1631586593208_0.9486266359414628"},"_hasShrinkwrap":false},"0.4.1":{"name":"@alayanetwork/eth-ledger-bridge-keyring","version":"0.4.1","description":"A MetaMask compatible keyring, for ledger hardware wallets","main":"index.js","scripts":{"test":"mocha","lint":"eslint . --ext .js","lint:fix":"eslint --fix . --ext .js"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"repository":{"type":"git","url":"git+https://github.com/AlayaNetwork/samurai-eth-method-registry.git"},"keywords":["platon","ethereum","keyring","ledger","samurai"],"author":{"name":"Bruno Barbieri"},"license":"ISC","bugs":{"url":"https://github.com/AlayaNetwork/samurai-eth-method-registry/issues"},"homepage":"https://github.com/AlayaNetwork/samurai-eth-method-registry#readme","resolutions":{"mocha/**/mkdirp":"^0.5.3"},"dependencies":{"@ethereumjs/tx":"^3.1.1","@ledgerhq/hw-app-eth":"^6.2.0","@ledgerhq/hw-transport-webhid":"^6.2.0","@alayanetwork/ethereumjs-util":"^5.2.0","eth-sig-util":"^1.4.2","ethereumjs-tx":"^1.3.4","ethereumjs-util":"^5.1.5","events":"^2.0.0","hdkey":"0.8.0"},"devDependencies":{"@metamask/eslint-config":"^3.0.0","babel-eslint":"^10.1.0","chai":"^4.1.2","chai-spies":"^1.0.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.1","eslint-plugin-json":"^1.2.0","eslint-plugin-mocha":"^6.2.2","mocha":"^5.0.4"},"gitHead":"acb70b608f7f524f00a3a1d36ae4f7b1d169ca66","_id":"@alayanetwork/eth-ledger-bridge-keyring@0.4.1","_nodeVersion":"12.22.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-qWsvKvW7IBV7p0DK4n4Z28lztsWAGG/RUNHSPR0onO7E+/YP1nmNoR+9Zu8iOqobc+fwP39U24WSHDmyVsEswg==","shasum":"8f16d33717a0f0ae94d2f59ce163894585f458c8","tarball":"https://registry.npmjs.org/@alayanetwork/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.4.1.tgz","fileCount":4,"unpackedSize":24144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQwBlCRA9TVsSAnZWagAASywP/1J9eoMjOa6ASTezUISP\nwMB5n4Danv6ROVPCMDxEb+pqJPasJ4fQXx1o44v0RXfeGMBYWsg++qorJ2uE\n4AZxqoZVD4T1nQ6y3+w2xHCx6S7/XU6lx+qJD04RNn//CJx+Ex19kUBbNTaX\nVfXINsobQ3QJXTX6Fb+X/gJTY6YKl5n06FXlh6o+jCddyQlSeoQUXd8r10nu\nYl5G9fQlIdB/93pifd2ckzyRzmd+O1Y2wdfq+P+33x0epMswAvgirQX835+9\n6n7ooQY0r9dbBeTK0QLiOAUUjlXHtZRmSLerbV2wmlPjJGjR0Eo+uDiWS2f3\nDKuRobTQxNct2R6kdtx5ua6cQ+A73I+BtE+hVxgW7KSYCr9caPufNu/fgwLM\nBa7zmeXhOr39MaXX40h9TTpoJDAsoB2Xzz7ma7ouJSoZAguGD/BlTTVpIKw6\nOCIQs9um74j0pwn7EhOrO9XqK2i8nJuu/FmX15qWzMoR3YpbRHRH2wB8eEy1\nAhgU94XFJvHFvGe7US09ur25mjjn8y9sbuMYZyPl2bTOGiUWQJJJzMnmaKdB\nH2XAGpyj6Ayi9WYEPoCrgyxWKx0ElQI7B+47EbH5JyuCG+Op1IJ0NOaugP91\n2oZYhPCbKe1AgaUJnqqYYenGa9ppIfBwkotKtBzyzt2kC4ifV70nRsaNNBdu\nJ/ly\r\n=Rr93\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWuQwlI+SDvtW3gXiFNSgJP+IS0yL1YxqPI0wyhygJigIhANyIts+8JyAUiOrkM4d8SnnOyeo/E+PQAYeq6Dm+WUyt"}]},"_npmUser":{"name":"alayanetwork","email":"npm@latticex.foundation"},"directories":{},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eth-ledger-bridge-keyring_0.4.1_1631780965480_0.2988918083797447"},"_hasShrinkwrap":false}},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"description":"A MetaMask compatible keyring, for ledger hardware wallets","homepage":"https://github.com/AlayaNetwork/samurai-eth-method-registry#readme","keywords":["platon","ethereum","keyring","ledger","samurai"],"repository":{"type":"git","url":"git+https://github.com/AlayaNetwork/samurai-eth-method-registry.git"},"author":{"name":"Bruno Barbieri"},"bugs":{"url":"https://github.com/AlayaNetwork/samurai-eth-method-registry/issues"},"license":"ISC","readme":"eth-ledger-bridge-keyring [![CircleCI](https://circleci.com/gh/MetaMask/eth-ledger-bridge-keyring.svg?style=svg)](https://circleci.com/gh/MetaMask/eth-ledger-bridge-keyring)\r\n==================\r\n\r\nAn implementation of MetaMask's [Keyring interface](https://github.com/MetaMask/eth-simple-keyring#the-keyring-class-protocol), that uses a Ledger hardware wallet for all cryptographic operations.\r\n\r\nIn most regards, it works in the same way as\r\n[eth-hd-keyring](https://github.com/MetaMask/eth-hd-keyring), but using a Ledger\r\ndevice. However there are a number of differences:\r\n\r\n- Because the keys are stored in the device, operations that rely on the device\r\n  will fail if there is no Ledger device attached, or a different Ledger device\r\n  is attached.\r\n\r\n- It does not support the `signMessage`, `signTypedData` or `exportAccount`\r\n  methods, because Ledger devices do not support these operations.\r\n\r\n- Because extensions have limited access to browser features, there's no easy way to interact wth the Ledger Hardware wallet from the MetaMask extension. This library implements a workaround to those restrictions by injecting (on demand) an iframe to the background page of the extension, (which is hosted [here](https://metamask.github.io/eth-ledger-bridge-keyring/index.html).\r\n\r\nThe iframe is allowed to interact with the Ledger device (since U2F requires SSL and the iframe is hosted under https) using the libraries from [LedgerJS](https://github.com/LedgerHQ/ledgerjs) *hw-app-eth* and *hw-transport-u2f* and establishes a two-way communication channel with the extension via postMessage.\r\n\r\nThe iframe code it's hosted in the same repo under the branch [gh-pages](https://github.com/MetaMask/eth-ledger-bridge-keyring/tree/gh-pages) and it's being served via github pages. In the future we might move it under the metamask.io domain.\r\n\r\nUsage\r\n-----\r\n\r\nIn addition to all the known methods from the [Keyring class protocol](https://github.com/MetaMask/eth-simple-keyring#the-keyring-class-protocol),\r\nthere are a few others:\r\n\r\n\r\n- **isUnlocked** : Returns true if we have the public key in memory, which allows to generate the list of accounts at any time\r\n\r\n- **unlock** : Connects to the Ledger device and exports the extended public key, which is later used to read the available ethereum addresses inside the Ledger account.\r\n\r\n- **setAccountToUnlock** : the index of the account that you want to unlock in order to use with the signTransaction and signPersonalMessage methods\r\n\r\n- **getFirstPage** : returns the first ordered set of accounts from the Ledger account\r\n\r\n- **getNextPage** : returns the next ordered set of accounts from the Ledger account based on the current page\r\n\r\n- **getPreviousPage** : returns the previous ordered set of accounts from the Ledger account based on the current page\r\n\r\n- **forgetDevice** : removes all the device info from memory so the next interaction with the keyring will prompt the user to connect the Ledger device and export the account information\r\n\r\nTesting\r\n-------\r\nRun the following command:\r\n\r\n```\r\nnpm test\r\n```\r\n\r\n\r\n\r\nAttributions\r\n-------\r\nThis code was inspired by [eth-ledger-keyring](https://github.com/jamespic/eth-ledger-keyring) and [eth-hd-keyring](https://github.com/MetaMask/eth-hd-keyring)\r\n","readmeFilename":"README.md"}