{"_id":"@cogitojs/cogito-ethereum-react","_rev":"5-71e4b2919ec22b6a4f8fc57f28c99c98","name":"@cogitojs/cogito-ethereum-react","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.19":{"name":"@cogitojs/cogito-ethereum-react","version":"0.2.19","description":"Cogito Ethereum React library","homepage":"https://cogito.mobi","license":"MIT","main":"lib/index.js","module":"es/index.js","scripts":{"build":"node ./tools/build.js"},"engines":{"node":">=9.0.0"},"dependencies":{"@cogitojs/cogito-ethereum":"^0.2.19","libsodium-wrappers":"^0.7.2","truffle-contract":"^3.0.5","web3":"^1.0.0-beta.36"},"peerDependencies":{"prop-types":"^15.6.2","react":"^16.6.3","react-dom":"^16.6.3"},"publishConfig":{"access":"public"},"devDependencies":{"react-testing-library":"^5.3.0"},"gitHead":"e1e293e20c36b248606cc79820652e5336c856dc","_resolved":"","_integrity":"","_from":"file:cogitojs-cogito-ethereum-react-0.2.19.tgz","_id":"@cogitojs/cogito-ethereum-react@0.2.19","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"everydayproductive","email":"marcin@everydayproductive.com"},"dist":{"integrity":"sha512-6OTuE0/ouOtqpIfTHdp7jKto0kRJ/invSeB+sqZlQAaZeO3KA8qJA1aT2+A/GBfGJ7Zdlc6C7rFI9TdLUX3O3w==","shasum":"730bf04741488c3b291d5e9a95dd0ad2e49ff7f3","tarball":"https://registry.npmjs.org/@cogitojs/cogito-ethereum-react/-/cogito-ethereum-react-0.2.19.tgz","fileCount":21,"unpackedSize":80075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM4QRCRA9TVsSAnZWagAA48AP/jVcc61+2JGKRmdEh6bJ\nJZ9edxnKFXuc8j15DmRCPr1EogscjWhI0ygLBsHHgeQ6LhUloGBWKBPs71Ba\nLO2KRAvqOjhqJxxAZ1r5iDyV7QBYtDohfUpPJ87OZ9oWxnCIVd9Sdz3UEI0o\n7qw1WjFUmCDmGotl836aQZj/sxeWiLEl2euOmsA2+kp+Z6fGqWCSnce2+WcF\nHNfaoyeLesjkZX6NEeiI3Rcie6ZgcpRN5XGWUhgRK1Y32/xCjqAzqppgiFWU\nif1A9yzJXWZaUCZraZmxc6S8qmYnciWZzun5dOxrONu7r48vGXZjHajKhIPN\nvzkq2GnvTEbg1wkD3qNoX/mG0rzDoBBBy/ldP8tXt9OV4knWnZwlSelLocTM\nRuHa4ws/044pBF/eRyG1ZGcf2AgSFifjD4LI7W23yG9107ELCWbsdHDiPYTQ\n5IC5I4Cvlld7yFwzHUjt+KVsA7gP2JlGkFpPBQKWUZN/L1+r3EvyAhNaNzgX\nQNUvKphFPKKOoLzmL8btVPPvxt5PM7VRze5Tuu+kT9roH5wtE9LUPgZ04KNh\nkhRc05gSvxN8YjOENgwfFI1VB5gwB9y31AaNCQndMlsyOTov8yl89wDtji98\ndqmLCuENB3vlwNp1R7tV0apYEJiaapbtdBzYrc1YVFwhXLXOMs5JhCjPu6oz\npFyg\r\n=NY6p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5pi3uj/7NMTb80V09yTTI6b6XKVwgG0sx0cFAA+rgvQIhAOW/oO9xYVmNw9W8Fyzf3qYKYO0xiZBtTbYrPkC43pzU"}]},"maintainers":[{"name":"everydayproductive","email":"marcin@everydayproductive.com"},{"name":"markspanbroek","email":"mark@spanbroek.net"},{"name":"jeroenknoops","email":"jeroen.knoops@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cogito-ethereum-react_0.2.19_1546880017269_0.5120043658088531"},"_hasShrinkwrap":false},"0.2.22":{"name":"@cogitojs/cogito-ethereum-react","version":"0.2.22","description":"Cogito Ethereum React library","homepage":"https://cogito.mobi","license":"MIT","main":"lib/index.js","module":"es/index.js","scripts":{"build":"node ./tools/build.js"},"engines":{"node":">=9.0.0"},"dependencies":{"@cogitojs/cogito-ethereum":"^0.2.19","libsodium-wrappers":"^0.7.2","truffle-contract":"^3.0.5","web3":"^1.0.0-beta.36"},"peerDependencies":{"prop-types":"^15.6.2","react":"^16.6.3","react-dom":"^16.6.3"},"publishConfig":{"access":"public"},"devDependencies":{"react-testing-library":"^5.3.0"},"gitHead":"8fa5d205ad6736a4d015ae7954c723133ae915d1","_resolved":"","_integrity":"","_from":"file:cogitojs-cogito-ethereum-react-0.2.22.tgz","_id":"@cogitojs/cogito-ethereum-react@0.2.22","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"everydayproductive","email":"marcin@everydayproductive.com"},"dist":{"integrity":"sha512-uPGx6kw3Nwwt42Var45oe44fG1AvEfjS1f4jTdVLR2V9fIqM7HBsDYqwu+XtkzX+PJHPiGFfJHrJju1ECYa9bg==","shasum":"751f308c24a108abcc69013ed01d5cd6d40d0bd5","tarball":"https://registry.npmjs.org/@cogitojs/cogito-ethereum-react/-/cogito-ethereum-react-0.2.22.tgz","fileCount":21,"unpackedSize":97727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcU26fCRA9TVsSAnZWagAAf5UP/0YbKC+nTJ09xOV/7pRM\nRrIrLyzWNbTZ7QjKRCHv27DbRdGbwC+WukbuV1WikK/1Ctt2HS8AzlBkD0cC\nKTS2b0SUHzMyckjeNBnH23oRYj4HMFHbLNXsxjB/y0jXCWYhr8NUTEzCitp+\nnpDcKk3+a+On/GM/XKt7lzXX3YkP7phDwF3/hdaF/ayBguWh4qTVidmERv9e\nMBsT3AiX0WKmdRBhE7P2LPUhD8YW3Vn8ShbdgldqMBtI6HM5ihUB8RCNiLBZ\nI47Wj+IBp4Hp3faohPETlic8ACpIQdq8VYufCsewqednOUkfY3qwXiL5uHIB\nSynQMOyEIhclzsdBJF35iPAVEN8uAo1PmSzMZiT5gqfoeZA0RhQRLpFyLXSp\nD4BKzBGitc3QUFMNaxhNIZyBAIXukVPFPNHZ1bI+CIonWYctXZ14XWSB/wU2\n8tX+Nf7xTUAlvkk/YoQ8PXcoHI4sCR3l51rUrNCRfILLFeWlyTHo9B/8Ruoj\nNzUcJftJa3Fj6t61mLj9Ss6QcjM4XWrBOogQt6bb3YVfvmOEb3pIgGFpdMT1\nwRdX70mtWkvu0UFZn3jSeucPNd10P7T3pVuPqSUTxPvSACMy7npuschUGKmz\nnrvzeFOD0dSWbNS4uZjPj5vGTYDKA396zAcVdhhZcV6Cs01dQZD1dIM88e/V\n3Q87\r\n=+Tv0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXh3V2LNq/+oPDkPjXf6eYRccrk5cImBaXE9uojLYMfAIgDVGpMXy0kePp1wPwx3xoy3Bfd2VyjFP4cFfcyZagCiw="}]},"maintainers":[{"name":"everydayproductive","email":"marcin@everydayproductive.com"},{"name":"jeroenknoops","email":"jeroen.knoops@gmail.com"},{"name":"markspanbroek","email":"mark@spanbroek.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cogito-ethereum-react_0.2.22_1548971679390_0.5369124311760851"},"_hasShrinkwrap":false},"0.2.23":{"name":"@cogitojs/cogito-ethereum-react","version":"0.2.23","description":"Cogito Ethereum React library","homepage":"https://cogito.mobi","license":"MIT","main":"lib/index.js","module":"es/index.js","scripts":{"build":"node ./tools/build.js"},"engines":{"node":">=8.0.0"},"dependencies":{"@cogitojs/cogito-ethereum":"^0.2.23","libsodium-wrappers":"^0.7.2","truffle-contract":"^3.0.5","web3":"^1.0.0-beta.36"},"peerDependencies":{"prop-types":"^15.6.2","react":"^16.6.3","react-dom":"^16.6.3"},"publishConfig":{"access":"public"},"devDependencies":{"react-testing-library":"^5.3.0"},"gitHead":"558949fc0d06f7d63e451c85dcb8fb6594c7cf71","_resolved":"","_integrity":"","_from":"file:cogitojs-cogito-ethereum-react-0.2.23.tgz","_id":"@cogitojs/cogito-ethereum-react@0.2.23","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"everydayproductive","email":"marcin@everydayproductive.com"},"dist":{"integrity":"sha512-7RvP89dzbAvr0JBgARhG81raesMoXuRbr3RNBtUkKp82BsbugfnOEsrl4Ho2x3dilDpv6iatWL649CFcMffybA==","shasum":"eab6e0ccfbd5cf7cb3c8ac5522337ac61810f35e","tarball":"https://registry.npmjs.org/@cogitojs/cogito-ethereum-react/-/cogito-ethereum-react-0.2.23.tgz","fileCount":21,"unpackedSize":95379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVFeTCRA9TVsSAnZWagAAqy0P/1Z9VptUf0ut3FdMw0ho\nXA4uHr1mEJihPwTpZLEt2XXlzwuHHSSMK3ZSXB3bJuf5L1kDkjam+Wv76UvB\nzVVT9xr9OrWhZygSyKB+K9n9FDHJDKbh5LnJLV7ymWg/qh/GkgfjaXwf/hb5\ngAtwoTsN1y4fo3vYTyHEh8QrYxF2YBzo/MSUsbkCV9LuYvlRAqXIPhvIbCD9\nXRDJYu3xxENpM+1XwsFSzn+lOXyBLdI0Gv1y58ynWXEl6bx67AljSe8l1riB\nzPdqxzKGNuW4Sp/4rFXKwDWSJrdOkDkjm5gaADqh99UBVbcLMAxH9eW4BX30\n0HMldtGNTGlEepYeP6uk/dZf2F/wXRwCf2z1pQvgbWH0cOFqQA1j3tx5rwbx\nVHYMO9iHrbvWwya8itXYxVX95r5FP1h7gcGw5TH5CBtdotJxs4INujj0YOpJ\n27sEXOYNXfuqGZiG2vS738wuep1JBfnWHusUPrH0eOmNUiCU2bY53nh18nyM\nbvwdXjChe+RDH3TVtWTCpf3qCqR2bPJ1bMsLqnKjLvpMJyT4d9y4enogd3VT\nfWj7FtOVoKWTxwN/XutcD8+H7PwjrY4rJhUOXLE/Nm8W3ghXE6t3/fgV+uXG\nvdnPc29JmijACLGSMwJykuMq0BAtpHQ13+Q+NYJgx4TLUQ3OI4xysuZbKV9A\nLu+d\r\n=C3Cw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCohIH7S3bFXPgkcbFMtfqHBZV9KkUErBFKwR3DTZzSaQIgAuYVe3BuzpfVE39IL4TarJ0iakTsBnKtvTZJ457Pn9c="}]},"maintainers":[{"name":"everydayproductive","email":"marcin@everydayproductive.com"},{"name":"jeroenknoops","email":"jeroen.knoops@gmail.com"},{"name":"markspanbroek","email":"mark@spanbroek.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cogito-ethereum-react_0.2.23_1549031314731_0.1712575334450226"},"_hasShrinkwrap":false},"0.3.0":{"name":"@cogitojs/cogito-ethereum-react","version":"0.3.0","description":"Cogito Ethereum React library","homepage":"https://cogito.mobi","license":"MIT","main":"lib/index.js","module":"es/index.js","scripts":{"build":"node ./tools/build.js"},"engines":{"node":">=8.0.0"},"dependencies":{"@cogitojs/cogito-ethereum":"^0.3.0","libsodium-wrappers":"^0.7.2","truffle-contract":"^3.0.5","web3":"1.0.0-beta.36"},"peerDependencies":{"prop-types":"^15.6.2","react":"^16.6.3","react-dom":"^16.6.3"},"publishConfig":{"access":"public"},"devDependencies":{"react-testing-library":"^5.3.0"},"gitHead":"e6dfe2f2da5877de36fde1e9267096bc030b8d0d","_id":"@cogitojs/cogito-ethereum-react@0.3.0","_nodeVersion":"11.13.0","_npmVersion":"lerna/3.13.1/node@v11.13.0+x64 (darwin)","dist":{"integrity":"sha512-Xh8Y7g1h5yFwKsqTgoc7Zmxb0nfrM+HkExT3VVDLf6TP8ABOM9adCQ0n/nyDK6Xpk/dPkmAOEsdPvzxdc/4f5A==","shasum":"b493cb8ce85e30a915e0f562aecf740a8e55cccc","tarball":"https://registry.npmjs.org/@cogitojs/cogito-ethereum-react/-/cogito-ethereum-react-0.3.0.tgz","fileCount":22,"unpackedSize":94856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwBGmCRA9TVsSAnZWagAA3zMP/0gY0FD3FLFLwa7t1fAu\nYdIj/QxCZ9/0lRdIaEtHn9QvTywSzih5KHjbWhEXxptbW5Gr7cZDyAsUtSrX\nM2jKzSpdG8r0hhK+YjXWEG3Fzk8a2PnMEMwuyUjd7lVSnhVwmw+tw5OHlxv4\nwMdOZVSxYC7MMW8YRnCDK/L9C+7E1VSp9W70kvGNqTUCEcRIKQh0jZ8JjhSV\n2vMjTykocCD8t0HFePI68J1urlhlj1rtovLov1hKNncJQmWXKr5q2bUTjYQi\niiRdft8IMw+gIUVFSNjakrcePxb5W7b+sZtl0UHpfsWa6kH0ZE9XEtY7yUyh\nSA7Wxej1/G70ZNPtCkjQx1D90RdNy4ozIcCgimdbHwHF7/i0+3r44rQTw/9u\nM9Hk2iItsb9u0FafF44qIS0+NAvuw84LrKwV/B5bJy7Dhu/FSHIX1eoOXmn2\nWAiiR4LPOWPrc9Fs3fFyUFnJndfWoT9Dj509hVOL9E1rOzm5GpozxtPvBGZ7\nH2KUOargYJH2OCefnqLGNgzNDle8eDkO299K0hEqe5pXZf4T4LL6CzpEsShZ\ndm0aWKhpsxNFXOmav5K4gbF4GhsvXCHIQT+gXY7UAPxJv38rhSLMyEZvwuKD\noytdWVlQeK0ASOedi3mq8iZmcGVMMdAW+okyKMfLf6sCAaHHsSKOcjR+5p4W\nVoty\r\n=V/cC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1Yz5VU5Ohv8JdR4aBRhtRXoPedaPEpLsb/iAw2BGPuAiEA43rY8G4NbuyN+RQ4ncFDUBrVgnREORjTuE8Qxpi3QR4="}]},"maintainers":[{"email":"marcin@everydayproductive.com","name":"everydayproductive"},{"email":"jeroen.knoops@gmail.com","name":"jeroenknoops"},{"email":"mark@spanbroek.net","name":"markspanbroek"},{"email":"philips-software@philips.com","name":"philips-software-fa"}],"_npmUser":{"name":"jeroenknoops","email":"jeroen.knoops@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cogito-ethereum-react_0.3.0_1556091302147_0.8598303014800412"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-07T16:53:37.181Z","0.2.19":"2019-01-07T16:53:37.420Z","modified":"2022-04-05T00:11:07.299Z","0.2.22":"2019-01-31T21:54:39.547Z","0.2.23":"2019-02-01T14:28:34.874Z","0.3.0":"2019-04-24T07:35:02.273Z"},"maintainers":[{"email":"marcin@everydayproductive.com","name":"everydayproductive"},{"email":"jeroen.knoops@gmail.com","name":"jeroenknoops"},{"email":"mark@spanbroek.net","name":"markspanbroek"},{"email":"philips-software@philips.com","name":"philips-software-fa"}],"description":"Cogito Ethereum React library","homepage":"https://cogito.mobi","license":"MIT","readme":"# @cogitojs/cogito-ethereum-react\n\nProvides a React component that allows interaction with smart contracts on an\nEthereum blockchain using the Cogito app. It provides the same functionality as\nthe [Cogito Ethereum][@cogitojs/cogito-ethereum] package in a React friendly\nway.\n\n## Usage\n\nAdd `@cogitojs/cogito-ethereum-react` as a dependency:\n\n```bash\nyarn add @cogitojs/cogito-ethereum-react\n```\n\nand import it:\n\n```javascript\nimport { CogitoEthereumReact } from '@cogitojs/cogito-ethereum-react'\n```\n\n## Props\n\nThe `CogitoEthereumReact` component accepts the following props:\n\n| prop name | description  |\n|-----------|--------------|\n| contractsBlobs  | Array of contracts JSON blobs - see [Working with Contracts] for more details. |\n| channelId  | identifier of the Telepath channel. If omitted a new random channel id will be created. |\n| channelKey | a symmetric key of the Telepath channel. If omitted a new random key will be created. |\n| appName    | the name of the app. Cogito app shows the `appName` when requesting user signature. |\n| onTelepathChanged | function to be called when the telepath channel has been updated. Provides an object `{ channelId, channelKey, appName }` as an argument. |\n| render     | render prop - a function that will be called every time the component is updated. It provides `{ cogitoWeb3, telepathChannel, contractsProxies, newChannel }` as an argument, where `cogitoWeb3` is an instance of Web3 that uses [CogitoProvider], `telepathChannel` is an instance of [Telepath], and `contractsProxies` is an object holding the references to contracts proxies corresponding to the provided contracts JSON blobs (see [Working with Contracts] for details). `newChannel` is a function to change the current channel to a new one. This function will trigger calling the render prop (or child) function, which means the whole tree below it will be (re)rendered. If this prop is present, it will take precedence over the `children`. |\n\n## Example\n\nThe example below illustrates how to use the `CogitoEthereumReact` component:\n\n```jsx\nimport { CogitoEthereumReact } from '@cogitojs/cogito-ethereum-react'\nimport { SimpleStorage } from '@cogitojs/demo-app-contracts'\n\nclass Main extends React.Component {\n  web3IsReady = ({cogitoWeb3, telepathChannel, contractsProxies}) => {\n    return (cogitoWeb3 && telepathChannel && contractsProxies.SimpleStorage)\n  }\n\n  onTelepathChanged = ({ channelId, channelKey, appName }) => {\n    console.log('Telepath channel changed:')\n    console.log(`channelId: ${channelId}`)\n    console.log(`channelKey: ${channelKey}`)\n    console.log(`appName: ${appName}`)\n  }\n\n  render () {\n    return (\n      <CogitoEthereumReact contractsBlobs={[SimpleStorage()]}\n        channelId={channelId}\n        channelKey={channelKey}\n        appName='Cogito Demo App'\n        onTelepathChanged={this.onTelepathChanged}\n      >\n        {web3Props => {\n          if (this.web3IsReady(web3Props)) {\n            return (\n              <div>\n                <p>Ready!</p>\n                <button onClick={web3Props.newChannel()}>\n                  Change channel\n                </button>\n              </div>\n            )\n          } else {\n            return (\n              <p>Please wait...</p>\n            )\n          }\n        }}\n      </CogitoEthereumReact>\n    )\n  }\n}\n\nexport { Main }\n```\n\nIf you prefer using `render` prop, the `render` method would look like this:\n\n```jsx\nrender () {\n  return (\n    <CogitoEthereumReact contractsBlobs={[SimpleStorage()]}\n      channelId={channelId}\n      channelKey={channelKey}\n      appName='Cogito Demo App'\n      onTelepathChanged={this.onTelepathChanged}\n      render={web3Props => {\n        if (this.web3IsReady(web3Props)) {\n          return (\n            <div>\n              <p>Ready!</p>\n              <button onClick={web3Props.newChannel()}>\n                Change channel\n              </button>\n            </div>\n          )\n        } else {\n          return (\n            <p>Please wait...</p>\n          )\n        }\n      }} />\n  )\n}\n```\n\n[@cogitojs/cogito-ethereum]: https://cogito.mobi/components/cogito-ethereum\n[Cogito]: https://cogito.mobi/components/cogito-ethereum\n[CogitoProvider]: https://cogito.mobi/components/cogito-web3-provider\n[Telepath]: https://cogito.mobi/components/telepath-js\n[Working with Contracts]: https://cogito.mobi/components/cogito-ethereum#working-with-contracts\n","readmeFilename":"README.md"}