diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..36af2198 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/README.md b/README.md index 9e1135bf..7213b2b1 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,13 @@ -
-tyronZIL -
-
-

Own your data, empower your world!

-
+This is an [open-source](./LICENSE) client for Node.js that implements the [Tyron Self-Sovereign Identity Protocol](https://www.ssiprotocol.com). -Decentralized identity client powered by [Zilliqa](https://zilliqa.com) :zap: +## W3C DID Method -For the management of Decentralized Identifiers (DIDs), tyronZIL implements the Tyron SSI Protocol, which includes the deployment of the user-owned [DID-Smart-Contract](./src/lib/blockchain/smart-contracts/DIDC-latest.scilla). With Tyron, the user is in control of their Decentralized Identifier. +The tyronzil DID Method is conformant with the World Wide Web Consortium (W3C) [Decentralized Identifiers (DIDs) v1.0](https://w3c.github.io/did-core/) specification and registered in the [W3C DID Specification Registries](https://w3c.github.io/did-spec-registries/). -## W3C DID-Method +## Files -The [tyronZIL DID-Method](https://www.tyronzil.com) is conformant with the World Wide Web Consortium (W3C) [Decentralized Identifiers (DIDs) v1.0](https://w3c.github.io/did-core/) specification and the first DID-Method for the Zilliqa blockchain platform registered in the [DID Specification Registries](https://w3c.github.io/did-spec-registries/). +- [Code of conduct](./files/CODE_OF_CONDUCT.md) -Check out the [development roadmap!](./files/roadmap.md) +- [Contributing guideline](./files/CONTRIBUTING.md) -## Problem summary - -Identities on the internet remain centralized, mainly by identity providers such as Facebook, Google and PayPal. Thus, when people shop online and login with these accounts, they don't have enough control nor understanding of how their data is used and shared with third parties. Furthermore, decentralized applications are still difficult to grasp for most regular users, and Decentralized Identifiers (DIDs) can make the user experience much better while increasing privacy and security. - -## Tyron - -Self-Sovereign Identity (SSI) allows people to manage their digital identities, proving who they are without a middleman, by anchoring DIDs on blockchain platforms as a shared root of trust. However, most blockchains still can't provide decentralized identity at scale. By implementing the Tyron SSI Protocol, tyronZIL aims to solve this issue and enable user-controlled digital identities. - -The word Tyron derives from the Greek *turannos* that means sovereign, and ***Tyron's purpose is to give people sovereignty over their data***. - -## Contributing - -It'd be great to have your help! Please refer to the [contributing guideline](./files/CONTRIBUTING.md) and [code of conduct](./files/CODE_OF_CONDUCT.md) :high_brightness: - -## Try it out - -[Installation](./files/installation.md) to get up and running with the command-line interface! +- [Installation guide](./files/installation.md) diff --git a/files/CODE_OF_CONDUCT.md b/files/CODE_OF_CONDUCT.md index 83e3cab2..b42618b2 100644 --- a/files/CODE_OF_CONDUCT.md +++ b/files/CODE_OF_CONDUCT.md @@ -2,11 +2,11 @@ ## 1. Purpose -A primary goal of tyron's community is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof). +A primary goal of our community is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof). This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior. -We invite all those who participate in tyron's community to help us create safe and positive experiences for everyone. +We invite all those who participate in our community to help us create safe and positive experiences for everyone. ## 2. Open [Source/Culture/Tech] Citizenship @@ -45,7 +45,7 @@ The following behaviors are considered harassment and are unacceptable within ou ## 5. Weapons Policy -No weapons will be allowed at tyron's community events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter. +No weapons will be allowed at community events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter. ## 6. Consequences of Unacceptable Behavior diff --git a/files/CONTRIBUTING.md b/files/CONTRIBUTING.md index 5612b6a8..c14cb235 100644 --- a/files/CONTRIBUTING.md +++ b/files/CONTRIBUTING.md @@ -2,40 +2,20 @@ Thanks for your interest in contributing to this project. -It'd be so cool to have a growing number of contributors, and you are encouraged to become one of them! That would help tyron to achieve its purpose: +It'd be so cool to have a growing number of contributors, and you are encouraged to become one of them! -```rust -To give people sovereignty over their data -``` +No matter your background or technical expertise, **your feedback is valuable**, so please share your ideas, suggestions, or questions on our [Discord channel](https://discord.gg/FMAUh4ZNwZ) in Zilgineers. -> No matter your background or technical expertise, **your feedback is valuable**, so please share your ideas, suggestions, questions, etc. +## Open-source software & license -## INDEX - -- [Open source software & licenses](#open-source-software--licenses) - -- [How to contribute](#how-to-contribute-high_brightness) - -- [Contact info](#contact-info) - -## Open source software & license - -```Open source software``` means you have the freedom to use, study, copy, modify and distribute the source code. +Open-source software means you have the freedom to use, study, copy, modify and distribute the source code. These permissions are enforced through a [GNU General Public License v3.0](../LICENSE) that protects your contributor rights with two steps: (1) asserts copyright on the software, and (2) offers you legal permission to copy, distribute and/or modify the software. ## How to contribute :high_brightness: -Please keep in mind Tyron's [code of conduct](./CODE_OF_CONDUCT.md) while contributing. +Please keep in mind our [code of conduct](./CODE_OF_CONDUCT.md) while contributing. > New to [markdown?](https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops) > :mag: Explore the [emoji markup!](https://gist.github.com/rxaviers/7360908) -### Pull requests - -To share your contributions, please send a pull request. - -## Contact info - -eMail: juliocabdu@pm.me - -Mobile: (+45)429-553-20 (same number on Signal, Telegram, WhatsApp and iMessage) +To contribute, please fork, develop in your repo and send a pull request. Join the discussion regarding guidelines [here](https://github.com/Zillacracy-org/ssibrowser.com/discussions/1). diff --git a/files/installation.md b/files/installation.md index 187657a3..6943b628 100644 --- a/files/installation.md +++ b/files/installation.md @@ -1,69 +1,72 @@ -# Install tyronZIL-js +# Install the SSI client > Getting ready: -> - Recommended to use [nvm](https://github.com/nvm-sh/nvm) to install node.js ```nvm use 12``` +> - Recommended to use [nvm](https://github.com/nvm-sh/nvm) to install node.js > - Make sure to have the latest version of npm: ```npm install -g npm``` > - Also, install [node-gyp](https://github.com/nodejs/node-gyp): ```npm install -g node-gyp``` On macOS ```xcode-select --install``` as well -1. ```git clone https://github.com/julio-cabdu/tyronZIL-js``` +1. ```git clone https://github.com/Zillacracy-org/ssiclient``` -2. ```cd tyronZIL-js``` +2. ```cd ssiclient``` 3. ```git status``` -> To start contributing, create your topic branch: ```git checkout -b yourTyron``` -4. ```npm install``` +4. ```npm i``` -5. ```npm run build``` +5. ```npm run tyronzil``` -6. To get the CLI ready: -```npm install -g .``` +## tyronzil command-line interface -## tyronZIL-CLI +### Deploy -### DID-create +Deploy a tyron smart contract with: -Create your brand new tyronZIL DID and save it on the Zilliqa blockchain platform, forever. +```tyronzil deploy``` + +### DID Create + +Create your brand new tyronzil DID and save it on the Zilliqa blockchain platform, forever. ```tyronzil did create``` and follow the instructions :zap: -> More info [here](https://www.tyronzil.com/operations/CRUD/did-create/) -> For your convenience, you could use [these testing-accounts](./testing-accounts.md) +For your convenience, you can use [these testing-accounts](./testing-accounts.md). + +> More info [here](https://www.tyronzil.com/CRUD-operations/did-create/) -### DID-resolve +### DID Resolve -Resolve any DID into its corresponding DID-document or DID-resolution-result with: +Resolve any DID into its corresponding DID Document or DID Resolution Result with: ```tyronzil resolve``` -> More info [here](https://www.tyronzil.com/operations/CRUD/did-resolve/) +> More info [here](https://www.tyronzil.com/CRUD-operations/did-resolve/) -### DID-recover +### DID Recover -In case you want to reset your DID-state while keeping the same identifier, you need your recovery private key. +In case you want to reset your DID Document while keeping the same identifier, you need your recovery private key. ```tyronzil did recover``` and follow the instructions -> More info [here](https://www.tyronzil.com/operations/CRUD/did-recover/) +> More info [here](https://www.tyronzil.com/CRUD-operations/did-recover/) -### DID-update +### DID Update -To update your tyronZIL DID you need your update private key: +To update your tyronzil DID you need your update private key: ```tyronzil did update``` and follow the instructions -> More info [here](https://www.tyronzil.com/operations/CRUD/did-update/) +> More info [here](https://www.tyronzil.com/CRUD-operations/did-update/) -### DID-deactivate +### DID Deactivate To fully deactivate your DID: ```tyronzil did deactivate``` and follow the instructions -> After deactivation, the DID will not be useful anymore, and trying to resolve it must throw a 'DidDeactivated' error. +After deactivation, the DID will not be useful anymore, and trying to resolve it must throw a 'DidDeactivated' error. -> More info [here](https://www.tyronzil.com/operations/CRUD/did-deactivate/) +> More info [here](https://www.tyronzil.com/CRUD-operations/did-deactivate/) ## Documentation diff --git a/files/roadmap.md b/files/roadmap.md deleted file mode 100644 index 40bff85e..00000000 --- a/files/roadmap.md +++ /dev/null @@ -1,12 +0,0 @@ -# tyronZIL roadmap - -The tyronZIL project gets organized in development sprints of 4 weeks duration. - -Dates | Sprint ----|--- -29/6 - 24/7/2020 | Creates the tyronZIL DID-Client that performs DID CRUD operations (create, read, recover, update & deactivate). -27/7 - 21/8/2020 | Integrates the DID-Client with the Zilliqa blockchain platform. -24/8 - 18/9/2020 | Implements the [DID-Smart-Contract (DIDC)](https://www.tyronzil.com/smart-contracts/didc/) to immutably save and distribute DID-States. -21/9 - 11/12/2020 | **Tyron Improvement Proposal #1** - TIP1 consists of 3 sprints that aim to increase security and discoverability of Tyron Decentralized Identifiers (DIDs). -21/9 - 16/10/2020 | TIP1.1 implements Zilliqa's 32-byte private-keys to generate Schnorr signatures that can be verified by the DIDC. The contract also produces the SHA-256 hash of the Decentralized Identifier, which must be signed to deactivate the DID. And the DIDC can verify that all Schnorr signatures correspond to the [DID-Keys](https://www.tyronzil.com/protocol-parameters/#did-keys) that have their public keys stored in the contract. [Release notes](https://github.com/julio-cabdu/tyronZIL-js/releases/tag/v1.0.0-alpha). -19/10 - 13/11/2020 | TIP1.2 develops the *init.tyron* smart contract for the initialization of [@tyron.did](https://twitter.com/tyrondid) self-sovereign identities as well as a domain name system that implements the *.did*, *.agent* & *.tyron* domains. These top-level SSI Domains define the SSI Trinity constituted by the user as the owner of their decentralized identity, the agent providing products & services, and tyron as the technology & open organization. This development sprint also introduces the xWallet that gives ZRC-2 transfer capabilities to the DID smart contract (DIDC). By using a donation campaign code, the DIDC can send a commission-free transfer to another *user.did* & keep track of the token balance - find the donations prototype at [pung.me](https://pung.me). [Release notes](https://github.com/julio-cabdu/tyronZIL-js/releases/tag/v2.0.0-alpha). \ No newline at end of file diff --git a/files/tyronzil-logo.png b/files/tyronzil-logo.png deleted file mode 100644 index ba0fa2d5..00000000 Binary files a/files/tyronzil-logo.png and /dev/null differ diff --git a/package-lock.json b/package-lock.json index 02e10375..2b38db2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,31 +1,3889 @@ { - "name": "tyronzil-js", - "version": "2.0.0", - "lockfileVersion": 1, + "name": "ssiclient", + "version": "3.3.0", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "3.3.0", + "license": "GPL-3.0-only", + "dependencies": { + "@types/websocket": "^1.0.1", + "@zilliqa-js/zilliqa": "2.2.0", + "bn": "^1.0.5", + "chalk": "^4.1.0", + "node-fetch": "^3.2.10", + "readline-sync": "^1.4.10", + "tslib": "^2.1.0", + "tyron": "^3.12.4", + "yargs": "^15.4.0" + }, + "bin": { + "tyronzil": "dist/src/bin/index.js" + }, + "devDependencies": { + "@types/node": "^14.14.31", + "@types/readline-sync": "^1.4.3", + "@types/yargs": "^15.0.13", + "@typescript-eslint/eslint-plugin": "^3.8.0", + "@typescript-eslint/parser": "^3.8.0", + "copyfiles": "^2.4.1", + "eslint": "^7.20.0", + "husky": "^6.0.0", + "lint-staged": "^11.0.0", + "typedoc": "^0.17.8", + "typescript": "^3.9.9" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "node_modules/@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "node_modules/@types/bip39": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/bip39/-/bip39-2.4.2.tgz", + "integrity": "sha512-Vo9lqOIRq8uoIzEVrV87ZvcIM0PN9t0K3oYZ/CS61fIYKCBdOIM7mlWzXuRvSXrDtVa1uUO2w1cdfufxTC0bzg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "node_modules/@types/hdkey": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@types/hdkey/-/hdkey-0.7.1.tgz", + "integrity": "sha512-4Kkr06hq+R8a9EzVNqXGOY2x1xA7dhY6qlp6OvaZ+IJy1BCca1Cv126RD9X7CMJoXoLo8WvAizy8gQHpqW6K0Q==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "node_modules/@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + }, + "node_modules/@types/node": { + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==" + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/readline-sync": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/readline-sync/-/readline-sync-1.4.3.tgz", + "integrity": "sha512-YP9NVli96E+qQLAF2db+VjnAUEeZcFVg4YnMgr8kpDUFwQBnj31rPLOVHmazbKQhaIkJ9cMHsZhpKdzUeL0KTg==", + "dev": true + }, + "node_modules/@types/websocket": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.2.tgz", + "integrity": "sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yargs": { + "version": "15.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", + "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "20.2.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", + "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz", + "integrity": "sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "3.10.1", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^3.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", + "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", + "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", + "dev": true, + "dependencies": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.10.1", + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/typescript-estree": "3.10.1", + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.1.tgz", + "integrity": "sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==", + "dev": true, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz", + "integrity": "sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "3.10.1", + "@typescript-eslint/visitor-keys": "3.10.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz", + "integrity": "sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@zilliqa-js/account": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/account/-/account-2.2.0.tgz", + "integrity": "sha512-2K4RwHAxF4AxD7sAKbW6/7vI3UoxoG73IVAnw/poiw5HLaDdR7hHXBvoClSacnInhfaECJeXrCYIYvqGGN9FPA==", + "dependencies": { + "@types/bip39": "^2.4.0", + "@types/hdkey": "^0.7.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/proto": "2.2.0", + "@zilliqa-js/util": "2.2.0", + "bip39": "^2.5.0", + "hdkey": "^1.1.0" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/blockchain": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/blockchain/-/blockchain-2.2.0.tgz", + "integrity": "sha512-QWo21vKlZTXqxtDsGWmyoGRnljCRhP4RmGBn+q/dDp43WMp/mqHNlYVRbB17B3ToaYeI/omILTpGVx3/uNm6Zg==", + "dependencies": { + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/contract": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", + "utility-types": "^3.4.1" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/contract": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/contract/-/contract-2.2.0.tgz", + "integrity": "sha512-JFSxzp9SD/OsOPzBkm35O+p0xXusxFCzq5N1F/xLy5uTmnJqylUW+7T0EEXA0YlNJUtZM1YCN/TY3uzFFD6TVw==", + "dependencies": { + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/blockchain": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", + "hash.js": "^1.1.5", + "utility-types": "^2.1.0" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/contract/node_modules/utility-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-2.1.0.tgz", + "integrity": "sha512-/nP2gqavggo6l38rtQI/CdeV+2fmBGXVvHgj9kV2MAnms3TIi77Mz9BtapPFI0+GZQCqqom0vACQ+VlTTaCovw==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@zilliqa-js/core": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/core/-/core-2.2.0.tgz", + "integrity": "sha512-/SZiNJrzNsJov5L6CLiXOv+FoSy4lsHT/OcuO0Jd/cwWZm+nyEmVx9SFzU6NxDmK+v8E5oSGj/lC7nLW/XXQPw==", + "dependencies": { + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", + "cross-fetch": "^2.2.2", + "mitt": "^1.1.3" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/crypto": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/crypto/-/crypto-2.2.0.tgz", + "integrity": "sha512-CwX2+SLmVaKG2Tlzud6qIEMzAboDcbuGXDJytMt5CLinFHMYjjOZfyFyzIq7Ttkg9ny5mNfUulmVEn0kM90unA==", + "dependencies": { + "@zilliqa-js/util": "2.2.0", + "aes-js": "^3.1.1", + "bsert": "^0.0.4", + "elliptic": "^6.5.0", + "hash.js": "^1.1.5", + "hmac-drbg": "^1.0.1", + "pbkdf2": "^3.0.16", + "randombytes": "^2.0.6", + "scryptsy": "^2.1.0", + "sodium-native": "^3.2.0", + "uuid": "^3.3.2" + } + }, + "node_modules/@zilliqa-js/proto": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/proto/-/proto-2.2.0.tgz", + "integrity": "sha512-0QPNJdvafT0ItPGrqEff7KMYNCT/DkWCn0/x2/UwVoVANy5BHL3WkwDV3y49KthVwdZUotQVzRaweHTs6PIcuA==", + "dependencies": { + "protobufjs": "^6.8.8" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/subscriptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/subscriptions/-/subscriptions-2.2.0.tgz", + "integrity": "sha512-wwFbXTWvwgCc0hqSCRM+2cbe4doW4q7wMmjGxW6DUwRxIrCNmF2ZX0G3ls8Z6I7Bxq90RwoVxNU62sMMkuxj2g==", + "dependencies": { + "@zilliqa-js/core": "2.2.0", + "mock-socket": "^9.0.2", + "websocket": "^1.0.28" + } + }, + "node_modules/@zilliqa-js/util": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/util/-/util-2.2.0.tgz", + "integrity": "sha512-bzThiraMQKDumhQY0HMsutX28HPgqB+KKqiet8M8QQbCFvQODxAGpuxJX6bZiX+6K6tZUk8yDSW8Ri3dgOdRDg==", + "dependencies": { + "@types/bn.js": "^4.11.3", + "@types/long": "^4.0.0", + "bn.js": "^4.11.8", + "long": "^4.0.0" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/@zilliqa-js/zilliqa": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/zilliqa/-/zilliqa-2.2.0.tgz", + "integrity": "sha512-S2XKSqEYGTWXal1pqit48vpki6l0l7kO3kI3Q5/N/aEIS+iq+Ug0vJ2eIqXRTK4HJVbA67sk7yCZgfC1qSOd3Q==", + "dependencies": { + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/blockchain": "2.2.0", + "@zilliqa-js/contract": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/subscriptions": "2.2.0", + "@zilliqa-js/util": "2.2.0" + }, + "engines": { + "node": ">=10.0.0 <15" + } + }, + "node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bip39": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.6.0.tgz", + "integrity": "sha512-RrnQRG2EgEoqO24ea+Q/fftuPUZLmrEM3qNhhGsA3PbaXaCW791LTzPuVyx/VprXQcTbPJ3K3UeTna8ZnVl2sg==", + "dependencies": { + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1", + "safe-buffer": "^5.0.1", + "unorm": "^1.3.3" + } + }, + "node_modules/bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bn": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bn/-/bn-1.0.5.tgz", + "integrity": "sha512-7TvGbqbZb6lDzsBtNz1VkdXXV0BVmZKPPViPmo2IpvwaryF7P+QKYKACyVkwo2mZPr2CpFiz7EtgPEcc3o/JFQ==" + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/bsert": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/bsert/-/bsert-0.0.4.tgz", + "integrity": "sha512-VReLe1aTaHRmf80YLOHUk8ONQ48SjseZP76GlNIDheD5REYByn/Mm9yrtI0/ZCaFrcfxzgpiw1/hMMCUOSMa3w==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "node_modules/bufferutil": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/copyfiles/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/copyfiles/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/copyfiles/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/copyfiles/node_modules/yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-fetch": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.6.tgz", + "integrity": "sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA==", + "dependencies": { + "node-fetch": "^2.6.7", + "whatwg-fetch": "^2.0.4" + } + }, + "node_modules/cross-fetch/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "dependencies": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dependencies": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", + "dev": true, + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dependencies": { + "type": "^2.0.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hdkey": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", + "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", + "dependencies": { + "bs58check": "^2.1.2", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/husky": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", + "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/lint-staged": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.0.0.tgz", + "integrity": "sha512-3rsRIoyaE8IphSUtO1RVTFl1e0SLBtxxUOPBtHxQgBHS5/i6nqvjcUfNioMa4BU9yGnPzbO+xkfLtXtxBpCzjw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.1", + "cli-truncate": "^2.1.0", + "commander": "^7.2.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.3.1", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^5.0.0", + "listr2": "^3.8.2", + "log-symbols": "^4.1.0", + "micromatch": "^4.0.4", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/listr2": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.10.0.tgz", + "integrity": "sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw==", + "dev": true, + "dependencies": { + "cli-truncate": "^2.1.0", + "colorette": "^1.2.2", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.7", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/marked": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "dev": true, + "bin": { + "marked": "bin/marked" + }, + "engines": { + "node": ">= 8.16.2" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/mitt": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", + "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==" + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mock-socket": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.0.3.tgz", + "integrity": "sha512-SxIiD2yE/By79p3cNAAXyLQWTvEFNEzcAO7PH+DzRqKSFaplAPFjiQLmw8ofmpCsZf+Rhfn2/xCJagpdGmYdTw==", + "dependencies": { + "url-parse": "^1.4.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", + "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/noms/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/noms/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "dependencies": { + "semver-compare": "^1.0.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/protobufjs": { + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", + "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "node_modules/scryptsy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" + }, + "node_modules/secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sodium-native": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-3.2.1.tgz", + "integrity": "sha512-EgDZ/Z7PxL2kCasKk7wnRkV8W9kvwuIlHuHXAxkQm3FF0MgVsjyLBXGjSRGhjE6u7rhSpk3KaMfFM23bfMysIQ==", + "hasInstallScript": true, + "dependencies": { + "ini": "^1.3.5", + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/table/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typedoc": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", + "integrity": "sha512-/OyrHCJ8jtzu+QZ+771YaxQ9s4g5Z3XsQE3Ma7q+BL392xxBn4UMvvCdVnqKC2T/dz03/VXSLVKOP3lHmDdc/w==", + "dev": true, + "dependencies": { + "fs-extra": "^8.1.0", + "handlebars": "^4.7.6", + "highlight.js": "^10.0.0", + "lodash": "^4.17.15", + "lunr": "^2.3.8", + "marked": "1.0.0", + "minimatch": "^3.0.0", + "progress": "^2.0.3", + "shelljs": "^0.8.4", + "typedoc-default-themes": "^0.10.2" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "typescript": ">=3.8.3" + } + }, + "node_modules/typedoc-default-themes": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.2.tgz", + "integrity": "sha512-zo09yRj+xwLFE3hyhJeVHWRSPuKEIAsFK5r2u47KL/HBKqpwdUSanoaz5L34IKiSATFrjG5ywmIu98hPVMfxZg==", + "dev": true, + "dependencies": { + "lunr": "^2.3.8" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/typescript": { + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/tyron": { + "version": "3.12.4", + "resolved": "https://registry.npmjs.org/tyron/-/tyron-3.12.4.tgz", + "integrity": "sha512-5uAIVGzOJHIyr7J9npzAs+ibksxpmv8gr9VXgGGy7ulwcIdeaBYhudbxaRUtd16aZbtZ7piuTjf4GhNVjXO7sQ==", + "dependencies": { + "@zilliqa-js/zilliqa": "3.0.0" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/account/-/account-3.0.0.tgz", + "integrity": "sha512-3+Mprf8sgYzdCzqMG3Hz9jFAYbGo7oCZlMqCbl9IZu1RU4wU5Zb0HBQrJHcw9H02IePCP/NVMVmEQOcWVPTwAA==", + "dependencies": { + "@types/bip39": "^2.4.0", + "@types/hdkey": "^0.7.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/proto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "bip39": "^2.5.0", + "hdkey": "^1.1.0" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/blockchain": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/blockchain/-/blockchain-3.0.0.tgz", + "integrity": "sha512-jrGBogGupJ8yl0TW78GBytQmSzGguz8oOEfwOXJVSfXDDsFKNuWY3eDJp4a8Af6dA66bl9slXEIF76Kpj28tng==", + "dependencies": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/contract": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "utility-types": "^3.4.1" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/contract": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/contract/-/contract-3.0.0.tgz", + "integrity": "sha512-8GhqBD3/rhCiGhcggkFL3zM8s/f8GyaH1RM3Kkg11ETVPLw3xlxbbG668wyagQ0Qb2yEt5n/C/fLbtR9Ch8Jyg==", + "dependencies": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/blockchain": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "hash.js": "^1.1.5", + "utility-types": "^2.1.0" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/contract/node_modules/utility-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-2.1.0.tgz", + "integrity": "sha512-/nP2gqavggo6l38rtQI/CdeV+2fmBGXVvHgj9kV2MAnms3TIi77Mz9BtapPFI0+GZQCqqom0vACQ+VlTTaCovw==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/core": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/core/-/core-3.0.0.tgz", + "integrity": "sha512-aDeOqGl2gOZ8LQhCFDGgOX0L8ZX6amnFEIyLc3vXzzQ0vX+jZ19U2q6IFI82eIPNZuUBNrcei0Wefe3D6dyjsw==", + "dependencies": { + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "cross-fetch": "^2.2.2", + "mitt": "^1.1.3" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/crypto/-/crypto-3.0.0.tgz", + "integrity": "sha512-vs4xWG8C+/UzqfKNreRfe1TrzKwvXZUI+3BD2X+fTtSST1ZXwX9KRa3T3MdmK252tiYqNhWm/YJBr36lPYRX3A==", + "dependencies": { + "@zilliqa-js/util": "3.0.0", + "aes-js": "^3.1.1", + "bsert": "^0.0.4", + "elliptic": "^6.5.0", + "hash.js": "^1.1.5", + "hmac-drbg": "^1.0.1", + "pbkdf2": "^3.0.16", + "randombytes": "^2.0.6", + "scrypt-js": "^3.0.1", + "scryptsy": "^2.1.0", + "sodium-native": "^3.2.0", + "uuid": "^3.3.2" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/proto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/proto/-/proto-3.0.0.tgz", + "integrity": "sha512-FnLmNica3kZwUY8WbzPyUDM27YnXvWdzReuX87VVrhQgTIfGExOECIep/8ogs465U7CJQtEjxrOTAqSytDBNPA==", + "dependencies": { + "protobufjs": "^6.8.8" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/subscriptions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/subscriptions/-/subscriptions-3.0.0.tgz", + "integrity": "sha512-AmMsgNOTjGOO2TdYr+RUTXHTVnTU8gXeuRDJOpWJfeRQi27tf99zi7GwqbyYiWsPznBqD2BmirBHNxao+QKf6A==", + "dependencies": { + "@zilliqa-js/core": "3.0.0", + "mock-socket": "^9.0.2", + "websocket": "^1.0.28" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/util/-/util-3.0.0.tgz", + "integrity": "sha512-4TWHZ8gXmMmRrwkok2Py3YSUXl4udnnmI6EY6UmdtRtKiJl9LEjpGlq0+3YwGAouLrTPPkIxBXXETCDhX6D6Xg==", + "dependencies": { + "@types/bn.js": "^4.11.3", + "@types/long": "^4.0.0", + "bn.js": "^4.11.8", + "long": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/tyron/node_modules/@zilliqa-js/zilliqa": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/zilliqa/-/zilliqa-3.0.0.tgz", + "integrity": "sha512-dG8dXqsIhLs7KS8qCdC8ilP+rOX7wKEQuLG+ra3sdGeJgD283jw8bb05UGzqpmrRKFtG3DybHtYcqcgSWY9uBw==", + "dependencies": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/blockchain": "3.0.0", + "@zilliqa-js/contract": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/subscriptions": "3.0.0", + "@zilliqa-js/util": "3.0.0" + }, + "engines": { + "node": ">=12.0.0 <15" + } + }, + "node_modules/uglify-js": { + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unorm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", + "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz", + "integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/utility-types": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz", + "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "dependencies": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/websocket/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/websocket/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "engines": { + "node": ">=0.10.32" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + }, "dependencies": { "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "requires": { "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.14.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -65,6 +3923,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -83,38 +3947,20 @@ } }, "@eslint/eslintrc": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", - "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", - "lodash": "^4.17.19", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@protobufjs/aspromise": { @@ -179,15 +4025,6 @@ "@types/node": "*" } }, - "@types/bitcore-lib": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@types/bitcore-lib/-/bitcore-lib-0.15.2.tgz", - "integrity": "sha512-4EGo5FunshASa0xq2Ta2zfi5CANZ7SB6NfHXJKHk5QUort8ywL1Z7tE9Mr5ft7mHjXQVBngqTguQ8Y5So37hiA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -211,9 +4048,9 @@ } }, "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", "dev": true }, "@types/long": { @@ -222,9 +4059,15 @@ "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/node": { - "version": "14.11.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.5.tgz", - "integrity": "sha512-jVFzDV6NTbrLMxm4xDSIW/gKnk8rQLF9wAzLWIOg+5nU6ACrIMndeBdXci0FGtqJbP9tQvm6V39eshc96TO2wQ==" + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==" + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true }, "@types/readline-sync": { "version": "1.4.3", @@ -233,57 +4076,40 @@ "dev": true }, "@types/websocket": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.1.tgz", - "integrity": "sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.2.tgz", + "integrity": "sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ==", "requires": { "@types/node": "*" } }, "@types/yargs": { - "version": "15.0.7", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.7.tgz", - "integrity": "sha512-Gf4u3EjaPNcC9cTu4/j2oN14nSVhr8PQ+BvBcBQHAhDZfl0bVIiLgvnRXv/dn58XhTm9UXvBpvJpDlwV65QxOA==", + "version": "15.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", + "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", - "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "version": "20.2.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", + "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", "dev": true }, "@typescript-eslint/eslint-plugin": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz", - "integrity": "sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "3.10.1", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "integrity": "sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "3.10.1", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" } }, "@typescript-eslint/experimental-utils": { @@ -332,23 +4158,6 @@ "lodash": "^4.17.15", "semver": "^7.3.2", "tsutils": "^3.17.1" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@typescript-eslint/visitor-keys": { @@ -361,43 +4170,43 @@ } }, "@zilliqa-js/account": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/account/-/account-1.0.0.tgz", - "integrity": "sha512-pu9g3PB1Q5UtJiGuAQ0G//AHp697QdE6nuceN73Jks2NKfY32pYba0lRg5mcyP777YWW38wiBcT4E5O2pU+94Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/account/-/account-2.2.0.tgz", + "integrity": "sha512-2K4RwHAxF4AxD7sAKbW6/7vI3UoxoG73IVAnw/poiw5HLaDdR7hHXBvoClSacnInhfaECJeXrCYIYvqGGN9FPA==", "requires": { "@types/bip39": "^2.4.0", "@types/hdkey": "^0.7.0", - "@zilliqa-js/core": "1.0.0", - "@zilliqa-js/crypto": "1.0.0", - "@zilliqa-js/proto": "0.11.1", - "@zilliqa-js/util": "0.11.1", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/proto": "2.2.0", + "@zilliqa-js/util": "2.2.0", "bip39": "^2.5.0", "hdkey": "^1.1.0" } }, "@zilliqa-js/blockchain": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/blockchain/-/blockchain-1.0.0.tgz", - "integrity": "sha512-M7FI9IkX/e1DayQjzDFLuivtw51pEXekj66G9MvIcm9wYDICWGD05ucSGCHuYGquj4oi2n+dFDxOH0VPSJrcLQ==", - "requires": { - "@zilliqa-js/account": "1.0.0", - "@zilliqa-js/contract": "1.0.0", - "@zilliqa-js/core": "1.0.0", - "@zilliqa-js/crypto": "1.0.0", - "@zilliqa-js/util": "0.11.1", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/blockchain/-/blockchain-2.2.0.tgz", + "integrity": "sha512-QWo21vKlZTXqxtDsGWmyoGRnljCRhP4RmGBn+q/dDp43WMp/mqHNlYVRbB17B3ToaYeI/omILTpGVx3/uNm6Zg==", + "requires": { + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/contract": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", "utility-types": "^3.4.1" } }, "@zilliqa-js/contract": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/contract/-/contract-1.0.0.tgz", - "integrity": "sha512-cwxKi7ZyfTW43JTqDNM86A/cK1y1mTI6iwaDBnGahj8w3kQOGficZr1oc0SOsyHNo5l1ACuywDnLgv7/aPaeJw==", - "requires": { - "@zilliqa-js/account": "1.0.0", - "@zilliqa-js/blockchain": "1.0.0", - "@zilliqa-js/core": "1.0.0", - "@zilliqa-js/crypto": "1.0.0", - "@zilliqa-js/util": "0.11.1", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/contract/-/contract-2.2.0.tgz", + "integrity": "sha512-JFSxzp9SD/OsOPzBkm35O+p0xXusxFCzq5N1F/xLy5uTmnJqylUW+7T0EEXA0YlNJUtZM1YCN/TY3uzFFD6TVw==", + "requires": { + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/blockchain": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", "hash.js": "^1.1.5", "utility-types": "^2.1.0" }, @@ -410,22 +4219,22 @@ } }, "@zilliqa-js/core": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/core/-/core-1.0.0.tgz", - "integrity": "sha512-qlJP6cX/NJcILU7+N2Uwy3uq2xkk1cEiMhJIf4EM0v7A3YY9icr1Y5oUl4cSexjxnAumH4keJNnv15ArzG4e3Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/core/-/core-2.2.0.tgz", + "integrity": "sha512-/SZiNJrzNsJov5L6CLiXOv+FoSy4lsHT/OcuO0Jd/cwWZm+nyEmVx9SFzU6NxDmK+v8E5oSGj/lC7nLW/XXQPw==", "requires": { - "@zilliqa-js/crypto": "1.0.0", - "@zilliqa-js/util": "0.11.1", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/util": "2.2.0", "cross-fetch": "^2.2.2", "mitt": "^1.1.3" } }, "@zilliqa-js/crypto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/crypto/-/crypto-1.0.0.tgz", - "integrity": "sha512-YFBH2om7p+mgRrGhEcGdbYf/ymA3JL3xXYXySUuXZ63zNiiNbKupPJpDMDSre+dcJImYWD9hMumOkWBtZYP1Fw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/crypto/-/crypto-2.2.0.tgz", + "integrity": "sha512-CwX2+SLmVaKG2Tlzud6qIEMzAboDcbuGXDJytMt5CLinFHMYjjOZfyFyzIq7Ttkg9ny5mNfUulmVEn0kM90unA==", "requires": { - "@zilliqa-js/util": "0.11.1", + "@zilliqa-js/util": "2.2.0", "aes-js": "^3.1.1", "bsert": "^0.0.4", "elliptic": "^6.5.0", @@ -433,34 +4242,33 @@ "hmac-drbg": "^1.0.1", "pbkdf2": "^3.0.16", "randombytes": "^2.0.6", - "scrypt.js": "^0.3.0", "scryptsy": "^2.1.0", "sodium-native": "^3.2.0", "uuid": "^3.3.2" } }, "@zilliqa-js/proto": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@zilliqa-js/proto/-/proto-0.11.1.tgz", - "integrity": "sha512-8fIXnh4uuoZU7bMCSAMoelGOeEpQlCUtc+e6/g9vjijsA0SoBMOpqfzdZpVvyBkmPqZV+yUCXFGb2HyS3n1dcg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/proto/-/proto-2.2.0.tgz", + "integrity": "sha512-0QPNJdvafT0ItPGrqEff7KMYNCT/DkWCn0/x2/UwVoVANy5BHL3WkwDV3y49KthVwdZUotQVzRaweHTs6PIcuA==", "requires": { "protobufjs": "^6.8.8" } }, "@zilliqa-js/subscriptions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/subscriptions/-/subscriptions-1.0.0.tgz", - "integrity": "sha512-b/Wglit8UQ//92fiSpXf5+9kpmnI8ipezu2B1DAornGrG7s0tLojNhRISISZ6nDafZ2Pc5Wb8rWhTW8oLcGHAA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/subscriptions/-/subscriptions-2.2.0.tgz", + "integrity": "sha512-wwFbXTWvwgCc0hqSCRM+2cbe4doW4q7wMmjGxW6DUwRxIrCNmF2ZX0G3ls8Z6I7Bxq90RwoVxNU62sMMkuxj2g==", "requires": { - "@zilliqa-js/core": "1.0.0", + "@zilliqa-js/core": "2.2.0", "mock-socket": "^9.0.2", "websocket": "^1.0.28" } }, "@zilliqa-js/util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@zilliqa-js/util/-/util-0.11.1.tgz", - "integrity": "sha512-eD6lgY/8kexbxnlGrhE1+gB9D69+5oVfhdjOc4LNKUKsu9aWfg4AdrEWwgt0wndNbbGQcN8JKzlkCXtjNpsk5A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/util/-/util-2.2.0.tgz", + "integrity": "sha512-bzThiraMQKDumhQY0HMsutX28HPgqB+KKqiet8M8QQbCFvQODxAGpuxJX6bZiX+6K6tZUk8yDSW8Ri3dgOdRDg==", "requires": { "@types/bn.js": "^4.11.3", "@types/long": "^4.0.0", @@ -469,17 +4277,17 @@ } }, "@zilliqa-js/zilliqa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@zilliqa-js/zilliqa/-/zilliqa-1.0.0.tgz", - "integrity": "sha512-jLDCh2F075kZOI8HCZGYpRsYTd4Fbb5naOy2y30tpqOqjqImJDShpEPv8hDZhPj3wi6FoHMYM49IeO7XPKDa3Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/zilliqa/-/zilliqa-2.2.0.tgz", + "integrity": "sha512-S2XKSqEYGTWXal1pqit48vpki6l0l7kO3kI3Q5/N/aEIS+iq+Ug0vJ2eIqXRTK4HJVbA67sk7yCZgfC1qSOd3Q==", "requires": { - "@zilliqa-js/account": "1.0.0", - "@zilliqa-js/blockchain": "1.0.0", - "@zilliqa-js/contract": "1.0.0", - "@zilliqa-js/core": "1.0.0", - "@zilliqa-js/crypto": "1.0.0", - "@zilliqa-js/subscriptions": "1.0.0", - "@zilliqa-js/util": "0.11.1" + "@zilliqa-js/account": "2.2.0", + "@zilliqa-js/blockchain": "2.2.0", + "@zilliqa-js/contract": "2.2.0", + "@zilliqa-js/core": "2.2.0", + "@zilliqa-js/crypto": "2.2.0", + "@zilliqa-js/subscriptions": "2.2.0", + "@zilliqa-js/util": "2.2.0" } }, "acorn": { @@ -492,17 +4300,28 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true + "dev": true, + "requires": {} }, "aes-js": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { - "version": "6.12.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", - "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -517,10 +4336,27 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -540,15 +4376,15 @@ } }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "base-x": { @@ -593,9 +4429,9 @@ "integrity": "sha512-7TvGbqbZb6lDzsBtNz1VkdXXV0BVmZKPPViPmo2IpvwaryF7P+QKYKACyVkwo2mZPr2CpFiz7EtgPEcc3o/JFQ==" }, "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "brace-expansion": { "version": "1.1.11", @@ -607,6 +4443,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -654,18 +4499,11 @@ "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "bufferutil": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", - "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==" - } + "node-gyp-build": "^4.2.0" } }, "callsites": { @@ -680,9 +4518,9 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -697,6 +4535,31 @@ "safe-buffer": "^5.0.1" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -705,6 +4568,18 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } } }, "color-convert": { @@ -720,6 +4595,18 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -727,9 +4614,9 @@ "dev": true }, "copyfiles": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.0.tgz", - "integrity": "sha512-yGjpR3yjQdxccW8EcJ4a7ZCA6wGER6/Q2Y+b7bXbVxGeSHBf93i9d7MzTsx+VV1CpMKQa3v4ThZfXBcltMzl0w==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", "dev": true, "requires": { "glob": "^7.0.5", @@ -738,7 +4625,47 @@ "noms": "0.0.0", "through2": "^2.0.1", "untildify": "^4.0.0", - "yargs": "^15.3.1" + "yargs": "^16.1.0" + }, + "dependencies": { + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true + } } }, "core-util-is": { @@ -747,6 +4674,19 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -773,18 +4713,21 @@ } }, "cross-fetch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.3.tgz", - "integrity": "sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.6.tgz", + "integrity": "sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA==", "requires": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" + "node-fetch": "^2.6.7", + "whatwg-fetch": "^2.0.4" }, "dependencies": { "node-fetch": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } } } }, @@ -808,12 +4751,18 @@ "type": "^1.0.1" } }, + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" + }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.2" } }, "decamelize": { @@ -821,6 +4770,12 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -847,17 +4802,17 @@ } }, "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" } }, "emoji-regex": { @@ -874,6 +4829,15 @@ "ansi-colors": "^4.1.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", @@ -903,36 +4867,44 @@ "ext": "^1.1.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "eslint": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", - "integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.1.3", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^1.3.0", - "espree": "^7.3.0", - "esquery": "^1.2.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -940,7 +4912,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.19", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -949,24 +4921,15 @@ "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^5.2.3", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } @@ -997,13 +4960,13 @@ "dev": true }, "espree": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", - "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { "acorn": "^7.4.0", - "acorn-jsx": "^5.2.0", + "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^1.3.0" } }, @@ -1014,9 +4977,9 @@ "dev": true }, "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -1068,6 +5031,23 @@ "safe-buffer": "^5.1.1" } }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, "ext": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", @@ -1077,9 +5057,9 @@ }, "dependencies": { "type": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" } } }, @@ -1101,13 +5081,22 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" } }, "file-uri-to-path": { @@ -1115,6 +5104,15 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -1125,22 +5123,29 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -1158,6 +5163,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -1169,10 +5180,22 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1184,33 +5207,33 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" } }, "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, "requires": { "minimist": "^1.2.5", @@ -1220,6 +5243,15 @@ "wordwrap": "^1.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1255,9 +5287,9 @@ } }, "highlight.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.1.tgz", - "integrity": "sha512-A+sckVPIb9zQTUydC9lpRX1qRFO/N0OKEh0NwIr65ckvWA/oMY8v9P3+kGRK3w2ULSh9E8v5MszXafodQ6039g==", + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", "dev": true }, "hmac-drbg": { @@ -1270,6 +5302,18 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "husky": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", + "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", + "dev": true + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -1277,9 +5321,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -1292,6 +5336,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1308,9 +5358,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "interpret": { "version": "1.4.0", @@ -1318,6 +5368,21 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1338,11 +5403,41 @@ "is-extglob": "^2.1.1" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -1362,15 +5457,21 @@ "dev": true }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" } }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1402,6 +5503,50 @@ "type-check": "~0.4.0" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "lint-staged": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-11.0.0.tgz", + "integrity": "sha512-3rsRIoyaE8IphSUtO1RVTFl1e0SLBtxxUOPBtHxQgBHS5/i6nqvjcUfNioMa4BU9yGnPzbO+xkfLtXtxBpCzjw==", + "dev": true, + "requires": { + "chalk": "^4.1.1", + "cli-truncate": "^2.1.0", + "commander": "^7.2.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.3.1", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^5.0.0", + "listr2": "^3.8.2", + "log-symbols": "^4.1.0", + "micromatch": "^4.0.4", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + } + }, + "listr2": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.10.0.tgz", + "integrity": "sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw==", + "dev": true, + "requires": { + "cli-truncate": "^2.1.0", + "colorette": "^1.2.2", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.7", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1411,16 +5556,89 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -1443,6 +5661,28 @@ "safe-buffer": "^5.1.2" } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -1463,9 +5703,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mitt": { @@ -1488,14 +5728,15 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" }, "natural-compare": { "version": "1.4.0", @@ -1514,10 +5755,20 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", + "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } }, "node-gyp-build": { "version": "4.2.3", @@ -1554,6 +5805,21 @@ } } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1563,6 +5829,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -1593,6 +5868,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -1607,6 +5891,18 @@ "callsites": "^3.0.0" } }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1625,15 +5921,21 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -1642,6 +5944,21 @@ "sha.js": "^2.4.8" } }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -1661,9 +5978,9 @@ "dev": true }, "protobufjs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.1.tgz", - "integrity": "sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ==", + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", + "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -1676,15 +5993,8 @@ "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/long": "^4.0.1", - "@types/node": "^13.7.0", + "@types/node": ">=13.7.0", "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "13.13.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.23.tgz", - "integrity": "sha512-L31WmMJYKb15PDqFWutn8HNwrNK6CE6bkWgSB0dO1XpNoHrszVKV1Clcnfgd6c/oG54TVF8XQEvY2gQrW8K6Mw==" - } } }, "punycode": { @@ -1741,6 +6051,12 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -1752,11 +6068,12 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -1766,10 +6083,20 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -1784,41 +6111,33 @@ "inherits": "^2.0.1" } }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "scrypt": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", - "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", - "optional": true, - "requires": { - "nan": "^2.0.8" - } - }, - "scrypt.js": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", - "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", - "optional": true, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, "requires": { - "scrypt": "^6.0.2", - "scryptsy": "^1.2.1" + "tslib": "^1.9.0" }, "dependencies": { - "scryptsy": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", - "optional": true, - "requires": { - "pbkdf2": "^3.0.3" - } + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true } } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, "scryptsy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", @@ -1840,9 +6159,18 @@ } }, "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, "set-blocking": { @@ -1875,9 +6203,9 @@ "dev": true }, "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, "requires": { "glob": "^7.0.0", @@ -1885,53 +6213,27 @@ "rechoir": "^0.6.2" } }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } }, "sodium-native": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-3.2.0.tgz", - "integrity": "sha512-8aq/vQSegLwsRch8Sb/Bpf9aAqlNe5dp0+NVhb9UjHv42zDZ0D5zX3wBRUbXK9Ejum9uZE6DUgT4vVLlUFRBWg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-3.2.1.tgz", + "integrity": "sha512-EgDZ/Z7PxL2kCasKk7wnRkV8W9kvwuIlHuHXAxkQm3FF0MgVsjyLBXGjSRGhjE6u7rhSpk3KaMfFM23bfMysIQ==", "requires": { "ini": "^1.3.5", "node-gyp-build": "^4.2.0" @@ -1949,22 +6251,39 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, "requires": { - "safe-buffer": "~5.2.0" + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" } }, "strip-ansi": { @@ -1975,6 +6294,12 @@ "ansi-regex": "^5.0.0" } }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -1990,53 +6315,46 @@ } }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "ajv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } } } @@ -2047,6 +6365,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -2095,24 +6419,38 @@ } } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "tslib": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.2.tgz", - "integrity": "sha512-wAH28hcEKwna96/UacuWaVspVLkg4x1aDM9JlzqaQTOFczCktkVAb5fmXChgandR1EraDPs2w8P+ozM+oafwxg==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" }, "tsutils": { - "version": "3.17.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", - "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" }, "dependencies": { "tslib": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.0.tgz", - "integrity": "sha512-+Zw5lu0D9tvBMjGP8LpvMb0u2WW2QV3y+D8mO6J+cNzCYIN4sVy43Bf9vl92nqFahutN0I8zHa7cc4vihIshnw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true } } @@ -2132,9 +6470,9 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "typedarray-to-buffer": { @@ -2173,15 +6511,147 @@ } }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", "dev": true }, + "tyron": { + "version": "3.12.4", + "resolved": "https://registry.npmjs.org/tyron/-/tyron-3.12.4.tgz", + "integrity": "sha512-5uAIVGzOJHIyr7J9npzAs+ibksxpmv8gr9VXgGGy7ulwcIdeaBYhudbxaRUtd16aZbtZ7piuTjf4GhNVjXO7sQ==", + "requires": { + "@zilliqa-js/zilliqa": "3.0.0" + }, + "dependencies": { + "@zilliqa-js/account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/account/-/account-3.0.0.tgz", + "integrity": "sha512-3+Mprf8sgYzdCzqMG3Hz9jFAYbGo7oCZlMqCbl9IZu1RU4wU5Zb0HBQrJHcw9H02IePCP/NVMVmEQOcWVPTwAA==", + "requires": { + "@types/bip39": "^2.4.0", + "@types/hdkey": "^0.7.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/proto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "bip39": "^2.5.0", + "hdkey": "^1.1.0" + } + }, + "@zilliqa-js/blockchain": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/blockchain/-/blockchain-3.0.0.tgz", + "integrity": "sha512-jrGBogGupJ8yl0TW78GBytQmSzGguz8oOEfwOXJVSfXDDsFKNuWY3eDJp4a8Af6dA66bl9slXEIF76Kpj28tng==", + "requires": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/contract": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "utility-types": "^3.4.1" + } + }, + "@zilliqa-js/contract": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/contract/-/contract-3.0.0.tgz", + "integrity": "sha512-8GhqBD3/rhCiGhcggkFL3zM8s/f8GyaH1RM3Kkg11ETVPLw3xlxbbG668wyagQ0Qb2yEt5n/C/fLbtR9Ch8Jyg==", + "requires": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/blockchain": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "hash.js": "^1.1.5", + "utility-types": "^2.1.0" + }, + "dependencies": { + "utility-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-2.1.0.tgz", + "integrity": "sha512-/nP2gqavggo6l38rtQI/CdeV+2fmBGXVvHgj9kV2MAnms3TIi77Mz9BtapPFI0+GZQCqqom0vACQ+VlTTaCovw==" + } + } + }, + "@zilliqa-js/core": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/core/-/core-3.0.0.tgz", + "integrity": "sha512-aDeOqGl2gOZ8LQhCFDGgOX0L8ZX6amnFEIyLc3vXzzQ0vX+jZ19U2q6IFI82eIPNZuUBNrcei0Wefe3D6dyjsw==", + "requires": { + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/util": "3.0.0", + "cross-fetch": "^2.2.2", + "mitt": "^1.1.3" + } + }, + "@zilliqa-js/crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/crypto/-/crypto-3.0.0.tgz", + "integrity": "sha512-vs4xWG8C+/UzqfKNreRfe1TrzKwvXZUI+3BD2X+fTtSST1ZXwX9KRa3T3MdmK252tiYqNhWm/YJBr36lPYRX3A==", + "requires": { + "@zilliqa-js/util": "3.0.0", + "aes-js": "^3.1.1", + "bsert": "^0.0.4", + "elliptic": "^6.5.0", + "hash.js": "^1.1.5", + "hmac-drbg": "^1.0.1", + "pbkdf2": "^3.0.16", + "randombytes": "^2.0.6", + "scrypt-js": "^3.0.1", + "scryptsy": "^2.1.0", + "sodium-native": "^3.2.0", + "uuid": "^3.3.2" + } + }, + "@zilliqa-js/proto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/proto/-/proto-3.0.0.tgz", + "integrity": "sha512-FnLmNica3kZwUY8WbzPyUDM27YnXvWdzReuX87VVrhQgTIfGExOECIep/8ogs465U7CJQtEjxrOTAqSytDBNPA==", + "requires": { + "protobufjs": "^6.8.8" + } + }, + "@zilliqa-js/subscriptions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/subscriptions/-/subscriptions-3.0.0.tgz", + "integrity": "sha512-AmMsgNOTjGOO2TdYr+RUTXHTVnTU8gXeuRDJOpWJfeRQi27tf99zi7GwqbyYiWsPznBqD2BmirBHNxao+QKf6A==", + "requires": { + "@zilliqa-js/core": "3.0.0", + "mock-socket": "^9.0.2", + "websocket": "^1.0.28" + } + }, + "@zilliqa-js/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/util/-/util-3.0.0.tgz", + "integrity": "sha512-4TWHZ8gXmMmRrwkok2Py3YSUXl4udnnmI6EY6UmdtRtKiJl9LEjpGlq0+3YwGAouLrTPPkIxBXXETCDhX6D6Xg==", + "requires": { + "@types/bn.js": "^4.11.3", + "@types/long": "^4.0.0", + "bn.js": "^4.11.8", + "long": "^4.0.0" + } + }, + "@zilliqa-js/zilliqa": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@zilliqa-js/zilliqa/-/zilliqa-3.0.0.tgz", + "integrity": "sha512-dG8dXqsIhLs7KS8qCdC8ilP+rOX7wKEQuLG+ra3sdGeJgD283jw8bb05UGzqpmrRKFtG3DybHtYcqcgSWY9uBw==", + "requires": { + "@zilliqa-js/account": "3.0.0", + "@zilliqa-js/blockchain": "3.0.0", + "@zilliqa-js/contract": "3.0.0", + "@zilliqa-js/core": "3.0.0", + "@zilliqa-js/crypto": "3.0.0", + "@zilliqa-js/subscriptions": "3.0.0", + "@zilliqa-js/util": "3.0.0" + } + } + } + }, "uglify-js": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.1.tgz", - "integrity": "sha512-OApPSuJcxcnewwjSGGfWOjx3oix5XpmrK9Z2j0fTRlHGoZ49IU6kExfZTM0++fCArOOCet+vIfWwFHbvWqwp6g==", + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", "dev": true, "optional": true }, @@ -2203,36 +6673,29 @@ "dev": true }, "uri-js": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", - "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { "punycode": "^2.1.0" } }, "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, "utf-8-validate": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", - "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz", + "integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==", "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==" - } + "node-gyp-build": "^4.2.0" } }, "util-deprecate": { @@ -2251,15 +6714,25 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, + "web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, "websocket": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.32.tgz", - "integrity": "sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", "requires": { "bufferutil": "^4.0.1", "debug": "^2.2.0", @@ -2267,6 +6740,21 @@ "typedarray-to-buffer": "^3.1.5", "utf-8-validate": "^5.0.2", "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, "whatwg-fetch": { @@ -2274,6 +6762,15 @@ "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2301,9 +6798,10 @@ "dev": true }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2316,26 +6814,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - } - } - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -2343,15 +6821,27 @@ "dev": true }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true + }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", diff --git a/package.json b/package.json index 3fcaad36..cc8c2d60 100644 --- a/package.json +++ b/package.json @@ -1,59 +1,70 @@ { - "name": "tyronzil-js", - "version": "2.0.0", - "description": "Tyron DID-Client powered by the Zilliqa blockchain", - "main": "dist/src/core.js", + "name": "ssiclient", + "version": "3.3.0", + "description": "SSI Protocol's client for Node.js", + "main": "dist/bin/index.js", "bin": { "tyronzil": "./dist/src/bin/index.js" }, "scripts": { "build": "tsc && copyfiles \"package.json\" dist", "lint": "eslint . --ext .ts", - "typedoc": "typedoc --out typedocs" + "typedoc": "typedoc --out typedocs", + "tyronzil": "npm run build && npm i -g ." }, "repository": { "type": "git", - "url": "git+https://github.com/julio-cabdu/tyronzil-js.git" + "url": "git+https://github.com/Ignite-DAO/ssiclient.git" }, "keywords": [ - "did", - "did-client", + "ssi-protocol", + "tyron", + "tyron-ssi", + "self-sovereign-identity", + "ssi", "decentralized-identity", "decentralized-identifiers", + "did", "decentralized-application", "dapp", - "self-sovereign identity", - "tyron", - "tyron.did", - "tyronZIL", - "zilliqa" + "tyronzil", + "zilliqa", + "ignite-dao" ], - "author": "https://github.com/julio-cabdu", + "author": "Tyron Pungtas and its affiliates", "license": "GPL-3.0-only", "bugs": { - "url": "https://github.com/julio-cabdu/tyronzil-js/issues" + "url": "https://github.com/Ignite-DAO/ssiclient/issues" }, - "homepage": "https://github.com/julio-cabdu/tyronzil-js#readme", + "homepage": "https://github.com/Ignite-DAO/ssiclient/blob/master/README.md", "dependencies": { - "@zilliqa-js/zilliqa": "^1.0.0-alpha.1", "@types/websocket": "^1.0.1", + "@zilliqa-js/zilliqa": "2.2.0", "bn": "^1.0.5", "chalk": "^4.1.0", - "node-fetch": "^2.6.1", + "node-fetch": "^3.2.10", "readline-sync": "^1.4.10", - "tslib": "^2.0.1", + "tslib": "^2.1.0", + "tyron": "^3.12.4", "yargs": "^15.4.0" }, "devDependencies": { - "typescript": "^3.9.7", - "@types/bitcore-lib": "^0.15.2", - "@types/node": "^14.6.3", + "@types/node": "^14.14.31", "@types/readline-sync": "^1.4.3", - "@types/yargs": "^15.0.5", + "@types/yargs": "^15.0.13", "@typescript-eslint/eslint-plugin": "^3.8.0", "@typescript-eslint/parser": "^3.8.0", - "copyfiles": "^2.3.0", - "eslint": "^7.6.0", - "typedoc": "^0.17.8" + "copyfiles": "^2.4.1", + "eslint": "^7.20.0", + "husky": "^6.0.0", + "lint-staged": "^11.0.0", + "typedoc": "^0.17.8", + "typescript": "^3.9.9" + }, + "lint-staged": { + "*.ts": [ + "eslint src", + "npx tsc --noEmit" + ] } } diff --git a/src/bin/coop-cli.ts b/src/bin/coop-cli.ts new file mode 100644 index 00000000..48326f29 --- /dev/null +++ b/src/bin/coop-cli.ts @@ -0,0 +1,90 @@ +/* +SSI Protocol's client for Node.js +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details.*/ + +import * as tyron from 'tyron' +import LogColors from './log-colors'; +import * as readline from 'readline-sync'; +import tyronzilCLI, { admin_zil_secret_key } from './tyronzil-cli'; + +/** Handle the tyronzil command-line interface */ +export default class coopCLI { + + public static async handleAddWork(): Promise { + const set_network = await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Initializing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const userDomain = readline.question(LogColors.green(`What is the domain name of the coop?`) + ` [e.g. tyron.coop] ` + LogColors.lightBlue(`Your answer: `)); + const resolve = userDomain.split("."); + const addr = await tyron.Resolver.default.resolveDns(set_network.network, set_network.initTyron, resolve[0], resolve[1]) + + const tprotocol = readline.question(LogColors.green(`What's the transfer protocol?`)+ ' [https: 1/ git: 2] '+ LogColors.lightBlue(`Your answer: `)); + let tprotocol_: tyron.DocumentModel.TransferProtocol; + switch (tprotocol) { + case "1": + tprotocol_ = tyron.DocumentModel.TransferProtocol.Https + break; + case "2": + tprotocol_ = tyron.DocumentModel.TransferProtocol.Git + break; + } + const uri = readline.question(LogColors.green(`What's the PR's URI?`)+ ' [www.github.com/...] '+ LogColors.lightBlue(`Your answer: `)); + const amount = readline.question(LogColors.green(`How many hours did you work on it?`)+ ' [number] '+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.AddWork(addr, tprotocol_!, uri, amount); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.AddWork, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleNFTTransfer(): Promise { + const set_network = await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Initializing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const userDomain = readline.question(LogColors.green(`What is the domain name?`) + ` [e.g. uriel.did] ` + LogColors.lightBlue(`Your answer: `)); + const resolve = userDomain.split("."); + const addr = await tyron.Resolver.default.resolveDns(set_network.network, set_network.initTyron, resolve[0], resolve[1]) + + const beneficiary = readline.question(LogColors.green(`What's the domain name of the beneficiary? `)+ LogColors.lightBlue(`Your answer: `)); + const resolve_ = beneficiary.split("."); + const beneficiary_: tyron.TyronZil.Beneficiary = { + username: resolve_[0], + domain: resolve_[1], + constructor: tyron.TyronZil.BeneficiaryConstructor.domain + }; + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.NFTTransfer(addr, beneficiary_); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.NFTTransfer, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } +} \ No newline at end of file diff --git a/src/bin/index.ts b/src/bin/index.ts index 01d5339e..892a01f8 100644 --- a/src/bin/index.ts +++ b/src/bin/index.ts @@ -2,66 +2,99 @@ // So `npm i` installs the CLI correctly across all operating systems /* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte +SSI Protocol's client for Node.js +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details.*/ import * as yargs from 'yargs'; -import tyronCLI from './tyronZIL-CLI'; -import SmartUtil from '../lib/blockchain/smart-contracts/smart-util'; +import tyronCLI from './tyronzil-cli'; +import SmartUtil from '../lib/smart-util'; + +import hash from 'hash.js'; +import * as zcrypto from '@zilliqa-js/crypto'; +import * as zutil from '@zilliqa-js/util'; +import xWalletCLI from './xwallet-cli'; +import coopCLI from './coop-cli'; yargs - .scriptName('tyronzil') - .usage('Usage: $0 [options]') - .demandCommand(1, 'Try: tyronzil , with command = did OR resolve') - .command('did', ' -> to execute a tyronZIL DID-operation, try: $tyronzil did , with subcommand = create|resolve|update|recover|deactivate', (yargs) => { - yargs - .usage('Usage: $0 did [options]') - .demandCommand(1, 'Specify a subcommand: create|resolve|update|recover|deactivate') - .command('create', ' -> creates a unique digital identity did:tyron:zil)', async() => { - await tyronCLI.handleCreate(); - }) - .command('update', ' -> updates the given tyronZIL DID and its DID-state', async() => { - await tyronCLI.handleUpdate(); - }) - .command('recover', ' -> recovers the given tyronZIL DID and creates a new DID-state)', async() => { - await tyronCLI.handleRecover(); - }) - .command('deactivate', ' -> deactivates the given tyronZIL DID and its DID-state', async() => { - await tyronCLI.handleDeactivate(); - }) - .wrap(null) - .strict(); //the sub-command must be one of the explicitly defined sub-commands - }) - .command('resolve', ' -> resolves the given tyronZIL DID into its DID-document (read operation)', async() => { - await tyronCLI.handleResolve(); - }) - .command('dns', ` -> sets a DIDC's domain name`, async() => { - await tyronCLI.handleDns(); - }) - .command('ssitoken', ` -> initializes the SSI Token in the user's DIDC`, async() => { - await tyronCLI.handleSsiToken(); - }) - .command('donation', ` -> initializes the donation campaign code in the user's DIDC`, async() => { - await tyronCLI.handleDonation(); - }) - .command('donate', ` -> donates $XSGD to another tyron.did`, async() => { - await tyronCLI.handleDonate(); - }) - .command('encode', ' -> encodes the given contract into a Base64URL string', async() => { - await SmartUtil.encode(); - }) - .strict() // the command must be one of the explicitly defined commands - .help(false) // disabling --help option - .version(false) // disabling --version option - .argv; + .scriptName('tyronzil') + .usage('Usage: $0 [options]') + .demandCommand(1, 'Try: tyronzil , with command = did OR resolve') + .command('test', ' -> ...', async() => { + const h1 = hash.sha256().update("hola").digest('hex'); + console.log(h1); + let hash_ = "0000000000000000000000000000000000000000"; + const key = "020616e2521b9914c2363a51239249bbdc7aeb899bb70f1bf1ab96c8c8a2af4461" + const h3 = hash.sha256().update(zutil.bytes.hexToByteArray(key)).digest('hex'); + + const previous_recovery_key = zcrypto.getPubKeyFromPrivateKey('e4abc6a56291872f880e9582cb2eebfe9ba83895014831d22bfe7213f766ca1a'); + console.log(previous_recovery_key); + const concat_ = hash_+h1+h3; console.log(concat_); + const signature = zcrypto.sign(Buffer.from(concat_, 'hex'), 'e4abc6a56291872f880e9582cb2eebfe9ba83895014831d22bfe7213f766ca1a', previous_recovery_key); + console.log(signature); + + }) + .command('deploy', ' -> deploys a tyron smart contract', async() => { + await tyronCLI.handleDeploy(); + }) + .command('buynft', ' -> buy domain name NFT', async() => { + await xWalletCLI.handleBuyDomainNameNFT(); + }) + .command('enablesr', ' -> enable social recovery', async() => { + await xWalletCLI.handleEnableSocialRecovery(); + }) + .command('updatesr', ' -> update social recoverer', async() => { + await xWalletCLI.handleUpdateSocialRecoverer(); + }) + + .command('updateinit', ' -> update address of init.tyron', async() => { + await xWalletCLI.handleUpdateInit(); + }) + .command('updateadmin', ' -> update address of the admin of the contract', async() => { + await xWalletCLI.handleUpdateAdmin(); + }) + .command('nfttransfer', ' -> transfer NFT coop membership', async() => { + await coopCLI.handleNFTTransfer(); + }) + .command('addwork', ' -> add work to NFT coop', async() => { + await coopCLI.handleAddWork(); + }) + .command('did', ' -> to execute a tyronZIL DID operation, try: $tyronzil did , with subcommand = create|resolve|update|recover|deactivate', (yargs) => { + yargs + .usage('Usage: $0 did [options]') + .demandCommand(1, 'Specify a subcommand: create|resolve|update|recover|deactivate') + .command('create', ' -> creates a unique digital identity did:tyron:zil)', async() => { + await tyronCLI.handleDidCreate(); + }) + .command('recover', ' -> recovers the given tyronZIL DID and creates a new DID-state)', async() => { + await tyronCLI.handleDidRecover(); + }) + .command('update', ' -> updates the given tyronZIL DID and its DID-state', async() => { + await tyronCLI.handleDidUpdate(); + }) + .command('deactivate', ' -> deactivates the given tyronZIL DID and its DID-state', async() => { + await tyronCLI.handleDidDeactivate(); + }) + .wrap(null) + .strict(); //the sub-command must be one of the explicitly defined sub-commands + }) + .command('resolve', ' -> resolves the given tyronZIL DID into its DID-document (read operation)', async() => { + await tyronCLI.handleDidResolve(); + }) + .command('encode', ' -> encodes the given contract into a Base64URL string', async() => { + await SmartUtil.encode(); + }) + .strict() // the command must be one of the explicitly defined commands + .help(false) // disabling --help option + .version(false) // disabling --version option + .argv; diff --git a/src/bin/tyronZIL-CLI.ts b/src/bin/tyronZIL-CLI.ts deleted file mode 100644 index 10cdf340..00000000 --- a/src/bin/tyronZIL-CLI.ts +++ /dev/null @@ -1,597 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import DidCreate from '../lib/decentralized-identity/did-operations/did-create'; -import DidUpdate, { UpdateOperationInput } from '../lib/decentralized-identity/did-operations/did-update'; -import DidRecover, { RecoverOperationInput } from '../lib/decentralized-identity/did-operations/did-recover'; -import DidDeactivate, { DeactivateOperationInput } from '../lib/decentralized-identity/did-operations/did-deactivate'; -import Util, { CliInputModel } from './util'; -import TyronZIL, { InitTyron, TransitionTag } from '../lib/blockchain/tyronzil'; -import DidScheme, { NetworkNamespace } from '../lib/decentralized-identity/tyronZIL-schemes/did-scheme'; -import DidState from '../lib/decentralized-identity/did-operations/did-resolve/did-state'; -import DidDoc, {ResolutionInput, Accept } from '../lib/decentralized-identity/did-operations/did-resolve/did-document'; -import { PatchAction, PatchModel } from '../lib/decentralized-identity/protocols/models/document-model'; -import ErrorCode from '../lib/decentralized-identity/util/ErrorCode'; -import LogColors from './log-colors'; -import * as readline from 'readline-sync'; -import Resolver from '../lib/decentralized-identity/did-operations/did-resolve/resolver'; -import CodeError from '../lib/decentralized-identity/util/ErrorCode'; - -/** Handles the command-line interface Tyron DID operations */ -export default class TyronCLI { - - /** Gets network choice from the user */ - private static network(): { network: NetworkNamespace, initTyron: InitTyron } { - const network = readline.question(LogColors.green(`On which Zilliqa network would you like to operate, mainnet(m), testnet(t) or isolated server(i)?`) + ` - [m/t/i] - Defaults to testnet - ` + LogColors.lightBlue(`Your answer: `)); - // Both default to testnet - let NETWORK; - let INIT_TYRON; //address of the init.tyron smart contract - switch(network.toLowerCase()) { - case 'm': - NETWORK = NetworkNamespace.Mainnet; - INIT_TYRON = InitTyron.Mainnet; - break; - case 'i': - NETWORK = NetworkNamespace.Isolated; - INIT_TYRON = InitTyron.Isolated; - break; - default: - // Defaults to testnet - NETWORK = NetworkNamespace.Testnet; - INIT_TYRON = InitTyron.Testnet; - break; - } - return { - network: NETWORK, - initTyron: INIT_TYRON - } - } - - /*** **** ***/ - - /** Handles the `Tyron DID-Create` operation */ - public static async handleCreate(): Promise { - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - console.log(LogColors.brightGreen(`The user is the contract owner of their Tyron DID smart contract (DIDC)`)); - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 50,000] - ` + LogColors.lightBlue(`Your answer: `)); - - console.log(LogColors.brightGreen(`Initializing...`)); - await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit - ) - .then(async init => { - // Adds verification-method inputs & services: - const KEY_INPUT = await Util.InputKeys(); - const SERVICES = await Util.services(); - - const CLI_INPUT: CliInputModel = { - network: NETWORK, - publicKeyInput: KEY_INPUT, - services: SERVICES, - userPrivateKey: contractOwner_privateKey - }; - - /** Executes the `Tyron DID-Create` operation */ - const OPERATION = await DidCreate.execute(CLI_INPUT); - const TAG = TransitionTag.Create; - if(OPERATION !== undefined) { - console.log(LogColors.brightGreen(`Your ${TAG} request got processed!`)); - } else { - throw new ErrorCode("RequestUnsuccessful", "Wrong choice. Try again.") - } - - return { - init: init, - operation: OPERATION, - tag: TAG - }; - }) - .then(async didCreate => { - console.log(LogColors.brightGreen(`Let's deploy the user's Tyron DID smart contract!`)) - - const version = readline.question(LogColors.green(`What version of the DIDC would you like to deploy?`)+` - Versions currently supported: [2.0] - ` + LogColors.lightBlue(`Your answer: `)); - - // The user deploys their DIDC and calls the TyronInit transition - const DEPLOYED_CONTRACT = await TyronZIL.deploy(didCreate.init, version); - const DIDC_ADDR = DEPLOYED_CONTRACT.contract.address!; - - const DID = await DidScheme.newDID({network: NETWORK, didUniqueSuffix: DIDC_ADDR}); - console.log(LogColors.green(`The user's Tyron Decentralized Identifier is: `) + LogColors.green(DID.did)); - - const PARAMS = await TyronZIL.create( - "pungtas", - didCreate.operation.document, - didCreate.operation.updateKey, - didCreate.operation.recoveryKey - ); - - await TyronZIL.submit(didCreate.init, DIDC_ADDR, didCreate.tag, PARAMS, ".did"); - - // Sets the DIDC's domain name - const domainName = readline.question(LogColors.green(`What domain name avatar.did would you like to register for your DIDC?`)+` - [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DOT_INDEX = domainName.lastIndexOf("."); - const SSI_DOMAIN = domainName.substring(DOT_INDEX); - if(SSI_DOMAIN !== ".did") { - throw new ErrorCode("CodeNotDidDomain", "The DIDC MUST first get registered on a .did domain") - } - const AVATAR = domainName.substring(0, DOT_INDEX); - await Resolver.validateAvatar(AVATAR); - - const DNS_PARAMS = await TyronZIL.dns(".did", AVATAR); - await TyronZIL.submit(didCreate.init, DIDC_ADDR, TransitionTag.Dns, DNS_PARAMS, ".did"); - return { - did: DID.did, - operation: didCreate.operation - }; - }) - .then( async create => { - // To save the private keys: - await Util.savePrivateKeys(create.did, create.operation.privateKeys); - }) - .catch(err => console.error(LogColors.red(err))) - } - - /*** **** ****/ - - /** Updates the DIDC's domain names */ - public static async handleDns(): Promise { - try { - const SET_NETWORK = this.network(); - const input = readline.question(LogColors.green(`To fetch the user's DIDC, give the address of the their DID smart contract (1) OR their domain.did (2)`) + ` - [1/2] - ` + LogColors.lightBlue(`Your answer: `)); - let DIDC_ADDR: string; - switch (input) { - case "1": - DIDC_ADDR = readline.question(LogColors.green(`Provide the DIDC's hex-encoded address`) + LogColors.lightBlue(`Your answer: `)); - break; - case "2": - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: uriel.did] - ` + LogColors.lightBlue(`Your answer: `)); - DIDC_ADDR = await Resolver.resolveDns(SET_NETWORK.network, SET_NETWORK.initTyron, domainName); - break; - default: - throw new CodeError("You have to choose between the previous options"); - }; - - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - - console.log(LogColors.brightGreen(`Initializing...`)); - await TyronZIL.initialize( - SET_NETWORK.network, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit - ) - .then(async init => { - const domainName = readline.question(LogColors.green(`What domain name avatar.did would you like to register for your DIDC?`)+` - [e.g.: iva.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DOT_INDEX = domainName.lastIndexOf("."); - const SSI_DOMAIN = domainName.substring(DOT_INDEX); - if(SSI_DOMAIN !== ".did") { - throw new ErrorCode("CodeNotDidDomain", "The DIDC MUST get registered on a .did domain") - } - const AVATAR = domainName.substring(0, DOT_INDEX); - await Resolver.validateAvatar(AVATAR); - - const DNS_PARAMS = await TyronZIL.dns(".did", AVATAR); - await TyronZIL.submit(init, DIDC_ADDR, TransitionTag.Dns, DNS_PARAMS, ".did"); - }) - .catch(err => { throw err }) - } catch (err) { - console.error(LogColors.red(err)) - } - } - - /*** **** ****/ - - /** Resolves the Tyron DID and saves it */ - public static async handleResolve(): Promise { - try { - const SET_NETWORK = this.network(); - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: uriel.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(SET_NETWORK.network, SET_NETWORK.initTyron, domainName); - - /** Whether to resolve the DID as a document or resolution result */ - const RESOLUTION_CHOICE = readline.question(LogColors.green(`Would you like to resolve your DID as a document(1) or as a resolution result(2)? `) + `- [1/2] - Defaults to document - ` + LogColors.lightBlue(`Your answer: `)); - - let ACCEPT; - switch (RESOLUTION_CHOICE) { - case "1": - ACCEPT = Accept.contentType - break; - case "2": - ACCEPT = Accept.Result - break; - default: - ACCEPT = Accept.contentType - break; - } - - const RESOLUTION_INPUT: ResolutionInput = { - didcAddr: DIDC_ADDR, - metadata : { - accept: ACCEPT - } - } - console.log(LogColors.brightGreen(`Resolving your request...`)); - - /** Resolves the Tyron DID */ - await DidDoc.resolution(SET_NETWORK.network, RESOLUTION_INPUT) - .then(async did_resolved => { - // Saves the DID-Document - const DID = did_resolved.id; - await DidDoc.write(DID, did_resolved); - }) - .catch(err => { throw err }) - } catch (err) { console.error(LogColors.red(err)) } - } - - /*** **** ****/ - - /** Handles the `Tyron DID-Recover` operation */ - public static async handleRecover(): Promise { - console.log(LogColors.brightGreen(`To recover your Tyron DID, let's fetch its current DIDC-State from the Zilliqa blockchain platform!`)); - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: uriel.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - - await DidState.fetch(NETWORK, DIDC_ADDR) - .then(async did_state => { - const RECOVERY_PRIVATE_KEY = readline.question(LogColors.brightGreen(`DID-State retrieved!`) + LogColors.green(` - Provide the recovery private key - `) + LogColors.lightBlue(`Your answer: `)); - await Util.verifyKey(RECOVERY_PRIVATE_KEY, did_state.did_recovery_key); - - // Adds verification-method inputs & services: - const KEY_INPUT = await Util.InputKeys(); - const SERVICES = await Util.services(); - - const CLI_INPUT: CliInputModel = { - network: NETWORK, - publicKeyInput: KEY_INPUT, - services: SERVICES - }; - const RECOVER_INPUT: RecoverOperationInput = { - did: did_state.decentralized_identifier, - recoveryPrivateKey: RECOVERY_PRIVATE_KEY, - cliInput: CLI_INPUT - }; - - const OPERATION = await DidRecover.execute(RECOVER_INPUT); - const TAG = TransitionTag.Recover; - if(OPERATION !== undefined) { - console.log(LogColors.brightGreen(`Your ${TAG} request got processed!`)); - } else { - throw new ErrorCode("RequestUnsuccessful", "Wrong choice. Try again.") - } - - return { - state: did_state, - operation: OPERATION, - tag: TAG - }; - }) - .then(async didRecover => { - console.log(LogColors.brightGreen(`Next, let's save the DID-Recover operation on the Zilliqa blockchain platform, so it stays immutable!`)); - - const PARAMS = await TyronZIL.recover( - 'pungtas', - didRecover.operation.newDocument, - didRecover.operation.docHash, - didRecover.operation.signature, - didRecover.operation.newUpdateKey, - didRecover.operation.newRecoveryKey - ); - - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - - const INITIALIZED = await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ); - - await TyronZIL.submit(INITIALIZED, DIDC_ADDR, didRecover.tag, PARAMS, ".did"); - return didRecover; - }) - .then( async didRecover => { - // To save the private keys: - await Util.savePrivateKeys(didRecover.operation.decentralized_identifier, didRecover.operation.privateKeys); - - }) - .catch(err => console.error(LogColors.red(err))) - } - - /*** **** ****/ - - /** Handles the `Tyron DID-Update` operation */ - public static async handleUpdate(): Promise { - console.log(LogColors.brightGreen(`To update your Tyron DID, let's fetch its current DIDC state from the Zilliqa blockchain platform!`)); - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - - await DidState.fetch(NETWORK, DIDC_ADDR) - .then(async did_state => { - const UPDATE_PRIVATE_KEY = readline.question(LogColors.brightGreen(`DID-State retrieved!`) + LogColors.green(` - Provide the update private key - `) + LogColors.lightBlue(`Your answer: `)); - await Util.verifyKey(UPDATE_PRIVATE_KEY, did_state.did_update_key); - - const patches_amount = readline.question(LogColors.green(`How many patches would you like to make? - `) + LogColors.lightBlue(`Your answer: `)); - const PATCHES = []; - for(let i=0, t= Number(patches_amount); i { - console.log(LogColors.brightGreen(`Next, let's save the DID-Update operation on the Zilliqa blockchain platform, so it stays immutable!`)); - - const PARAMS = await TyronZIL.update( - "pungtas", - didUpdate.operation.newDocument, - didUpdate.operation.docHash, - didUpdate.operation.signature, - didUpdate.operation.newUpdateKey - ); - - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - - const INITIALIZED = await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ); - - await TyronZIL.submit(INITIALIZED, DIDC_ADDR, didUpdate.tag, PARAMS, ".did"); - return didUpdate; - }) - .then( async didUpdate => { - // To save the private keys: - await Util.savePrivateKeys(didUpdate.operation.decentralized_identifier, didUpdate.operation.privateKeys) - }) - .catch(err => console.error(LogColors.red(err))) - } - - /*** **** ***/ - - /** Handles the `Tyron DID-Deactivate` operation */ - public static async handleDeactivate(): Promise { - console.log(LogColors.brightGreen(`To deactivate the Tyron DID, let's fetch its current DIDC state from the Zilliqa blockchain platform!`)); - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - - await DidState.fetch(NETWORK, DIDC_ADDR) - .then(async did_state => { - const RECOVERY_PRIVATE_KEY = readline.question(LogColors.brightGreen(`DID-State retrieved!`) + LogColors.green(` - Provide the recovery private key - `) + LogColors.lightBlue(`Your answer: `)); - await Util.verifyKey(RECOVERY_PRIVATE_KEY, did_state.did_recovery_key); - - return { - did_state: did_state, - recoveryPrivateKey: RECOVERY_PRIVATE_KEY - } - }) - .then(async request => { - const DEACTIVATE_INPUT: DeactivateOperationInput = { - state: request.did_state, - recoveryPrivateKey: request.recoveryPrivateKey - }; - - const OPERATION = await DidDeactivate.execute(DEACTIVATE_INPUT); - const TAG = TransitionTag.Deactivate; - if(OPERATION !== undefined) { - console.log(LogColors.brightGreen(`Your ${TAG} request got processed!`)); - } else { - throw new ErrorCode("RequestUnsuccessful", "Wrong choice. Try again.") - } - - return { - request: request, - operation: OPERATION, - tag: TAG - }; - }) - .then(async didDeactivate => { - console.log(LogColors.brightGreen(`Next, let's save your DID-Deactivate operation on the Zilliqa blockchain platform, so it stays immutable!`)); - - const PARAMS = await TyronZIL.deactivate( - "pungtas", - didDeactivate.operation.signature - ); - - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - - const INITIALIZED = await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ); - - await TyronZIL.submit(INITIALIZED, DIDC_ADDR, didDeactivate.tag, PARAMS, ".did"); - }) - .catch(err => console.error(LogColors.red(err))) - } - - /** Initializes the SSI Token in the user's DIDC */ - public static async handleSsiToken(): Promise { - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - const token = readline.question(LogColors.green(`What is the SSI Token that you would like to register into your DIDC? `) + `- [e.g.: xsgd] - ` + LogColors.lightBlue(`Your answer: `)); - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - - await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ).then(async init => { - const PARAMS = await TyronZIL.ssiToken(token); - await TyronZIL.submit(init, DIDC_ADDR, TransitionTag.SsiToken, PARAMS, ".did"); - }) - .catch(err => console.error(LogColors.red(err))) - } - - /** Initializes the donation campaign code in the user's DIDC */ - public static async handleDonation(): Promise { - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name (to fetch their DID smart contract)? `) + `- [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - const campaign = readline.question(LogColors.green(`What is the donation campaign code that you would like to register into your DIDC? `) + `- [e.g.: covid-aid] - ` + LogColors.lightBlue(`Your answer: `)); - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - - await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ).then(async init => { - const PARAMS = await TyronZIL.donate(campaign); - await TyronZIL.submit(init, DIDC_ADDR, TransitionTag.Donate, PARAMS, ".did"); - }) - .catch(err => console.error(LogColors.red(err))) - } - - /** Donates $XSGD */ - public static async handleDonate(): Promise { - const SET_NETWORK = this.network(); - const NETWORK = SET_NETWORK.network; - - /** Asks for the user's domain name to fetch their DIDC */ - const domainName = readline.question(LogColors.green(`What is the user's domain name? `) + `- [e.g.: julio.did] - ` + LogColors.lightBlue(`Your answer: `)); - const campaign = readline.question(LogColors.green(`What is the donation campaign code? `) + `- [e.g.: covid-aid] - ` + LogColors.lightBlue(`Your answer: `)); - const contractOwner_privateKey = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` - [Hex-encoded private key] - ` + LogColors.lightBlue(`Your answer: `)); - const toDomainName = readline.question(LogColors.green(`What is the user's domain name that you would like to donate $XSGD? `) + `- [e.g.: mar.did] - ` + LogColors.lightBlue(`Your answer: `)); - const amount = readline.question(LogColors.green(`How many $XSGD would you like to donate? - `) + LogColors.lightBlue(`Your answer: `)) - const xsgdPrivateKey = readline.question(LogColors.green(`What is your $XSGD private key? - `) + LogColors.lightBlue(`Your answer: `)) - const gas_limit = readline.question(LogColors.green(`What is the gas limit?`) + ` - [Recommended value: 5,000] - ` + LogColors.lightBlue(`Your answer: `)); - - await TyronZIL.initialize( - NETWORK, - SET_NETWORK.initTyron, - contractOwner_privateKey, - gas_limit, - ).then(async init => { - const DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, domainName); - const TO_DIDC_ADDR = await Resolver.resolveDns(NETWORK, SET_NETWORK.initTyron, toDomainName); - - const xsgd_privateKey = zcrypto.normalizePrivateKey(xsgdPrivateKey); - const xsgd_publicKey = zcrypto.getPubKeyFromPrivateKey(xsgd_privateKey); - const to_addr = zcrypto.fromBech32Address(TO_DIDC_ADDR).substring(2); - const SIGNATURE = "0x"+ zcrypto.sign(Buffer.from(to_addr, 'hex'), xsgd_privateKey, xsgd_publicKey); - - const PARAMS = await TyronZIL.xTransfer(campaign, "xsgd", "pungtas", zcrypto.fromBech32Address(TO_DIDC_ADDR), String(Number(amount)*1e6), SIGNATURE ); - await TyronZIL.submit(init, DIDC_ADDR, TransitionTag.XTranfer, PARAMS, ".did"); - }) - .catch(err => console.error(LogColors.red(err))) - } -} diff --git a/src/bin/tyronzil-cli.ts b/src/bin/tyronzil-cli.ts new file mode 100644 index 00000000..810310e6 --- /dev/null +++ b/src/bin/tyronzil-cli.ts @@ -0,0 +1,376 @@ +/* +SSI Protocol's client for Node.js +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details.*/ + +import * as tyron from 'tyron'; +import * as fs from 'fs'; +import Util from './util'; +import LogColors from './log-colors'; +import * as readline from 'readline-sync'; +import SmartUtil from '../lib/smart-util'; + +/** Address of the init.tyron smart contract + * @TODO: configure globally + */ +export enum InitTyron { + Testnet = "0x91e0a9Bd1af55E75a43b7F7608B9B8CB1b175F76", + Mainnet = "", + Isolated = "" +} + +export const admin_zil_secret_key = '8cefad33c6b2eafe6456e80cd69fda3fcd23b5c4a6719275340f340a9259c26a'; + +/** Handle the tyronzil command-line interface */ +export default class tyronzilCLI { + + /** Get network choice from the user */ + public static async network(): Promise<{ network: tyron.DidScheme.NetworkNamespace, initTyron: InitTyron }> { + const choice = readline.question(LogColors.green(`On which Zilliqa network would you like to operate, mainnet(m), testnet(t) or isolated server(i)?`) + ` [m/t/i] - Defaults to testnet. ` + LogColors.lightBlue(`Your answer: `)); + let network; + let init_tyron; + switch(choice.toLowerCase()) { + case 'm': + network = tyron.DidScheme.NetworkNamespace.Mainnet; + init_tyron = InitTyron.Mainnet; + break; + case 'i': + network = tyron.DidScheme.NetworkNamespace.Isolated; + init_tyron = InitTyron.Isolated; + break; + default: + // Defaults to testnet + network = tyron.DidScheme.NetworkNamespace.Testnet; + init_tyron = InitTyron.Testnet; + break; + } + return { + network: network, + initTyron: init_tyron + } + } + + /** Saves the `DID Document` in local storage */ + public static async write(did: string, input: tyron.DidDocument.default|tyron.DidDocument.ResolutionResult): Promise { + try { + const PRINT_STATE = JSON.stringify(input, null, 2); + let FILE_NAME; + if(input instanceof tyron.DidDocument.default) { + FILE_NAME = `DID_DOCUMENT_${did}.json`; + } else { + FILE_NAME = `DID_RESOLVED_${did}.json`; + } + fs.writeFileSync(FILE_NAME, PRINT_STATE); + console.info(LogColors.yellow(`DID resolved as: ${LogColors.brightYellow(FILE_NAME)}`)); + } catch (error) { + throw new tyron.ErrorCode.default("CodeCouldNotSave", "The DID file did not get saved"); + } + } + + public static async fetchAddr(set_network: { network: tyron.DidScheme.NetworkNamespace, initTyron: InitTyron }): Promise { + const userDomain = readline.question(LogColors.green(`What is the domain name?`) + ` [e.g. uriel.did] ` + LogColors.lightBlue(`Your answer: `)); + const resolve = userDomain.split("."); + const addr = await tyron.Resolver.default.resolveDns(set_network.network, set_network.initTyron, resolve[0], resolve[1]); + return addr + } + + /** Handle the deployment of a tyron smart contract */ + public static async handleDeploy(): Promise { + await this.network() + .then( async set_network => { + const init = await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 50000, + set_network.initTyron + ); + const tyron_ = readline.question(LogColors.green(`What tyron smart contract would you like to deploy?`)+` [init, coop, xwallet] ` + LogColors.lightBlue(`Your answer: `)); + const version = readline.question(LogColors.green(`What version of the smart contract would you like to deploy?`)+` [number] ` + LogColors.lightBlue(`Your answer: `)); + const contract_code = await SmartUtil.decode(init, set_network.initTyron, tyron_, version); + + // Deploy smart contract + console.log(LogColors.yellow(`Deploying...`)); + const deployed_contract = await tyron.TyronZil.default.deploy(init, contract_code); + const addr = deployed_contract.contract.address!; + console.log(LogColors.green(`The smart contract's address is: `) + LogColors.brightGreen(addr)); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + /** Handle the `DID Create` operation */ + public static async handleDidCreate(): Promise { + await this.network() + .then( async set_network => { + const addr = await this.fetchAddr(set_network); + + const init = await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 50000, + set_network.initTyron + ); + + // Add verification-method inputs & services: + const key_input = await Util.InputKeys(); + const services = await Util.services(); + const input: tyron.DidCrud.InputModel = { + addr: addr, + publicKeyInput: key_input, + services: services + }; + + /** Execute the `DID Create` operation */ + const operation = await tyron.DidCrud.default.Create(input); + const tag = tyron.TyronZil.TransitionTag.Create; + if(operation !== undefined){ console.log(LogColors.yellow(`Your ${tag} request got processed!`)); + } else{ throw new tyron.ErrorCode.default("RequestUnsuccessful", "Wrong choice. Try again.") } + + await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.Create, init, addr, "0", operation.txParams); + + const did = await tyron.DidScheme.default.newDID({network: set_network.network, didUniqueSuffix: addr}); + console.log(LogColors.green(`The decentralized identifier is: `) + LogColors.brightGreen(did.did)); + + // To save the private keys: + await Util.savePrivateKeys(did.did, operation.privateKeys!); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + /** Resolve a DID and save it */ + public static async handleDidResolve(): Promise { + try { + await this.network() + .then( async set_network => { + const addr = await this.fetchAddr(set_network); + + /** Whether to resolve the DID as a document or resolution result */ + const RESOLUTION_CHOICE = readline.question(LogColors.green(`Would you like to resolve your DID as a document(1) or as a resolution result(2)? `) + ` [1/2] - Defaults to document.` + LogColors.lightBlue(`Your answer: `)); + + let ACCEPT; + switch (RESOLUTION_CHOICE) { + case "1": + ACCEPT = tyron.DidDocument.Accept.contentType + break; + case "2": + ACCEPT = tyron.DidDocument.Accept.Result + break; + default: + ACCEPT = tyron.DidDocument.Accept.contentType + break; + } + + const resolution_input: tyron.DidDocument.ResolutionInput = { + addr: addr, + metadata : { + accept: ACCEPT + } + } + console.log(LogColors.brightGreen(`Resolving your request...`)); + + /** Resolves the Tyron DID */ + await tyron.DidDocument.default.resolution(set_network.network, resolution_input) + .then(async (did_resolved: { id: any; }) => { + // Saves the DID Document + const DID = did_resolved.id; + await this.write(DID, did_resolved); + }) + .catch((err: any) => { throw err }) + }) + } catch (err) { console.error(LogColors.red(err)) } + } + + /** Handle the `DID Recover` operation */ + public static async handleDidRecover(): Promise { + await this.network() + .then( async set_network => { + const addr = await this.fetchAddr(set_network); + const did_state = await tyron.DidState.default.fetch(set_network.network, addr); + + const recovery_private_key = readline.question(LogColors.brightGreen(`DID State retrieved!`) + LogColors.green(` - Provide the recovery private key - `) + LogColors.lightBlue(`Your answer: `)); + await Util.verifyKey(recovery_private_key, did_state.did_recovery_key); + + // Adds verification-method inputs & services: + const key_input = await Util.InputKeys(); + const services = await Util.services(); + + const input: tyron.DidCrud.InputModel = { + addr: addr, + publicKeyInput: key_input, + services: services, + recoveryPrivateKey: recovery_private_key + }; + + const operation = await tyron.DidCrud.default.Recover(input); + const tag = tyron.TyronZil.TransitionTag.Recover; + if(operation !== undefined) { + console.log(LogColors.yellow(`Your ${tag} request got processed!`)); + } else { + throw new tyron.ErrorCode.default("RequestUnsuccessful", "Wrong choice. Try again.") + } + + console.log(LogColors.brightGreen(`Next, let's save the DID Recover operation on the Zilliqa blockchain platform, so it stays immutable!`)); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + const initialized = await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ); + + console.log(LogColors.yellow(`Submitting transaction...`)); + await tyron.TyronZil.default.submit(tag, initialized, addr, "0", operation.txParams); + + await Util.savePrivateKeys(did_state.did, operation.privateKeys!); + + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + /** Handle the `DID Update` operation */ + public static async handleDidUpdate(): Promise { + await this.network() + .then( async set_network => { + const addr = await this.fetchAddr(set_network); + const did_state = await tyron.DidState.default.fetch(set_network.network, addr); + + const update_private_key = readline.question(LogColors.brightGreen(`DID State retrieved!`) + LogColors.green(` - Provide the update private key - `) + LogColors.lightBlue(`Your answer: `)); + await Util.verifyKey(update_private_key, did_state.did_update_key); + + const patches_amount = readline.question(LogColors.green(`How many patches would you like to make? - `) + LogColors.lightBlue(`Your answer: `)); + const PATCHES = []; + for(let i=0, t= Number(patches_amount); i console.error(LogColors.red(err))) + } + + /** Handle the `DID Deactivate` operation */ + public static async handleDidDeactivate(): Promise { + await this.network() + .then( async set_network => { + const addr = await this.fetchAddr(set_network); + const did_state = await tyron.DidState.default.fetch(set_network.network, addr); + + const recovery_private_key = readline.question(LogColors.brightGreen(`DID State retrieved!`) + LogColors.green(` - Provide the recovery private key - `) + LogColors.lightBlue(`Your answer: `)); + await Util.verifyKey(recovery_private_key, did_state.did_recovery_key); + + const input = { + addr: addr, + state: did_state, + recoveryPrivateKey: recovery_private_key + }; + + const operation = await tyron.DidCrud.default.Deactivate(input); + const tag = tyron.TyronZil.TransitionTag.Deactivate; + if(operation !== undefined) { + console.log(LogColors.yellow(`Your ${tag} request got processed!`)); + } else { + throw new tyron.ErrorCode.default("RequestUnsuccessful", "Wrong choice. Try again.") + } + + console.log(LogColors.brightGreen(`Next, let's save your DID Deactivate operation on the Zilliqa blockchain platform, so it stays immutable!`)); + + const owner_zil_secret_key = readline.question(LogColors.green(`What is the user's private key (contract owner key)?`) + ` [Hex-encoded private key] ` + LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + const initialized = await tyron.TyronZil.default.initialize( + set_network.network, + set_network.initTyron, + 10000, + owner_zil_secret_key + ); + await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.Deactivate, initialized, addr, "0", operation.txParams); + console.log(LogColors.yellow(`Submitting transaction...`)); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } +} \ No newline at end of file diff --git a/src/bin/util.ts b/src/bin/util.ts index f80bd20d..ada63f0f 100644 --- a/src/bin/util.ts +++ b/src/bin/util.ts @@ -1,6 +1,7 @@ /* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte + SSI Protocol's client for Node.js + Self-Sovereign Identity Protocol. + Copyright (C) Tyron Pungtas and its affiliates. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,12 +18,7 @@ import * as zcrypto from '@zilliqa-js/crypto'; import * as fs from 'fs'; import LogColors from './log-colors'; import * as readline from 'readline-sync'; -import { Action, DataTransferProtocol, DocumentElement, ServiceModel } from '../lib/decentralized-identity/protocols/models/document-model'; -import { PublicKeyPurpose } from '../lib/decentralized-identity/protocols/models/verification-method-models'; -import { NetworkNamespace } from '../lib/decentralized-identity/tyronZIL-schemes/did-scheme'; -import ErrorCode from '../lib/decentralized-identity/util/ErrorCode'; -import { TyronPrivateKeys } from '../lib/decentralized-identity/util/did-keys'; -import TyronZIL, { TransitionValue } from '../lib/blockchain/tyronzil'; +import * as tyron from 'tyron'; export default class Util { @@ -34,7 +30,6 @@ export default class Util { const KEY_INPUT = []; console.log(LogColors.brightGreen(`You can have a key for each of the following purposes: - $xSGD stablecoin(0), General(1), Authentication(2), Assertion(3), @@ -42,40 +37,37 @@ export default class Util { Invocation(5), & Delegation(6)`)); - const amount = readline.question(LogColors.green(`How many of them would you like to add?`) + ` - up to [7] - ` + LogColors.lightBlue(`Your answer: `)); + const amount = readline.question(LogColors.green(`How many of them would you like to add?`) + ` - up to [6] - ` + LogColors.lightBlue(`Your answer: `)); if(Number(amount)> 6) { - throw new ErrorCode("IncorrectAmount", "You may only have up to 7 keys, one for each purpose") + throw new tyron.ErrorCode.default("IncorrectAmount", "You may only have up to 6 keys, one for each purpose") } for(let i=0, t= Number(amount); i { + /** Generates DID services */ + public static async services(): Promise { console.log(LogColors.brightGreen(`Service endpoints for your Decentralized Identifier:`)); - const SERVICES: TransitionValue[] = []; + const SERVICES: tyron.DocumentModel.ServiceModel[] = []; const SERVICE_ID_SET: Set = new Set(); const amount = readline.question(LogColors.green(`How many services would you like to add? - `) + LogColors.lightBlue(`Your answer: `)); if(!Number(amount) && Number(amount) !== 0 || Number(amount) < 0) { - throw new ErrorCode("WrongAmount", "It must be a number greater than or equal to 0"); + throw new tyron.ErrorCode.default("WrongAmount", "It must be a number greater than or equal to 0"); } for(let i=0, t= Number(amount); i { + public static async savePrivateKeys(did: string, keys: tyron.DidKeys.DIDVerificationMethods): Promise { const KEY_FILE_NAME = `DID_PRIVATE_KEYS_${did}.json`; fs.writeFileSync(KEY_FILE_NAME, JSON.stringify(keys, null, 2)); console.info(LogColors.yellow(`Private keys saved as: ${LogColors.brightYellow(KEY_FILE_NAME)}`)); } - /** Verifies that the given key matches the DID-Key of the DIDC (did_update_key OR did_recovery_key) */ + /** Verifies that the given key matches the DID key of the smart contracts (DID update key OR DID recovery key) */ public static async verifyKey(privateKey: string, didKey: string): Promise { const PUB_KEY = "0x"+ zcrypto.getPubKeyFromPrivateKey(privateKey); if(PUB_KEY === didKey) { - console.log(LogColors.brightGreen(`Success! The private key corresponds to the public did_key stored in the DIDC`)); + console.log(LogColors.brightGreen(`Success! The private key corresponds to the public DID key stored in the smart contract.`)); } else { - throw new ErrorCode("WrongKey", "The given key is not matching the corresponding key in the DIDC") + throw new tyron.ErrorCode.default("WrongKey", "The given key is not matching the corresponding key in the smart contract.") } } } - -/*** ** interfaces ** ***/ - -export interface CliInputModel { - network: NetworkNamespace; - publicKeyInput: PublicKeyInput[]; - services: TransitionValue[]; - userPrivateKey?: string; -} export interface PublicKeyInput { - id: PublicKeyPurpose; + id: tyron.VerificationMethods.PublicKeyPurpose; } diff --git a/src/bin/xwallet-cli.ts b/src/bin/xwallet-cli.ts new file mode 100644 index 00000000..1a704460 --- /dev/null +++ b/src/bin/xwallet-cli.ts @@ -0,0 +1,169 @@ +/* +SSI Protocol's client for Node.js +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details.*/ + +import * as tyron from 'tyron'; +import LogColors from './log-colors'; +import * as readline from 'readline-sync'; +import tyronzilCLI, { admin_zil_secret_key } from './tyronzil-cli'; + +/** Handle the xWallet command-line interface */ +export default class xWalletCLI { + + public static async handleBuyDomainNameNFT(): Promise { + const set_network = await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const username = readline.question(LogColors.green(`What's the username NFT that you'd like to buy? `)+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.BuyDomainNameNFT(username); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.BuyDomainNameNFT, init, addr, "200000000000000", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleTransferDomainNameNFT(): Promise { + const set_network = await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const username = readline.question(LogColors.green(`What's the username NFT that you'd like to buy? `)+ LogColors.lightBlue(`Your answer: `)); + const addr1 = readline.question(LogColors.green(`What's the new address?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.TransferDomainNameNFT(username, addr1); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.TransferDomainNameNFT, init, addr, "110000000000000", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleEnableSocialRecovery(): Promise { + const set_network = await tyronzilCLI.network(); + const owner_zil_secret_key = readline.question(LogColors.green(`What is the user's Zilliqa secret key?`) + ` [Hex-encoded private key] ` + LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + owner_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const addr1 = readline.question(LogColors.green(`What's the address of the first recoverer?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const addr2 = readline.question(LogColors.green(`What's the address of the second recoverer?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.EnableSocialRecovery(addr1, addr2); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.EnableSocialRecovery, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleUpdateSocialRecoverer(): Promise { + const set_network = await tyronzilCLI.network(); + const owner_zil_secret_key = readline.question(LogColors.green(`What is the user's Zilliqa secret key?`) + ` [Hex-encoded private key] ` + LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + owner_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const recoverer = readline.question(LogColors.green(`What's the recoverer you'd like to update?`)+ ` [1/2] `+ LogColors.lightBlue(`Your answer: `)); + const addr1 = readline.question(LogColors.green(`What's the new address?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + + let recoverer_: tyron.TyronZil.Recoverer; + switch (recoverer) { + case '1': + recoverer_ = tyron.TyronZil.Recoverer.first + break; + case '2': + recoverer_ = tyron.TyronZil.Recoverer.second + break; + } + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.UpdateSocialRecoverer(addr, recoverer_!, addr1) + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.UpdateSocialRecoverer, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleUpdateInit(): Promise { + const set_network = await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const addr1 = readline.question(LogColors.green(`What's the new address of init.tyron?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.TxAddr(addr1); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.UpdateInit, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } + + public static async handleUpdateAdmin(): Promise { + const set_network = await await tyronzilCLI.network(); + + console.log(LogColors.yellow(`Executing tyronzil...`)); + await tyron.TyronZil.default.initialize( + set_network.network, + admin_zil_secret_key, + 10000, + set_network.initTyron + ) + .then(async (init: any) => { + const addr = readline.question(LogColors.green(`What's the address of your tyron smart contract?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + const addr1 = readline.question(LogColors.green(`What's your new admin address?`)+ ` [Base16 address] `+ LogColors.lightBlue(`Your answer: `)); + + console.log(LogColors.yellow(`Submitting transaction...`)); + const tx_params = await tyron.TyronZil.default.TxAddr(addr1); + const tx = await tyron.TyronZil.default.submit(tyron.TyronZil.TransitionTag.UpdateAdmin, init, addr, "0", tx_params); + console.log(tx); + }) + .catch((err: unknown) => console.error(LogColors.red(err))) + } +} \ No newline at end of file diff --git a/src/lib/blockchain/smart-contracts/didc.scilla b/src/lib/blockchain/smart-contracts/didc.scilla deleted file mode 100644 index 85a94d68..00000000 --- a/src/lib/blockchain/smart-contracts/didc.scilla +++ /dev/null @@ -1,1071 +0,0 @@ -(* - Tyron: Decentralized identity application powered by Zilliqa - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*) - -scilla_version 0 -import BoolUtils - -(*------------------------*) -(* The Tyron DIDC Library *) -(*------------------------*) - -library DIDC - -(* Messages *) -(*----------*) - let one_msg = - fun(msg: Message) => - let nil_msg = Nil{Message} in - Cons{Message} msg nil_msg - - let two_msgs = - fun(msg1: Message) => - fun(msg2: Message) => - let msgs_tmp = one_msg msg2 in - Cons{Message} msg1 msgs_tmp - -(* The SSI Trinity ADT *) -(*---------------------*) - type SsiTrinity = - | User (* the contract owner *) - | Agent of String (* the agent is the entity running the DID-Client - string avatar of .agent *) - | Tyron (* the init.tyron contract *) - - -(* The Status ADTs *) -(*-----------------*) - type DidStatus = - | Undefined - | Initialized - | Created - | Updated - | Recovered - | Deactivated - - type CheckStatus = - | NotDeactivated - | Init - | Operational (* created, updated or recovered *) - -(* The Document ADTs *) -(*-------------------*) - type Action = - | Add - | Remove - - type DataTransferProtocol = - | Https - | Git - | Ssh - - type ServiceEndpoint = - | ServiceEndpoint of DataTransferProtocol String - - type DidService = - | DidService of String ServiceEndpoint (* the type & endpoint *) - - type Document = - | VerificationMethod of Action String ByStr33 (* string: key purpose OR service ID *) - | Service of Action String DidService - -(* Constants *) -(*-----------*) - let user = User - let tyron = Tyron - let dotDid = ".did" - let notDeactivated = NotDeactivated - let init = Init - let operational = Operational - let zero = Uint128 0 - let hundred = Uint128 100 - let undefined = "undefined" - let deactivated = "deactivated" - let period = Uint128 14065 (*approx. 1 week*) - -(* Error events *) -(*--------------*) - type Error = - | CodeNotTyron - | CodeWrongAmount - | CodeNotAgent - | CodeWrongStatus - | CodeNotOwner - | CodeWrongSignature - | CodeUndefinedKey - | CodeRepeatedKey - | CodeNotSsiToken - | CodeNotProxy - | CodeNotValid - - let make_error = - fun(error: Error) => - let result = - match error with - | CodeNotTyron => Int32 -1 - | CodeWrongAmount => Int32 -2 - | CodeNotAgent => Int32 -3 - | CodeWrongStatus => Int32 -4 - | CodeNotOwner => Int32 -5 - | CodeWrongSignature => Int32 -6 - | CodeUndefinedKey => Int32 -7 - | CodeRepeatedKey => Int32 -8 - | CodeNotSsiToken => Int32 -9 - | CodeNotProxy => Int32 -10 - | CodeNotValid => Int32 -11 - end - in - {_exception: "Error"; code: result} - - let deconstruct_option_uint128 = - fun(option: Option Uint128) => - match option with - | Some value => value - | _ => zero - end - - let update_methods: forall 'A. List Document -> Map String ByStr33 -> Map String ByStr33 = - tfun 'A => - fun(l: List Document) => - fun(prevMethods: Map String ByStr33) => - let foldl = @list_foldl Document Map String ByStr33 in - let iter = - fun(map: Map String ByStr33) => - fun(h: Document) => - match h with - | VerificationMethod action purpose key => - match action with - | Add => - builtin put map purpose key - | Remove => - builtin remove map purpose - end - | _ => map - end - in - foldl iter prevMethods l - - let make_endpoint = - fun(i: DidService) => - match i with - | DidService t endpoint => - match endpoint with - | ServiceEndpoint transfer e => - match transfer with - | Https => - let prefix = "https://" in - let this_uri = builtin concat prefix e in - Pair{String String} t this_uri - | Git => - let prefix = "git://" in - let this_uri = builtin concat prefix e in - Pair{String String} t this_uri - | Ssh => - let prefix = "ssh://" in - let this_uri = builtin concat prefix e in - Pair{String String} t this_uri - end - end - end - - let update_services: forall 'A. List Document -> Map String Pair String String -> Map String Pair String String = - tfun 'A => - fun(l: List Document) => - fun(prevServices: Map String Pair String String) => - let foldl = @list_foldl Document Map String Pair String String in - let iter = - fun(map: Map String Pair String String) => - fun(h: Document) => - match h with - | Service action id didService => - match action with - | Add => - let endpoint = make_endpoint didService in - builtin put map id endpoint - | Remove => - builtin remove map id - end - | _ => map - end - in - foldl iter prevServices l - -(*---------------------*) -(* The xWallet Library *) -(*---------------------*) - type XDirection = - | In - | Out - - let incoming = In - let outcoming = Out - -(*-------------------------------------*) -(* The Tyron DID Smart Contract (DIDC) *) -(*-------------------------------------*) - -contract DIDC( -(* Immutable fields declaration *) -(*------------------------------*) - - (* The user is the owner of their DIDC *) - initContractOwner: ByStr20, - - (* The address of the init.tyron contract *) - initTyron: ByStr20 - ) - with - let init = 0x63e2d8484187de4f66a571c098f3b51a793f055b in - builtin eq init initTyron - => - -(* Mutable fields declaration *) -(*----------------------------*) - (* The user's Zilliqa address *) - field contract_owner: ByStr20 = initContractOwner - - (* The Tyron DID *) - field decentralized_identifier: String = undefined - - (* The address of the init.tyron contract's latest implementation *) - field init_tyron: ByStr20 = initTyron - - (* The Decentralized Identifier's DNS resource records - @key: domain - @value: avatar *) - field resource_records: Map String String = Emp String String - - (* The user's agents - @key: avatar.agent - @value: agent's address *) - field ssi_agents: Map String ByStr20 = Emp String ByStr20 - field latest_agent: ByStr20 = initContractOwner - - (* The status of the DID *) - field did_status: DidStatus = Undefined - - (* The Tyron verification methods - @key: key purpose - @value: public key of type "SchnorrSecp256k1VerificationKey2019" *) - field verification_methods: Map String ByStr33 = Emp String ByStr33 - - (* The DID services - @key: ID - @value: the type & URI *) - field services: Map String Pair String String = Emp String Pair String String - - (* The Tyron Hash *) - field tyron_hash: Option ByStr = None{ByStr} - - (* The public key for the next DID-Update operation *) - field did_update_key: Option ByStr33 = None{ByStr33} - - (* The public key for the next DID-Recover or DID-Deactivate operation *) - field did_recovery_key: Option ByStr33 = None{ByStr33} - - (* The block number when the DID-Create operation occurred *) - field created: BNum = BNum 0 - - (* The block number when the last tyronZIL transaction occurred *) - field ledger_time: BNum = BNum 0 - - (* A monotonically increasing number representing the amount of tyronZIL transactions that have taken place *) - field transaction_number: Uint128 = Uint128 0 - - (* The following fields are set by the init.tyron contract in the InitCallBack transition *) - (* The operation cost of tyronZIL transaction - @key: domain - @value: cost *) - field operation_cost: Map String Uint128 = Emp String Uint128 - - (* The address of the Tyron Pungtas Foundation *) - field foundation_address: ByStr20 = initContractOwner - - (* The agent's commission as a % of the operation_cost - @key: avatar.agent - @value: comission *) - field agent_commission: Map String Uint128 = Emp String Uint128 - field latest_commission: Uint128 = Uint128 0 - - (* The xWallet fields *) - (*--------------------*) - (* SSI Token implementations - @key: address - @value: token name *) - field xWallet: Map ByStr20 String = Emp ByStr20 String - - (* SSI Token balances - @key: token name - @value: balance *) - field xBalances: Map String Uint128 = Emp String Uint128 - - (* SSI Token proxies - @key: token name - @value: address *) - field xProxies: Map String ByStr20 = Emp String ByStr20 - - (* The Donation Scheme - @key: campaign name - @value: campaign's starting block number *) - field donation: Map String BNum = Emp String BNum - -(*------------*) -(* Procedures *) -(*------------*) - - (* The Tyron DID-Scheme - this procedure generates the user's Decentralized Identifier & the Tyron Hash *) - procedure DidScheme() - this_did = - let did_prefix = "did:tyron:zil:test:" in - let did_suffix = builtin to_string _this_address in - builtin concat did_prefix did_suffix; - decentralized_identifier := this_did; - this_th = - let hash = builtin sha256hash this_did in - builtin to_bystr hash; - th = Some{ByStr} this_th; - tyron_hash := th - end - - (* The procedure to throw an error *) - procedure ThrowError( - err: Error - ) - e = make_error err; - throw e - end - - (* Validates that the order comes from an SsiTrinity entity *) - procedure IsRightCaller( - caller: SsiTrinity - ) - match caller with - | User => - the_owner <- contract_owner; - is_owner = builtin eq the_owner _sender; - match is_owner with - | True => - | False => - err = CodeNotOwner; - ThrowError err - end - | Tyron => - this_tyron <- init_tyron; - is_tyron = builtin eq this_tyron _sender; - match is_tyron with - | True => - | False => - err = CodeNotTyron; - ThrowError err - end - | Agent avatar => - this_agent <- ssi_agents[avatar]; - match this_agent with - | Some agent_addr => - latest_agent := agent_addr; - commission <- agent_commission[avatar]; - this_agent_commission = deconstruct_option_uint128 commission; - latest_commission := this_agent_commission - | None => - err = CodeNotAgent; - ThrowError err - end - end - end - - (* Verifies that the DID-Status is correct for the given operation *) - procedure IsRightStatus( - check: CheckStatus - ) - this_status <- did_status; - match check with - | NotDeactivated => - match this_status with - | Deactivated => - err = CodeWrongStatus; - ThrowError err - | _ => - end - | Init => - match this_status with - | Initialized => - | _ => - err = CodeWrongStatus; - ThrowError err - end - | Operational => - match this_status with - | Created => - | Updated => - | Recovered => - | _ => - err = CodeWrongStatus; - ThrowError err - end - end - end - - (* Checks that the donation campaign code is within the limitation period of 1-week *) - procedure Donation( - campaign: String - ) - this_starting_block <- donation[campaign]; - current_block <- & BLOCKNUMBER; - match this_starting_block with - | Some starting_block => - is_valid = - let limit = builtin badd starting_block period in - builtin blt current_block limit; - match is_valid with - | True => - | False => - err = CodeNotValid; - ThrowError err - end - | None => - err = CodeNotValid; - ThrowError err - end - end - - (* Executes the payment to the agent and foundation *) - procedure Payment( - domain: String, - agent: String - ) - calling_agent = Agent agent; - IsRightCaller calling_agent; - this_cost <- operation_cost[domain]; - match this_cost with - | Some cost => - is_donation = builtin eq cost zero; - match is_donation with - | True => Donation domain - | False => - (* To be accepted, the payment MUST be exact *) - amount_is_correct = builtin eq _amount cost; - match amount_is_correct with - | True => - (* The DIDC accepts the incoming transfer *) - accept; - agent_addr <- latest_agent; - (* Calculates payment to the agent *) - this_agent_commission <- latest_commission; - payment_to_agent = - let percent = builtin div _amount hundred in - builtin mul this_agent_commission percent; - msg_to_agent = { - _tag: ""; - _recipient: agent_addr; - _amount: payment_to_agent - }; - e = { - _eventname: "Agent_payment_verified"; - agent: agent; - agent_address: agent_addr; - agent_commission: this_agent_commission - }; - event e; - (* Calculates payment to the foundation *) - payment_to_foundation = builtin sub _amount payment_to_agent; - this_foundation_address <- foundation_address; - msg_to_foundation = { - _tag: ""; - _recipient: this_foundation_address; - _amount: payment_to_foundation - }; - (* Sends both payments at once *) - msgs = two_msgs msg_to_agent msg_to_foundation; - send msgs - | False => - err = CodeWrongAmount; - ThrowError err - end - end - | None => - err = CodeNotSsiToken; - ThrowError err - end - end - - (* Verifies the Schnorr signature that comes with the signed data corresponds with the public DID-Keys stored in the contract *) - procedure IsRightSignature( - signedData: ByStr, - sig: ByStr64, - key: Option ByStr33 - ) - match key with - | Some pubk => - signature_is_right = builtin schnorr_verify pubk signedData sig; - match signature_is_right with - | True => - | False => - err = CodeWrongSignature; - ThrowError err - end - | None => - err = CodeUndefinedKey; - ThrowError err - end - end - - (* Updates the verification methods and services map fields *) - procedure UpdateDocument( - status: CheckStatus, - newDocument: List Document - ) - current_methods <- verification_methods; - prev_methods = - match status with - | Operational => current_methods - | _ => Emp String ByStr33 - end; - update_methods = @update_methods Document; - updated_methods = update_methods newDocument prev_methods; - verification_methods := updated_methods; - current_services <- services; - prev_services = - match status with - | Operational => current_services - | _ => Emp String Pair String String - end; - update_services = @update_services Document; - updated_services = update_services newDocument prev_services; - services := updated_services - end - - (* Validates that the new public DID-Key is different from before *) - procedure IsValidKey( - didKey: Option ByStr33, - key: ByStr33 - ) - match didKey with - | Some pubk => - is_same_key = builtin eq pubk key; - match is_same_key with - | True => - err = CodeRepeatedKey; - ThrowError err - | False => - end - | None => - err = CodeUndefinedKey; - ThrowError err - end - end - - (* Generates a timestamp *) - procedure Timestamp() - current_block <- & BLOCKNUMBER; - ledger_time := current_block; - latest_tx_number <- transaction_number; - new_tx_number = - let incrementor = Uint128 1 in - builtin add latest_tx_number incrementor; - transaction_number := new_tx_number - end - -(*-------------*) -(* Transitions *) -(*-------------*) - - (* Updates the Zilliqa address of the user aka contract owner*) - transition UpdateOwner( - newOwner: ByStr20 - ) - IsRightCaller user; - contract_owner := newOwner - end - - (* Updates the init.tyron contract to its latest implementation - only the user can execute this transition *) - transition UpdateInit( - newInit: ByStr20 - ) - IsRightCaller user; - init_tyron := newInit; - e = { - _eventname: "Updated_init.tyron"; - new_init_tyron: newInit - }; - event e - end - - (* Sets the agent's info into the user's DIDC - * Sends a message to the init.tyron contract that in return calls the InitCallBack transition *) - transition Init( - agent: String - ) - IsRightStatus notDeactivated; - this_tyron <- init_tyron; - msg = { - _tag: "Init"; - _recipient: this_tyron; - _amount: zero; - agent: agent - }; - msg_init = one_msg msg; - send msg_init - end - - (* The init.tyron contract calls this transition to set the operation cost, foundation's address and agent's domain name, address & commission *) - transition InitCallBack( - operationCost: Uint128, - foundationAddr: ByStr20, - agent: String, - agentAddr: ByStr20, - agentCommission: Uint128 - ) - IsRightCaller tyron; - operation_cost[dotDid] := operationCost; - foundation_address := foundationAddr; - ssi_agents[agent] := agentAddr; - agent_commission[agent] := agentCommission; - this_status <- did_status; - match this_status with - | Undefined => - new_status = Initialized; - did_status := new_status - | _ => - end; - did <- decentralized_identifier; - e = { - _eventname: "DIDC_initialized"; - decentralized_identifier: did; - agent: agent; - agent_commission: agentCommission - }; - event e; - Timestamp - end - - (* Sets a domain name for the Decentralized Identifier *) - transition SetSsiDomain( - domain: String, - avatar: String - ) - IsRightStatus operational; - IsRightCaller user; - this_cost <- operation_cost[dotDid]; - match this_cost with - | Some op_cost => - amount_is_correct = builtin eq _amount op_cost; - this_tyron <- init_tyron; - match amount_is_correct with - | True => - accept; - msg = { - _tag: "SetSsiDomain"; - _recipient: this_tyron; - _amount: _amount; - domain: domain; - avatar: avatar - }; - msg_domain = one_msg msg; - send msg_domain - | False => - err = CodeWrongAmount; - ThrowError err - end - | None => - err = CodeNotSsiToken; - ThrowError err - end - end - - (* The init.tyron contract calls this transition to set a user's domain name *) - transition SetDomainCallBack( - domain: String, - avatar: String - ) - IsRightCaller tyron; - resource_records[domain] := avatar; - domain_name = builtin concat avatar domain; - did <- decentralized_identifier; - e = { - _eventname: "Updated_domain"; - decentralized_identifier: did; - domain_name: domain_name - }; - event e; - Timestamp - end - - (* Executes a Tyron DID-Create operation *) - transition DidCreate( - agent: String, - document: List Document, - updateKey: ByStr33, - recoveryKey: ByStr33 - ) - IsRightStatus init; - Payment dotDid agent; - IsRightCaller user; - DidScheme; - UpdateDocument init document; - is_same_key = builtin eq updateKey recoveryKey; - match is_same_key with - | True => - err = CodeRepeatedKey; - ThrowError err - | False => - update_key = Some{ByStr33} updateKey; - did_update_key := update_key; - recovery_key = Some{ByStr33} recoveryKey; - did_recovery_key := recovery_key; - new_status = Created; - did_status := new_status; - current_block <- & BLOCKNUMBER; - created := current_block; - did <- decentralized_identifier; - e = { - _eventname: "DID_created"; - decentralized_identifier: did - }; - event e; - Timestamp - end - end - - (* Executes a Tyron DID-Recover operation *) - transition DidRecover( - agent: String, - newDocument: List Document, - docHash: ByStr32, - signature: ByStr64, - newUpdateKey: ByStr33, - newRecoveryKey: ByStr33 - ) - IsRightStatus operational; - Payment dotDid agent; - IsRightCaller user; - did_key <- did_recovery_key; - signed_data = builtin to_bystr docHash; - IsRightSignature signed_data signature did_key; - UpdateDocument init newDocument; - IsValidKey did_key newRecoveryKey; - did_ukey <- did_update_key; - IsValidKey did_ukey newRecoveryKey; - next_recovery_key = Some{ByStr33} newRecoveryKey; - did_recovery_key := next_recovery_key; - IsValidKey did_key newUpdateKey; - IsValidKey did_ukey newUpdateKey; - next_update_key = Some{ByStr33} newUpdateKey; - did_update_key := next_update_key; - is_same_key = builtin eq newUpdateKey newRecoveryKey; - match is_same_key with - | True => - err = CodeRepeatedKey; - ThrowError err - | False => - new_status = Recovered; - did_status := new_status; - did <- decentralized_identifier; - e = { - _eventname: "DID_recovered"; - decentralized_identifier: did - }; - event e; - Timestamp - end - end - - (* Executes a Tyron DID-Update operation *) - transition DidUpdate( - agent: String, - newDocument: List Document, - docHash: ByStr20, - signature: ByStr64, - newUpdateKey: ByStr33 - ) - IsRightStatus operational; - Payment dotDid agent; - IsRightCaller user; - did_key <- did_update_key; - signed_data = builtin to_bystr docHash; - IsRightSignature signed_data signature did_key; - UpdateDocument operational newDocument; - IsValidKey did_key newUpdateKey; - did_rkey <- did_recovery_key; - IsValidKey did_rkey newUpdateKey; - next_update_key = Some{ByStr33} newUpdateKey; - did_update_key := next_update_key; - new_status = Updated; - did_status := new_status; - did <- decentralized_identifier; - e = { - _eventname: "DID_updated"; - decentralized_identifier: did - }; - event e; - Timestamp - end - - (* Executes a Tyron DID-Deactivate operation *) - transition DidDeactivate( - agent: String, - signature: ByStr64 - ) - IsRightStatus operational; - Payment dotDid agent; - IsRightCaller user; - did_key <- did_recovery_key; - this_th <- tyron_hash; - match this_th with - | Some th => - IsRightSignature th signature did_key - | None => - err = CodeNotTyron; - ThrowError err - end; - deactivated_key = None{ByStr33}; - did_update_key := deactivated_key; - did_recovery_key := deactivated_key; - deactivated_methods = Emp String ByStr33; - verification_methods := deactivated_methods; - deactivated_services = Emp String Pair String String; - services := deactivated_services; - new_status = Deactivated; - did_status := new_status; - did <- decentralized_identifier; - e = { - _eventname: "DID_deactivated"; - decentralized_identifier: did - }; - event e; - Timestamp - end - -(*---------*) -(* xWallet *) -(*---------*) - - (* Verifies the validity, checks & updates the balance of the SSI Tokens *) - procedure XWallet( - direction: XDirection, - amount: Uint128 - ) - this_token <- xWallet[_sender]; - match this_token with - | Some token => - this_balance <- xBalances[token]; - balance = deconstruct_option_uint128 this_balance; - match direction with - | In => - new_balance = builtin add balance amount; - xBalances[token] := new_balance - | Out => - new_balance = builtin sub balance amount; - xBalances[token] := new_balance - end - | None => - err = CodeNotSsiToken; - ThrowError err - end - end - - (* To set/update an SSI Token *) - transition SsiToken( - token: String - ) - IsRightStatus operational; - IsRightCaller user; - this_token_key <- verification_methods[token]; - match this_token_key with - | Some token_key => - this_tyron <- init_tyron; - msg = { - _tag: "SsiToken"; - _recipient: this_tyron; - _amount: zero; - token: token - }; - update_token = one_msg msg; - send update_token - | None => - err = CodeNotSsiToken; - ThrowError err - end - end - - (* The init.tyron contract calls this transition to update an SSI Token to its latest implementation *) - transition SsiTokenCallBack( - token: String, - proxyAddr: ByStr20, - tokenAddr: ByStr20 - ) - IsRightCaller tyron; - xWallet[tokenAddr] := token; - xProxies[token] := proxyAddr; - e = { - _eventname: "Updated_SSI_Token "; - ssi_token: token; - proxy_addr: proxyAddr; - token_addr: tokenAddr - }; - event e - end - - (* Adds native funds (ZIL) to the xWallet *) - transition ZilIn() - IsRightStatus operational; - accept; - did <- decentralized_identifier; - e = { - _eventname: "ZIL_received"; - decentralized_identifier: did; - from: _sender; - amount: _amount - }; - event e - end - - (* Sends ZIL from the xWallet to any recipient that implements the tag (e.g. "ZilIn", "") *) - transition ZilOut( - tag: String, - to: ByStr20, - amount: Uint128 - ) - IsRightStatus operational; - IsRightCaller user; - accept; - msg = { - _tag: tag; - _recipient: to; - _amount: amount - }; - transfer = one_msg msg; - send transfer; - did <- decentralized_identifier; - e = { - _eventname: "ZIL_sent"; - decentralized_identifier: did; - tag: tag; - to: to; - amount: amount - }; - event e; - Timestamp - end - - (* Acceptance transition - must be defined or transfers to this xWallet will fail otherwise *) - transition RecipientAcceptTransfer( - sender : ByStr20, - recipient : ByStr20, - amount : Uint128 - ) - IsRightStatus operational; - XWallet incoming amount; - did <- decentralized_identifier; - e = { - _eventname: "Transfer_received"; - decentralized_identifier: did; - sender: sender; - amount: amount - }; - event e - end - - (* Transfers ZRC-2 SSI Tokens *) - transition XTransfer( - domain: String, - token: String, - agent: String, - to: ByStr20, - amount: Uint128, - signature: ByStr64 - ) - IsRightStatus operational; - IsRightCaller user; - Payment domain agent; - this_balance <- xBalances[token]; - balance = deconstruct_option_uint128 this_balance; - is_enough = builtin lt amount balance; - match is_enough with - | True => - this_token_key <- verification_methods[token]; - signed_data = builtin to_bystr to; - IsRightSignature signed_data signature this_token_key; - this_proxy <- xProxies[token]; - match this_proxy with - | Some proxy => - msg = { - _tag: "Transfer"; - _recipient: proxy; - _amount: zero; - to: to; - amount: amount - }; - transfer = one_msg msg; - send transfer - | None => - err = CodeNotProxy; - ThrowError err - end - | False => - err = CodeWrongAmount; - ThrowError err - end - end - - (* Callback transition - must be defined or transfers from this xWallet will fail otherwise *) - transition TransferSuccessCallBack( - sender: ByStr20, - recipient: ByStr20, - amount : Uint128 - ) - IsRightStatus operational; - XWallet outcoming amount; - did <- decentralized_identifier; - e = { - _eventname: "Transfer_sent"; - decentralized_identifier: did; - from: sender; - to: recipient; - amount: amount - }; - event e; - Timestamp - end - - (* To initialize a donation campaign code *) - transition Donate( - campaign: String - ) - IsRightStatus operational; - this_tyron <- init_tyron; - msg = { - _tag: "Donate"; - _recipient: this_tyron; - _amount: zero; - campaign: campaign - }; - msg_donate = one_msg msg; - send msg_donate - end - - transition DonateCallBack( - campaign: String - ) - IsRightCaller tyron; - operation_cost[campaign] := zero; - current_block <- & BLOCKNUMBER; - donation[campaign] := current_block; - did <- decentralized_identifier; - e = { - _eventname: "Donation_campaign"; - decentralized_identifier: did; - campaign: campaign - }; - event e; - Timestamp - end diff --git a/src/lib/blockchain/smart-contracts/init.tyron.scilla b/src/lib/blockchain/smart-contracts/init.tyron.scilla deleted file mode 100644 index 2383b334..00000000 --- a/src/lib/blockchain/smart-contracts/init.tyron.scilla +++ /dev/null @@ -1,375 +0,0 @@ -(* - Tyron: Decentralized identity application powered by Zilliqa - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*) - -scilla_version 0 - -(*------------------------*) -(* The init.tyron library *) -(*------------------------*) - -library Init - -(* Messages *) -(*----------*) - let one_msg = - fun (msg: Message) => - let nil_msg = Nil {Message} in - Cons {Message} msg nil_msg - -(* Constants *) -(*-----------*) - let zero = Uint128 0 - let dotDid = ".did" - let dotTyron = ".tyron" - let dotAgent = ".agent" - -(* Error events *) -(*--------------*) - type Error = - | CodeNotFoundation - | CodeInsufficientFunds - | CodeDomainTaken - | CodeNotAgent - | CodeNotSsiDomain - | CodeNotRightCaller - | CodeNotCampaign - -(* Functions *) -(*-----------*) - let make_error = - fun (error: Error) => - let result = - match error with - | CodeNotFoundation => Int32 -1 - | CodeInsufficientFunds => Int32 -2 - | CodeDomainTaken => Int32 -3 - | CodeNotAgent => Int32 -4 - | CodeNotSsiDomain => Int32 -5 - | CodeNotRightCaller => Int32 -6 - | CodeNotCampaign => Int32 -7 - end - in - {_exception : "Error"; code : result} - - let deconstruct_option_uint128 = - fun(option: Option Uint128) => - match option with - | Some value => value - | _ => zero - end - -(*------------------------------------------------------------------------*) -(* init.tyron: The SSI Initialization & Domain Name System Smart Contract *) -(*------------------------------------------------------------------------*) - -contract Init( -(* Immutable fields declaration *) -(*------------------------------*) - - (* The Tyron Pungtas Foundation is the owner of the init.tyron contract *) - initFoundationAddr: ByStr20 - ) - -(* Mutable fields declaration *) -(*----------------------------*) - (* The Zilliqa address of the Tyron Pungtas Foundation *) - field foundation_addr: ByStr20 = initFoundationAddr - - (* The DID-Smart-Contract code by version - @key: version - @value: hex-encoded code *) - field didc_code: Map String String = Emp String String - - (* The cost of a tyronZIL transaction - @key: domain OR contract.tyron - @value: cost as % of the amount *) - field operation_cost: Map String Uint128 = Emp String Uint128 - - (* The agent's commission as a % of share - - the user has 51% of the share - - Tyron Pungtas Foundation 51% of the remaining 49 % - - the agent earns the rest and can offer promotions - @key: avatar.agent - @value: max 24% *) - field agent_commission: Map String Uint128 = Emp String Uint128 - - (* The DNS records - @key: SsiDomain (e.g. ".did", ".tyron", ".agent") - @value: Map of - @key: avatar - @value: address *) - field dns: Map String (Map String ByStr20) = Emp String (Map String ByStr20) - - (* The proxy addresses of the SSI Tokens - @key: token - @value: proxy address *) - field ssi_tokens: Map String ByStr20 = Emp String ByStr20 - - (* Token implementations - @key: proxy address - @value: implementation address *) - field ssi_token_implementations: Map ByStr20 ByStr20 = Emp ByStr20 ByStr20 - -(*------------*) -(* Procedures *) -(*------------*) - -(* The procedure to throw an error *) - procedure ThrowError( - err: Error - ) - e = make_error err; - throw e - end - -(* Executes the payment to the foundation *) - procedure Payment( - domain: String - ) - this_registration_cost <- operation_cost[domain]; - match this_registration_cost with - | Some registration_cost => - (* To be accepted, the payment MUST be exact *) - amount_is_correct = builtin eq _amount registration_cost; - match amount_is_correct with - | True => - (* The contract accepts the incoming transfer *) - accept; - the_foundation <- foundation_addr; - msg = { - _tag: ""; - _recipient: the_foundation; - _amount: _amount - }; - msg_to_foundation = one_msg msg; - send msg_to_foundation - | False => - err = CodeInsufficientFunds; - ThrowError err - end - | None => - err = CodeNotSsiDomain; - ThrowError err - end - end - -(* Validates the _sender *) - procedure IsRightCaller( - check: ByStr20 - ) - is_correct = builtin eq check _sender; - match is_correct with - | True => - | False => - err = CodeNotRightCaller; - ThrowError err - end - end - -(*-------------*) -(* Transitions *) -(*-------------*) - - (* Updates the address of the Tyron Pungtas Foundation *) - transition UpdateOwner( - newOwner: ByStr20 - ) - the_foundation <- foundation_addr; - IsRightCaller the_foundation; - foundation_addr := newOwner - end - - (* Sets the DID-Smart-Contract code *) - transition SetDidCode( - version: String, - code: String - ) - the_foundation <- foundation_addr; - IsRightCaller the_foundation; - didc_code[version] := code; - e = { - _eventname: "Updated_DIDC"; - version: version; - code: code - }; - event e - end - - (* Sets the operation_cost by SSI domain (domain name or donation campaign code) *) - transition OperationCost( - domain: String, - cost: Uint128 - ) - the_foundation <- foundation_addr; - IsRightCaller the_foundation; - operation_cost[domain] := cost - end - - (* Sets the agent_commission *) - transition AgentCommission( - agent: String, - commission: Uint128 - ) - this_agent_addr <- dns[dotAgent][agent]; - match this_agent_addr with - | Some agentAddr => - IsRightCaller agentAddr; - agent_commission[agent] := commission (*to-do make sure about %*) - | None => - err = CodeNotAgent; - ThrowError err - end - end - - (* Called by the DIDC to set the .did operation cost, foundation address & agent's account *) - transition Init( - agent: String - ) - this_agent_addr <- dns[dotAgent][agent]; - match this_agent_addr with - | Some agent_addr => - this_cost <- operation_cost[dotDid]; - the_operation_cost = deconstruct_option_uint128 this_cost; - this_commission <- agent_commission[agent]; - the_agent_commission = deconstruct_option_uint128 this_commission; - the_foundation <- foundation_addr; - msg = { - _tag: "InitCallBack"; - _recipient: _sender; - _amount: zero; - operationCost: the_operation_cost; - foundationAddr: the_foundation; - agent: agent; - agentAddr: agent_addr; - agentCommission: the_agent_commission - }; - msg_init = one_msg msg; - send msg_init - | None => - err = CodeNotAgent; - ThrowError err - end - end - - (* Sets a Self-Sovereign Identity domain name in the DNS *) - transition SetSsiDomain( - domain: String, - avatar: String - ) - Payment domain; - taken <- exists dns[domain][avatar]; - match taken with - | True => - err = CodeDomainTaken; - ThrowError err - | False => - dns[domain][avatar] := _sender; - msg = { - _tag: "SetDomainCallBack"; - _recipient: _sender; - _amount: zero; - domain: domain; - avatar: avatar - }; - msg_domain = one_msg msg; - send msg_domain - end - end - - (* Sets the token name, proxy address and implementation address of an SSI Token *) - transition SetSsiToken( - token: String, - proxyAddr: ByStr20, - tokenAddr: ByStr20 - ) - the_foundation <- foundation_addr; - IsRightCaller the_foundation; - ssi_tokens[token] := proxyAddr; - ssi_token_implementations[proxyAddr] := tokenAddr; - e = { - _eventname: "Updated_SSI_Token"; - token: token; - proxy_address: proxyAddr; - token_implementation_address: tokenAddr - }; - event e - end - - (* Called by a DIDC to initialize an SSI Token in its state *) - transition SsiToken( - token: String - ) - this_proxy_addr <- ssi_tokens[token]; - match this_proxy_addr with - | Some proxy_addr => - this_token_impl <- ssi_token_implementations[proxy_addr]; - match this_token_impl with - | Some token_impl => - msg = { - _tag: "SsiTokenCallBack"; - _recipient: _sender; - _amount: zero; - token: token; - proxyAddr: proxy_addr; - tokenAddr: token_impl - }; - msg_token = one_msg msg; - send msg_token - | None => - err = CodeNotSsiDomain; - ThrowError err - end - | None => - err = CodeNotSsiDomain; - ThrowError err - end - end - - (* Called by a DIDC to initialize a donation campaign code in its state *) - transition Donate( - campaign: String - ) - this_cost <- operation_cost[campaign]; - match this_cost with - | Some cost => - is_donation = builtin eq cost zero; - match is_donation with - | True => - msg = { - _tag: "DonateCallBack"; - _recipient: _sender; - _amount: zero; - campaign: campaign - }; - donation_init = one_msg msg; - send donation_init - | False => - err = CodeNotCampaign; - ThrowError err - end - | None => - err = CodeNotCampaign; - ThrowError err - end - end - - (* Removes a donation campaign code from the *operation_cost* map field *) - transition DeleteCampaign( - campaign: String - ) - the_foundation <- foundation_addr; - IsRightCaller the_foundation; - delete operation_cost[campaign] - end \ No newline at end of file diff --git a/src/lib/blockchain/smart-contracts/smart-util.ts b/src/lib/blockchain/smart-contracts/smart-util.ts deleted file mode 100644 index ac74a5b6..00000000 --- a/src/lib/blockchain/smart-contracts/smart-util.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as API from '@zilliqa-js/zilliqa'; -import { InitTyron } from '../tyronzil'; -import LogColors from '../../../bin/log-colors'; -import * as readline from 'readline-sync'; -import * as fs from 'fs'; -import * as util from 'util'; -import * as zlib from 'zlib'; - -/** Tools to manage smart contracts */ -export default class SmartUtil { - /** Encodes the given contract into a Base64URL string to save it into the init.tyron smart contract */ - public static async encode(): Promise { - const contractName = readline.question(LogColors.green(`What is the name of the contract that you'd like to encode? - `) + LogColors.lightBlue(`Your answer: `)); - try { - const CONTRACT_STRING = (fs.readFileSync(`src/lib/blockchain/smart-contracts/${contractName}.scilla`)).toString(); - const COMPRESSED_CONTRACT = await (util.promisify(zlib.gzip))(CONTRACT_STRING) as Buffer; - console.log(COMPRESSED_CONTRACT.toString('base64')); - console.log(`The size of the compressed smart-contract is: ${COMPRESSED_CONTRACT.byteLength}`) - } catch (error) { - console.error(error) - } - } - - /** Fetches the `Tyron DID-Smart-Contract` by version & decodes it */ - public static async decode(api: API.Zilliqa, initTyron: InitTyron, contractVersion: string): Promise { - const INIT_TYRON = initTyron as string; - const THIS_CONTRACT = await api.blockchain.getSmartContractState(INIT_TYRON) - .then(async STATE => { - const INIT = { - didcCode: STATE.result.didc_code, - }; - const CONTRACTS = Object.entries(INIT.didcCode); - let ENCODED_CONTRACT: string; - CONTRACTS.forEach((value: [string, unknown]) => { - if (value[0] === contractVersion) { - ENCODED_CONTRACT = value[1] as string; - } - }); - - const COMPRESSED_CONTRACT = Buffer.from(ENCODED_CONTRACT!,'base64'); - const DECOMPRESSED_CONTRACT = await (util.promisify(zlib.unzip))(COMPRESSED_CONTRACT) as Buffer; - return DECOMPRESSED_CONTRACT.toString(); - }) - .catch(err => { throw err }); - return THIS_CONTRACT; - } - - /** Gets the value out of a DIDC field Option */ - public static async getValue(object: any): Promise { - const ENTRIES = Object.entries(object); - let VALUE: string; - ENTRIES.forEach((value: [string, unknown]) => { - if (value[0] === "arguments") { - VALUE = value[1] as string; - } - }); - return VALUE![0]; - } - - /** Gets the DID-Status out of a DIDC field Option */ - public static async getStatus(object: any): Promise { - const ENTRIES = Object.entries(object); - let VALUE: string; - ENTRIES.forEach((value: [string, unknown]) => { - if (value[0] === "constructor") { - VALUE = value[1] as string; - } - }); - return VALUE!; - } - - /** Gets the value out of a map key */ - public static async getValuefromMap(object: any, key: string): Promise { - const ENTRIES = Object.entries(object); - let VALUE; - ENTRIES.forEach((value: [string, unknown]) => { - if (value[0] === key) { - VALUE = value[1] - } - }); - return VALUE; - } - - /** Turns the smart contract's map into a Map */ - public static async intoMap(object: any): Promise> { - const ENTRIES = Object.entries(object); - let MAP = new Map(); - ENTRIES.forEach((value: [string, unknown]) => { - MAP.set(value[0], value[1]) - }); - return MAP; - } - - /** Turns the DIDC `services` map field into a Map */ - public static async fromServices(object: any): Promise> { - const PREV_MAP = await this.intoMap(object); - let MAP = new Map(); - - for (let id of PREV_MAP.keys()) { - const OBJECT = PREV_MAP.get(id); - const ENTRIES = Object.entries(OBJECT); - - ENTRIES.forEach((value: [string, unknown]) => { - if (value[0] === "arguments") { - const VALUE = value[1] as [string, string]; - const TYPE = VALUE[0]; - const URI = VALUE[1]; - MAP.set(id, [TYPE, URI]); - } - }); - - }; - return MAP; - } -} diff --git a/src/lib/blockchain/tyron-state.ts b/src/lib/blockchain/tyron-state.ts deleted file mode 100644 index b376d79e..00000000 --- a/src/lib/blockchain/tyron-state.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { NetworkNamespace } from '../decentralized-identity/tyronZIL-schemes/did-scheme'; -import ZilliqaInit from './zilliqa-init'; -import SmartUtil from './smart-contracts/smart-util'; -import { OperationType } from '../decentralized-identity/protocols/sidetree'; -import ErrorCode from '../decentralized-identity/util/ErrorCode'; - -export default class TyronState { - public readonly contract_owner: string; - public readonly decentralized_identifier: string; - public readonly tyron_hash: string; - public readonly did_status: OperationType; - public readonly verification_methods: Map; - public readonly services: Map - public readonly did_update_key: string; - public readonly did_recovery_key: string; - public readonly created: number; - public readonly ledger_time: number; - public readonly sidetree_transaction_number: number; - - private constructor( - state: TyronStateModel - ) { - this.contract_owner = state.contract_owner; - this.decentralized_identifier = state.decentralized_identifier; - this.tyron_hash = state.tyron_hash; - this.did_status = state.did_status as OperationType; - this.verification_methods = state.verification_methods; - this.services = state.services; - this.did_update_key = state.did_update_key; - this.did_recovery_key = state.did_recovery_key; - this.created = state.created; - this.ledger_time = state.ledger_time; - this.sidetree_transaction_number = state.sidetree_transaction_number; - } - - /** Fetches the current state from the blockchain - * @params addr: the Zilliqa address of the user's smart-contract - */ - public static async fetch(network: NetworkNamespace, didcAddr: string): Promise { - const ZIL_INIT = new ZilliqaInit(network); - const tyron_state = await ZIL_INIT.API.blockchain.getSmartContractState(didcAddr) - .then(async didc_state => { - const STATUS = await SmartUtil.getStatus(didc_state.result.did_status); - switch (STATUS) { - case OperationType.Deactivate: - throw new ErrorCode("DidDeactivated", "The requested DID is deactivated"); - default: - const STATE: TyronStateModel = { - contract_owner: String(didc_state.result.contract_owner), - decentralized_identifier: String(didc_state.result.decentralized_identifier), - tyron_hash: await SmartUtil.getValue(didc_state.result.tyron_hash), - did_status: STATUS, - verification_methods: await SmartUtil.intoMap(didc_state.result.verification_methods), - services: await SmartUtil.fromServices(didc_state.result.services), - did_update_key: await SmartUtil.getValue(didc_state.result.did_update_key), - did_recovery_key: await SmartUtil.getValue(didc_state.result.did_recovery_key), - created: Number(didc_state.result.created), - ledger_time: Number(didc_state.result.ledger_time), - sidetree_transaction_number: Number(didc_state.result.sidetree_transaction_number), - }; - return new TyronState(STATE); - } - }) - .catch(err => { throw err }); - return tyron_state; - } -} - -/*** ** interfaces ** ***/ - -/** The Tyron State Model */ -export interface TyronStateModel { - contract_owner: string; - decentralized_identifier: string; - tyron_hash: string; - did_status: string; - verification_methods: Map; - services: Map; - did_update_key: string; - did_recovery_key: string; - created: number; - ledger_time: number; - sidetree_transaction_number: number; -} diff --git a/src/lib/blockchain/tyronzil.ts b/src/lib/blockchain/tyronzil.ts deleted file mode 100644 index 3d43d1f9..00000000 --- a/src/lib/blockchain/tyronzil.ts +++ /dev/null @@ -1,697 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { Transaction } from '@zilliqa-js/account'; -import { Contract} from '@zilliqa-js/contract'; -import * as zcrypto from '@zilliqa-js/crypto'; -import * as Util from '@zilliqa-js/util'; -import ZilliqaInit from './zilliqa-init'; -import SmartUtil from './smart-contracts/smart-util'; -import { NetworkNamespace } from '../decentralized-identity/tyronZIL-schemes/did-scheme'; -import ErrorCode from '../decentralized-identity/util/ErrorCode'; -import LogColors from '../../bin/log-colors'; -import { Action, DocumentElement, ServiceModel } from '../decentralized-identity/protocols/models/document-model'; -import CodeError from '../decentralized-identity/util/ErrorCode'; -import { PublicKeyModel } from '../decentralized-identity/protocols/models/verification-method-models'; - -/** The `init.tyron smart contracts */ -export enum InitTyron { - Testnet = "0x63e2d8484187de4f66a571c098f3b51a793f055b", - Mainnet = "0x1c8272a79b5b4920bcae80f310d638c8dd4bd8aa", - Isolated = "0x9ded7118b3386108f1bc4e0e0699d7ab23997265" -} - -/** The tyronZIL transaction class */ -export default class TyronZIL extends ZilliqaInit { - /** The user is the owner of their DIDC */ - public readonly contractOwner: string; - public readonly userPrivateKey: string; - - /** The Zilliqa address where the `init.tyron smart-contract` resides */ - public readonly initTyron: InitTyron; - - public readonly gasPrice: Util.BN; - public readonly gasLimit: Util.Long; - - private constructor( - network: NetworkNamespace, - contractOwner: string, - userPrivateKey: string, - initTyron: InitTyron, - gasPrice: Util.BN, - gasLimit: Util.Long, - ) { - super(network); - this.contractOwner = contractOwner; - this.userPrivateKey = userPrivateKey; - this.initTyron = initTyron; - this.gasPrice = gasPrice; - this.gasLimit = gasLimit - } - - /** Retrieves the minimum gas price & validates the account info */ - public static async initialize( - network: NetworkNamespace, - initTyron: InitTyron, - userPrivateKey: string, - gasLimit: string - ): Promise { - let CONTRACT_OWNER = zcrypto.getAddressFromPrivateKey(userPrivateKey); - - let GAS_LIMIT: Util.Long.Long; - if(!Number(gasLimit) || Number(gasLimit) < 0) { - throw new ErrorCode("WrongAmount", "The gas limit MUST be a number greater than 0") - } else { - GAS_LIMIT = new Util.Long(Number(gasLimit)); - } - - const ZIL_INIT = new ZilliqaInit(network); - const transaction_init = await ZIL_INIT.API.blockchain.getMinimumGasPrice() - .then(min_gas_price => { - const GAS_PRICE = new Util.BN(min_gas_price.result!); - console.log(LogColors.yellow(`The minimum gas price retrieved from the network is: `) + LogColors.brightYellow(`${Number(GAS_PRICE)/1000000000000} ZIL`)) - - return new TyronZIL( - network, - CONTRACT_OWNER, - userPrivateKey, - initTyron, - GAS_PRICE, - GAS_LIMIT - ); - }) - .catch(err => {throw err}); - return transaction_init; - } - - /*** **** ***/ - - /** Deploys the DIDC by version - * & calls the Init transition with the avatar.agent */ - public static async deploy(input: TyronZIL, version: string): Promise { - const deployed_contract = await SmartUtil.decode(input.API, input.initTyron, version) - .then(contract_code => { - console.log(LogColors.brightGreen(`DIDC-code successfully downloaded & decoded from the init.tyron smart contract!`)); - - const CONTRACT_INIT = [ - { - vname: '_scilla_version', - type: 'Uint32', - value: '0', - }, - { - vname: 'initContractOwner', - type: 'ByStr20', - value: `${input.contractOwner}`, - }, - { - vname: 'initTyron', - type: 'ByStr20', - value: `${input.initTyron}`, - } - ]; - const CONTRACT = input.API.contracts.new(contract_code, CONTRACT_INIT); - return CONTRACT; - }) - .then(async contract => { - console.log(LogColors.yellow(`The user's DIDC got properly instantiated: `) + LogColors.brightYellow(`${JSON.stringify(contract, null, 2)}`)); - input.API.wallet.addByPrivateKey(input.userPrivateKey); - - const USER_BALANCE = await input.API.blockchain.getBalance(input.contractOwner); - - console.log(LogColors.brightGreen(`Deploying...`)); - const [deployTx, didc] = await contract.deploy( - { - version: input.zilVersion, - gasPrice: input.gasPrice, - gasLimit: input.gasLimit, - nonce: Number(USER_BALANCE.result.nonce)+ 1, - }, - 33, - 1000, - false, - ); - const IS_DEPLOYED = deployTx.isConfirmed(); - if(!IS_DEPLOYED) { - throw new ErrorCode("Wrong-Deployment","The user's DIDC did not get deployed") - } - console.log(LogColors.yellow(`The user's Tyron DID smart contract (DIDC) is deployed: `) + LogColors.brightYellow(`${IS_DEPLOYED}`)); - console.log(LogColors.yellow(`Its Zilliqa address is: `) + LogColors.brightYellow(`${didc.address}`)); - console.log(LogColors.yellow(`Deployment Transaction ID: `) + LogColors.brightYellow(`${deployTx.id}`)); - - const DEPLOYMENT_GAS = (deployTx.getReceipt())!.cumulative_gas; - console.log(LogColors.yellow(`Gas consumed by deploying the DIDC was: `) + LogColors.brightYellow(`${DEPLOYMENT_GAS}`)); - - const DEPLOYED_CONTRACT = { - transaction: deployTx, - contract: didc - }; - return DEPLOYED_CONTRACT; - }) - .then(async deployed_contract => { - console.log(LogColors.brightGreen(`Calling the Init transition...`)) - const agent = "pungtas"; - const CALL = await deployed_contract.contract.call( - 'Init', - [ - { - vname: 'agent', - type: 'String', - value: `${agent}` - } - ], - { - version: input.zilVersion, - amount: new Util.BN(0), - gasPrice: input.gasPrice, - gasLimit: input.gasLimit - }, - 33, - 1000, - false - ); - console.log(LogColors.yellow(`The user's DIDC is initialized: `) + LogColors.brightYellow(`${CALL.isConfirmed()}`)); - const CUMULATIVE_GAS = (CALL.getReceipt())!.cumulative_gas; - console.log(LogColors.yellow(`Gas consumed by the Init transition was: `) + LogColors.brightYellow(`${CUMULATIVE_GAS}`)); - console.log(LogColors.yellow(`The transaction ID is: `) + LogColors.brightYellow(`${CALL.id}`)); - if(!CALL.isConfirmed()) { - throw new ErrorCode("CodeNotInitialized", "The DIDC did not get initialized") - } - return deployed_contract; - }) - .catch(err => { throw err }); - return deployed_contract; - } - - /** Submits a tyronZIL transaction */ - public static async submit( - input: TyronZIL, - didcAddr: string, - tag: TransitionTag, - params: TransitionParams[], - operation: string // e.g. ".did" - ): Promise { - - console.log(LogColors.brightGreen(`Processing the ${tag} tyronZIL transaction...`)); - - await input.API.blockchain.getSmartContractState(didcAddr) - .then(async SMART_CONTRACT_STATE => { - const OPERATION_COST = SMART_CONTRACT_STATE.result.operation_cost; - return await SmartUtil.getValuefromMap(OPERATION_COST, operation); - }) - .then(async operation_cost => { - const AMOUNT = new Util.BN(operation_cost); - const USER_PUBKEY = zcrypto.getPubKeyFromPrivateKey(input.userPrivateKey); - - const USER_BALANCE = await input.API.blockchain.getBalance(input.contractOwner); - - const TRANSITION: Transition = { - _tag: tag, - _amount: String(AMOUNT), - _sender: input.contractOwner, - params: params - }; - - const TX_OBJECT: TxObject = { - version: input.zilVersion, - amount: AMOUNT, - nonce: Number(USER_BALANCE.result.nonce)+ 1, - gasLimit: input.gasLimit, - gasPrice: input.gasPrice, - toAddr: didcAddr, - pubKey: USER_PUBKEY, - data: JSON.stringify(TRANSITION), - }; - - const RAW_TX = input.API.transactions.new(TX_OBJECT); - return RAW_TX; - }) - .then(async raw_tx => { - input.API.wallet.addByPrivateKey(input.userPrivateKey); - - const SIGNED_TX = await input.API.wallet.signWith(raw_tx, input.contractOwner); - return SIGNED_TX; - }) - .then(async signed_tx => { - /** Sends the transaction to the Zilliqa blockchain platform */ - const TX = await input.API.blockchain.createTransaction(signed_tx, 33, 1000); - return TX; - }) - .then( async transaction => { - const TRAN_ID = transaction.id!; - - const TRANSACTION = await transaction.confirm(TRAN_ID, 33, 1000) - console.log(LogColors.yellow(`For testing purposes, disclosing the ${tag} tyronZIL transaction: `) + LogColors.brightYellow(`${JSON.stringify(TRANSACTION, null, 2)}`)); - const STATUS = transaction.isConfirmed(); - console.log(LogColors.yellow(`The transaction is confirmed: `) + LogColors.brightYellow(`${STATUS}`)); - if(STATUS){ - console.log(LogColors.brightGreen(`The ${tag} tyronZIL transaction was successful!`)); - } else { - console.log(LogColors.red(`The ${tag} tyronZIL transaction was unsuccessful!`)); - } - - const TX_RECEIPT = transaction.getReceipt(); - const CUMULATIVE_GAS = TX_RECEIPT!.cumulative_gas; - console.log(LogColors.yellow(`Gas consumed: `) + LogColors.brightYellow(`${CUMULATIVE_GAS}`)); - }) - .catch(err => { throw err }) - } - - public static async create( - agent: string, - document: any[], - updateKey: string, - recoveryKey: string - ): Promise { - - const PARAMS = []; - - const AGENT: TransitionParams = { - vname: 'agent', - type: 'String', - value: agent, - }; - PARAMS.push(AGENT); - - const DOCUMENT: TransitionParams = { - vname: 'document', - type: 'List Document', - value: document, - }; - PARAMS.push(DOCUMENT); - - const UPDATE_KEY: TransitionParams = { - vname: 'updateKey', - type: 'ByStr33', - value: updateKey, - }; - PARAMS.push(UPDATE_KEY); - - const RECOVERY_KEY: TransitionParams = { - vname: 'recoveryKey', - type: 'ByStr33', - value: recoveryKey, - }; - PARAMS.push(RECOVERY_KEY); - - return PARAMS; - } - - public static async recover( - agent: string, - newDocument: any[], - docHash: string, - signature: string, - newUpdateKey: string, - newRecoveryKey: string - ): Promise { - - const PARAMS = []; - - const AGENT: TransitionParams = { - vname: 'agent', - type: 'String', - value: agent, - }; - PARAMS.push(AGENT); - - const DOCUMENT: TransitionParams = { - vname: 'newDocument', - type: 'List Document', - value: newDocument, - }; - PARAMS.push(DOCUMENT); - - const DOC_HASH: TransitionParams = { - vname: 'docHash', - type: 'ByStr20', - value: docHash, - }; - PARAMS.push(DOC_HASH); - - const SIGNATURE: TransitionParams = { - vname: 'signature', - type: 'ByStr64', - value: signature, - }; - PARAMS.push(SIGNATURE); - - const NEW_UPDATE_KEY: TransitionParams = { - vname: 'newUpdateKey', - type: 'ByStr33', - value: newUpdateKey, - }; - PARAMS.push(NEW_UPDATE_KEY); - - const NEW_RECOVERY_KEY: TransitionParams = { - vname: 'newRecoveryKey', - type: 'ByStr33', - value: newRecoveryKey, - }; - PARAMS.push(NEW_RECOVERY_KEY); - - return PARAMS; - } - - public static async update( - agent: string, - newDocument: any[], - docHash: string, - signature: string, - newUpdateKey: string - ): Promise { - - const PARAMS = []; - - const AGENT: TransitionParams = { - vname: 'agent', - type: 'String', - value: agent, - }; - PARAMS.push(AGENT); - - const DOCUMENT: TransitionParams = { - vname: 'newDocument', - type: 'List Document', - value: newDocument, - }; - PARAMS.push(DOCUMENT); - - const DOC_HASH: TransitionParams = { - vname: 'docHash', - type: 'ByStr20', - value: docHash, - }; - PARAMS.push(DOC_HASH); - - const SIGNATURE: TransitionParams = { - vname: 'signature', - type: 'ByStr64', - value: signature, - }; - PARAMS.push(SIGNATURE); - - const NEW_UPDATE_KEY: TransitionParams = { - vname: 'newUpdateKey', - type: 'ByStr33', - value: newUpdateKey, - }; - PARAMS.push(NEW_UPDATE_KEY); - - return PARAMS; - } - - public static async deactivate( - agent: string, - signature: string - ): Promise { - - const PARAMS = []; - - const AGENT: TransitionParams = { - vname: 'agent', - type: 'String', - value: agent, - }; - PARAMS.push(AGENT); - - const SIGNATURE: TransitionParams = { - vname: 'signature', - type: 'ByStr64', - value: signature, - }; - PARAMS.push(SIGNATURE); - - return PARAMS; - } - - public static async dns( - domain: string, - avatar: string - ): Promise { - - const PARAMS = []; - - const DOMAIN: TransitionParams = { - vname: 'domain', - type: 'String', - value: domain, - }; - PARAMS.push(DOMAIN); - - const AVATAR: TransitionParams = { - vname: 'avatar', - type: 'String', - value: avatar, - }; - PARAMS.push(AVATAR); - return PARAMS; - } - - /** Returns a DID-Document element transition value */ - public static async documentElement( - element: DocumentElement, - action: Action, - key?: PublicKeyModel, - service?: ServiceModel - ): Promise { - let VALUE: TransitionValue; - let ADD: TransitionValue = { - argtypes: [], - arguments: [], - constructor: Action.Adding - }; - let REMOVE: TransitionValue = { - argtypes: [], - arguments: [], - constructor: Action.Removing - }; - switch (element) { - case DocumentElement.VerificationMethod: - VALUE = { - argtypes: [], - arguments: [], - constructor: "VerificationMethod" - }; - switch (action) { - case Action.Adding: - Object.assign(VALUE, { - arguments: [ - ADD, - `${key!.id}`, - `${key!.key}` - ] - }); - break; - case Action.Removing: - Object.assign(VALUE, { - arguments: [ - REMOVE, - `${key!.id}`, - "0x024caf04aa4f660db04adf65daf5b993b3383fcdb2ef0479ca8866b1336334b5b4" - ] - }); - break; - } - break; - case DocumentElement.Service: - VALUE = { - argtypes: [], - arguments: [], - constructor: "Service" - }; - let DID_SERVICE = { - argtypes: [], - arguments: [ - `${service!.type}`, - { - argtypes: [], - arguments: [ - { - constructor: `${service!.transferProtocol}`, - argtypes: [], - arguments: [] - }, - `${service!.uri}` - ], - constructor: "ServiceEndpoint" - } - ], - constructor: "DidService" - }; - switch (action) { - case Action.Adding: - Object.assign(VALUE, { - arguments: [ - ADD, - `${service!.id}`, - DID_SERVICE - ] - }); - break; - case Action.Removing: - Object.assign(VALUE, { - arguments: [ - REMOVE, - `${service!.id}`, - DID_SERVICE - ] - }); - break; - } - break; - default: - throw new CodeError("UnsupportedElement", "That is not a DID-Document supported element"); - } - return VALUE; - } - - public static async xTransfer( - domain: string, - token: string, - agent: string, - recipient: string, - amount: string, - signature: string - ): Promise { - - const PARAMS = []; - - const DOMAIN: TransitionParams = { - vname: 'domain', - type: 'String', - value: domain - }; - PARAMS.push(DOMAIN); - - const TOKEN: TransitionParams = { - vname: 'token', - type: 'String', - value: token - }; - PARAMS.push(TOKEN); - - const AGENT: TransitionParams = { - vname: 'agent', - type: 'String', - value: agent - }; - PARAMS.push(AGENT); - - const RECIPIENT: TransitionParams = { - vname: 'to', - type: 'ByStr20', - value: recipient - }; - PARAMS.push(RECIPIENT); - - const AMOUNT: TransitionParams = { - vname: 'amount', - type: 'Uint128', - value: amount, - }; - PARAMS.push(AMOUNT); - - const SIGNATURE: TransitionParams = { - vname: 'signature', - type: 'ByStr64', - value: signature - }; - PARAMS.push(SIGNATURE); - - return PARAMS; - } - - public static async ssiToken( - token: string - ): Promise { - - const PARAMS = []; - - const TOKEN: TransitionParams = { - vname: 'token', - type: 'String', - value: token, - }; - PARAMS.push(TOKEN); - return PARAMS; - } - - public static async donate( - campaign: string - ): Promise { - - const PARAMS = []; - - const CAMPAIGN: TransitionParams = { - vname: 'campaign', - type: 'String', - value: campaign, - }; - PARAMS.push(CAMPAIGN); - return PARAMS; - } -} - -/*** ** interfaces ** ***/ - -/** The result of a DIDC deployment */ -export interface DeployedContract { - transaction: Transaction, - contract: Contract -} - -interface Transition { - _tag: string; // transition to be invoked - _amount: string; // number of QA to be transferred - _sender: string; // address of the invoker - params: TransitionParams[] // an array of parameter objects -} - -export enum TransitionTag { - Create = 'DidCreate', - Update = "DidUpdate", - Recover = "DidRecover", - Deactivate = "DidDeactivate", - Dns = "SetSsiDomain", - XTranfer = "XTransfer", - SsiToken = "SsiToken", - Donate = "Donate" -} - -interface TransitionParams { - vname: string; - type: any; - value: unknown; -} - -export interface TransitionValue { - constructor: string; - argtypes: any[]; - arguments: any[] -} - -interface TxObject { - version: number; - amount: Util.BN; - nonce: number; - gasLimit: Util.Long; - gasPrice: Util.BN; - toAddr: string; - pubKey: string; - code?: string; - data?: string; - priority?: boolean; -} diff --git a/src/lib/blockchain/zilliqa-init.ts b/src/lib/blockchain/zilliqa-init.ts deleted file mode 100644 index 779e9930..00000000 --- a/src/lib/blockchain/zilliqa-init.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { NetworkNamespace } from '../decentralized-identity/tyronZIL-schemes/did-scheme'; -import * as API from '@zilliqa-js/zilliqa'; -import * as Util from '@zilliqa-js/util'; - -export default class ZilliqaInit { - public readonly endpoint: ZilliqaEndpoint; - public readonly chainID: ZilliqaChainID; - public readonly API: API.Zilliqa; - public readonly zilVersion: number; - - constructor( - network: NetworkNamespace - ) { - let NETWORK_ENDPOINT; - let CHAIN_ID; - switch(network) { - case NetworkNamespace.Mainnet: - NETWORK_ENDPOINT = ZilliqaEndpoint.Mainnet; - CHAIN_ID = ZilliqaChainID.Mainnet; - break; - case NetworkNamespace.Testnet: - NETWORK_ENDPOINT = ZilliqaEndpoint.Testnet; - CHAIN_ID = ZilliqaChainID.Testnet; - break; - case NetworkNamespace.Isolated: - NETWORK_ENDPOINT = ZilliqaEndpoint.IsolatedServer; - CHAIN_ID = ZilliqaChainID.IsolatedServer; - break; - } - this.endpoint = NETWORK_ENDPOINT; - this.chainID = CHAIN_ID; - this.API = new API.Zilliqa(this.endpoint); - this.zilVersion = Util.bytes.pack(this.chainID, 1); - } -} - -enum ZilliqaEndpoint { - Mainnet = 'https://api.zilliqa.com/', - Testnet = 'https://dev-api.zilliqa.com/', - IsolatedServer = 'https://zilliqa-isolated-server.zilliqa.com/' -} - -enum ZilliqaChainID { - Mainnet = 1, - Testnet = 333, - IsolatedServer = 222 -} diff --git a/src/lib/decentralized-identity/did-operations/did-create.ts b/src/lib/decentralized-identity/did-operations/did-create.ts deleted file mode 100644 index 8e4370ce..00000000 --- a/src/lib/decentralized-identity/did-operations/did-create.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { OperationType } from '../protocols/sidetree'; -import { Cryptography, OperationKeyPairInput, TyronPrivateKeys } from '../util/did-keys'; -import { CliInputModel } from '../../../bin/util'; -import { TransitionValue } from '../../blockchain/tyronzil'; -import { PrivateKeyModel } from '../protocols/models/verification-method-models'; - -/** Generates a `Tyron DID-Create` operation - * which produces the `DID-Document` & metadata */ -export default class DidCreate { - public readonly type = OperationType.Create; - public readonly document: TransitionValue[]; - public readonly updateKey: string; - public readonly recoveryKey: string; - public readonly privateKeys: TyronPrivateKeys; - - /*** **** ***/ - - private constructor ( - operation: CreateOperationModel - ) { - this.document = operation.document; - this.updateKey = "0x"+ operation.updateKey; - this.recoveryKey = "0x"+ operation.recoveryKey; - this.privateKeys = operation.privateKeys; - } - - /*** **** ***/ - - /** Generates a Tyron `DID-Create` operation with input from the CLI */ - public static async execute(input: CliInputModel): Promise { - const VERIFICATION_METHODS: TransitionValue[] = []; - const PRIVATE_KEY_MODEL: PrivateKeyModel[] = []; - - for(const key_input of input.publicKeyInput) { - // Creates the cryptographic key pair - const KEY_PAIR_INPUT: OperationKeyPairInput = { - id: key_input.id - } - const [VERIFICATION_METHOD, PRIVATE_KEY] = await Cryptography.operationKeyPair(KEY_PAIR_INPUT); - VERIFICATION_METHODS.push(VERIFICATION_METHOD); - PRIVATE_KEY_MODEL.push(PRIVATE_KEY); - } - - const DOCUMENT = VERIFICATION_METHODS.concat(input.services); - - // Creates the update key-pair (necessary for the next update operation) - const [UPDATE_KEY, UPDATE_PRIVATE_KEY] = await Cryptography.keyPair("update"); - PRIVATE_KEY_MODEL.push(UPDATE_PRIVATE_KEY); - - // Creates the recovery key-pair (necessary for next recovery or deactivate operation) - const [RECOVERY_KEY, RECOVERY_PRIVATE_KEY] = await Cryptography.keyPair("recovery"); - PRIVATE_KEY_MODEL.push(RECOVERY_PRIVATE_KEY); - - const PRIVATE_KEYS = await Cryptography.processKeys(PRIVATE_KEY_MODEL); - - /** Output data from a Tyron `DID-Create` operation */ - const OPERATION_OUTPUT: CreateOperationModel = { - document: DOCUMENT, - updateKey: UPDATE_KEY, - recoveryKey: RECOVERY_KEY, - privateKeys: PRIVATE_KEYS - }; - return new DidCreate(OPERATION_OUTPUT); - } -} - -/*** ** interfaces ** ***/ - -/** Defines output data for a Sidetree-based `DID-Create` operation */ -interface CreateOperationModel { - document: TransitionValue[]; - updateKey: string; - recoveryKey: string; - privateKeys: TyronPrivateKeys; -} diff --git a/src/lib/decentralized-identity/did-operations/did-deactivate.ts b/src/lib/decentralized-identity/did-operations/did-deactivate.ts deleted file mode 100644 index 1cd2d98d..00000000 --- a/src/lib/decentralized-identity/did-operations/did-deactivate.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import { OperationType } from '../protocols/sidetree'; -import DidState from './did-resolve/did-state'; - -/** Generates a `Tyron DID-Deactivate` operation */ -export default class DidDeactivate { - public readonly type = OperationType.Deactivate; - public readonly decentralized_identifier: string; - public readonly signature: string; - - /*** **** ***/ - - private constructor ( - operation: DeactivateOperationModel - ) { - this.decentralized_identifier = operation.did; - this.signature = "0x"+ operation.signature; - } - - /** Generates a Sidetree-based `DID-Deactivate` operation */ - public static async execute(input: DeactivateOperationInput): Promise { - const TYRON_HASH = input.state.tyron_hash.substring(2); - const PREVIOUS_RECOVERY_KEY = zcrypto.getPubKeyFromPrivateKey(input.recoveryPrivateKey); - - const SIGNATURE = zcrypto.sign(Buffer.from(TYRON_HASH, 'hex'), input.recoveryPrivateKey, PREVIOUS_RECOVERY_KEY); - - /** Output data from a Tyron `DID-Deactivate` operation */ - const OPERATION_OUTPUT: DeactivateOperationModel = { - did: input.state.decentralized_identifier, - signature: SIGNATURE - }; - return new DidDeactivate(OPERATION_OUTPUT); - } -} - -/*** ** interfaces ** ***/ - -/** Defines input data for a `Tyron DID-Deactivate` operation */ -export interface DeactivateOperationInput { - state: DidState; - recoveryPrivateKey: string; -} - -/** Defines output data from a `Tyron DID-Deactivate` operation */ -interface DeactivateOperationModel { - did: string; - signature: string; -} diff --git a/src/lib/decentralized-identity/did-operations/did-recover.ts b/src/lib/decentralized-identity/did-operations/did-recover.ts deleted file mode 100644 index a9788536..00000000 --- a/src/lib/decentralized-identity/did-operations/did-recover.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import { OperationType } from '../protocols/sidetree'; -import { Cryptography, OperationKeyPairInput, TyronPrivateKeys } from '../util/did-keys'; -import { CliInputModel } from '../../../bin/util'; -import { TransitionValue } from '../../blockchain/tyronzil'; -import { PrivateKeyModel } from '../protocols/models/verification-method-models'; - -/** Generates a `Tyron DID-Recover` operation */ -export default class DidRecover { - public readonly type = OperationType.Recover; - public readonly decentralized_identifier: string; - public readonly newDocument: TransitionValue[]; - public readonly docHash: string; - public readonly signature: string; - public readonly newUpdateKey: string; - public readonly newRecoveryKey: string; - public readonly privateKeys: TyronPrivateKeys; - - /*** **** ***/ - - private constructor ( - operation: RecoverOperationModel - ) { - this.decentralized_identifier = operation.did; - this.newDocument = operation.newDocument; - this.docHash = "0x"+ operation.docHash; - this.signature = "0x"+ operation.signature; - this.newUpdateKey = "0x"+ operation.newUpdateKey; - this.newRecoveryKey = "0x"+ operation.newRecoveryKey; - this.privateKeys = operation.privateKeys; - } - - /** Generates a `Tyron DID-Recover` operation */ - public static async execute(input: RecoverOperationInput): Promise { - const VERIFICATION_METHODS: TransitionValue[] = []; - const PRIVATE_KEY_MODEL: PrivateKeyModel[] = []; - - const PUBLIC_KEY_INPUT = input.cliInput.publicKeyInput; - for(const key_input of PUBLIC_KEY_INPUT) { - // Creates the cryptographic key pair - const KEY_PAIR_INPUT: OperationKeyPairInput = { - id: key_input.id - } - const [VERIFICATION_METHOD, PRIVATE_KEY] = await Cryptography.operationKeyPair(KEY_PAIR_INPUT); - VERIFICATION_METHODS.push(VERIFICATION_METHOD); - PRIVATE_KEY_MODEL.push(PRIVATE_KEY); - } - - const DOCUMENT = VERIFICATION_METHODS.concat(input.cliInput.services); - const DOC_OBJECT = Object.assign({}, DOCUMENT); - const DOC_BUFFER = Buffer.from(JSON.stringify(DOC_OBJECT)); - const DOC_HASH = require("crypto").createHash("sha256").update(DOC_BUFFER).digest('hex'); - - const PREVIOUS_RECOVERY_KEY = zcrypto.getPubKeyFromPrivateKey(input.recoveryPrivateKey); - const SIGNATURE = zcrypto.sign(Buffer.from(DOC_HASH, 'hex'), input.recoveryPrivateKey!, PREVIOUS_RECOVERY_KEY); - - /** Key-pair for the next DID-Upate operation */ - const [UPDATE_KEY, UPDATE_PRIVATE_KEY] = await Cryptography.keyPair("update"); - PRIVATE_KEY_MODEL.push(UPDATE_PRIVATE_KEY); - - /** Key-pair for the next DID-Recover or Deactivate operation */ - const [RECOVERY_KEY, RECOVERY_PRIVATE_KEY] = await Cryptography.keyPair("recovery"); - PRIVATE_KEY_MODEL.push(RECOVERY_PRIVATE_KEY); - - const PRIVATE_KEYS = await Cryptography.processKeys(PRIVATE_KEY_MODEL); - - /** Output data from a Tyron `DID-Recover` operation */ - const OPERATION_OUTPUT: RecoverOperationModel = { - did: input.did, - newDocument: DOCUMENT, - docHash: DOC_HASH, - signature: SIGNATURE, - newUpdateKey: UPDATE_KEY, - newRecoveryKey: RECOVERY_KEY, - privateKeys: PRIVATE_KEYS - }; - return new DidRecover(OPERATION_OUTPUT); - } -} - -/*** ** interfaces ** ***/ - -/** Defines input data for a `Tyron DID-Recover` operation */ -export interface RecoverOperationInput { - did: string; - recoveryPrivateKey: string; - cliInput: CliInputModel; -} - -/** Defines output data from a `Tyron DID-Recover` operation */ -interface RecoverOperationModel { - did: string; - newDocument: TransitionValue[]; - docHash: string; - signature: string; - newUpdateKey: string; - newRecoveryKey: string; - privateKeys: TyronPrivateKeys; -} diff --git a/src/lib/decentralized-identity/did-operations/did-resolve/did-document.ts b/src/lib/decentralized-identity/did-operations/did-resolve/did-document.ts deleted file mode 100644 index 4dad5d91..00000000 --- a/src/lib/decentralized-identity/did-operations/did-resolve/did-document.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import ZilliqaInit from '../../../blockchain/zilliqa-init'; -import { DidServiceEndpointModel } from '../../protocols/models/document-model'; -import { PublicKeyPurpose, TyronVerificationMethods, VerificationMethodModel } from '../../protocols/models/verification-method-models'; -import { NetworkNamespace } from '../../tyronZIL-schemes/did-scheme'; -import DidUrlScheme from '../../tyronZIL-schemes/did-url-scheme'; -import DidState from './did-state'; -import ErrorCode from '../../util/ErrorCode'; -import * as fs from 'fs'; -import LogColors from '../../../../bin/log-colors'; - -export enum Accept { - contentType = "application/did+json", //requests a DID-Document as output - Result = "application/did+json;profile='https://w3c-ccg.github.io/did-resolution'" //requests a DID-Resolution-Result as output -} - -/** Generates a `Tyron DID-Document` */ -export default class DidDoc { - public readonly id: string; - public readonly publicKey?: VerificationMethodModel; - public readonly authentication?: VerificationMethodModel; - public readonly assertionMethod?: VerificationMethodModel; - public readonly keyAgreement?: VerificationMethodModel; - public readonly capabilityInvocation?: VerificationMethodModel; - public readonly capabilityDelegation?: VerificationMethodModel; - public readonly xsgdKey?: VerificationMethodModel; - public readonly service?: DidServiceEndpointModel[]; - - private constructor ( - scheme: DidDocScheme - ) { - this.id = scheme.id; - this.publicKey = scheme.verificationMethods!.publicKey; - this.authentication = scheme.verificationMethods!.authentication; - this.assertionMethod = scheme.verificationMethods!.assertionMethod; - this.keyAgreement = scheme.verificationMethods!.keyAgreement; - this.capabilityInvocation = scheme.verificationMethods!.capabilityDelegation; - this.xsgdKey = scheme.verificationMethods!.xsgdKey; - this.service = scheme.service; - } - - /*** **** ***/ - - /** The `Tyron DID-Resolution` method */ - public static async resolution(network: NetworkNamespace, input: ResolutionInput): Promise { - const ACCEPT = input.metadata.accept; - const ZIL_INIT = new ZilliqaInit(network); - - const BLOCKCHAIN_INFO = await ZIL_INIT.API.blockchain.getBlockChainInfo(); - let RESOLUTION_RESULT; - - const DID_RESOLVED = await DidState.fetch(network, input.didcAddr) - .then(async did_state => { - const DID_DOC = await DidDoc.read(did_state); - switch (ACCEPT) { - case Accept.contentType: - return DID_DOC; - case Accept.Result: - RESOLUTION_RESULT = { - id: DID_DOC.id, - resolutionMetadata: BLOCKCHAIN_INFO, - document: DID_DOC, - metadata: { - contentType: "application/did+json", - updateKey: did_state.did_update_key, - recoveryKey: did_state.did_recovery_key, - } - }; - return RESOLUTION_RESULT; - } - }) - .catch(err => { throw err }) - return DID_RESOLVED; - } - - /*** **** ***/ - - /** Generates a 'Tyron DID-Read' operation, resolving any `Tyron DID-state` into its DID-Document */ - public static async read(state: DidState): Promise { - const DID_DOC = await DidUrlScheme.validate(state.decentralized_identifier) - .then(async did_scheme => { - const ID = did_scheme.did; - - /** Reads the public keys */ - const VERIFICATION_METHODS = state.verification_methods!; - let PUBLIC_KEY; - let AUTHENTICATION; - let ASSERTION_METHOD; - let KEY_AGREEMENT; - let CAPABILITY_INVOCATION; - let CAPABILITY_DELEGATION; - let XSGD_KEY; - - // Every key MUST have a Public Key Purpose as its ID - for (let purpose of VERIFICATION_METHODS.keys()) { - const DID_URL: string = ID + '#' + purpose; - const KEY = VERIFICATION_METHODS.get(purpose); - const VERIFICATION_METHOD: VerificationMethodModel = { - id: DID_URL, - type: 'SchnorrSecp256k1VerificationKey2019', - publicKeyBase58: zcrypto.encodeBase58(KEY!) - }; - switch (purpose) { - case PublicKeyPurpose.General: - PUBLIC_KEY = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.Auth: - AUTHENTICATION = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.Assertion: - ASSERTION_METHOD = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.Agreement: - KEY_AGREEMENT = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.Invocation: - CAPABILITY_INVOCATION = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.Delegation: - CAPABILITY_DELEGATION = VERIFICATION_METHOD; - break; - case PublicKeyPurpose.XSGD: - XSGD_KEY = VERIFICATION_METHOD; - break; - default: - throw new ErrorCode("InvalidPurpose", `The resolver detected an invalid Public Key Purpose`); - } - }; - - /*** **** ***/ - - /** Service property */ - const services = state.services; - const SERVICES = []; - for (let id of services.keys()) { - const TYPE_URI = services.get(id); - const TYPE = TYPE_URI![0]; - const URI = TYPE_URI![1]; - const SERVICE: DidServiceEndpointModel = { - id: ID + '#' + id, - type: TYPE, - endpoint: URI - }; - SERVICES.push(SERVICE); - } - - /** The `Tyron DID-Document` */ - const SCHEME: DidDocScheme = { - id: ID, - verificationMethods: {}, - service: [] - }; - if(XSGD_KEY !== undefined) { - SCHEME.verificationMethods.xsgdKey = XSGD_KEY; - } - if(PUBLIC_KEY !== undefined) { - SCHEME.verificationMethods.publicKey = PUBLIC_KEY; - } - if(AUTHENTICATION !== undefined) { - SCHEME.verificationMethods.authentication = AUTHENTICATION; - } - if(ASSERTION_METHOD !== undefined) { - SCHEME.verificationMethods.assertionMethod = ASSERTION_METHOD; - } - if(KEY_AGREEMENT !== undefined) { - SCHEME.verificationMethods.keyAgreement = KEY_AGREEMENT; - } - if(CAPABILITY_INVOCATION !== undefined) { - SCHEME.verificationMethods.capabilityInvocation = CAPABILITY_INVOCATION; - } - if(CAPABILITY_DELEGATION!== undefined) { - SCHEME.verificationMethods.capabilityDelegation = CAPABILITY_DELEGATION; - } - - if(SERVICES.length !== 0) { - SCHEME.service = SERVICES; - } - return new DidDoc(SCHEME); - }) - .catch(err => { throw err }) - return DID_DOC; - } - - /*** **** ***/ - - /** Saves the `Tyron DID-Document` */ - public static async write(did: string, input: DidDoc|ResolutionResult): Promise { - try { - const PRINT_STATE = JSON.stringify(input, null, 2); - let FILE_NAME; - if(input instanceof DidDoc) { - FILE_NAME = `DID_DOCUMENT_${did}.json`; - } else { - FILE_NAME = `DID_RESOLVED_${did}.json`; - } - fs.writeFileSync(FILE_NAME, PRINT_STATE); - console.info(LogColors.yellow(`DID resolved as: ${LogColors.brightYellow(FILE_NAME)}`)); - } catch (error) { - throw new ErrorCode("CodeCouldNotSave", "The DID file did not get saved"); - } - } -} - -/*** ** interfaces ** ***/ - -/** The scheme of a `Tyron DID-Document` */ -interface DidDocScheme { - id: string; - verificationMethods: TyronVerificationMethods; - service: DidServiceEndpointModel[]; - created?: number; //MUST be a valid XML datetime value, as defined in section 3.3.7 of [W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes [XMLSCHEMA1.1-2]]. This datetime value MUST be normalized to UTC 00:00, as indicated by the trailing "Z" - updated?: number; //timestamp of the most recent change -} - -export interface ResolutionInput { - didcAddr: string; - metadata: ResolutionInputMetadata; -} - -export interface ResolutionInputMetadata { - accept: Accept; //to request a certain type of result - versionId?: string; //to request a specific version of the DID-Document - mutually exclusive with versionTime - versionTime?: string; //idem versionId - an RFC3339 combined date and time representing when the DID-Doc was current for the input DID - noCache?: boolean; //to request a certain kind of caching behavior - 'true': caching is disabled and a fresh DID-Doc is retrieved from the registry - dereferencingInput?: DereferencingInputMetadata; -} - -interface DereferencingInputMetadata { - serviceType?: string; //to select a specific service from the DID-Document - followRedirect?: boolean; //to instruct whether redirects should be followed -} - -export interface ResolutionResult { - id: string; - resolutionMetadata: unknown; - document: DidDoc; - metadata: DocumentMetadata; -} - -interface DocumentMetadata { - contentType: string; - updateKey: string; - recoveryKey: string; -} diff --git a/src/lib/decentralized-identity/did-operations/did-resolve/did-state.ts b/src/lib/decentralized-identity/did-operations/did-resolve/did-state.ts deleted file mode 100644 index 05c51b3e..00000000 --- a/src/lib/decentralized-identity/did-operations/did-resolve/did-state.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import TyronState from '../../../blockchain/tyron-state'; -import { NetworkNamespace } from '../../tyronZIL-schemes/did-scheme'; -import DidUrlScheme from '../../tyronZIL-schemes/did-url-scheme'; -import { OperationType } from '../../protocols/sidetree'; - -/** The Tyron DID-State */ -export default class DidState { - public readonly contract_owner: string; - public readonly decentralized_identifier: string; - public readonly did_status: OperationType; - public readonly tyron_hash: string; - public readonly verification_methods: Map; - public readonly services: Map; - - public readonly did_update_key: string; - public readonly did_recovery_key: string; - - private constructor( - state: DidStateModel - ) { - this.contract_owner = state.contract_owner; - this.decentralized_identifier = state.decentralized_identifier; - this.did_status = state.did_status; - this.tyron_hash = state.tyron_hash; - this.verification_methods = state.verification_methods; - this.services = state.services; - this.did_update_key = state.did_update_key; - this.did_recovery_key = state.did_recovery_key - } - - /*** **** ***/ - - /** Fetches the current DID-State for the given tyron_addr */ - public static async fetch(network: NetworkNamespace, didcAddr: string): Promise { - const did_state = await TyronState.fetch(network, didcAddr) - .then(async tyron_state => { - // Validates the Tyron DID-Scheme - await DidUrlScheme.validate(tyron_state.decentralized_identifier); - - const THIS_STATE: DidStateModel = { - contract_owner: tyron_state.contract_owner, - decentralized_identifier: tyron_state.decentralized_identifier, - did_status: tyron_state.did_status, - tyron_hash: tyron_state.tyron_hash, - verification_methods: tyron_state.verification_methods, - services: tyron_state.services, - did_update_key: tyron_state.did_update_key, - did_recovery_key: tyron_state.did_recovery_key - }; - return new DidState(THIS_STATE); - }) - .catch(err => { throw err }) - return did_state; - } -} - -/*** ** interfaces ** ***/ - -/** The state model of a Tyron Decentralized Identifier */ -export interface DidStateModel { - contract_owner: string; - decentralized_identifier: string; - did_status: OperationType; - tyron_hash: string; - verification_methods: Map; - services: Map; - did_update_key: string; - did_recovery_key: string; -} diff --git a/src/lib/decentralized-identity/did-operations/did-resolve/resolver.ts b/src/lib/decentralized-identity/did-operations/did-resolve/resolver.ts deleted file mode 100644 index 4c6ef216..00000000 --- a/src/lib/decentralized-identity/did-operations/did-resolve/resolver.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import LogColors from "../../../../bin/log-colors"; -import SmartUtil from "../../../blockchain/smart-contracts/smart-util"; -import { InitTyron } from "../../../blockchain/tyronzil"; -import ZilliqaInit from '../../../blockchain/zilliqa-init'; -import { NetworkNamespace } from '../../tyronZIL-schemes/did-scheme'; -import CodeError from '../../util/ErrorCode'; - -export default class Resolver { - public static async validateAvatar(avatar: string): Promise { - const regex = /^[\w\d_]+$/; - if(!regex.test(avatar) || avatar.length > 15 ) { - throw new CodeError("DomainNameInvalid", "The domain name must be 15 characters or less and contain only letters, numbers and underscores, and no spaces") - } - } - public static async resolveDns(network: NetworkNamespace, initTyron: InitTyron, domainName: string): Promise { - const ZIL_INIT = new ZilliqaInit(network); - const DOT_INDEX = domainName.lastIndexOf("."); - const SSI_DOMAIN = domainName.substring(DOT_INDEX); - const AVATAR = domainName.substring(0, DOT_INDEX); - - const DIDC_ADDRESS = await this.validateAvatar(AVATAR) - .then( async() => { - return await ZIL_INIT.API.blockchain.getSmartContractState(initTyron) - }) - .then(async STATE => { - return STATE.result.dns; - }) - .then(async (dns: any) => { - return await SmartUtil.getValuefromMap(dns, SSI_DOMAIN); - }) - .then(async (resourceRecords: any) => { - return await SmartUtil.getValuefromMap(resourceRecords, AVATAR); - }) - .catch((err: any) => { throw err }); - - console.log(LogColors.brightGreen(`${domainName}'s contract address is: ${DIDC_ADDRESS}`)); - return zcrypto.toBech32Address(DIDC_ADDRESS) - } -} \ No newline at end of file diff --git a/src/lib/decentralized-identity/did-operations/did-update.ts b/src/lib/decentralized-identity/did-operations/did-update.ts deleted file mode 100644 index 26ff134d..00000000 --- a/src/lib/decentralized-identity/did-operations/did-update.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import { OperationType, Sidetree } from '../protocols/sidetree'; -import { Cryptography, TyronPrivateKeys } from '../util/did-keys'; -import { PatchModel } from '../protocols/models/document-model'; -import DidState from './did-resolve/did-state'; -import { TransitionValue } from '../../blockchain/tyronzil'; - -/** Generates a `Tyron DID-Update` operation */ -export default class DidUpdate{ - public readonly type = OperationType.Update; - public readonly decentralized_identifier: string; - public readonly newDocument: TransitionValue[]; - public readonly docHash: string; - public readonly signature: string; - public readonly newUpdateKey: string; - public readonly privateKeys: TyronPrivateKeys; - - private constructor ( - operation: UpdateOperationModel - ) { - this.decentralized_identifier = operation.did; - this.newDocument = operation.newDocument; - this.docHash = "0x"+ operation.docHash; - this.signature = "0x"+ operation.signature; - this.newUpdateKey = "0x"+ operation.newUpdateKey; - this.privateKeys = operation.privateKeys; - } - - /*** **** ***/ - - /** Generates a `Tyron DID-Update` operation with input from the CLI */ - public static async execute(input: UpdateOperationInput): Promise { - const operation = await Sidetree.processPatches(input.patches) - .then(async update => { - const DOC_OBJECT = Object.assign({}, update.updateDocument); - const DOC_BUFFER = Buffer.from(JSON.stringify(DOC_OBJECT)); - const DOC_HASH = require("crypto").createHash("sha256").update(DOC_BUFFER).digest('hex'); - - const PREVIOUS_UPDATE_KEY = zcrypto.getPubKeyFromPrivateKey(input.updatePrivateKey); - const SIGNATURE = zcrypto.sign(Buffer.from(DOC_HASH, 'hex'), input.updatePrivateKey, PREVIOUS_UPDATE_KEY); - - // Generates key-pair for the next DID-Update operation - const [NEW_UPDATE_KEY, NEW_UPDATE_PRIVATE_KEY] = await Cryptography.keyPair("update"); - update.privateKeys.push(NEW_UPDATE_PRIVATE_KEY); - - const PRIVATE_KEYS = await Cryptography.processKeys(update.privateKeys); - - /** Output data from a Tyron `DID-Update` operation */ - const OPERATION_OUTPUT: UpdateOperationModel = { - did: input.state.decentralized_identifier, - newDocument: update.updateDocument, - docHash: DOC_HASH, - signature: SIGNATURE, - newUpdateKey: NEW_UPDATE_KEY, - privateKeys: PRIVATE_KEYS - }; - return new DidUpdate(OPERATION_OUTPUT); - }) - .catch(err => { throw err }) - return operation; - } -} - -/*** ** interfaces ** ***/ - -/** Defines input data for a `Tyron DID-Update` operation */ -export interface UpdateOperationInput { - state: DidState; - updatePrivateKey: string; - patches: PatchModel[]; -} - -/** Defines output data from a `Tyron DID-Update` operation */ -interface UpdateOperationModel { - did: string; - newDocument: TransitionValue[]; - docHash: string; - signature: string; - newUpdateKey: string; - privateKeys: TyronPrivateKeys; -} diff --git a/src/lib/decentralized-identity/protocols/models/document-model.ts b/src/lib/decentralized-identity/protocols/models/document-model.ts deleted file mode 100644 index 3da40fa0..00000000 --- a/src/lib/decentralized-identity/protocols/models/document-model.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { PublicKeyInput } from '../../../../bin/util'; -import { TransitionValue } from '../../../blockchain/tyronzil'; - -export enum DocumentElement { - VerificationMethod = "key", - Service = "service" -} - -export interface ServiceModel { - id: string; - transferProtocol: DataTransferProtocol; - type: string; - uri: string -} - -export enum Action { - Adding = "Add", - Removing = "Remove" -} - -export enum DataTransferProtocol { - Https = "Https", - Git = "Git", - Ssh = "Ssh" -} - -/** Sidetreee Service Endpoint for the 'service' property of the DID-Document */ -export interface DidServiceEndpointModel { - id: string; - type: string; - endpoint: string; -} - -export interface PatchModel { - action: PatchAction; - ids?: string[]; //the IDs of the DID-Document elements to remove - keyInput?: PublicKeyInput[]; - services?: TransitionValue[]; -} - -export enum PatchAction { - AddKeys = 'add-public-keys', - RemoveKeys = 'remove-public-keys', - AddServices = 'add-service-endpoints', - RemoveServices = 'remove-service-endpoints', - // Format of an additional custom action - CustomAction = '-custom-action', -} diff --git a/src/lib/decentralized-identity/protocols/models/verification-method-models.ts b/src/lib/decentralized-identity/protocols/models/verification-method-models.ts deleted file mode 100644 index 94574beb..00000000 --- a/src/lib/decentralized-identity/protocols/models/verification-method-models.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -export interface PublicKeyModel { - id: string; - key?: string; -} - -export interface PrivateKeyModel { - id: string; - key: string; -} - -export interface VerificationMethodModel extends PublicKeyModel { - type: string; - publicKeyBase58: string; -} - -export enum PublicKeyPurpose { - General = 'general', - Auth = 'authentication', - Assertion = 'assertion', - Agreement = 'agreement', - Invocation = 'invocation', - Delegation = 'delegation', - XSGD = 'xsgd' -} - -export interface TyronVerificationMethods { - publicKey?: VerificationMethodModel; - authentication?: VerificationMethodModel; - assertionMethod?: VerificationMethodModel; - keyAgreement?: VerificationMethodModel; - capabilityInvocation?: VerificationMethodModel; - capabilityDelegation?: VerificationMethodModel; - xsgdKey?: VerificationMethodModel; -} diff --git a/src/lib/decentralized-identity/protocols/sidetree.ts b/src/lib/decentralized-identity/protocols/sidetree.ts deleted file mode 100644 index cdf67657..00000000 --- a/src/lib/decentralized-identity/protocols/sidetree.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import { PublicKeyInput } from '../../../bin/util'; -import { PatchModel, PatchAction, Action, DataTransferProtocol, DocumentElement, ServiceModel } from './models/document-model'; -import { PrivateKeyModel, PublicKeyModel } from './models/verification-method-models'; -import { Cryptography, OperationKeyPairInput } from '../util/did-keys'; -import ErrorCode from '../util/ErrorCode'; -import TyronZIL from '../../blockchain/tyronzil'; - -/** Operation types */ -export enum OperationType { - Create = "Created", - Recover = "Recovered", - Update = "Updated", - Deactivate = "Deactivated" -} - -export class Sidetree { - public static async processPatches(patches: PatchModel[]) - : Promise<{ updateDocument: any[], privateKeys: PrivateKeyModel[] }> { - let UPDATE_DOCUMENT: any[] = []; - let PRIVATE_KEYS: PrivateKeyModel[] = []; - - for(const patch of patches) { - switch (patch.action) { - case PatchAction.AddKeys: - if(patch.keyInput !== undefined) { - await this.addKeys(patch.keyInput) - .then(async new_keys => { - for (let key of new_keys.publicKeys) { - UPDATE_DOCUMENT.push(key); - PRIVATE_KEYS.push() - } - for (let key of new_keys.privateKeys) { - PRIVATE_KEYS.push(key) - } - }) - .catch(err => { throw err }) - } else { - throw new ErrorCode("Missing", "No key in AddKeys patch") - } - break; - case PatchAction.RemoveKeys: - if(patch.ids !== undefined) { - for(const id of patch.ids) { - const KEY: PublicKeyModel = { - id: id - }; - const DOC_ELEMENT = await TyronZIL.documentElement( - DocumentElement.VerificationMethod, - Action.Removing, - KEY - ); - UPDATE_DOCUMENT.push(DOC_ELEMENT); - } - } - break; - case PatchAction.AddServices: - if (patch.services !== undefined) { - for (let service of patch.services) { - UPDATE_DOCUMENT.push(service) - } - } else { - throw new ErrorCode("Missing", "No services given to add") - } - break; - case PatchAction.RemoveServices: - if(patch.ids !== undefined) { - for(const id of patch.ids) { - const SERVICE: ServiceModel = { - id: id, - type: "", - transferProtocol: DataTransferProtocol.Https, - uri: "" - }; - const DOC_ELEMENT = await TyronZIL.documentElement( - DocumentElement.Service, - Action.Removing, - undefined, - SERVICE - ); - UPDATE_DOCUMENT.push(DOC_ELEMENT); - } - } else { - throw new ErrorCode("Missing", "No service ID given to remove") - } - break; - default: - throw new ErrorCode("CodeIncorrectPatchAction", "The chosen action is not valid"); - } - } - return { - updateDocument: UPDATE_DOCUMENT, - privateKeys: PRIVATE_KEYS, - } - } - - private static async addKeys(input: PublicKeyInput[]): Promise { - const VERIFICATION_METHODS = []; - const PRIVATE_KEYS = []; - for(let i=0, t= input.length; i { - const SCHEME_DATA: SchemeInputData = { - network: input.network, - didUniqueSuffix: input.didUniqueSuffix, - }; - - return new DidScheme(SCHEME_DATA); - } -} - -export enum NetworkNamespace { - Mainnet = 'main:', - Testnet = 'test:', - Isolated = 'isol:' -} - -export interface SchemeInputData { - network: NetworkNamespace; - /** The globally unique part of the DID */ - didUniqueSuffix: string; -} diff --git a/src/lib/decentralized-identity/tyronZIL-schemes/did-url-scheme.ts b/src/lib/decentralized-identity/tyronZIL-schemes/did-url-scheme.ts deleted file mode 100644 index de421437..00000000 --- a/src/lib/decentralized-identity/tyronZIL-schemes/did-url-scheme.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import DidScheme, { SchemeInputData, NetworkNamespace } from "./did-scheme"; -import ErrorCode from '../util/ErrorCode'; - -export enum UrlParameters { - Hl = 'hl', //resource hash of the DID-document to add integrity protection - Service = 'service', //identifies a service from the DID-document by service ID - VersionId = 'version-id', //identifies a specific version of the DID-document to be resolved - VersionTime = 'version-time', //identifies a specific version timestamp of the DID-document to be resolved (the doc that was valid at that particular time) - InitialState = 'sidetree-initial-state' //initial self-certifying state, to use the DID immediately after generation without being anchored (unpublished DID) -} - -export default class DidUrlScheme extends DidScheme { - public readonly didUrl?: string; - public readonly path?: string; - public readonly query?: string; - public readonly fragment?: string; - public readonly longFormDid?: string; - - private constructor( - input: UrlInput - ) { - super(input.schemeInput); - this.didUrl = this.did + this.path + this.query + this.fragment; - this.path = '/' + input.path; - this.query = '?' + input.query; - this.fragment = '#' + input.fragment; - this.longFormDid = this.did + this.query; - } - - /** Validates if the given DID is a proper Tyron Decentralized Identifier */ - public static async validate(did: string): Promise { - const PREFIX = this.schemeIdentifier + this.methodName + this.blockchain; - - if (!did.startsWith(PREFIX)) { - throw new ErrorCode("CodeIncorrectDidPrefix", "The given DID does not have the right prefix"); - } - - const NETWORK = did.substring(14, 19); - - if (NETWORK !== NetworkNamespace.Mainnet && NETWORK !== NetworkNamespace.Testnet && NETWORK !== NetworkNamespace.Isolated) { - throw new ErrorCode("CodeIncorrectNetwork", "The network namespace is invalid") - } - const DID_SUFFIX = did.substring(19); - - const SCHEME_INPUT_DATA: SchemeInputData = { - network: NETWORK, - didUniqueSuffix: DID_SUFFIX - }; - const DID: UrlInput = { - schemeInput: SCHEME_INPUT_DATA - }; - return new DidUrlScheme(DID); - } -} - -export interface UrlInput { - schemeInput: SchemeInputData; - path?: string; - query?: string; - fragment?: string; -} - -export interface LongFormDidInput { - schemeInput: SchemeInputData; - suffixData: string; - delta: string; -} - -export interface Query { - urlParameter: UrlParameters; - value: string; -} diff --git a/src/lib/decentralized-identity/util/ErrorCode.ts b/src/lib/decentralized-identity/util/ErrorCode.ts deleted file mode 100644 index 6d969a6e..00000000 --- a/src/lib/decentralized-identity/util/ErrorCode.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -// Cloned from SidetreeError: -export default class CodeError extends Error { - constructor( - public code: string, - message?: string - ) { - super(message ? `${code}: ${message}` : code); - // NOTE: Extending 'Error' breaks prototype chain since TypeScript 2.1. - // The following line restores prototype chain. - Object.setPrototypeOf(this, new.target.prototype); - } -} diff --git a/src/lib/decentralized-identity/util/did-keys.ts b/src/lib/decentralized-identity/util/did-keys.ts deleted file mode 100644 index e1bb1d92..00000000 --- a/src/lib/decentralized-identity/util/did-keys.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - TyronZIL-js: Decentralized identity client for the Zilliqa blockchain platform - Copyright (C) 2020 Julio Cesar Cabrapan Duarte - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ - -import * as zcrypto from '@zilliqa-js/crypto'; -import TyronZIL, { TransitionValue } from '../../blockchain/tyronzil'; -import { Action, DocumentElement } from '../protocols/models/document-model'; -import { PrivateKeyModel, PublicKeyModel, PublicKeyPurpose } from '../protocols/models/verification-method-models'; -import ErrorCode from './ErrorCode'; - -/** Defines input data to generate a cryptographic key pair */ -export interface OperationKeyPairInput { - id: string //the key purpose -} - -/** Generates cryptographic operations */ -export class Cryptography { - /** Asymmetric cryptography to generate the key pair using the KEY_ALGORITHM (secp256k1) - * @returns [publicKey, privateKey] */ - public static async operationKeyPair(input: OperationKeyPairInput): Promise<[TransitionValue, PrivateKeyModel]> { - const PRIVATE_KEY = zcrypto.schnorr.generatePrivateKey(); - const PUBLIC_KEY = "0x"+ zcrypto.getPubKeyFromPrivateKey(PRIVATE_KEY); - const VERIFICATION_METHOD: PublicKeyModel = { - id: input.id, - key: PUBLIC_KEY - }; - const DOC_ELEMENT = await TyronZIL.documentElement( - DocumentElement.VerificationMethod, - Action.Adding, - VERIFICATION_METHOD - ); - const PRIVATE_KEY_MODEL: PrivateKeyModel = { - id: input.id, - key: PRIVATE_KEY - }; - - return [DOC_ELEMENT, PRIVATE_KEY_MODEL]; - } - - /** Generates a secp256k1 key pair - * @returns [publicKey, privateKey] */ - public static async keyPair(id: string): Promise<[string, PrivateKeyModel]> { - const PRIVATE_KEY = zcrypto.schnorr.generatePrivateKey(); - const PUBLIC_KEY = zcrypto.getPubKeyFromPrivateKey(PRIVATE_KEY); - const PRIVATE_KEY_MODEL = { - id: id, - key: PRIVATE_KEY - } - return [PUBLIC_KEY, PRIVATE_KEY_MODEL]; - } - - public static async processKeys(input: PublicKeyModel[]|PrivateKeyModel[]): Promise { - const KEY_ID_SET: Set = new Set(); - let KEYS = {}; - let NEW_KEY; - for(const key of input) { - // IDs must be unique - if(!KEY_ID_SET.has(key.id)) { - KEY_ID_SET.add(key.id); - } else { - throw new ErrorCode("KeyDuplicated", "The key ID must be unique"); - } - switch (key.id) { - case PublicKeyPurpose.General: - NEW_KEY = { - general: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY) - break; - case PublicKeyPurpose.Auth: - NEW_KEY = { - authentication: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY) - break; - case PublicKeyPurpose.Assertion: - NEW_KEY = { - assertion: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case PublicKeyPurpose.Agreement: - NEW_KEY = { - agreement: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case PublicKeyPurpose.Invocation: - NEW_KEY = { - invocation: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case PublicKeyPurpose.Delegation: - NEW_KEY = { - delegation: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case PublicKeyPurpose.XSGD: - NEW_KEY = { - xsgd: "0x"+ key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case "update": - NEW_KEY = { - did_update: key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - case "recovery": - NEW_KEY = { - did_recovery: key.key - }; - Object.assign(KEYS, NEW_KEY); - break; - default: - throw new ErrorCode("InvalidID", `The client detected an invalid key ID`); - } - } - return KEYS; - } -} - -export interface TyronPublicKeys { - general?: string; - authentication?: string; - assertion?: string; - agreement?: string; - invocation?: string; - delegation?: string; - xsgd?: string; -} - -export interface TyronPrivateKeys extends TyronPublicKeys { - did_update?: string; - did_recovery?: string; -} diff --git a/src/lib/smart-contracts/coop.scilla b/src/lib/smart-contracts/coop.scilla new file mode 100644 index 00000000..4987f014 --- /dev/null +++ b/src/lib/smart-contracts/coop.scilla @@ -0,0 +1,613 @@ +(* v0.4.0 +NFTcoop.tyron: decentralized identifier NFT cooperative project +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. +www.ssiprotocol.com + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. *) + +scilla_version 0 + +import IntUtils + +library NFT_coop + + (* The DID library *) + + type DIDstatus = + | Deployed + | Created + | Updated + | Recovered + | Deactivated + + type Operation = + | Recovery + | Update + + type Action = + | Add + | Remove + + type TransferProtocol = + | Https + | Git + +type Endpoint = + | Address of ByStr20 + | Uri of String TransferProtocol String (* type, transfer protocol & uri *) + + type Document = + | VerificationMethod of Action String ByStr33 (* string: key purpose OR service ID *) + | Service of Action String Endpoint + + type Beneficiary = + | UserDomain of String String + | BeneficiaryAddr of ByStr20 + + let didRecovery = Recovery + let didUpdate = Update + let update = "update" + let recovery = "recovery" + let didsr = "socialrecovery" + let actionAdd = "add" + let actionRemove = "remove" + let psc = "psc" (* profit-sharing community *) + + let one_msg = fun( msg: Message ) => + let nil_msg = Nil{ Message } in Cons{ Message } msg nil_msg + + let two_msgs = fun( msg1: Message ) => fun( msg2: Message ) => + let msgs_tmp = one_msg msg2 in Cons{ Message } msg1 msgs_tmp + + type Error = + | CodeWrongStatus + | CodeNotAdmin + | CodeWrongCaller + | CodeWrongSignature + | CodeUndefinedKey + | CodeSameKey + | CodeNotValid + | CodeInsufficientFunds + + let make_error = fun( error: Error ) => + let result = match error with + | CodeWrongStatus => Int32 -1 + | CodeNotAdmin => Int32 -2 + | CodeWrongCaller => Int32 -3 + | CodeWrongSignature => Int32 -4 + | CodeUndefinedKey => Int32 -5 + | CodeSameKey => Int32 -6 + | CodeNotValid => Int32 -7 + | CodeInsufficientFunds => Int32 -8 + end in { _exception: "Error"; code: result } + + let zero = Uint128 0 + let zeroByStr20 = 0x0000000000000000000000000000000000000000 + let zeroByStr32 = 0x0000000000000000000000000000000000000000000000000000000000000000 + let zeroByStr33 = 0x000000000000000000000000000000000000000000000000000000000000000000 + let zeroByStr64 = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + let zero_bystr = builtin to_bystr zeroByStr20 + + let option_value = tfun 'A => fun( default: 'A ) => fun( input: Option 'A) => + match input with + | Some v => v + | None => default + end + let option_uint128_value = let f = @option_value Uint128 in f zero + let option_bystr20_value = let f = @option_value ByStr20 in f zeroByStr20 + let option_bystr33_value = let f = @option_value ByStr33 in f zeroByStr33 + let option_bystr64_value = let f = @option_value ByStr64 in f zeroByStr64 + + (* The NFT.coop library *) + + type Account = + | Account of Uint128 Uint128 Uint128 Uint128 (* PRs, merged commits, balance & xPoints *) + + type PR = + | PR of ByStr20 Uint128 (* member & hours *) + + let domain_ = "coop" + let one = Uint128 1 + let hundred = Uint128 100 + let zeroAccount = Account zero zero zero zero + let option_account = let f = @option_value Account in f zeroAccount + + let account_prs = fun( getAccount: Option Account ) => + let account = option_account getAccount + in match account with + | Account pull_requests merged balance xps => pull_requests end + + let account_merged = fun( getAccount: Option Account ) => + let account = option_account getAccount + in match account with + | Account prs merged_commits balance xps => merged_commits end + + let account_balance = fun( getAccount: Option Account ) => + let account = option_account getAccount + in match account with + | Account prs merged zil_balance xps => zil_balance end + + let account_xps = fun( getAccount: Option Account ) => + let account = option_account getAccount + in match account with + | Account prs merged balance xpoints => xpoints end + + let pr_member = fun( pr: PR ) => + match pr with + | PR member hours => member end + + let pr_hours = fun( pr: PR ) => + match pr with + | PR member hours => hours end + +contract NFT_coop( + initAdmin: ByStr20, + init_tyron: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 ), field psc_fee: Map String Uint128 end + ) + field admin_: ByStr20 = initAdmin + field did_: String = "" (* the decentralized identifier *) + field did_status_: DIDstatus = Deployed + + field init_: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 ), field psc_fee: Map String Uint128 end = init_tyron + + (* Verification methods @key: key purpose @value: public key of type "SchnorrSecp256k1VerificationKey2019" *) + field verification_methods_: Map String ByStr33 = Emp String ByStr33 + + (* Services @key: ID @value: endpoint *) + field services_: Map String ByStr20 = Emp String ByStr20 + field services__: Map String Endpoint = Emp String Endpoint + field service_addr: Map String ByStr20 = Emp String ByStr20 + + field document_hash: ByStr = zero_bystr + + (* The block number when the DID Create operation occurred *) + field did_created_: BNum = BNum 0 + + (* The block number when the last DID CRUD operation occurred *) + field ledger_time_: BNum = BNum 0 + + (* A monotonically increasing number representing the amount of DID CRUD transactions that have taken place *) + field crud_tx_number_: Uint128 = zero + + (* Coop NFTs *) + + field members: Map ByStr20 Account = Emp ByStr20 Account + + field contributions: Map ByStr32 PR = Emp ByStr32 PR + + field nfts: Map ByStr32 Uint128 = Emp ByStr32 Uint128 (* commit & performance *) + + field hourly_wage: Uint128 = hundred (* hourly wage divided by 100 *) + +(* The DID backbone *) + +procedure ThrowError( err: Error ) + e = make_error err; throw e end + +procedure IsOperational() + did_status <- did_status_; + match did_status with + | Deactivated => err = CodeWrongStatus; ThrowError err + | _ => end end + +procedure VerifyAdmin() + current_admin <- admin_; + verified = builtin eq current_admin _sender; + match verified with + | True => + | False => err= CodeNotAdmin; ThrowError err end end + +transition UpdateAdmin( addr: ByStr20 ) + IsOperational; VerifyAdmin; admin_ := addr end + +transition UpdateInit( + addr: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 ), field psc_fee: Map String Uint128 end + ) + IsOperational; VerifyAdmin; init_ := addr end + +procedure Payment( id: String ) + current_init <- init_; + get_fee <-& current_init.psc_fee[id]; fee = option_uint128_value get_fee; + is_zero = builtin eq fee zero; + match is_zero with + | True => err = CodeNotValid; ThrowError err + | False => accept; msg = let m = { _tag: "AddFunds"; _recipient: current_init; _amount: fee; id: id } in one_msg m; send msg end end + +transition BuyDomainNameNFT( username: String ) + IsOperational; VerifyAdmin; current_init <- init_; + get_fee <-& current_init.psc_fee[domain_]; fee = option_uint128_value get_fee; + accept; msg = let m = { _tag: "BuyDomainNameNFT"; _recipient: current_init; _amount: fee; + username: username; + domain: domain_ + } in one_msg m; send msg end + +transition TransferDomainNameNFT( + username: String, + addr: ByStr20 + ) + IsOperational; VerifyAdmin; current_init <- init_; + get_fee <-& current_init.psc_fee[domain_]; fee = option_uint128_value get_fee; + accept; msg = let m = { _tag: "TransferDomainNameNFT"; _recipient: current_init; _amount: fee; + username: username; + domain: domain_; + newAddr: addr + } in one_msg m; send msg end + +(* Verify Schnorr signature - signed data must correspond with a DID Key *) +procedure VerifySignature( + id: String, + signedData: ByStr, + signature: ByStr64 + ) + get_did_key <- verification_methods_[id]; + is_right_signature = let did_key = option_bystr33_value get_did_key in builtin schnorr_verify did_key signedData signature; + match is_right_signature with + | True => + | False => err = CodeWrongSignature; ThrowError err end end + +procedure ThrowIfNoKey( optKey: Option ByStr33 ) + match optKey with + | Some key => + | None => err = CodeUndefinedKey; ThrowError err end end + +procedure ThrowIfSameKey( + key: ByStr33, + sndKey: ByStr33 + ) + is_same_key = builtin eq key sndKey; + match is_same_key with + | True => err= CodeSameKey; ThrowError err + | False => end end + +procedure VerifyDIDkeys( + operation: Operation, + didRecovery: ByStr33, + didUpdate: ByStr33 + ) + get_update_key <- verification_methods_[update]; new_update = option_bystr33_value get_update_key; + match operation with + | Recovery => + get_recovery_key <- verification_methods_[recovery]; new_recovery = option_bystr33_value get_recovery_key; + ThrowIfSameKey new_recovery new_update; + ThrowIfSameKey new_recovery didRecovery; ThrowIfSameKey new_recovery didUpdate; ThrowIfSameKey new_update didRecovery; ThrowIfSameKey new_update didUpdate + | Update => ThrowIfSameKey new_update didUpdate; ThrowIfSameKey new_update didRecovery end end + +procedure Timestamp() + current_block <- &BLOCKNUMBER; ledger_time_ := current_block; + latest_tx_number <- crud_tx_number_; + new_tx_number = let incrementor = Uint128 1 in builtin add latest_tx_number incrementor; crud_tx_number_ := new_tx_number +end + +procedure SaveDocument( document: Document ) + match document with + | VerificationMethod action purpose key => + match action with + | Add => verification_methods_[purpose] := key + | Remove => err = CodeNotValid; ThrowError err end + | Service action id endpoint => + match action with + | Add => + match endpoint with + | Address addr => services_[id] := addr + | Uri eType protocol uri => services__[id] := endpoint end + | Remove => err = CodeNotValid; ThrowError err end end end + +transition DidCreate( + document: List Document, + signature: Option ByStr64 + ) + did_status <- did_status_; + match did_status with + | Deployed => + VerifyAdmin; + new_did = let did_prefix = "did:tyron:zil:main:" in let did_suffix = builtin to_string _this_address + in builtin concat did_prefix did_suffix; did_ := new_did; + forall document SaveDocument; + get_recovery_key <- verification_methods_[recovery]; ThrowIfNoKey get_recovery_key; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; ThrowIfNoKey get_update_key; did_update = option_bystr33_value get_update_key; + ThrowIfSameKey did_recovery did_update; + new_status = Created; did_status_ := new_status; + current_block <- &BLOCKNUMBER; did_created_ := current_block; Timestamp + | _ => err = CodeWrongStatus; ThrowError err + end +end + +procedure UpdateDocument( document: Document ) + match document with + | VerificationMethod action purpose key => + key_exists <- exists verification_methods_[purpose]; + match action with + | Add => + match key_exists with + | True => err = CodeNotValid; ThrowError err + | False => verification_methods_[purpose] := key end + | Remove => + match key_exists with + | True => delete verification_methods_[purpose] + | False => err = CodeNotValid; ThrowError err end end + | Service action id endpoint => + service_exists <- exists services_[id]; + match action with + | Add => + match service_exists with + | True => err = CodeNotValid; ThrowError err + | False => + match endpoint with + | Address addr => services_[id] := addr + | Uri eType protocol uri => services__[id] := endpoint end end + | Remove => + match service_exists with + | True => delete services_[id] + | False => err = CodeNotValid; ThrowError err end end end end + +procedure ValidateDocument( + operation: Operation, + document: List Document + ) + match operation with + | Recovery => forall document SaveDocument + | Update => forall document UpdateDocument + end +end + +procedure HashDocument( document: Document ) + doc_hash <- document_hash; + match document with + | VerificationMethod action purpose key => + match action with + | Add => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash purpose + in let h3 = builtin sha256hash key + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + | Remove => + hash = let h1 = builtin sha256hash actionRemove + in let h2 = builtin sha256hash purpose + in builtin concat h1 h2; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + end + | Service action id endpoint => + match action with + | Add => + match endpoint with + | Uri eType transfer uri => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash id + in let h3 = builtin sha256hash uri + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + | Address addr => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash id + in let h3 = builtin sha256hash addr + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + end + | Remove => + hash = let h1 = builtin sha256hash actionRemove + in let h2 = builtin sha256hash id + in builtin concat h1 h2; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ end end end + +procedure VerifyDocument( + operation: Operation, + document: List Document, + signature: Option ByStr64 + ) + document_hash := zero_bystr; + forall document HashDocument; + doc_hash <- document_hash; + sig = option_bystr64_value signature; + id = match operation with + | Recovery => recovery + | Update => update + end; + VerifySignature id doc_hash sig; + ValidateDocument operation document end + +transition DidRecover( + document: List Document, + signature: Option ByStr64 + ) + IsOperational; VerifyAdmin; + get_recovery_key <- verification_methods_[recovery]; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; did_update = option_bystr33_value get_update_key; + VerifyDocument didRecovery document signature; + VerifyDIDkeys didRecovery did_recovery did_update; + new_status = Recovered; did_status_ := new_status; Timestamp end + +transition DidUpdate( + document: List Document, + signature: Option ByStr64 + ) + IsOperational; VerifyAdmin; + get_recovery_key <- verification_methods_[recovery]; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; did_update = option_bystr33_value get_update_key; + VerifyDocument didUpdate document signature; + VerifyDIDkeys didUpdate did_recovery did_update; + new_status = Updated; did_status_ := new_status; Timestamp end + +transition DidDeactivate( + document: List Document, + signature: Option ByStr64 + ) + IsOperational; VerifyAdmin; + VerifyDocument didRecovery document signature; + deactivated_methods = Emp String ByStr33; verification_methods_ := deactivated_methods; + deactivated_services = Emp String ByStr20; services_ := deactivated_services; + deactivated_services_ = Emp String Endpoint; services__ := deactivated_services_; + new_status = Deactivated; did_status_ := new_status; Timestamp end + +(* Receive $ZIL native funds *) +transition AddFunds() + IsOperational; accept end + +(* Send $ZIL to any recipient that implements the tag, e.g. "AddFunds", "", etc. *) +transition SendFunds( + tag: String, + beneficiary: Beneficiary + ) + IsOperational; VerifyAdmin; + match beneficiary with + | UserDomain username domain => + current_init <- init_; + get_addr <-& current_init.dns[domain][username]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: tag; _recipient: addr; _amount: _amount } in one_msg m; send msg + | BeneficiaryAddr addr => + accept; msg = let m = { _tag: tag; _recipient: addr; _amount: _amount } in one_msg m; send msg end end + +procedure FetchServiceAddr( id: String ) + current_init <- init_; get_service <-& current_init.services_[id]; addr = option_bystr20_value get_service; service_addr[id] := addr end + +transition Transfer( + addrName: String, + beneficiary: Beneficiary, + amount: Uint128 + ) + IsOperational; VerifyAdmin; + FetchServiceAddr addrName; get_token_addr <- service_addr[addrName]; token_addr = option_bystr20_value get_token_addr; + match beneficiary with + | UserDomain username domain => + current_init <- init_; + get_addr <-& current_init.dns[domain][username]; addr = option_bystr20_value get_addr; + msg = let m = { _tag: "Transfer"; _recipient: token_addr; _amount: zero; + to: addr; + amount: amount + } in one_msg m ; send msg + | BeneficiaryAddr addr => + msg = let m = { _tag: "Transfer"; _recipient: token_addr; _amount: zero; + to: addr; + amount: amount + } in one_msg m ; send msg end end + +transition RecipientAcceptTransfer( + sender: ByStr20, + recipient: ByStr20, + amount: Uint128 + ) + IsOperational end + +transition RecipientAcceptTransferFrom( + initiator: ByStr20, + sender: ByStr20, + recipient: ByStr20, + amount: Uint128 + ) + IsOperational end + +transition TransferSuccessCallBack( + sender: ByStr20, + recipient: ByStr20, + amount : Uint128 + ) + IsOperational end + +transition TransferFromSuccessCallBack( + initiator: ByStr20, + sender: ByStr20, + recipient: ByStr20, + amount: Uint128 + ) + IsOperational end + +(* The NFT.coop backbone *) + +transition UpdateHourlyWage( amount: Uint128 ) + VerifyAdmin; hourly_wage := amount end + +transition AddMember( addr: ByStr20 ) + VerifyAdmin; + new_account = Account zero zero zero zero; + members[addr] := new_account end + +transition NFTTransfer( beneficiary: Beneficiary ) + IsOperational; get_account <- members[_sender]; + match get_account with + | None => err = CodeWrongCaller; ThrowError err + | Some account => + match beneficiary with + | UserDomain username domain => + current_init <- init_; get_addr <-& current_init.dns[domain][username]; addr = option_bystr20_value get_addr; + members[addr] := account; delete members[_sender] + | BeneficiaryAddr addr => + members[addr] := account; delete members[_sender] end end end + +transition AddWork( + transferProtocol: TransferProtocol, + uri: String, + amount: Uint128 (* hours *) + ) + IsOperational; get_account <- members[_sender]; + match get_account with + | None => err = CodeWrongCaller; ThrowError err + | Some account => + prs = account_prs get_account; merged = account_merged get_account; balance = account_balance get_account; xpoints = account_xps get_account; + current_block <- &BLOCKNUMBER; + commit = let h1 = builtin sha256hash _sender + in let h2 = builtin sha256hash uri + in let h3 = builtin sha256hash current_block + in let h1_2 = builtin concat h1 h2 + in let h1__3 = builtin concat h1_2 h3 + in builtin sha256hash h1__3; + new_endpoint = Uri domain_ transferProtocol uri; id = builtin to_string commit; services__[id] := new_endpoint; + new_pr = PR _sender amount; contributions[commit] := new_pr; + updated_account = let updated_prs = builtin add prs one in Account updated_prs merged balance xpoints; members[_sender] := updated_account end end + +transition AssessPerformance( + commit: ByStr32, + amount: Uint128 (* performance: 20(%) = 1 star, 100(%) = 5 stars *) + ) + IsOperational; VerifyAdmin; + get_pr <- contributions[commit]; + match get_pr with + | None => err = CodeNotValid; ThrowError err + | Some pr => + member = pr_member pr; hours = pr_hours pr; + get_account <- members[member]; prs = account_prs get_account; merged = account_merged get_account; balance = account_balance get_account; xpoints = account_xps get_account; + nfts[commit] := amount; + current_hourly_wage <- hourly_wage; + updated_account = let updated_merged = builtin add merged one (* transfer NFT value to contributor *) + in let earnings_percent = builtin mul hours current_hourly_wage + in let earnings = builtin mul earnings_percent amount + in let updated_balance = builtin add balance earnings + in let updated_xps = builtin add xpoints amount + in Account prs updated_merged updated_balance updated_xps; members[member] := updated_account; + id = builtin to_string commit; delete services_[id] end end + +transition RemoveService( commit: ByStr32 ) + IsOperational; VerifyAdmin; + get_pr <- contributions[commit]; + match get_pr with + | None => err = CodeNotValid; ThrowError err + | Some pr => delete contributions[commit]; id = builtin to_string commit; delete services_[id] end end + +transition WithdrawEarnings( amount: Uint128 ) + IsOperational; get_account <- members[_sender]; + match get_account with + | None => err = CodeWrongCaller; ThrowError err + | Some account => + prs = account_prs get_account; merged = account_merged get_account; balance = account_balance get_account; xpoints = account_xps get_account; + sufficient_funds = uint128_ge balance amount; + match sufficient_funds with + | True => + updated_account = let new_balance = builtin sub balance amount in Account prs merged new_balance xpoints; members[_sender] := updated_account; + msg = let m = { _tag: "AddFunds"; _recipient: _sender; _amount: amount } in one_msg m; send msg + | False => err = CodeInsufficientFunds; ThrowError err end end end \ No newline at end of file diff --git a/src/lib/smart-contracts/xwallet.scilla b/src/lib/smart-contracts/xwallet.scilla new file mode 100644 index 00000000..1d109905 --- /dev/null +++ b/src/lib/smart-contracts/xwallet.scilla @@ -0,0 +1,840 @@ +(* v0.9.3 +DIDxWallet.tyron: decentralized identifier smart wallet. +Self-Sovereign Identity Protocol. +Copyright (C) Tyron Pungtas and its affiliates. +www.ssiprotocol.com + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details.*) + +scilla_version 0 + +import PairUtils BoolUtils + +library DIDxWallet + + (* The DID library *) + + type DIDstatus = + | Deployed + | Created + | Updated + | Recovered + | Deactivated + | Locked + + type Operation = + | Recovery + | Update + + type Action = + | Add + | Remove + + type TransferProtocol = + | Https + | Git + + type Endpoint = + | Address of ByStr20 + | Uri of String TransferProtocol String (* type, transfer protocol & uri *) + + type Document = + | VerificationMethod of Action String ByStr33 (* string: key purpose OR service ID *) + | Service of Action String Endpoint + + type Recoverer = + | First + | Second + + type Beneficiary = + | UserDomain of String String + | BeneficiaryAddr of ByStr20 + + let didRecovery = Recovery + let didUpdate = Update + let update = "update" + let recovery = "recovery" + let didsr = "socialrecovery" + let actionAdd = "add" + let actionRemove = "remove" + let empty_methods = Emp String ByStr33 + let empty_services = Emp String ByStr20 + let empty_services_ = Emp String Endpoint + + let one_msg = fun( msg: Message ) => + let nil_msg = Nil{ Message } in Cons{ Message } msg nil_msg + + let two_msgs = fun( msg1: Message ) => fun( msg2: Message ) => + let msgs_tmp = one_msg msg2 in Cons{ Message } msg1 msgs_tmp + + type Error = + | CodeWrongStatus + | CodeNotAdmin + | CodeWrongCaller + | CodeWrongSignature + | CodeUndefinedKey + | CodeSameKey + | CodeSameId + | CodeNotValid + | CodeDidLocked + + let make_error = fun( error: Error ) => + let result = match error with + | CodeWrongStatus => Int32 -1 + | CodeNotAdmin => Int32 -2 + | CodeWrongCaller => Int32 -3 + | CodeWrongSignature => Int32 -4 + | CodeUndefinedKey => Int32 -5 + | CodeSameKey => Int32 -6 + | CodeSameId => Int32 -8 + | CodeNotValid => Int32 -9 + | CodeDidLocked => Int32 -10 + end in { _exception: "Error"; code: result } + + let zero = Uint128 0 + let zeroByStr20 = 0x0000000000000000000000000000000000000000 + let zeroByStr33 = 0x000000000000000000000000000000000000000000000000000000000000000000 + let zeroByStr64 = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + let zero_bystr = builtin to_bystr zeroByStr20 + + let option_value = tfun 'A => fun( default: 'A ) => fun( input: Option 'A) => + match input with + | Some v => v + | None => default end + let option_uint128_value = let f = @option_value Uint128 in f zero + let option_bystr20_value = let f = @option_value ByStr20 in f zeroByStr20 + let option_bystr33_value = let f = @option_value ByStr33 in f zeroByStr33 + let option_bystr64_value = let f = @option_value ByStr64 in f zeroByStr64 + + (* The xWallet library *) + + type Data = + | Data of String String String Uint128 Uint128 Uint128 (* id, address name, second address name, amount, second amount, third amount *) + + let domain_ = "did" + let education = "education" + let crud = "crud" + let stakezil = "stakezil" + let zilswap = "zilswap" + let xorder = "xorder" + let fifteen_min = Uint128 21 + let one_hundred = Uint128 100 + let fixed = None{ Uint128 } + +contract DIDxWallet( + initAdmin: ByStr20, + init_tyron: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 with contract field verification_methods_: Map String ByStr33 end ), field psc_fee: Map String Uint128 end + ) + field admin_: ByStr20 = initAdmin + field did_: String = "" (* the decentralized identifier *) + field did_status_: DIDstatus = Deployed + + field init_: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 with contract field verification_methods_: Map String ByStr33 end ), field psc_fee: Map String Uint128 end = init_tyron + field agent: ByStr20 = initAdmin + + (* Verification methods @key: key purpose @value: public key of type "SchnorrSecp256k1VerificationKey2019" *) + field verification_methods_: Map String ByStr33 = empty_methods + + (* Services @key: ID @value: endpoint *) + field services_: Map String ByStr20 = empty_services + field services__: Map String Endpoint = empty_services_ + field service_addr: Map String ByStr20 = Emp String ByStr20 + + field document_hash: ByStr = zero_bystr + + field social_recovery_: Option( Pair ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end ) + = None{( Pair ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end )} + + (* The block number when the DID Create operation occurred *) + field did_created_: BNum = BNum 0 + + (* The block number when the last DID CRUD operation occurred *) + field ledger_time_: BNum = BNum 0 + + (* A monotonically increasing number representing the amount of DID CRUD transactions that have taken place *) + field crud_tx_number_: Uint128 = zero + + field deadline_block: Uint128 = fifteen_min + +(* The DID backbone *) + +procedure ThrowError( err: Error ) + e = make_error err; throw e end + +procedure IsOperational() + did_status <- did_status_; + match did_status with + | Deactivated => err = CodeWrongStatus; ThrowError err + | Locked => err = CodeDidLocked; ThrowError err + | _ => end end + +procedure VerifyAdmin() + current_admin <- admin_; + verified = builtin eq current_admin _sender; + match verified with + | True => + | False => err= CodeNotAdmin; ThrowError err end end + +procedure Payment( + id: String, + amount: Option Uint128 + ) + init <- init_; + get_fee <-& init.psc_fee[id]; fee = option_uint128_value get_fee; + is_zero = builtin eq fee zero; + match is_zero with + | True => err = CodeNotValid; ThrowError err + | False => + match amount with + | None => accept; msg = let m = { _tag: "AddFunds"; _recipient: init; _amount: fee; id: id } in one_msg m; send msg + | Some amt => + fee_ = let percent = builtin div amt one_hundred in builtin mul fee percent; + accept; msg = let m = { _tag: "AddFunds"; _recipient: init; _amount: fee_; id: id } in one_msg m; send msg end end end + +transition UpdateAdmin( addr: ByStr20 ) + IsOperational; VerifyAdmin; Payment update fixed; admin_ := addr end + +transition UpdateInit( + addr: ByStr20 with contract field services_: Map String ByStr20, field dns: Map String ( Map String ByStr20 with contract field verification_methods_: Map String ByStr33 end ), field psc_fee: Map String Uint128 end + ) + IsOperational; VerifyAdmin; Payment update fixed; init_ := addr end + +transition UpdateAgent( addrName: String ) + IsOperational; VerifyAdmin; Payment update fixed; + init <- init_; agent_ = "agent"; + get_addr <-& init.dns[agent_][addrName]; addr = option_bystr20_value get_addr; + agent := addr end + +transition EnableSocialRecovery( + recovererName: String, + recovererDomain: String, + sndRecovererName: String, + sndRecovererDomain: String + ) + IsOperational; VerifyAdmin; Payment update fixed; + init <- init_; + get_addr <-& init.dns[recovererDomain][recovererName]; + get_sndAddr <-& init.dns[sndRecovererDomain][sndRecovererName]; + match get_addr with + | Some addr => match get_sndAddr with + | Some sndAddr => + recoverers = let sr = Pair{ ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end } addr sndAddr + in Some{( Pair ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end )} sr; + social_recovery_ := recoverers + | None => err = CodeNotValid; ThrowError err end + | None => err = CodeNotValid; ThrowError err end end + +transition UpdateSocialRecoverer( + recoverer: Recoverer, + recovererName: String, + recovererDomain: String + ) + IsOperational; VerifyAdmin; Payment update fixed; + social_recovery <- social_recovery_; + init <- init_; + get_addr <-& init.dns[recovererDomain][recovererName]; + match get_addr with + | Some addr => + match social_recovery with + | Some recoverers => + match recoverer with + | First => + sr2addr = let snd_element = @snd ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end in snd_element recoverers; + updated_sr = let sr = Pair{ ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end } addr sr2addr + in Some{( Pair ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end )} sr; + social_recovery_ := updated_sr + | Second => + sr1addr = let fst_element = @fst ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end in fst_element recoverers; + updated_sr = let sr = Pair{ ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end } sr1addr addr + in Some{( Pair ByStr20 with contract field verification_methods_: Map String ByStr33 end ByStr20 with contract field verification_methods_: Map String ByStr33 end )} sr; + social_recovery_ := updated_sr end + | None => err = CodeWrongStatus; ThrowError err end + | None => err = CodeNotValid; ThrowError err end end + +transition Lock() + IsOperational; VerifyAdmin; Payment update fixed; + social_recovery <- social_recovery_; + match social_recovery with + | Some recoverers => + | None => err = CodeNotValid; ThrowError err end; + locked = Locked; did_status_ := locked end + +transition SocialRecovery( + addr: ByStr20 with contract field verification_methods_: Map String ByStr33 end, + signature1: ByStr64, + signature2: ByStr64 + ) + did_status <- did_status_; + match did_status with + | Deactivated => err = CodeWrongStatus; ThrowError err + | _ => end; + Payment didsr fixed; + signed_data = builtin to_bystr addr; + social_recovery <- social_recovery_; + match social_recovery with + | Some recoverers => + recoverer1addr = let fst_element = @fst + ByStr20 with contract field verification_methods_: Map String ByStr33 end + ByStr20 with contract field verification_methods_: Map String ByStr33 end + in fst_element recoverers; + recoverer2addr = let snd_element = @snd + ByStr20 with contract field verification_methods_: Map String ByStr33 end + ByStr20 with contract field verification_methods_: Map String ByStr33 end + in snd_element recoverers; + is_recoverer = let is_recoverer1 = builtin eq recoverer1addr _sender in let is_recoverer2 = builtin eq recoverer2addr _sender in orb is_recoverer1 is_recoverer2; + match is_recoverer with + | True => + | False => err = CodeWrongCaller; ThrowError err end; + get_recoverer1key <-& recoverer1addr.verification_methods_[didsr]; did_sr1key = option_bystr33_value get_recoverer1key; + is_right_signature1 = builtin schnorr_verify did_sr1key signed_data signature1; + match is_right_signature1 with + | True => + get_recoverer2key <-& recoverer2addr.verification_methods_[didsr]; did_sr2key = option_bystr33_value get_recoverer2key; + is_right_signature2 = builtin schnorr_verify did_sr2key signed_data signature2; + match is_right_signature2 with + | True => + | False => err = CodeWrongSignature; ThrowError err end + | False => err = CodeWrongSignature; ThrowError err end + | None => err = CodeWrongStatus; ThrowError err end; + admin_ := addr end + +transition BuyDomainNameNFT( username: String ) + IsOperational; VerifyAdmin; init <- init_; + get_fee <-& init.psc_fee[domain_]; fee = option_uint128_value get_fee; + accept; msg = let m = { _tag: "BuyDomainNameNFT"; _recipient: init; _amount: fee; + username: username; + domain: domain_ } in one_msg m; send msg end + +transition TransferDomainNameNFT( + username: String, + newAddr: ByStr20 + ) + IsOperational; VerifyAdmin; init <- init_; + get_fee <-& init.psc_fee[domain_]; fee = option_uint128_value get_fee; + accept; msg = let m = { _tag: "TransferDomainNameNFT"; _recipient: init; _amount: fee; + username: username; + domain: domain_; + newAddr: newAddr } in one_msg m; send msg end + +(* Verify Schnorr signature - signed data must correspond with a DID Key *) +procedure VerifySignature( + id: String, + signedData: ByStr, + signature: ByStr64 + ) + get_did_key <- verification_methods_[id]; + is_right_signature = let did_key = option_bystr33_value get_did_key in builtin schnorr_verify did_key signedData signature; + match is_right_signature with + | True => + | False => err = CodeWrongSignature; ThrowError err end end + +procedure ThrowIfNoKey( optKey: Option ByStr33 ) + match optKey with + | Some key => + | None => err = CodeUndefinedKey; ThrowError err end end + +procedure ThrowIfSameKey( + key: ByStr33, + sndKey: ByStr33 + ) + is_same_key = builtin eq key sndKey; + match is_same_key with + | True => err= CodeSameKey; ThrowError err + | False => end end + +procedure VerifyDIDkeys( + operation: Operation, + didRecovery: ByStr33, + didUpdate: ByStr33 + ) + get_update_key <- verification_methods_[update]; new_update = option_bystr33_value get_update_key; + match operation with + | Recovery => + get_recovery_key <- verification_methods_[recovery]; new_recovery = option_bystr33_value get_recovery_key; + ThrowIfSameKey new_recovery new_update; + ThrowIfSameKey new_recovery didRecovery; ThrowIfSameKey new_recovery didUpdate; ThrowIfSameKey new_update didRecovery; ThrowIfSameKey new_update didUpdate + | Update => ThrowIfSameKey new_update didUpdate; ThrowIfSameKey new_update didRecovery end end + +procedure Timestamp() + current_block <- &BLOCKNUMBER; ledger_time_ := current_block; + latest_tx_number <- crud_tx_number_; + new_tx_number = let incrementor = Uint128 1 in builtin add latest_tx_number incrementor; crud_tx_number_ := new_tx_number end + +procedure SaveDocument( document: Document ) + match document with + | VerificationMethod action purpose key => + match action with + | Add => verification_methods_[purpose] := key + | Remove => err = CodeNotValid; ThrowError err end + | Service action id endpoint => + match action with + | Add => + match endpoint with + | Address addr => services_[id] := addr + | Uri eType protocol uri => services__[id] := endpoint end + | Remove => err = CodeNotValid; ThrowError err end end end + +transition DidCreate( + document: List Document, + signature: Option ByStr64 + ) + did_status <- did_status_; + match did_status with + | Deployed => + VerifyAdmin; Payment crud fixed; + new_did = let did_prefix = "did:tyron:zil:main:" in let did_suffix = builtin to_string _this_address + in builtin concat did_prefix did_suffix; did_ := new_did; + forall document SaveDocument; + get_recovery_key <- verification_methods_[recovery]; ThrowIfNoKey get_recovery_key; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; ThrowIfNoKey get_update_key; did_update = option_bystr33_value get_update_key; + ThrowIfSameKey did_recovery did_update; + new_status = Created; did_status_ := new_status; + current_block <- &BLOCKNUMBER; did_created_ := current_block; Timestamp + | _ => err = CodeWrongStatus; ThrowError err end end + +procedure UpdateDocument( document: Document ) + match document with + | VerificationMethod action purpose key => + key_exists <- exists verification_methods_[purpose]; + match action with + | Add => + match key_exists with + | True => + is_update = builtin eq purpose update; + match is_update with + | True => verification_methods_[update] := key + | False => err = CodeSameId; ThrowError err end + | False => verification_methods_[purpose] := key end + | Remove => + match key_exists with + | True => delete verification_methods_[purpose] + | False => err = CodeNotValid; ThrowError err end end + | Service action id endpoint => + is_service_ <- exists services_[id]; + is_service__ <- exists services__[id]; + service_exists = orb is_service_ is_service__; + match action with + | Add => + match service_exists with + | True => err = CodeSameId; ThrowError err + | False => + match endpoint with + | Address addr => services_[id] := addr + | Uri eType protocol uri => services__[id] := endpoint end end + | Remove => + match service_exists with + | True => delete services_[id]; delete services__[id] + | False => err = CodeNotValid; ThrowError err end end end end + +procedure ValidateDocument( + operation: Operation, + document: List Document + ) + match operation with + | Recovery => forall document SaveDocument + | Update => forall document UpdateDocument end end + +procedure HashDocument( document: Document ) + doc_hash <- document_hash; + match document with + | VerificationMethod action purpose key => + match action with + | Add => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash purpose + in let h3 = builtin sha256hash key + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + | Remove => + hash = let h1 = builtin sha256hash actionRemove + in let h2 = builtin sha256hash purpose + in builtin concat h1 h2; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ end + | Service action id endpoint => + match action with + | Add => + match endpoint with + | Uri eType transfer uri => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash id + in let h3 = builtin sha256hash uri + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ + | Address addr => + hash = let h1 = builtin sha256hash actionAdd + in let h2 = builtin sha256hash id + in let h3 = builtin sha256hash addr + in let h1_2 = builtin concat h1 h2 + in builtin concat h1_2 h3; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ end + | Remove => + hash = let h1 = builtin sha256hash actionRemove + in let h2 = builtin sha256hash id + in builtin concat h1 h2; + doc_hash_ = let hash_ = builtin to_bystr hash in builtin concat doc_hash hash_; + document_hash := doc_hash_ end end end + +procedure VerifyDocument( + operation: Operation, + document: List Document, + signature: Option ByStr64 + ) + document_hash := zero_bystr; + forall document HashDocument; + doc_hash <- document_hash; + sig = option_bystr64_value signature; + id = match operation with + | Recovery => recovery + | Update => update end; + VerifySignature id doc_hash sig; + ValidateDocument operation document end + +transition DidRecover( + document: List Document, + signature: Option ByStr64 + ) + did_status <- did_status_; + match did_status with + | Created => | Recovered => | Updated => + | _ => err = CodeWrongStatus; ThrowError err end; + VerifyAdmin; Payment crud fixed; + get_recovery_key <- verification_methods_[recovery]; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; did_update = option_bystr33_value get_update_key; + verification_methods_ := empty_methods; services_ := empty_services; services__ := empty_services_; + VerifyDocument didRecovery document signature; + VerifyDIDkeys didRecovery did_recovery did_update; + new_status = Recovered; did_status_ := new_status; Timestamp end + +transition DidUpdate( + document: List Document, + signature: Option ByStr64 + ) + did_status <- did_status_; + match did_status with + | Created => | Recovered => | Updated => + | _ => err = CodeWrongStatus; ThrowError err end; + VerifyAdmin; Payment update fixed; + get_recovery_key <- verification_methods_[recovery]; did_recovery = option_bystr33_value get_recovery_key; + get_update_key <- verification_methods_[update]; did_update = option_bystr33_value get_update_key; + VerifyDocument didUpdate document signature; + VerifyDIDkeys didUpdate did_recovery did_update; + new_status = Updated; did_status_ := new_status; Timestamp end + +transition DidDeactivate( + document: List Document, + signature: Option ByStr64 + ) + did_status <- did_status_; + match did_status with + | Created => | Recovered => | Updated => + | _ => err = CodeWrongStatus; ThrowError err end; + VerifyAdmin; Payment crud fixed; + VerifyDocument didRecovery document signature; + verification_methods_ := empty_methods; services_ := empty_services; services__ := empty_services_; + new_status = Deactivated; did_status_ := new_status; Timestamp end + +(* Receive $ZIL native funds *) +transition AddFunds() + IsOperational; Payment education fixed; accept end + +(* Send $ZIL to any recipient that implements the tag, e.g. "AddFunds", "", etc. *) +transition SendFunds( + tag: String, + beneficiary: Beneficiary + ) + IsOperational; VerifyAdmin; Payment education fixed; + match beneficiary with + | UserDomain username domain => + init <- init_; + get_addr <-& init.dns[domain][username]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: tag; _recipient: addr; _amount: _amount } in one_msg m; send msg + | BeneficiaryAddr addr => + accept; msg = let m = { _tag: tag; _recipient: addr; _amount: _amount } in one_msg m; send msg end end + +procedure FetchServiceAddr( id: String ) + init <- init_; get_service <-& init.services_[id]; addr = option_bystr20_value get_service; service_addr[id] := addr end + +transition Transfer( + addrName: String, + beneficiary: Beneficiary, + amount: Uint128 + ) + IsOperational; VerifyAdmin; Payment education fixed; + FetchServiceAddr addrName; get_token_addr <- service_addr[addrName]; token_addr = option_bystr20_value get_token_addr; + match beneficiary with + | UserDomain username domain => + init <- init_; + get_addr <-& init.dns[domain][username]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "Transfer"; _recipient: token_addr; _amount: zero; + to: addr; + amount: amount } in one_msg m ; send msg + | BeneficiaryAddr addr => + accept; msg = let m = { _tag: "Transfer"; _recipient: token_addr; _amount: zero; + to: addr; + amount: amount } in one_msg m ; send msg end end + +transition RecipientAcceptTransfer( sender: ByStr20, recipient: ByStr20, amount: Uint128 ) IsOperational end + +transition RecipientAcceptTransferFrom( initiator: ByStr20, sender: ByStr20, recipient: ByStr20, amount: Uint128 ) IsOperational end + +transition TransferSuccessCallBack( sender: ByStr20, recipient: ByStr20, amount : Uint128 ) IsOperational end + +transition TransferFromSuccessCallBack( initiator: ByStr20, sender: ByStr20, recipient: ByStr20, amount: Uint128 ) IsOperational end + +(* The xWallet backbone *) + +transition UpdateDeadline( amount: Uint128 ) + IsOperational; VerifyAdmin; Payment update fixed; deadline_block := amount end + +procedure IncreaseAllowance( + addrName: String, + amount: Uint128 + ) + FetchServiceAddr addrName; get_addr <- service_addr[addrName]; addr = option_bystr20_value get_addr; + FetchServiceAddr zilswap; get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + msg = let m = { + _tag: "IncreaseAllowance"; _recipient: addr; _amount: zero; + spender: zilswap_addr; + amount: amount } in one_msg m ; send msg end + +procedure VerifyCaller( + data: Data, + signature: Option ByStr64 + ) + current_admin <- admin_; + is_admin = builtin eq current_admin _sender; + match is_admin with + | True => + | False => + current_agent <- agent; + is_agent = builtin eq current_agent _sender; + match is_agent with + | True => + match signature with + | None => err = CodeNotValid; ThrowError err + | Some sig => + match data with + | Data id addrName sndAddrName amt sndAmt trdAmt => + signed_data = let h1 = builtin sha256hash addrName + in let h2 = builtin sha256hash sndAddrName + in let h3 = builtin sha256hash amt + in let h4 = builtin sha256hash sndAmt + in let h5 = builtin sha256hash trdAmt + in let h1_2 = builtin concat h1 h2 + in let h1__3 = builtin concat h1_2 h3 + in let h1__4 = builtin concat h1__3 h4 + in let h1__5 = builtin concat h1__4 h5 + in builtin to_bystr h1__5; + VerifySignature xorder signed_data sig end end + | False => err = CodeWrongCaller; ThrowError err end end end + +transition AddLiquidity( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; + match data with + | Data id addrName none amt sndAmt none_ => + IncreaseAllowance addrName amt; + get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + get_addr <- service_addr[addrName]; addr = option_bystr20_value get_addr; + current_block <- &BLOCKNUMBER; deadline <- deadline_block; this_deadline = builtin badd current_block deadline; + amount = Some{ Uint128 } amt; Payment zilswap amount; + accept; msg = let m = { + _tag: "AddLiquidity"; _recipient: zilswap_addr; _amount: _amount; + token_address: addr; + min_contribution_amount: amt; + max_token_amount: sndAmt; + deadline_block: this_deadline } in one_msg m ; send msg end end + +transition RemoveLiquidity( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; + match data with + | Data id addrName none_ amt sndAmt trdAmt => + FetchServiceAddr zilswap; get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + FetchServiceAddr addrName; get_addr <- service_addr[addrName]; addr = option_bystr20_value get_addr; + current_block <- &BLOCKNUMBER; deadline <- deadline_block; this_deadline = builtin badd current_block deadline; + amount = Some{ Uint128 } amt; Payment zilswap amount; + accept; msg = let m = { + _tag: "RemoveLiquidity"; _recipient: zilswap_addr; _amount: _amount; + token_address: addr; + contribution_amount: amt; + min_zil_amount: sndAmt; + min_token_amount: trdAmt; + deadline_block: this_deadline } in one_msg m ; send msg end end + +transition SwapExactZILForTokens( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; + match data with + | Data id addrName none amt sndAmt none_ => + FetchServiceAddr zilswap; get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + FetchServiceAddr addrName; get_addr <- service_addr[addrName]; addr = option_bystr20_value get_addr; + current_block <- &BLOCKNUMBER; deadline <- deadline_block; this_deadline = builtin badd current_block deadline; + amount = Some{ Uint128 } amt; Payment zilswap amount; + accept; msg = let m = { + _tag: "SwapExactZILForTokens"; _recipient: zilswap_addr; _amount: amt; + token_address: addr; + min_token_amount: sndAmt; + deadline_block: this_deadline; + recipient_address: _this_address } in one_msg m; send msg end end + +transition SwapExactTokensForZIL( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; Payment education fixed; + match data with + | Data id addrName none amt sndAmt none_ => + IncreaseAllowance addrName amt; + get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + get_addr <- service_addr[addrName]; addr = option_bystr20_value get_addr; + current_block <- &BLOCKNUMBER; deadline <- deadline_block; this_deadline = builtin badd current_block deadline; + accept; msg = let m = { + _tag: "SwapExactTokensForZIL"; _recipient: zilswap_addr; _amount: zero; + token_address: addr; + token_amount: amt; + min_zil_amount: sndAmt; + deadline_block: this_deadline; + recipient_address: _this_address } in one_msg m ; send msg end end + +transition SwapExactTokensForTokens( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; Payment education fixed; + match data with + | Data id tokenName toTokenName amt sndAmt trdAmt => + IncreaseAllowance tokenName amt; + get_zilswap <- service_addr[zilswap]; zilswap_addr = option_bystr20_value get_zilswap; + get_addr <- service_addr[tokenName]; addr = option_bystr20_value get_addr; + FetchServiceAddr toTokenName; get_sndAddr <- service_addr[toTokenName]; sndAddr = option_bystr20_value get_sndAddr; + current_block <- &BLOCKNUMBER; deadline <- deadline_block; this_deadline = builtin badd current_block deadline; + accept; msg = let m = { + _tag: "SwapExactTokensForTokens"; _recipient: zilswap_addr; _amount: zero; + token0_address: addr; + token1_address: sndAddr; + token0_amount: amt; + min_token1_amount: sndAmt; + deadline_block: this_deadline; + recipient_address: _this_address } in one_msg m ; send msg end end + +transition DelegateStake( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + match data with + | Data id ssnName sndAddrName amt sndAmt trdAmt => + FetchServiceAddr ssnName; get_ssnaddr <- service_addr[ssnName]; ssnaddr = option_bystr20_value get_ssnaddr; + amount_ = Some{ Uint128 } amt; Payment stakezil amount_; + current_agent <- agent; is_agent = builtin eq current_agent ssnaddr; + match is_agent with + | True => + | False => Payment id amount_ end; + accept; msg = let m = { _tag: "DelegateStake"; _recipient: addr; _amount: amt; + ssnaddr: ssnaddr } in one_msg m; send msg end end + +transition DelegateStakeSuccessCallBack( ssnaddr: ByStr20, amount: Uint128 ) IsOperational end + +transition WithdrawStakeRewards( + data: Data, + signature: Option ByStr64 + ) + IsOperational; VerifyCaller data signature; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + match data with + | Data id ssnName none none_ none__ none___ => + FetchServiceAddr ssnName; get_ssnaddr <- service_addr[ssnName]; ssnaddr = option_bystr20_value get_ssnaddr; + Payment education fixed; + current_agent <- agent; is_agent = builtin eq current_agent ssnaddr; + match is_agent with + | True => + | False => Payment id fixed end; + accept; msg = let m = { _tag: "WithdrawStakeRewards"; _recipient: addr; _amount: zero; + ssnaddr: ssnaddr } in one_msg m; send msg end end + +transition WithdrawStakeRewardsSuccessCallBack( ssnaddr: ByStr20, rewards: Uint128 ) IsOperational end + +transition WithdrawStakeAmt( + ssnName: String, + amount: Uint128 + ) + IsOperational; VerifyAdmin; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + FetchServiceAddr ssnName; get_ssnaddr <- service_addr[ssnName]; ssnaddr = option_bystr20_value get_ssnaddr; + amount_ = Some{ Uint128 } amount; Payment stakezil amount_; + accept; msg = let m = { _tag: "WithdrawStakeAmt"; _recipient: addr; _amount: zero; + ssnaddr: ssnaddr; + amt: amount } in one_msg m; send msg end + +transition WithdrawStakeAmtSuccessCallBack( ssnaddr: ByStr20, amount: Uint128 ) IsOperational end + +transition CompleteWithdrawal() + IsOperational; VerifyAdmin; Payment education fixed; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "CompleteWithdrawal"; _recipient: addr; _amount: zero } in one_msg m; send msg end + +transition CompleteWithdrawalNoUnbondedStakeCallBack( amount: Uint128 ) IsOperational end + +transition CompleteWithdrawalSuccessCallBack( amount: Uint128 ) IsOperational end + +transition ReDelegateStake( + ssnName: String, + toSsnName: String, + amount: Uint128 + ) + IsOperational; VerifyAdmin; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + FetchServiceAddr ssnName; get_ssnaddr <- service_addr[ssnName]; ssnaddr = option_bystr20_value get_ssnaddr; + FetchServiceAddr toSsnName; get_to_ssnaddr <- service_addr[toSsnName]; to_ssnaddr = option_bystr20_value get_to_ssnaddr; + amount_ = Some{ Uint128 } amount; Payment stakezil amount_; + accept; msg = let m = { _tag: "ReDelegateStake"; _recipient: addr; _amount: zero; + ssnaddr: ssnaddr; + to_ssn: to_ssnaddr; + amount: amount } in one_msg m; send msg end + +transition ReDelegateStakeSuccessCallBack( ssnaddr: ByStr20, tossn: ByStr20, amount: Uint128 ) IsOperational end + +transition RequestDelegatorSwap( newAddr: ByStr20 ) + IsOperational; VerifyAdmin; Payment update fixed; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "RequestDelegatorSwap"; _recipient: addr; _amount: zero; + new_deleg_addr: newAddr } in one_msg m; send msg end + +transition ConfirmDelegatorSwap( requestor: ByStr20 ) + IsOperational; VerifyAdmin; Payment education fixed; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "ConfirmDelegatorSwap"; _recipient: addr; _amount: zero; + requestor: requestor } in one_msg m; send msg end + +transition RevokeDelegatorSwap() + IsOperational; VerifyAdmin; Payment education fixed; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "RevokeDelegatorSwap"; _recipient: addr; _amount: zero } in one_msg m; send msg end + +transition RejectDelegatorSwap( requestor: ByStr20 ) + IsOperational; VerifyAdmin; Payment education fixed; + FetchServiceAddr stakezil; get_addr <- service_addr[stakezil]; addr = option_bystr20_value get_addr; + accept; msg = let m = { _tag: "RejectDelegatorSwap"; _recipient: addr; _amount: zero; + requestor: requestor } in one_msg m; send msg end \ No newline at end of file diff --git a/src/lib/smart-util.ts b/src/lib/smart-util.ts new file mode 100644 index 00000000..dbdfc697 --- /dev/null +++ b/src/lib/smart-util.ts @@ -0,0 +1,67 @@ +/* + SSI Protocol's client for Node.js + Self-Sovereign Identity Protocol. + Copyright (C) Tyron Pungtas and its affiliates. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + +import * as tyron from 'tyron'; +import LogColors from '../bin/log-colors'; +import * as readline from 'readline-sync'; +import * as fs from 'fs'; +import * as util from 'util'; +import * as zlib from 'zlib'; + +/** Tools to manage smart contracts */ +export default class SmartUtil { + /** Encodes the given contract into a Base64URL string to save it into the init.tyron smart contract */ + public static async encode(): Promise { + const contractName = readline.question(LogColors.green(`What is the name of the contract that you'd like to encode? - `) + LogColors.lightBlue(`Your answer: `)); + try { + const CONTRACT_STRING = (fs.readFileSync(`src/lib/smart-contracts/${contractName}.scilla`)).toString(); + const COMPRESSED_CONTRACT = await (util.promisify(zlib.gzip))(CONTRACT_STRING) as Buffer; + console.log(COMPRESSED_CONTRACT.toString('base64')); + console.log(`The size of the compressed smart-contract is: ${COMPRESSED_CONTRACT.byteLength}`) + } catch (error) { + console.error(error) + } + } + + /** Fetches the tyron smart contract by version & decodes it */ + public static async decode(init: tyron.ZilliqaInit.default, initTyron: string, tyronContract: string, contractVersion: string): Promise { + const this_contract = await init.API.blockchain.getSmartContractState(initTyron) + .then(async state => { + const init = { + tyronCode: state.result.tyron_code, + }; + const contracts = Object.entries(init.tyronCode); + let tyron_contract; + let encoded_contract: string; + contracts.forEach((value: [string, unknown]) => { + if (value[0] === tyronContract) { + tyron_contract = value[1] as [string, unknown]; + tyron_contract = Object.entries(tyron_contract) + tyron_contract.forEach((value: [string, unknown]) => { + if (value[0] === contractVersion) { + encoded_contract = value[1] as string; + } + }) + } + }); + const compressed_contract = Buffer.from(encoded_contract!,'base64'); + const decompressed_contract = await (util.promisify(zlib.unzip))(compressed_contract) as Buffer; + return decompressed_contract.toString(); + }) + .catch(err => { throw err }); + return this_contract; + } +}