{"_id":"identity-wallet","_rev":"90-c73a13041596b3d46a601866cc1e3b06","name":"identity-wallet","dist-tags":{"next":"2.0.0-alpha.20","latest":"2.0.0"},"versions":{"0.0.1":{"name":"identity-wallet","version":"0.0.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.0.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"f43a5b1bd31beaedc97105f914ac7594b2ecf265","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.0.1.tgz","fileCount":20,"integrity":"sha512-gAzK+epbqKlBkySi3E8uUFzV8mnKrk2/FYWtZdTmdespXLZnwRadxXS5HaOs1+9eEGbOeJejml0LIrWH7azUCg==","signatures":[{"sig":"MEYCIQDuFyQKSiXmH8TOKpm4+Hdha2c6QhkY97u+jciruOpUeAIhALtNSkJ3a4fR/rjSiph9bO9y91ztssnsdGA++0LrGvw2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJtiOCRA9TVsSAnZWagAAt2cP/Rnnie1s7NE8Ayg3C318\nbtWl94y93YD/URblGBnW7slLyQH2OSHp9TTLbJXlfP9qSCfszR5z+RKPNFnK\nLeuMhYOC59O9YvvYltA9Nrv0Bb1evHU0w6sCcxFhOZuitAh5/Mpst52hLCKL\ngWOHKWdv3I1eKgWp/UgareCEJJ5IFJnasa7yfgwS9IZqtWAAOH0N8slsWhW0\nhjfeS0DOyRSFc1iVGWjnatCF0FHQ77Jfwi+g1u9qrZ0Zl0q0cZcP9S/S1ggU\nz+mc9EoNj1rOhnMAD6dlP2uPq9ZGHUSbppJJcWBs9H13jDRFtkZOMBuE/zIV\ncqNRt3epeFxSndeaygGIKmu5A4V5l/N45QrrGH6IA9rujJ61qo03RtnJ/9Iw\nV0Kk3nPf3AmqGJrqRjVUFMiXNTxjVP/8d2A/prvIgxrhtPmm8sgfKTcIx+9p\njnk/1bbXZe9MkaOuHyr/t+IDYkLJHwsjFR7e5o87+fcdc7a+hdKcgEGUolpT\n+gr9f7qDOJADt3QunfFIrk//nO7Qkclos/Bqm1SbvuQgQ0ZD9r7qS9GOxB8U\nUG5ncTksy/5fjJoxsyokdynvci4ubjDvlQkTqqiyDsQE1xfxty4/fJ0GLvnG\nXAUswEMuV/cthAwG2MuqFsm9ShW81xpPj7eG3vO+mpc71Wp9UW1dpUARN6Kn\nasBS\r\n=Bbiu\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/index.js","browser":{"fs":false,"child_process":false},"gitHead":"2dd0dd3bd6d1e631941a56c17dbd7b989ee16675","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.0.1_1562826893342_0.7306463686849185","host":"s3://npm-registry-packages"}},"0.1.0-beta.1":{"name":"identity-wallet","version":"0.1.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"e507b7c9aa27e072b187e3540a28200968410ecc","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.1.tgz","fileCount":20,"integrity":"sha512-oGEw0q9ZmX+mRX41Kspk0rFocLfLd23CkMSjfO0xVPmCv9gPAVtD9YaHXZfGERi9h0FvnJg7jLsLE3/qvJkalg==","signatures":[{"sig":"MEUCIBvoPLvHUf7RmAtRxAfnQ12xNQ9ESllru2fI3RJ2+fhCAiEAt0FTF6URvgfpZWEc0UdiMEcJDEQOfc8JCTbZz/0kQ3k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":46856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMDlECRA9TVsSAnZWagAANb0P/A+buQOE+1z6AeFzqVpe\n7adO3loZJZmXI87iMioR04aqjlDk/k0vAQo1a7M6eE/wgy8HHYRhG+WaPV6B\ncxgEKwp8HQPyAWaHN7ENc28HNSXnO23rHvjcOYdUwAmEmsQ9aAL89PbuBx8K\nFQssTY3pub0CR3YLUhKpKBFHWggAq1cikZwAQBb5axcPW6FeEoyMpij/rYf9\n7Xl8qEiyVoSv99h/mtFEAPk5WAcolielJY79tRuX/nUb2+MLJONe/hv4d3tg\nR2/icEsi52YYjsLaOHIifyTLmu1ylCYScSZlfglYVkJLfvZ5+JccwGVmRZCK\nEHFZ0IAFKateJbMYPqq6dzG8L3CD6fu9F3IjoHXDZ0fgqJLpWx4/WC/1+/iX\n5MY/WLjiur0Y13gv+SoguW3BDba99OVKUXIQNzExPHbAPtnuv39RvKSuibFH\niPuDmuUkAt0EBkFdrygWHITVfHi8Hhzi8PH4FwFuYh1V7kMFqmvTfC0d8yXC\npEhIRtJE6nUcuRVAKcybZgqQtZkG07cISeOKCH0iRk0kkaMg2gpDyQ5H7246\nLbcbkq4+u0MEjAy9FR1E8CMQVhy/jmHzG02oOg3cRos0eInsE4ahsszyLn5e\nDz9dq7CPP9i9hKqtdDdXqF9n2o3scqLYdJoG7SI7HxsjWGjrlKqswwjsRASt\n5t33\r\n=SSGs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/index.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n\nThe Identity Wallet SDK allows developers to easily create a wallet that let's users control their own data. An identity can be tied to an ethereum account, ethereum smart contract, or simply exist by itself. The Identity Wallet can be used together with [3Box](https://github.com/3box/3box-js) to sync, update, and store user data. It provides APIs for encrypting/decrypting data, and signing claims.\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n","browser":{"fs":false,"child_process":false},"gitHead":"1294f3a4fb314808115ab058a1dd8d6dc6fb09cb","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.1_1563441476254_0.5210802291418892","host":"s3://npm-registry-packages"}},"0.1.0-beta.2":{"name":"identity-wallet","version":"0.1.0-beta.2","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.2","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"d07fbbbd7fe3b41cc2b55174cf8e17a942f30747","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.2.tgz","fileCount":22,"integrity":"sha512-77OuZ6zFfqVrnvHsh1Ng+QBcSHD0qpGuVIUf2h2/GwVqJZJ8h9NSGY0SyCEFslP33toZr1hR2eRHFt688B1hBQ==","signatures":[{"sig":"MEUCIQCxJLaQIxApzMLiAmc8kajNffW0Qa27Hc/92f4qdGsOMgIgB1XP8HN973u1dZhl/ePv29MSX8WWdn7tdCJAGpCWPl4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2057355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMDnUCRA9TVsSAnZWagAAkAEP/2QBd4MmnAtR5Wkb8zDn\nPA7rk1RmYeS4o+j1e0VGkUiSpjLmpsrVQETTAxjuBCSHa7wnRssQV4+3WrJW\n0AQUjFYSlQ/TfGDdhhifqvLk62PtHTWBl1ikFbm2X9a+nxw5UtcJjpIt6/o1\n8T4BtdnETSjpt3ZVxqdiK0jepo952MEmxayvHXq3aJN4410UrIN4+n3DWFY6\nwrUF5Pu4GqCLTWOIFgYSCeB7HHkDUJUAB71S568wrp4A9YDJsoSDiK5QAK+3\nym6jsBPdl4aMHjsSSfuq0oD89d0SI4iYY5nYQBcns0JRbo6+8YoGNItA/yTO\nO5E6Cfyf2iAG8KWSym8a5+jR41a7gtNIUzmk1kY6/F1rd/xw86UzqWSPdT1y\ngN2T1A2GBmyYmmJgW4WR3m99C3VsxQ90UyyW2Fe7y86kSj52f4RiA3AvVY6i\nNOLhLCRl2b/F80ekoAU4PieapNlEFp18Qf2AI9lMTiH2ZMgP6Sb4Pl03Y2U+\neVjvxN9WZWE3JO8al6YNUK3z8aLMmD7FrJIYpfQp04ABjPu+LIA0mA1/ajBc\nTKCrEjVW35OZZblwH1AY+bhNLQfkCYei+MpNOvbG6j0hXOBZ06AEaTGFLJFO\npxJMbhY5Bf8NPJqc+MBVTbbcJxL9DV9JmIbJhpvrvZGztDnBj03OUZn/0MG+\nJfDy\r\n=pQ6H\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n\nThe Identity Wallet SDK allows developers to easily create a wallet that let's users control their own data. An identity can be tied to an ethereum account, ethereum smart contract, or simply exist by itself. The Identity Wallet can be used together with [3Box](https://github.com/3box/3box-js) to sync, update, and store user data. It provides APIs for encrypting/decrypting data, and signing claims.\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n","browser":{"fs":false,"child_process":false},"gitHead":"24ac4f7b33b42367247fee0b6b4a2e9ae35bfe9e","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.2_1563441619528_0.10000121384747862","host":"s3://npm-registry-packages"}},"0.1.0-beta.3":{"name":"identity-wallet","version":"0.1.0-beta.3","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.3","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"4f00195b480928aca3f7f52fc91d5ea644dd388f","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.3.tgz","fileCount":22,"integrity":"sha512-85DYAySjMT0rd+oAm/EhQEWwLxwItw6uPMCvtBSacvSRo8CNfH0Vwy+SZFISr5CzE228eeB1wFRlYrsk6eF4BA==","signatures":[{"sig":"MEQCIBPWKKR7NiMzMqASGlcJbCgRauuWx/2Ur4bvDdGs9AhoAiADL+xmbTcagF9vjxmo/CFIs9CuzuC0fSGuHwUoj9vbCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMFy4CRA9TVsSAnZWagAAE0IQAKUeIiO7vdSDchlK9DaP\nqwez9j8aKVzoXkW7AEbVJGdCtWOsRPQBOdhA6lXBX5WsqJ59DAWy3UxQiNcv\nbBTnpZRGwSGokz4tEcTHiWrucQGkuzVqTyPifq+thaMMOmF4CX/ipd0WoBtz\ns0cpePg6hRKNnRJuk6DbsTqe2otAw7Rl/TrDGIiCkF+13RAbIghk34oZO3uJ\nkaQ6i5/3lx0FdGSsZsWAZToda6eDhhyIBjpvXZVGbzDq6ny16PSRa6x9uQwM\n+dKS6Labi4RQ5HBWDm+VIBiL6ASFwrZ1RhWN+hSlsPeRZohkfPnZljvPvOVo\nUSXDE/yKLSlVKmAUWuiKvTKYXntzuUvsBNfbeXpM69xpW8564eXZflqkXL+L\nqI2ftylcmllHrA7taqikbILbOY8bwXOXbQvuq7lKy8eBWm08y54sWoqyXGQw\n24BBJJNvZDlrU2Cw3CbJEt6tE174v86HWyk1OIiBkrYMxZZRxKzGSgPzzHAM\n7sAVzWv6G65/T2Fvmd6e3IEUUkOGNhdlS5oNDV/zVlS6j6dpcjxHC0qbrczr\nD6WUjuOOhF7z5iQXnovcAEou1YcjezCD17l3C5fwHYMzCgbRoEWzWRxVvU5d\nVgD6NZ9VNPaKudsxy1g0y59DL+izZt0OGgzr9pFPF/c8NfJL1OYh3qCdlKyr\n0iPL\r\n=i1HZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n\nThe Identity Wallet SDK allows developers to easily create a wallet that let's users control their own data. An identity can be tied to an ethereum account, ethereum smart contract, or simply exist by itself. The Identity Wallet can be used together with [3Box](https://github.com/3box/3box-js) to sync, update, and store user data. It provides APIs for encrypting/decrypting data, and signing claims.\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"5fd2a84deae802d910228f158fb12067ed4865f9","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.3_1563450551502_0.8556137192793667","host":"s3://npm-registry-packages"}},"0.1.0-beta.4":{"name":"identity-wallet","version":"0.1.0-beta.4","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.4","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"5d99c5abe2b35dd07f0fea9751cf05b2e0883a16","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.4.tgz","fileCount":24,"integrity":"sha512-Yg7KFQJrilvpHKejidJNlIEy1GafR+7yU76HA56eVP6EJWeCpNqVtic2XUGSxzlP+N6QWxUYmcAy6kc0kieKVw==","signatures":[{"sig":"MEYCIQDSK5RXrrqdf7+rmeCHNRoH1zdatFWqDa3FtI+jmvgRHgIhAMlVgOrGliUolzQEgGH5ddHkswNy3vZmt5UQ5bJOhvub","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2138786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMG2KCRA9TVsSAnZWagAA+OQP/AtqFYL4Sn3h7Yk8UEiR\nVb433ZYDt/iHNlKfhCJEarEkbNj1bew5/XS8PPD3zbcElOdyvGJ6ySXVN8w6\nYD5e1p23jwZkdD/M8dGlwVhzlvydj9j2ZaZBpK0+Nehzdaf5RggemU10/NN3\nO9EPE6iUMN/+Sl458EKgq62HFc9ZxAN1p9I2NE8Tt0FV2kVz+uhwlsycJDMl\nBkeSnZYinOHmqo0EZ0u2ye8bKvkQb86L0AhFe+VJ8CdFnOigZplHcG4l3fg9\nXhKqNk8U8ERYnJibS/+lCFlOZCTJhO0wvbI1Sy0kYa+0iMKLJisVv1zPAB+4\nVcaoQpHOT++Tzi1OsKO7fve2w/kD+Rt/pimMJKPon40BTOiHMWeYzkNqkAPH\n9/c0JGFWmS43csEDG0PH965jPWF/F93bYLKC0jSESKyZzgYwnfjmGQIWcwPJ\nR5/6oASBatVsN+utXDdqy0VhlrF3nPYhWu2mjxM1gpPxnZjpI7lbO8KENOYx\nUCVHDuEwjGTFGFaih+rfs1l21WsAle5UggKzI+DMgLqgRTRyFjBcu9epKnwu\ndjJcwOzmTNgGuvaYmxWicFvuVbiLXpIcgl5/KWW2LaOhxtQOX3EZWjMweoZf\nbpGIptU8rF01mLQvT5sWm0kUCC4O69UBhhRXvrBpNrB0Ch32x7HBtX5prcMV\nPPu+\r\n=Kfm0\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n\nThe Identity Wallet SDK allows developers to easily create a wallet that let's users control their own data. An identity can be tied to an ethereum account, ethereum smart contract, or simply exist by itself. The Identity Wallet can be used together with [3Box](https://github.com/3box/3box-js) to sync, update, and store user data. It provides APIs for encrypting/decrypting data, and signing claims.\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"772c7710fd211ba13198d8450a4fa5999f2eaeb7","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.4_1563454857505_0.3338581882852707","host":"s3://npm-registry-packages"}},"0.1.0-beta.5":{"name":"identity-wallet","version":"0.1.0-beta.5","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.5","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"533bd8091bfb35e93a467e2eb6e99314edb35a21","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.5.tgz","fileCount":24,"integrity":"sha512-guVulFqAm0MgIX9+iXdqlkK5SI43OHrrRL1AzSTRcyplRBMbzuSfEENUwbcp3vzhifC3UBM0UkM4ltHQJJpq+Q==","signatures":[{"sig":"MEYCIQDbBvevQU5turC+6EAGFviAjLe0/KF5dm3eVKS5xFnxPAIhAMmDNc5U1k3K6GcoZDLdw7DvMNtQ6rbkoiso1vBE7m4n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2139387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMZetCRA9TVsSAnZWagAAHGwP/1z4qm6RRK/3wmYlGwcX\nDwPL2ElZ5qx3+kwzddpwZRD7M3Cn9iMrYO0fd3AfDyJwQMgaOWaRDAl7mbTQ\npElfZLg4ifNWDkKw3g1NOApyRdAuXJzbYTMjiLe91yHUmvfUb7dhIMXX8D0N\nILm61TqaW8Zl0vv7ybyLFTSLykDHRqj2YyR5rYbvFVXIdwvXpG8uz91nkR8X\nSrwKGuuD9g9zTvM+EVQfHq0t8vbUtdLRGhTe3FlBnusqTFwzW9FgzboxdMJV\np7aY5lVnYXFdxyzvNHDjPoedepyENVpsV0PTULTFPcAdQlc+OX+3aphERgOF\nVNXmG/GgkfXjEFXuSWaLPS9JZr3/lmiK7PhVAwRtFlhYiFrPzNU5tYdlGVHL\n0N+3CEOfhFOcHBv5IeI6thrEq8LaPGbeAoJgTRE8pRasSosXNMPNdFrTEyTW\nsQYd0fwfpn/a5gknMmZqyzyl3PaYUSD/InQ/93fLxSwNiEUhKfoE+PEjJJL2\nexXAKgcP7n3Qf7qLQk3uTtZ6WNNcxfSOy1Y/GDoi8MKQ5l95qVYRi6qC3eft\ne140sIO0G3lBdE255h4T+zy+peOfPc5xMiiLB6IZe/LnnM+8eCwrZK3Xvf8T\nHjdUFOX2ghiQ8znCQivRPjPzQhxedqDTt9TaVA+9uOyuR6rTwxPTvDxL3izj\npGmv\r\n=Jxjt\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n\nThe Identity Wallet SDK allows developers to easily create a wallet that let's users control their own data. An identity can be tied to an ethereum account, ethereum smart contract, or simply exist by itself. The Identity Wallet can be used together with [3Box](https://github.com/3box/3box-js) to sync, update, and store user data. It provides APIs for encrypting/decrypting data, and signing claims.\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"e7e82cd717131c679043c1ccc8eb1f0322372884","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.5_1563531180588_0.6304402924888537","host":"s3://npm-registry-packages"}},"0.1.0-beta.6":{"name":"identity-wallet","version":"0.1.0-beta.6","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.6","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"5d8808c9a424ac84032662bbdc722ca367024d85","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.6.tgz","fileCount":24,"integrity":"sha512-8n5455f5Mjzp2X+nYC6moMC6tfdwkiMLsdt9IIjI3l9qwsAXy82tBAC6/Q0WQ2KYhBC66MXGOQAnjj4A9LSS+Q==","signatures":[{"sig":"MEYCIQDnzMQT+zp+PxNMJwxkX1srxvJuxjb4XmjdfsFjO8BBgwIhANZ7NKDxS0v2pdqVBWr8+kTQPfd2oNcAcvNwubTxI4Av","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2139502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOaT0CRA9TVsSAnZWagAALAsP/2162l006LoL3F/8a3vn\nCZ7f2iUqiTEw/SEvFfr8OXccZMfNr3HFBPa6Kl+TtBuy28tIX6Z0tml0NoOI\nhAPdYiw4FzjlPb7vipMy8QTiSuTkFffrCreoZgnXLEMF7PC2PrdFz2wt4HU2\nRD/Q6Mt/u+NyiymQISXAeWoVmVOQ9Lt9gzkuogowwWFGJvcbl//DY76JAW/Q\nOt+giE9w3416nkaTcXzSeZoWgIYwf6PBoi1jgX4JSs3S5uGg8ihaKQ+n/pTV\nt5shOoXsIlCsb5kAzUJ555Qms5aLX4bCQ99FU6UJtA2Pkaeht3GwiOU3FS1q\nqCZmBebhgn6ruQX4L0u82Q4gfL9/5viix4/+mWMCWUwOShTtd5G2KgzNadKj\n+ubVN3S5g1FbZ/rmv6njCRBIOFex0RIbfG0Hs3CK1Q/lr15FhnPya1yvoZo2\nRTYAZ8pjXu7Wu6ks9q0XCn3dpE8zBBQSses3ic0fZvaaPCptIJqtxZjp5TdV\nF696opv5+h0lAu34nzW3BUv/iEquqAlN/10zZcAWKQlbYXIg1NiHhevftgbm\nBLgbce7waohwnBGe2FaiiCBNj4cqgduSE+7SxJIKPhnXjnFoGbCIq7XYbEd3\n2VbFuyfUuAjrW9jK4Umsl9JlAummKuL+IQ1EODCY5sOC5b0Qiu53j0cJXUtQ\nEpK/\r\n=HLz+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"cb54c4f3896d6162eee15f98a6df5b131844dd7d","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.6_1564058867719_0.2337581553617838","host":"s3://npm-registry-packages"}},"0.1.0-beta.7":{"name":"identity-wallet","version":"0.1.0-beta.7","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.7","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"7facc836e89520bf23a235edda9888024675347c","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.7.tgz","fileCount":24,"integrity":"sha512-yrYW6Ttn+S8WB9wWIQH4NtBFOLE5vpPBrRgKDTeN0d7HcU8oGhZjpwRJ9UcW9xwnxkrW9sIkovd36OUjYkdvEg==","signatures":[{"sig":"MEQCIHtdyOaDN6L/051DkEcuKrIY9kmXjy393qInttJbatNkAiA9+5EHmcNiboE0zvG7Ef3xOQ57ROcE+LjtRUJbUFQb+g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2139461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOaXWCRA9TVsSAnZWagAARNoP/j7rmceIXnQtsvHzJpRw\nnqPvZL/eQTljn5MA6Zq/CcdEIwLW9v/0s1g84AZZQkztWISnRBqIaDtpvO4D\nF3uCl4ADDPqpGxqoF60ggQvM6LGRaQ9RxC+67piznk7d1wRRvWyVT4ArI/++\nzIrStOtwFI2v5uPciNOiE1j+5p5diuPx0/YGVv0V1qMrHNJCSIzyhE73svbs\nkxattQzUGF/vIwOLfllDbVDQgh4wWxyl7fo3nYjbZFbf7OsMN+3ho01YOOxv\nzYxxdsAFCYcFdL8sNmmdaFPTnmsWdvoHX+ZeFZAWY+G+9kisU7ARZ9Y3A+b4\nMePtYeAEReMPEzwIUCPYJZ3E6/5bRwqmaw9YauWk+C0naPidcPx3tUc5ngem\nO7FszPsMlb7lzdrtIceD6TXHWYqlNgEOOrTGu0GoWSKV9QIfWLiq4vpNS1TO\nlhUXCd5NThAc5xSu+Keaik8VdcLtlHqvjkssdiJTnoAbNCEm3k5ZijP6aN4F\ns+o/52sT+oXujE8p+HFKGTTnxIs4TwaP72PxPhxd4BJbp21ITMQqdG/fv12Z\nIK/xOUFzDPUzPaaLVUEg0d242RGeVnQvmIKS0CNwBfBAcq5VMeD0srxcrxsx\n+g3cdcS61jvGVby0dH0IBDclFW3JXV4i0P/SXoq1pOqGB312RS7HAmtAgmrO\nhzDC\r\n=H6cj\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"e35a3c9611c6702fa82ab781d95ac030416dd857","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.7_1564059093406_0.31765052560047446","host":"s3://npm-registry-packages"}},"0.1.0-beta.8":{"name":"identity-wallet","version":"0.1.0-beta.8","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.8","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"97e33bf8cf5278a5fdbc60c4a19fec3c0e2e8f24","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.8.tgz","fileCount":24,"integrity":"sha512-hnr/fvkoogWvotXuXW9ITlKKcA+5nqykPAF68otmtExlHoYqEZHtdD+oTXDn0wfD8RyJJiPLEB3OTM48WAyR4Q==","signatures":[{"sig":"MEUCIFW1l2WZ3pDpK3oYsZ37qYwiQPsbOLSiddktHbADbNthAiEAkY9iZprxmXYJjB3Ji7Gz2aJ5mJldvYPSMfs0AOA8MxA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2139801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOajoCRA9TVsSAnZWagAAvX0QAJJ47Z5ApKErjgmj+1qr\n8EWcKgUlHdB5uFXPzR3hZuhuIQ7sdJvOwpQvWY7vj2rXAZ0uxc3jz+Dq5GOl\ndLDkc+jpTs7zTi59R3fu9fH/3aGf3mAze1J3NU6/SlWx+AejIMlQrJcOfS9p\nnKMPDkvCe22dW4OfZ+7cDCIiLE3do7ZjWAJpuSlMX2aHFb7ukX1elaZUat95\nXtBJZQq3Cu/P7fUHPiEvOj3HQJYNnMKYJT76AsUA0AQpo0AVu0OpdBe5Id2u\nwun3tP8sEJK/nhUSoHAVSmd8Gl+Wd73hy6xaw5dh7cQq2R1YG9EFAMOaNtNF\nKD8YUfltGhB/vVvNwHk8aYO9vslVsiG5qRahrEk2JJLJh+vASQfpyhUWbFIw\no/5rgj4Ws4yU/qFsNKLLxXgdalp/1s+g/tDEvY8aPgoKTynTT66Vafdlz7FZ\nu0nkuYQo8G689SijXpF/TgH8IcelXUdKMilpjxVIoN7N4FdfTDxj6puN6PnW\nHlrwlqhUoEEfwznQlMqBYG0iuKDQ4iVdEpVrh2RBMR+8SvmjoA9Jm5bdm89D\nbre7e47/FZgAvjNIyunvRd84WKdhHp3JYKebkwOjVYG0291gmrWP4yKTge2h\nMHtHru/KbWWOjLeeq9c3jMsv2XzYECcvTtVAjDt9rEAKmAI+sKVxcwuGbUnl\n67ey\r\n=h+js\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"646ff37edc86dc23fc90284dedfaa460c4946224","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.8_1564059879509_0.7185672136817036","host":"s3://npm-registry-packages"}},"0.1.0-beta.9":{"name":"identity-wallet","version":"0.1.0-beta.9","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0-beta.9","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"8fcb05250a9ae906a1c1ee4bc1b229ba73ba54a4","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0-beta.9.tgz","fileCount":24,"integrity":"sha512-6M5uRIkB9E5+sLYEo0MBF3Ue4zf3/D3LCz4ShIjLTjq99iv0aFGY7/kXO1KZE7skBS9DKZuW47BDSgGlE990kg==","signatures":[{"sig":"MEYCIQCJP3HFdAVG0vCNfffJVRYSRzN559jfRzTqvRbbtMfppQIhAOO62flOWqrtzBTv6SSD/3P6ug5uxklDzkix8IF7YN5M","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2140312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbjD6CRA9TVsSAnZWagAAmTUP/28mH+vN5oTGYW+3NbOw\nFpMLlD5EgHoS7urc1czQ0DZIJ3Ve4oNkMdfMtKciHCrsXbjrjLrxLntFLPDL\nhzvNJ6Yn4wO64zYBNnEGuVEM9NrYB24Z3RVud5HeRyV5d+80BLDOpmsUFpRQ\np3J3GRu2WeMa7t88ouE/RFaoCxCXJClLtjJrnsU1az/JgG1q8vatg9HPpHFE\nq38SMLSExRFYhGFuhYgbEXMqp2Sv7duNIdjz1uLuivKbzJTTHziWnKoCeL1J\n5qpcWYXP/oqX04+0I7ZOUIew9/VxjOIX+qhedBfabxKEWcO6ZdlinG6JI7Y+\ngK0wtbhvYr1MqEsBVD+XZOQcsai32kdKlruCk+DN/32dpjOXUpti++ZO+GWp\n1EbMh4XDnzXZ3lYZlmBiaybYhGo3zptuM4N6nIWbaD2HwMT4xu+O0mMwKZTY\nSWKCfs80MERAaPcrrKHgvJ26m19v1Ld06bz/attW0tb9bWJDZOad5kJrkSR7\nMX42asQAKLuGPo+NmKsmqp1CMJVXOM58hI6QGY8hIsS92NGQ3PggGK2PauCa\nbN5bZp03BvrU3Hlh848qsEVvy1fAi8F0JhmPFzrCgKZ1kZaUxPXiVXky2X1T\nvnw68ukJvuv+sR/EjiInq46Qp1TwnH8vpvTgi5zHPs1hWIu/H3Qurr+u70GV\nVH2G\r\n=L2n5\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![npm](https://img.shields.io/npm/v/3box.svg?style=for-the-badge)](https://www.npmjs.com/package/3box)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst Box = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"e81458d2e9ef224dbd06126204e486d4dadc0936","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0-beta.9_1567502585504_0.7064086475086646","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"identity-wallet","version":"0.1.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.1.0","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet#readme","bugs":{"url":"https://github.com/3box/identity-wallet/issues"},"dist":{"shasum":"e4383231c907f30846d36778d1072745bfa45717","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.1.0.tgz","fileCount":24,"integrity":"sha512-I40L5ldKO1h5R/CDm3yiDBF9L9kE6iHNIZMJv0BWQWhYvt4GSffBoNFFfcfxVHpChheNNRvrzKPyCsPsaODAVA==","signatures":[{"sig":"MEUCIE3g6UebOhwBq3RKQXswtnN0dD/kFs8Y7cvPTApvxrCMAiEA7lNcU0ztoEzmxU1g81hYFUAI1T2jcSrOF5L3Yko/Lh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2143665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjHTlCRA9TVsSAnZWagAAaD4P/iNN9l2gd/hZguQVkTQ+\n1tJCzWIWa/vUkK//SDwzg1ywwVzklyu6JUv2uSB+hvpTSVQ5ZuVnnheOFwk8\nXzdFlbtHd9jHeGh91Iw9xp9igXQ52HiHTttqJ1GpFWZWiaoZKlgGoGTEXewq\nEIzZB90xGwiABgS64i3xjRr/3Z8t6qwpqbsdcM76/68fxYSQZC1rqjXgJP6x\ny1EVTNyX8SdlbkYEdkMQ5PJIlnuoCp7n/mbXvGkUaa4Jrlpu1Djg+f5RftGI\nQJnPiUyq6sX0iygCbCcQlrNSus+Y2Bqpyg5rS72LG9gkwiK6vzHRUQHFVM28\nGe3m9NUlA8MnI0i+gRd1jbbumnRg5TQoMZfttWifOqzFcGZKb+2cUdr+3cRi\ncqqSHabV+9kbwBX4FboIv8w0g2jnbRFz9Zu8SQGEJ4Vk0qH/ehi7N/gpxIqW\nicTqeh+OC3lORuj8C9Er0leErjUrSqf0mBN4sD8YtO8xw8AOnJrNXsQMOSDI\nrmBYaLYHRNZHQTj6vo3HfBn9q2pzM9mLZmSQmIlxGHMAFJ06Lv7lCJIe3h2D\nyRPe9mZ6p0fk0kmsuhUjR8KLR7DaqRa3eSq00zpIZA5psfxECmn8YX4FVaKn\ng/JQQAd1WnmGXu4sbyWY11aP0nGo0nrhzbomNa8DhgSZYb4nc+BUeQo5Pm1r\nxPpc\r\n=LICF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"15e37a405da13f8f8c9e4ce5702a8cb3b769c150","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.11.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.1.0_1569486052906_0.8791483719639288","host":"s3://npm-registry-packages"}},"0.2.0-beta.1":{"name":"identity-wallet","version":"0.2.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"77a9da2d61dc8bda99d61d1934446345b8e4b379","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.1.tgz","fileCount":26,"integrity":"sha512-YwNE+z7GPXJjWBVFmYFzkZ1LIK4v8d6KCXwFdR2uqUCVtgpHf0eT2dGbrL5tvhWMlwp2iDu4G8nmluVr4Ykd1g==","signatures":[{"sig":"MEQCIBhZIXYxhTc4aItsAzI49XjdHGn13BBEDvieCRH8wTJTAiA36xCA8yfsy/dxyQmagSG1D0A87V5Txkbzc3mX9EFxmw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2156427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmG0+CRA9TVsSAnZWagAAB8wP/3R1tlcPR6Kkd2ziinwh\nD/9D38k0uAwbxe8a+XfNCnV+eJuqydomztws6NriU8jBxsItA9VXcJ/WG3qM\nbiYX8dpey8c05/zMIpKiKUuoiVvy9GjUSqEef0D0JsTb+1bgEXGeVwPRwdlo\nzOt4ODXg6mS0BoIQnlwt+6ec6uucL3Di4AmrE2HTksx6KXaBT5/jAvDilPrg\npD0ELOknnqY9F5zS9uNmq0wFTnt5kuln+rYA3+XFf7bndnjVjthNAff+wqA5\nhLj9dTrORw51GlbrqMSHEgLHYIq0Mko05VZ3e1M5qHS3WGl34pdTZ5zqHLE3\n7Fr1X9+3qt9oQI6wk2uWTb7xdoJM1ZCPSG+qyCOgMva2lwbi/E1e11xdxaGW\nL8hO8kyk+xMqDzFJ+0kC7vPGc+LSe083pPmKSmmPAagEQNmlF8bg4a3xF3l8\nYaekOn1GcS8loit4n/3RsHmb1QlZeu2bdSKHhzGBXIqHILY5Xr2kpY8/yA5e\nkQsENvUAR8yCEVIzzaTa6Q/fKmbdTo7Dsu/0Rg9ra11sBGBkHKq/EOsUJw7h\nojbpOwe1MRO7d+8V9oOdtys14NsYP3txytQJ/krIgOKuu+1HROvWwK5T+XXK\nBoElpB1pVWSXfTwHPB4bfZ15ufF/1m2Y1K74OV0THQ2D00E4RcM60dxx8PJC\nfoIe\r\n=91ds\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"15e37a405da13f8f8c9e4ce5702a8cb3b769c150","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.10.0","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.1_1570270524467_0.8411192199092195","host":"s3://npm-registry-packages"}},"0.2.0-beta.2":{"name":"identity-wallet","version":"0.2.0-beta.2","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.2","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"13bc4b0b91e35df22cde97e680ff4db9c3efdd25","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.2.tgz","fileCount":26,"integrity":"sha512-lfxs6vsyNwu7gKOVGQDsz8gZIqfwsMw8xUrWI4kHyrISN5Gw02XP+em5vEqcLiLxpqYY3kxHVfHcNB3/HgDOnA==","signatures":[{"sig":"MEQCIEDgAZ9pWIRXrsCbL4vCBYiiTXnsMh2+lSzwsxPtvJKqAiAqpmD6CaEV1eLYeOOw+sOlU+4Ooj7BGsu0qU057ua3Uw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2785608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmpooCRA9TVsSAnZWagAAg/AQAIdyHz95ehDV2sWjvHT1\nkVZGnfjGQqdQz+OBHOCDaWEI8lRPWMIHSRH8ltF2xawIwGd/KJqktOOD018U\n9czZiD5/25PlhHKcBQ+h1CvBjbrFRakrJmEeMZOg+46aPvgmT2S6R0DWa+Av\nw8d4D3u72uQ3rFPyPXsIVlIJT1dbKRlePR7c+UfWVPRE0KycnaMTsbUdB0+u\nlcxkMUB0Dm3gXA7lJ1LeeJ4h1xo77VJKR2gBsORAXlJTCarfeOjsL+3XkmrK\nmb6SQYJUbxfqxcqnm9xQgRxSSqUHc/wu3FCKgh3qe60JUVEtSN/9DjZrarTu\nfMh6Vuu8VykrkUEzVv1RvVzjAe3jRgcI2Bghnsqc3EWD4p/CzRS4LvmD5CZA\nk5FUkaNpiK8F9G5wCcy76ZPxmVWzFDeQMc48CvgWLljS0Sd0Y97p63JgrrjV\nLyupIK13q0V1DuAVBRVVIa/ekLLre4AwWs7qx0sPyWprHwAIukP4Sx95zZeV\nqWuyNicWQXx4sqSUitu/FEe0Fh0JVCC3ZPK/f4kyCjd3v0q4mLfXv35i9xhF\n1rtbPYIs6I/RZr+eK/GRMBxZuE8AbWyAfCpRb6hIs3p+BOhWmgmGRLVJZtKR\nGYO60aFX2e5mnIq9CiGH9/5/NAasHjtKm3G29sPwKnWLO58qN+MDiwd0h9l7\nOH66\r\n=peLf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.2_1570413095382_0.5743019882292015","host":"s3://npm-registry-packages"}},"0.2.0-beta.3":{"name":"identity-wallet","version":"0.2.0-beta.3","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.3","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"01976226f97b4547b6e1ba79f28bcc056a1a9e28","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.3.tgz","fileCount":26,"integrity":"sha512-gCn9kPUgd+jQrU8Ug6W7hlSv7w6V4d7TaWJ7/QLWR3oKsGgREPXV31TbiAqQzpwpbs97wg/dcr7XI0xs8E8x/Q==","signatures":[{"sig":"MEYCIQCM2o0yruSb5Txlj2+n6ojwVqTf+s5LJ/CDz3BRpfERFAIhAM29pM325mViMmS9P95Q3Is3ajvZdCvp64fKz6n6UTOg","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2785404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmu0kCRA9TVsSAnZWagAA2DwP/2hgy/6XbO/dbQxwz8qn\nJe85EHqT9FlS9Twwsr48vFyvbjsigm+xMDZGw6wiim9CvtYZDq036wtYdZC4\n7HggdW1Hgfn4s1UQyNXESzpDbJKWCagcL7fvkQ3h6m97ntQ9VdPhExsL0/Sp\nWsumXrX1wo6f8vxGik2/IYEymLQiyLWC6UDLS5CwkUoDOzuU2lvsrJ0W4C9N\nCkTmxJt1mcCGLxuO33zP8cb61VlJH4F5Hmvt2fVaaK7If2M6xtSnpK04BSmd\nOtohHz90hCCeFl/NaXDNWkj0kOzQ1B9qrEtcZd4FFu4awGiUOyYilFZGGC/N\nV7QlBgViRAjLvBJLWLwiGA3q50TWac19Ee8zzadSrThUTZYWym8voKqbRPnb\nBMXEwQCAt9CD7VKcVDbdpiX9GXRIygb2Lz63JVHRxJMEdc41nKqrXqc61CyH\nDdOzkbVfk+dghYfmHlPaoYdVT2hsx37aNT5rhmrx0C8SSVRItLrn18MOR9wX\naLlJk0Q6x/v7nI9rdOox8YyuOqJ1xY05YqRPlOQdDHcNzALjdqZI9nRzNWC0\nD7hSDoQzPvtH+rnohxTZD17ru/1L7auRiXxOWhWdjtKKj2i6KA/g/gqFF/ev\nCFj70t/WDw8LoEa/IVt4PpJ+tTJlJVzYw1OKwGlneee5rgDcG0TiksR1/dhP\nHXpb\r\n=Q6/c\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.3_1570434339670_0.264267956454334","host":"s3://npm-registry-packages"}},"0.2.0-beta.4":{"name":"identity-wallet","version":"0.2.0-beta.4","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.4","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8e1479725d700be0665885d8df674e0efe6b3ded","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.4.tgz","fileCount":26,"integrity":"sha512-zjIrYqZ26PPu/1FuMDlow10ks9L7C5a1A8QnrcsRnFouYMzEwZCG0tSV8oiRQNzL00R0ZOV+PUVUFtUPpBOFLg==","signatures":[{"sig":"MEYCIQD4JvBY/HuXltlQY2r7cojqzRlBHLzjvco1lW9Qb68ExgIhAMWuiUKqcHjAmENNNRlaAzCQ2rvw4gaVdOPpS+4xPbR3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2785293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmu1NCRA9TVsSAnZWagAAvQQP/j5nDafHtLp2w8gNPdQc\n2eNlQLlEta/2Sn6EWXy42nlnn9KHlCqwzHYSdp/A7hLbpDM9LBWptkKuRrMH\npVDtJBp8GuI6ed/DossR+dVY3pPCa2gTjhtRAUQzJh7SGhghdAlLUlVLnG1C\nXfKblSSrMnArOwSTsh38Dho98n6j0jePv5qX/ZOvBVuoAMDDAhUB4xnbfGz6\neJWg62Ksr8thy0X8DfCbfsOxfDPWt9qXpZn8M7mb6IOCFtu7qDz+w3wgYnfq\n5wjYHzSm47Q/ev9Lww9GyvY0YA9cYnIbIC8gJw6wTtagUh5G7H7NTx2x+uO2\nsIUjSZve2FzZyiuEH4l+ebJBv+SG524/SWADnPseFOvOYiID6IEfVBSeSrWp\nuiGo3ZkH94BH7X5/ALR3ycOxNIMUCvT++9pXbDF5tE2nmAWDyMFz9eV8kLGW\nHh4+QsZvXOtFb+sqtAghyouEgfsrvUq0eVGgsMtVWnYrwQS8bIV4OU4dUedJ\nrKampRkcHC8XHdTPT3ayUm9NC00ovO0xlg00FiRgzjncWKypSUsI3QBbV+d8\naZmSeSIZUlDNHgRvc/pR9UW6C11IGMBVPP4eYMXEARi+/L2RTGH/8JvOY+Um\nqPkFKCprJ2wTKOYRv2C9TJqb0Zz6N49yo/dFTVbcdjyZyboF1Z3wjjiosle6\nrkb8\r\n=u4Ei\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.4_1570434380856_0.5717715156856702","host":"s3://npm-registry-packages"}},"0.2.0-beta.5":{"name":"identity-wallet","version":"0.2.0-beta.5","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.5","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"e4c978487703c6377b46c9697429df2cd35c6e35","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.5.tgz","fileCount":26,"integrity":"sha512-o6cSf8gVdajAi2elyjrw+E4Rj0QW3itLqklHfGS9UIDsVs3BvE+NLA0nTG28dC9lyHJzkqCtLWeeHkjS2B4XzA==","signatures":[{"sig":"MEYCIQDXOY2SAiTzlyEsQNplGUTvIIKgGejkQEEkDcK30BU7SAIhAJ7fB5QL0Gv3VwiazAAaw8nLRa7S0BlNwrc3/VhKr4db","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2771409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmu8GCRA9TVsSAnZWagAABgAP/2ljuc7jUR30+64tRJSV\nD9ve3M4tDm71xNHTpKb22ifXB2KYcDqEym19rznjGIbEf6SreSHBdX3nkpfH\nMxvuPPQ0egi4dFO2xhltJBMLhJT9wn48Gyi5cleeOZZwmofdDFMnVNZF70l9\n+5jpxzMBoCxM+rvFqlT+04IXsw/4s2brGumzGo7oRHeiCZZGJurjFFfONk6W\nsPa96rrLpYz+OYe+Vfx2OL5wi5jUfa7RSx4e7g1+aSykB99cKg5soe/GuVSe\nTs5FkgSp/EtYGYrK04CLfyXN8eDh56n+qoIdVIuRfDf1vZ56eQMbQx8n7E3/\nZGTRgyb6KDQNFP92S9nj3qmscL6v/WrWL6tYidnCh1GmwHVn2Fgh8DIN0SO2\ncw2QCDyJijHmhFRMi9yX/pjdCNPuIKfAUcSy1Klm5BvL1gDda35fwEDx4T9a\nQ6081j3C4daoGh/FFRppFU+GGavT5iTNilulKeFBJl0pRe5Y+a8BEY2DqEf2\n7QgIM+oTKeoxcUa5tFHlhM5ETTVcy+hBmGvLY1OsIoXy5Gzt5NDUGrkhVI1O\nSs3+KwpNT6oIt4V9ahcXOFXhmj4dIC9d+fZe0nDQwaGoTCsD2iOWLEmwYTZ0\nvIWX40ycFdOZwUQAeKpQuRQu482331fzJTdUQzWn1HPHKXYKDTiD6clyOJyq\nxami\r\n=IJPK\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.5_1570434821847_0.3413635951410743","host":"s3://npm-registry-packages"}},"0.2.0-beta.6":{"name":"identity-wallet","version":"0.2.0-beta.6","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.6","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"69f1793eaeb6fce80626d91e51fc989a8998a685","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.6.tgz","fileCount":26,"integrity":"sha512-1/AjxP72uGoA0DoKBAwsdhAIUx62KsrgEW/kzhXECD12gaIrAx4a8SRveakO7kYxIBBhTetwr+Du/Wz5vVH6AQ==","signatures":[{"sig":"MEYCIQD9MmETXQr3IPCKtO0CDRRvdgLOx0qnRx1WnvhnXRTDkAIhAOgcLzO+I5DnUDmgqVQC3Q+P6CFqbqMae/bci0i4eOJH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2770138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmu+eCRA9TVsSAnZWagAAno4P/06HWxTWEPwUEByIOJge\nj5rjqp+TI55oG22HaWtIEtbkMy4jrImAHEfmD61xR7jB/qiJTeaXNdoOUxUf\n6pu9RFgt0DPEi2kTeUV2OxXwAiwcBFXVQwdC1Hj+GkIGSYGrJzOS2rZ1bH/F\naGtzcdk1RugR3jaaDmu/T6bnvUw5aYi6AtEG2TFEscaSYl70ZF8FzLPwL0DZ\nVDYUBfqSGtjRZuYmyl3k5zop61h/SV5Dtl/hy2Id84FRxNFCoe3ShgZ4TXQM\nlnghQBgLUaG+Gj7PJSHNt0To9UoFzDQ15FkFbafH8f4b1SDcmP7ZGPdmEwnf\nZu0850SJLX7/xw+MBS/29L1tJYzz3Ghkithmpm8ZBAeeO6rJfiTbNwRZQE3n\nqlbmGG63i9ZNAQM81hxj4ntXWwtrD8UHytWztgnx3P784tVAqoRaH0EusJWm\nY4DPyM7UjQNWIhQ2hqNMdj188wMfhkwPWd6Fft6OM8oG6xgdm9oMkCSAZz86\naKOXiMHzZxt++k0/qqKUIm76kCb2rEkEXSPKNtvgOHJ0e70zL2Zkb4eRs5O2\n9As1rePHM36BcPTmlRMv3HzDImCfl6rVsaQg6hg46OhmoRywOuuhUYCU/EyM\nwlnfcHQkYB4xxhKKFlWRtJQeapcfQpxPWSx3jy/qsx+dOvvULrENzSKWp2uL\nWZDS\r\n=cmj1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.6_1570434974116_0.6298300642581596","host":"s3://npm-registry-packages"}},"0.2.0-beta.7":{"name":"identity-wallet","version":"0.2.0-beta.7","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.7","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"0054ef0b411e60e5ab12270fde7c6bcd9fbe95f9","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.7.tgz","fileCount":26,"integrity":"sha512-cwNNQIu7zsc7YZx66P+QDNcxoEY7gUVu3UAFPE2srz7juUcWiTnQ8OG7ggUqsFSxdRRnH8sSrvNdsO0dfpC2Wg==","signatures":[{"sig":"MEUCIQDiejj9tn7p7Qzs66HNXeoD82EoFXsRaGntDhlrwNEqqgIgY/rOOJDj4K5acKqmEAdlX+clXjETziPLNaBEz0VU3u0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2771519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvQRCRA9TVsSAnZWagAA0VgP/3xvvXbGs+2dCldGVUsB\nCsy0DuKhVFOnjGxTdbRQJnYBD9uXF6JMgef4uEfZUtWC79vdY9jeE0kSck66\ngeWPS4QSyR5tYysurOmQGiQaqmIHWmeQTk6W7mu1o8MXswT4baMfohNv9liC\nhxPv2VmQ8J8niD9FsvgKoC2wnbmZEILi9UoOcedVxNmhk+yNI/RvdDyCVK35\nSaRGlDniNmgyjmNrMTDCzJ9B4x/xY3grbqSnjWPAXwtClwOZ9WUzhw8Fcmre\nU2t9Scoj5KEJhElh6bnTso2FJBK36sXFX5gjxndnfbEjXVQ3gzEpwj8dZW/q\nAqtACGWktcL53rOzkYj9/oRy81XwfgJq7leiHiFA2YSKCrcL6YKp80WJyvTB\n1xXrj4NsCNCkzRk37XW4a6Un6Mi1SeUweTNDr6KSwZf3F8eEVHOE0mEMMKyr\nuctfQ/NG2Q0u7QXkd9qqyqosCVUz5hhAZEC4nERb3YcjGUbcx0aK66uDkxvK\nlLxYfGtB8o2u2amSZmw+5TIvLMVaUPNP4C60JN2cm9wLOcSy93DZnRmUp9XR\n9vRWj9kETU2ASNrPpUm9FVWtYTOnULufxVfE5bC9Uevaub8Zhj9IVgXwrlVX\n+OZTWBdz1xjNtWeBNEuj1USQEBSyMOPK5FYVUJ1G5OpE8wPEof5WjePP0BKj\nD60A\r\n=h8eF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.7_1570436112418_0.37040110598463727","host":"s3://npm-registry-packages"}},"0.2.0-beta.9":{"name":"identity-wallet","version":"0.2.0-beta.9","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.9","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"9aa620bee84348813d1fc8f18e2ddb9b67562006","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.9.tgz","fileCount":22,"integrity":"sha512-dAvM5k/gkX4P5InlzlTsxHieVi8RPGea4KvHJ1tNboAsJ0hP84cBd+9CRbaxKK/locJw08IBiNFo89dNeVI9Yw==","signatures":[{"sig":"MEUCIBLco+TUXcRZg+z1+KBqlu/EhIFUxfkWe7ZCfR+rcS6JAiEA2PVGa6rXLfiwXcsAr7T2Qkl0FIoPDve9+2j6zdet9cs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":979224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvXuCRA9TVsSAnZWagAABvAP+wcumtsbkmzKpLjr/AeO\n/Pj4MyXHoax9tqV9YAfeEvmfyBE8P3rZmCF7BCzRVZXGKvhHHOg9dabhz9Mf\nAv9KJUe2qH2Jy0c4lgTNn5j5TB1QCsEA1Ki/5d8HvjwJ1DV3r72Vw7pqV6Oj\nY6Lgnn7sWBXMGFze4RyBkpo70Wq4SfV+DEv7z6sEY9UjYCHCHhMKqjzUlCHG\nLIkSPeUmcm+NmnnXVTIgktrmQgP765MSu4qCvN3MUFv+tlFyTZhaoN8wdUZJ\n2PYR/JoKPqUTwdsg+LwcqP+SXPFNCvDf8/I0yC4iSGWnsezOrity9ZfrO+q8\n2PbL/VfpvCFCesdoQf4lmE5qqGA03p1GXkh92b/51t7EXrJJYpjfO0bmryG1\npRpVn7+wNoCIfCXKIEu0uEhO4mVkNgioO+zT2epkeO4DP87j6BULVtpBB/dk\nG7jrBOCJ5UiAtbB+NVUAp/FBPHKb/ca1Bv2HQLAXIl2yNZdTxs4ZcPyTwbr2\nqDcLFVtfgxyl8WCpbcfxXCWaf5ig1/SGcIPi1qZeFVeSgigw9HCQOuPm9+Yu\ndPa7s2A9Lq9cem49X4J5RtlVjb4SpIjkvzNDHnvcclj8rqXLydLntIJpi3PQ\nfZQu4Kwb29mDtxMoQxa4GcGsn/dUcORSahAMg2rKUy61iltptixvX06eIctn\n1ahH\r\n=C/Sa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4","babel-preset-es2015-without-strict-and-regenerator":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.9_1570436589958_0.6416080887265319","host":"s3://npm-registry-packages"}},"0.2.0-beta.10":{"name":"identity-wallet","version":"0.2.0-beta.10","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.10","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"7612695e2684c8ef6db5709f6c6bea3449d3e8ef","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.10.tgz","fileCount":26,"integrity":"sha512-ZhBVu1TnhxCnYXwOr6ky00l9SFbg2d+uExat2rjX/MqrMzfq/EmWI50QyMaHOiCjhTdE8wrd3I9OLdrbHAyWGA==","signatures":[{"sig":"MEUCIB5NRdQJyn4VQHOlU/DgVpnbF3rTw3qZbq9mN5payxLjAiEAwb+3yVyr4Vu1DoccYvAPepSN/zkLB60gsB4F/8W7GjU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2789708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvp3CRA9TVsSAnZWagAANFEP/jySSCbfxW6DgSmF4/yx\nFqqGdIUjH9BackO3/n0CoMO192U2H8F9CKqNi/cUoVAYTPyTwZ3T02pw1gt+\nXEcjlS+xq/aJUG+R8LwCH547i+e6/NXq6cHJgRt0d1yGTqKRe1g8Jz/LGYdp\nTjK0/1QoKHw44c2+0qBAlNSs0JDP0pZs6awbVY9TK6je5Tmdhxlgf6Feh1nF\nGs/4qENAgWqBkoJS+k2OVivkplbDwpi8b18mnz3Jzuvos+MT+tAbnZO8IIJ/\no+pELEG9k1JkvTMZFQr9F9PyOR4m+0fRrYu/ROH8cEoOHfmNxmGhDcIa0yTN\nhIVXi8jVBU8AV3v4j2gWRFRh6Zt+00fbxB7jkDrL+rF2KctUPWryg0AXSeoa\nDRQPF2cfqfcT3zudlNkwX54M0xR59/iJv+F9VQ49O6LsUZCLFKvbarKqNion\nE9JfY/xejE/HsYnZZHYS3Xfx+/PbGJNIMJXRgT/LD+G85bVNMDTBizoWs3Tz\nxrtqX903mhDcJeLEWV4E8nwTGH3bFamEvroY2eMV4ikqwqfXAj3i6t38S/mI\nZ6Gp9/CgFi4pAcJD/Dj74Pu+4ixjgG8PC4kl5S+Nw0ioELyup6zEDcZhOfiq\nRu+UfoLrvZTcTg3LaHNCERmJEelJ2Q0eNauBstsLGLb0HcfSxSDewxTmgDqz\nE9IK\r\n=7rqx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.10_1570437750928_0.3018946308182886","host":"s3://npm-registry-packages"}},"0.2.0-beta.11":{"name":"identity-wallet","version":"0.2.0-beta.11","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.11","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"d688df4f3a83e1ee8d329e9c547376d09b0a80d9","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.11.tgz","fileCount":26,"integrity":"sha512-qWO7whZINSUi3IZQkcdKLOLZPobI/HHJx8RJ9PzzPYRjhPtYYt/WiXmg5BzpSdN+HssW+KvyJksbK/aonzbahg==","signatures":[{"sig":"MEUCIAGSeicBmMgKzLNyylxALnLWh0y5iOur6laRImgx7aNGAiEAtOD7q2g0v6o8A+G1yaWHJaIxtZfoeplCT0RlZRrM0lM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2773976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvq3CRA9TVsSAnZWagAAPLQP+gOU2wzwr4FveY3P48ri\nh11RzAqYcglqv4CeNSYHYqEr1is6auq/cn4CAjjMRf5cKEc/Xo9Z6jkl82QX\nAGa3nYPvNvIAr0cmhDqEuZX9lR70U6KbL3VMdm+mmAEl2Rj7OHiFyw++9dLT\nhhvJzqFOp3ZADtry2Cu2zOefc3CuGqcFrsuZ08Txoa3Qb4Z5Uv1XHeXgSOKB\nRXR3HxtbDFiRVXxlF/hsXimlsGFRW4j2w6DjgYg/sZb9AXGZiviUQOL7hYuN\nnu90OovGqR3+BC88v8QIeS/uBk52l93iY5D66/9PWPNSC6G+H2vIh6OvetDs\nmuAQ7i9g/GD0DBZkBFiDxNqEcpfk6v58ziU9SNe+MqMGL2f6q8mIZL9Kq9mb\nboCD3gK91Y0bt40waJ5LkQjuN1wJJxolIo4FAmOn/PGRWU8LOdoRWsMz/kxB\nYqglGGzsc+F3o31LkUgIx4IAlXQc32gv/OSiTY44HypXH1Vr53KqvbEjOu99\nCE/KPOwSCCL0eeKBm6CVDYUmmZPaD7dohAirKIaFmODntrnH1gKJVfUS0xWE\nOZi0zIh3XPOjztHdl2Xq1yXh2Bd70Co2WT6HGRfXALbQ2U61NcoEEYwU+kiw\nujBxXr7GR2kdg0QSa6FWwsXVtD0IzraRGpWEblBmQXCJu6p5l6/jTDw59ivq\nDT4O\r\n=XWah\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.11_1570437814639_0.4388585468289603","host":"s3://npm-registry-packages"}},"0.2.0-beta.12":{"name":"identity-wallet","version":"0.2.0-beta.12","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.12","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"fbf096a0645a5f55e71c76aa7faade220fe0a942","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.12.tgz","fileCount":26,"integrity":"sha512-tU5DbGUgg/nZA2pRV6+LxpqZ/WTafvqqJVlmSCT5YUcO5Q+jbgRxJDp2z7mTzwcsAEsmP/UeBJ4v1SKb6ksP+A==","signatures":[{"sig":"MEUCIHdPsdUZjYcdLmgLq9yVMzcSqkBHKw48vrOH1mR2h/QOAiEApzimdc1i+r7bqeG7rf3cS5sw8rJuzfIhmc2sNQQVCN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2767440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmvv6CRA9TVsSAnZWagAArcwQAJzuY6Dx6z8nbSz2QcWd\nGE4lrvSiNJdSqmSv9kQcEVZ7tnK7DPGlDQD5ZTLPqwde6cqrB9mgTbr1V+sg\neD2izzRqBKTjIdNddDMUu03MDKKdVuIRTes9adbQWyJJ6/JKnNI1Owe7P3oN\nfltfcb51i7Y9wj1HQW73bs2H3Z8l4oUW3EMrjmIHrkTri6mhv00wHDhEgN4D\nQMOzxEcrXN9fqtN5DHP0BS1DGfhdlAKWYfQnEHuUb9fK2y0c0J8Gh7Gcloqq\nSwFtGfUgZr66PIw4iHFxCmuee69MaJVa6KNR4OLXLYl1utnXDkoKYnGfLZx1\ncCqtPJnXl0KJ5i+kkgB56+PAoZq6dDz1QZJSvOaoi0NvQL+mVXVIDJ9kkmKH\nsmG801otbzNeXlVtIxr+fMUUhYLuZM0+USPNxRUUVXYo4BYABZrEuKgfOYaA\n0l3oFOoMsELtpAmjqvOxNMJMX5rJvfZeHq3pLTMv9E5bgdWkKbHTvGmvldFr\nmiQGb4nmzWc5HbCIjxx8R7AcBgnAIoV26D5aInQjn/Hbu4z06r1B4idOqttZ\nC83y2Zz3Wg5L3X2juMocufgrQ5Ch6aXszLarOX0gHqb8fgod9euekhLD/Ieq\nS579D637C6Mh7PvX3KjQfWZjcicm+ZES8b39ckF3Qo1oCepOBzcDV0NtyDRq\noH8G\r\n=GjHA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.12_1570438138229_0.8861567769144081","host":"s3://npm-registry-packages"}},"0.2.0-beta.13":{"name":"identity-wallet","version":"0.2.0-beta.13","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.13","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"074131369952607cd250af6a29286c7fa4b9acf4","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.13.tgz","fileCount":26,"integrity":"sha512-m/6Rh4w/Sai8b5hVt3byuIOXzlYWIzailQQskT4G/XFYjBnTcYT9JAFQ/qSMX2qOeU/U83OvryTwaLI80pmyWQ==","signatures":[{"sig":"MEUCIQC/qXUcC+n2Azyqcn4pqxJp4GvRJYrxCS7GrPiD+sc6UgIgO5/nVJesZu4Ynw1vw1fT1H7OUako/57tDqXaEALrRIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2767501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmv2dCRA9TVsSAnZWagAAtGIQAIIB3kkpA1QZEEO8UPk+\n1XzxkO+VCaDM/oMnN3QrEc3CqbrGeW69wPF5mz3kXeYX6T5/J2MPgWc4iU6x\nDt/XJlXsm9XbCM6cSVcdNW5f/Ga9tyn44d5vOIBldutOB/aKEdYDEdFgBlXx\nt//94OkJumTKSzIE6dy0gaXTACakEn64tAgm4OPvQDnGDO8VNU89n3nKMucf\nt3IqMvPzoE4qWd0ArjGiex9AMn8KmWacy/rsHf0vtt5uoiL28qpFfw9Seivh\nPBmKi85YEAVpW0goRntkmzyMmmIfCoO846dV1d3AEYzTfFETx75BBYKI0atM\n37NkoqV1P6K8NPhwQ/ptm7oGyl8NJm4PDPmyO7CukDJng816Dpo0fxHQDGje\nRb8DwPS/OFnnlbpTbq6XU25Q1PLDdUII+hWbcac2zLlXnGIZxq9utd1798SX\nYydGIJc34EiAAW98S/96vH3IJoiSluY9fNuT2n+Hsi/DChOTEnstAymvd6oI\n0g/dcLCEId+J8FE327DYKc7v+Ub+3U2liDqx6B5/G9rCcoPpMvqnE4L1pv+A\nUltOOej+mAsRlsHQ71CxTn38ndQ+RuVDKtjPVc/umGrikP24qjL9HFerPwVL\nsJAnqEjLnDrB9mk2tf6neeFBZl6QgoGj984/xYtNroBEO8FVm1clQa0renVq\nFxiv\r\n=6edf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"buffer":"^5.4.3","ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.13_1570438557288_0.35797598731498237","host":"s3://npm-registry-packages"}},"0.2.0-beta.14":{"name":"identity-wallet","version":"0.2.0-beta.14","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.14","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"9246bf1cf781cabd7ff7bbab2b78530e7e3f380b","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.14.tgz","fileCount":26,"integrity":"sha512-x2+Ra2uApTZjhAApOr9acSshh0iIKpcQu/5XmiypZfy08FmQsJJceyx+aJL0dZ5gl4Ho9kXw/mrIO9olek/jRQ==","signatures":[{"sig":"MEYCIQDm6I6+pRyHqAKIPYcVMnwR8JyIrwdBmmDiQKpE52cdvgIhAMRceB2RLSDLbz8eCMjdbX4WoSg6T+Dc/pJ3KcmgdmLn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2767423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmwAMCRA9TVsSAnZWagAA5CQQAIx2+IMB0KkQWwi3ICQM\nEdqFfU8I+G/66PZe7NBd7mD14wGoCDa2zOlBWtwHuuOKbevdyLLLEt1pF3Uy\ng8oLi2ETEBwIrrV9P2F/PDQtC+oKDBwdLYBVkqrL+Om6TVRU68EqLRHpdloT\nus/Y/j4/mvANj8GS3ho1ExYxA+8DNBTyApTHf9nkfAYh8Srmd3JVWDACss/7\nvvCiIxUH37gU/YX/IutBlwAYf2QE25wqddSi95U8VdwfnP4uS/OG6eX6s+aL\nZkqb3KP/7w/Bev4hVnccqIqd2Eeb6QWv+bGf8oa0PrrZDmUSFC1FZD9EjGjj\ndWqhlnIS2gBTkCmVfPupPSAd0tFQcM+MeZc/obSwZ2VGJUim0H8bZbsSerTS\nhArl/SwUKv2SsLmNSkGtdPzudC7tfm8Fd1NAHKDjTzsl/BFmwU6DEmOoCscN\nEhM+ZW0qSdq+gNGd5GYFKEiParaXrN8UTsHPewTCMiIDP4jfIZ+MFP7MCW9R\nD76cRq0Va/1ZNRN38oJ2KkyATsZNfqk7E4hEF/UIkOO6fVz07j2jHViAgZvM\nmjCGIYzlpM5KtYrvcAhttJ06xquodhBgsSGUBIuEt5QBktgrNmP4KWQusovc\n7FWqjLBqlmdvI5Y+8QRkJhamkjkxftas81VDriP3/7ISNJ6yPgueHm0Cq7a4\ng9rz\r\n=n20t\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"buffer":"^5.4.3","ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.14_1570439179888_0.6129046917936238","host":"s3://npm-registry-packages"}},"0.2.0-beta.15":{"name":"identity-wallet","version":"0.2.0-beta.15","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.15","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"f080d0a7b855854cbc45855b695f0870415cae8a","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.15.tgz","fileCount":26,"integrity":"sha512-lpI7Mr4UmDWMKZkhuCFOVPyMlQmwftbN4wH5KQlW/npF6nLGXvlGlP8jqU3exf0XzPCVLpqULap/w4PggiS2ZA==","signatures":[{"sig":"MEUCIB84RxpSu92yHUBnSvhEzekSkf6aRrAOTpU4602WrvCIAiEA1+bwQCmh417h7wSo45Ufq1mMQrz8xE+7jtvcmyhla0E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2767502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmwHkCRA9TVsSAnZWagAA/GMP/3d2t6yGq6CRx7dZEI4s\nLqPwmH/0oAe4rgVi7jnHdV+U0kkbtisxNkUdOKUFctw206gdJkm4akXWRBca\nttKKVGviQ6WWjFATEhqS88szeIay0fbKQ7OIlWpGgLkSwJutqLnXYKYw1nSE\nKOzShJN5Nxf5DJDdBNaxSDFdRWpUjw6WT56gz/Qq5bw4UWLuKYeAH/CetQNA\nDlDZTu1xSG3wBm2uUx0BJvZ7a68q3PCbacYvgisFGdb9OXWSxbzTIO4yuiu8\n/hhNEp1Kr8mJF+QGZH4nEPahvS/t8d0O8F2y33X5JaV3D2u3uJOsM8qqWtFR\nM171LB62LNCoqvLjIcfNhs+pLl6m8SB9LkbQSLyETT2uJtULPjx/oM0XWkUJ\nlihhKedjo9CKKVoj+lNSxyR6ZrJzGth4wDg7gQQTdyqrin+lewJOzuEDGlXL\n4KcvIc2mG3UGKQWo/RtCWnj7KOoCC8QVgzIyVUYgKF6RMTGJVpv4P3a7pS4C\nXnpWW6MQoPzF4Oju2nq3053OAhuhQf4tchZMTC5qS3KhQtK9Tj/6Kic387Dz\nvZnMxHXbXDRYadIIWA2c0pwJaEnokJjEIoAX6/TSVkS6312acqS5lsW8FuRO\nEAKc4bJ5h7jqbRhqslq9oI7cvRBOTBvflfCmAfxUjrS+/zu0xU1F3p0DWHt+\n9JUP\r\n=aeIk\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"buffer":"^5.4.3","ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.15_1570439651878_0.8754477839534758","host":"s3://npm-registry-packages"}},"0.2.0-beta.16":{"name":"identity-wallet","version":"0.2.0-beta.16","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.16","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"f97ca1039a674fb27134a5e9a2dcb2b46e0a2657","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.16.tgz","fileCount":26,"integrity":"sha512-c9Ceji262Ouvj2F9lpBhj6bIrlcx9rBUVLrjZREoGic9DzsJ0daT/I69AuzUkF+eNIRf2lSVZN9vrzkm5MzbIg==","signatures":[{"sig":"MEUCIA07+uT0d+DFKwOcj+q+POTx3mZ9Nawqre5c9laXW+zYAiEAzcuX8AC7uNxj1nNRnLwIu7ZyxTNIa1vFoBE59ZHHoHE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2782673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmwO/CRA9TVsSAnZWagAAkssP/iNz6EG10irpSbIOyScF\nBEmF5nGdlq5d5iYsfMMjBfbRTY5+h5UdOci3000jFq+usU/27cRBrBjbGSUe\nepEzZvAyyNwCIZGswQT0nad+m9HcVBqZxxNkN//R8kDzMCdNeUAjKHhHwnqQ\n/eQjOn6vFP+HhHmACqL4hygmPdtXkX4puugmO2IPAFx5wdV+WFIaQYE1peoS\nQXgXTT03M6zu20AA4R2sFgKEqTuoFYEt9iAxGJk5dV5MsJnwtoQUVV7tBnOE\nrYf6powlnbyaQQIUZGjY5r5rdlC8N39oFwNNusCM0McJDXxRH5sFEUvDRwM2\nZMKd5S4v693RdZyPsqpOt6fOoKioUUKonNPlKVdLn2XCdq6+ohmrMRXzFIVn\nwwCpfsbM7kBAiQieEquC4LgIMUq54+YAIUEyXgy5gGi3QRmJl2h9gK1TDWbW\nzSuSesmv5rEM4AG95X2mhb2hiRL48fhJWsZSRgIH8HnE68dTMyo7oKhzTfM8\neC772Uo+/xfVC3TQPGjZMOaYrO45rzCLlZPj7SJv9fXAURvWNaNoRNS3047h\nyJaKcn3yJMC3DB0gQXX2ufBqBQW1gmfemMt0wuJbH/u1m/UiCj7TbJ5BDQxr\niUmUEKH1l0/AXyUeY9/EOdy5qm8cDQwd+Iq+4XywBZsXHKgixSlarzoCZwx8\nvodZ\r\n=RXQ6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.16_1570440126731_0.8777627739944747","host":"s3://npm-registry-packages"}},"0.2.0-beta.18":{"name":"identity-wallet","version":"0.2.0-beta.18","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.18","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"571feb2681774f73677155f5febb74bfdd4d16bc","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.18.tgz","fileCount":26,"integrity":"sha512-LbcDRokBoSngo/YKnjOALzrpxdW4fY5uW6sPEZRtbF9kSQWSr/yYX+dvxCP9HAX7rlvpWK//UnjMoe88hA5nUw==","signatures":[{"sig":"MEUCIQDyU1BIytpbflzGrnQwnGAaGkvT8KpP7lzWWo4AQHnhwAIgBRLvCPs5NrkFbZs+TZdTZyFmdSGICdr2BsoulMCRv0k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3287759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdmwkwCRA9TVsSAnZWagAAjlYP/2YN2i4z1nVMOJte77Rg\nyZIzuE5tgMIScagHg0DZ3uZ2iLSiOpe/cRLcWrZV5Qxfh+thbzVBn80dtT/E\nL4kLwQJEG/XYKY1yaKS5XWNRD/0u5NEAoejmfgRE1E0FjIqm9Zl3bAIckKl2\nLVxn11/s7TUZeR9Rr53zxWwg5h8FUFMgnRdpzNjb0a1ScqWo3OkPIB/WlixD\nvlA1M1S279jiQ18DopHKTzdUB+9DpljPXaXGNOwEbZe1FBs5cOD2yAUlMfa9\nmtuIgXTunaXLKHnAzv1cDcSKQJWrhrqJHkz/du1x9zdF8jM51KQN43D2OMFL\nFnd80tiSig+GEGpavS4LlfnLe/3J5qgLM7+TsG4xt8Hotq7wNIOh2wA9aBra\nCXQR03AlWIkQWduPkwyPffZVcio3sGdgb8jJHUHffsyB+u604iVq64FJH2nY\nuRr0haMSEMo9wUWH6hameMnk3psNPntn9y/XiO9WiGr+zp+3ot+ASHt7rSDT\nzh1knnFa4DQMcWY5Nruv7nTirwP2lewEnpTqVmY79owU1b+ALNxONENrrUiI\nEAyUf51k1E6pYlyzYzNNGAiiz2+juv0T2lXGfWRguo6uCGN7UG/m89wuNNhM\n66nic0FM6Kkbw9euZ8OF2kgrUE8cCdZGzOLW54waH1pm9QaOdmFy2X6VOAF+\nRT4e\r\n=ZbJI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@babel/polyfill":"^7.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.18_1570441519976_0.6591408147986855","host":"s3://npm-registry-packages"}},"0.2.0-beta.19":{"name":"identity-wallet","version":"0.2.0-beta.19","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.19","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"984a98eb27b3d8b6798b789b2a1ceb51812cbd02","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.19.tgz","fileCount":26,"integrity":"sha512-KiaH1GYor0z6cE0gZDPrFSCmkzokHb3oC2mbpngdHa/sieTDKGmt/1ui2G4zByKZ8hbXFmNB4nDmExl6zD2pHw==","signatures":[{"sig":"MEUCIQC5C1uN/GyJuSh76um7q9Up0BnLpCIsxyAgpfOvmAK9pwIgV8EwaU+YEdKgKpVZ4QRcv1sTzOKpXhzCHEiWlUgSDhQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3287786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnCKfCRA9TVsSAnZWagAA80gQAIH7zMgx4b7NmgL3ZCCn\ne6Z1vwUdpWWY1VdfeimbRo3GSkLe/aDlLhXO8gQ+2hl80fWjUphz7iPyguH9\naCCNLW2CPGWEK/mIBvEZJDHU4PeXxZ4x3RyPOr+/n7+Gw2iMbGahlxXvCzJd\n2ieqwJyN92/fpTRLKiftr0upeyJX/JePDR7h4zuEKZQ98NOnGfWuCg25Kv7W\nr4t73ifsp2wkHeX17Huox0RKp0rMC+AN8au76E1AIS4gnvwBTClyoVhMWMsV\ndNry8/Bkl1ltVvKYHSO5Awc30F75tmjzWRo6ZtW8GkS1somU+/+ulQPVxLiJ\njxR458x8PUvKuT/oDUCQdEn22Azxa0I2Pt0RE8YZlDvLQHnGutzqEv49lQY7\na+fsngcU7VS93o4METJab70T3YDBgT4yHV7g+JrGr+84aS2hvBRznvaV2VxT\nqyk6QdboMpLg3pqhVaXMVnQNa5JT5D3j9HK/QgFVCmW5QBhvkVilzBcaZVV6\nv/boRSJKEFxmsHBfETz+basrg8/nlNj2WtEGMpmDVobhvY7Vk98sPkpuWESr\nT+gyu4WQz6ROAsxURlLDHOl1pSORsveaLd5+KSumspLpBTgT7IO0yQOPouci\nTzgjOGkWFx3CcfGnOlgPCK2QTPa6s/MaT2LLUYUJgZJzSXLYk9O5V37jqExZ\nnUTR\r\n=iWx8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@babel/polyfill":"^7.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.19_1570513567227_0.722510797257625","host":"s3://npm-registry-packages"}},"0.2.0-beta.20":{"name":"identity-wallet","version":"0.2.0-beta.20","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.20","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"ced40c8b69a7315b77b6136f4368f5efe22e5a0b","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.20.tgz","fileCount":26,"integrity":"sha512-ZX1SBwAlVa+SGrcUP1jMjxmdv+PzHNPV+46OcmPxMTbDcckXWmKw+AO6nRxvQGBf2RuDxrQrUvf1AzyLTg+qXg==","signatures":[{"sig":"MEYCIQCz8a+S7lDrj6ENDUKrL+jx9At/ljKJ/yI3PIymHlRLoQIhAIVTdRf6CS35aQkrjxxE3c5MgYhrch8YSnvq+p0dpc9y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2782734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnCZVCRA9TVsSAnZWagAALQIQAJMUutU/8x/kqzqS978Q\nMfPJDwnfQyFhF6qx6pm1v42OeoEI2MYVWYLSkBdyiQkrF0bakXvZ5ETbSlhI\nyetV6OO0TZGkpuWvHTeNg2AUW6GmjdXPIa0LyqEguAaOtla1fdNm285Xkl/Y\nC6icZUn2O5NDjWKLBWEwW98S5o5kgA78y7h+6Gr5WuG1DgBEla++cnqrK01m\njPFfCkUQdRyDizFen/XkqwjBZC+u5idebCbRtyo3aSJd631Q7kCWgm+LIH8O\nRQW5pj6dgH2toV4iY7g+5PfDd+SRtFTtWeInUwPEZ4cj8vl2/Z1hPAdS/3rS\nesU0G/RuKK8pTsw0SDRysHoxb3DYg0uDsjw/ksCTdXDRY02qtQ0WC/zZq8A6\nfz3/R0o1N32EzxUxxtacBZ10Va6XtFQFwiPZIqIgpj9H8nXQrmlrVETN+ymv\nVVdMFP1wv+msExOPksaUmYZPmltTwwo3UH/vq9qoZItGnQQx6yPqn2Jr4vJt\np6ePCj40JaW8ioGWMSLWrtMPC4AYt2GlexlEYdzwS0ZcAvc/ciMwmbCOfWkk\nKEiw1wwEwIHiUwYpmN5eDYO8aLWbGUVKKipRdeTiP1fNe5fdt6YLG9i4j8jg\nBX2OYRaMP4FjGvViMOmbDgMewHAxo4zFJ056J5cKaBykzO0ROst7Xg//rNpl\nmcWC\r\n=4MeN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@babel/polyfill":"^7.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.20_1570514516883_0.06168003907595754","host":"s3://npm-registry-packages"}},"0.2.0-beta.21":{"name":"identity-wallet","version":"0.2.0-beta.21","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.21","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"d0a3aebe2ab3b3044734b21e40db280f6f44416e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.21.tgz","fileCount":26,"integrity":"sha512-iDtG/IkaDsEKEKB5AXYOi8W2JoBeqmrni4QUC1vF7WU03CHEJJ2O5JurCRhEge2V7636PJzwwGjAIrTtWdTyDQ==","signatures":[{"sig":"MEQCID1FAVmfK6SDt1T7ETsZTZbCuiM+CIlqMfG0CZoNu3FAAiBdgEhlx4XBgRYeVlOf9P0iBwult9VsMgzJOLi6xEFi3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":251117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnCfLCRA9TVsSAnZWagAAE5kP/1xM9eWUASf5CiXPtbN2\nKmnhCzkeBA7cWH3fcgzjYnsT/eq8uYJXHsG5ZGZAp8LAG+QPa27nhZ0TjOrq\n3sUDT3vqKlmX7Pd6xR0KPS62s4SLqCw+CzZQnHklVB9dyJ3k0/+F6PVEzQit\nvlTYmraxcm3t+MO1ejyXfHWtsi/o2P7oN+3bxvEr4FbfIASyjtsbx6Yls0CY\nCwOhEzwLlLT5BPlJRwZwhJRtWsOmSLO20jLdKiLo1z+GkiWweynUvgZ8IHu/\n9ppRtz8RTZ/g4lQpxV+r+ugLrFq6egEK7UnwobNU/EC74dsznIw/4rja1tR0\nSP40Sb+RQtHcGr1PxnEHQfn3Q6147sVuskpt9ryRAV1hTzwvwfZ/Rd2jiYK9\n+o01zWEJw8OA4d1OZ4nGu0Ao3xYBPIhcTyUe2Ig6f4KrBZqb4NKJdqfYinRc\nN1mKdY5G1BtMmrgyr9ZAVqdmuDaZBpk+qVthjQOY4geh1TdsFhh9SohkJz31\nkaHqz6/kL2Q5xGZKCXKkyPJc/UFZ/GOYnW/hLm3UNWhmaH1XjWG2LS+oikSc\nBo1cUtE09I8eNQ7gN0Ro0dX/ov+o6sYLiaDkxzjLWhHVCBtsmiW6SQBPau/4\nSxBCzYs6Jil5VyZrmf2EREQonq8s+WiDLQH9/S9b+3JEs3yDGjr7VS3nYYHA\n6ztg\r\n=6aUf\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@babel/polyfill":"^7.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.21_1570514890792_0.6352728938033263","host":"s3://npm-registry-packages"}},"0.2.0-beta.22":{"name":"identity-wallet","version":"0.2.0-beta.22","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.22","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"7a16728f2c31a94a6007340a5ab15b8763435003","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.22.tgz","fileCount":26,"integrity":"sha512-lCEfkTYFr1EHQ/R3Jt9qwyM+azJwlZfqpsjeOnQfnibMHTmq7cRhdCKhEATGcbaDpAkuPxvEXdFGKDrQ75cOIQ==","signatures":[{"sig":"MEUCICSztznut8a4AP76c31eOxn1zAhSZmr0D81jah5JwME9AiEAsj3qu4ywLGOizPEpqtHFNd4a0weGghkf5PQ01Rm37O0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnCirCRA9TVsSAnZWagAA9EYP/3uTF0LPOpCZWcRqMz7d\nmjFKz0PHopiYyLlqsh/TdyxHNxUt1b3DauxuZFoaVvWmdKNPz2/kBAomGOlG\nBqfiSoWL7c3+Y1IhJO6GrtG3Znb7lxdCD6bA9bMEO3O6d7ouCg2gbV69GDwt\nBE1iQ1E+oY/X/MwWt9RU3fauRPshSzb8mhgqd8Wh62rgdWLRuypyxa9HdQiW\nfNWkACELOVUf8jfGAPEyXLrchDsMd8Osg4dXzThmjvIZig9GN/GtD3Exf+eK\nvqqV9RCnJn1LqUDvFFjxXLiVtXP9yKUMv4CKk1vCtnVBZ+kNcygow/fh8u3r\njXv4UwJOjBdaMySRzfBA2xgRpIIaz3VjsLuIjPCnW4YCdfgd3Ho+rK0z1eKs\nqinM+pv4cHf6XTO0KnWV8KpE6K9rum30DX3oMM6/pK4VapWz7eSrZnM5A66e\n8ZrWo256Vjkl2qsUnMZENELq/GEtCCR1t8RMl91He6me1+q/tCu+1TggDmeU\ntQ+GjF/zx/Srte8rBjDrGMcWivk2v/qUwpl/q41FrUx0bfI1mfIlAfmsAyly\nd8VeWutRib2XGw5dP1EO3hGKw0djKXxiShKO3fAwdFbKpHeopcRnJKFz98xD\nF2axYFzen/HqxD2vFS8ST907VSkloKDXZS1z2QB5K3teLq9weYjlTPHIOz4L\ntMZz\r\n=YCPg\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.22_1570515114762_0.652095860222212","host":"s3://npm-registry-packages"}},"0.2.0-beta.23":{"name":"identity-wallet","version":"0.2.0-beta.23","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.23","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"add6448208d15bd0a7602634eefb803eb1a12917","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.23.tgz","fileCount":26,"integrity":"sha512-5en7MhtSuijwuh73855qUAIuV2E8Ybxw/m+XuI/KOrCaR18X4WBG990e8J74KBn9hhLgWdTVSmmSw/4UXUC2Dg==","signatures":[{"sig":"MEUCIAPCDEG62hB5PW00238P5FrrqfaJeBspgkWsEEfyQGbyAiEAtS5MXjwK6HEkjO9COCCKKPYg//P5aj/FeLEfVFlmMo0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnCrTCRA9TVsSAnZWagAAVp0P/RxWo/9Ohfqyt8xnLZz2\nxMVeX9nVmDIBp1kxfUbFhPefAIpIvABQJeFXXdNaMy83Zp7hCiCBGFgPQc+N\n6X5+BegTA96cs/jSFto4U5D41llKn2zG5ZXuYI9qWtRVbze5HRICL9rzoD7L\nZFHpIewDuPAC/bXCT0Uj84W48RIoVdHf9VWTOxOisr6+8HxM64mKH7tRLCBe\n0QJ2kimYBCbpw+8yALvwunMaFHKgbsX+UCGW6z0xvotNd8Cm0x1JAtiKEsfl\nsMMH18xHtMCOBgpyYG1X3YjGNbptu53Pw8Amjsffhzdl2yOroEN1/ZX72Nlj\nMUXkWCghOeoctsO9Jg3I0a3xPYNj/Cx4NMMUc4jvkMiW+OUpn9u9fsxQuOIM\nBp5bzlVcOObzv8nanI7W9t5XKfnoR9uZWkF/siGuRXQoRQc33FnjljFOtCnj\nNJIxAv1Skv37h2Tky1rZBNDVqGBMYgUA9/MIKis8OnOrBvjw/gEEsi7AP55c\n8TJ7YppMo0O/I7QA2whrxv2yaZG7jFKtSSqWTo3q3Z2QszJIO8n+LQFAmUS2\nQoltms/Mqv9edyt7bRYPagvns0wjU0pLozFlVcUsOCyf/So0PToWVtrul44I\nXDWhX6P1R/7APZYO1bawsY84LBst45Mk8PjZzVdyKrdzSCwUDVLoR7AFKxtg\nlkqw\r\n=hp16\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"796338cfb88f42f9b74b6409afba74e315e6532b","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.23_1570515667205_0.1394073155046538","host":"s3://npm-registry-packages"}},"0.2.0-beta.24":{"name":"identity-wallet","version":"0.2.0-beta.24","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0-beta.24","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"1a50b3557fe60ba50e8f9cadfe051a62a47e434a","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0-beta.24.tgz","fileCount":28,"integrity":"sha512-pN/M/ZLZYiQH159vPQDOgyxx+rlsI5HiTGcVMwMCHUN4gYE6zP5zlcvfSEYsa1pir7J8gl8xn3+QKGuOSXFNFQ==","signatures":[{"sig":"MEUCIGExrWjhiUHNkOMcnyoyndE80aDxCakgheLIhSZIOEcdAiEAnFXCeWFXEogQ2jNgDYRHkIWsbK6+vPMGA0CBrSz9zYo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2791245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdovSCCRA9TVsSAnZWagAAvIsP/3XhBUzJtAMdpofwpz6/\ng3iRCj4vv21hjG6tjJoy6zhPRaW8Tz8vPy+X+IY9fLFOiwxT6O2LEO81J0xj\nGjxsH8rZQqNLDlaInj2qm6BFe8qCJj95NpD1ts7H6PmHlWl/laulbwU3WXu9\nsEeWwKBSLghhpQflBqp55TFoBa/qtivxeTWboE35hj8OnPgApcJhARYJT4BD\nwJJjFh3b7b4VBh28UO/MzC0zFG8DVXKloZNhfkz1AIVQrYPRgPZ4M+ztjJTV\nMrsWtyM8BBspxHPtg2b8XYDbfXZWIibwqNsjWb91tIoRoB+RfX7Bu/heUcvF\nkDNDvMd4LvYNBh0QtJxWPCL1T8FEJXXntvLROzizeZj7dH5Rt6T91P7fIs6+\nXIbnjQfoI7F1JrUYNzmKgAyOf8tg5t4PnVe4fugTg5QKkHFa8oU6LO9oMCtC\nHpvQLCkkadoMYO5iC8r/xe77hv9imQYcPVVTd2rrZqvCIwc85qn/qKfBKMx4\n/qTik+L9WxydQafErIqoRF7lBgWiDsuE0ucwfFudmSD+INYLuJH6XXRE9Str\nXmTCzFCCSd2VcddgWKbLk7cqvZcbALLTDg5FI8Lk6OqGH4DOEbTG35bDJSx0\nE3nkpc4ezF3vRFCwhbL56cBkbUj4Em76y+Rsfrj1L4JOfv5ZNn2CEO1+DudR\n4MjA\r\n=NlDy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst box = await Box.openBox(idWallet, window.ethereum)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"506ea281e4c9f0aac6728ebaebe7d284b20ff6ef","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0-beta.24_1570960513793_0.7318492579555489","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"identity-wallet","version":"0.2.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.0","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"70184189aa74e47726333f255740ce1969d7375b","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.0.tgz","fileCount":28,"integrity":"sha512-/sliWwpx6WGk9VkhfokrLYU95yL0VW47Arj26KtOwjzPw7dm3J2PIDz8lEGqOyLmQQa/MNW8S3yuYgXcjO+mSg==","signatures":[{"sig":"MEQCIDYgDYpbt+noU3V4ieQUFOoNNz7tndZdnXPj0OysFuoZAiAeNh0o2Uxz/DgoYNefPJKcqm8TTLNlxmpqy1tNDpAB5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2788642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp8ZBCRA9TVsSAnZWagAA/VAP/0Gj1eTFSCPClvsbdbcO\nFkqaBUmmbIx70hu3hg0K3a9FsCLzFh3+nTHLSBtly+xDI9LL6JKHTHQl23k4\nktcsnlIsaa+NlvBgxND7ski07hjO23bAr9pCAgkd/WIXPJhTYkYsih1qJpjK\n/zvjczZOuLtyRogAYVy1Q418Koqe6sds0nUgBAFeuBMqHC/DppxIX8HBUEnT\nbrZX8E84EN7jeMAXExtNKgvAgf6klPN6AUTNQlo0UiFZNZcoT3z15AYhrkW5\nTIrf5GG8bLfYKuu/Isbqi8OEp7fEbIrttzWfUH3vW0gcUqK1A1QerlMMMpDQ\ntub8eyFNmfSXOoIW9DEM6B86t9iH7K+4yt3pfRv0pBZL4HABpzj+gc9TPbUA\nDTXKNkN1E/YSw7QpygbbNOyrpoYUTR+HpidxpTykJtIAT4My1oHhhDcjSHWP\njZxmJrdS86kRDC3WDP6WinIMvfH/xZ++DmgLB3z6COp1f5hI73AHD+s265oq\n3HYiX+/Ta+vkGpvCcmcy1eFxR738030YgZV/iBW4rn6RIb82UDWsKaK72g4p\nKhqA+vU1IIFFGKdBhn+1HdvvUxJgTpqqMikjX9OPFDDzFs0tVZBl+HV00pXL\n83w4EGn6YDtdHCFXZ3BA1HFEyZxemBBfdhzMwjnIw2Bk/R70KzR9jh1l7S0Q\ndzBX\r\n=nS3k\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"9770b9d007495ec4d149a782cf857b8995b1bb59","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.0_1571276353089_0.3852826807923002","host":"s3://npm-registry-packages"}},"0.3.0-beta.1":{"name":"identity-wallet","version":"0.3.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.3.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"5fe4207378fc10e73fd45a31555cd65a9513415c","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.3.0-beta.1.tgz","fileCount":28,"integrity":"sha512-1bAUangUfd58tVAG1BN57Jc6WDXlCq7JuZU5YJhodXx+XdqaVOfquUqjJhF2ZCQ9dCT60jyU3fJXIXAxF73i/A==","signatures":[{"sig":"MEUCIQD24+oPwBgYFU4H408vuOieQx8yMd9dV4IeJXpMNnIuUQIgXLFQmRmjlxAGFHyA/qfT+zy0os6S9EPxK+dUWbq+Sf8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2298504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrkjuCRA9TVsSAnZWagAA6LIQAKM0d1YWAHs0LHEwPdD9\nJ7KKPtgiPx6+mmLO71frJx6hA4lrS9RnqwQKjAGDsSdOECaddPPwsZGubJJt\nlh735nPM35zLy7YAiutJrHeiBfssCTyQ9VvzzFYZMbcXCnR5+arnGEh/dSAB\n0EziwG19ESWoQV3+wanglf2DkRoCC1SuEVh//DWgIE6ceP4msl9ljWihQr6E\ntm2zOGesY8c+Q/bylzpznObmQULrFcew+g8nmNvSzTQLKI5ORti9PSqtRgYX\nqrQdls3wtU1uIPrkRlUOTkDQI7JHsXq+D32J9xabktrkMkwDMpJQO29pKWh/\nJYmaW7FfBNJpmTJOIvsmD+MefPde1BR7GpubN3fAnAJlSm0UrZrJyEbrxLsw\n9aKyh5tT9WGXjipsqlMpi8mD+6JIEz5BP6kx6eUbch3ixs79d3tlAITc8J58\nkb0dMYhB1wTfopN6GxH/R5WFhuDo/VTcmkUgZGSeeabERHbncGDj213pe/vy\nViu9kTHn+Luw+wtmsIiiRJqM0DV7IVvvIMcr3Zy0y8NrhxA1XUzj3v/z8q8t\nFgL0eo8gvdAVxoO8OFKMNtcYZZImxJ1depn4SONULFE+1ZrYLaf8Vv9nFwIY\nq01L0HLF0oddz+HutNmi3KCAV2JZ+glfai2rmJMVDTKsIYPH7P4FEpB9zC2w\ncmFp\r\n=qv1+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"3ffb5379fb6def4e0b22c564976644ee16fe6e8d","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@ethersproject/hdnode":"^5.0.0-beta.133","@ethersproject/wallet":"^5.0.0-beta.133"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.3.0-beta.1_1571703021435_0.5832135408572301","host":"s3://npm-registry-packages"}},"0.2.1-beta.1":{"name":"identity-wallet","version":"0.2.1-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.1-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"f85efe6a753e83e3bec9dcd3056c5dae2ae62e5c","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.1-beta.1.tgz","fileCount":28,"integrity":"sha512-SlABsApUXMrfRtZ4yUGDQioDt0GW6QbGas1Q8c5UVgAqWVMjrlEOJgL9cAolb+W4G8T/ZM9zAOdcbb2fBuyQzQ==","signatures":[{"sig":"MEUCIHL/KKsXZR2hB6/4nxF8IOJ6CfgRzwFeYkxlJHtZzLZxAiEA8CCCq/S2Cpm+AUxnCjRSLNiiK6WJBNhvTIwtEA9CoBg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2789706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdr0zaCRA9TVsSAnZWagAAB4QP/iX5YKfS6yCgeurPbWBy\n4KxEhIoNm62MCUMUUNoG7CcJOX3LBs2wFN1gi7sRpcMGlil5irLlag79Wkke\n9SrBwVl1muK2iUEHgvXh8FV5HSVfc0ixXqm+HelS5S9XbBu2z7hKyyQl7lH5\nYDj0AoSke56JAZ5oIDGWMnM1siPvLWmkYnnY/i0j2YFrpx42M3kIMkGTymfV\nu4ujTR2uBA8qwcmJ706scTshfhVZGhnCgqtShVY2sL0lr1IoggrgcSCCWXXb\nbKx8I+RuBDCSwARRdfor4Je1GbTvO5rcApxr/PHZChFeIOCjndbhOjAp4XbI\nDUGgOZmtUmoaKJsRORlczX64PO97rT921H3oZfIsjOMjahN/B2fWE+RKmBRu\nHCAhXrJxkaByrTIRwVf8j7usCN0pJAtjhU0Y3f/XARdPJKzfIEwF+C8WtAhn\natLg1ouKfq+zQAZxNMlqXwqMG2LvDaM5enMdtn1YVVoRMQ1u5ylAC/+Tt2PQ\nhSj2uQtDptKed8O88l7EOthcW4HIzVNQB3cgQdQ1ACUAUfKagEEF7NYujyx/\nIPh3ATSUE47oYLHdVRQYjqOefwD/+sDwKo/1IcwNZMxw+ZN0+PfQ1jfLgPqN\nEGHS0z3EJtu+vAdFJwOIZ8f278dFUqHFdu0vFpBzRfrIanmXXnDxmaTR2eF0\n7PAB\r\n=BpP+\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet({ seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet({ authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"e11b9effa17bd1878ebb48c8ac14c9be81775355","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.1-beta.1_1571769561605_0.6887059370840947","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"identity-wallet","version":"0.2.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.2.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"4a632308725234120051285eac5b7d06b764d47d","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.2.1.tgz","fileCount":28,"integrity":"sha512-sZswjD4PBrGB+GJ6RrmqJOAzmMX2xLfCMMkjrpjLTe3ES2UA5BKPSAWk32UJmKseIfl+8qytaCEBrZDfJme1pw==","signatures":[{"sig":"MEYCIQDitxd8fPdy9HJpmtlDCxIetdwWHeX85JAsDcVYueKOXAIhAOIhq6PmgXYv60HxdbAJpuYDLLXP1bYqdqUrlZBUihqb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2789816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdr20dCRA9TVsSAnZWagAAcYMP/0q0gTnCxcmd/wtpbJtY\nLFZte9slX7vDSb1qCdOIYq2OBhDQaffB3hUJ12PPc6wfoSMqG/q1u6GfFZ9+\nBODZUxBEe/GiD9W2jizfGXmpSTPLSNeePpYh3PXh2trXKc0AHuaEdAVsWIVv\nHz9QaElHtfjoZwWdCHd78ZU6PZTzwfLu/e+tbri6n9Xs845agMkJqIl+7bxO\nOp1YYS3viP7ZJBTg33DfiiBb+sfKcQT+w6h7XTsvvOU3jPmm3yVZUMdfstE9\n0n+0otEe0iLkilRbf7YDjeDYiJnU3tmbKrYgUoB0cRWVwaylAWyE4GgJPJCx\nXwL6TpZCgKQv+P4zJmWaNgN6qNAIrgBHlaZcl4+fCttHzXMNnePt/Vi4Pe4q\nF9pTO5ruExww+kVKwGV/d5byH/3k9krUc03yNzNfP6hJ01HuQtr/6Hf1pwQv\nWKOsrcU3tka1+xEBQ9XepDHJmoZGVx2JJFMMiXbHf9GJWEz0Bn08Y5d1KqxC\n0l2IR1DLPV4e4Jjr0gXYszqG5iaKXVZoRoiSLwD/QUhAjHAC38e+ewpF8wWP\nw013g1o1lq7kCnHHq1iRvagXO2L7d4FH5jQlvHePFQEWjBGfwL60ojNVq6FB\nLogDtI8dP9YWt4c0dQGlhXGOV+o7aH04tY5cW9W1sZZCgH7LDRVoca8GleOM\nNRmz\r\n=6akF\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"5fea3384d9b74555b50621a78c2560e7bf5f1e18","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"ethers":"^4.0.28","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.2.1_1571777820505_0.2427104544694052","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"identity-wallet","version":"0.3.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.3.0","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8a4b1c5a508d2f91fa1d3794c6b7a49687493457","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.3.0.tgz","fileCount":28,"integrity":"sha512-oTQ3W+fdzh7+jjNg1ULWvLVqL0pdb4drxGNMNLD0kgGS1MdlKpmqi0ELZF8NeYbFl4cmAnqBgSOCtA6SMctJ5w==","signatures":[{"sig":"MEQCIGcOt7xDhBMFEQPf/iRFQjW8xXUefNs9mR3WbzBM64C1AiAhLPcDd4pyCdrFh+0Ze9qzMAkS6QAeIFbjIN3SsE2S5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2096379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwpywCRA9TVsSAnZWagAAr64P/i6rMPnwm5c5W4xSpdie\ndBFYaOGgj7PohUZFcwn64ixai5QavLNjXwTTzjvIsfNR3mf6W6HP7C74vcLZ\nM3W1ay6kcoivCkI8cdNIRvZYmF6yeEcELuZhN6lQbd58hXEPpaDNeJ490Zm+\n6cjEYksMUH8l8Bn6nOvSvwNQl5bjm99bINSicPi2pUNAPAquPdTZwUJJbBTp\nlpps7oWnb/w76NfcGGZXQBY14SnKN173/+OU0mxqNtS40PMMUmwKHJeVMTKn\ngzKXO+kcD4aqUWwvzF0lVNShxvjMsXbvbUMYhucHG6+HNfOhoOFtaYrliFi5\ni+KJez2FF8AIJHZ8gvxuuYcQyeW/yvlVMLzn4TSNk6BxbwnLnKAG7Oo2I36r\nBeSjMcItzkoWpIBhJN1Mea5B3+Qt4lLXGGSW2+pzvA8lM/RKGWo+nKxkvKrR\nfByxSmCPvX/THnAa0pOTeM/VEVrJRXmpxQ73gR8ZfaP78C4RLpViZphaSq2L\nxsZMWGzowF0ww6XQdEwqW8H1Mn1sH6SjprWEyynzpOqwoC0sM/nbVVhFDQVT\nV7F107uX63kLdYh/oWi2tmExmLRffW6UWjcf1HR/mmHsK3FlFGDLp1S4u6yF\nwsqnaK4LxK11I4dOnKQOB6R1fjjnSz5gKGRPKrSqJnlM9LtOWHJuK1jkmqwO\n5de1\r\n=b8Ep\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"c158608576f8447e789aa09f167ec361f46c0c78","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.3.0_1573035184387_0.6716646832717192","host":"s3://npm-registry-packages"}},"0.3.1":{"name":"identity-wallet","version":"0.3.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.3.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"dcff5248aaa178621f1d62198bfef53b1d961af0","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.3.1.tgz","fileCount":28,"integrity":"sha512-xTdDEF5PzAClIeezKtUV99Tr0lDQfaxzx+BBEqvfh+Sq3zOK5UvWgBCfxtvyHx0frG5ovWaorIADx9b2+a/mIw==","signatures":[{"sig":"MEYCIQCxeBtH4EgL85BghMZwEKXgcGBNkHCsZUqNkHAT4PRK4QIhAN2UniFV2/wl8vfzsIMbQvSH5QVnQWJTdB0LECFDhDwk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2096649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzbKLCRA9TVsSAnZWagAAY0gQAI6r3Z+cRFuxib2wW8lp\ngxukxsN62B3/nWsmv4+VPL2hfdxkvMDOEnr/T9Vk36mjiuy8eQmyJvemlm5E\nHpu4uth88rhkXmGDjNdqMZ6yWTOf8ABO8TQGm+bPcxF3MtSc8alYQUL8rrq8\nuImny/yDd/qCzDwYV/bBHVUnICL9gHx1W3sWAXqI38WYnCt9/sq/g7m4Q0SE\nltmDcJzHlZyyvk9WTJgmqmxWPxHbt7PqpJSAvmVn7pQKT3W/qrvHvo+e01Mi\nQhnOozLr4bn6H0W+rP7MOzocuVktz/IYE8wHkTHrHfXRyBtJXifgh+iSRG6x\naWDhwRoEYjgpD77rZKro4cv+MoZhFUO1Lm7K3PKe64YmSjfPdjIfBDjaXe6B\n4wAaJ77J/AsYvTkqbQ4wxSr1ZePJYhyLhSO3X601c1nDFEWvXiRK1EsOy0TI\nkJlryh/BWmcgG57IWz+qfhk/1EZ/fKUfcfxVwlbDxIZFi8KyxR9Xl6Z3ZODU\npgDmwaji6vTaYqUseJrcsY4hf4Q2sMUGeO7Qe037JzquB9bD7iCZnO1A8b0f\nLgSts+mVGbTsrGvP2b6j0ByDeFdUm6C6oitgF5vTezQiMxjb3H015b7oiSCy\nvq6NZKH2pxEhiFYFoQOat6T1GzUj7YIXGq0445UVRFE2d/i+dnYZJLiHqf8l\nAt5h\r\n=YgMw\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"71ea0187d03ed05c389ad89ea404beb9fd4850cf","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.3.1_1573761674772_0.8503100944777164","host":"s3://npm-registry-packages"}},"0.3.2-beta.1":{"name":"identity-wallet","version":"0.3.2-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@0.3.2-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"0cb9942f6de9c87701ea1f3a4fd2e6ec4da80dc1","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-0.3.2-beta.1.tgz","fileCount":28,"integrity":"sha512-1/hHjNKuzos+SE/sBfYeS2plNvMrQJqrZ3vy7X9GIBKJRkUMC2NGKpN3cXDUrXdG8YYzlXkXh+xR7zRa6xSPyg==","signatures":[{"sig":"MEQCIE/7Q0OzGA1J9bKVDYD0V7xS8EivYHb1dU//oD3YtY3sAiBxMVKTmwQK39kqE70XDFV+n1p8Yb9MWj6GJh2KQ+vMUQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2096714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd0/DECRA9TVsSAnZWagAAngYP/iTA9piF+Mz/y5ZtlJ0O\nFv1W0YUFeW3B9Ru5x6BZpb3Gnxp3BzfkKfNq2Hdi0cflI4HMFNqIGe9avSeh\nScLteDz5qakjhbMbsCoURnTDLfHZ7Km+cLvSD7y0NiSLSzRw9w4hBUxB0jY6\nzDtJasrLYkKOxgJIdFEVnCFQ5NGzCSouW7EtGpMlS6jnUmUwfjAp9xE+cLzY\nPPMaZhOtXpg5TbXJfJUv4TVAZaRUSlXqe2nRUa31aXkKlw9h6slpu0oIqG8A\nbQ/EyzS/md9mYGhF82G/LZTOHBTe3Nk5RB6SB3If07OXI7MyNeA/ASQBYhHX\n/p6Q8OTPFNQi2nyyjOqHgU/eg8NAKnsGTARN7QT8Mu8wmbYtXcIT1/H89t+0\nlAcxAToenkQIPnFoD917SHjWggY8P36qMlSNtpU2Ceuz9hYHUElDYiHQhTNH\nxi6LgmVUF9WWrrnwutUoKGO0M8mlFsFks/Xe8iP8nyyuPhYnnDmaDbsiUMsv\n8ORUrlyqoEg8e+XVtisiI9WSya4BLDtyqefcz59dlPmsNBeV+hB5W3c77dm9\ncmg3h5T3pOVmNd3JKYekjoU9dE9MHCxsq3N97Oh1ys6ztVa46hOuLl36Z7Z8\niB6xBTcz0B4p1taZ94Dy5Qx3gzMfpyziwjBeNcUC3hj3SM+qVI/m+9YkEBFF\nTDIc\r\n=RlVa\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.ethereumAddress | <code>String</code> | The ethereumAddress of the identity |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.DID | <code>String</code> | The DID used as the issuer of this claim |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"71ea0187d03ed05c389ad89ea404beb9fd4850cf","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","tweetnacl":"^1.0.1","multihashes":"^0.4.15","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_0.3.2-beta.1_1574170819234_0.22383469202555384","host":"s3://npm-registry-packages"}},"1.0.0-beta.1":{"name":"identity-wallet","version":"1.0.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.0.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"fa5b98735c5d4b69cdacee581a7bc5098396f906","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.0.0-beta.1.tgz","fileCount":28,"integrity":"sha512-ak88JCruA7TnYU4D2ussRYyy3xbcsCQXNuwWLz1rdhtHqsrTE0k/ri7CeTApUG1WENImlqH3tYVoVeLQLMuFCQ==","signatures":[{"sig":"MEYCIQCeYaVC+vc0f5OPbXIxXv8N8r1/k/xcg+hySKT63MjJSAIhAK4rZeugTGOGUP8xfNFM39mNXvBeE6FO5pYcGRCkXIL5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2493136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3kuhCRA9TVsSAnZWagAA1XQP/3fTwqMivoLSG6huDJTO\n7/+2jSHizC6M/PM1c556ijXKSUTrlBhgIZ7RCX1lgWWfclH6GzocChsYgQIJ\n4nf0r2oJ+a++BwSqvCUo8WmE8xTuG9G0YZyyn5cn/Vbq3MCgTZMJ7s6oZopw\n+9s4GwZB3CHcoOEJmCvyIxcj2of2bTJ9Jd5Z80PtNpXUR2hXINO6UOxOwY+C\nr6FDO7UBWSUUPc4tAFWuozvxSX6qIDPMSU3mnwJ7j3zs4GlVEhpGYXfGstre\njLdvF2A7UhxZz6uDbk/CCGTyi/jltJ92LbfZgiqX/Z+g5CATZM8A0dEkdFlt\ntX7ekOxT17v1cgh9emC6g8dTiG1l42eH92ClU4Zr/2ThmZjE3LqGG4Re0F1/\nFwzC1C8k7hQtaU7zio+qaG8xbMZJQsWLA9VMnWYrS1l5iXWDduVE9VGFIfMY\nqsMWU9gy8lgUkFJWfBTAfzpDSpI0wtNodSHLXbhtq5JHgQBluYg0l2r9Ff4H\ntqLXOQk+XPLBSbvf3py/dz1bSoOmXAy07Pvpl59qIbybbBs/Cyx/A3h+kuep\n40ZiouhnXN3I3YowW0KNEeMXdgegI+joIYg9cN3R8bBxQ6hz4Gq0Xh+7+APk\n2T/Arl/nQqihy5wOzCvNXuj5DMWo3kRyyc4OPOWJWSRqnZaq9IqUI91AOln2\nZyOy\r\n=I5Yy\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink an address to the 3ID\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"17b5fa813e729350c45f23a97022981317e07a76","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.2.1","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.0.0-beta.1_1574849440775_0.20860008974465538","host":"s3://npm-registry-packages"}},"1.0.0-beta.2":{"name":"identity-wallet","version":"1.0.0-beta.2","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.0.0-beta.2","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"c55b8c834162cbc59161f755d33bcb75cb910f30","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.0.0-beta.2.tgz","fileCount":28,"integrity":"sha512-kThy7ittEQ+JmgLPDfcPskUi7tvG0WzCXZILsAYt8oseL+QDhvKYm+RPYhb47UFwKuUgOj2NqE19ChI+SEjl7Q==","signatures":[{"sig":"MEYCIQDFpg0op58G2ckNfoCKa56OPVtiSZXhU1VoGMkdu8TjMAIhAMTRtjKcQ1awasNOW52iAyMkFugl4etDXW3qUfXX6QAc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2493940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3lrfCRA9TVsSAnZWagAAER4P/07jA5AOkbJseqAs97b+\n9PBs3FsGFsGHfsSDmKq5nwjPuaKKKj5cTphpsePDfaKunhTFw0Bs6YNio9Ne\n9cBT/ooXegllX3yY5Jk8YAAXcLSJXpLdmHLaC4NyYQeZLc04CoOmZ6IW7pmA\nk7WiKVsUnTV67hAIpSa+8dkCXM9LwKdowgcM2HbgUUsmptTND98dqPRPJ0Rd\nyYqAQRK94BsKPBED5WPWru5tYx4SKIKopVwXU4WcviKkpEyMXTjdkCNEhsW0\n3tySWCjMRaOEWTZTAxTD/gfaaDQYtgInCpsi/8+O/c9Aw5Udze6WXFCHJhe4\n4ruVudYxeeABu+unN2TJ8IMoZAr18b97F5vVKfmKQr5nGKEpritjuikLS/cK\nh5QTLCQrMeLPBxy0lL7HDj/DxlgIFUGyAnxZANZo5pUli9tmdT/tHwqJxYuQ\nx+bU4Xhjp1xK+fSyI3C9zdJQDiymyKcoyceF1MppnyRKKI7X61RCJfA9Lq6a\nWPghE5xUdseMDPnYl97EgJXr74CvkeQRmkjLyfW4iMNcBaBRyg8rsp4ZR+kZ\ngEPmenkkc+bdTmtM7ON/Hr24/bRcBruZcdOXSZS/l3tTUBOpZ9oIoyuB//t7\n5ph0jkJXWKb62W8CPNsAxGJYSAnBHcebwvTTaDqVPDFkiVatuCvR1OeTbpnF\nlTUC\r\n=jtF7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity. To create an instance of the IdentityWallet in this way the ethereum address of the account also needs to be passed to the constructor.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\nconst ethereumAddress = '0xabc123' // an ethereum address\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret, ethereumAddress })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink an address to the 3ID\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext and nonce) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"17b5fa813e729350c45f23a97022981317e07a76","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.2.1","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.0.0-beta.2_1574853343322_0.5297505951520685","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"identity-wallet","version":"1.0.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.0.0","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"51eb71c367f705967cce1715f27bbf1094650dd5","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.0.0.tgz","fileCount":28,"integrity":"sha512-Vmf9oGFhVynhPaVJhlbPYIpJjtREoEMn6iln9Totq5+Ee5PtckSEyhDles0XlCQMShwCdoU4Xwq/rypUvVQh3Q==","signatures":[{"sig":"MEQCID5XATjYKa9JdMURxaKz+/FdvMV/JU45/HZmHtjFTE+0AiAOtACPl+ukEzpIbf3oFVWhwgHSbWfOzGu1W/9UVbbijg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2514594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5WLGCRA9TVsSAnZWagAAhr0P/A6cYUHygdmTwFRlWpGk\neRt3ud5k9HQDgsAR3colq1S3K7oHqwZQ/gWxS/9kp6bpgYlB3IWZ4yA1suxc\nuR0u0U5Ck7qBfvh1acQo3VWeH4kOUVnHHgDwvcJXPc1MtBB3aiVVwpQRguE7\nx7PXA2TX8pBrOWQvUW6E2GQ2UF147X4opwR6XL00eas60l4OMI9Zp5YLWEiQ\n+YfBT8kSyYkEgDGNNrRzRrRSo5L4qtMXZTv6LRzEqjvKKGX7eraNuDdLrscT\ncIGrym0/dx428kqAi0lHjzg3SSEJkqsJqZ8/M6gYIU7tI2RdwLP8xlSfco5c\nsrxGhNMRRE2jrCx4pt7IPV9qKgHNCpUJiR0Rrc/bvPzKF2aSxN87ySe0euQ2\nvlHD7rdMO+BuxVMNZMaCkRUn3sStWo1ZdkaRu+cLBUoSEvWzOawuQzwntiJr\nYTfAg4l7rRiYhPi43oU91OMqpM1CYmG+fGZby997Pyv2dcFNVIXigouIxoN8\n8nqw18NxUZMkMKh5IDask2M/RIT2w71KRlQkepZJvfUfoZFRoXqBzS9Vf3VP\nEPIsGyRAQJHYQOFYESl3X2L8DoO56dy5RWHf1OJmaRIOIm/apbMUFQt8PMjL\n7orOLIW1VPaxcVms88xJ3ZtGvn8V2yLJu8sIts3nmPiZrOrYwP5gqv9QO4FU\nEJPc\r\n=7ZJ3\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"c4bc6f10efcd1383e09ec4e974e22d6503383125","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.2","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.0.0_1575314117451_0.5009601050170669","host":"s3://npm-registry-packages"}},"1.1.0-beta.1":{"name":"identity-wallet","version":"1.1.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"443529094cfe8702221651e5028dd5bfa31a14b3","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.0-beta.1.tgz","fileCount":28,"integrity":"sha512-icn2Yc7v87bzs+S2XZzur8XHihICLxre+26bB+gHn1aWy/dQERXG2bPtmuDKb2U4K1DRqSNirtQzxHQoTnBPaw==","signatures":[{"sig":"MEUCIQCfdNrMAPHN/lUjfpWcho1eJhPKBeSrUSkNPGeF62TKhwIgFerMohICkIw6Js5oGha++BFxStwjuP5BGnfIf7+2xJ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2517897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/MY1CRA9TVsSAnZWagAAnt0P+gLdVBIZSXJL2trqw1Yz\nBsFf0KB38MuhBFQ4OS8G1BcDQKckZZG59lPHygs6mRt3zXkBjrn4JhjMnnO3\n9Ih8NBuUfZ4RHDDsT0MeNzf2yTq6XHaVmjve1q9Dh/87BZAfpaUZEfTD/GZp\n2oxHaWaEUv+++2iyRlZSV/MO+Qv0QujKZrhRFqxiVmW0vHkl9L7/aipbqUQb\nX/f5KU4tb+wJhm8jl+iyL3Edjai3pu7MurO9rMYnyB9D/fSoqpPYsAr/4jmp\niaOOOx7IGV7fpUs+rBuG2ozCHCfVp1ANZT3xOnaiZ0uDJokuhIKDIq6/Xf5U\nHCprCrjJ64MmKLiGQ+OMk92RKu+f6O3EvztOVmoRq2v1YdESLwoMMrEA5YAs\nbPNXEYFD2kzR4kn0mfsdt2Fk7UBSmebwJK0SAjl7Tf+rQ3Y8R5tFrsNhJMew\nVSBiNgwxDQB5aKI1rTKRLOSqUeQznddPh1jrWPNnfDejjq+hdcoe5L0FsD/t\nbi6Ajekjfhsx1+YrnewCVY31PbHA2aWwukXfy7nGo78wPxovCB//YCSxS2PP\nELn2atfGSzoJHdbrA0SGF/4GqbmaCT1jQSVb+FRAjYha52JYlvt3ZAdlaPss\nAiKtlJaFolMpjIgEofnC4ZLY48XyeRtPvP+wAm6hD6l0gA5Uj0nxSxNmFKpI\nGzyL\r\n=hIR8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"a8fc9388650097d82dcf5f803fd015f31367e8b9","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.2","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.0-beta.1_1576846900644_0.5181785324103907","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"identity-wallet","version":"1.1.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.0","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"685435f84059621a894baad1fe4547332921e9c9","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.0.tgz","fileCount":28,"integrity":"sha512-D6zGznRc3ba+MO916mUDYZcFHBwScHBm0qIopMHZvUvKgRWrHr7A/19xBV6G5BNe3rSIa9TzMeeLCm3qR1i6Ag==","signatures":[{"sig":"MEUCIQCPD78CWwKhPSvyg00Z379LF0Un/+KfPIpqzq5dPhMm9gIgPQRSNkNCQ3NxB8ckD0ZDFbqeNI+7TzbDrDprVQVjQhc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2517961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFvVdCRA9TVsSAnZWagAA+McP/RvJYJANz0j/l/wKOGSO\nyq4TX8QQ2vQe1RdOF+fDuKQi6rbL5DuAJ3rgMXZrY5nTQ/Ui9MeiwpA2RDOB\nktQW36rMoIYkDQeoDvavgqduw0x2CjBHS/MwpbVyykeHfsr0qs8OQKV4JCKH\nM9NnBpzJNlEaId4lAQb9MLo8HrVRhuiTHCrLNmMFvY/m+lMBCTWRCZXzpJDt\nD7cvOqoCJSBysvYw/OHuYbqmgHbJ4MC6AXpxcBhqerg6MX2xvpk0Zu9IiE6z\nbhRJwDF94+750l8wJtwHrUqNMiTc5+pzdq7DCrxNw42oTWRTuhOImXwcLegd\n47NPZtXD5fM3lCvOMYKVJC1ncayIFhhLLCzL60a43tuTwE2PXaOMgxera4tW\n9XXJE/hGrUTr5NHT/4oKXeSUSIlPTi34i3YJsxBLFz1DQdEPEHaWy7AQKlIQ\nvs00RkONcuaPRsAaaTVIwdkT46+8jg+IrDAr5SWQCY47p7Ea32ocPZ0h+qVG\nRBLUoZJEd3gTp6lHY1gsupvAAi/9jBN/kMaeSjjowKEH04Gqwj39a+rOVF8t\nmvGQMP5tYMOwB5QqEzF4kFf0vk8IBj503mBn8k67/Mr4WE3EMtB01lTQFvX1\n/qV7JUdwM5p1qTGcXheBrWiZRI9SHTgUzp+rRs6UguLi0a/blW0SEbRT5IEP\npr4w\r\n=Vs2e\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"2d0cff95548229c20060e864930b11b36688903c","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.2","@ethersproject/hdnode":"5.0.0-beta.133","@ethersproject/wallet":"5.0.0-beta.133"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.0_1578562908830_0.5339122812725978","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"identity-wallet","version":"1.1.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"d8a28528d64745b35bbc5c3683bbc69be16d421e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.1.tgz","fileCount":28,"integrity":"sha512-Nta6LK7Z9B9+W9bQVS4Tj+axoAmGuYIPIN6ChW5qWoS+98CYUe1EDcbO5YgjCKpeJSUSKbzfJiVL2N3jdl9QbA==","signatures":[{"sig":"MEUCIAEwlP91tjryaS+xevRMOYNuauMEGFr9UqJYlvfO3zFNAiEAiHTLtZKxByTiHS7JN1WMC0Ckyl+NybI8MYJBV2q/nq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2522388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRFbiCRA9TVsSAnZWagAA0jwQAJTIxaM9/HVjk+N91h3c\ni1S2uEWxVTtr/wXLNpfUJNFXqjkuTqAxgrHqockieixbK17DNC9mPs1vUzK5\nsVU5s5x17IN3uXafTGc2aGRf+5SbSBmKjCyy8v+BzPpkE9Tk7EC/XYYqdLCT\n7791WUsVDmTjC+gfQivVY3sTBF7agvJdymiYnXBz6Qi9KIULACqfwVJ7tSk0\nY+lmI3oxHm+nYt9+pIIfFHr6E7ZmsXoJKSsdrphV33Ab2Ajqj5rXg+ijyPA6\njBPxMF+HhuozmMa/BGT6JRvnJx/q5wr60aCiJ9U2japtw+Iu6IOZP/OpxlHW\nvGQLPrTCj+C2fXtID9IfTi+S652EqPsY+/M0c6AlzS7bXQUD9gq7WPjfbSvH\nkiyYJb8cAyl48yL4Rtddx/kF8GLIeB0bScOPqhhqLRIOZhtpL/JxwZpcrkNa\nK0yrrfLrDMWz3CIvVq7LRBzrsGR5GtTHwu4ZwUUAH60lzaV02lH6VoVUUgwD\n9bcP+elilScno4VqDtF4zk3Gxde1yPthvK3niSMskQuutL/uMAgc22Bs864b\ntVj+tzHQpnTNVlXxkRtvwXSHPihyjvN9TXf8KYEnpHCVXpfcAdOhgJ5pJpjI\nf8nfL5hpIZQdTJoRyRHduD418tir4p30WogmV15P31jSi1EE/PA2P7UHhcb/\nylZ6\r\n=qXXZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"9810623592c946ae970522440d49b4a92c2a732c","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.2","@ethersproject/hdnode":"^5.0.0-beta.137","@ethersproject/wallet":"^5.0.0-beta.136"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.1_1581536994146_0.7700428671363313","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"identity-wallet","version":"1.1.2","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.2","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"9bf94f8f3ef40bc2514e762488c1481e19f3625e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.2.tgz","fileCount":28,"integrity":"sha512-SEdzRMyVnYaKD346yU+MHZUTffK9JcLsX1xmRDDkOaSCL04jHML6RiVyEffN8upCs5sGszP+vRpD3gztYkm5Lg==","signatures":[{"sig":"MEUCIQCLIqkg290wM5SHQ8eHjPOvEkpYBFEB6otxIYqUWzc3LAIgQrXJNAABS4KmQNullwjMEff7PZEfD4WQu+NS0S85ZRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2557105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJechkBCRA9TVsSAnZWagAAhKMP/1pIeGkPFGNYwXXovOJ8\ncrWawk6hdXT1BHfN9M+CbGwCulMDoQ4Y4x1snamx3ALvoyhb1kTv7rf6WfNp\n9dXSDP0OsTGqBfyLdaOX/RDVibdle6toOCVkFcPG+zp+xN/uEAhlpnGpDIP8\nbdevW6BEmcCxmlWFzTKdbxeQJcytBznrPF2i7yR+1tcbj06XzEsiK4lSAnsh\nJy5tN0TP+ol3pXqU3I2ueg6bWCRVlFHRBmLNG/FxZhoo35lgka3iiMsTX/w0\nhMBsa/3z80bBof8vxqKPevJbXOtApK5UThIoDk6zy21ie7/vNoDe6DFbKhRr\nu0pPn6fs7KSxxwy20D0JAMvZ0DTeQE76HYq6UzFmwnnj9mTdfML7r2rO80MH\nmS2HO3yVek2Eibavu9z+8/37J6dlw0OeXasIQLxpOnMGPzv8lw/F0xFXHl5f\nX6Dj1pN6yMqEunPhSZ42VqE/JnqZ+ATTwaJ6hTuZ12a8gBdURhd8G2YwBnqI\nAL+22i9G/6/8SXGTbXetu/GRY8qfb8r3UYF08PDwuLtyB95gKbMRDohYCn0B\neUlQz9FvC5pVfDyMVQiyoiHupFJFtwHn+JTlzuNQw/JcmV4fWh8r7C2nHG49\n4X+QKmzWSO8x4JvtPkZvYfvLEHbIFZhB02I30CXgQrduAzEaEEGN8PVMT72y\npzDj\r\n=Kjug\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"9810623592c946ae970522440d49b4a92c2a732c","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"^5.0.0-beta.137","@ethersproject/wallet":"^5.0.0-beta.136"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.2_1584535809486_0.6006580702854736","host":"s3://npm-registry-packages"}},"1.1.3-beta.1":{"name":"identity-wallet","version":"1.1.3-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.3-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"15124a0834fd84cf951525f929764da8d71096e4","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.3-beta.1.tgz","fileCount":28,"integrity":"sha512-kHUE08vvCIQ9LfVJEToRwsOCv9qdaYiG2LJKG6p2PNAQH98BnhPrT6UpaPGJtBNheTYrX2uInqmEjowXr6NLgw==","signatures":[{"sig":"MEUCIDn/V9CTBAwWU2RHe2pVPjRgGRVhBdCTiLxf8wQfLkUlAiEAyUE/t3/ybaFFJrMXeCA0aIZPmgy4Bm+D5irE8X1w26A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2556044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJechwNCRA9TVsSAnZWagAAe0gP+QF0UZMl2HrMigBlwIYk\n95C6QdCcx4q0szVCncv8o1CqxSatve4t7y8QXGMzeHsr4NfZF3hXuPk6JbUf\nNaHD/CA9vW98qcboQviPdyJWwW/tompKn/prsWj/KKwSSZ9AEWtACj2X0nPD\nDfgh+zmFuw7RXmB2ARv1Ms8kwsNq0vPq2+z4YnP66QG/3KLZoayC2Te3Jjyj\nm8Ir+wNKmCDOTJzLSdmmVBkR5V9+rKWNndF8336Wyx5L2tYCEHYOiX/4ejST\nrdS9uSxgj5JK/VH6zDVSmbloCTqGqsj2jVGoTQ1oo5cWbo7SUv1nCcnjRG9U\nxKwnRtfoEAWWjRSYtubqXgAQ1qyDJPze7EgPIhoV51RLdDTOnr7ZJ3NotV9h\nLPZmQEf7oqlKAf+2PTsSh0av8HqSikVwUF1s/s5Zib0b9wwxprO8OuM+MU9U\nLQMax5H7a/lsc3CgIBBaJKvpQxoXWOfpMwRAnkJNRES0vLhDnvL7FOaMU/TK\nbst8h6Cmqiml//lmObAFiogmVmBRnXN2J/QM1J8RHzXrscIPHT3XwuxUrRQ+\nUiXZ6+QDZUc61jhiGnIgsM8XGeclpZv1M+cDs+XkbV9bQnh//l89ZqplqQix\nlfYVEsx/Uak1xT4cM3VyvM941+t86pEltiSkm52HBKxYntRhssxR78wm52/S\n8/uW\r\n=QSH8\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"9810623592c946ae970522440d49b4a92c2a732c","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"^5.0.0-beta.137","@ethersproject/wallet":"^5.0.0-beta.136"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.3-beta.1_1584536589093_0.012489029882345903","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"identity-wallet","version":"1.1.3","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.1.3","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"6e97253ba79b44725628181db6b7d1ad42f64066","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.1.3.tgz","fileCount":28,"integrity":"sha512-sRJZuWivDzmjbHHdepPYUDqqRVNgJgu1bAyI88MIhLiT6qeQNRYt5tGGhn3wtfEHn58yWqR6XlKBjUY7mZ5ggg==","signatures":[{"sig":"MEUCID2UsIBAli3uJjt0PCUxqKwa7ttenXkVPZy0++nDcQyIAiEA/f/O9bf4apf8LIOHrRSwUcI05+Crrl3TPIHYSZVKWro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2556150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecj5SCRA9TVsSAnZWagAAWv4P/RKBgBvtubm/vdFn+L44\na2W4oO4Msmd5zixx+Q3RxlKuKhZUu/MIbJF21ag8p8ybJ2kePj4B/9qQja87\nn87VtzztsCIWUeXgKW6KEmgcQWqTteQuVj32xmmE604+bl21ncjPNEFO9Ms4\nq4vX276WLvCZ46PeLJhdz6ZkySzvv3QOYbPzMr1fjo7nH4IU3a7+bzsogyl2\nUxp01aYF+rZT/OAYov3Kfmfgxr47U/Ki0IyxuY5b9NzC4W7QYdCD95I/dkb5\ncqccV80GKJFAPSW8rURkEjr9A1dGzQ6QTY+2lU4bhavWmhgdRXtOLPGmPC0E\nkZpqSbLm5ai4/Sq7LIW4BLlWTCTUce9qi1wqZx95qe4G53wHJzMHpLwJ73KF\n8KKS2dR7JtRJkBd1hF6grM7lB0TUS3gbYv1JIjmF4XY+POhSKg036cjyVAWx\nai0mMkC1rm6qwKkQuvz5WyKuFdwxtd3bLD7i9lEFXMaeiAY2KaHies/LhnQe\nRIA5k3mPjYp09ILdDTmsm4uvD2tKm7qU+v+i+knMDhKpqXMLcrJMK3oEm/ot\nbM0SBetUe7wIm6Xsboc+NDjcKI67kIkid5MpBIu+nH5f8BjtEZpKDAfvAJYI\npVMzIvtODAAGGIX0UGcpJ5xxWRgIJHA1QqsWMnIF/23kYnc59UaDONB+Ci54\npDpi\r\n=mpBq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"c7227a20364d4ebd2054834f96da6e9316ea827a","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"5.0.0-beta.137","@ethersproject/wallet":"5.0.0-beta.136"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.1.3_1584545362291_0.24524308227542746","host":"s3://npm-registry-packages"}},"1.2.0-ceramic.1":{"name":"identity-wallet","version":"1.2.0-ceramic.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.2.0-ceramic.1","maintainers":[{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"70299b1637b9f8c6f35881c47196973d8fa08878","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.2.0-ceramic.1.tgz","fileCount":28,"integrity":"sha512-HRNrtqa9KbiMMISrMsoOxxsWIx4u78vXm9Wr+ly5yiclhwTQ5qAUl8jR8HH2TozbiayRVwrZPxqRRYkpOupEZQ==","signatures":[{"sig":"MEUCIQDI5m3cKd97vbS6wakGr258576b4UbwRg6zi0fpa0bDFQIgKMes8Ntc7RuPK1+oJ9uKHyoiAuqpWoOrotQMNBMM3DU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2502645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiFOUCRA9TVsSAnZWagAA7s0P/3K8+1jZn+yNeuVC9RZY\nBm+D0BJrpKUq3pes5Jtrxo7eWhsGilDNPM7HrTD1ipTDa6WLITH2XzicDFeN\nz9NGdZh/sl5fpoRrKjUNt0/NDhHHiSI4OximikhLmlrdYTZKeAEwkF4aWdwk\nMs7+EgJb5ijMT4YWhcLdg6vXEyOfsP8Ps2SvMM2DxtXaTLt3oLe0uELvqBwP\nhrEzlE6oQJK3zTTlpZoC+xhNlYK3lO+j0/LwLP+j2gLTElUpnJvA89P7uw4g\nauy9vGVnhLvB/ehdBySCOnfXzGj4F2sKDWxh3MwW4zV8Dgh62YQmRr3VJ45h\nGfgk39G0sA0aruKcwUV1y8pBYETl34qKlkjEPuyABI7LRCnlXpnFJb9EBFKT\ntJGuQ+j9uaz/EbeYh3woOhYI+tOQdQbG1KAOS5iHEk+3MVsiWEX6V578iBdV\njzykQUq1QbM9pZKxZ9z/tI3SNgbN00YlBdjvfml61h6y9sEcYY3TfimZdUBI\nLvbrr9Zd2zVMNRelrFUu6z755blFwT4sksm0atp5HGq1nsrs5Jpry13n/TUw\neQAMAlIeLNV0tva4GTIcjWDVP8eNbswc2Z/fBGKOhji5+sH6Y3DQJ4VeoksN\n7yv2/cA1tZHVjP0rBAlYXW3l5KeapJCNWowdXbMNKQfdr3GKTM2dRFCcSDit\nK4hi\r\n=SVxq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"9feae75f56edd64a007b847ddf2816d3da49fa8c","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.11.3","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.16.3","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^4.0.0","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"5.0.0-beta.137","@ethersproject/wallet":"5.0.0-beta.136"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.2.0-ceramic.1_1585992595775_0.031104706531325688","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"identity-wallet","version":"1.2.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.2.0","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"715b566436f54d08df9914a046cbb4c27b6f3734","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.2.0.tgz","fileCount":28,"integrity":"sha512-kPAmtYWFgq5kepsQOI/ROUXen+wA10lnH+ZyX6cL2BxgQeP1Ae+L89NQcsogurUSYvJNXO7heRf2wEktG/enKQ==","signatures":[{"sig":"MEQCIGTbhPTSNmB0jqlUVnb8TpVqvfm6ikjFInstwon8dp64AiBa8z7bqrgOeXqnYBWmFFvFYRxJBc8ZjLNqITqOjEdi6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2582913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJele/UCRA9TVsSAnZWagAAVxUP/1AG6wFu19LnPQST5rOH\nC2ck4fOwoTjMCpuLGLGGwDWNYCWZ05uOMiQREmUk2cgdFDmeQzwbSumXJ8FY\nCOdaF2IIo2keZMidAJcfLZgG4cW8dKmoGwehX2bTVS+l8YpwPYSWSG89Y9fC\nLFT/jgSrEbkJJYA4hDR3ZcVDErL9oR/nznkSEjwZECgH9399/cnG2XQ8Jeej\nFXKf7gJV3MljmRcLNbCdzyE19rlrxGQN6lKrGkJG5WeTi/wDjsagc55KkEsQ\nkmNVoqGRWyJ62nMUaEFj6TQlfdZ05UxO2cs7KgVMSw0BapVVGKyT+Gs1ilxV\nfadA8cVpOmdQt+0kB5OIj/xiUDs+wFcdnSfD9abG8cQ+gM7qnTwOo0h22j19\ni/8t6MH47aC+6xhRl7huusXxTD9ixmdJ9gPNp063h39nKgBH7Cf80XCv3o0Z\nFLu01UoLEgeNAStEUXO3UUBp1bNedmKC4vAB8BMGFTMqj0pXLBWa4KqyJmaP\noKfFoECfNrptTTrjri9JDxgH/M6Rl2HZCgG8ZmHGmPX6rGTmFtdSPxba1A6Q\ndJFcC7iDLgFVGgyCRppVQsQdspH4YRccfCnI+vnRFtLLqbf6/3EneZ01VqyZ\n5+ddRakVLhdNZ16Gq7DOROVJf7JESWgjYrKywqazF6okkucVeXHfHbnLBIQ2\nxeaT\r\n=6P/X\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"1b0fb776cab54998540d1d41f44e397a797c8edf","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"zachferland","email":"zachferland@gmail.com"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.12.0","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"5.0.0-beta.137","@ethersproject/wallet":"5.0.0-beta.136"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.2.0_1586884564033_0.9925304693448207","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"identity-wallet","version":"1.3.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.3.0","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"dc69b28be42469e0cfcd44cfb9535c8574c8c3bd","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.3.0.tgz","fileCount":28,"integrity":"sha512-jVyR81ZX+jbEwujMRui8nvggv06F7EzvUfG24iZy7xscb1iD6iJH2UeNhc2AvteGuphwzln7qm5GlrwhluMfrA==","signatures":[{"sig":"MEUCIQDRx0OH6OnOIeuRHjSainBeBQVPwlc3FXFOp2S9kP+FkgIgXt6EzPI41tYvk7KPb+fJiHemM7VQ6UmNrjdJyIpCnZQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2582054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0WcsCRA9TVsSAnZWagAA6N8P/2xWa0ugf/iJyw0FF+8R\n0sNqXbjKRG9bOFAyKci2YwT6HeiPIAJe2RvkX8mmNe8MRst5XMeG6kNBSrX7\na1A35N/4NYrwSVZnwsQQABc/mw7PIKaGJF0gweB4wOxp7qZcQu6CJCV6Zxsv\nGDzGIhnsC/mGd5ClwiYz3hAIb0umdylVGzyz2tYHK0CGy86b+u9nCr+WCe4o\n2Vt+lIljL51x8dJnG8p+cFg5wR+ZliGpWcBCJLikkXBbkRQ+rbBCHRUvDcFa\n5uZweu4mL62MKnQF92anEf98fApu4+q1D+1H6TwxZcMR0cZdMObjq4hOO70k\npPBY0rMC577aZ7kok4McFfRFAdI1A3MD52q8ds+biCVruN3EPcFL8dFzVe/2\nYDq6EZ1O5OcYV+nFoRLRLZM/nTrI4CIzmeuLikkiCeWOy82qNhVByc34volG\nywSXuZGKoS9XmJnmTJYsA4E7uBtzq0jTrc5ZJx1kQKfWbbS4YVJUp4d0v+7J\naevBU99/ZWp6eZILCfywxGbzpu0ejfbA4SlbjJAmFC8sr+U8fNWdj6bc2fLk\nYNsWFlHxZltye3dfuFcphxbeKhDxlLI1JLUFIinhhBhLLfjW7UPW/pkG4QiI\n9gJuBjQcmxrljo3GUO41cdurtNxdhDtilqdbNiZIi6PI72YvBC3L6GFq3xvg\nkN4M\r\n=pX9i\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"1e2718e85f9964ac98ba74c4ca9970eada8d402a","scripts":{"lint":"standard --verbose src/**","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"rm -rf ./lib; ./node_modules/.bin/babel src --out-dir lib --ignore=src/__tests__/,src/__mocks__/","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; ./node_modules/.bin/jsdoc2md -g none -d 3 'src/**/*.js' >> README.md"},"_npmUser":{"name":"zachferland","email":"zachferland@gmail.com"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.12.0","dependencies":{"store":"^2.0.12","events":"^3.0.0","did-jwt":"^0.1.3","js-sha256":"^0.9.0","tweetnacl":"^1.0.1","multihashes":"^0.4.15","ipld-dag-cbor":"^0.15.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.0","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.3.3","@ethersproject/hdnode":"5.0.0-beta.137","@ethersproject/wallet":"5.0.0-beta.136"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^23.6.0","webpack":"^4.32.2","standard":"^12.0.1","@babel/cli":"^7.4.4","babel-core":"7.0.0-bridge.0","@babel/core":"^7.4.5","webpack-cli":"^3.3.2","babel-loader":"^8.0.6","@babel/preset-env":"^7.4.5","jsdoc-to-markdown":"^5.0.0","@babel/preset-react":"^7.0.0","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-transform-modules-commonjs":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.3.0_1590781739386_0.28411005437242687","host":"s3://npm-registry-packages"}},"1.4.0-beta.1":{"name":"identity-wallet","version":"1.4.0-beta.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.4.0-beta.1","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"203719af24a4a5e1b57181bb0e9d8985affc19fd","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.4.0-beta.1.tgz","fileCount":33,"integrity":"sha512-sHlRit+fXgimqqOGHE9J8W2P51VftIUk0sbtTVgT+FbL4Zkj0PR9TdJMj5IO5s43XwiYUyrcOEX63wAW3IaeXg==","signatures":[{"sig":"MEUCIQCuyAqyZZtjxpcbIBogmgfQEG9PDpy2YNvaLzMy3WT2ggIgcenMCur01fbrUHBiqQiVM3Qoq+auSTzpsYVkEfR0Z4g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3198519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLLg1CRA9TVsSAnZWagAA05AP/RlPsJnCL146xNSosuR/\nrkIFdGhFscODLOokCYu2OA746fzRkT/mXqzOSbGgrE3Rp/7AUIeZpQSVDh5V\nNTGsGZG6nw6DWzFFwgII4tah40SiKM+xlMfn75k5WERoULJUCSVMYi2i/o+s\nxorKTfvfKtmYhZNRtm8yATjeR7N9evpJvyxMWqSETT0RbvZTDrpOWpS/V5BS\nZbOtlrs8XMw1TqoFI/anPtSFJ0gIowt39HRMyhef/21Lm7mHkKSNWbk9hmSH\nuZZB4jKBuo185WWlI3AUuCMXalTvMtEdiVm6233V08U2uFpZGmU0iR2Cnbte\nkVZcAyoHo8h5f/cL4RQQONlhkdPxw+zWOdvxnd/eHaehywtuq5fE2DG8VvJZ\ndwahdG2tg6qsmWrj+ZzRv1//c5FRnoPYQy3KikIS67iS0UIGwq3WRviel64W\nuoLkufm5jvcFI9FMUkID8teCcXHKjxjM+NHPFFmwW17jWVBGzH9LyuT/f6f8\nMdqkkpjJaW2PzI4Nmbb9O7xc7yLoF50RMXAHX4SzxjyBO7EfkDunl6W44+T+\nXnqAuHQN4byrx4vtd/uc+7cXcrII9XLU8gxBPBk45MIgYOXriDX/pWFDvIrD\nHBJc/fQNw5AyZozqy1VfPaKBiTHxLKKu8l8uKzW0iYUiUJJ6pRGkvdH5sE3H\n8SEC\r\n=8ItP\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n    * [.hasConsent(spaces, origin)](#IdentityWallet+hasConsent) ⇒ <code>Boolean</code>\n    * [.getConsent(spaces, origin)](#IdentityWallet+getConsent) ⇒ <code>Boolean</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces, origin)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+hasConsent\"></a>\n\n#### identityWallet.hasConsent(spaces, origin) ⇒ <code>Boolean</code>\nDetermine if consent has been given for spaces for a given origin\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if consent has already been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+getConsent\"></a>\n\n#### identityWallet.getConsent(spaces, origin) ⇒ <code>Boolean</code>\nGet consent for given spaces for a given origin\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True consent was given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces, origin) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"3ae6e8f8fa2939d661ba35e0996226d3ba45d4d5","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"rm -rf ./lib; babel src --out-dir lib","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"zachferland","email":"zachferland@gmail.com"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.4.1","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"10.12.0","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^0.8.3","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.4.0-beta.1_1596766260905_0.8667555102067752","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"identity-wallet","version":"1.4.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.4.0","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"ae42d0681acd1b0ab892d20aa2d4a088ae7b7b34","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.4.0.tgz","fileCount":33,"integrity":"sha512-3V9CPICqy/fzqSnFVp8MqESO+xTqmdCn2XoyO3KShxSS1jyyt47D6TWu1qz6tODKZvHunpgjeYfXzCGhlZWjpw==","signatures":[{"sig":"MEQCIEsvc4qjynQHCq72+pSYtDEzt3WlP1sbzBtoMNcHS/17AiAKfVATTXxMnFEfB3Cbaf+35i1/u/+6AFYNu8Ng/LN8DA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3202782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLRiWCRA9TVsSAnZWagAAOvIP/3JKVC3E7miFjFg2T4Gy\ne5MbveB7js5hrgNiSHi6m7z73aytal/jH00y8mjDSR+EAY3FVDokOsYQhVpT\nS1xZZOfJuUviXmaLeG+e1iXyxmMAh5QQ8aZTHLeXUbbofDLlNqXG+76kGgp1\n3MjZNEWFqDg0H6msaA9sm5+yGYsCRoCYVKXhZ2hgamYEb4oXqidUOhxjZnIl\nFpIj+Mm31K3PY+JpKMsd3snEqWdiD/nachjiYxUnm9CGWPWfAkx5s4SpoVen\nJMaJnQ7PnOdszbfFGl5q2svgIO1//IciQdxN5c5PicQIKUc/vys9MRvmzgzm\nWNuwh4rbiJls3f3hkXUqY6h9jQzs33mvfpX+NvL4lKB9/qDVqHExf4fBj1yD\nfTTL+Vj655l4CN82A+EPHhoIULUByagB3z5z8RsTN8vU86NIHq3GbmUFD9fw\nj4BCEqKG/dK3IG+uW+QdQDsOueDdx3BRZFKSjMC3C5zLbDcEQEjWh26aRPOD\nZke2lHxbjqVGBleS8Co49iOpXp1gPLaUbQ9c+NYV1EpxOIrjetzDmRU55ud2\nf5K6VsIs0a3DQus0tpfWQmS0vH2knh2w1usGccx3XIKeOLw2IKATnSY1n/ew\ndAqKgFNcASkC3l4fa0pfFDlzbPz+XjeB5kbt3H1JLsYsz785uvJ7AShLG33w\nhRf/\r\n=vRKl\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"9aa3b6e7e2fa0c25c8fb7a9b156d0699490484f0","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"rm -rf ./lib; babel src --out-dir lib","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"paul_lecam","email":"paul@ulem.net"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.4","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.14.1","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"cids":"^0.8.3","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.4.0_1596790933720_0.7764510504033346","host":"s3://npm-registry-packages"}},"1.4.1":{"name":"identity-wallet","version":"1.4.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@1.4.1","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"83f27474dc034dce1701f70849411f43c70bd24b","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-1.4.1.tgz","fileCount":90,"integrity":"sha512-VRlpoin4gXqn6q1lx0rvTZn4lWCjRLQ6TcOigFPJgCF3mCWEqWcvwEsXIZR9vybX7N6Voiw3A1l1sqniVXfnnA==","signatures":[{"sig":"MEYCIQDsRh8wnX4wiTTkuh6oQ3bzBvNGFP2HEn1HlHtH1M3h0AIhAMl2ca+aAThZyII7K9z8YnPL5Jr7mMfND6LZAMw05RYc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3306157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMmHMCRA9TVsSAnZWagAAPv4P/1uUcQiDef9Xu1S7INdE\n5lbEDurrE7RqF/9V20pBvATnJuxXqplIXEBZx+iq+znjAGWQ0v6ajg+ljNBo\nXZyhQ9gXqf0LEnANK/OfQOi1Wi6vK6wYop2sl8Jgphvmp3+i8tfQ4Ck4unFK\nd55QsvyUTOrEXrN2nt6YQuBc/MeqtW6GgLa5Ta6XBoARLRFoNb4RV1OlZv3i\n+/PsRAlIXnD5HCeZGUnD/ok+RrZMCdj6OLCwlUTWeY7oNQJVMNfH9WdLK88L\n1laW4XrZzh7U/IIG3tyyHLS3gIBsA0wfbgSbcCkum6egeNi7tjZ0nzpFdxlC\nqyQPVcxiU+fFR4YXGxZPLrpwamcIUHTrEK9OmW56M2OoxvcgzbkP0zKdME3T\nOwmR+zGpeYBO1bP6OEyrhyDPbiBlSyldDcuRfIDDcNFYBkuVqZ7Zu/bMod0M\nvB/MGhWdZJOwwOQS833ryg9NnsSzoOrIfCwGWN7w15nSLo/ywEzsGMYs9thV\nd2uzUy2ZFXGQl9fp0GFhEbTCVppMqPG30yFYR7hiTVBrMG84L/Rv+yenmCco\nkFzanjNPfEJ64sq9UdGYqgIPimtuXV2gVs2PD+MBKBGXW6eTSo9dq1p7f85u\npShF5SElwZZq24l+Wg3E/2ywkpDlo5k93qKj1Xsw9bpe1uAGjzOu7bigOCfd\nxzPz\r\n=PrGZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"71236b19ed00f45cc4750bbdfd250f540c1983a2","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.4","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.4.0","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"cids":"^0.8.3","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_1.4.1_1597137355721_0.1695355240080334","host":"s3://npm-registry-packages"}},"2.0.0-alpha.0":{"name":"identity-wallet","version":"2.0.0-alpha.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@2.0.0-alpha.0","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"e4113538b28e6de87508dd7813dfa8a872b72dfb","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.0.tgz","fileCount":62,"integrity":"sha512-1z60X3L1F96fX/1cyO8eOIVpUiTLaBCmG5ylaFvTVWJ3RiodvFVaQ5+3YGRrq0KJ+MCZioljeIRWkMwN5eD3Dw==","signatures":[{"sig":"MEUCIQCs1Faitgx+50Ej6ji6lZdt4w69/CULwCP0yg3IjthQIQIgKL7T3GUiutpD4n2UkNVHocibJXDkyXMfhG4Zm+cmEuk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3062301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO4RzCRA9TVsSAnZWagAAshgP/j8lP0QBG+IlpCpv8DDu\n2nQzZDiSgF1ofF28fmTUHOENC/v2XEMn/ymB7756cKyYPcKvxj7StXKwLxP9\n8iW4QvOpJIyrQiQ9Th05enN3s9ogp/5FkaFF9sM5P8zUr09Q1l/FlkyPqcut\n7nCCIIVJP2p/0Wd6K+VjLEb5WqRbFnUPv7+WvakYqQxaxlfAied+DdUcYpfz\n5hFwB7i2/cjJrp8xYQB2S0irakJUjk6s2w3rNWRFkJUdWg5bJoulsfqC3Qhw\nszdBCmvtP2+3dbpfuyeab7OpzajVlPs67ptT8ak+WWqtLEhXt5Nzma//XNtv\nBOLljjMkYsGvIfZZcy8m8iWe3Vf+t6r+HY/2iHdMRdxGZj5vxPuyptTp+y0c\n0WU7mtUF12OR7IfG0joiiH/BSolmSmHVZraVH9xcJinqIS45qW25ei9Cx9l9\nGVI9jPaZbqJ4qppytP4UKn0ckDXJI2QHynwDF2SgtWO3bMoqNG+LAJLrJicI\nNB2d14sNOKeSrTc59fBU6LvCxyz++ZhGWhImI9XLWAWqeHGha9IeMdB4Cjjw\n+xUoTehpKaV1M2aqu9RMr2qSYmm255NkRnxFaV2cJn9gu6GlsUW9CqlFgUqb\n/oONp7G2D9g1/mBUJXE8H/8Hq+fGir7NehZ/pwryi4tOUCJo/R9CnDsd62Is\nGHXl\r\n=sKE6\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n","browser":{"fs":false,"child_process":false},"gitHead":"b9c554df341b32def2cacaf438a619973f87c8e6","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.4","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.4.0","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-common":"^0.2.8","@ceramicnetwork/ceramic-http-client":"^0.2.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^0.8.3","ipfs":"^0.48.2","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicnetwork/ceramic-core":"^0.3.0-alpha.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.0_1597736051277_0.43969108606295015","host":"s3://npm-registry-packages"}},"2.0.0-alpha.1":{"name":"identity-wallet","version":"2.0.0-alpha.1","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@2.0.0-alpha.1","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"7d460d8177a123d585bc5d1d221e6906c562e368","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.1.tgz","fileCount":62,"integrity":"sha512-M0bmFt/lU714ht0TS5NDg1QwmLZPPl5g/OmUOMSN5Tk5kqPqYsIaL1keNJ0rAR4vDXFtHuxet6RuLaPE9FPaCQ==","signatures":[{"sig":"MEYCIQD6KRxpfdjO1/POJ5qF0iJGj6tr/gwMXADuy8pxkupWywIhAMjWxvmsvdXokI5FkQcXLBQB4PP+SSjxuHCrv57zHzi2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2602177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP67WCRA9TVsSAnZWagAA4DMP/1sp9TQvOCLR8mQnsy4I\nd8i59DB+BlHfNTC+LIbdInzU6cQbWOpP8qTUqZMnYEjLe9qw8cwsB0TW4Df4\ndROvBn+9ZIF9Jqy2VgZGjIhM+6P/YAir0ouqF8jCKzqrrwGucabXeXAHK1MX\nujlcEU9D+XwgOmQ2OUAUeCgGD79R0XewTpDuWuCCfRF4DSqa/xKno62HPe2E\nXL0KjF956XiXP8G6wZNqJdZfhktcAP0T1glYH+5a54JHN/d6YWx/UcqourMt\nbrY0oFBQYO1WYg4JVcSxPbMcq1CBWr5DA8mGkhzblHmrt+tzRDnsOefTmEmF\nQWHTYSBLxF9BB8kIN6wJTAZET6ck+2U+G7ph7wZ4GBAw0Ups9oZp85T5NLot\n75loLzf1JKfR3aefTiwFMhXj8zifmMFUE/2hpITqBUpmAaBHuUMsIlP2mu01\nL35MDQ6ZegafzXckfPB2i5vFq3oVY3AQrq0dqWQARpFXCNW2IRdjicvjfUTo\nYQCO/y5sDeBO9OlfGeyhka4+DavrTWrCac7ylWG2brEfupv5w4o01goz/lPM\nJh7VsxevrI+V5mJqHihligbzqVwgkxSI5eOsBNHSt1AlI5HugUNNy6PsN42y\n/vSfBhHccSjAWVy1dbkmtij/A8vmmVc9M+/qKBcWjR+WdApA1uCbPtn/Dt1O\n3EYv\r\n=g3zZ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n","browser":{"fs":false,"child_process":false},"gitHead":"9c91ec1ff8c5765b13d714b0b4ea1e97d87604d3","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.4","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.4.0","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-common":"^0.2.8","@ceramicnetwork/ceramic-http-client":"^0.2.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^0.8.3","ipfs":"^0.48.2","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicnetwork/ceramic-core":"^0.3.0-alpha.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.1_1598009045657_0.910236045000751","host":"s3://npm-registry-packages"}},"2.0.0-alpha.2":{"name":"identity-wallet","version":"2.0.0-alpha.2","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@2.0.0-alpha.2","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"7b9d02f37b447e926b4b0720683966c1cde7d013","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.2.tgz","fileCount":68,"integrity":"sha512-WD/SbTQeZuGyFwgNp6JKaTl4KFaD8ekQq+AD1hOPzcOp1rxRHodeaB7qJ87pXt9WjquPYMW+rc73C2UJeMcYOA==","signatures":[{"sig":"MEUCIAdbZ59XAKlcLAczz5VGM0y+eW6TbxTRDCJNWvHipEbZAiEAy5kdmeK66WUGWGuo/t0bSYn7he3pusgkWVHT5kfqO5k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11677534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUfL8CRA9TVsSAnZWagAAo7kP+QC/ohsi+B7XGqTNaa9D\nOg89+gx01WCwI4wWFTk2/Sye6FEyTkZkQUqaBvzwCycgBu94B3wcpIXOkiUR\nervfkk55ykBoVq4xNaBQ6wIXuCBXimgPg8QY6Qv4Ungq7eT+WQjUwpeOl55H\nG9LFPBmUSDbb+hcwCLUyIc7BcG+wdJoYpi+h9kSvh8QVcJwu0YHsHERwESm/\nWszxScHSQDnFcElXYUWDORPU5Bp4qbBDio0RfKLMnQSjNevQ9bW6E3EPRpzL\nHJUMmqr+TyW30+HmgP9m/gGqb077lKQFysFqn8oDGcfPRSQMsOQwLqX4MQmR\nbyz++kAzSpAFk6H+nnYPawt1m0WTBRN4bIFjj+HNHLzkvWeoncBlgPoUQxYL\n5fdTuQurxjDwtTuH9go2UsNBj3lgAUcqh0Jxdj+XUrYshOqvfhXMWPAh+wnK\nlLxelzkUMaWe47UCpUFJ1iCwG02MjuIejQ83L3/phyrdWJyyH5pcP8GzDFbq\n5GmLiMja8MsslJfABvMMuLdrAYARsjsa5gB8ApZOIom7nmpoak7j4FGH6mxm\nXzLWw6XVn0VayP+KPO+AoCkU4WmZ5GvYoIilHIBsE01K4Ii1uB8F1ZC1lwXE\nCRXE6xedoU1QHrbINOn9ZB1JOfhCZKMqxKfL97xQSxoCz3bjOZy03Bt088Ug\nliKl\r\n=VXC1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.DID](#IdentityWallet+DID)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+DID\"></a>\n\n#### identityWallet.DID\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| DID | <code>string</code> | The 3ID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"ThreeIDX\"></a>\n\n### ThreeIDX\nClass used for creating the 3ID and IDX data structure.\n\n**Kind**: global class  \n\n* [ThreeIDX](#ThreeIDX)\n    * [.createIDX()](#ThreeIDX+createIDX)\n    * [.loadIDX()](#ThreeIDX+loadIDX)\n    * [.addAuthEntries()](#ThreeIDX+addAuthEntries)\n    * [.getAllAuthEntries()](#ThreeIDX+getAllAuthEntries)\n\n<a name=\"ThreeIDX+createIDX\"></a>\n\n#### threeIDX.createIDX()\nCreate a new IDX structure that has a given authEntry in it's keychain.\n\n**Kind**: instance method of [<code>ThreeIDX</code>](#ThreeIDX)  \n<a name=\"ThreeIDX+loadIDX\"></a>\n\n#### threeIDX.loadIDX()\nReturns the encrypted JWE for the given authLink\n\n**Kind**: instance method of [<code>ThreeIDX</code>](#ThreeIDX)  \n<a name=\"ThreeIDX+addAuthEntries\"></a>\n\n#### threeIDX.addAuthEntries()\nAdds a new AuthEntries to the Auth keychain.\n\n**Kind**: instance method of [<code>ThreeIDX</code>](#ThreeIDX)  \n<a name=\"ThreeIDX+getAllAuthEntries\"></a>\n\n#### threeIDX.getAllAuthEntries()\nReturns all public keys that is in the auth keychain.\n\n**Kind**: instance method of [<code>ThreeIDX</code>](#ThreeIDX)  \n","browser":{"fs":false,"child_process":false},"gitHead":"af81e5d92b30973df3f6654f2a652a098745f168","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.5","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.1","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^0.8.3","ipfs":"^0.49.0","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.9","@ceramicnetwork/ceramic-common":"^0.5.9","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.2_1599206139683_0.9898544536468314","host":"s3://npm-registry-packages"}},"2.0.0-alpha.3":{"name":"identity-wallet","version":"2.0.0-alpha.3","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.3","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"79f35a2f5d45ed08e90854f606e63a0af5395eed","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.3.tgz","fileCount":69,"integrity":"sha512-wLG2ET5fh1AdvsSoPQLuHke9jujR1WzWwdb3mFxSIr0bnnPihvEROVPzzJpuKj/2rO//oNIHfA/3CAmvkglq7g==","signatures":[{"sig":"MEYCIQDfjTPO9v4IURokx+8VEyW9hDRX+OlPP1bLRZFEEKO1RgIhAKt0iKhce1x1JthqF9xXEVHAO6fcOOaJs+XzQjCnxLpK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11678796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWL8uCRA9TVsSAnZWagAAy7wP/3VaKbd/qrG+1Vn2ccBR\nEtl/1ECX5ZOszeZBHXrocV0bZO7tKIkXbedFkWrtUN6Xj6RQnckZo45iY3B2\n5fYPrkmVMypSHGAzJyB/RC880wT7ZcOaXMGrG7XMKAcRwvJpG61WMbKZ6n+o\n5mVWdw1Qe/Ym1DdN4zJeJyNq7dzFPJGaYkzPZ43k/XTTcI2nD0KBMc0n7j6q\nxX+hXB8ZnWE9fmKjpdNdowuId6Usfh4itZu9ODwqXgbngdRPnLjW/bkK5gKt\ndWvRNicE7avhMPEk5mWeATjCArg35R1joQ8Hz6X0vkIaDeNl7Gx7ufobUZEV\nW6n5f1pJGG+AtY3lRqiFgj3HJYEq3u07bbN2rjnwHeMFwzLGqlIxRBw5LU1w\nxz9mfpCIiXuaSy8f0ObLOqzETxiqzkznf7kHLz62AAIzQyD7+OpvcxwujNAO\nXm/CP38uTb5+z7tRt2gYMrDsYyrOzfgmoegYYKExeea1DZtNQ1YFc56LljLr\n4/WiN0Bri60Inmj3qnh+2yd37QPKh3aCHBj5T2fiQIMS/lzrDTjVbDSJrcPg\nf+wIxikoEaQqr5F98ceas2mL7eiobHxXl8zKi5HrRLm9M2AWULMeStXfG9mA\nZ7vxiJTgLP209Q/XA9aa1Q4n1WZe/c6OtcyYmhgkUuUQC0yBmc0i3T56GJ2z\nekZo\r\n=PwnT\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.DID](#IdentityWallet+DID)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+DID\"></a>\n\n#### identityWallet.DID\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| DID | <code>string</code> | The 3ID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"27b16b924be24adff050d87cf9702b0bb938dd16","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.5","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.1","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^0.8.3","ipfs":"^0.49.0","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.9","@ceramicnetwork/ceramic-common":"^0.5.9","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.3_1599651629634_0.128760887886872","host":"s3://npm-registry-packages"}},"2.0.0-alpha.4":{"name":"identity-wallet","version":"2.0.0-alpha.4","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.4","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"dc5eb16a591149aebfe42cf1bfaad6485413c3c1","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.4.tgz","fileCount":69,"integrity":"sha512-WVAdBfxZE2Ip/TK/jm9H5Zo6adi9DzeshxGO0ug5d+alZHGtMFRG/6uiUPnia/ZtFkl7arJK78/WYVShEU1RbA==","signatures":[{"sig":"MEUCIFNe7aCrpOyLXgsln7WZ2QGT3KqNwVAyuybu799PrG32AiEAlHCgk6v/YNx6NkcqJwuB7jTOtN9Tmq3IBvYe5pYPLFo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4576666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWglCCRA9TVsSAnZWagAAS9wQAInD0Qsc0aVf77ZctzOB\nRPkN+bphAsqgvtqm1r2vimdkJq0W5HeewHMBD8OIlWFu4lgkqiI3Zjw1EFyZ\n3puYipSndFHxenF7GEnygagsYT7heVF1DpE2o8AQ/mI8A7/DWAUpI92BAyKa\nVuo7aXDk/+NvyHgHHPN5Rw5KicF2L+eIFJpw6czRInqjWsDvumeuA0Ux6DzI\noRyL4acqm+TTjirD668P1XvOBKQjJs9VQNKl5pMABhcpTpCJrqHWADWPojNd\n3GgoS5oz8wE4xRr3JIbWs+YbLPN4/8TZJZhCNziyllbxY7BDwXWhuSMc5GTi\ndT10VKORtR4dSit0mVojYDaEEyqaUEvX+M1YPM/QYjPFPR9kkzXjcxSQx730\ntz7hh9nEg9YrwhbXUPerumMOdgRV83qf1oOw8N9ruBT0TQ/QNfwHvTZqW2Rk\ngZgVvl+MPGAALSXt43xbn15SSdhJvG5UMJaZ57mvrcFKIkG+/s4UH5xbcpIO\ncxvAPTbgyy85rLg8r2gxu9ItC4qsZ6DMYaNdCnzuPwB6bjZrlkbiE1gCZZd1\nWSEHzTX1nOVhDU6bJdaTcI5iqj8GNJkPwnepjJiNxoBmhEwJJOzt00ar9j72\nxSsdxZyveE/PIIkL8gpHkw6yvbi5wcoJRlS2wxQ4SWZbXHyxP6OE3OsuJoIc\nbtFS\r\n=TpjS\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.DID](#IdentityWallet+DID)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+DID\"></a>\n\n#### identityWallet.DID\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| DID | <code>string</code> | The 3ID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"7bff24a35d39650afc2ae4ea82bbe49d0c3494f7","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.5","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.1","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.11","@ceramicnetwork/ceramic-common":"^0.5.11","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.4_1599736130151_0.7464710462803181","host":"s3://npm-registry-packages"}},"2.0.0-alpha.5":{"name":"identity-wallet","version":"2.0.0-alpha.5","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.5","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"83c656a5dd33b7b563d50d7bc4c497b0d5a2029e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.5.tgz","fileCount":68,"integrity":"sha512-zIQPaHQivjf+SHjW8K08AeYNWJZKcz9dRtrDBiClP91rA3/5nsqvbIpaB0FD8hqK4rXczydgDBrLXpHxWm96hA==","signatures":[{"sig":"MEUCIQDl9GbL7QMUF8Q5vLa8GaZgXwSmdAMtkvjMxip8yPP2gwIgBpHmdbszOfznDGdW2DjVJJPdcvI8MTy8N9pIViJ6dhU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4576961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW4zJCRA9TVsSAnZWagAAV2EQAJ1h+5c0sCliQ/XqB/fB\nTimPTho18gH4WsZ+9cTZi1/iWMiFn/rWVyMY/Sf2WlGsx3/+sHmaS7UmlAMp\no/q3KG2wYx+9CfcU3/JE4lcG7b6d3oJyC6xfy6C4DFzxRb+aFoGSJFG8E+5i\np3ZTupt4rzQr3pYnuJKZDxnT3qDvvXt09i/22QFgL6PfuESaq0xGwHZb/pcf\nxkQwc004GCtK8V4ZFxDrxs2XBJM6ZXfEhEaodWIIfbATzr7HqW3+1HIY9nf9\ny61RDyCxMyy2wLo169h5u7Q8OgghtYsduKh/+hFPOqKP+iFpG4iVxAsf8MjN\nKaCU8OVWO8lHZtj6L7NI+B7GreqSVdEtDBdm88cm0sFtxRxXruVaHeZritgM\n1sJGJRLpLaVz7UrjSYL+vax2g3QzVuyi2aew6M9fkmQAjz2Ot3yNYlDFxzYk\nIqoogV3PbuzJ+WM8olbCCfFNZr1zFIWHd/Ml8nVoUTB4ckuXPJBqwWo5aVy2\nafVpwrapEHX+xkQDjpkAuGfG7JYBJXUzjjl5lhnCMZDVK2w7+PWhiXpFEYzf\nxiDZN9QWoyuCP3G+HUUA/tnhuo4njrhwqMEutZ/APa5hXHw0EKmBx3lD2aIV\na/oXNLF/6/XK8g8lmvF7vnZO0alkqGU2eTGFqH9uyGFOk2h38M5YUSa7iCqJ\nrhi6\r\n=eHta\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"2973eda341fc513bf8acbf5d3ec1b84920d9f980","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.5","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.1","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.11","@ceramicnetwork/ceramic-common":"^0.5.11","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.5_1599835336167_0.42218205059589153","host":"s3://npm-registry-packages"}},"2.0.0-alpha.6":{"name":"identity-wallet","version":"2.0.0-alpha.6","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.6","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8f82bf32df75d89cb9a74a8ae680c93ff06d9db6","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.6.tgz","fileCount":68,"integrity":"sha512-TANUlretVdRRJxZ7OXFdH0l1EDee2b+q0GkAp/ZBZ/wdCRtaAXaPo5b1K4oxxHi39iiaCnzjVYFZBjEiwYAmnA==","signatures":[{"sig":"MEQCIFZTrl05kWmlnDfM7GBjSkB8qZP7WXyM1r9rbDmsF3MlAiAQSebnwq3blfiIFF8uzr3noGTqryI6AzngQaBDRJCxrA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4729680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbJzpCRA9TVsSAnZWagAA2IkP/1w68tZcNlx8xWgWY3EB\nypzqHEdEiP0gMPWeqqtFHMZjDr3JAFdsypPha2+yYmOxnEFBhWeriq9f/z7h\ncABLcPSYLVhoPofqYnX0o4F7snQd3tjaN1CmPlvfRaGhqA1LcC4a6t0Qxmzf\n7qXtx6YKhUctHA/QymSMSuzq/bQiDHFoFNXAjE2rIbRoI4FSJ9XzY1KGAAsL\nZ1H6I/q6n1fOiBlrcB5sCArNVbcnHGfvgsjV2tAR0dm9KrHzOeUl2TpAoyR/\nExcut0MFRDxnK1T0Zv+TxevbPS3nyBN4YQqRgyLCEB+zt5q9PbPGgZMusjTZ\n8UOFxlkZ0gGUQEZg95CCXd7rzQwph/+beabbjTJcHFW5UziRtKS2+M1liVu+\nm2slPYDVWkh21+l6ewWcEk8XzbsrOVC/6htAV6J4qQ++zJJHKFfMpK+Fh8jE\nBQxJJGGHjhnA/li5EaIa9upQ27MS/xG3Yo84goaQVoVQE6xlYeCo4qUrI+BM\nG24cZS+osTfS7sULeTQprdqiDq96qpSnwDgROn4+Zv4hokSYmeVQAsP1pOZ7\nWUh2BiZvBotO+NzqJzygaKyevcDx/s5mlCyjX6Qy5lDmXs402Kx21upXPih3\nhQEP9PtUd3xbJUv9JKx4NEsaWElH+dnsfzjVnX/ORETVNHD3fynFDltcOtXg\nE3Gj\r\n=Iu+M\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"40f8bf87dcde6ac7059fa2a90388e329702bfbf3","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.11","@ceramicnetwork/ceramic-common":"^0.5.11","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.6_1600953576319_0.754133647471537","host":"s3://npm-registry-packages"}},"2.0.0-alpha.7":{"name":"identity-wallet","version":"2.0.0-alpha.7","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.7","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"de0ac93e90098734fe74ca95135b5e54fa3f34af","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.7.tgz","fileCount":68,"integrity":"sha512-zBzzsaZUQrBYCBPE9jgD6gn8qRV1rNWDXj/KvZMbLYtu4hAQMQZRc/e4K2WushVCOYbhAetL7aJ7JOf028Fddw==","signatures":[{"sig":"MEUCIGtbtPcuMEK/vL/QujTCwML6VEWcsxPaAxtw1eyQosoPAiEAgkvGZNzyAdT58uaAggPzlqn12mJ8Yxv7Kqm2gguLny0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4732938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbadhCRA9TVsSAnZWagAA/eoQAKTt5UiZRGMVivoZdMDB\nIAU911DBSeNSzNkaL0ZBG+CZecEn29z+qHR1QTbGcpffsuk5f1q8aqjYZtsA\nH6skSQRywuzwE3wSmylFKJLsl060XADLsf1I4Xg3VXyOuhc162OKfBvAXQLU\nlwfPYLIC3SHk43oBQ3dmjKM/z6gfRmvCkSL71rCBB7vq4FgpnF8Oe4Szn2yP\nJRMuNwdljUGS5YAXtD+X1mBxuBxuYtotnGn86euV+rLMNGZGyS8Cweoh7jYG\nS1An762ZYI2Kmv2+m8iKDiCjALWETS6Gf7aC8WWnaTvWTNQ/shdV5XngFWZ/\nfSqo07VH0CSbPihlZDJ/PG+k6ZqDV6xXU/CZEiELdgDpECikAut2UN8l9R3J\nhQ72wjoXRTc8hTwLTgynzkvhpmhdcuBmkffKN/9E0SNhf1qU8/Oy/NFWUqkv\nm5Hs5TM4CPB9hu3y0AjHCsQYJgoRSrWeGDL7At1yQ8GvMOJu376vBHyZxbkD\n8gysXhZjfWgeuN16fUz/dQMY4M99m22b23rGuIbs4LSc4s/yqccLHM/EUeF/\nR7CaSgrBGKPrcLsM3i8vMe6AArGss3dEIQkwTlKaF5yIzHVPnuG7KM5fj1Vs\nMpxWzCmMYyTTmlHYGkAFR7a1kt2QsXgB1eKeoeLytybz5FncuGnEiqv/G37H\nD5yy\r\n=+LoI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"2b7fe05d501e9c24c193ab9f01f7d9ffa9fe3350","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.5.11"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.5.11","@ceramicnetwork/ceramic-common":"^0.5.11","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.7_1601021792964_0.7841609078533103","host":"s3://npm-registry-packages"}},"2.0.0-alpha.8":{"name":"identity-wallet","version":"2.0.0-alpha.8","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.8","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8976ba2d279f37102bb12136a4706d515668db5e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.8.tgz","fileCount":68,"integrity":"sha512-OF3h2dOwUDt6mL/os30LHOMQRfBMbRiCkU0LWBbboIluOh5UY+RoWh+PtRiqArSedwKa+RhsG1lSicXQIHqybw==","signatures":[{"sig":"MEUCIQC8N0qrxGDc+XFY6z4rjEHSwVbJKfY434rfRNd6e8+f0AIgHP6yqvkF2ej4+A6zJ694ikpyZY4K/A3qGuLdXhWY6kk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4650922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbde4CRA9TVsSAnZWagAAZUMP/jBHi/W5g4s+jflwa6uY\nr0XpiC4n1d1D0+H/tpnjgEd03DuV5ssAOEW2F3bMngFomwAg8TRRxzfvgJZl\nCxiH7ylO3s1IIKEh07ff8CKLwbgQxtrnMRwgGoaJq7a+2pQyRLVKFrmcmPYv\nL+XI393UWzjwLPfOD8vF3cCsghlzzgMFS8Gzw45sRWNxc79DTvrCoT9d+w6n\nzw70FKdhOptHvkO3W2EHbKPQsxudO0xNR04b+faadfhF21tr9PHbo0KbQzPR\niKafPmF3x6VbMYX8EAaaVqXlPa23wpqeloqUuDHfQRbXA1Py8+1pllw6ATxZ\nzcfu3PL7TUY9qYDB9OSwHuZjh6TnpxReM1q732hD5VuEZK4rlJxTmugRuGz3\nvyeCTvMbuH1U5MZC2MXy3Q/xmlTIxF2CxiFf68dTxkh2UXaZEdj3aGXUDOHV\ntTEgfDVGuMa9i/VnIhIKD1AW7DfsPSUQ3HkzpuTb4Y9uhglgJzgIn6/87PP0\nfozpYiiwGzVu7XR030cR+wb9qiAHe3MNU88paSXXho52YS7hhH5Fbl58nnpC\njZU8xfuBRisQVKYPVelpCkxAocBa+A3TAnSOL3QledbTV9iOHUhsjjI5yQw0\naNBHHc6YAHonlsi0r/fADiPHbZE4Y4u4dW8OnMpex7W/0loKpR0pfv968CZ8\nApv3\r\n=Hed4\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"fa31c5a2c5f02f28ebd59aeb5539b22def09c0ab","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"bs58":"^4.0.1","caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","elliptic":"^6.5.3","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.8.0","@ceramicnetwork/ceramic-common":"^0.8.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.8_1601034167635_0.24179375148272442","host":"s3://npm-registry-packages"}},"2.0.0-alpha.9":{"name":"identity-wallet","version":"2.0.0-alpha.9","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.9","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"624c3ec1dc70acef93acd6782b9856cb8b7c4d1e","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.9.tgz","fileCount":68,"integrity":"sha512-AM6GPV7g/BOe2IPNeoP0EWo2Jchg3PyNrsyzdv0lCToQSJ7MYLcG/4Y5NKjh3JR77Ml931DaeVK0PHr9q6P8pQ==","signatures":[{"sig":"MEUCIQDonY+Q16M6cc3WqyzyN2zHPJFe7DfNckX8mix47f9tiQIgKrxHq/rdndc92ZDqDY0gE/i3XjPapG7DoucYHRxstKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4679427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbdyDCRA9TVsSAnZWagAAgX4P/0QCBePgo/b7VkPGBJUz\nr2AmB/iht/aM7zXHpMzz9l55WUY7vQitDsUIYcn7WRll7zM8Zt3Dxxuw0vxp\nMTLbr4OSp/zaHekcfRzcTYVNlUuCBy/ZvkwyIppF3M88pgzTVtka9zpXcJHp\nyZPCKvsgcldZYeObk8i+R8bR23M0kgQiH9Su7RnZXF0Otwk2f+szxTPvVjp3\nTk4jd4pWxnwczMrqJMZp41xRqSux/l6wKbfwVCAcPHnlxlcqNjLVPf0ojHio\nodHUM6q1cjq/bkIi5VoC3f92t9ed7bI3W0fUBHhxbJuBRZEs0WbeBFJ+XBGM\nvPTTRfStlBlsB5FJk9YSaywrAH+xtp4biKV4hSkebwYwgEdeCKShJ1MKHNZb\nkVuhJFVU/7zcPBUEUS32x9H3IJdck8LdIJOY7Asw12utdOSh6lJfJ8JB5kP5\n1um1X1qKUvOE6m7Lsbg1YBA3v4xuskqYkwAohNxmKuwopjIgbAPp+lAnB1yB\nMi/E1asYfbhziYJukoykWJYjAFDj5NcMbuMDnWEqSZTtPWjC6cQc1FVR1qTA\nb3ZLDf5kPSX2a8TDz2V+UE6Qr6AZHT0KzfnCh1iKC2R6XosVUwEzh8Gsiv4B\nd0ALnLPVldyOOB0gr5ndadFjq70bJ9mrhZyWCuEC2qVTelZ0MQuTRkki64+9\n9jLO\r\n=mIDB\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"e1d7146a215bb3daa4e5c3fbb97dfe9cbba2080a","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"git+https://github.com/oed/did-jwt.git#feat/jwe","elliptic":"^6.5.3","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^3.0.1","uint8arrays":"^1.1.0","ipld-dag-cbor":"^0.17.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","@stablelib/sha256":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.4","@ethersproject/wallet":"^5.0.4","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.8.0","@ceramicnetwork/ceramic-common":"^0.8.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.9_1601035394944_0.6322701557758856","host":"s3://npm-registry-packages"}},"2.0.0-alpha.10":{"name":"identity-wallet","version":"2.0.0-alpha.10","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.10","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"06b4dc4a33d24722c3134464f575e408a882ed30","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.10.tgz","fileCount":68,"integrity":"sha512-gxhLsB43kONIZFycvt+5EUdycmBrXguqvAMYO53L07rgv5R0FOSSQU06+O6VMOUMFma1AcVA3QHvVWzI+oY9fw==","signatures":[{"sig":"MEYCIQCwzMI8zuDFf0cHQ1qOLt4aM2one9JVVgnRTwoeW4D3gQIhAJrfUp4P2EVsn0Vt3BPEX3vmekRqUgwSfDMElne8wDbq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4679434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc0jcCRA9TVsSAnZWagAAjQ4P/jf1qK40C37N90nBO7q6\nJb03XzNPiIejX2Hr48IK3YsSAspU+Kp9Ozstt+6Kj1hNtFMAUEr97fOBqBEh\nHJumzwGhBkZw5zoRqBu335+i0NwbIJbPyryT5jWD4CrFxM2/iWJLcqB24nKN\ngqbKJYx/N/TD+sm3xhM5kYUqbRT4vvGGGjOW11ydLtJgf4V9awq4w8VNW/QX\nGMZpIvgcdBbB1M2NzYXxlGDGS7N/6URBUv09B7xgoAFA/wTjoOvOmtZJcoZM\nxS4ybRbb2MklrtwREbVlE0HHrdtet4e3ct4E1u4KdazSqMRvxwgbFg5UVdtf\nGgvTHDcIjAz+9A0Aj+xdK2l7tsf5MMSNAm8a/C1lHklh2jQUqPM17H1mkRFI\nbiqPFO4AWfSpw8qWEwIRdB2YEZKKcihO0k0zxwqIKq8UFoF9h7Y0BcoUY6lm\ntKHgFxhL4+/yznjBIluXg1jQonCBNykIOGHkXS7IpsmmASq3XamhjXm6yGc2\nCCeqrfjIZorkTF+bmn8DPEIN/shGMDgLPclo/zX2zrs6DzKedceZXtbAxmNY\nKgrBb7ylOsAGbx9AEQ5/QzzWH1s19r4YouFNgTnYV+e3gzYznrG6SK4Muz1b\nQhEVpf93IIh4v4OHv9gacQWf0/cBba9q2RDs4CUAK6vHC5a/uVki6UuuqBEm\n+7yO\r\n=Y1w7\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"00f38c017a3c383e6ed5022736e90cb6bae0429c","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","events":"^3.2.0","did-jwt":"git+https://github.com/oed/did-jwt.git#feat/jwe-build","elliptic":"^6.5.3","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^3.0.1","uint8arrays":"^1.1.0","ipld-dag-cbor":"^0.17.0","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","@stablelib/sha256":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.4","@ethersproject/wallet":"^5.0.4","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/bs58":"^4.0.1","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.8.0","@ceramicnetwork/ceramic-common":"^0.8.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.10_1601390811960_0.23473246868042708","host":"s3://npm-registry-packages"}},"2.0.0-alpha.11":{"name":"identity-wallet","version":"2.0.0-alpha.11","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.11","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"13c6adef351e7d130e201354591f9d7a7a6ca903","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.11.tgz","fileCount":68,"integrity":"sha512-xIQVl2iBvsq9QCEo7RKZIeUid+0GMJNNXz4qY+dWUqsFao14Ow/m1pBqkemElb2e+h8n4AvNXrlUPXeiuJwerw==","signatures":[{"sig":"MEYCIQCqpwN5jvhp2fcgTijfiEY1WB9uTE9SrkLP4LPLSUS1OwIhANCNPCOJTmRNnXBcNV5xVBAhbDKKvTKxHB2ttvQWPViI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4654117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdvkbCRA9TVsSAnZWagAAiZgP/2KI41kF2bZaRv/dqbr4\n0/XCdzOApwJVAKu7QkgEKozC4XksUlObo0op+9aJoorfDx6Gos5Bg5sw0dM6\nu5XJrzyT3BHmIsfqgMkHRBgB0no7zc8rnW4MB0sPa+GFlHDRXet/O+F0ds6f\nk38kO1qDduCGN3PlCP961NCVWNxPI7FOPcDEdtCnTNqNZzVJ/opgddHugFd7\noqejry88dPyxJU6L2LCS2hNCnUH8pDTJaCIYJH7xCEBu+IuD7s2hoGBhtC6b\n1I+d8pPrDOH6AxdXO+VRJSkeRbH2E2zHD0817WleF5vgb7O6bMf/n3FaCqbj\n4bweeJl4Jw8ig5KyVuYn/tBVvstS8aKivEuh9zoOSY1VUmWunrgj6WZEXcL0\nyjqCq71KYo7s+eTPg5tLhiQgiG1xrN2z1JO/nbFj6CfC/Hnt2hCdz3w+ADyp\nf9PhroudP7t5eFF8DsU/ZEGsXOaNeK+grbmHf84L5Gy1htujk5q3h8u2Dx2W\nBda+0Npfm0tzl7puoc/KvYPSXsaRpQWqtSXIf/yrhr2GO2VrvClUbAlaVZ8r\nC/6IhdbTCqu0kUxyX1esOun8mwa1NKNSpMRjF7guSv6FsPH/nkvvLzUmBKDl\nMh2+gDVLqv4ZNwpO5L8Os+Qz2NxGLfvQAk0f7nIEX9wLXHbbMIHH2bOfcHhf\nNq5B\r\n=ruah\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>String</code> | The seed of the identity, 32 bytes hex string |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"2bfed03c60e12c3fdaf0badd85fd1d7ceb3a2f5c","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.1","elliptic":"^6.5.3","rpc-utils":"^0.1.2","multihashes":"^3.0.1","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/nacl":"^1.0.1","@stablelib/random":"^1.0.0","@stablelib/sha256":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.4","@ethersproject/wallet":"^5.0.4","fast-json-stable-stringify":"^2.1.0","@ceramicnetwork/ceramic-http-client":"^0.6.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.8.0","@ceramicnetwork/ceramic-common":"^0.8.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.11_1601632538926_0.8949018957943071","host":"s3://npm-registry-packages"}},"2.0.0-alpha.12":{"name":"identity-wallet","version":"2.0.0-alpha.12","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.12","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"59b3f925e61edd37b6ced02a8f814ccd26518817","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.12.tgz","fileCount":67,"integrity":"sha512-eHWqRjXgYeceNHsAUGywD3fvBxM+BQjxF5ZUfaT6pTwY3XA23xPrOuxLeY9D3eT6GKc5fyyCIZa4+tsmsoWmXA==","signatures":[{"sig":"MEUCIEfeOcaNep+bm9WlNjtNDV1Llv4KPoHk/sRquH4EldbHAiEA26IuYNNJWFhmqAloTlblvDnDGEgLibDQq0wgo6uIjd4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4655771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffafqCRA9TVsSAnZWagAAqsQQAIMnjWiZ82JKirpQnIUj\nnUrcLWPzvA2j33Uaib161KK8HG48fPPO4q8j0QQAKgRknXnyYhkc/JQNXkE9\n0qn1llFGijc+ogPE/eZrYPwBw6QkIK7uuwg5Y9BaMUETX31pvhK89LfcVSpZ\nhXpQ4Cmxc9l2ZI8kdb2JFdvqFAihaPWGB2yMXw5ScKIsgKLWaYbGUnbDyfGv\nOQBEI8sV1VbnOb79KIp/qMlTYSESNFwNDvtuENqxYEayukFd+lW27QYp17WV\nDhlZxebRTxAMH8uMnUvG3ujXYFPmnLHfv/OcQaugHhSEKw31wg7nkj94/s3w\nKimLu9I9zxVsyI9rer68B3XV1qWGZNS/uQSj67Glnc9apt8efTMdW/8S6oEw\ngORJr1FPac7YltH6Jrz5CdZw8ryPtYwQ1WFFDSdgT0ldwWzqzL70YZcr7t2q\nDcYaC3KFRXfn4UPmJqhFzgUHZahmuYwnWyaBaGDMMkCDXPnr/Mfo+ETrpBSK\nXZ0QwWDTRsPFkJMnHvK3w+Z/9NU1w8ZfN51iqUEvCwLMLGdV5Mg8q5XyVioN\ngWWmeK//Sqnj8yuoQmJLtwuFVltM4LhaE3OqlG/ixXkX+AJ5LiK2XKUOVNAL\neNc9yJsaS2C0KNLNglP4w1j+leLbSCGAg7olTKz7OkJH1ySo3KtzigO+IPGZ\nvmu0\r\n=f3JN\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","browser":{"fs":false,"child_process":false},"gitHead":"155252a195e233ba435de96b083e005f99f2959e","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"paul_lecam","email":"paul@ulem.net"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.3","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","elliptic":"^6.5.3","rpc-utils":"^0.1.2","multihashes":"^3.0.1","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/nacl":"^1.0.1","@stablelib/random":"^1.0.0","@stablelib/sha256":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.5","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.2.0","@ceramicnetwork/ceramic-http-client":"^0.6.4"},"_hasShrinkwrap":false,"devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicstudio/idx-tools":"^0.2.1","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.10.0","@ceramicnetwork/ceramic-common":"^0.10.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.12_1602070505761_0.6323957851208892","host":"s3://npm-registry-packages"}},"2.0.0-alpha.13":{"name":"identity-wallet","version":"2.0.0-alpha.13","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.13","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"95634966d4f6260b70c55cf79febdaa50bb4a88a","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.13.tgz","fileCount":67,"integrity":"sha512-n2Di8SjJcUEJ/ZPUf2rJQcHOD8FC6i0d2aBz0YfXdcKm4B+RjHzWV0Kb+DSbE/TAZiVzrPRTswdXxS3iQSQR5w==","signatures":[{"sig":"MEUCIHCj21vi5XF6Lt52zLWKvnZH7WjAa/B1FKynEXQSj7nTAiEA3nx8Lt04Vs/M8usyaWyYVapzRmicBUPcnqrRdUXJmYM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4658219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffvxVCRA9TVsSAnZWagAArV8P/1+WgOOVq8dd2QVw7jyc\nDzGXMRMe7bskTumgh/xP1hJ688zC7ZdWZkdaohsDZJ445g+nESYSwi3pxXQs\nQE3nnzfT8ixvafoVtYAy0NtSRnSD9/jkkHV+/RbgRg3q6AaPnunC+2yMCV54\nBTnVtHatcYIJOrSk6FpVfxIxpb9PKR+7ss07RK39mGl8hYtrz2TL3fECcrTI\npoWlhQpo8n8bum72/xSMgtSVydAkBUz/oVIovcPa4A5FBmNfQc+fN4zUK4nq\nWoiXmy0TgbLQ51/4J6MphtN+IRmCgp9bkqggRmA2mRq7gLK8qF5IPUi3KB+w\nsm1kn74a/OK+rV8zbTFNL0OAHg2TIEOvlraRh0hzRg8S+JwDbbIhTw0tiJH8\n7LnHejfs0E9kCHgdze3LOhvwS+6U52uGDg8PsR5l38Ci+wdHkKfjh+HH/y1B\nQi6QOUI6b7FMZh+ca2mnz+q6/QZeuKCBKmnT9kvVLrIWSDsuv+Dq7kYsqAOL\nbtvl+RzNbbhzZZDMuQHEgsCw5PJ3qwn3ZPRck18xAhpubQ2TccaBao5P4fi3\nsLtYzd8XfGy3hP3fZeozH3xpYEzuzJAAUk6IMAQfSIVEsGj+GmkDy7yQB/pT\nG9ehaRReaF3qCCyw81Ov8nwtf3KAFF2pgE/8FCqKyeNUwMARFGhcxLwpHVuA\nsWcB\r\n=2awI\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","browser":{"fs":false,"child_process":false},"gitHead":"355989f71e0a8868f324f0ec3f0cf35b291e2151","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"paul_lecam","email":"paul@ulem.net"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.3","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","elliptic":"^6.5.3","rpc-utils":"^0.1.2","multihashes":"^3.0.1","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/nacl":"^1.0.1","@stablelib/random":"^1.0.0","@stablelib/sha256":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.5","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.2.0","@ceramicnetwork/ceramic-http-client":"^0.6.4"},"_hasShrinkwrap":false,"devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicstudio/idx-tools":"^0.2.1","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.10.0","@ceramicnetwork/ceramic-common":"^0.10.0","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.13_1602157652847_0.8097051041727519","host":"s3://npm-registry-packages"}},"2.0.0-alpha.14":{"name":"identity-wallet","version":"2.0.0-alpha.14","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.14","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"770e70b62b5ca08033bee4b6b602f09802a57335","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.14.tgz","fileCount":64,"integrity":"sha512-TRSl/MehgBHZnuburobLnXXVRTcAuI1kqiK12qF5JzetI2pXQ7ToVY2GNgMkOs24akpx9xEk4mEGoyvv0BnEgA==","signatures":[{"sig":"MEQCICyNpFEPX3LWDf3WXPn0FG0X0nRKrlrM3C0Mt4IsOBZnAiB6fRXg0ZK7zlehCXYSzBHTC0hMS1omvN4qKgMKZiQGDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5307263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiXCFCRA9TVsSAnZWagAAUncP/07fzbLvR0I4BMTH4YCU\nKgtypbLulO0pAUNfBJ4eE55JAnN8cP8+Nqv9HG3uq45hgy7rHLFe2wpFhVbs\nitlJcu1WNcB7758SUnr39NPmiQuXFGXRNIKvxkDl5L3eAnTDQaVvrH4zcZ7H\nmM9JQlnb8YNmnJPR7vvkayUXQwur9P1Sz55B/zrD52+WNL5AgnVOggSEXTet\nMAVtb2x0srvqAwEBU/6a9M0FWKjbyJwIK/rdmtFOdogjPR2GD9W2Jz5XO7Sg\nfZPGsvFHvWF1Q0H5ooXavJYKXJC9OT6O4bTWfOeiev2Xa3uHwzp69SrvmU0H\nC6EJkibckNLBY6NX9SlPZN8aEfQW8QMR6hjo3WZN9wIAVMwK2Mh1nLAQyTud\n5vFDarFhKhhIXEJdScqT6pYd7KKU7fDUnanIL3d2nPYV3wTC18ubqHnASg6M\nTBj9jO77qUMtd/CHad3GBMAA9gI5PdCPqt7uDmYuXU0FJust6fAlTwknpFf/\nU6NKqJDJ7k45VTfYcgEkOpiAPCaPHxSegr0x4HtVMe4DKA97VMzicP52ig1Z\n7gG6ftcU9sOK9x2y1G8R+rspl7cP5YbbP3c+wmF50uzejKe7JZfmYprrP9+G\neqmVuWBwWzFEZFQnBKvRYjAJsQV1RDglUkupNx6IFYcVGuhFz29jfORmsOuW\n5w67\r\n=Tgxh\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"14b25ae0b1bf6157a2d1cbd85b127c7870d33cb4","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.5","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.2.1","@ceramicnetwork/ceramic-http-client":"^0.6.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicstudio/idx-tools":"^0.2.2","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.10.1","@ceramicnetwork/ceramic-common":"^0.10.1","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.14_1602842756475_0.9664032450770248","host":"s3://npm-registry-packages"}},"2.0.0-alpha.15":{"name":"identity-wallet","version":"2.0.0-alpha.15","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.15","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"336e2025dab39d066e245cbbb2a2a1e9d3b806a6","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.15.tgz","fileCount":64,"integrity":"sha512-J+uLm+OOC0eCQT5llxUgYT28dnILFooMscBPHg8bu2cxOJUlzqjTI4WFN39ZD24NA/bmdJo/v+aja085+v8y1Q==","signatures":[{"sig":"MEUCIQDDEMp40DpmzXbf1k5FqEoOhVM7QTrgIe3axRY96DfmJwIgN59z8stgYz8WeCJVpxiJKRBfrn5OVZ2zogeY70pyNk0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5312814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkA+SCRA9TVsSAnZWagAAB7oP/2Ea3C8RPWiilsIw7gVX\nejd67nK/7UxDZ5W6S5odqAatUWMFeUb1IgoyBkYyv+9vgkLSmAVhbmLHDVWQ\n5JqRRuJoWu1mfxsFC9+dQosrRHFwrMKu5KetT72400MWTCVySMbEinIM9HRZ\nOXbE+FJPYnDwV9lhoj6tBdhEhEtQvsYSHK50c7TBnBZ1nUzK7/VF0ocZN0s6\nxspkmdrtiOnEzrTeWlFP+miOWbmzu/we5cnEyO8ff5OhJyRggVf0Eg2+l3sm\nKD+6uVciWKd4Gdn1W/JtlInbotcu0ZkNklxXEQMZnLjkOvHx4l9qERGQEmGN\nvL8htP7KBGb3qazTiVSRjwABqI4IqnlTD6/DOZrk4q0VSvs2fCTKUlFARDY0\nrnZfNLmeITC4gyc1h6ptzfc7CLrEGoyEXZgAmG9HoZ5v4WVIBHyTTlxU7KDO\n/ntqBWle3GiIt5QNa8JRLaHjiQGIDAUmJzlCQkGEyMBHFQtWeJEkJ5wwm1e5\ngDtCHEbKWzG+B8T8rVbciw20bHt5pdAZ8Gz9iUu5+9BrTIa35gdVqav8wpaI\nc2/mpackZSPCiLyTINRFop18fGRBcWLj+poCYJkfw1Gi/SCxQAA2ZK4OUTm+\nZGooR5bTwOLCo3tuOcIdZ7Fl1zyat1XRcyPjko51XDQ3s/T9+IMxdCsW2G6h\nrdj6\r\n=X/xo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"4eb3b9eaa87907cf17c0142e3e21597e36c2b337","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.5","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.2.1","@ceramicnetwork/ceramic-http-client":"^0.6.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicstudio/idx-tools":"^0.2.2","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.10.1","@ceramicnetwork/ceramic-common":"^0.10.1","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.15_1603276690520_0.09108834829543033","host":"s3://npm-registry-packages"}},"2.0.0-alpha.16":{"name":"identity-wallet","version":"2.0.0-alpha.16","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.16","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8276bd7093aff15c3a3acb757568eebedfc02c49","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.16.tgz","fileCount":64,"integrity":"sha512-WlS91TYoUAtSjfPjYRuKzmEqc+EMkyePQQOqeTYE1jqo/azl7EHvoHHlQaGUzeZaEEDseeJZdM8jYJYaGGvBoA==","signatures":[{"sig":"MEYCIQClO/Cmc48stnY05jITrg2/HCz0VyA+ROPQkyaMyuwK3wIhAPtHOMrgk7MTteAHlQk626oHnrbPiqh+4Vz20xzw0h03","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5312953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkXpFCRA9TVsSAnZWagAAEugP/3IgiCdwo5BjWELADlAI\nNWo5ovWl6GHd6e31f40IlZtwFfX7SivmDo80KBptrUCrsJHk4vTFg0wIsHkd\n2yOjCXWntAsv4earXjhHgydRAuTvL7PYA5z8AQiVfuT2ck9AeLcvOHtjXhR0\nnL0JcT5VUGnXh+t0kouP/6cLMs779lOyzu+g7WOtNv+tEBciZS+NGk1eJvpJ\nrRc0qBPATtgZPTVm0qy2N3rtwIt8NLGpSZIzqXx8MksOm49bnMcZH8WlT/FW\n2qgqEFL2bGYvILoUfScYQ0+MaUkIYEPkFy0WPviQMey17xxITUmQtItGv8X/\n+GMVIVjXsfijyXatsaudBQxLAa+89ugZy6l07MxBHzhnOP1g4XtxFqNwszkS\nM84CD7TlPY/YF8cxujxsX4YlGPdvcGHFavRWxJeLpbx/DeadiEDZh6fPtjYa\nh0sljJXokk2qwM6pj2KwIwNisV7e8Ma7UHpEq0mRQqU/SgMoq8oyDtzony5B\nVERVxNZC8niR5FJXKujeMCwBNIJmee+ezCDUeV7qD/vWdmpoeq8564yI7RyU\na1CzEzoojn0sRvmE62Y3NPKMq6JohAz2+42jjkjpqLh5r5tz6qccz6sEnA5W\nILxMSkbfpdGE+udroug6C9xGPtGEKT3MOOi0wXaLFxsj9MDWwHulktl0XzTZ\nKVrd\r\n=JNRA\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"2eb8d2caa74551eb2c240ee28feed44b7804f687","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.4.5","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.5","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.2.1","@ceramicnetwork/ceramic-http-client":"^0.6.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.0","ipfs":"^0.50.2","jest":"^26.1.0","eslint":"^7.5.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@ceramicstudio/idx-tools":"^0.2.2","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.10.1","@ceramicnetwork/ceramic-common":"^0.10.1","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.16_1603369541280_0.3983008753207633","host":"s3://npm-registry-packages"}},"2.0.0-alpha.17":{"name":"identity-wallet","version":"2.0.0-alpha.17","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.17","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"f220a7705950af1f84e5b8234f44f981c66ce187","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.17.tgz","fileCount":64,"integrity":"sha512-Pu8Ljiw2Irprbw+PEtN8MpWCEPJuWN/7U1ilKouqgwoQbMGiUefzbfhEjy2TW15/L5D98smUPN7CPrJ9sGwRIw==","signatures":[{"sig":"MEUCIQCFTkmOZu44WkU/NsIyHbecJkQJo9uO3QYOG+kXBl6xBwIgY9iCNcceSXTjT3jMfEHe7CnCWFrhfezmjE+MKg9c5Ts=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4580782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmWmACRA9TVsSAnZWagAA8XAQAI4K3fYvBtBJMsR2wXXR\nSp/0Z9xUeZXL0fZlbmdL0R803MRmQeCw6JJrEmDA1CuIXZ+mHapg/NqLtBv9\nErzDuOUjKgcmlhtSSyslG6Z0z9Y19mLth9qlM4aXcnn5o48WiCO4OJClb/YQ\nv6vkOpsrSMEQrG/HVDrI4rllByWbPCA82dHM4b1sK17TOaYTLnpqs566nAOf\nxL1Oaxo7h92KB1j8MGCxKd9Zq1DV9uPu7c1/KyYhTtFSu/lvBIceTBHrxd0l\nQWq+RRweExgA1i81oP6UKYHUkzixZVGsbmWEPpBHFRB6ceDuCbTbzDT39rlz\nNO2s8/ld+X4XVKGT1eSbnDaHob376vrrCuyHqJCm/4zrAvwmhIkBwO39ltJ7\nQftw0ab2xABzqd+so0VQ29o1ZGBnNtE8X3yXlS50chWkec+Nmi7BNql71Bif\nn+BGQAqZyDG72As+Ppp2D1XhCEt+kG0L+iNoyWM9AbM3uA76o3kbOryQhg3l\n+PFJIRsDF3T0+N/cSqInnl7aS7wiWEmoz7jlnipMfte/i9Df4vdcYsUDj1ta\nNNJMj12uPfh6bS2D/ppuDd269KXIUZCq+SdaY66PyTE7px00wVB29OC+CsHt\nb4rePbTrmJEl2UU13sEQeYVqY/5gbpwxS/EZIhu2z6vsLWzVZE+ZBlSOD/YW\nE/se\r\n=yJ9x\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"443f9b68f514951c6063f4f991d15cd51e3c645e","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"paul_lecam","email":"paul@ulem.net"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"12.18.3","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.12.1","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.7","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.3.0-alpha.0","@ceramicnetwork/ceramic-http-client":"^0.7.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.2","ipfs":"^0.50.2","jest":"^26.6.1","eslint":"^7.12.0","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.12.1","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.12.3","@types/jest":"^26.0.15","@types/node":"^14.14.3","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.12.1","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.12.1","@ceramicstudio/idx-tools":"^0.3.0-alpha.0","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.12.0","@ceramicnetwork/ceramic-common":"^0.12.0","@babel/plugin-transform-runtime":"^7.12.1","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"^7.12.1","@babel/plugin-proposal-object-rest-spread":"^7.12.1"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.17_1603889535531_0.027329645947481662","host":"s3://npm-registry-packages"}},"2.0.0-alpha.18":{"name":"identity-wallet","version":"2.0.0-alpha.18","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.18","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"8f9938100c9b31aa6aebe9335fcb372f222afd76","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.18.tgz","fileCount":64,"integrity":"sha512-Iro78pz3cS2zy9B+hz8VjNgLNB7byoJtORJLeJ3ij0PG8n+wRyXpy/776012vRqxzFr9lZZrEP2+PMydg0rJqg==","signatures":[{"sig":"MEYCIQDB3BAsvRLOMCIy93XLuyx2jU7w8qmtXDoo/eQVDc3FswIhALpdp8G5g+15IHSdWYgCg4zu90Dm8H0gtgNs76NEpYWG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4579488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoTW0CRA9TVsSAnZWagAAFiYP/RRzpWg3zYW/78YNWFtQ\nF/6mjYtuLuc97YLTaaD3tZ88+bno6Qow/C+MNjXqYz5tG9LlW1gPobd1wFEY\nyJEW0d5fH505pPWgK0flsZvJfdFiochzu2mEdpYojrRRGFZDiu3zwdyBX1kR\n9Z/GtnxpC9PkhTUOjpH9/MenPIcw8rS+VgpXaMxrlY/Izw0RGSLM7AMopUf5\nR+zaRLZs2lApeBK+z8/lKAy3pTvrikoxEDF9Um+5nbkVeL5v+/tJM6ghWyuz\n1J78tYi1/4Y8bzAmg3ZQVtpLVFOHpVYRg/VgpJ3sv/dgNHp6jeBNjTu6ALHe\nOp32nq11oN67MIy/Q9MJCf8FiqwLnVCt1OIGNUBuoHd8HTDdRbk5YL6STyKH\n1krCXavY1GS3+wexsHwA2aUybYjJWKTQ2ya90/db0dN5BdRpfegZq5v6m1wS\ntr5IosqLzOR8lrAwUuP3Qbb8j7kWMjpUa+hk5+e+t8mX38ZyIZ8n1RnMnMCn\nMudYNKCJLcPHirHFg64jKY8+uY59VLygikXxUEwuHM58dlfrXdj3+uHzAw1v\natb5ulGzkZsF5A+X0W/nG88cxo0rE9jElZNul66tOh1u9DSUkeKDLUp6RRDh\njenmw5YtHMaZwW/T35RmM5n09ux76R8YEplsFOnam0hUKpRA3fzTB9W4uHiI\ng+Ax\r\n=HaXQ\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"cfc09e6c487354ae0b9c8d5d042f9cf75fd6e9b1","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.12.1","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.7","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.3.0","@ceramicnetwork/ceramic-http-client":"^0.7.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.2","ipfs":"^0.51.0","jest":"^26.6.2","eslint":"^7.12.1","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.12.1","babel-core":"7.0.0-bridge.0","typescript":"^4.0.5","@babel/core":"^7.12.3","@types/jest":"^26.0.15","@types/node":"^14.14.6","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.12.1","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.2.0","@babel/preset-typescript":"^7.12.1","@ceramicstudio/idx-tools":"^0.3.1","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.12.0","@ceramicnetwork/ceramic-common":"^0.12.0","@babel/plugin-transform-runtime":"^7.12.1","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"^7.12.1","@babel/plugin-proposal-object-rest-spread":"^7.12.1"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.18_1604400563125_0.22523483483752682","host":"s3://npm-registry-packages"}},"2.0.0-alpha.19":{"name":"identity-wallet","version":"2.0.0-alpha.19","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.19","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"0bd710120ed8d1a4873846e10907f32d2031e1b6","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.19.tgz","fileCount":64,"integrity":"sha512-WOh8JhyxfM79hLsFH5c1J+YFyQx0T7/hCavFYcLUERwchEF+ilB6CHuN48Dvo56YK/j00NqIvWVCjbzZUNCOAw==","signatures":[{"sig":"MEUCIBk0YsWuHax6BWz5+bt4YSqBIkUAc4rukJpsFqTnzgO/AiEA7F9thdXeeNBQOlIZ6YZKHLHla+LatEsm2f8PNBozFtE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4579468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfprzjCRA9TVsSAnZWagAALfEP/jadT2GLaUoYu1rhtVPr\nrrcYrC6SxvLNqmlpG+1ngkJaFlvOs4NzSC/eKEslH+mISTiEtFx4LLdLaOTH\nGqtFYzkhdqZ6xyIPFHwDZQhc1kq0bsj8dtGSnyDasSxXkIER1YOTCzrLi+3R\nGzB6YDDm33fPjuLq+aGx21ynaPuDB6MkmO7/soV9MSAYznntayiRikz7CeoW\nPFFRZNsoWG9dkudjDSlDD7dh3GHb4+Z/iMp5X0yDXUbwywORGU/595mk73Z9\nsdrT6TiyjApAZMDpcpnzJViSIyUxgo6FHOz8UmbeScmox3Kqe3enznUkPx0a\nsBjW/yw1LIEDubBqcMwYs+wp9M/lS1aE4KyD9ibXTq3VDxMJ8aqAjj46Q5pu\nagNHKKmSS1EVohq/q4Rrey/YQOoTVwnhEoZUPwOtt0VjBzDb6oNrJyJz2FJT\nOtITfa5B9HClomnL9oFkYDhzLc646Y2QHIM4/WV6YWHCvW30uO8K3HZctR1k\nrgHgc3WiImOCQwLxRIybMebFk5NniKQOQVVg1RFV0rSxnx0Q8sZOEvTrkM7G\nZPI7S8BOjdzTCJIVevRS4K9GmlsChsjFlFd58NBQS4S0DOOhOmwTPBjFGI+d\nZETXJd1UvNapuK+Ql+gqrgejMYBhsU3BVki0Yly0AE6gSatH+5nL0KuOO6dF\nD8/d\r\n=pxXb\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"21b97ac5797b24b58c0ea391d3bd1886b479eec6","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.12.1","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.7","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.3.0","@ceramicnetwork/ceramic-http-client":"^0.7.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.2","ipfs":"^0.51.0","jest":"^26.6.2","eslint":"^7.12.1","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.12.1","babel-core":"7.0.0-bridge.0","typescript":"^4.0.5","@babel/core":"^7.12.3","@types/jest":"^26.0.15","@types/node":"^14.14.6","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.12.1","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.2.0","@babel/preset-typescript":"^7.12.1","@ceramicstudio/idx-tools":"^0.3.1","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.12.0","@ceramicnetwork/ceramic-common":"^0.12.0","@babel/plugin-transform-runtime":"^7.12.1","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"^7.12.1","@babel/plugin-proposal-object-rest-spread":"^7.12.1"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.19_1604762850981_0.08465100611233956","host":"s3://npm-registry-packages"}},"2.0.0-alpha.20":{"name":"identity-wallet","version":"2.0.0-alpha.20","author":{"name":"3box","email":"team@3box.io"},"license":"(Apache-2.0 OR MIT)","_id":"identity-wallet@2.0.0-alpha.20","maintainers":[{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"oed","email":"oed@3box.io"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"fff98f55ba428ce42ea334080a7b6d43e1121968","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0-alpha.20.tgz","fileCount":64,"integrity":"sha512-JLOYY6GJMHIozC86aypYCBpKJ4QMhEPvyEtEFnuHRZvpLHS9LxsTVwF4D5OACPfbYGo+X9NiIUpTWqBZ60jaHQ==","signatures":[{"sig":"MEQCIDdHeWAqJHEx8iuMyLUkMG8IP7B3GbE21HLBwaVIdX1uAiBryJ8EkrMlZp9nD0jrKTLWQOSwzc5DtjwwYvdFP6Cg1A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4579461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJft9EzCRA9TVsSAnZWagAAn/UP/1e4+RJF9J6MwuYhtoQn\nC2iib7AMdWmuWgWNRHt7iyopTKTGdPUNGDZosisJ6LnGnaUzZZciwAdLZllh\nSyv2UwHeTCbEhlrTZZXMaT3cT/uT3nMehiNLRvCraFBE5I3yn+lTyekhswIZ\npvr9fkfXbX8tYcTxL63gZDG/5J1wgawfjPLhZI2XdZVbhQ2/5xsdWA5DgZHd\nHZuPK+Ibbfkzp07LMYZCQnl8596uovXCMZDNwpz0OuCJm/HTvtQPB7q+MpF9\nmfy357ke4iXL3XGzR/6MQ3Tu4dTzxyrKM6M8YCk4AQtUKraWY9a1pNbT7WVG\nyQuwprwgxb2QVwQMXroQ5JieBUn9OwcEYPeiJhUbgHrewGYlLSGaWSXfidtk\nL4TsOT31x74C2NxUqJPDivbRbyT30yTCtIFggwyBsFfFX2vCkJ49QbciILP1\nlJ3mAR0IsQnWdIpQtjKErWFHzsjmsiWanz4q4Y2pvG7xQQgg67JF1aBJL/fW\nhhAcTNVsrrM6UF0yYj/lbjKsgeluPP75Tt3lR9i/cFQeGfg2tAPIUlHjFOVj\neWsDVCHpzw/k5m94SeRXrbxdnXL0i7zsBMsvYWz8oJ2gVReI4aVL6R2nsOCX\nlOV+NUiST5ra/+ymMCHa8ZfohviPb/0oZHfQiuMWJCyfO6A8QWpV8J1FpO54\nCUGR\r\n=CVF1\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"jest-environment-uint8array","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","types":"lib/identity-wallet.d.ts","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet-js)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet-js.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet-js)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n\n# Identity Wallet\n🆔-wallet\n\nIdentityWallet is a JavaScript SDK that allows developers to create and manage 3ID identities on the Ceramic network. It exposes a [DID Provider](https://eips.ethereum.org/EIPS/eip-2844) interface which exposes JOSE signing and decryption though a JOSN-RPC interface. IdentityWallet can be used in combination with [js-did](https://github.com/ceramicnetwork/js-did).\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getPermission` function\nthe `getPermission` configuration parameter is always required when creating an instance of IdentityWallet. It is used to give an application permission to decrypt and sign data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given paths.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  payload: {\n    paths: ['/path/1', '/path/2']\n  }\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `/path/1` and `/path/2`. If the user consents to this the function should just return the `paths` array, otherwise an empty array. Note that an array containing only some of the requested paths may also be returned.\n\n#### Creating a wallet with an authentication method\nTo create a wallet with an auth method you can pass two params to the create method of IDW as shown below. If the auth method doesn't have a 3ID associated with it yet IDW will create a new 3ID.\n```js\nconst authSecret = new Uint8Array([ ... ]) // Entropy used to authenticate\nconst authId = 'myAuthenticationMethod' // a name of the auth method\n\nconst idWallet = await IdentityWallet.create({ getPermission, authSecret, authId })\n```\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = await IdentityWallet.create({ getPermission, seed })\n```\n\n#### Using the IdentityWallet with js-did\nAn instance of the DID provider from IdentityWallet can be passed directly to js-did.\n```js\nconst provider = idWallet.getDidProvider()\nconst did = new DID({ provider })\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet()](#new_IdentityWallet_new)\n    * _instance_\n        * [.keychain](#IdentityWallet+keychain)\n        * [.permissions](#IdentityWallet+permissions)\n        * [.id](#IdentityWallet+id)\n        * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n        * [.resetIDX()](#IdentityWallet+resetIDX)\n    * _static_\n        * [.create(config)](#IdentityWallet.create) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet()\nUse IdentityWallet.create() to create an IdentityWallet instance\n\n<a name=\"IdentityWallet+keychain\"></a>\n\n#### identityWallet.keychain\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| keychain | [<code>Keychain</code>](#Keychain) | Edit the keychain |\n\n<a name=\"IdentityWallet+permissions\"></a>\n\n#### identityWallet.permissions\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| permissions | [<code>Permissions</code>](#Permissions) | Edit permissions |\n\n<a name=\"IdentityWallet+id\"></a>\n\n#### identityWallet.id\n**Kind**: instance property of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| id | <code>string</code> | The DID of the IdentityWallet instance |\n\n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+resetIDX\"></a>\n\n#### identityWallet.resetIDX()\nReset the IDX doc structure to a default (mostly empty) state.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n<a name=\"IdentityWallet.create\"></a>\n\n#### IdentityWallet.create(config) ⇒ [<code>IdentityWallet</code>](#IdentityWallet)\nCreates an instance of IdentityWallet\n\n**Kind**: static method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: [<code>IdentityWallet</code>](#IdentityWallet) - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | <code>Object</code> | The configuration to be used |\n| config.getPermission | <code>function</code> | The function that is called to ask the user for permission |\n| config.seed | <code>Uint8Array</code> | The seed of the identity, 32 bytes |\n| config.authSecret | <code>Uint8Array</code> | The authSecret to use, 32 bytes |\n| config.authId | <code>String</code> | The authId is used to identify the authSecret |\n| config.disableIDX | <code>Boolean</code> | Disable creation of the IDX document |\n| config.v03ID | <code>String</code> | A v0 3ID, has to be passed if a migration is being preformed |\n\n<a name=\"Keychain\"></a>\n\n### Keychain\n**Kind**: global class  \n\n* [Keychain](#Keychain)\n    * [new Keychain()](#new_Keychain_new)\n    * [.list()](#Keychain+list) ⇒ <code>Array.&lt;string&gt;</code>\n    * [.add(authId, authSecret)](#Keychain+add)\n    * [.remove(authId)](#Keychain+remove)\n    * [.status()](#Keychain+status) ⇒ <code>KeychainStatus</code>\n    * [.commit()](#Keychain+commit)\n\n<a name=\"new_Keychain_new\"></a>\n\n#### new Keychain()\nThe Keychain enables adding and removing of authentication methods.\n\n<a name=\"Keychain+list\"></a>\n\n#### keychain.list() ⇒ <code>Array.&lt;string&gt;</code>\nList all current authentication methods.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>Array.&lt;string&gt;</code> - A list of authIds.  \n<a name=\"Keychain+add\"></a>\n\n#### keychain.add(authId, authSecret)\nAdd a new authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n| authSecret | <code>Uint8Array</code> | The authSecret to use, should be of sufficient entropy |\n\n<a name=\"Keychain+remove\"></a>\n\n#### keychain.remove(authId)\nRemove an authentication method (adds to staging).\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authId | <code>String</code> | An identifier for the auth method |\n\n<a name=\"Keychain+status\"></a>\n\n#### keychain.status() ⇒ <code>KeychainStatus</code>\nShow the staging status of the keychain.\nSince removing auth methods will rotate the keys of the 3ID its a good idea\nto remove multiple auth methods at once if desired. Therefore we introduce\na commit pattern to do multiple updates to the keychain at once.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n**Returns**: <code>KeychainStatus</code> - Object that states the staging status of the keychain  \n<a name=\"Keychain+commit\"></a>\n\n#### keychain.commit()\nCommit the staged changes to the keychain.\n\n**Kind**: instance method of [<code>Keychain</code>](#Keychain)  \n<a name=\"Permissions\"></a>\n\n### Permissions\n**Kind**: global class  \n\n* [Permissions](#Permissions)\n    * [new Permissions()](#new_Permissions_new)\n    * [.request(origin, paths)](#Permissions+request) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.has(origin, paths)](#Permissions+has) ⇒ <code>Boolean</code>\n    * [.get(origin)](#Permissions+get) ⇒ <code>Array.&lt;String&gt;</code>\n    * [.set(origin, paths)](#Permissions+set)\n\n<a name=\"new_Permissions_new\"></a>\n\n#### new Permissions()\nThe Permissions class exposes methods to read and update the given permissions\n\n<a name=\"Permissions+request\"></a>\n\n#### permissions.request(origin, paths) ⇒ <code>Array.&lt;String&gt;</code>\nRequest permission for given paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The paths that where granted permission for  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+has\"></a>\n\n#### permissions.has(origin, paths) ⇒ <code>Boolean</code>\nDetermine if permission has been given for paths for a given origin.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Boolean</code> - True if permission has previously been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n<a name=\"Permissions+get\"></a>\n\n#### permissions.get(origin) ⇒ <code>Array.&lt;String&gt;</code>\nGet the paths which the given origin has permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n**Returns**: <code>Array.&lt;String&gt;</code> - The permissioned paths  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n\n<a name=\"Permissions+set\"></a>\n\n#### permissions.set(origin, paths)\nSet the paths which the given origin should have permission for.\n\n**Kind**: instance method of [<code>Permissions</code>](#Permissions)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| origin | <code>String</code> | Application domain |\n| paths | <code>Array.&lt;String&gt;</code> | The desired paths |\n\n","browser":{"fs":false,"child_process":false},"gitHead":"5063441de3a2b8a65f1dfa9c2458da8d15b22ecb","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"caip":"^0.9.2","store":"^2.0.12","did-jwt":"^4.6.2","rpc-utils":"^0.1.2","uint8arrays":"^1.1.0","@babel/runtime":"^7.12.1","dag-jose-utils":"^0.1.0","@stablelib/random":"^1.0.0","@stablelib/x25519":"^1.0.0","3id-blockchain-utils":"^1.0.0","@ethersproject/hdnode":"^5.0.5","@ethersproject/wallet":"^5.0.7","fast-json-stable-stringify":"^2.1.0","@ceramicstudio/idx-constants":"^0.3.0","@ceramicnetwork/ceramic-http-client":"^0.7.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"cids":"^1.0.2","ipfs":"^0.51.0","jest":"^26.6.2","eslint":"^7.12.1","it-all":"^1.0.2","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.12.1","babel-core":"7.0.0-bridge.0","typescript":"^4.0.5","@babel/core":"^7.12.3","@types/jest":"^26.0.15","@types/node":"^14.14.6","jsdoc-babel":"^0.5.0","tmp-promise":"^3.0.2","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.12.1","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.2.0","@babel/preset-typescript":"^7.12.1","@ceramicstudio/idx-tools":"^0.3.1","jest-environment-uint8array":"^1.0.0","@ceramicnetwork/ceramic-core":"^0.12.0","@ceramicnetwork/ceramic-common":"^0.12.0","@babel/plugin-transform-runtime":"^7.12.1","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-modules-commonjs":"^7.12.1","@babel/plugin-proposal-object-rest-spread":"^7.12.1"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0-alpha.20_1605882162859_0.12282810010049161","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"identity-wallet","version":"2.0.0","author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","_id":"identity-wallet@2.0.0","maintainers":[{"name":"oed","email":"oed@3box.io"},{"name":"zachferland","email":"zachferland@gmail.com"},{"name":"paul_lecam","email":"paul@ulem.net"},{"name":"mangwana","email":"judith@npmjs.com"}],"homepage":"https://github.com/3box/identity-wallet-js#readme","bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"dist":{"shasum":"449cba4ec9af0f40ac2744b2e8553096a8a8275f","tarball":"https://registry.npmjs.org/identity-wallet/-/identity-wallet-2.0.0.tgz","fileCount":65,"integrity":"sha512-2aJ6KUfCEZFaBNG4FZv0HCCGLTPQ6bNf1qHL9ziu0SNdp+C0/MclxADCmFx4Zi61be6n0TLDnvQVGDVZCw9Y4w==","signatures":[{"sig":"MEYCIQDs0MZNSZd3+/3ymYJJWQxpn+esNP4d2cUo6h7woJmNvwIhAJPS5PVaXeUwLhnfCRl8+ze7EhVvIVzeTV7SpFzPScdh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6797638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIoU0CRA9TVsSAnZWagAAQ44P/2gFLyCkgys548jh5lTk\nHzIVB1jvX6RYxq0R4GHVJ89L9qV14aJlakJpX4mpxSP32WOIT6j3ogNL0nGy\nHdMa5j+as5oQ21M4NOWLMft40uNZX7i56k+XM+0rHvpgVAmKTYp3zvIdRt2b\nZ9E6pFRWQ92Bwn2XxSEPYN+I4zBWPHuQBwUnFlvLafE+oN18ORoAtbti3/o3\n/3ZLXL6xt1iyYi3XjtbGwjjF2OJ/mTooAXeBGGHBalERrijzhuqVXlQsKSn3\n02p6C+x3dydxEYdW5GIgl3UOvcbeTyYDv6BCo1c8XKtegPbrpnItHMjG7nZ8\nKZhR6nUlAzPjDhacr0Y1f5IGGUl8Vy8uY922/U0vW9M73OMoIamyi+gxW5KE\nD5k4wLdHFoXOIjH17RT7HSd4rY5WRT9d8r9CLdYlP6RWH08A9hi3AJ6VuAJJ\niDiViWuBlTqUPFyuNn2B6L2fJTrHAiFFOnhrOQ42DLOnXOwi7uOJy5TaSqUD\nqiBgdatrdDwxNg5/Sj37Ovtr4weSRniwsLns2b+GwiDXUZRzlFzpeVASFizY\nk866/WK8ff+KlCpbMEwhZKdBKGPaQKuB/5pjTcgzAAQd/1c8LnkeDIa0oxnb\ngDMoCdRoGvP+rKLwBWb5S1BsNvc1ZhkWKbzOtbyt7z/RX0KG4V0SnXegWsrQ\naTgS\r\n=XNQo\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testEnvironment":"node","testPathIgnorePatterns":["node_modules","lib"]},"main":"lib/identity-wallet.js","browser":{"fs":false,"child_process":false},"gitHead":"71236b19ed00f45cc4750bbdfd250f540c1983a2","scripts":{"lint":"eslint ./src --ext .js,.ts","test":"jest --coverage --runInBand","build":"npm run build:es5; npm run build:dist; npm run build:dist:prod","prepare":"npm run build","build:es5":"tsc -p tsconfig.json","build:dist":"webpack --config webpack.config.js --mode=development","build:dist:dev":"webpack --config webpack.dev.config.js --mode=development","prepublishOnly":"npm run build; npm run generate-readme","build:dist:prod":"webpack --config webpack.config.js --mode=production --output-filename identity-wallet.min.js","generate-readme":"cp readme-template.md README.md; jsdoc2md --configure ./jsdoc2md.json -g none -d 3 'src/**/*.ts' >> README.md"},"_npmUser":{"name":"oed","email":"oed@3box.io"},"deprecated":"Please use the 3id-did-provider package which works with Ceramic","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"_npmVersion":"6.14.8","description":"Create and manage identities","directories":{"lib":"lib"},"_nodeVersion":"14.11.0","dependencies":{"store":"^2.0.12","events":"^3.2.0","did-jwt":"^4.4.0","js-sha256":"^0.9.0","rpc-utils":"^0.1.2","tweetnacl":"^1.0.3","multihashes":"^1.0.1","ipld-dag-cbor":"^0.15.3","@babel/runtime":"^7.4.5","tweetnacl-util":"^0.15.1","ipfs-did-document":"^1.2.3","3id-blockchain-utils":"^0.4.0","@ethersproject/hdnode":"^5.0.1","@ethersproject/wallet":"^5.0.1","fast-json-stable-stringify":"^2.1.0"},"_hasShrinkwrap":false,"devDependencies":{"cids":"^0.8.3","jest":"^26.1.0","eslint":"^7.5.0","webpack":"^4.44.0","prettier":"^2.0.5","@babel/cli":"^7.10.5","babel-core":"7.0.0-bridge.0","typescript":"^3.9.7","@babel/core":"^7.10.5","@types/jest":"^26.0.7","@types/node":"^14.0.26","jsdoc-babel":"^0.5.0","webpack-cli":"^3.3.12","@types/store":"^2.0.2","babel-loader":"^8.1.0","@types/elliptic":"^6.4.12","@babel/preset-env":"^7.10.4","jsdoc-to-markdown":"^6.0.1","eslint-config-3box":"^0.1.2","@babel/preset-typescript":"^7.10.4","@babel/plugin-transform-runtime":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-transform-modules-commonjs":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4"},"_npmOperationalInternal":{"tmp":"tmp/identity-wallet_2.0.0_1612875059924_0.7266018920365009","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-07-11T06:34:53.342Z","modified":"2024-10-23T15:43:14.356Z","0.0.1":"2019-07-11T06:34:53.535Z","0.1.0-beta.1":"2019-07-18T09:17:56.424Z","0.1.0-beta.2":"2019-07-18T09:20:19.650Z","0.1.0-beta.3":"2019-07-18T11:49:11.696Z","0.1.0-beta.4":"2019-07-18T13:00:57.660Z","0.1.0-beta.5":"2019-07-19T10:13:00.847Z","0.1.0-beta.6":"2019-07-25T12:47:48.064Z","0.1.0-beta.7":"2019-07-25T12:51:33.588Z","0.1.0-beta.8":"2019-07-25T13:04:39.652Z","0.1.0-beta.9":"2019-09-03T09:23:05.689Z","0.1.0":"2019-09-26T08:20:53.060Z","0.2.0-beta.1":"2019-10-05T10:15:24.710Z","0.2.0-beta.2":"2019-10-07T01:51:35.576Z","0.2.0-beta.3":"2019-10-07T07:45:39.940Z","0.2.0-beta.4":"2019-10-07T07:46:21.069Z","0.2.0-beta.5":"2019-10-07T07:53:42.056Z","0.2.0-beta.6":"2019-10-07T07:56:14.350Z","0.2.0-beta.7":"2019-10-07T08:15:12.617Z","0.2.0-beta.9":"2019-10-07T08:23:10.140Z","0.2.0-beta.10":"2019-10-07T08:42:31.080Z","0.2.0-beta.11":"2019-10-07T08:43:34.859Z","0.2.0-beta.12":"2019-10-07T08:48:58.459Z","0.2.0-beta.13":"2019-10-07T08:55:57.528Z","0.2.0-beta.14":"2019-10-07T09:06:20.058Z","0.2.0-beta.15":"2019-10-07T09:14:12.091Z","0.2.0-beta.16":"2019-10-07T09:22:06.951Z","0.2.0-beta.18":"2019-10-07T09:45:20.163Z","0.2.0-beta.19":"2019-10-08T05:46:07.451Z","0.2.0-beta.20":"2019-10-08T06:01:57.067Z","0.2.0-beta.21":"2019-10-08T06:08:11.079Z","0.2.0-beta.22":"2019-10-08T06:11:54.903Z","0.2.0-beta.23":"2019-10-08T06:21:07.371Z","0.2.0-beta.24":"2019-10-13T09:55:14.052Z","0.2.0":"2019-10-17T01:39:13.274Z","0.3.0-beta.1":"2019-10-22T00:10:21.628Z","0.2.1-beta.1":"2019-10-22T18:39:21.842Z","0.2.1":"2019-10-22T20:57:00.709Z","0.3.0":"2019-11-06T10:13:04.555Z","0.3.1":"2019-11-14T20:01:14.988Z","0.3.2-beta.1":"2019-11-19T13:40:19.428Z","1.0.0-beta.1":"2019-11-27T10:10:40.982Z","1.0.0-beta.2":"2019-11-27T11:15:43.546Z","1.0.0":"2019-12-02T19:15:17.655Z","1.1.0-beta.1":"2019-12-20T13:01:40.851Z","1.1.0":"2020-01-09T09:41:48.939Z","1.1.1":"2020-02-12T19:49:54.281Z","1.1.2":"2020-03-18T12:50:09.645Z","1.1.3-beta.1":"2020-03-18T13:03:09.262Z","1.1.3":"2020-03-18T15:29:22.536Z","1.2.0-ceramic.1":"2020-04-04T09:29:56.226Z","1.2.0":"2020-04-14T17:16:04.176Z","1.3.0":"2020-05-29T19:48:59.619Z","1.4.0-beta.1":"2020-08-07T02:11:01.085Z","1.4.0":"2020-08-07T09:02:14.514Z","1.4.1":"2020-08-11T09:15:55.968Z","2.0.0-alpha.0":"2020-08-18T07:34:11.444Z","2.0.0-alpha.1":"2020-08-21T11:24:05.887Z","2.0.0-alpha.2":"2020-09-04T07:55:39.897Z","2.0.0-alpha.3":"2020-09-09T11:40:29.904Z","2.0.0-alpha.4":"2020-09-10T11:08:50.388Z","2.0.0-alpha.5":"2020-09-11T14:42:16.593Z","2.0.0-alpha.6":"2020-09-24T13:19:37.019Z","2.0.0-alpha.7":"2020-09-25T08:16:33.251Z","2.0.0-alpha.8":"2020-09-25T11:42:47.917Z","2.0.0-alpha.9":"2020-09-25T12:03:15.203Z","2.0.0-alpha.10":"2020-09-29T14:46:52.155Z","2.0.0-alpha.11":"2020-10-02T09:55:39.170Z","2.0.0-alpha.12":"2020-10-07T11:35:05.940Z","2.0.0-alpha.13":"2020-10-08T11:47:33.061Z","2.0.0-alpha.14":"2020-10-16T10:05:56.650Z","2.0.0-alpha.15":"2020-10-21T10:38:10.687Z","2.0.0-alpha.16":"2020-10-22T12:25:41.443Z","2.0.0-alpha.17":"2020-10-28T12:52:15.751Z","2.0.0-alpha.18":"2020-11-03T10:49:23.327Z","2.0.0-alpha.19":"2020-11-07T15:27:31.265Z","2.0.0-alpha.20":"2020-11-20T14:22:43.093Z","2.0.0":"2021-02-09T12:51:00.175Z"},"bugs":{"url":"https://github.com/3box/identity-wallet-js/issues"},"author":{"name":"3box","email":"team@3box.io"},"license":"Apache-2.0","homepage":"https://github.com/3box/identity-wallet-js#readme","repository":{"url":"git+https://github.com/3box/identity-wallet-js.git","type":"git"},"description":"Create and manage identities","maintainers":[{"email":"oed@3box.io","name":"oed"},{"email":"jmangwana@github.com","name":"mangwana"}],"readme":"[![CircleCI](https://img.shields.io/circleci/project/github/3box/identity-wallet.svg?style=for-the-badge)](https://circleci.com/gh/3box/identity-wallet)\n[![Discord](https://img.shields.io/discord/484729862368526356.svg?style=for-the-badge)](https://discordapp.com/invite/Z3f3Cxy)\n[![npm](https://img.shields.io/npm/dt/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![npm](https://img.shields.io/npm/v/identity-wallet.svg?style=for-the-badge)](https://www.npmjs.com/package/identity-wallet)\n[![Codecov](https://img.shields.io/codecov/c/github/3box/identity-wallet.svg?style=for-the-badge)](https://codecov.io/gh/3box/identity-wallet)\n[![Twitter Follow](https://img.shields.io/twitter/follow/3boxdb.svg?style=for-the-badge&label=Twitter)](https://twitter.com/3boxdb)\n[![Greenkeeper badge](https://badges.greenkeeper.io/3box/identity-wallet.svg)](https://greenkeeper.io/)\n\n# Identity Wallet\n🆔-wallet\n\n3Box `identity-wallet-js` is a JavaScript SDK that allows Ethereum JavaScript wallet developers to natively support 3Box identity and authentication functionalities, including: creating 3Box accounts, adding authentication methods (Ethereum keys), and responding to authentication requests for 3Box accounts as well as spaces.\n\n\n## Getting Started\n### <a name=\"install\"></a>Installation\nInstall 3box in your npm project:\n```\n$ npm install identity-wallet\n```\n\n### <a name=\"usage\"></a>Usage\n#### Import Identity Wallet into your project\nImport the identity-wallet module\n```js\nconst IdentityWallet = require('identity-wallet')\n```\nImport using the dist build in your html code\n```js\n<script type=\"text/javascript\" src=\"../dist/identity-wallet.js\"></script>\n```\n\n#### Understanding the `getConsent` function\nThe first parameter of the IdentityWallet constructor is the `getConsent` function. This function determines whether or not any given `origin` (app) is allowed access to the users data. What this function should do is to present a dialog to the user in the wallet UI, asking for permission to access the given spaces.\n\nThe function is called with one parameter which is the `request` object. It looks like this:\n```js\n{\n  type: 'authenticate',\n  origin: 'https://my.app.origin',\n  spaces: ['space1', 'space2']\n}\n```\nIn the above example the app with origin `https://my.app.origin` is requesting access to `space1` and `space2`. If the user consents to this the function should return `true`, otherwise it should return `false`.\nNote that if the `spaces` array is empty the app is requesting access to the general 3Box storage.\n\n#### Creating a wallet with a seed\nTo create a wallet with a seed you can simply pass it as an option to the constructor. This will create an instance of the IdentityWallet that derives all it's keys from this seed. Be careful, if this seed is lost the identity and all of it's data will be lost as well.\n```js\nconst seed = '0xabc123...' // a hex encoded seed\n\nconst idWallet = new IdentityWallet(getConsent, { seed })\n```\n\n#### Creating an identity for a contract wallet\nFor wallets which doesn't have one keypair, e.g. smart contract wallets, we provide a way of creating an identity with multiple authentication secrets. In this model each authentication secret grants full access to the identity.\n```js\nconst authSecret = '0xabc123...' // a hex encoded secret\n\nconst idWallet = new IdentityWallet(getConsent, { authSecret })\n```\n\nNew authentication secrets can later be added by calling the `addAuthMethod` instance method of the identityWallet. Note that this method can only be called after an authentication first has happened (`Box.openBox` has been called from `3box-js`).\n```js\nconst authSecret2 = '0xabc123...' // a hex encoded secret\n\nidWallet.addAuthMethod(authSecret2)\n```\n\n#### Using the IdentityWallet with 3box-js\nAn instance of IdentityWallet can be passed directly to 3box-js and will be used to authenticate the user.\n```js\nconst provider = idWallet.get3idProvider()\nconst box = await Box.openBox(null, provider)\n```\n\n#### Using the ThreeIdProvider to consume RPC calls\nAs described above the *3idProvider* can be accessed by calling `idWallet.get3idProvider()`. The provider object that is returned can be used to consume [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) requests.\n```js\nconst provider = idWallet.get3idProvider()\n// using the provider\nconst response = await provider.send(rpcRequest, origin)\n\n// alternatively using a callback function\nprovider.send(rpcRequest, origin, (error, response) => {\n  // use response or handle error\n})\n```\nIn the above example `rpcRequest` is a request formated according to the [3ID JSON-RPC](https://github.com/3box/3box/blob/master/3IPs/3ip-10.md) specification, and `origin` is a string, e.g. `https://my.app.origin`.\n\n\n#### Link an address to the identity\nMultiple blockchain addresses can be linked to an identity controlled by an IdentityWallet instance. Right now two types of ethereum addresses are supported: EOAs (externally owned accounts) and EIP1271 contracts. Support for other types and blockchains can be easily added by contributing to the 3id-blockchain-utils module.\nTo link an address simply use the linkAddress method as shown in the example below. The ethProvider needs to be able to sign a message using personal_sign for the given address.\n```js\nconst ethAddress = '0xabc...'\nconst ethProvider = // an ethereum json-rpc provider\n\nawait idWallet.linkAddress(ethAddress, ethProvider)\n```\n\n## Maintainers\n[@oed](https://github.com/oed)\n\n## <a name=\"api\"></a> API Documentation\n<a name=\"IdentityWallet\"></a>\n\n### IdentityWallet\n**Kind**: global class  \n\n* [IdentityWallet](#IdentityWallet)\n    * [new IdentityWallet(getConsent, config)](#new_IdentityWallet_new)\n    * [.get3idProvider()](#IdentityWallet+get3idProvider) ⇒ <code>ThreeIdProvider</code>\n    * [.getDidProvider()](#IdentityWallet+getDidProvider) ⇒ <code>DidProvider</code>\n    * [.hasConsent(spaces, origin)](#IdentityWallet+hasConsent) ⇒ <code>Boolean</code>\n    * [.getConsent(spaces, origin)](#IdentityWallet+getConsent) ⇒ <code>Boolean</code>\n    * [.linkAddress(address, provider)](#IdentityWallet+linkAddress) ⇒ <code>Object</code>\n    * [.authenticate(spaces, opts)](#IdentityWallet+authenticate) ⇒ <code>Object</code>\n    * [.isAuthenticated(spaces, origin)](#IdentityWallet+isAuthenticated) ⇒ <code>Boolean</code>\n    * [.addAuthMethod(authSecret)](#IdentityWallet+addAuthMethod)\n    * [.signClaim(payload, opts)](#IdentityWallet+signClaim) ⇒ <code>String</code>\n    * [.encrypt(message, space, opts)](#IdentityWallet+encrypt) ⇒ <code>Object</code>\n    * [.decrypt(encryptedObject, space)](#IdentityWallet+decrypt) ⇒ <code>String</code>\n\n<a name=\"new_IdentityWallet_new\"></a>\n\n#### new IdentityWallet(getConsent, config)\nCreates an instance of IdentityWallet\n\n**Returns**: <code>this</code> - An IdentityWallet instance  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| getConsent | <code>function</code> | The function that is called to ask the user for consent |\n| config | <code>Object</code> | The configuration to be used |\n| config.seed | <code>String</code> | The seed of the identity, 32 hex string |\n| config.authSecret | <code>String</code> | The authSecret to use, 32 hex string |\n| config.externalAuth | <code>String</code> | External auth function, directly returns key material, used to migrate legacy 3box accounts |\n\n<a name=\"IdentityWallet+get3idProvider\"></a>\n\n#### identityWallet.get3idProvider() ⇒ <code>ThreeIdProvider</code>\nGet the 3IDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>ThreeIdProvider</code> - The 3IDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+getDidProvider\"></a>\n\n#### identityWallet.getDidProvider() ⇒ <code>DidProvider</code>\nGet the DIDProvider\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>DidProvider</code> - The DIDProvider for this IdentityWallet instance  \n<a name=\"IdentityWallet+hasConsent\"></a>\n\n#### identityWallet.hasConsent(spaces, origin) ⇒ <code>Boolean</code>\nDetermine if consent has been given for spaces for a given origin\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if consent has already been given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+getConsent\"></a>\n\n#### identityWallet.getConsent(spaces, origin) ⇒ <code>Boolean</code>\nGet consent for given spaces for a given origin\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True consent was given  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+linkAddress\"></a>\n\n#### identityWallet.linkAddress(address, provider) ⇒ <code>Object</code>\nLink a blockchain address to the identity. Usually the address\nwould be an ethereum address (EOA or EIP1271 compatible contract)\nand the provider is an JSON-RPC provider that can sign a message\nwith this address using personal_sign.\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The link proof object  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| address | <code>String</code> | The address to link |\n| provider | <code>Object</code> | The provider that can sign a message for the given address |\n\n<a name=\"IdentityWallet+authenticate\"></a>\n\n#### identityWallet.authenticate(spaces, opts) ⇒ <code>Object</code>\nAuthenticate to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The public keys for the requested spaces of this identity  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| opts | <code>Object</code> | Optional parameters |\n| opts.authData | <code>Array.&lt;Object&gt;</code> | The authData for this identity |\n\n<a name=\"IdentityWallet+isAuthenticated\"></a>\n\n#### identityWallet.isAuthenticated(spaces, origin) ⇒ <code>Boolean</code>\nCheck if authenticated to given spaces\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Boolean</code> - True if authenticated  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| spaces | <code>Array.&lt;String&gt;</code> | The desired spaces |\n| origin | <code>String</code> | Application domain |\n| opt.address | <code>String</code> | Optional address (managementKey) if keyring not available yet |\n\n<a name=\"IdentityWallet+addAuthMethod\"></a>\n\n#### identityWallet.addAuthMethod(authSecret)\nAdd a new authentication method for this identity\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| authSecret | <code>String</code> | A 32 byte hex string used as authentication secret |\n\n<a name=\"IdentityWallet+signClaim\"></a>\n\n#### identityWallet.signClaim(payload, opts) ⇒ <code>String</code>\nSign a verifiable credential. The format of the credential is [did-jwt](https://github.com/uport-project/did-jwt).\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The signed claim encoded as a JWT  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| payload | <code>Object</code> | The payload of the claim |\n| opts | <code>Object</code> | Optional parameters |\n| opts.space | <code>String</code> | The space used to sign the claim |\n| opts.expiresIn | <code>String</code> | Set an expiry date for the claim as unix timestamp |\n\n<a name=\"IdentityWallet+encrypt\"></a>\n\n#### identityWallet.encrypt(message, space, opts) ⇒ <code>Object</code>\nEncrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>Object</code> - The encrypted object (ciphertext and nonce)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | <code>String</code> | The message to be encrypted |\n| space | <code>String</code> | The space used for encryption |\n| opts | <code>Object</code> | Optional parameters |\n| opts.to | <code>String</code> | The public key to encrypt the message to |\n| opts.nonce | <code>String</code> | The nonce used to encrypt the message |\n| opts.blockSize | <code>String</code> | The blockSize used for padding (default 24) |\n\n<a name=\"IdentityWallet+decrypt\"></a>\n\n#### identityWallet.decrypt(encryptedObject, space) ⇒ <code>String</code>\nDecrypt a message\n\n**Kind**: instance method of [<code>IdentityWallet</code>](#IdentityWallet)  \n**Returns**: <code>String</code> - The decrypted message  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| encryptedObject | <code>Object</code> | The encrypted object (ciphertext, nonce, and ephemeralFrom for asymmetric encrypted objects) |\n| space | <code>String</code> | The space used for encryption |\n\n","readmeFilename":"README.md"}