{"_id":"react-idm-wallet","_rev":"30-802056ca08f925f9be854712ec331473","name":"react-idm-wallet","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"react-idm-wallet","version":"0.1.0","description":"React bindings for the reference implementation of the IDM Wallet in JavaScript","main":"lib/index.js","module":"es/index.js","homepage":"https://github.com/ipfs-shipyard/react-idm-wallet#readme","author":{"name":"André Cruz","email":"andre@moxy.studio"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/react-idm-wallet.git"},"keywords":["react","idm","wallet","connect","hoc","identity","decentralized"],"bugs":{"url":"https://github.com/ipfs-shipyard/react-idm-wallet/issues"},"scripts":{"build:commonjs":"BABEL_ENV=commonjs babel src -d lib --delete-dir-on-start","build:es":"BABEL_ENV=es babel src -d es --delete-dir-on-start","build":"npm run build:commonjs && npm run build:es","test":"jest --coverage","lint":"eslint --ignore-path .gitignore .","prerelease":"npm t && npm run lint && npm run build","release":"standard-version"},"jest":{"setupFilesAfterEnv":["react-testing-library/cleanup-after-each"],"collectCoverageFrom":["src/**/*"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"standard-version":{"scripts":{"posttag":"git push --follow-tags origin master"}},"lint-staged":{"*.js":["eslint --fix","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"peerDependencies":{"react":"^16.8.0","idm-wallet":"^0.2.0"},"dependencies":{"cancel.it":"^0.1.1","hoist-non-react-statics":"^3.3.0","invariant":"^2.2.4","lodash":"^4.17.11","memoize-one":"^5.0.4","p-is-promise":"^2.1.0","p-try":"^2.2.0","prop-types":"^15.7.2","shallow-equal":"^1.1.0"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@commitlint/config-conventional":"^7.5.0","babel-jest":"^24.5.0","babel-preset-moxy":"^3.0.4","commitlint":"^7.5.2","delay":"^4.2.0","eslint":"^5.13.0","eslint-config-moxy":"^7.1.0","husky":"^2.1.0","jest":"^24.5.0","lint-staged":"^8.1.4","p-each-series":"^2.1.0","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","react-testing-library":"^7.0.0","standard-version":"^5.0.0"},"gitHead":"b89f6f4dba60d22f815f6edadb4a2d39ea07c021","_id":"react-idm-wallet@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"dist":{"integrity":"sha512-gRCjBAxY/QD26/wpItzA5SD0F0Ni3tYLf9N54yLGIffU80y/QxL6OiuTuGIT3KixMEw65RAM4QXErol0tvMz/w==","shasum":"6d02d8102df533dd1580c5b85f66c7002eb4e844","tarball":"https://registry.npmjs.org/react-idm-wallet/-/react-idm-wallet-0.1.0.tgz","fileCount":14,"unpackedSize":34533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyzEkCRA9TVsSAnZWagAAv8YP/3xYJZy8B6OfFkNRW0gn\njPWtbXLrx5N//2TWcVW6bHKlvsvK6tcir461eU7ipqN8celPgEOjM21ccppm\n3Ba4RSonvR5WdH09FUnXVQtnw5BuV7/XCr8zSG8eoMb43FVcbikrktvVJtvF\nk19wic7FkP0nz6mF6o0VEwa4NWBhjeqNOlzNnk7+SVmaW6rI5dTsn3gSWQh1\nUPGzgzwHSeMMZIK8KssVkcDjsFuKsyXfqVdpMzApdTCKG8yr6xIFKar6N9cm\nE54sc4DjVO/YQvUYgIH4fvLf8laPmvM0aBAtrb8DyMJyjCwrXW9DxVyccq/G\nB4yl49b37Kd76G00etE15ewpPXEkAZ9pUEW7NH3C0zTd5p6MZgbWezIJddlt\nQV7Udik1Wtj9Qm6Mfl4DXQQSBkQ2pTC5STvdCsZlbEV3KYSaHKlu1f/rfHRW\nwRyT0+/sVYcNqhwozH96a0v28qRcKtZJpZSrkvVxL8VAvDjCCggEUu4HaS6g\nVB/yaqLY+0iPNwvKTioIiHluGN/uaGCUduX32T1YZFB0qdSkmBiAo8GNKudC\n/Q4x7UH3exJAE+K761pHUuzsgvM50SOz7kEdF3iJGPrfKnHUlTf5WwwnzwLu\ngeoFnAwQ1J9TRryGnA1/lzOWLgSMJ2AU3sXy+4H6xMJWuWaqdtxmj1yzXnNd\nErOO\r\n=bSlS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgj2a5pOnGCc8peirQDZ1IFFvotWqXBLwpsG+YFAtpwAiAQISRzzUr48LZOBMokF4fnplPzBoqM3alHxDFF6A7WYQ=="}]},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-idm-wallet_0.1.0_1556820259448_0.4702802781194706"},"_hasShrinkwrap":false},"0.2.0":{"name":"react-idm-wallet","version":"0.2.0","description":"React bindings for the reference implementation of the IDM Wallet in JavaScript","main":"lib/index.js","module":"es/index.js","homepage":"https://github.com/ipfs-shipyard/react-idm-wallet#readme","author":{"name":"André Cruz","email":"andre@moxy.studio"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/react-idm-wallet.git"},"keywords":["react","idm","wallet","connect","hoc","identity","decentralized"],"bugs":{"url":"https://github.com/ipfs-shipyard/react-idm-wallet/issues"},"scripts":{"build:commonjs":"BABEL_ENV=commonjs babel src -d lib --delete-dir-on-start","build:es":"BABEL_ENV=es babel src -d es --delete-dir-on-start","build":"npm run build:commonjs && npm run build:es","test":"jest --coverage","lint":"eslint --ignore-path .gitignore .","prerelease":"npm t && npm run lint && npm run build","release":"standard-version"},"jest":{"setupFilesAfterEnv":["react-testing-library/cleanup-after-each"],"collectCoverageFrom":["src/**/*"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"standard-version":{"scripts":{"posttag":"git push --follow-tags origin master"}},"lint-staged":{"*.js":["eslint --fix","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"peerDependencies":{"react":"^16.8.0","idm-wallet":"^0.3.0"},"dependencies":{"cancel.it":"^0.1.1","hoist-non-react-statics":"^3.3.0","invariant":"^2.2.4","lodash":"^4.17.11","memoize-one":"^5.0.4","p-is-promise":"^2.1.0","p-try":"^2.2.0","prop-types":"^15.7.2","shallow-equal":"^1.1.0"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@commitlint/config-conventional":"^7.5.0","babel-jest":"^24.5.0","babel-preset-moxy":"^3.0.4","commitlint":"^7.5.2","delay":"^4.2.0","eslint":"^5.13.0","eslint-config-moxy":"^7.1.0","husky":"^2.1.0","jest":"^24.5.0","lint-staged":"^8.1.4","p-each-series":"^2.1.0","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","react-testing-library":"^7.0.0","standard-version":"^5.0.0"},"gitHead":"946aadfc5fa212e7674538e039b0279debe52a13","_id":"react-idm-wallet@0.2.0","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"paulobmarcos","email":"paulobmarcos@outlook.com"},"dist":{"integrity":"sha512-gziDMgPjRnRxOG8h198otvJu2bCKuGN+1iBgdhOZtG8CFzqiPVxDM0RKwI2g2AIpmI9NGfZzzTKGVXLmwjDeXA==","shasum":"bb1c89a43426b8b207348058dff37737d8ef9234","tarball":"https://registry.npmjs.org/react-idm-wallet/-/react-idm-wallet-0.2.0.tgz","fileCount":14,"unpackedSize":35904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7QqdCRA9TVsSAnZWagAAJA4QAJsA/fdIiECmK4r74eLo\n3DvezijsEu5Au1QolMDjksxaKs2iseb0ABkct7C1ZW4kgdtj40cHzwzM2lE3\nYSRIQgPZgnXsuEikBneua1JVvMjvqKUNdxw+xrzVLNECpgLRQpoXowhWmala\nHClA/gvdtNwMpNIFrDYXbs/zd3+9pMd76m615rOihxrJminpFqtUeevY6Pi5\nGwLEk/EumhzkKgJs1xd0x8YUKbZBs4lYFZ+nWIpLIiOWiI+L/ZqDFo8pdvIP\nlPcUpxSTODsIo3w58UoDrXANEvR8wYeovJh1bPEoSW+TZrovAMcPE4HKZhre\ngrxUi3QSbZt0S1e5ekwXxGJk9CDAaW/SjQqPQhjEGNAhIvy0qmo1VL4hcxV3\nHkVKDcKFSbIfhS6kDA6gZgAaTelWI2kL7Il6MCrGEBUe5CEciHTpyL045/dc\nJyneDpzZfbmaUszkNHY1dfVSAC0XM/gsncJ53sFMUb+BszXp3Cs4gXUY42Nm\nVKyBsN40407IawLVmzYtCFWtJ7rORREn+od7x7X6E9/bU1AxYrz//Ckd8mIk\ngi85Yhecn/gy0rh5fHQ2STHxFFVFCatldfQXcLmL1dgGEA0UnPjKkgoGiQH7\ny9fnW7e9eZsfUQOKe1R47IZtfzQuqjVFBVFx7kU0id47ugnHT7aL8jyF9z6P\nCp/1\r\n=91gy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFG9ei5+2M2GNCWq9qML1MQegZX9vygQV40vVAwlQq/eAiA48fBKar79IMJDuWV5ZFghWwaRTkPfIW6Dz3HX6IL2iA=="}]},"maintainers":[{"email":"andreclima.pt@gmail.com","name":"acostalima"},{"email":"a.reis_05@hotmail.com","name":"afonsovreis"},{"email":"gmdz95@gmail.com","name":"dominguesgm"},{"email":"filipediasferreira@me.com","name":"filipediasf"},{"email":"fsdiogo@gmail.com","name":"fsdiogo"},{"email":"mail@hugodias.me","name":"hugomrdias"},{"email":"ivolimasilva@outlook.com","name":"ivolimasilva"},{"email":"joaomssmota@gmail.com","name":"joaomota"},{"email":"marcooliveira@me.com","name":"marcooliveira"},{"email":"hello@moxy.studio","name":"moxyhq"},{"email":"nelsonfonseca.18@gmail.com","name":"nlfonseca"},{"email":"paulobmarcos@outlook.com","name":"paulobmarcos"},{"email":"pedromiguelsousasantos@hotmail.com","name":"pedromiguelss"},{"email":"ricardo.silva@moxy.studio","name":"ricardo-silva91"},{"email":"ruimpmonteiro12345@gmail.com","name":"ruimonteiro"},{"email":"rui.neves@moxy.studio","name":"ruipneves"},{"email":"andremiguelcruz@msn.com","name":"satazor"},{"email":"vasco.santos@moxy.studio","name":"vascosantos"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-idm-wallet_0.2.0_1559038620753_0.23051223636680174"},"_hasShrinkwrap":false},"0.3.0":{"name":"react-idm-wallet","version":"0.3.0","description":"React bindings for the reference implementation of the IDM Wallet in JavaScript","main":"lib/index.js","module":"es/index.js","homepage":"https://github.com/ipfs-shipyard/react-idm-wallet#readme","author":{"name":"André Cruz","email":"andre@moxy.studio"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/react-idm-wallet.git"},"keywords":["react","idm","wallet","connect","hoc","identity","decentralized"],"bugs":{"url":"https://github.com/ipfs-shipyard/react-idm-wallet/issues"},"scripts":{"build:commonjs":"BABEL_ENV=commonjs babel src -d lib --delete-dir-on-start","build:es":"BABEL_ENV=es babel src -d es --delete-dir-on-start","build":"npm run build:commonjs && npm run build:es","test":"jest --coverage","lint":"eslint --ignore-path .gitignore .","prerelease":"npm t && npm run lint && npm run build","release":"standard-version"},"jest":{"setupFilesAfterEnv":["react-testing-library/cleanup-after-each"],"collectCoverageFrom":["src/**/*"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"standard-version":{"scripts":{"posttag":"git push --follow-tags origin master"}},"lint-staged":{"*.js":["eslint --fix","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"peerDependencies":{"react":"^16.8.0","idm-wallet":"^0.4.0"},"dependencies":{"cancel.it":"^0.1.1","hoist-non-react-statics":"^3.3.0","invariant":"^2.2.4","lodash":"^4.17.11","memoize-one":"^5.0.4","p-is-promise":"^2.1.0","p-try":"^2.2.0","prop-types":"^15.7.2","shallow-equal":"^1.1.0"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@commitlint/config-conventional":"^7.5.0","babel-jest":"^24.5.0","babel-preset-moxy":"^3.0.4","commitlint":"^7.5.2","delay":"^4.2.0","eslint":"^5.13.0","eslint-config-moxy":"^7.1.0","husky":"^2.1.0","jest":"^24.5.0","lint-staged":"^8.1.4","p-each-series":"^2.1.0","react":"^16.8.6","react-dom":"^16.8.6","react-test-renderer":"^16.8.6","react-testing-library":"^7.0.0","standard-version":"^6.0.1"},"gitHead":"3a1458425c6e66dbb01517e2e4d5486ea85cf465","_id":"react-idm-wallet@0.3.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gTbmFY+/G6DptJcN2PzcRV9G9qJufWcT7f0w1luymgYk/R2oRtXVe4o8EKegGrmoZCD2Bp2LqsWQtZZqPHpT4A==","shasum":"b9464f2833b258c9c7189cdbcb39e0cb21c45f22","tarball":"https://registry.npmjs.org/react-idm-wallet/-/react-idm-wallet-0.3.0.tgz","fileCount":14,"unpackedSize":36419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBSNTCRA9TVsSAnZWagAAE1wQAI7NYUJcnSHl55mExkzl\n5HoUwXkm7poyIlbDSCtiTgtG7pAO1IKa5wr2nrrAnrV/8AwTHckjSpFaiNKx\nolLA/qFTGXmmmbtzFtvQGZltyPWE+enSNklOAA+AwD5ZDiiUsG/9SwXKlckG\nC2raye/0a2SZX5mvY3B40hL5cXp8gh57c3rzpzZi2MiqLHO3P6H+r7jhsbjO\nCI7Vht8woXwgAqUL/jSNy5tv+G/HU0Q5q3Ua7BkXAzEj2ZeqHDDhiHIkK7yc\nigKiQ+zbBGUiHS0WSL9TKxp+JDsxpFjSkI2ugVtfy/crAAuTFzj7KK0LIfFf\nt1e+W2Ri1qg1ZgSlCGpwNNrPqeYnUzNZH7kdfLfusURreFjVWVKT9zt/E8eT\nIcDo5neROMuKwQJNd2sY1snlBfbyv/pM0Ws5DCqa9sDkK9yGZbF0fYC+5U1R\nwTzVs1UbIgpyKjBsI7I5lZqZ9Ek982j3eKXjHdhlTQ9HO3AXGj5w07PUEwU1\n0J+5R/Qhfd2udmRJ16KzAAHiXrycyUPU3Bt07qZfoHgV11p/7plhpjJt4epj\nNZIBHK4KbO/3LkXOpCIpvqlYT23USX2gbYjUKmIYD+xQ6kiEgcc4Xjj2Uq4l\n59TkD6UH1+v/1voMuYRmR6l4vlzPnuJpMrng68vTu813QZnI8vZRYNyCK3XO\njATS\r\n=uheb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHPuUvP4H8ZWld7592t5tAQZjoqUNr1jJn+eZP/jX6RwIgUPf1Cyc+1dRsxF5Hv4MmxQUp/zsx0z4B5gjsUhvBnQE="}]},"maintainers":[{"email":"andreclima.pt@gmail.com","name":"acostalima"},{"email":"a.reis_05@hotmail.com","name":"afonsovreis"},{"email":"gmdz95@gmail.com","name":"dominguesgm"},{"email":"filipediasferreira@me.com","name":"filipediasf"},{"email":"fsdiogo@gmail.com","name":"fsdiogo"},{"email":"mail@hugodias.me","name":"hugomrdias"},{"email":"ivolimasilva@outlook.com","name":"ivolimasilva"},{"email":"joaomssmota@gmail.com","name":"joaomota"},{"email":"marcooliveira@me.com","name":"marcooliveira"},{"email":"hello@moxy.studio","name":"moxyhq"},{"email":"nelsonfonseca.18@gmail.com","name":"nlfonseca"},{"email":"paulobmarcos@outlook.com","name":"paulobmarcos"},{"email":"pedromiguelsousasantos@hotmail.com","name":"pedromiguelss"},{"email":"ricardo.silva@moxy.studio","name":"ricardo-silva91"},{"email":"ruimpmonteiro12345@gmail.com","name":"ruimonteiro"},{"email":"rui.neves@moxy.studio","name":"ruipneves"},{"email":"andremiguelcruz@msn.com","name":"satazor"},{"email":"vasco.santos@moxy.studio","name":"vascosantos"}],"_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-idm-wallet_0.3.0_1560617810754_0.6649476452262733"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-02T18:04:19.447Z","0.1.0":"2019-05-02T18:04:19.583Z","modified":"2022-05-14T12:31:38.697Z","0.2.0":"2019-05-28T10:17:00.978Z","0.3.0":"2019-06-15T16:56:50.911Z"},"maintainers":[{"email":"tiagoddinis@gmail.com","name":"tiagodinis"},{"email":"hello@moxy.studio","name":"moxyhq"},{"email":"filipediasferreira@me.com","name":"filipediasf"},{"email":"andremiguelcruz@msn.com","name":"satazor"},{"email":"marcooliveira@me.com","name":"marcooliveira"},{"email":"andreclima.pt@gmail.com","name":"acostalima"},{"email":"andregoncalves20007@gmail.com","name":"andregoncalvesdev"}],"description":"React bindings for the reference implementation of the IDM Wallet in JavaScript","homepage":"https://github.com/ipfs-shipyard/react-idm-wallet#readme","keywords":["react","idm","wallet","connect","hoc","identity","decentralized"],"repository":{"type":"git","url":"git+https://github.com/ipfs-shipyard/react-idm-wallet.git"},"author":{"name":"André Cruz","email":"andre@moxy.studio"},"bugs":{"url":"https://github.com/ipfs-shipyard/react-idm-wallet/issues"},"license":"MIT","readme":"# react-idm-wallet\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/react-idm-wallet\n[downloads-image]:http://img.shields.io/npm/dm/react-idm-wallet.svg\n[npm-image]:http://img.shields.io/npm/v/react-idm-wallet.svg\n[travis-url]:https://travis-ci.org/ipfs-shipyard/react-idm-wallet\n[travis-image]:http://img.shields.io/travis/ipfs-shipyard/react-idm-wallet/master.svg\n[codecov-url]:https://codecov.io/gh/ipfs-shipyard/react-idm-wallet\n[codecov-image]:https://img.shields.io/codecov/c/github/ipfs-shipyard/react-idm-wallet/master.svg\n[david-dm-url]:https://david-dm.org/ipfs-shipyard/react-idm-wallet\n[david-dm-image]:https://img.shields.io/david/ipfs-shipyard/react-idm-wallet.svg\n[david-dm-dev-url]:https://david-dm.org/ipfs-shipyard/react-idm-wallet?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/ipfs-shipyard/react-idm-wallet.svg\n\nReact bindings for the [reference implementation](https://npmjs.org/package/idm-wallet) of the IDM Wallet in JavaScript.\n\n\n## Installation\n\n```sh\n$ npm install react-idm-wallet idm-wallet\n```\n\nYou must also install `idm-wallet` as this module has a peer-depedency on it.\n\nThis library is written in modern JavaScript and is published in both CommonJS and ES module transpiled variants. If you target older browsers please make sure to transpile accordingly.\n\n\n## Usage\n\nFirst, wrap your application in `<IdmWalletProvider>`:\n\n```js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport createIdmWallet from 'idm-wallet';\nimport { IdmWalletProvider } from 'react-idm-wallet';\nimport App from './App';\n\nconst renderApp = (idmWallet) => {\n    ReactDOM.render(\n        <IdmWalletProvider idmWallet={ idmWallet }>\n            <App />\n        </IdmWalletProvider>,\n        document.getElementById('root')\n    );\n};\n\ncreateIdmWallet()\n.then(renderApp)\n.catch((err) => console.error(err));\n```\n\nIf you would like to render a loader while the wallet is being created, you may use [`react-promiseful`](https://github.com/moxystudio/react-promiseful) to help you with that. You will find an example in the [`<IdmWalletProvider>`](#idmwalletprovider) API documentation.\n\nThen, you may use `connectIdmWallet` to connect a component to a IDM Wallet:\n\n```js\n// App.js\nimport React from 'react';\nimport { connectIdmWallet } from 'react-idm-wallet';\n\nconst App = ({ locked, onLock }) => (\n    <div>\n        <p>Locked: { locked }</p>\n        <button onClick={ onLock }>Lock wallet</button>\n    </div>\n);\n\nconst createMapWalletToProps = (idmWallet) => {\n    const onLocked = () => idmWallet.locker.lock();\n\n    return () => {\n        locked: idmWallet.locker.isLocked(),\n        onLock,\n    });\n};\n\nexport connectIdmWallet(createMapWalletToProps)(App);\n```\n\n\n## API\n\n- [`<IdmWalletProvider>`](#idmwalletprovider)\n- [`connectIdmWallet(createMapWalletToProps, [options])`](#connectidmwalletcreatemapwallettoprops-options)\n- [`createIdmWalletObservable(idmWallet)`](#createidmwalletobservableidmwallet)\n\n### IdmWalletProvider\n\nThe `<IdmWalletProvider>` makes a IDM Wallet available to any nested components that have been wrapped in the `connectIdmWallet()` function.\n\nSince any React component in an app can be connected, most applications will render a `<IdmWalletProvider>` at the top level, with the entire app's component tree inside of it. You can't use a connected component unless it is nested inside of a `<IdmWalletProvider>`.\n\nBecause the creation of the wallet via `createIdmWallet` is asynchronous, we recommend using  [`react-promiseful`](https://github.com/moxystudio/react-promiseful) to conditionally render a loader while creating, a error if the creation failed or the `<IdmWalletProvider>` if succeeded. Here's an example:\n\n```js\nimport React, { Fragment } from 'react';\nimport ReactDOM from 'react-dom';\nimport createIdmWallet from 'idm-wallet';\nimport { IdmWalletProvider } from 'react-idm-wallet';\nimport { PromiseState } from 'react-promiseful';\nimport App from './App';\n\nReactDOM.render(\n    <PromiseState promise={ createIdmWallet() } delayMs={ 500 }>\n        { ({ status, value }) => {\n            switch (status) {\n            case 'pending': return <div>Creating wallet...</div>;\n            case 'rejected': return <div>Oops, unable to create wallet: { value.message }</div>;\n            case 'fulfilled': return (\n                <IdmWalletProvider idmWallet={ value }>\n                    <App />\n                </IdmWalletProvider>\n            ) }\n        } }\n    </PromiseState>,\n    document.getElementById('root')\n);\n```\n\n#### Props\n\n##### idmWallet\n\nType: `object`\n\nThe [idmWallet](https://npmjs.org/package/idm-wallet) instance to use in your app.\nInternally, [`createIdmWalletObservable()`](#createidmwalletobservableidmwallet) will be used to observe changes to IDM Wallet's data.\n\n##### children\n\nType: `Node` (any React's node)\n\nWhat to render as the children.\n\n### connectIdmWallet(createMapWalletToProps, [options])\n\nThe `connectIdmWallet()` function connects a React component to a IDM Wallet instance, by providing the connected component with the pieces of the data and functions it needs from the IDM Wallet.\n\nIt does not modify the component class passed to it; instead, it returns a new, connected component that wraps the component you passed in. Moreover, any ref will be automatically forwarded to the component you passed in.\n\n#### createMapWalletToProps\n\nType: `function`\n\nA factory that creates a function that maps any data or functions from a IDM Wallet to props that will be passed to the wrapped component. **From now on**, we will call the factory and the returned function **`createMapWalletToProps`** and **`mapWalletToProps`** respectively.\n\n```js\nconst createMapWalletToProps = (idmWallet) => (ownProps) => ({});\n```\n\nYour `createMapWalletToProps` will be called once per `idmWallet` instance, which usually does not change.\n\nIf your `mapWalletToProps` function is declared with `ownProps`, it will be called whenever any data on the IDM Wallet changes or when the wrapper component receives new props (based on shallow equality comparisons). On the other hand, if the function is declared without any parameter, it will be called only whenever any data on the IDM Wallet changes.\n\nAll calls to functions of the `idmWallet` must be bound, so that the correct `this` is used. This means that you will often wrap them to keep the binding. For that reason, it's **important to declare them in the factory** to avoid creating new functions everytime `mapWalletToProps` runs, thus avoiding unwanted re-renders:\n\n```js\n// ❌ Incorrect: `onLock` prop will be new everytime\nconst createMapWalletToProps = (idmWallet) => (ownProps) => ({\n    locked: idmWallet.locker.isLocked(),\n    onLock: () => idmWallet.locker.lock(),\n});\n\n// ✅ Correct: `onLock` prop will have the same reference everytime\nconst createMapWalletToProps = (idmWallet) => {\n    onLock = () => idmWallet.locker.lock();\n\n    return (ownProps) => {\n        locked: idmWallet.locker.isLocked(),\n        onLock,\n    };\n});\n```\n\n##### promises\n\nAny mapped functions in `mapWalletToProps` that returns a promise will have a method called `.cancel()` in the promise itself. Calling this method will ignore the outcome of promise, causing it to never be resolved. This method should be called when unmounting your component and similar cenarios to guarantee unnecessary errors and side-effects, such as:\n\n> Warning: setState(…): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component.\n\nYou may check [cancel.it](https://github.com/Eazymov/cancel.it) documentation to know more.\n\n#### options\n\n##### options.pure\n\nType: `boolean`   \nDefault: `true`\n\nAssumes that the wrapped component is a \"pure\" component and does not rely on any input or state other than its props and the mapped props from the IDM Wallet. Several equality checks are performed to avoid unnecessary calls to `mapWalletToProps` as well as to bail out on unnecessary renders.\n\n### createIdmWalletObservable(idmWallet)\n\nCreates an observer with the ability to watch changes of `idmWallet`. Those changes are captured by adding listeners to the `idmWallet`, such as `idmWallet.locker.onLockedChange(listener)`, and by wrapping functions that mutate underlying data, such as `idmWallet.locker.lock()`.\n\nNote that the same observer will be returned for the same `idmWallet`.\n\n### idmWallet\n\nType: `object`\n\nThe [idmWallet](https://npmjs.org/package/idm-wallet) instance to observe.\n\n### Returned observer\n\nThe observer returned by `createIdmWalletObservable()` is an object with the following methods:\n\n#### subscribe(fn)\n\nSubscribes to changes to the IDM Wallet, returning a function that unsubscribes when called.\n\n```js\nconst observable = createIdmWalletObservable(idmWallet);\n\nconst unsubscribe = observable.subscribe(() => {\n    console.log('changed!');\n});\n```\n\n#### unsubscribe(fn)\n\nUnsubscribes a previously added subscriber.\n\n#### cleanup()\n\nResets the IDM Wallet to its original state if there are no subscribers left, removing the previously added listeners and wrappers from the `idmWallet`.\nThe next call to `subscribe()` will add the listeners and wrappers to the `idmWallet` again.\n\n\n## Tests\n\n```sh\n$ npm test\n$ npm test -- --watch # during development\n```\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","readmeFilename":"README.md"}