{"_id":"@blobaa/attestation-protocol-ts","_rev":"4-2b901974514862ddde1beb742620048b","name":"@blobaa/attestation-protocol-ts","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0-beta.10":{"name":"@blobaa/attestation-protocol-ts","version":"1.0.0-beta.10","description":"An implementation of the Attestation Protocol written in TypeScript","author":{"name":"atz3n"},"license":"AGPL","repository":{"type":"git","url":"git+https://github.com/blobaa/attestation-protocol-ts.git"},"main":"dist/src/index.js","scripts":{"test":"npm run test-browser && npm run test-node","test-node":"jest --testEnvironment=node","test-browser":"jest --testEnvironment=jsdom","build":"rm -rf dist && tsc","test-build-node":"jest --rootDir=dist --testEnvironment=node","test-build-browser":"jest --rootDir=dist --testEnvironment=jsdom","lint":"eslint ./ --ext .ts","fix-lint":"eslint ./ --fix --ext .ts"},"devDependencies":{"@types/jest":"^24.0.23","@types/node":"^12.12.14","@typescript-eslint/eslint-plugin":"^2.16.0","@typescript-eslint/parser":"^2.16.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.0","eslint-plugin-prefer-arrow":"^1.1.7","jest":"^24.9.0","jest-cli":"^24.9.0","ts-jest":"^24.2.0","tslint":"^5.20.1","typescript":"^3.7.3"},"dependencies":{"@blobaa/ardor-ts":"^2.4.1"},"gitHead":"27e4245649f2754ba064e6093fee7a4d76692260","bugs":{"url":"https://github.com/blobaa/attestation-protocol-ts/issues"},"homepage":"https://github.com/blobaa/attestation-protocol-ts#readme","_id":"@blobaa/attestation-protocol-ts@1.0.0-beta.10","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-/ZRjO4L/jPoQ+uTDKkTIxfcGF1kaXZwpa0Wx8KEb5zYMXJHhi8FjQGUj4AN9z+f7DxRRZFTbxRZmdqWN7MnEcg==","shasum":"666f29974ab6c1c1b7a7316b0cd5a16b9b365793","tarball":"https://registry.npmjs.org/@blobaa/attestation-protocol-ts/-/attestation-protocol-ts-1.0.0-beta.10.tgz","fileCount":53,"unpackedSize":236661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegbiyCRA9TVsSAnZWagAAV7IP/1YCllJuaEtattuFM8aF\nhi/HYI+xg8JxZMCzXjONBHKjvBF/uh2Uk2p+V84KTHvOyEwZIn9nhnGk1+QE\nWB2MRrtkBe2IH7HuoDX4XUiUxZnhavHDt9kFJF4L6tA6tLm3FNMeK/Ts+jXf\nWYTzQVoTBU01pMs3lfzVtjUBp2nVHZAKVadatnzTz9yGvA2j568GWltxHHoD\niZOuGeYoW/WvxGd2zQVvF+0VlmM9r+5xjudmpL3387rQpuFGaxn+hwsE7JMd\nl1K6rW/gUCUD/jyTaO2V0ggc3u3XfRGPW+cTBuQXZAzvN5C7lht6JZZXuS5N\nzDbUrzWVWKKV4uRzhdxd59nxIt4wK3hHuM/GN8FgraBQZvPTp15JalmhHjgj\ntW5fGlv6jjnQe+GaHljaDmSGYIGoxJezzXMpF2e1/sfI0zkkFEC4QMbwMchH\niuJjmIUQXQf4sOQWvfu29hnVsIiSNEtMqmqMmQtVeN+5paY2/3PpwsXpWtih\njnXRtCdMfcsKkKIxKKnctKrp2EtOK8fD4PM/2p7u+GQsE6FLFtFgnzdxIE8b\nlfR1Hr8yxiu1wWwqAPU7tjI3h8luMenkZXiGp1RzWrb3+HM2wnDnDjxofG+O\nS9/ZGHma87UV0TxEC6ls/OHBTEC8xpM8Pj388XQPrbtxhuxeGMdlFImwT4Ze\nZeA6\r\n=jrnd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXEwQMTe9g9rB2sBoGAMCcmgxG7x/CccccAfpJCThiyAiBo5ipn/E+sM8+eNQCu6TmhGNKRuU4rS6C22uLT3GfGuw=="}]},"maintainers":[{"name":"blobaa","email":"hi.blobaa@gmail.com"}],"_npmUser":{"name":"blobaa","email":"hi.blobaa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestation-protocol-ts_1.0.0-beta.10_1585559729633_0.46113659348475045"},"_hasShrinkwrap":false},"1.0.0-beta.11":{"name":"@blobaa/attestation-protocol-ts","version":"1.0.0-beta.11","description":"An implementation of the Attestation Protocol written in TypeScript","author":{"name":"atz3n"},"license":"AGPL","repository":{"type":"git","url":"git+https://github.com/blobaa/attestation-protocol-ts.git"},"main":"dist/src/index.js","scripts":{"test":"npm run test-browser && npm run test-node","test-node":"jest --testEnvironment=node","test-browser":"jest --testEnvironment=jsdom","build":"rm -rf dist && tsc","test-build-node":"jest --rootDir=dist --testEnvironment=node","test-build-browser":"jest --rootDir=dist --testEnvironment=jsdom","lint":"eslint ./ --ext .ts","fix-lint":"eslint ./ --fix --ext .ts"},"devDependencies":{"@types/jest":"^24.0.23","@types/node":"^12.12.14","@typescript-eslint/eslint-plugin":"^2.16.0","@typescript-eslint/parser":"^2.16.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.0","eslint-plugin-prefer-arrow":"^1.1.7","jest":"^24.9.0","jest-cli":"^24.9.0","ts-jest":"^24.2.0","tslint":"^5.20.1","typescript":"^3.7.3"},"dependencies":{"@blobaa/ardor-ts":"^2.4.1"},"gitHead":"a61f4a3408dc581bf4a8cfe658193e0ee1342786","bugs":{"url":"https://github.com/blobaa/attestation-protocol-ts/issues"},"homepage":"https://github.com/blobaa/attestation-protocol-ts#readme","_id":"@blobaa/attestation-protocol-ts@1.0.0-beta.11","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-3yMj6PwflHVX66uYI6Z8S/UWiIprjjbI+JlgrY1W2a220o5wJQmLtM9+kDbnUpfiVguuvLaYtZYpscb0hkjGjw==","shasum":"a0bee381c2774e611dc6c9463b9e34199904f936","tarball":"https://registry.npmjs.org/@blobaa/attestation-protocol-ts/-/attestation-protocol-ts-1.0.0-beta.11.tgz","fileCount":53,"unpackedSize":236661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegbqXCRA9TVsSAnZWagAA6LoP/2PBoujYzz4EoATjbnqR\nMcMKiTxtvaqH800Fx7vvpUgRajd6yOe9ks7uTXTD9jhZEC1tjcFBlcuBVEVc\nV6cnr3cxVhIXs8/B4YOPiqIk86ws9Xiw+ZrJXwyWULULBMxnzOAdPRDTE4FZ\nfr7PuuyLmN4y4OoCP9GHhEIZxMW+QqWPQorQc1NbVHv0r7mdd5yCLlz3VLkd\nD0wpAmDOueONkafod1paDkmw6r+oFx2LsM+qGBlfBT3nHIBzRlcIp7vZ+MgJ\n9BTV4w7s4gwxSnG/uV3of761rQ1+jK+wlcy4av9LvuQHIMOVeAEOX0kKSvGW\n8rX1X7CDKgTRGn+fIJ65sYy1ia3Dv7mh3+BQjJb9lCY55gUbl9BXfun2ak/Q\nb4LWirWbwMfOzK0v+PYvzOfkt66qFD8B3q9gccX7suwQfZxPSwSSAt+fey9r\nh1BBaXyLBl6/fonj+0ZVJp6QJW9YNBOEKAKZpF2+keXL3r+MC46ydPT7PYca\niX6K5duF4nlcKzHDjISVscoDuZeuSVWZbWvz8tIMT0iHTRynsjYZM9bSXNEU\n3x7EJTes1lQiskv3zCX4guXmCYBP0vbioB0KZvIzmptRgboddJINuUAA2ot0\n+iyfF7L/jBqbo4nyJcRrKBRAt1LxRZyl6r+/+CtXynhbjviIteGwt8550zAM\nktvr\r\n=h1D1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYqmcIFKj6+udbOJXL5s2QbTfPVH7BkIewaQdBYwgu9AiEAoA0oej6OYQ7bpweAQPycs06DFJP0FA9TVtInprJLLqA="}]},"maintainers":[{"name":"blobaa","email":"hi.blobaa@gmail.com"}],"_npmUser":{"name":"blobaa","email":"hi.blobaa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestation-protocol-ts_1.0.0-beta.11_1585560214446_0.6515945181632017"},"_hasShrinkwrap":false},"1.0.0-beta.12":{"name":"@blobaa/attestation-protocol-ts","version":"1.0.0-beta.12","description":"An implementation of the Attestation Protocol written in TypeScript","author":{"name":"atz3n"},"license":"AGPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/blobaa/attestation-protocol-ts.git"},"main":"dist/src/index.js","scripts":{"test":"npm run test-browser && npm run test-node","test-node":"jest --testEnvironment=node","test-browser":"jest --testEnvironment=jsdom","build":"rm -rf dist && tsc","test-build-node":"jest --rootDir=dist --testEnvironment=node","test-build-browser":"jest --rootDir=dist --testEnvironment=jsdom","lint":"eslint ./ --ext .ts","fix-lint":"eslint ./ --fix --ext .ts"},"devDependencies":{"@types/jest":"^24.0.23","@types/node":"^12.12.14","@typescript-eslint/eslint-plugin":"^2.16.0","@typescript-eslint/parser":"^2.16.0","eslint":"^6.8.0","eslint-plugin-import":"^2.20.0","eslint-plugin-prefer-arrow":"^1.1.7","jest":"^24.9.0","jest-cli":"^24.9.0","ts-jest":"^24.2.0","tslint":"^5.20.1","typescript":"^3.7.3"},"dependencies":{"@blobaa/ardor-ts":"^2.4.1"},"gitHead":"3140947c4a8977b6e864316b7851437a96cabb4c","bugs":{"url":"https://github.com/blobaa/attestation-protocol-ts/issues"},"homepage":"https://github.com/blobaa/attestation-protocol-ts#readme","_id":"@blobaa/attestation-protocol-ts@1.0.0-beta.12","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-hOcJlhQBAPaLOQtHDR8vMtRCR7NBHywouWSGwfiOlrxzNM/hc259Y6WoJoOmmz47xkhFYZwnz3lF5HCfGTwXxw==","shasum":"19a957d0aa9c27f3580e57ee82452e912a75fa39","tarball":"https://registry.npmjs.org/@blobaa/attestation-protocol-ts/-/attestation-protocol-ts-1.0.0-beta.12.tgz","fileCount":53,"unpackedSize":236673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegc6MCRA9TVsSAnZWagAA1oYP/RVY1xzcL+Z6qnvpNydl\n7BJ43zddwUkeUnVFntKUMpgYKHDQMbwz9hkSaNNSMf/Rt/x2zwm45aeJv+vr\nLlzlpCcOZz8fwKW/Zp1b9QRsP+fXudDJ53V2oHEsk5HDGZse9MrcYpCSj/Ww\nwDcxpMXyrB8fpYR8M4xFzzwXsxPLbkMG8R/nXB9HON9Tj4y8SIJ/TELWw42Q\nftoU3WmwNZOcgZ9t1dNXonyq/jMpeQzlrYMr4YXL4Q07HdRerOfEsXqBmP4F\nzJO4rkU9aJxaFaDkCwaggaSEKroRZKBjE3a223vC2YAUZiyOl2LtD8prBjc/\nQ5rB0gBDXgTK7p4Xkkk25NTwQ8VqXRjLKX+GDMRAgQqCH34tsM3sXjaU5jK5\nFv7+45AyDeZKux2w4oQwIGbjvN1mR7BF9V5DALlOgwJRvZAp14HTJayvheWI\nCQMr5wOnv+E5+RdsZcXv779yr6pZbNtDy+s1Opzylem0O0q9Bp4BXFQ0pNAd\nONf5GIr9geH/kMNG4rb4W1J0HAEL2dBBKYAlN/PIP4BfOgm6zNPr2IwZeLkr\n2ScstD11jcoviLtA2Zm+WI78qUth3eatOo84Qi/WpFKQoA7WjcAIY1tUqZuz\nxJa75sF01NDcORHR6DOsj0QngIZfTBlBJm9Ha7nLY8YnLr1qrdTR8/uS66mw\n0iPO\r\n=WILN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCndXyBmT8Hs5eAOoOgaJ9uU9CAYTG+/AdWYbXLZLXLgIgULljFosQTp59gAmY6PD1cIW6NjxcbINCchm1FYB8i1I="}]},"maintainers":[{"name":"blobaa","email":"hi.blobaa@gmail.com"}],"_npmUser":{"name":"blobaa","email":"hi.blobaa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestation-protocol-ts_1.0.0-beta.12_1585565324264_0.45894992861564865"},"_hasShrinkwrap":false},"1.0.1":{"name":"@blobaa/attestation-protocol-ts","version":"1.0.1","description":"An implementation of the Attestation Protocol written in TypeScript","author":{"name":"atz3n"},"license":"AGPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/blobaa/attestation-protocol-ts.git"},"main":"dist/src/index.js","scripts":{"test":"npm run test-browser && npm run test-node","test-node":"jest --testEnvironment=node","test-browser":"jest --testEnvironment=jsdom","build":"rm -rf dist && tsc","test-build-node":"jest --rootDir=dist --testEnvironment=node","test-build-browser":"jest --rootDir=dist --testEnvironment=jsdom","lint":"eslint ./ --ext .ts","fix-lint":"eslint ./ --fix --ext .ts"},"devDependencies":{"@types/jest":"^24.0.23","@types/node":"^12.19.14","@typescript-eslint/eslint-plugin":"^2.34.0","@typescript-eslint/parser":"^2.34.0","eslint":"^6.8.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prefer-arrow":"^1.2.2","jest":"^24.9.0","jest-cli":"^24.9.0","ts-jest":"^26.4.4","tslint":"^5.20.1","typescript":"^3.9.7"},"dependencies":{"@blobaa/ardor-ts":"^2.8.2"},"gitHead":"7d44958158424f04366305dc7e8d1624c95af519","bugs":{"url":"https://github.com/blobaa/attestation-protocol-ts/issues"},"homepage":"https://github.com/blobaa/attestation-protocol-ts#readme","_id":"@blobaa/attestation-protocol-ts@1.0.1","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-reJJVGeQ6PGvJswBpHTWgO6JMCFffulDfFokOQtIMwcaOeEI74bHNCG7A3UGxYZnWCrAwZfjNwclr733SDvFWw==","shasum":"54d1d2f6ac71e124a9526df673c5efe4d5f78409","tarball":"https://registry.npmjs.org/@blobaa/attestation-protocol-ts/-/attestation-protocol-ts-1.0.1.tgz","fileCount":53,"unpackedSize":237592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAzrOCRA9TVsSAnZWagAAiRAP/jtDKMoqKVJI12ekfhKf\nYU/totsyzpDFDi80eN5XkbZLXFZp+rKTd/o9ZhbwhyuB4sTgzOkMMSTL9oQd\nFAo3ThdJFR+qvsirwlXbtxeak4aJAK24OflpdvxOnjCRItMcN4knJ5wJHWqw\ng6qyMElN47P8XU5WL28/x8uRM9JwqVTZH7NeuY7Le7uXqpVBlVDx0xxfJLB5\nzYYmOJPSMrn1VlYNtLgaSt9GAB/CNjar/4HMQumXyO57539xooor6RXD4gJ/\nWN2KeKiCY4n3W3tIY4wGuU8U59aPZ59fQilGnX45gHcwUgf7PO8ENa/Fho5x\n26X6lZu2I72xpEIWbdDGVGNWJYOmytDTe+YxL5N4EOcdQcPn1yvbxI9ZYOZI\nf2AxGf6jK06UxvKSQU3N0ksMtWoDbqNiX8vh52u11zPVLX7dodEifUvdudA7\n5KRWK0XvENuqCMhTqzmFtO/S2FHcm7Og4Gf1te9u93wzlfpQaL2uqi6kJBez\nYj14woSsr7TOJ9yylZRNtOUlnde8YF5+dEKQy4JdKN1bP2vNEVm4ggwqr1xu\nMsOPh+se52yb9ygm257NGb4qPto6dpPnri3sVvxYG0eIhCM5yMlIWl4KgVRS\npQgg2fJRphhajpWhViDzvqerXxJfvxENe9cUeei6O6gKqkmqBF/gjFc4T/7c\nmKRK\r\n=Vgbn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNnrQ4s5xAvsP5k7ekeZmInxPRdefxOYmj2PJ9i68L5AiEAq6B9eXsEERZ/ktLr69QGrXXQOxwm0t6pkdCJbIJnDYM="}]},"_npmUser":{"name":"blobaa","email":"hi.blobaa@gmail.com"},"directories":{},"maintainers":[{"name":"blobaa","email":"hi.blobaa@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attestation-protocol-ts_1.0.1_1610824397814_0.9259318400377983"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-30T09:15:29.396Z","1.0.0-beta.10":"2020-03-30T09:15:29.885Z","modified":"2022-04-04T19:36:29.902Z","1.0.0-beta.11":"2020-03-30T09:23:34.623Z","1.0.0-beta.12":"2020-03-30T10:48:44.430Z","1.0.1":"2021-01-16T19:13:17.975Z"},"maintainers":[{"name":"blobaa","email":"hi.blobaa@gmail.com"}],"description":"An implementation of the Attestation Protocol written in TypeScript","homepage":"https://github.com/blobaa/attestation-protocol-ts#readme","repository":{"type":"git","url":"git+https://github.com/blobaa/attestation-protocol-ts.git"},"author":{"name":"atz3n"},"bugs":{"url":"https://github.com/blobaa/attestation-protocol-ts/issues"},"license":"AGPL-3.0-or-later","readme":"# Attestation Protocol TypeScript\n\nAn implementation of the [Attestation Protocol](https://docu.blobaa.dev/attestation-protocol) written in [TypeScript](https://www.typescriptlang.org).\n\n\n<details><summary><i>Table of Contents</i></summary>\n<p>\n\n- [Attestation Protocol TypeScript](#attestation-protocol-typescript)\n  - [Installation](#installation)\n    - [Npmjs Registry](#npmjs-registry)\n    - [Github Registry](#github-registry)\n  - [Development](#development)\n  - [General](#general)\n  - [APIs](#apis)\n    - [Attestation](#attestation)\n      - [createRootAttestation](#createrootattestation)\n      - [createIntermediateAttestation](#createintermediateattestation)\n      - [createLeafAttestation](#createleafattestation)\n      - [createAttestationUnchecked](#createattestationunchecked)\n      - [updateRootAttestation](#updaterootattestation)\n      - [updateIntermediateAttestation](#updateintermediateattestation)\n      - [updateLeafAttestation](#updateleafattestation)\n      - [revokeRootAttestation](#revokerootattestation)\n      - [revokeIntermediateAttestation](#revokeintermediateattestation)\n      - [revokeLeafAttestation](#revokeleafattestation)\n      - [revokeAttestationUnchecked](#revokeattestationunchecked)\n    - [Data](#data)\n      - [signData](#signdata)\n      - [verifySignedData](#verifysigneddata)\n    - [Entity](#entity)\n      - [getEntity](#getentity)\n    - [Error Handling](#error-handling)\n  - [Module Instantiation](#module-instantiation)\n  - [Licensing](#licensing)\n    - [Dual-License](#dual-license)\n\n</p>\n</details>\n\n\n## Installation\n\nThis library is published on GitHub's and npmjs's npm registry.\n\n\n### Npmjs Registry\n\n````\nnpm install @blobaa/attestation-protocol-ts\n````\n\nSee [npmjs package](https://www.npmjs.com/package/@blobaa/attestation-protocol-ts).\n\n\n### Github Registry\n\nFor using GitHub's registry, create a *.npmrc* file in the same directory as your *package.json* and add the following line \n\n````\n@blobaa:registry=https://npm.pkg.github.com/blobaa\n```` \n\nThis tells npm to use the GitHub registry for @blobaa scoped packages. More information about multiple registry usage can be found in [this medium post](https://medium.com/@crysfel/using-different-registries-in-yarn-and-npm-766541d6f851).\n\nYou can now install the package via\n\n````\nnpm install @blobaa/attestation-protocol-ts\n````\n\nSee [GitHub package](https://github.com/blobaa/attestation-protocol-ts/packages/82302).\n\nCAUTION: You need to [authenticate yourself](https://github.community/t5/GitHub-API-Development-and/Download-from-Github-Package-Registry-without-authentication/td-p/35255) to use the GitHub registry, even if it's a public available package.\n\n\n## Development\n\nYou need to have [Node.js](https://nodejs.org/en/) installed.\n\nTo **initialize** the project just clone this repository and run\n```\nnpm install\n```\n\nFor **linting** run \n```\nnpm run lint\n```\n\nYou can try to **autofix lint errors** with\n```\nnpm run fix-lint\n```\n\nFor **unit testing** run the following associated commands\n\nbrowser:\n```\nnpm run test-browser\n```\n\nnode: \n```\nnpm run test-node\n```\n\nboth: \n```\nnpm test\n```\n\n\n## General\n\nThis library uses the [ardor-ts](https://github.com/blobaa/ardor-ts) package to interact with the [Ardor](https://ardorplatform.org) Blockchain. At the current state there is no child chain configuration possible. It uses the default ardor-ts configuration and therefore the IGNIS child chain.\n\nThere are lots of tests in the test folder. Have a look if you need some additional examples of how to use the APIs.\n\nThis version implements the Attestation Protocol version 1.0.0\n\n\n## APIs\n\nThe library consist of the following modules:\n\n### Attestation\n\nThe Attestation module handles attestation tasks like creating, updating and revoking attestations. It provides the following APIs:\n\n````typescript\n- createRootAttestation(url: string, params: CreateRootAttestationParams): Promise<AttestationResponse>\n- createIntermediateAttestation(url: string, params: CreateIntermediateAttestationParams): Promise<AttestationResponse>\n- createLeafAttestation(url: string, params: CreateLeafAttestationParams): Promise<AttestationResponse>\n- createAttestationUnchecked(url: string, params: CreateAttestationUncheckedParams): Promise<AttestationResponse>\n\n- updateRootAttestation(url: string, params: UpdateRootAttestationParams): Promise<AttestationResponse>\n- updateIntermediateAttestation(url: string, params: UpdateIntermediateAttestationParams): Promise<AttestationResponse>\n- updateLeafAttestation(url: string, params: UpdateLeafAttestationParams): Promise<AttestationResponse>\n\n- revokeRootAttestation(url: string, params: RevokeRootAttestationParams): Promise<AttestationResponse>\n- revokeIntermediateAttestation(url: string, params: RevokeIntermediateAttestationParams): Promise<AttestationResponse>\n- revokeLeafAttestation(url: string, params: RevokeLeafAttestationParams): Promise<AttestationResponse>\n- revokeAttestationUnchecked(url: string, params: RevokeAttestationUncheckedParams): Promise<AttestationResponse>\n````\n\nBefore requesting blockchain transactions, various conditions will be checked and an error will be thrown in case of an unmet condition. This is to protect a user against invalid transaction creation and therefore money lost in form of transaction fees.\n\nUse the *createAttestationUnchecked* and *revokeAttestationUnchecked* APIs for bypassing these checks (which is of course not recommended).\n\n\n#### createRootAttestation\n\nThis API lets you create self attestations and therefore root entities for trust chains.\n\n````typescript\nimport { attestation, CreateRootAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst createRootAttestationExample = async () => {\n\n    /* set parameters */\n    const params: CreateRootAttestationParams = {\n        attestationContext: \"exampleContext\",\n        payload: \"exampleAccountPayload\",       // [optional] payload data field (see Attestation Protocol)\n        \n        passphrase: \"<some passphrase>\",        // passphrase of account to be self attested\n        fee: 0.1                                // [optional] fee in IGNIS.\n                                                // If not set, automatic fee calculation will be used\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.createRootAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\ncreateRootAttestationExample();\n````\n\n\n#### createIntermediateAttestation\n\nThis API creates intermediate attestations based on a root or intermediate account. It creates an intermediate chain link in a trust chain.\n\n````typescript\nimport { attestation, CreateIntermediateAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst createIntermediateAttestationExample = async () => {\n\n    /* set parameters */\n    const params: CreateIntermediateAttestationParams = {\n        intermediateAccount: \"ARDOR-ACCO-UNTT-OBEA-TTEST\",  // account to be attested\n        attestationContext: \"exampleContext\",\n        payload: \"exampleAccountPayload\",                   // [optional] payload data field (see Attestation Protocol)\n        \n        passphrase: \"<some passphrase>\",                    // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",    // [optional] account name of attestor accounts attestor.\n                                                            // Required if attestor account is an intermediate entity\n        fee: 0.1                                            // [optional] fee in IGNIS. \n                                                            // If not set, automatic fee calculation will be used\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.createIntermediateAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\ncreateIntermediateAttestationExample();\n````\n\n\n#### createLeafAttestation\n\nThis API creates leaf attestations based on a root or intermediate account. It creates the bottom end of a trust chain.\n\n````typescript\nimport { attestation, CreateLeafAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst createLeafAttestationExample = async () => {\n\n    /* set parameters */\n    const params: CreateLeafAttestationParams = {\n        leafAccount: \"ARDOR-ACCO-UNTT-OBEA-TTEST\",          // account to be attested\n        attestationContext: \"exampleContext\",\n        payload: \"exampleAccountPayload\",                   // [optional] payload data field (see Attestation Protocol)\n        \n        passphrase: \"<some passphrase>\",                    // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",    // [optional] account name of attestor accounts attestor.\n                                                            // Required if attestor account is an intermediate entity\n        fee: 0.1                                            // [optional] fee in IGNIS.\n                                                            // If not set, automatic fee calculation will be used\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.createLeafAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\ncreateLeafAttestationExample();\n````\n\n\n#### createAttestationUnchecked\n\nThis API lets you create attestations without checking conditions. Use it with caution as it may result in invalid trust chains.\n\n````typescript\nimport { attestation, CreateAttestationUncheckedParams, EntityType } from '@blobaa/attestation-protocol-ts'\n\n\nconst createAttestationUncheckedExample = async () => {\n\n    /* set parameters */\n    const params: CreateAttestationUncheckedParams = {\n        account: \"ARDOR-ACCO-UNTT-OBEA-TTEST\",  // account to be attested,\n        entityType: EntityType.ROOT,            // entity type of account to be attested\n        attestationContext: \"exampleContext\",\n        payload: \"exampleAccountPayload\",       // [optional] payload data field (see Attestation Protocol)\n        \n        passphrase: \"<some passphrase>\",        // passphrase of attestor account\n        fee: 0.1                                // [optional] fee in IGNIS.\n                                                // If not set, automatic fee calculation will be used\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.createAttestationUnchecked(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\ncreateAttestationUncheckedExample();\n````\n\n\n#### updateRootAttestation\n\nThis API lets you update root entity accounts in two ways. You can either update the state and/or payload data fields or update the account, which is the implementation of moving to another account (see Attestation Protocol).\n\n**Data Field Update**\n\n````typescript\nimport { attestation, State, UpdateRootAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateRootDataFieldsExample = async () => {\n\n    /* set parameters */\n    const params: UpdateRootAttestationParams = {\n        attestationContext: \"exampleContext\",\n        newPayload: \"newExampleAccountPayload\", // [optional] new payload\n        newState: State.INACTIVE,               // [optional] new state\n\n        passphrase: \"<some passphrase>\",        // passphrase of account to be updated\n        fee: 0.1                                // [optional] fee in IGNIS.\n                                                // If not set, automatic fee calculation will be used\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateRootAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateRootDataFieldsExample();\n````\n\n**Account Update**\n\n````typescript\nimport { attestation, UpdateRootAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateRootAccountExample = async () => {\n\n    /* set parameters */\n    const params: UpdateRootAttestationParams = {\n        attestationContext: \"exampleContext\",\n        newRootAccount: \"ARDOR-NEWA-CCOU-NTNA-MEXXX\",   // new account\n\n        passphrase: \"<some passphrase>\",                // passphrase of account to be updated\n        fee: 0.1                                        // [optional] fee in IGNIS.\n                                                        // If not set, automatic fee calculation will be used.\n                                                        // CAUTION: this involves two transactions and the\n                                                        // fee is set for each\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateRootAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateRootAccountExample();\n````\n\n\n#### updateIntermediateAttestation\n\nThis API lets you update intermediate entity accounts in two ways. You can either update the state and/or payload data fields or update the account, which is the implementation of moving to another account (see Attestation Protocol).\n\n**Data Field Update**\n\n````typescript\nimport { attestation, State, UpdateIntermediateAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateIntermediateDataFieldsExample = async () => {\n\n    /* set parameters */\n    const params: UpdateIntermediateAttestationParams = {\n        intermediateAccount: \"ARDOR-ACCO-UNTT-OBEU-PDATE\",  // account to be updated\n        attestationContext: \"exampleContext\",\n        newPayload: \"newExampleAccountPayload\",             // [optional] new payload\n        newState: State.INACTIVE,                           // [optional] new state\n        \n        passphrase: \"<some passphrase>\",                    // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",    // [optional] account name of attestor accounts attestor.\n                                                            // Required if attestor account is an intermediate entity\n        fee: 0.1                                            // [optional] fee in IGNIS.\n                                                            // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateIntermediateAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateIntermediateDataFieldsExample();\n````\n\n**Account Update**\n\n````typescript\nimport { attestation, UpdateIntermediateAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateIntermediateAccountExample = async () => {\n\n    /* set parameters */\n    const params: UpdateIntermediateAttestationParams = {\n        intermediateAccount: \"ARDOR-ACCO-UNTT-OBEU-PDATE\",      // account to be updated\n        attestationContext: \"exampleContext\",\n        newIntermediateAccount: \"ARDOR-NEWA-CCOU-NTXX-XXXXX\",   // new account\n        \n        passphrase: \"<some passphrase>\",                        // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",        // [optional] account name of attestor accounts attestor.\n                                                                // Required if attestor account is an intermediate entity\n        fee: 0.1                                                // [optional] fee in IGNIS.\n                                                                // If not set, automatic fee calculation will be used.\n                                                                // CAUTION: this involves two transactions and the\n                                                                // fee is set for each\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateIntermediateAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateIntermediateAccountExample();\n````\n\n\n#### updateLeafAttestation\n\nThis API lets you update leaf entity accounts in two ways. You can either update the state and/or payload data fields or update the account, which is the implementation of moving to another account (see Attestation Protocol).\n\n**Data Field Update**\n\n````typescript\nimport { attestation, State, UpdateLeafAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateLeafDataFieldsExample = async () => {\n\n    /* set parameters */\n    const params: UpdateLeafAttestationParams = {\n        leafAccount: \"ARDOR-ACCO-UNTT-OBEU-PDATE\",          // account to be updated\n        attestationContext: \"exampleContext\",\n        newPayload: \"newExampleAccountPayload\",             // [optional] new payload\n        newState: State.INACTIVE,                           // [optional] new state\n        \n        passphrase: \"<some passphrase>\",                    // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",    // [optional] account name of attestor accounts attestor.\n                                                            // Required if attestor account is an intermediate entity\n        fee: 0.1                                            // [optional] fee in IGNIS.\n                                                            // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateLeafAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateLeafDataFieldsExample();\n````\n\n**Account Update**\n\n````typescript\nimport { attestation, UpdateLeafAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst updateLeafAccountExample = async () => {\n\n    /* set parameters */\n    const params: UpdateLeafAttestationParams = {\n        leafAccount: \"ARDOR-ACCO-UNTT-OBEU-PDATE\",          // account to be updated\n        attestationContext: \"exampleContext\",\n        newLeafAccount: \"ARDOR-NEWA-CCOU-NTXX-XXXXX\",       // new account\n        \n        passphrase: \"<some passphrase>\",                    // passphrase of attestor account\n        myAttestorAccount: \"ARDOR-MYAT-TEST-ORAC-COUNT\",    // [optional] account name of attestor accounts attestor.\n                                                            // Required if attestor account is an intermediate entity\n        fee: 0.1                                            // [optional] fee in IGNIS.\n                                                            // If not set, automatic fee calculation will be used.\n                                                            // CAUTION: this involves two transactions and the\n                                                            // fee is set for each\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.updateLeafAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nupdateLeafAccountExample();\n````\n\n\n#### revokeRootAttestation\n\nThis API revokes self set root attestations.\n\n```typescript\nimport { attestation, RevokeRootAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst revokeRootAttestationExample = async () => {\n\n    /* set parameters */\n    const params: RevokeRootAttestationParams = {\n        attestationContext: \"exampleContext\",\n        passphrase: \"<some passphrase>\",        // passphrase of account to be revoked\n        fee: 0.1                                // [optional] fee in IGNIS.\n                                                // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.revokeRootAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nrevokeRootAttestationExample();\n```\n\n\n#### revokeIntermediateAttestation\n\nThis API revokes intermediate attestations in two ways. You can either self revoke an attestation set by another account to your account (an account from which you know the passphrase) or revoke an attestation created by you for another account.\n\n```typescript\nimport { attestation, RevokeIntermediateAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst revokeIntermediateAttestationExample = async () => {\n\n    /* set parameters */\n    const params: RevokeIntermediateAttestationParams = {\n        intermediateAccount: \"ARDOR-ACCO-UNTT-OBER-EVOKE\",  // [optional] account to be revoked.\n                                                            // Required if request is not a self revocation\n        attestationContext: \"exampleContext\",\n        passphrase: \"<some passphrase>\",                    // passphrase of revoking account\n        fee: 0.1                                            // [optional] fee in IGNIS.\n                                                            // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.revokeIntermediateAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nrevokeIntermediateAttestationExample();\n```\n\n\n#### revokeLeafAttestation\n\nThis API revokes leaf attestations in two ways. You can either self revoke an attestation set by another account to your account (an account from which you know the passphrase) or revoke an attestation created by you for another account.\n\n```typescript\nimport { attestation, RevokeLeafAttestationParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst revokeLeafAttestationExample = async () => {\n\n    /* set parameters */\n    const params: RevokeLeafAttestationParams = {\n        leafAccount: \"ARDOR-ACCO-UNTT-OBER-EVOKE\",  // [ optional ] account to be revoked.\n                                                    // Required if request is not a self revocation\n        attestationContext: \"exampleContext\",\n        passphrase: \"<some passphrase>\",            // passphrase of revoking account\n        fee: 0.1                                    // [optional] fee in IGNIS.\n                                                    // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.revokeLeafAttestation(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nrevokeLeafAttestationExample();\n```\n\n\n#### revokeAttestationUnchecked\n\nThis API lets you revoke attestations without checking conditions. Use it with caution as it may result in invalid trust chains.\n\n```typescript\nimport { attestation, RevokeAttestationUncheckedParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst revokeAttestationUncheckedExample = async () => {\n\n    /* set parameters */\n    const params: RevokeAttestationUncheckedParams = {\n        account: \"ARDOR-ACCO-UNTT-OBER-EVOKE\",  // account to be revoked\n        attestationContext: \"exampleContext\",\n        passphrase: \"<some passphrase>\",        // passphrase of revoking account\n        fee: 0.1                                // [optional] fee in IGNIS.\n                                                // If not set, automatic fee calculation will be used.\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await attestation.revokeAttestationUnchecked(\"https://testardor.jelurida.com\", params);\n\n        /* response implements the AttestationResponse interface */\n        console.log(response.transactionId);\n\n    } catch (e) { /* see error handling */ }\n}\n\nrevokeAttestationUncheckedExample();\n```\n\n\n### Data\n\nThe Data module handles the data signing and verification tasks. It provides the following APIs:\n\n````typescript\n- signData(params: SignDataParams, forTestnet?: boolean): SignedData // forTestnet defaults to false\n- verifySignedData(url: string, params: VerifySignedDataParams, forTestnet?: boolean): Promise<VerifySignedDataResponse> // forTestnet defaults to false\n````\n\n\n#### signData\n\nThis API lets you create a signed data object.\n\n````typescript\nimport { data, SignDataParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst signDataExample = () => {\n\n    /* set parameters */\n    const params: SignDataParams = {\n        attestationContext: \"exampleContext\",\n        attestationPath: [                      // [optional] trust chain up to the root account.\n            \"ARDOR-INTE-RMED-IATE-ACCO1\",       // Can be omitted if signed data creator is root account\n            \"ARDOR-INTE-RMED-IATE-ACCO2\",\n            \"ARDOR-ROOT-ACCO-UNTX-XXXXX\" \n        ], \n        payload: \"exampleDataPayload\",          // user data to be signed\n        passphrase: \"<some passphrase>\"         // passphrase of signed data creator account\n    };\n\n    /* create signed data object */\n    const signedData = data.signData(params, true);\n\n    /* signed data object contains all necessary verification data */\n    console.log(signedData.attestationContext);\n    console.log(signedData.attestationPath);\n    console.log(signedData.payload);\n    console.log(signedData.creatorAccount);\n    console.log(signedData.signature);\n}\n\nsignDataExample();\n````\n\n\n#### verifySignedData\n\nThis API lets you verify the origin and integrity of a signed data object.\n\n````typescript\nimport { data, VerifySignedDataParams, SignedDataCheckParams, EntityCheckParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst verifySignedDataExample = async () => {\n\n    /* [optional] create a user callback for custom signed data checking logic */\n    const signedDataCheckCb = (params: SignedDataCheckParams): boolean => {\n        \n        /* params contains the signed data object and signature time */\n        console.log(params.signedData);\n        console.log(params.signatureTime);\n\n        return true; // must return true to continue verification. False throws an verification error\n    };\n\n    /* [optional] create a user callback for custom entity checking logic */\n    const entityCheckCb = (entity: EntityCheckParams): boolean => {\n        \n        /* entity parameter contains the account name and data fields */\n        console.log(entity.account);\n        console.log(entity.protocolVersion);\n        console.log(entity.entityType);\n        console.log(entity.state);\n        console.log(entity.payload);\n\n        return true; // must return true to continue verification. False throws an verification error\n    };\n\n\n    /* set parameters */\n    const params: VerifySignedDataParams = {\n        trustedRootAccount: \"ARDOR-TRUS-TEDR-OOTA-CCOUN\",\n        signedData: signedDataObject,                       // signed data to be verified. Created with signData API\n        signedDataCheckCallback: signedDataCheckCb,         // [optional] user callback called while signed data checking\n        entityCheckCallback: entityCheckCb                  // [optional] user callback called every time an entity is checked\n    };\n\n    try {\n\n        /* create and emit request. Throws an error in case of failing verification */\n        const response = await data.verifySignedData(\"https://testardor.jelurida.com\", params, true);\n\n        /* response implements the VerifySignedDataResponse interface */\n        console.log(response.activeRootAccount);\n        console.log(response.verifiedTrustChain);\n\n    } catch (e) { /* see error handling */ }\n}\n\nverifySignedDataExample();\n````\n\n\n### Entity\n\nThe Entity module provides the possibility to retrieve account information.\n\n````typescript\n- getEntity(url: string, params: GetEntityParams): Promise<GetEntityResponse>\n````\n\n\n#### getEntity\n\n````typescript\nimport { entity, GetEntityParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst getEntityExample = async () => {\n\n    /* set parameters */\n    const params: GetEntityParams = {\n        account: \"ARDOR-ACCO-UNTT-OBER-ETRIE\",  // account to be retrieved\n        attestationContext: \"exampleContext\",\n        attestor: \"ARDOR-ATTE-STOR-ACCO-UNTXX\" // [optional] attestor account\n    };\n    \n    try {\n\n        /* create and emit request */\n        const response = await entity.getEntity(\"https://testardor.jelurida.com\", params);\n        \n        /* response implements the GetEntityResponse interface */\n        console.log(response.account);\n        console.log(response.attestationContext);\n        console.log(response.entityType);\n        console.log(response.payload);\n        console.log(response.protocolVersion);\n        console.log(response.redirectAccount);\n        console.log(response.state);\n\n    } catch (e) { /* see error handling */ }\n}\n\ngetEntityExample();\n````\n\n\n### Error Handling\n\nThere is an unified error handling for all asynchronous APIs. Every API throws an error in case of any failures or unmet conditions. Every error implements the 'Error' interface of this library. The interface consist of two data fields. The *code* field contains a value of the 'ErrorCode' enum to indicate the error reason. The *description* field contains a human readable description of the cause of the thrown error.\n\n````typescript\nimport { entity, Error, ErrorCode, GetEntityParams } from '@blobaa/attestation-protocol-ts'\n\n\nconst errorHandlingExample = async () => {\n\n    const params: GetEntityParams = {\n        account: \"ARDOR-5TT2-VS3T-EUTS-7WDBA\",\n        attestationContext: \"exampleContext\",\n    };\n            \n    try {\n\n        /* create and emit request */\n        await entity.getEntity(\"https://testardor42.jelurida.com\", params); // throws an error because the subdomain is renamed to a non-existing record\n\n    } catch (e) {\n        \n        /* all errors implement the library's Error interface */\n        const error = e as Error;\n\n        /* every error has an error code that corresponds to the ErrorCode enum */\n        if(error.code === ErrorCode.CONNECTION_ERROR) {\n             //  handle connection error here\n        }\n\n        console.log(error.code);\n        console.log(error.description);\n    }\n}\n\nerrorHandlingExample();\n````\n\n\n## Module Instantiation\n\nEach module is pre instantiated and importable via the lower case module name. If you need the class definition of a module, import it via the upper case name. For example:\n\n````typescript\nimport { SignDataParams, data, Data } from '@blobaa/attestation-protocol-ts'\n\n\nconst params: SignDataParams = {\n    attestationContext: \"exampleContext\",\n    payload: \"exampleDataPayload\",\n    passphrase: \"<some passphrase>\"\n};\n\n\n/* use the default instance */\nconst signedData = data.signData(params);\nconsole.log(signedData);\n\n/* use your own instance */\nconst myData = new Data();\nconst signedData2 = myData.signData(params);\nconsole.log(signedData2);\n````\n\n\n## Licensing\n\n### Dual-License\n\nattestation-protocol-ts source code (\"The Software\") is licensed under **both** GNU Affero General Public License v3.0 or later **and** a proprietary license that can be arranged with me. In practical sense, this means:\n\n- If you are developing Open Source Software (OSS) based on attestation-protocol-ts, chances are you will be able to use attestation-protocol-ts freely under AGPL. Please double check [here](https://www.gnu.org/licenses/agpl-3.0.en.html) for OSS license compatibility with AGPL.\n- Alternatively, if you are unable to release your application as Open Source Software, you may arrange alternative licensing with me. Just send your inquiry to hi.blobaa@gmail.com to discuss this option.\n\n____\nEnjoy :)","readmeFilename":"README.md"}