{"_id":"@anychain/core","_rev":"8-4db0b19d8d516bac7e75a623c97e267a","name":"@anychain/core","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@anychain/core","version":"0.1.0","description":"Blockchain data structure for Node.js","main":"dist/index.js","types":"dist/index.d.ts","files":["dist"],"repository":{"type":"git","url":"git@github.com:fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"license":"MIT","bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"keywords":["blockchain","typescript"],"devDependencies":{"@types/chai":"4.1.2","@types/mocha":"5.0.0","@types/node":"9.6.0","chai":"4.1.2","mocha":"5.0.5","ts-node":"5.0.1","tslint":"5.9.1","tslint-config-prettier":"1.10.0","typescript":"2.7.2"},"scripts":{"build":"tsc","test":"mocha -r ts-node/register src/**/*.test.ts","prepublishOnly":"yarn build"},"_id":"@anychain/core@0.1.0","dist":{"shasum":"1d56e5f66566dc35fc1ea4bc0eb1c2880eecb8e8","tarball":"https://registry.npmjs.org/@anychain/core/-/core-0.1.0.tgz","fileCount":12,"unpackedSize":8332,"integrity":"sha512-aHb3pCaW4mjITRUq/Mge0WjFQnMCa2QOQ0UegV0Q7fdTkEq4Do39MU/2OsM1Mg2kwB64jmX6vIgUP8+f6+qLBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCprVPemQtAqo9DwYQrykOhP1QIv7NU7NeI9i2NILvZzgIhAJKxoY/ExoSDYaOPdBCEzROsGjeE5GSJar4Jw0c/9yh2"}]},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"_npmUser":{"name":"fgladisch","email":"felix@felixgladisch.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.0_1522057322212_0.1789815118123419"},"_hasShrinkwrap":false},"0.1.1":{"name":"@anychain/core","version":"0.1.1","description":"Blockchain data structure for Node.js","main":"dist/index.js","types":"dist/index.d.ts","files":["dist"],"repository":{"type":"git","url":"git@github.com:fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"license":"MIT","bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"keywords":["blockchain","crypto","peer-to-peer","p2p","typescript"],"devDependencies":{"@types/chai":"4.1.2","@types/mocha":"5.0.0","@types/node":"9.6.0","chai":"4.1.2","mocha":"5.0.5","rimraf":"2.6.2","ts-node":"5.0.1","tslint":"5.9.1","tslint-config-prettier":"1.10.0","typescript":"2.7.2"},"scripts":{"build":"rimraf dist && tsc","test":"mocha -r ts-node/register src/**/*.test.ts","prepublishOnly":"yarn test && yarn build"},"_id":"@anychain/core@0.1.1","dist":{"shasum":"5b5ea9d18bd1be582f3e6a123599e277537c69cb","tarball":"https://registry.npmjs.org/@anychain/core/-/core-0.1.1.tgz","fileCount":13,"unpackedSize":10176,"integrity":"sha512-r2W6cH1YBBLu90QvofKnG6USySGRmN2/7Xjt2h3I44/swcJLlZua2g4Ky7RfjZ3XhpQtR1YKxesuVMzzJm6J4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJxa2o+aBTOhYdG/n4n19+l657xcnlidIbBEzNjGl9sQIhAIfPouRHI6JOcHp35TPKGVPaQr4vQj+CFBkFP2PHeN68"}]},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"_npmUser":{"name":"fgladisch","email":"felix@felixgladisch.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.1.1_1522067678599_0.39257044244887673"},"_hasShrinkwrap":false},"0.2.0":{"name":"@anychain/core","version":"0.2.0","description":"Blockchain data structure for Node.js","main":"dist/index.js","types":"dist/index.d.ts","files":["dist"],"repository":{"type":"git","url":"git@github.com:fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"license":"MIT","bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"keywords":["blockchain","crypto","peer-to-peer","p2p","typescript"],"devDependencies":{"@types/chai":"4.1.2","@types/mocha":"5.0.0","@types/node":"9.6.0","chai":"4.1.2","mocha":"5.0.5","rimraf":"2.6.2","ts-node":"5.0.1","tslint":"5.9.1","tslint-config-prettier":"1.10.0","typescript":"2.7.2"},"scripts":{"build":"rimraf dist && tsc","test":"mocha -r ts-node/register src/**/*.test.ts","prepublishOnly":"yarn test && yarn build"},"licenseText":"MIT License\n\nCopyright (c) 2018 Felix Alexander Gladisch\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@anychain/core@0.2.0","dist":{"shasum":"9c45c679b598f5dd349b93df92715ee5f6f3e5d5","tarball":"https://registry.npmjs.org/@anychain/core/-/core-0.2.0.tgz","fileCount":14,"unpackedSize":11043,"integrity":"sha512-eWvdBZi2f/t6qYANrJl6CIFQNbg9zY381QEkOhJtP1+18iDgKKezEtiDVTUPUQm/pjWzT21FzjRnKr7e/jPRZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDge/EUeuQXN3FKXje/uP4slfcpgiP2BtSCBUjKVHmPYgIhAMlQJRWhPsq2MqJGi49AsZZMW8pZ1qN+ey9Lvo6f0yne"}]},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"_npmUser":{"name":"fgladisch","email":"felix@felixgladisch.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.0_1522087803847_0.17888724187165383"},"_hasShrinkwrap":false},"0.2.1":{"name":"@anychain/core","version":"0.2.1","description":"Blockchain data structure for Node.js","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"license":"MIT","bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"keywords":["blockchain","crypto","peer-to-peer","p2p","typescript"],"scripts":{"build":"rimraf dist && tsc","test":"mocha -r ts-node/register src/**/*.test.ts","prepublishOnly":"npm run test && npm run build","lint":"eslint src --ext .ts"},"devDependencies":{"@types/chai":"4.2.21","@types/mocha":"9.0.0","@types/node":"16.6.0","@typescript-eslint/eslint-plugin":"^4.29.1","@typescript-eslint/parser":"^4.29.1","chai":"4.3.4","eslint-config-prettier":"^8.3.0","eslint":"^7.32.0","mocha":"9.0.3","rimraf":"3.0.2","ts-node":"10.2.0","typescript":"4.3.5"},"gitHead":"a946008d2197de4b11aa7e09130c50a627ea1e33","homepage":"https://github.com/fgladisch/anychain#readme","_id":"@anychain/core@0.2.1","_nodeVersion":"16.4.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-Yy1E/q0p1P5CgLxssIJE1lp8adCTsjxV3W50BXb5aE+Q7Cf1EDPYPPkFpbLJsJ8Wq20NHYf5D4fc4O7LAkD0Sg==","shasum":"17f3e8e871628f573f10096210819220d0ab00a1","tarball":"https://registry.npmjs.org/@anychain/core/-/core-0.2.1.tgz","fileCount":15,"unpackedSize":16261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFT0vCRA9TVsSAnZWagAALBwP/1Kq3BNpIkQW/Hip4/bH\nHj3M2JKqyOqDWTe6d121R5Tz5qkcFgpbSwG3sZONQc6CuEckJ+zl+3wqhaae\nrmGtqqFUKujlwEA6iZBWt0cSQ1cKLwzk0fjhZHJ3pu01/CuY7+Yl83HLTUE9\ngABPq9+sN/KPlqZRncB3cYlonVx4Ny9X69189ISLP0A+eRw1K7F7vW5q8ZFP\nyBtVJyJKp83CrAch7Dflx328QuylBtdF9fCXKvbv/XkDsCsq2ODqczgc7cQf\n/jRCb3COYdWr2e0+tJ2XE58Fiulwy+Np2fMMZODA4o9gbyTiw8kBmbv42XIN\nzrROG8YiU5WdbLELZRL4wk2vNgJKW0hlfqcm/Ztz6rSk8NFmsC0Aiso2uxwp\nDdcUoZcIm+fdS1OexdzJg4eA43D0EQgLAGs562CAlb/63b3yeKWnkOMee2ZD\njdUIkJfQaoc79RwIZpXNMU5tAGOXyrMDO0IZj6L/pcFlNz+sQfXr9k8ys9si\nWwv4qBcoy2RcIyCUnopcFQe8OWeemkjsoKJtVUaWszAc8QZei8aAJi9NqOn8\nJA/xhkDtSw7Ndu29oalxGDS+J1u+6rd8PntF/5NKwV+GAH9sz4WYAdni5sfM\n9r8hFUrA0utu8LgLGWq3m3ihxYbC072UPCiZk1DAAthdf3BVDpvwTSOhGN9D\nw/ld\r\n=baJq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCO53in7BRXDqV/4ILWZGk/Glgj+UG8GjH41j7/JqI5AIgK0h9Rb6WYIruhIcG8ywkLPXvZIypYgGGMPZ+32dmxE8="}]},"_npmUser":{"name":"fgladisch","email":"felix@felixgladisch.de"},"directories":{},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.1_1628781871743_0.007060972059119708"},"_hasShrinkwrap":false},"0.2.2":{"name":"@anychain/core","version":"0.2.2","description":"Blockchain data structure for Node.js","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"license":"MIT","bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"keywords":["blockchain","crypto","peer-to-peer","p2p","typescript"],"scripts":{"build":"rimraf dist && tsc","test":"mocha -r ts-node/register src/**/*.test.ts","prepublishOnly":"npm run test && npm run build","lint":"eslint src --ext .ts"},"devDependencies":{"@types/chai":"4.3.0","@types/mocha":"9.1.0","@types/node":"17.0.12","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","chai":"4.3.6","eslint-config-prettier":"^8.3.0","eslint":"^8.7.0","mocha":"9.2.0","rimraf":"3.0.2","ts-node":"10.4.0","typescript":"4.5.5"},"gitHead":"f30e5dc5c539ce962255e0219e393c164acc05bb","homepage":"https://github.com/fgladisch/anychain#readme","_id":"@anychain/core@0.2.2","_nodeVersion":"17.1.0","_npmVersion":"8.1.2","dist":{"integrity":"sha512-klItHFMHoNdp8IwNWCMb1Hvhtd8F9HO7CFnzPLdehdVsEIJOdR4hjmpg9jy948oGs6rghsMf+f+1xlIC2FAOuw==","shasum":"a03626ebd035ff2c3fc084983cd347427b0fe3b0","tarball":"https://registry.npmjs.org/@anychain/core/-/core-0.2.2.tgz","fileCount":15,"unpackedSize":16260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8V1ECRA9TVsSAnZWagAA7hYP/1l7U8LG2xOsD5KGZzTe\n+bJsaR2M5lDO6b5XCEr71CvQ020NyH9tTUX3xR7GxXoA+aLnA2QCsUBsHDbW\nbUfuIuAvLvT9wcIUB3bz5Ns8P3TxGdLYWdDrp6R+3wXnFHFvpmxhA2nzZXbJ\n/gKpr3N9RWKkQqjxuNi5BsjlDsci6brP+PHTJmjU6wuRpN8cZ+bc4jPHAAtR\nX/VqpPnbbs+FLnJoNDcs/vE9YrQFjI0jVq4AxzmxVc0cFFJYgdq8CcAguzUR\nnJVlLli3k/81B1W47sE5hv4+/j0FNXU9+9Vkm6HaQvanNhs3+rXudTOFTao0\ntrykNEmKtZAYVK46N6oCJWb1tG9UZkf0p8YSx0e0BoWVktmEjnYFTz1iT+q8\nKiIiEvhHAQ8mTm94mCuxUWhEQEJcso/xdgHthk1WwmvNJBjrurWqAIM6gMr1\nKg0280PuyCDA+2TNPezbs0vNm7Tt6GUl1K67HyLRaZe4QTYN1IxnzPKopduM\nGhhgQdQPS3VBaSp4Outg25OB2QMuDDc56RhWZ8netygRfKVB1icy57Px54ox\nLdZjlJUPrl3PY2OO3/BoRvueRcYnpPwlh0YEDMxoYd7j0DKgs0rJyQh+Q079\nAjY8yt6nHq06wfbFb6aRTVyTT2Q4+ZDb5ltFgVI+r+Hdx0Gzm6MC84arSrWv\nFwFR\r\n=Rm7C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGk9TbAVlBvCgmtln5fT3TqTF6mSkOV+WX4wmx6p2KyrAiEArlfu0+XIKC5Vxki3iclvnoHcOfH+YM985zQmf+m682A="}]},"_npmUser":{"name":"fgladisch","email":"felix@felixgladisch.de"},"directories":{},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.2.2_1643208004395_0.19725516446529157"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-26T09:42:02.112Z","0.1.0":"2018-03-26T09:42:02.345Z","modified":"2022-06-12T14:43:18.269Z","0.1.1":"2018-03-26T12:34:38.693Z","0.2.0":"2018-03-26T18:10:03.909Z","0.2.1":"2021-08-12T15:24:31.885Z","0.2.2":"2022-01-26T14:40:04.682Z"},"maintainers":[{"name":"fgladisch","email":"felix@felixgladisch.de"}],"description":"Blockchain data structure for Node.js","keywords":["blockchain","crypto","peer-to-peer","p2p","typescript"],"repository":{"type":"git","url":"git+ssh://git@github.com/fgladisch/anychain.git"},"author":{"name":"Felix Gladisch","email":"felix@felixgladisch.de"},"bugs":{"url":"https://github.com/fgladisch/anychain/issues"},"license":"MIT","readme":"# anychain\n\nA blockchain data structure for Node.js! :rocket:\n\n## Quick Start (JavaScript)\n\n```ts\nconst { Blockchain } = require(\"@anychain/core\");\n\nconst blockchain = new Blockchain();\n\nconst shipments = [\n  {\n    trackingId: 42,\n    latitude: 40.758895,\n    longitude: -73.985131\n  }\n];\n\nblockchain.add(shipments);\n```\n\n## Quick Start (TypeScript)\n\n```ts\nimport { Block, Blockchain } from \"@anychain/core\";\n\ninterface Shipment {\n  trackingId: number;\n  latitude: number;\n  longitude: number;\n}\n\nconst shipments: Shipment[] = [\n  {\n    trackingId: 42,\n    latitude: 40.758895,\n    longitude: -73.985131\n  }\n];\n\nconst blockchain: Blockchain<Shipment[]> = new Blockchain<Shipment[]>();\n\nconst latestBlock: Block<Shipment[]> = blockchain.add(shipments);\n```\n\n## Installation\n\n```bash\nyarn add @anychain/core\n# or\nnpm install --save @anychain/core\n```\n\n## API\n\n### `constructor(chain?: Block<T>[])`\n\nPass an optional existing `chain` to the constructor.\n\n### `#add(data: T): Block<T>`\n\nAdds a new block with the given data to the blockchain.\n\n### `#update(chain: Block<T>[]): boolean`\n\nOverwrite the current `chain` with a more recent one. Returns `true` when the update was successful.\n\n### `#toJSON(): string`\n\nReturns the following JSON for the example above:\n\n```json\n[\n  {\n    \"index\": 0,\n    \"parent\": null,\n    \"data\": \"GENESIS\",\n    \"time\": 1522226975631,\n    \"hash\": \"2e465389daa2d20a41fcd12cb7cf2b59fbd04e72dcd5d21cb5c72c91fd83119b\"\n  },\n  {\n    \"index\": 1,\n    \"parent\": \"2e465389daa2d20a41fcd12cb7cf2b59fbd04e72dcd5d21cb5c72c91fd83119b\",\n    \"data\": [\n      {\n        \"trackingId\": 42,\n        \"latitude\": 40.758895,\n        \"longitude\": -73.985131\n      }\n    ],\n    \"time\": 1522226975631,\n    \"hash\": \"9467452a7cdb8491d3b5c1cce93583bb2840e6c0b9e2612f6a915e1df207c52a\"\n  }\n]\n```\n\n### `#getChain(): Block<T>[]`\n\nReturns the full `chain` as array.\n\n### `#getGenesisBlock(): Block<T>`\n\nReturns the first `block` in the `chain` (genesis).\n\n### `#getLatestBlock(): Block<T>`\n\nReturns the latest `block` in the `chain`.\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md","homepage":"https://github.com/fgladisch/anychain#readme"}