{"_id":"@cogitojs/cogito-web3-provider","_rev":"4-42e28a05c0af53b44cce1a2474753a11","name":"@cogitojs/cogito-web3-provider","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.19":{"name":"@cogitojs/cogito-web3-provider","version":"0.2.19","description":"An Ethereum web3 provider that signs transactions with the Cogito app","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/telepath-js":"^0.2.19","web3":"^1.0.0-beta.36"},"devDependencies":{"lodash":"^4.17.11"},"publishConfig":{"access":"public"},"gitHead":"e1e293e20c36b248606cc79820652e5336c856dc","_resolved":"","_integrity":"","_from":"file:cogitojs-cogito-web3-provider-0.2.19.tgz","_id":"@cogitojs/cogito-web3-provider@0.2.19","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"everydayproductive","email":"marcin@everydayproductive.com"},"dist":{"integrity":"sha512-VzE/RIBZlFf53FFKPStXqQGwkdcLsFLEFPvU6CGLLT9908mCQ8zTKfi8nk030fTtzE6/er+Rh9aI+AUXxzdR1w==","shasum":"3419b42a17c7eb2ac386ec3e7e6881304e0bfe7b","tarball":"https://registry.npmjs.org/@cogitojs/cogito-web3-provider/-/cogito-web3-provider-0.2.19.tgz","fileCount":43,"unpackedSize":109490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM4QGCRA9TVsSAnZWagAAE3sQAJWGgEv/TiQwplY19H3l\nAmJeAs1YaFFONXGkFR6vKE75mxjXwAs9ApkvWDmHOKucGNFgnnbhvCuw5LtZ\ni2MCzZPeNBVeV34FQ4ke0dlWvI4bXxuI7ZgZqBsg3uFOgD1UbaFU4wjvSUh5\noet+fJuaD8AVbJi1dbhy7729b5GqD3nnhI5zLDlq0Ausabc04Tkv1PUSc9DC\nxdcdjub3QExMa/tAycg15AKiB417zchxnNqW7lhEUdrEoX88Os45hg4RdOXJ\nVjwHTXP1OtwL836QVvsaAZx95TXThCXlK3kRUQU4fWbdJmpK5sz3kfOgq5t4\n2bJOOwIsJB91hdj8rB4hPTGMDeMn9y3oocbi5WOcwZh+DlIo2K+VVH4Gw8yz\ndElsEICMgEOyPYRq7NqfXbw2GhHqCoiOJhSdOEHV3ClSnE5t1mMn0t8HORVg\n7BkPUJ+9lxdppMAg0oKCAu6trN5BzbXzIlDR08C/qexuxLdZ6P89AtGpkdfa\nox3a2k7Fqc1VHOyU/ADnTTy2ZAmWLMgI1ARDDwWWxq7fzYh1FixCqMcLnWws\nQ1vgYbbOPcyUS15JVhTjXVFfxKgc/KJqeRlYsvWn4MSPW90ONBHqD78xQw3d\njGKJ1Z9Wg43MGzCziJ4gRfIQlYL79niF/gcI0CNL6apdtiE/l3YLBDyKIYc1\nIMAc\r\n=SYEA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuKfYs5egLO2AWAoFDJ+JjBS1aatcerboECSPxbMe6ZAiEA2Bwpgwe/C/2mgS99SvIvJmopNFErJhuAdnTdwHdrY68="}]},"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-web3-provider_0.2.19_1546880005583_0.7988552658469568"},"_hasShrinkwrap":false},"0.2.23":{"name":"@cogitojs/cogito-web3-provider","version":"0.2.23","description":"An Ethereum web3 provider that signs transactions with the Cogito app","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/telepath-js":"^0.2.23","web3":"^1.0.0-beta.36"},"devDependencies":{"lodash":"^4.17.11"},"publishConfig":{"access":"public"},"gitHead":"558949fc0d06f7d63e451c85dcb8fb6594c7cf71","_resolved":"","_integrity":"","_from":"file:cogitojs-cogito-web3-provider-0.2.23.tgz","_id":"@cogitojs/cogito-web3-provider@0.2.23","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"everydayproductive","email":"marcin@everydayproductive.com"},"dist":{"integrity":"sha512-mL+Ldh1/RzhMEjsbhbYTF+/GkjeZkCnGacfdb3CfIEXu2fmmFFtGWPxsbLG/Kc9DqWgE6JvOmz+FDb5Es6oOCw==","shasum":"8dde59d36a008f4e00d6c383a743c5c03f73d296","tarball":"https://registry.npmjs.org/@cogitojs/cogito-web3-provider/-/cogito-web3-provider-0.2.23.tgz","fileCount":43,"unpackedSize":99278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVFeGCRA9TVsSAnZWagAA/80P/1QvQRv49S0NT/rwVHRb\n1CPGDI8Vf5Z4Yq2VVujSgGqnLgi1Z0OzJOk+XSU5pHXPRChW+Kpy3K/DxBJ5\nSZrWXwprCuWFRmAfY6TwWym4pt1SvtUsWPPkQyqRqbA0FpPKSvki6xSIZJ1l\ngDl9MfrtszWJHLqbGJMEi5+c7D01I+aDuvH5hU3wELnOnnRLETWFGWqcY7Ya\n44bXrOCiFl9KGaZ83IkjV+RPAy0o3vFohYzC2LM90WIgiztHxnWAr4Iso7nG\nMjTTM9Dq3c69iLI/L5nOZ79JeJ3qBrVWiBougEPH33qdDI2Zid7XRhnAg+Y9\nScI018Smii2LJtcjdCxM/AQ/KCLO9Awv7B66TdoDy3PQb4WKDPU3T4M3pjFV\ncSxLc1zVtZjnE5cgFX7CHaswkaqz/NSRMghXEeNPTqVohAOVcDXW5zb2Knh/\n6eQRIaaHirypyVWa9d7/Y/LQG/g8HzjXm28lk+hrD4BrS5uJ0OEvAu987zLI\nRoIpEfq5Vd+XAmeA+otWcZ7axfW1B7vbeKKnfC6hmGeTVD9th70xPNoaNPwO\nNnIwp9F/QpmKghxmIT/xTwiaZzTuTwW+sUe/giMLo4fam098MUtTBOi2TO/c\nfW20Aof7wFg19+wa4ROxMNkg5B5s4DvxJxOXrX1c34azAEhhVgFSNqMcHTaH\nsEK3\r\n=/+Xb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkf3vdNx3Su9eCZmIgFiGyPEXEwNBxrZJYuR6kQ6Q0XAiEAqMJ88DaiUQtgymJKtFHyCIqtPoVCU7vB+nLht3bVBPY="}]},"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-web3-provider_0.2.23_1549031301464_0.9325781377012679"},"_hasShrinkwrap":false},"0.3.0":{"name":"@cogitojs/cogito-web3-provider","version":"0.3.0","description":"An Ethereum web3 provider that signs transactions with the Cogito app","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/telepath-js":"^0.3.0","web3":"1.0.0-beta.36"},"devDependencies":{"lodash":"^4.17.11"},"publishConfig":{"access":"public"},"gitHead":"e6dfe2f2da5877de36fde1e9267096bc030b8d0d","_id":"@cogitojs/cogito-web3-provider@0.3.0","_nodeVersion":"11.13.0","_npmVersion":"lerna/3.13.1/node@v11.13.0+x64 (darwin)","dist":{"integrity":"sha512-dvAQMwZiSgiWzGFsvX2MfU3qVNcNUsKC9VSDWKqBmoLfhlJ9lK3x8f68m7Og7mHgiTGZDp2IVzDeRtnx+CxPEw==","shasum":"4203f1c9e9152aba6cb5eb34e41f55d285d77068","tarball":"https://registry.npmjs.org/@cogitojs/cogito-web3-provider/-/cogito-web3-provider-0.3.0.tgz","fileCount":43,"unpackedSize":100247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwBGeCRA9TVsSAnZWagAAP1gP/0NkZPiGr3wyMk6bHl/N\nGlW6YFPKRJFTh/N6XHUMbvWBoZAdUMoxMhzsTbUptrNWclrUeDete8mLHMyG\nHfNHqcK5WRCmLG2gc44EL0o8p11R/k9YRtFcWvUNK6QDPhzladYol7UM+xNg\nPEpV+NZcQTi8/tdPgv0xzgE/Z8kgPAk7BUDdUCnPDm4DKhV2gsc/YfkVWGL1\nXwgPPNhbFr8E1kaaamQTP6Xb1dwUl2S+D4ZUVuQQLWT58rG8yQB8kDNxPP8v\nVqCtTI9JnR3jydkRlm5YkKSYQwB+T2ASxtRaHl0FHCfTssAgmJ/yT8IedWYP\nbQE1aYeuhDyut1dKrYpHH/u3UDwB3zuWacP0YM72uP308eBp9Y4IgfGAQOu6\nTHWaB/jmVFBp8nRQREHYWtyZ5K4/hwkWSk1Zf/soxjVk/zxUmR5aR1rWezrH\ncuqHYjHGdC+P4AP/s0fFbb5PdXjg3ugsTaa5QYt+w8ebogGMLj3bPiBs8whz\nhQAmt/dLI51PwBpUP9uHiO3RLkb9UIA7zOWpUuAXQoie6mpaYLUAhfMDtcC9\nmxFGtmA63mAxCxjT4RtX5UGw506XuVX9gVNWvidgV5RbCVxC/oz4+ApgF1Xo\nEchk6RUDpbNbVketm/a3hYpIowxQnnSU8meB2aNhvbRvnib03pGzZ9AYFK6d\n0Wgq\r\n=7h6D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjCPFuoA8yN7S8n0VIW4UT8mRvvghxaBCo4YfEWzx10QIhAIctHwsF+B6wzodWiNuczE3LKnanTHZEKJhqVKs8McQC"}]},"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-web3-provider_0.3.0_1556091293447_0.04818610005215129"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-07T16:53:25.498Z","0.2.19":"2019-01-07T16:53:25.690Z","modified":"2022-04-05T00:11:08.728Z","0.2.23":"2019-02-01T14:28:21.571Z","0.3.0":"2019-04-24T07:34:54.101Z"},"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":"An Ethereum web3 provider that signs transactions with the Cogito app","homepage":"https://cogito.mobi","license":"MIT","readme":"# @cogitojs/cogito-web3-provider\n\nAllows you to sign transactions on an Ethereum network using the Cogito mobile\napp. This is a fairly low-level component for those who are already familiar\nwith Ethereum and the [Web3] api. A higher level abstraction for working with\nEthereum and smart contracts is provided by the [Cogito\nEthereum][@cogitojs/cogito-ethereum] package.\n\nCogito Web3 Provider intercepts some of the standard [Web3] requests and\nredirect them to the Cogito mobile app using a [telepath] channel.\n\n![Transaction Signing Sequence](images/sign-transaction.png)\n\n## Usage\n\nAdd `@cogitojs/cogito-web3-provider` as your dependency:\n\n```bash\n$ yarn add @cogitojs/cogito-web3-provider\n```\n\n[Web3] delegates the actual sending of the requests to the so called providers.\nA valid web3 provider is required to provide one function: `send(payload,\ncallback)`. It often provides other functions (e.g. allowing web3 to poll for\nthe connection status) but in principle, the `send` function is the one that is\nstrictly required. `@cogitojs/cogito-web3-provider` provides such a provider as\nits only top-level abstraction: `CogitoProvider`.\n\n`CogitoProvider` requires two arguments when creating: the original provider\nand the telepath channel. The example below shows how to use `CogitoProvider`\nwith `Web3` and `Telepath`:\n\n```javascript\nimport { Telepath } from '@cogitojs/telepath-js'\nimport Web3 from 'web3'\nimport { CogitoProvider } from '@cogitojs/cogito-web3-provider'\n\nconst telepath = new Telepath('https://telepath.cogito.mobi')\nconst telepathChannel = await telepath.createChannel({ appName: 'Tutorial' })\n\nconst providerUrl = 'http://localhost:9545' // example for the local development\nconst originalProvider = new Web3.providers.HttpProvider(providerUrl)\nconst web3 = new Web3(\n  new CogitoProvider({ originalProvider, telepathChannel })\n)\n```\n\nFrom now on, `CogitoProvider` will check if the incoming request should be\nredirected to telepath (and then in turn to e.g. the Cogito mobile app) or if\nit should be handed over to the original provider.\n\nCurrently, `CogitoProvider` redirects two types of requests to telepath:\n[eth_accounts] and [eth_sendTransaction]. All other requests are forwarded to\nthe original provider.\n\n[@cogitojs/cogito-ethereum]: https://cogito.mobi/components/cogito-ethereum\n[Web3]: https://github.com/ethereum/web3.js\n[telepath]: https://cogito.mobi/components/telepath-js\n[eth_accounts]: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethaccounts\n[eth_sendTransaction]: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction\n","readmeFilename":"README.md"}