{"_id":"@dhealth/uri-library","_rev":"1-5444aa826c718a52037f48f3cf1a1f07","name":"@dhealth/uri-library","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dhealth/uri-library","version":"1.0.0","description":"URI Scheme library for dHealth Network","main":"dist/index.js","typings":"dist/index.d.ts","directories":{"test":"test"},"dependencies":{"url-parse":"1.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.0.0","@types/node":"^17.0.5","chai":"^4.3.4","chai-exclude":"^2.1.0","coveralls":"^3.1.1","mocha":"^9.1.3","nyc":"^15.1.0","@dhealth/sdk":"1.0.3-alpha-202201201200","ts-node":"^10.4.0","tslint":"^6.1.3","typedoc":"^0.22.10","typescript":"^4.5.4"},"scripts":{"pretest":"npm run build","build":"rm -rf dist/ && tsc","lint:all":"tslint --project .","test":"mocha --ui bdd --recursive ./dist/test","test:cov":"nyc --reporter=lcov --reporter=text-summary npm t","test:coveralls":"npm run test:cov | coveralls","coveralls-report":"cat ./coverage/lcov.info | coveralls","doc":"typedoc --entryPointStrategy expand --out \"ts-docs/$(npm run version --silent)\" src","version":"echo $npm_package_version"},"repository":{"type":"git","url":"git+https://github.com/dhealthproject/dhealth-uri-library.git"},"license":"Apache 2.0","bugs":{"url":"https://github.com/dhealthproject/dhealth-uri-library/issues"},"homepage":"https://github.com/dhealthproject/dhealth-uri-library#readme","nyc":{"exclude":["**/*.spec.js"]},"gitHead":"b412490773e23923671992ed308d2032e2327315","_id":"@dhealth/uri-library@1.0.0","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-cCqsEEJTuBayUatkLFIBqPRB6zz4w6x7zGkBfDE+Ea5WPaNIZkQolK1eA7iNq5zIep2Xy8r0p80YheOrgz3o8A==","shasum":"c7e795ec68b4a53049e112cfaf82f292a8135b31","tarball":"https://registry.npmjs.org/@dhealth/uri-library/-/uri-library-1.0.0.tgz","fileCount":28,"unpackedSize":38178,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2jV0Dv4ZXguZiUqh40rhrkFUw5iCgEHq2r0WSDgmpDAiBjJT/L2eYg+iHWuvVtASXmRre+KHKXjZilcuzwpGfAdA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWDXtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3Pg/+MHh35GchQOIkBpfrmJR4dmHf/Sg7u2MLg2UePSzt9D88bF2o\r\nkGR8RlGqaQ1ANntWBGQH1vb4WZuay76NMGmNP+1jNt4gCkmxwetwwddS+5V3\r\n3H4FdhCJDhELP8omPnB0a6qjekvlFjnIwxDiq7NJhT2AJkmK9dtC7R4ce4vd\r\nMzYMbASlitAcUUVQ1HT8NXHWcEHPXATW8lBU8OIcDGkXqAnfVkDZKof5fPQr\r\ni/AIMgTL7gOYnpJl4LcBdWeuT10J4fW2imlUCCde9kgd7MdgHq6nOVE5tl2n\r\nlp5+ZY6d7lrRKeNTsfM4RZ4g167Im38z6b2vRmccFySbAI3QDHDqLanRStPJ\r\nCBzrtKcqysgP6vDRH9OSmyGqqrYPYPP4DjuFXhZh5rnI0of0Yd3UI3l84STM\r\nr3YxbGcxzmcPA1Qgm2oyrI6kjfS75OZ9zuWqXvRr2cLfpco2KAOxpnSBxMcp\r\n2UG9YxOuFNCXkSW1mV4Za+6Ve+UJLB6fT5/tv0Y+BU88jrfGUPDuVSgymWTM\r\nJJSh/5EJoCvBwmeA9t10vWsri37veq3qag3kn4rZ473avkWIod+H2/nrPSVP\r\nj6KFvv1XNv189/8t/lecsD1ARJAorCIcqFEpkPvxUlnRB7OyGmEI1Je3QVE8\r\nnLCNdu2J6C8iuGiGGr9Vrm4p3m8y3eiLec8=\r\n=afWK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"evias.be","email":"greg@evias.be"},"maintainers":[{"name":"evias.be","email":"greg@evias.be"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uri-library_1.0.0_1649948141064_0.033199839104472995"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-14T14:55:41.008Z","1.0.0":"2022-04-14T14:55:41.199Z","modified":"2023-02-12T14:39:44.063Z"},"maintainers":[{"email":"greg@dhealth.foundation","name":"dhealthbot"},{"email":"greg@evias.be","name":"evias.be"}],"description":"URI Scheme library for dHealth Network","homepage":"https://github.com/dhealthproject/dhealth-uri-library#readme","repository":{"type":"git","url":"git+https://github.com/dhealthproject/dhealth-uri-library.git"},"bugs":{"url":"https://github.com/dhealthproject/dhealth-uri-library/issues"},"license":"Apache 2.0","readme":"# dHealth URI Library\n\n[![npm version](https://badge.fury.io/js/@dhealth%2Furi-library.svg)][npm]\n[![Discord](https://img.shields.io/badge/chat-on%20discord-green.svg)][discord]\n\nURI Scheme library to create dHealth Network transactions ready to be signed.\n\n## Requirements\n\n- Node.js 12 LTS\n\n## Installation\n\n``npm install @dhealth/uri-library``\n\n## Usage\n\n### Generate URI from Transaction\n\n```ts\n// examples/TransactionToURI.ts\n\nimport { Account, Deadline, EmptyMessage, Currency, NetworkType, TransferTransaction, TransactionMapping } from '@dhealth/sdk';\n\nimport { TransactionURI } from '@dhealth/uri-library';\n\nconst epochAdjustment = 1637848847;\nconst serializedTransaction = TransferTransaction.create(\n    Deadline.create(epochAdjustment),\n    Account.generateNewAccount(NetworkType.TEST_NET).address,\n    [Currency.PUBLIC.createRelative(10)],\n    EmptyMessage,\n    NetworkType.TEST_NET\n).serialize();\n\nconst generationHash = 'ABC'; // replace with network generation hash\nconst nodeUrl = 'http://localhost:3000';\nconst webhookUrl = 'http://myapp.local/id';\n\nconst transactionURI = new TransactionURI(serializedTransaction, TransactionMapping.createFromPayload, generationHash, nodeUrl, webhookUrl);\nconsole.log(transactionURI.build());\n\n```\n\n### Create Transaction from URI\n\n```ts\n// examples/URIToTransaction.ts\n\nimport { TransactionMapping } from '@dhealth/sdk';\nimport { TransactionURI } from '@dhealth/uri-library';\n\nconst serializedTransaction = 'B600000000000000000000000000000000000000000' +\n'0000000000000000000000000000000000000000000000000000000000000000000000000' +\n'0000000000000000000000000000000000000000000000000000000000000000000000000' +\n'0000000000000000000000000000190544100000000000000005816E98404000000900FFE' +\n'A45AEA2EE9B880D5E4F9B91B75857F444F1766CDCB0600010000000000CC403C7A113BDF7' +\n'C80969800000000000068656C6C6F';\n\nconst URI = 'web+dhealth://transaction?data=' + serializedTransaction + '&generationHash=test' +\n    '&nodeUrl=http://localhost:3000&webhookUrl=http://myapp.local/id';\nconst transactionURI = TransactionURI.fromURI(URI, TransactionMapping.createFromPayload);\n\nconst transaction = transactionURI.toTransaction();\nconsole.log(transaction);\n\n```\n\n## Getting help\n\nUse the following available resources to get help:\n\n- [dHealth Documentation][docs]\n- Join the community [Discord][discord] \n- If you found a bug, [open a new issue][issues]\n\n## Contributing\n\nContributions are welcome and appreciated. \nCheck [CONTRIBUTING](CONTRIBUTING.md) for information on how to contribute.\n\n## License\n\nCopyright 2019 NEM\n\nCopyright 2022-present dHealth Network, All rights reserved\n\nLicensed under the [Apache License 2.0](LICENSE)\n\n[npm]: https://www.npmjs.com/package/@dhealth/uri-library\n[docs]: https://docs.dhealth.com\n[issues]: https://github.com/dhealthproject/dhealth-uri-library/issues\n[discord]: https://discord.gg/P57WHbmZjk\n","readmeFilename":"README.md"}