From 290409caa7f0fdb26ad28da665e9045465f9b53b Mon Sep 17 00:00:00 2001 From: vba2000 Date: Fri, 17 Apr 2020 11:41:20 +0300 Subject: [PATCH 01/12] Add sync methods --- src/adapters/Adapter.ts | 6 +++++- src/adapters/LedgerAdapter.ts | 10 +++++++++- src/adapters/PrivateKeyAdapter.ts | 10 +++++++++- src/adapters/SeedAdapter.ts | 8 ++++++++ src/adapters/WavesKeeperAdapter.ts | 10 +++++++++- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/adapters/Adapter.ts b/src/adapters/Adapter.ts index 90aa24a..fb1f4a8 100644 --- a/src/adapters/Adapter.ts +++ b/src/adapters/Adapter.ts @@ -37,7 +37,11 @@ export abstract class Adapter { public isDestroyed(): boolean { return this._isDestroyed; } - + + public abstract getSyncAddress(): string; + + public abstract getSyncPublicKey(): string; + public abstract getSignVersions(): Record>; public abstract getPublicKey(): Promise; diff --git a/src/adapters/LedgerAdapter.ts b/src/adapters/LedgerAdapter.ts index fa6ce61..ef08620 100644 --- a/src/adapters/LedgerAdapter.ts +++ b/src/adapters/LedgerAdapter.ts @@ -30,7 +30,15 @@ export class LedgerAdapter extends Adapter { public isAvailable() { return this._isMyLedger(); } - + + public getSyncAddress(): string { + return this._currentUser.address; + } + + public getSyncPublicKey(): string { + return this._currentUser.publicKey; + } + public getPublicKey() { return Promise.resolve(this._currentUser.publicKey); } diff --git a/src/adapters/PrivateKeyAdapter.ts b/src/adapters/PrivateKeyAdapter.ts index d550297..d694579 100644 --- a/src/adapters/PrivateKeyAdapter.ts +++ b/src/adapters/PrivateKeyAdapter.ts @@ -64,7 +64,15 @@ export class PrivateKeyAdapter extends Adapter { public getSeed() { return Promise.reject(Error('Method "getSeed" is not available!')); } - + + public getSyncAddress(): string { + return this.address; + } + + public getSyncPublicKey(): string { + return this.publicKey; + } + public getPublicKey(): Promise { return Promise.resolve(this.publicKey); } diff --git a/src/adapters/SeedAdapter.ts b/src/adapters/SeedAdapter.ts index 573b2b1..fd47e02 100644 --- a/src/adapters/SeedAdapter.ts +++ b/src/adapters/SeedAdapter.ts @@ -97,6 +97,14 @@ export class SeedAdapter extends Adapter { return Promise.resolve(this.encodedSeed as string); } + public getSyncAddress(): string { + return this.seed.address; + } + + public getSyncPublicKey(): string { + return this.seed.keyPair.publicKey; + } + public getPublicKey(): Promise { return Promise.resolve(this.seed.keyPair.publicKey); } diff --git a/src/adapters/WavesKeeperAdapter.ts b/src/adapters/WavesKeeperAdapter.ts index 1f77e7a..a98ccb4 100644 --- a/src/adapters/WavesKeeperAdapter.ts +++ b/src/adapters/WavesKeeperAdapter.ts @@ -109,7 +109,15 @@ export class WavesKeeperAdapter extends Adapter { //@ts-ignore this._onDestoryCb.push(cb); } - + + public getSyncAddress(): string { + return this._address; + } + + public getSyncPublicKey(): string { + return this._pKey; + } + public getPublicKey() { return Promise.resolve(this._pKey); } From 2e26a01f1d3ccf506568c32fead30e3317f93616 Mon Sep 17 00:00:00 2001 From: vba2000 Date: Fri, 17 Apr 2020 11:45:43 +0300 Subject: [PATCH 02/12] Update pack lic --- package-lock.json | 936 +++++++++++++++++++++------------------------- src/utils.ts | 2 +- 2 files changed, 433 insertions(+), 505 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03dcca4..d079a33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,22 +14,23 @@ } }, "@babel/core": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.7.tgz", - "integrity": "sha512-rBlqF3Yko9cynC5CCFy6+K/w2N+Sq/ff2BPy+Krp7rHlABIr5epbA7OxVeKoMHB39LZOp1UY5SuLjy6uWi35yA==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.7", - "@babel/helpers": "^7.8.4", - "@babel/parser": "^7.8.7", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", "@babel/template": "^7.8.6", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.7", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", - "json5": "^2.1.0", + "json5": "^2.1.2", "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", @@ -59,30 +60,36 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true + }, + "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 } } }, "@babel/generator": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.8.tgz", - "integrity": "sha512-HKyUVu69cZoclptr8t8U5b6sx6zoWjh8jiUhnuj3MpZuKT2dJ8zPTuiy31luq32swhI0SpwItCIlU8XW7BZeJg==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", + "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", "dev": true, "requires": { - "@babel/types": "^7.8.7", + "@babel/types": "^7.9.5", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.8.3", "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/types": "^7.9.5" } }, "@babel/helper-get-function-arity": { @@ -94,12 +101,76 @@ "@babel/types": "^7.8.3" } }, + "@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, "@babel/helper-plugin-utils": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", "dev": true }, + "@babel/helper-replace-supers": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, "@babel/helper-split-export-declaration": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", @@ -109,32 +180,38 @@ "@babel/types": "^7.8.3" } }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, "@babel/helpers": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", - "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", "dev": true, "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3" + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" } }, "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.8.tgz", - "integrity": "sha512-mO5GWzBPsPf6865iIbzNE0AvkKF3NE+2S3eRUpE+FE07BOAkXh6G+GW/Pj01hhXjve1WScbaIO4UlY1JKeqCcA==", + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -167,17 +244,17 @@ } }, "@babel/traverse": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.6.tgz", - "integrity": "sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", + "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.6", - "@babel/helper-function-name": "^7.8.3", + "@babel/generator": "^7.9.5", + "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -201,12 +278,12 @@ } }, "@babel/types": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.7.tgz", - "integrity": "sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", "dev": true, "requires": { - "esutils": "^2.0.2", + "@babel/helper-validator-identifier": "^7.9.5", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -232,6 +309,42 @@ "slash": "^2.0.0" } }, + "@jest/core": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz", + "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.9.0", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-resolve-dependencies": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "jest-watcher": "^24.9.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "slash": "^2.0.0", + "strip-ansi": "^5.0.0" + } + }, "@jest/environment": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.9.0.tgz", @@ -367,6 +480,12 @@ "safe-buffer": "~5.1.1" } }, + "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 + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -387,61 +506,61 @@ } }, "@ledgerhq/devices": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.12.0.tgz", - "integrity": "sha512-6dduN4KkSMtBUmxLUBlTH7RXwnc0+1aiCjZMl2unL8CY9u4hGNzu1eN7y2SnR0V5PQQrDXCbQ+MAKmFJa0eR6w==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.13.1.tgz", + "integrity": "sha512-E3zgmA51+esMkczM9xLddVz0myXTauJaT5g4bbwGxxeHQyHyvaJNyOhMmcuxZN/aa/lfRmxYGthcN2JBUPju5A==", "requires": { - "@ledgerhq/errors": "^5.12.0", - "@ledgerhq/logs": "^5.11.0", - "rxjs": "^6.5.4" + "@ledgerhq/errors": "^5.13.1", + "@ledgerhq/logs": "^5.13.1", + "rxjs": "^6.5.5" } }, "@ledgerhq/errors": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.12.0.tgz", - "integrity": "sha512-jF5Km9Zh9Swt9tsNoFtB4tfcb7PmK/tubx+Z9Kt8ivJ9pF8+zthlTNr6sL1hBsfkjln+gYqLIHSUWcitlMN/Kw==" + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.13.1.tgz", + "integrity": "sha512-IuEw9a70K3C3AZV4yVGk75HlwmKmJaR6EjMIxBAupiCw0G6rBP0d62MA1Vx4dg082LKKNXKafWcDstLG4ySpBA==" }, "@ledgerhq/hw-transport": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.12.0.tgz", - "integrity": "sha512-TsGLDY4anie4f3nMPPC4defJAVfuakkTOKntKcPhnGBGFO4HhJGlpZ5LWx50RhYGP7c86QpwPhmxsnx8sLIJjQ==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.13.1.tgz", + "integrity": "sha512-TQJJY10ZoToYjaGK+u9wud0W2dK+6TBA753FGlHgptydSaRmep0uc4A2TxOLPexdVlbHXmkMa1skd3w4ZrKKdA==", "requires": { - "@ledgerhq/devices": "^5.12.0", - "@ledgerhq/errors": "^5.12.0", + "@ledgerhq/devices": "^5.13.1", + "@ledgerhq/errors": "^5.13.1", "events": "^3.1.0" } }, "@ledgerhq/hw-transport-u2f": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-5.12.0.tgz", - "integrity": "sha512-/d1BLvTFyPZYoP+/1XIQEdmprYs2Sz+vCHvC7FOAza2WpExM9K2YIjVe1yrhN5TeijSi1j0i5nZLppSY8NWzNg==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-5.13.1.tgz", + "integrity": "sha512-vn91iWDpEYYYGRPM+EbtnBnalE8KRKTPKo2vw8KHRGGdSqxip3nUvtXAa+9SCbm/nh4VU+s3K8YvuWKBrikTXg==", "requires": { - "@ledgerhq/errors": "^5.12.0", - "@ledgerhq/hw-transport": "^5.12.0", - "@ledgerhq/logs": "^5.11.0", + "@ledgerhq/errors": "^5.13.1", + "@ledgerhq/hw-transport": "^5.13.1", + "@ledgerhq/logs": "^5.13.1", "u2f-api": "0.2.7" } }, "@ledgerhq/hw-transport-webusb": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-5.12.0.tgz", - "integrity": "sha512-ptuxioxcZPU8N6xmyP6PhuF86gHKxhRAxGe5oYd2Rb78b9V1lkPoaJRJlkLpm2Br/vXhzLyOM1RbVTEMN+2a6Q==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-5.13.1.tgz", + "integrity": "sha512-HMSddoZqcmKRxeGwbFf+PX1HY1UsRb9xF1Qq0M1xm6PHokiXFpgycfql+EpctcaRyZnEniCbvDzs6/i8RvEeQQ==", "requires": { - "@ledgerhq/devices": "^5.12.0", - "@ledgerhq/errors": "^5.12.0", - "@ledgerhq/hw-transport": "^5.12.0", - "@ledgerhq/logs": "^5.11.0" + "@ledgerhq/devices": "^5.13.1", + "@ledgerhq/errors": "^5.13.1", + "@ledgerhq/hw-transport": "^5.13.1", + "@ledgerhq/logs": "^5.13.1" } }, "@ledgerhq/logs": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.11.0.tgz", - "integrity": "sha512-NiFDdxLU/z1VGQy0/cbpv7UScMDQ/rU8SznqILSHYTnhK2xvvNFTUkd1W2mpmf9E/hzXFI0UAOieLQ44qovX3w==" + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.13.1.tgz", + "integrity": "sha512-ag2wX5VcAqPMKooCn/S6kKblVlsn74ixtagpwR+6GdFqYa/bspH8mWw+zwcdzSwa/wbOQRuY75zH52qBonfXBA==" }, "@types/babel__core": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.6.tgz", - "integrity": "sha512-tTnhWszAqvXnhW7m5jQU9PomXSiKXk2sFxpahXvI20SZKu9ylPi8WtIxueZ6ehDWikPT0jeFujMj3X4ZHuf3Tg==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.7.tgz", + "integrity": "sha512-RL62NqSFPCDK2FM1pSDH0scHpJvsXtZNiYlMB73DgPBaG1E38ZYVL+ei5EkWRbr+KC4YNiAUNBnRj+bgwpgjMw==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -471,9 +590,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.9.tgz", - "integrity": "sha512-jEFQ8L1tuvPjOI8lnpaf73oCJe+aoxL6ygqSy6c8LcW98zaC+4mzWuQIRCEvKeCOu+lbqdXcg4Uqmm1S8AP1tw==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.10.tgz", + "integrity": "sha512-74fNdUGrWsgIB/V9kTO5FGHPWYY6Eqn+3Z7L6Hc4e/BxjYV7puvBqp5HwsVYYfLm6iURYBNCx4Ut37OF9yitCw==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -518,44 +637,34 @@ } }, "@types/jest": { - "version": "23.3.9", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-23.3.9.tgz", - "integrity": "sha512-wNMwXSUcwyYajtbayfPp55tSayuDVU6PfY5gzvRSj80UvxdXEJOVPnUVajaOp7NgXLm+1e2ZDLULmpsU9vDvQw==", + "version": "23.3.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-23.3.14.tgz", + "integrity": "sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==", "dev": true }, "@types/node": { - "version": "13.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.1.tgz", - "integrity": "sha512-E6M6N0blf/jiZx8Q3nb0vNaswQeEyn0XlupO+xN6DtJ6r6IT4nXrTry7zhIfYvFCl3/8Cu6WIysmUBKiqV0bqQ==", + "version": "13.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.1.tgz", + "integrity": "sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g==", "dev": true }, "@types/node-fetch": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.5.tgz", - "integrity": "sha512-IWwjsyYjGw+em3xTvWVQi5MgYKbRs0du57klfTaZkv/B24AEQ/p/IopNeqIYNy3EsfHOpg8ieQSDomPcsYMHpA==", + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.6.tgz", + "integrity": "sha512-2w0NTwMWF1d3NJMK0Uiq2UNN8htVCyOWOD0jIPjPgC5Ph/YP4dVhs9YxxcMcuLuwAslz0dVEcZQUaqkLs3IzOQ==", "dev": true, "requires": { "@types/node": "*", "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } } }, "@types/ramda": { - "version": "0.25.46", - "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.25.46.tgz", - "integrity": "sha512-UiyHmzWu0KftAWZXfiUvwToVTHGhaG2fnWVckGwaic4By6YyGqtOpq7m8R3HLrpEsYH0AnRQjtXhdL8igmCuDw==" + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.27.3.tgz", + "integrity": "sha512-fUUQsx88sJksuZXh6p11Bl4m1IHwXCez1mgIcbZ7Z4PvUdOqx8rGsqP1zDkixrnMPvupXXrwV1/1/vJEGjSehA==", + "requires": { + "ts-toolbelt": "^6.3.3" + } }, "@types/stack-utils": { "version": "1.0.1", @@ -632,13 +741,6 @@ "integrity": "sha512-To1ya2WUpElVYhLZKK+knd2qXLQlaxd/rATUoguZJHKs7H+PxhbalrBESmQG9yNQYGcnvGv+DE2ZGUZpqDcPQw==", "requires": { "@waves/ts-types": "^0.2.0" - }, - "dependencies": { - "@waves/ts-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.2.0.tgz", - "integrity": "sha512-mJOovPtwTyFV6fgI+KKFJ8IeqWSTXdKPOwgcCX9vT7wwMNwiJS2dMboAW2acR8YLiPy7LzZ5t41JCxvGLU+ZSA==" - } } }, "@waves/parse-json-bignumber": { @@ -656,14 +758,14 @@ } }, "@waves/ts-types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.2.0.tgz", - "integrity": "sha512-mJOovPtwTyFV6fgI+KKFJ8IeqWSTXdKPOwgcCX9vT7wwMNwiJS2dMboAW2acR8YLiPy7LzZ5t41JCxvGLU+ZSA==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.2.2.tgz", + "integrity": "sha512-C6kc8co7JEbmLxof3TzYzadtWOIt7ePOz+NUaEW9uNi2qjKz7Z56s2fkJJ+vjJq0O88Lj7uI4gsNOQRwZenv6g==" }, "@waves/waves-transactions": { - "version": "3.25.1", - "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-3.25.1.tgz", - "integrity": "sha512-6kCIPzQChGeZSF/8XGeMOLqwFgUH5N1zj0khJ7iI9zAc8dhoxQvjrydAO6Fpne/F7Cl9OzHJ/hqYPy0K1z0FvA==", + "version": "3.25.3", + "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-3.25.3.tgz", + "integrity": "sha512-oj/pqwoNvkhHGqydajotn6uN9QsY0oOmuWXIkW8QSh68Duchy/q5MZkaRwVKl5VVjdTzVhNAxXJYLoi2h+8/Rg==", "requires": { "@waves/marshall": "^0.9.1", "@waves/ts-lib-crypto": "^1.4.3", @@ -687,9 +789,9 @@ "dev": true }, "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-globals": { @@ -700,6 +802,20 @@ "requires": { "acorn": "^6.0.1", "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "dev": true + } } }, "acorn-node": { @@ -711,26 +827,12 @@ "acorn": "^7.0.0", "acorn-walk": "^7.0.0", "xtend": "^4.0.2" - }, - "dependencies": { - "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", - "dev": true - }, - "acorn-walk": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", - "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", - "dev": true - } } }, "acorn-walk": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.0.tgz", - "integrity": "sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", + "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", "dev": true }, "ajv": { @@ -1017,9 +1119,9 @@ } }, "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -1269,12 +1371,12 @@ } }, "bs-logger": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.5.tgz", - "integrity": "sha512-uFLE0LFMxrH8Z5Hd9QgivvRbrl/NFkOTHzGhlqQxsnmx5JBLrp4bc249afLL+GccyY/8hkcGi2LpVaOzaEY0nQ==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, "requires": { - "fast-json-stable-stringify": "^2.0.0" + "fast-json-stable-stringify": "2.x" } }, "bser": { @@ -1344,9 +1446,9 @@ "dev": true }, "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "capture-exit": { @@ -1478,9 +1580,9 @@ } }, "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "component-emitter": { @@ -1666,10 +1768,9 @@ } }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { "ms": "2.0.0" } @@ -1884,9 +1985,9 @@ } }, "es-abstract": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", - "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -2016,6 +2117,15 @@ "to-regex": "^3.0.1" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -2155,9 +2265,9 @@ "dev": true }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "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 }, "fast-levenshtein": { @@ -2226,16 +2336,6 @@ "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "requires": { "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } } }, "for-in": { @@ -2251,13 +2351,13 @@ "dev": true }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -2277,9 +2377,9 @@ "dev": true }, "fsevents": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", - "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", + "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", "dev": true, "optional": true, "requires": { @@ -2330,7 +2430,7 @@ } }, "chownr": { - "version": "1.1.3", + "version": "1.1.4", "bundled": true, "dev": true, "optional": true @@ -2496,7 +2596,7 @@ } }, "minimist": { - "version": "0.0.8", + "version": "1.2.5", "bundled": true, "dev": true }, @@ -2519,11 +2619,11 @@ } }, "mkdirp": { - "version": "0.5.1", + "version": "0.5.3", "bundled": true, "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "ms": { @@ -2533,7 +2633,7 @@ "optional": true }, "needle": { - "version": "2.4.0", + "version": "2.3.3", "bundled": true, "dev": true, "optional": true, @@ -2562,7 +2662,7 @@ } }, "nopt": { - "version": "4.0.1", + "version": "4.0.3", "bundled": true, "dev": true, "optional": true, @@ -2583,17 +2683,17 @@ "npm-normalize-package-bin": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "npm-packlist": { - "version": "1.4.7", + "version": "1.4.8", "bundled": true, "dev": true, "optional": true, "requires": { "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" } }, "npmlog": { @@ -2671,18 +2771,10 @@ "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } } }, "readable-stream": { - "version": "2.3.6", + "version": "2.3.7", "bundled": true, "dev": true, "optional": true, @@ -2864,9 +2956,9 @@ } }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3011,9 +3103,9 @@ } }, "html-escaper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", - "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "htmlescape": { @@ -3081,9 +3173,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "inline-source-map": { @@ -3424,21 +3516,15 @@ } }, "jest": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", - "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz", + "integrity": "sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw==", "dev": true, "requires": { "import-local": "^2.0.0", - "jest-cli": "^24.8.0" + "jest-cli": "^24.9.0" }, "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "jest-cli": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", @@ -3458,195 +3544,7 @@ "prompts": "^2.0.1", "realpath-native": "^1.1.0", "yargs": "^13.3.0" - }, - "dependencies": { - "@jest/core": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz", - "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/reporters": "^24.9.0", - "@jest/test-result": "^24.9.0", - "@jest/transform": "^24.9.0", - "@jest/types": "^24.9.0", - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "graceful-fs": "^4.1.15", - "jest-changed-files": "^24.9.0", - "jest-config": "^24.9.0", - "jest-haste-map": "^24.9.0", - "jest-message-util": "^24.9.0", - "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.9.0", - "jest-resolve-dependencies": "^24.9.0", - "jest-runner": "^24.9.0", - "jest-runtime": "^24.9.0", - "jest-snapshot": "^24.9.0", - "jest-util": "^24.9.0", - "jest-validate": "^24.9.0", - "jest-watcher": "^24.9.0", - "micromatch": "^3.1.10", - "p-each-series": "^1.0.0", - "realpath-native": "^1.1.0", - "rimraf": "^2.5.4", - "slash": "^2.0.0", - "strip-ansi": "^5.0.0" - } - }, - "@jest/test-result": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.9.0.tgz", - "integrity": "sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==", - "dev": true, - "requires": { - "@jest/console": "^24.9.0", - "@jest/types": "^24.9.0", - "@types/istanbul-lib-coverage": "^2.0.0" - } - }, - "@jest/types": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", - "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^13.0.0" - } - }, - "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, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "jest-config": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.9.0.tgz", - "integrity": "sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^24.9.0", - "@jest/types": "^24.9.0", - "babel-jest": "^24.9.0", - "chalk": "^2.0.1", - "glob": "^7.1.1", - "jest-environment-jsdom": "^24.9.0", - "jest-environment-node": "^24.9.0", - "jest-get-type": "^24.9.0", - "jest-jasmine2": "^24.9.0", - "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.9.0", - "jest-util": "^24.9.0", - "jest-validate": "^24.9.0", - "micromatch": "^3.1.10", - "pretty-format": "^24.9.0", - "realpath-native": "^1.1.0" - } - }, - "jest-util": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.9.0.tgz", - "integrity": "sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg==", - "dev": true, - "requires": { - "@jest/console": "^24.9.0", - "@jest/fake-timers": "^24.9.0", - "@jest/source-map": "^24.9.0", - "@jest/test-result": "^24.9.0", - "@jest/types": "^24.9.0", - "callsites": "^3.0.0", - "chalk": "^2.0.1", - "graceful-fs": "^4.1.15", - "is-ci": "^2.0.0", - "mkdirp": "^0.5.1", - "slash": "^2.0.0", - "source-map": "^0.6.0" - } - }, - "jest-validate": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.9.0.tgz", - "integrity": "sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ==", - "dev": true, - "requires": { - "@jest/types": "^24.9.0", - "camelcase": "^5.3.1", - "chalk": "^2.0.1", - "jest-get-type": "^24.9.0", - "leven": "^3.1.0", - "pretty-format": "^24.9.0" - } - }, - "prompts": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.1.tgz", - "integrity": "sha512-qIP2lQyCwYbdzcqHIUi2HAxiWixhoM9OdLCWf8txXsapC/X9YdsCoeyRIXE/GP+Q0J37Q7+XN/MFqbUa7IzXNA==", - "dev": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.4" - } - }, - "realpath-native": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", - "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", - "dev": true, - "requires": { - "util.promisify": "^1.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.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": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - } } - }, - "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 } } }, @@ -4013,14 +3911,6 @@ "jest-get-type": "^24.9.0", "leven": "^3.1.0", "pretty-format": "^24.9.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } } }, "jest-watcher": { @@ -4158,9 +4048,9 @@ "dev": true }, "json5": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz", - "integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -4302,9 +4192,9 @@ } }, "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "makeerror": { @@ -4443,20 +4333,12 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "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": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "mkdirp-classic": { @@ -4743,9 +4625,9 @@ "dev": true }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -4953,10 +4835,20 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "prompts": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.2.tgz", + "integrity": "sha512-Q06uKs2CkNYVID0VqwfAl9mipo99zkBv/n2JtWY89Yxa3ZabWSrs0e2KTudKVa3peLUvYXMefDqIleLPVUBZMA==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.4" + } + }, "psl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", - "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, "public-encrypt": { @@ -5032,9 +4924,9 @@ } }, "react-is": { - "version": "16.13.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz", - "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==", + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, "read-only-stream": { @@ -5082,6 +4974,12 @@ "util-deprecate": "~1.0.1" }, "dependencies": { + "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 + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -5161,6 +5059,19 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + } } }, "request-promise-core": { @@ -5196,9 +5107,9 @@ "dev": true }, "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.0.tgz", + "integrity": "sha512-LarL/PIKJvc09k1jaeT4kQb/8/7P+qV4qSnN2K80AES+OHdfZELAKVOBjxsvtToT/uLOfFbvYvKfZmV8cee7nA==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -5257,17 +5168,17 @@ "dev": true }, "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "requires": { "tslib": "^1.9.0" } }, "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==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "safe-regex": { @@ -5309,9 +5220,9 @@ "dev": true }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "set-blocking": { @@ -5400,9 +5311,9 @@ "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "simple-concat": { @@ -5412,9 +5323,9 @@ "dev": true }, "sisteransi": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.4.tgz", - "integrity": "sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true }, "slash": { @@ -5439,6 +5350,15 @@ "use": "^3.1.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -5757,24 +5677,46 @@ "strip-ansi": "^5.1.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" } }, "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -5784,14 +5726,6 @@ "dev": true, "requires": { "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - } } }, "strip-ansi": { @@ -5981,9 +5915,9 @@ } }, "ts-jest": { - "version": "23.10.4", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-23.10.4.tgz", - "integrity": "sha512-oV/wBwGUS7olSk/9yWMiSIJWbz5xO4zhftnY3gwv6s4SMg6WHF1m8XZNBvQOKQRiTAexZ9754Z13dxBq3Zgssw==", + "version": "23.10.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-23.10.5.tgz", + "integrity": "sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A==", "dev": true, "requires": { "bs-logger": "0.x", @@ -5992,18 +5926,16 @@ "json5": "2.x", "make-error": "1.x", "mkdirp": "0.x", + "resolve": "1.x", "semver": "^5.5", "yargs-parser": "10.x" }, "dependencies": { - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true }, "yargs-parser": { "version": "10.1.0", @@ -6016,6 +5948,11 @@ } } }, + "ts-toolbelt": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-6.4.2.tgz", + "integrity": "sha512-B27axztBC+3K4D1cuaRO3ygMcyR54LRpQxlt1zNIS9RnqDwrlDoVlIIazDqWxLuRaFzGWNvDLkjDgs3eeLEVig==" + }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", @@ -6058,9 +5995,9 @@ "dev": true }, "typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", - "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, "u2f-api": { @@ -6069,21 +6006,12 @@ "integrity": "sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==" }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", "dev": true, "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "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 - } + "commander": "~2.20.3" } }, "umd": { @@ -6211,6 +6139,14 @@ "dev": true, "requires": { "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } } }, "util-deprecate": { @@ -6416,14 +6352,6 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } } } } diff --git a/src/utils.ts b/src/utils.ts index 8c80853..5d92006 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -141,7 +141,7 @@ function getMassTransferFee(tx: IMassTransferTransaction, config: IFe function getConfigProperty(type: number, propertyName: T, config: IFeeConfig): IFeeConfigItem[T] { const value = path(['calculate_fee_rules', type, propertyName], config) as IFeeConfigItem[T]; - return isEmpty(value) ? path(['calculate_fee_rules', 'default', propertyName], config) : value; + return isEmpty(value) ? path(['calculate_fee_rules', 'default', propertyName], config) : value as any; } export interface IFeeConfig { From cb9fd5bf144bf61ac1c6fd9a3583c72b34e5a147 Mon Sep 17 00:00:00 2001 From: vba2000 Date: Fri, 17 Apr 2020 11:47:16 +0300 Subject: [PATCH 03/12] 5.12.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d079a33..6fbf6c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.10.1", + "version": "5.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ac8d9c6..baaf8fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.10.1", + "version": "5.12.0", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From 78e004536d28f9ea52d4dea1a0b18a64d42f9e0b Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 12:44:26 +0300 Subject: [PATCH 04/12] added updateAssetInfo, new tx versions, edit tests, data tx null value --- src/adapters/LedgerAdapter.ts | 17 +-- src/adapters/PrivateKeyAdapter.ts | 41 ++++---- src/adapters/SeedAdapter.ts | 79 +++++++------- src/adapters/WavesKeeperAdapter.ts | 37 +++---- src/prepareTx/constants.ts | 25 +++-- src/prepareTx/fieldValidator.ts | 164 +++++++++++++++-------------- src/prepareTx/interfaces.ts | 16 ++- src/prepareTx/schemas.ts | 14 ++- src/utils.ts | 3 +- test/tests_WavesKeeperAdapter.ts | 12 ++- test/tests_currentFee.ts | 96 +++++++++++------ test/tests_validators.ts | 146 ++++++++++++------------- 12 files changed, 370 insertions(+), 280 deletions(-) diff --git a/src/adapters/LedgerAdapter.ts b/src/adapters/LedgerAdapter.ts index ef08620..465d73f 100644 --- a/src/adapters/LedgerAdapter.ts +++ b/src/adapters/LedgerAdapter.ts @@ -30,15 +30,15 @@ export class LedgerAdapter extends Adapter { public isAvailable() { return this._isMyLedger(); } - + public getSyncAddress(): string { return this._currentUser.address; } - + public getSyncPublicKey(): string { return this._currentUser.publicKey; } - + public getPublicKey() { return Promise.resolve(this._currentUser.publicKey); } @@ -77,11 +77,11 @@ export class LedgerAdapter extends Adapter { return this._isMyLedger() .then(() => LedgerAdapter._ledger.signSomeData(this._currentUser.id, bytes)); } - + public getEncodedSeed() { return Promise.reject(Error('Method "getEncodedSeed" is not available!')); } - + public getPrivateKey() { return Promise.reject('No private key'); } @@ -107,7 +107,8 @@ export class LedgerAdapter extends Adapter { [SIGN_TYPE.SET_SCRIPT]: [1], [SIGN_TYPE.SPONSORSHIP]: [1], [SIGN_TYPE.SET_ASSET_SCRIPT]: [1], - [SIGN_TYPE.SCRIPT_INVOCATION]: [1] + [SIGN_TYPE.SCRIPT_INVOCATION]: [1], + [SIGN_TYPE.UPDATE_ASSET_INFO]: [1], }; } @@ -120,11 +121,11 @@ export class LedgerAdapter extends Adapter { throw {error: 'Invalid ledger'}; } }); - + promise.catch((e: any) => { console.warn(e); }); - + return promise; } diff --git a/src/adapters/PrivateKeyAdapter.ts b/src/adapters/PrivateKeyAdapter.ts index d694579..f146de5 100644 --- a/src/adapters/PrivateKeyAdapter.ts +++ b/src/adapters/PrivateKeyAdapter.ts @@ -35,28 +35,29 @@ export class PrivateKeyAdapter extends Adapter { return { [SIGN_TYPE.AUTH]: [1], [SIGN_TYPE.MATCHER_ORDERS]: [1], - [SIGN_TYPE.WAVES_CONFIRMATION]: [1], [SIGN_TYPE.CREATE_ORDER]: [1, 2, 3], [SIGN_TYPE.CANCEL_ORDER]: [0, 1], [SIGN_TYPE.COINOMAT_CONFIRMATION]: [1], - [SIGN_TYPE.ISSUE]: [2], - [SIGN_TYPE.TRANSFER]: [2], - [SIGN_TYPE.REISSUE]: [2], - [SIGN_TYPE.BURN]: [2], - [SIGN_TYPE.EXCHANGE]: [0, 1, 2], - [SIGN_TYPE.LEASE]: [2], - [SIGN_TYPE.CANCEL_LEASING]: [2], - [SIGN_TYPE.CREATE_ALIAS]: [2], - [SIGN_TYPE.MASS_TRANSFER]: [1], - [SIGN_TYPE.DATA]: [1], - [SIGN_TYPE.SET_SCRIPT]: [1], - [SIGN_TYPE.SPONSORSHIP]: [1], - [SIGN_TYPE.SET_ASSET_SCRIPT]: [1], - [SIGN_TYPE.SCRIPT_INVOCATION]: [1], + [SIGN_TYPE.WAVES_CONFIRMATION]: [1], + [SIGN_TYPE.TRANSFER]: [2, 3], + [SIGN_TYPE.ISSUE]: [2, 3], + [SIGN_TYPE.REISSUE]: [2, 3], + [SIGN_TYPE.BURN]: [2, 3], + [SIGN_TYPE.EXCHANGE]: [0, 1, 2, 3], + [SIGN_TYPE.LEASE]: [2, 3], + [SIGN_TYPE.CANCEL_LEASING]: [2, 3], + [SIGN_TYPE.CREATE_ALIAS]: [2, 3], + [SIGN_TYPE.MASS_TRANSFER]: [1, 2], + [SIGN_TYPE.DATA]: [1, 2], + [SIGN_TYPE.SET_SCRIPT]: [1, 2], + [SIGN_TYPE.SPONSORSHIP]: [1, 2], + [SIGN_TYPE.SET_ASSET_SCRIPT]: [1, 2], + [SIGN_TYPE.SCRIPT_INVOCATION]: [1, 2], + [SIGN_TYPE.UPDATE_ASSET_INFO]: [1], }; } - - + + public getEncodedSeed() { return Promise.reject(Error('Method "getEncodedSeed" is not available!')); } @@ -64,15 +65,15 @@ export class PrivateKeyAdapter extends Adapter { public getSeed() { return Promise.reject(Error('Method "getSeed" is not available!')); } - + public getSyncAddress(): string { return this.address; } - + public getSyncPublicKey(): string { return this.publicKey; } - + public getPublicKey(): Promise { return Promise.resolve(this.publicKey); } diff --git a/src/adapters/SeedAdapter.ts b/src/adapters/SeedAdapter.ts index fd47e02..184152a 100644 --- a/src/adapters/SeedAdapter.ts +++ b/src/adapters/SeedAdapter.ts @@ -7,17 +7,17 @@ const Seed = seedUtils.Seed; const signWithPrivateKey = libs.crypto.signBytes; export class SeedAdapter extends Adapter { - + public isEncoded: boolean = false; private readonly encodedSeed: string | null = null; private seed: seedUtils.Seed; public static type = AdapterType.Seed; - - + + constructor(data: string | IUser, networkCode?: string | number) { super(networkCode); let seed; - + if (typeof data === 'string') { seed = data; } else { @@ -25,7 +25,7 @@ export class SeedAdapter extends Adapter { const encryptionRounds = user.encryptionRounds; seed = Seed.decryptSeedPhrase(user.encryptedSeed, user.password, encryptionRounds); } - + try { if (/^base58:/.test(seed)) { const encodedSeed = seed.replace('base58:', ''); @@ -44,12 +44,12 @@ export class SeedAdapter extends Adapter { } } catch (e) { } - + if (!this.encodedSeed) { this.encodedSeed = libs.crypto.base58Encode(libs.crypto.stringToBytes(seed as string)); } - - + + this.seed = { encrypt: (password: string, encryptionRounds?: number) => { return Seed.encryptSeedPhrase(`base58:${this.encodedSeed}`, password, encryptionRounds) @@ -61,13 +61,13 @@ export class SeedAdapter extends Adapter { }, phrase: typeof seed === 'string' ? seed : '', }; - + Object.freeze(this.seed.keyPair); Object.freeze(this.seed); - + this._isDestroyed = false; } - + public getSignVersions(): Record> { return { [SIGN_TYPE.AUTH]: [1], @@ -76,73 +76,74 @@ export class SeedAdapter extends Adapter { [SIGN_TYPE.CANCEL_ORDER]: [0, 1], [SIGN_TYPE.COINOMAT_CONFIRMATION]: [1], [SIGN_TYPE.WAVES_CONFIRMATION]: [1], - [SIGN_TYPE.ISSUE]: [2], - [SIGN_TYPE.TRANSFER]: [2], - [SIGN_TYPE.REISSUE]: [2], - [SIGN_TYPE.BURN]: [2], - [SIGN_TYPE.EXCHANGE]: [0, 1, 2], - [SIGN_TYPE.LEASE]: [2], - [SIGN_TYPE.CANCEL_LEASING]: [2], - [SIGN_TYPE.CREATE_ALIAS]: [2], - [SIGN_TYPE.MASS_TRANSFER]: [1], - [SIGN_TYPE.DATA]: [1], - [SIGN_TYPE.SET_SCRIPT]: [1], - [SIGN_TYPE.SPONSORSHIP]: [1], - [SIGN_TYPE.SET_ASSET_SCRIPT]: [1], - [SIGN_TYPE.SCRIPT_INVOCATION]: [1], + [SIGN_TYPE.TRANSFER]: [2, 3], + [SIGN_TYPE.ISSUE]: [2, 3], + [SIGN_TYPE.REISSUE]: [2, 3], + [SIGN_TYPE.BURN]: [2, 3], + [SIGN_TYPE.EXCHANGE]: [0, 1, 2, 3], + [SIGN_TYPE.LEASE]: [2, 3], + [SIGN_TYPE.CANCEL_LEASING]: [2, 3], + [SIGN_TYPE.CREATE_ALIAS]: [2, 3], + [SIGN_TYPE.MASS_TRANSFER]: [1, 2], + [SIGN_TYPE.DATA]: [1, 2], + [SIGN_TYPE.SET_SCRIPT]: [1, 2], + [SIGN_TYPE.SPONSORSHIP]: [1, 2], + [SIGN_TYPE.SET_ASSET_SCRIPT]: [1, 2], + [SIGN_TYPE.SCRIPT_INVOCATION]: [1, 2], + [SIGN_TYPE.UPDATE_ASSET_INFO]: [1] }; } - + public getEncodedSeed(): Promise { return Promise.resolve(this.encodedSeed as string); } - + public getSyncAddress(): string { return this.seed.address; } - + public getSyncPublicKey(): string { return this.seed.keyPair.publicKey; } - + public getPublicKey(): Promise { return Promise.resolve(this.seed.keyPair.publicKey); } - + public getPrivateKey(): Promise { return Promise.resolve(this.seed.keyPair.privateKey); } - + public getAddress(): Promise { return Promise.resolve(this.seed.address); } - + public getSeed(): Promise { return typeof this.seed.phrase === 'string' ? Promise.resolve(this.seed.phrase) : Promise.reject(this.seed.phrase); } - + public signRequest(bytes: Uint8Array): Promise { return this._sign(bytes); } - + public signTransaction(bytes: Uint8Array, amountPrecision: number): Promise { return this._sign(bytes); } - + public signOrder(bytes: Uint8Array, amountPrecision: number): Promise { return this._sign(bytes); } - + public signData(bytes: Uint8Array): Promise { return this._sign(bytes); } - + private _sign(bytes: Uint8Array): Promise { return Promise.resolve(signWithPrivateKey(this.seed.keyPair, bytes)); } - + public static isAvailable() { return Promise.resolve(true); } - + } diff --git a/src/adapters/WavesKeeperAdapter.ts b/src/adapters/WavesKeeperAdapter.ts index a98ccb4..ac13828 100644 --- a/src/adapters/WavesKeeperAdapter.ts +++ b/src/adapters/WavesKeeperAdapter.ts @@ -11,20 +11,21 @@ const DEFAULT_TX_VERSIONS = { [SIGN_TYPE.CANCEL_ORDER]: [1], [SIGN_TYPE.COINOMAT_CONFIRMATION]: [1], [SIGN_TYPE.WAVES_CONFIRMATION]: [1], - [SIGN_TYPE.ISSUE]: [2], - [SIGN_TYPE.TRANSFER]: [2], - [SIGN_TYPE.REISSUE]: [2], - [SIGN_TYPE.BURN]: [2], - [SIGN_TYPE.EXCHANGE]: [0,1,2], - [SIGN_TYPE.LEASE]: [2], - [SIGN_TYPE.CANCEL_LEASING]: [2], - [SIGN_TYPE.CREATE_ALIAS]: [2], - [SIGN_TYPE.MASS_TRANSFER]: [1], - [SIGN_TYPE.DATA]: [1], - [SIGN_TYPE.SET_SCRIPT]: [1], - [SIGN_TYPE.SPONSORSHIP]: [1], - [SIGN_TYPE.SET_ASSET_SCRIPT]: [1], - [SIGN_TYPE.SCRIPT_INVOCATION]: [1] + [SIGN_TYPE.TRANSFER]: [2, 3], + [SIGN_TYPE.ISSUE]: [2, 3], + [SIGN_TYPE.REISSUE]: [2, 3], + [SIGN_TYPE.BURN]: [2, 3], + [SIGN_TYPE.EXCHANGE]: [0, 1, 2, 3], + [SIGN_TYPE.LEASE]: [2, 3], + [SIGN_TYPE.CANCEL_LEASING]: [2, 3], + [SIGN_TYPE.CREATE_ALIAS]: [2, 3], + [SIGN_TYPE.MASS_TRANSFER]: [1, 2], + [SIGN_TYPE.DATA]: [1, 2], + [SIGN_TYPE.SET_SCRIPT]: [1, 2], + [SIGN_TYPE.SPONSORSHIP]: [1, 2], + [SIGN_TYPE.SET_ASSET_SCRIPT]: [1, 2], + [SIGN_TYPE.SCRIPT_INVOCATION]: [1, 2], + [SIGN_TYPE.UPDATE_ASSET_INFO]: [1] }; export class WavesKeeperAdapter extends Adapter { @@ -109,15 +110,15 @@ export class WavesKeeperAdapter extends Adapter { //@ts-ignore this._onDestoryCb.push(cb); } - + public getSyncAddress(): string { return this._address; } - + public getSyncPublicKey(): string { return this._pKey; } - + public getPublicKey() { return Promise.resolve(this._pKey); } @@ -142,7 +143,7 @@ export class WavesKeeperAdapter extends Adapter { if (signData && signData.type === 'customData') { return (await WavesKeeperAdapter._api.signCustomData(signData)).signature; } - + return await WavesKeeperAdapter._api.signRequest(WavesKeeperAdapter._serializedData(signData)); } diff --git a/src/prepareTx/constants.ts b/src/prepareTx/constants.ts index edcea53..3d02d49 100644 --- a/src/prepareTx/constants.ts +++ b/src/prepareTx/constants.ts @@ -36,6 +36,7 @@ export enum TRANSACTION_TYPE_NUMBER { SPONSORSHIP = 14, SET_ASSET_SCRIPT = 15, SCRIPT_INVOCATION = 16, + UPDATE_ASSET_INFO = 17, } export enum SIGN_TYPE { @@ -59,6 +60,7 @@ export enum SIGN_TYPE { SPONSORSHIP = 14, SET_ASSET_SCRIPT = 15, SCRIPT_INVOCATION = 16, + UPDATE_ASSET_INFO = 17, } export interface ITypesMap { @@ -71,7 +73,7 @@ const getCancelOrderBytes = (txData: any) => { const { orderId, id, senderPublicKey, sender } = txData; const pBytes = BASE58_STRING(senderPublicKey || sender); const orderIdBytes = BASE58_STRING(id || orderId); - + return Uint8Array.from([ ...Array.from(pBytes), ...Array.from(orderIdBytes), @@ -79,7 +81,7 @@ const getCancelOrderBytes = (txData: any) => { }; export const SIGN_TYPES: Record = { - + [SIGN_TYPE.AUTH]: { getBytes: { 1: (txData) => { @@ -87,7 +89,7 @@ export const SIGN_TYPES: Record = { const pBytes = LEN(SHORT)(STRING)('WavesWalletAuthentication'); const hostBytes = LEN(SHORT)(STRING)(host || ''); const dataBytes = LEN(SHORT)(STRING)(data || ''); - + return Uint8Array.from([ ...Array.from(pBytes), ...Array.from(hostBytes), @@ -103,7 +105,7 @@ export const SIGN_TYPES: Record = { const { timestamp, prefix } = txData; const pBytes = LEN(SHORT)(STRING)(prefix); const timestampBytes = LONG(timestamp); - + return Uint8Array.from([ ...Array.from(pBytes), ...Array.from(timestampBytes), @@ -118,7 +120,7 @@ export const SIGN_TYPES: Record = { const { timestamp, publicKey } = txData; const pBytes = BASE58_STRING(publicKey); const timestampBytes = LONG(timestamp); - + return Uint8Array.from([ ...Array.from(pBytes), ...Array.from(timestampBytes), @@ -133,7 +135,7 @@ export const SIGN_TYPES: Record = { const { timestamp, senderPublicKey } = txData; const pBytes = BASE58_STRING(senderPublicKey); const timestampBytes = LONG(timestamp); - + return Uint8Array.from([ ...Array.from(pBytes), ...Array.from(timestampBytes), @@ -171,7 +173,7 @@ export const SIGN_TYPES: Record = { }, [SIGN_TYPE.TRANSFER]: { getBytes: { - 2: binary.serializeTx, + 2: binary.serializeTx }, toNode: (data, networkByte: number) => (toNode({ ...data, @@ -214,6 +216,15 @@ export const SIGN_TYPES: Record = { }, adapter: 'signTransaction' }, + [SIGN_TYPE.UPDATE_ASSET_INFO]: { + getBytes: { + 1: binary.serializeTx, + }, + // toNode: data => { + // return toNode(data, wavesTransactions.updateAssetInfo); + // }, + adapter: 'signTransaction' + }, [SIGN_TYPE.EXCHANGE]: { getBytes: { 0: (data) => binary.serializeTx({ ...data, version: 1 }), diff --git a/src/prepareTx/fieldValidator.ts b/src/prepareTx/fieldValidator.ts index 85de402..cdf337a 100644 --- a/src/prepareTx/fieldValidator.ts +++ b/src/prepareTx/fieldValidator.ts @@ -41,23 +41,24 @@ export const ERROR_MSG = { EMPTY_BASE64: 'field can be not empty base64"', BASE58: 'field can be base58 string', PUB_KEY: 'field can be base58 publicKey', + NULL_VALUE: 'field is not null' }; export const isValidAddress = function (address: string, networkByte: number) { if (!address || typeof address !== 'string') { throw new Error('Missing or invalid address'); } - + let addressBytes = base58Decode(address); - + if (addressBytes[0] !== 1 || addressBytes[1] !== networkByte) { return false; } - + let key = addressBytes.slice(0, 22); let check = addressBytes.slice(22, 26); let keyHash = keccak(blake2b(key)).slice(0, 4); - + for (var i = 0; i < 4; i++) { if (check[i] !== keyHash[i]) { return false; @@ -89,7 +90,7 @@ const error = ({ value, ...options }: IFieldOptions, message: string) => { const required = (options: IFieldOptions) => { const { value, optional } = options; - + if (!optional && value == null) { error(options, ERROR_MSG.REQUIRED); } @@ -99,24 +100,24 @@ const string = (options: IFieldOptions) => { options = { ...options, value: numberToString(options.value) }; required(options); const { value, optional } = options; - + if ((!optional && value == null) && (value != null && typeof value !== 'string')) { return error(options, ERROR_MSG.WRONG_TYPE); } }; const attachment = (options: IFieldOptions) => { - + const { value } = options; - + if (value == null) { return; } - + if (typeof value === 'string' || typeof value === 'number') { - + string(options); - + switch (true) { case typeof value != 'string': error(options, ERROR_MSG.WRONG_TYPE); @@ -125,12 +126,12 @@ const attachment = (options: IFieldOptions) => { error(options, ERROR_MSG.LARGE_FIELD); break; } - + return; } - + if (typeof value === 'object') { - + switch (true) { case typeof value.length !== 'number' || value.length < 0: error(options, ERROR_MSG.WRONG_TYPE); @@ -139,17 +140,17 @@ const attachment = (options: IFieldOptions) => { error(options, ERROR_MSG.LARGE_FIELD); break; } - + return; } - + error(options, ERROR_MSG.WRONG_TYPE); }; const number = (options: IFieldOptions) => { required(options); const { value } = options; - + if (value != null && new BigNumber(value).isNaN()) { return error(options, ERROR_MSG.WRONG_NUMBER); } @@ -158,7 +159,7 @@ const number = (options: IFieldOptions) => { const boolean = (options: IFieldOptions) => { required(options); const { value } = options; - + if (value != null && typeof value !== 'boolean') { return error(options, ERROR_MSG.WRONG_BOOLEAN); } @@ -167,11 +168,11 @@ const boolean = (options: IFieldOptions) => { const money = (options: IFieldOptions) => { required(options); const { value } = options; - + if (value == null) { return; } - + switch (true) { case !(value instanceof Money): return error(options, ERROR_MSG.WRONG_TYPE); @@ -183,25 +184,25 @@ const money = (options: IFieldOptions) => { const numberLike = (options: IFieldOptions, min?: string | number, max?: string | number) => { required(options); const { value } = options; - + if (value == null) { return; } - + const checkInterval = (bigNumber: BigNumber) => { if (min != null) { if (bigNumber.lt(new BigNumber(min))) { error(options, ERROR_MSG.SMALL_FIELD); } } - + if (max != null) { if (bigNumber.gt(new BigNumber(max))) { error(options, ERROR_MSG.LARGE_FIELD); } } }; - + switch (true) { case value instanceof BigNumber: if ((value).isNaN()) { @@ -210,9 +211,9 @@ const numberLike = (options: IFieldOptions, min?: string | number, max?: string checkInterval(value); break; case value instanceof Money: - + const coins = (value).getCoins(); - + if (coins.isNaN()) { error(options, ERROR_MSG.WRONG_NUMBER); } @@ -228,15 +229,21 @@ const numberLike = (options: IFieldOptions, min?: string | number, max?: string } }; +const isNull = (options: IFieldOptions) => { + if (options.value !== null) { + error(options, ERROR_MSG.NULL_VALUE); + } +} + const aliasName = (options: IFieldOptions) => { options = { ...options, value: numberToString(options.value) }; required(options); const { value } = options; - + if (value == null) { return null; } - + switch (true) { case typeof value !== 'string': return error(options, ERROR_MSG.WRONG_TYPE); @@ -260,7 +267,7 @@ const address = (options: IFieldOptions) => { return false; } }; - + if (value == null) { return null; } @@ -288,24 +295,24 @@ const assetId = (options: IFieldOptions) => { options = { ...options, value: numberToString(options.value) }; required(options); const { value } = options; - + if (value == null) { return null; } - - + + if (typeof value !== 'string') { return error(options, ERROR_MSG.WRONG_TYPE); } - + let isAssetId = false; - + try { isAssetId = base58Decode(value.trim()).length === 32; } catch (e) { isAssetId = false; } - + if (!isAssetId && value !== 'WAVES') { return error(options, ERROR_MSG.WRONG_ASSET_ID); } @@ -314,7 +321,7 @@ const assetId = (options: IFieldOptions) => { const timestamp = (options: IFieldOptions) => { required(options); const { value } = options; - + if (isNaN(value) || value && !(value instanceof Date || typeof value === 'number' || +value)) { if (typeof value !== 'string' || isNaN(Date.parse(value as string))) { return error(options, ERROR_MSG.WRONG_TIMESTAMP); @@ -325,15 +332,15 @@ const timestamp = (options: IFieldOptions) => { const orderType = (options: IFieldOptions) => { required(options); const { value } = options; - + if (value == null) { return null; } - + if (typeof value !== 'string') { return error(options, ERROR_MSG.WRONG_TYPE); } - + if (value !== 'sell' && value !== 'buy') { return error(options, ERROR_MSG.WRONG_ORDER_TYPE); } @@ -343,18 +350,18 @@ const assetName = (options: IFieldOptions) => { options = { ...options, value: numberToString(options.value) }; required(options); const { value } = options; - + if (value != null) { if (typeof value !== 'string') { error(options, ERROR_MSG.WRONG_TYPE); } - + const bytesLength = getBytesFromString(value).length; - + if (bytesLength < ASSETS.NAME_MIN_BYTES) { error(options, ERROR_MSG.SMALL_FIELD); } - + if (bytesLength > ASSETS.NAME_MAX_BYTES) { error(options, ERROR_MSG.LARGE_FIELD); } @@ -365,12 +372,12 @@ const assetDescription = (options: IFieldOptions) => { options = { ...options, value: numberToString(options.value) }; required(options); const { value } = options; - + if (value != null) { if (typeof value !== 'string') { error(options, ERROR_MSG.WRONG_TYPE); } - + const bytesLength = getBytesFromString(value).length; if (bytesLength > ASSETS.DESCRIPTION_MAX_BYTES) { error(options, ERROR_MSG.LARGE_FIELD); @@ -386,7 +393,7 @@ const precision = (options: IFieldOptions) => { const httpsUrl = (options: IFieldOptions) => { required(options); const { value } = options; - + const isNotUrl = (url: string) => { try { new URL(url); @@ -395,11 +402,11 @@ const httpsUrl = (options: IFieldOptions) => { return true; } }; - + if (value == null) { return null; } - + switch (true) { case typeof value !== 'string': error(options, ERROR_MSG.WRONG_TYPE); @@ -410,32 +417,32 @@ const httpsUrl = (options: IFieldOptions) => { case isNotUrl(value): error(options, ERROR_MSG.NOT_HTTPS_URL); break; - + } }; const transfers = (options: IFieldOptions) => { required(options); const { value } = options; - + if (!Array.isArray(value)) { error(options, ERROR_MSG.WRONG_TYPE); } - + if (!options.optional && value.length === 0) { error(options, ERROR_MSG.REQUIRED); } - + //@ts-ignore const errors = (value || []).map(({ recipient, amount, name }, index) => { const dataErrors = []; - + try { numberLike({ ...options, value: amount, name: `${options.name}:${index}:amount`, optional: false }); } catch (e) { dataErrors.push(e); } - + try { aliasOrAddress({ ...options, @@ -446,11 +453,11 @@ const transfers = (options: IFieldOptions) => { } catch (e) { dataErrors.push(e); } - + return dataErrors; //@ts-ignore }).filter(item => item.length); - + if (errors.length) { error(options, errors); error(options, errors); @@ -473,7 +480,7 @@ const data = (options: IFieldOptions, noKey?: boolean) => { } } const itemOptions = { ...options, name: `${options.name}:${index}:value`, optional: false, value }; - + try { switch (type) { case 'integer': @@ -488,6 +495,9 @@ const data = (options: IFieldOptions, noKey?: boolean) => { case 'string': string(itemOptions); break; + case undefined: + isNull(itemOptions); + break; default: error({ ...options, value: key, name: `${options.name}:${index}:type` }, ERROR_MSG.WRONG_TYPE); } @@ -496,7 +506,7 @@ const data = (options: IFieldOptions, noKey?: boolean) => { } //@ts-ignore }).filter(item => item); - + if (errors.length) { error(options, errors); } @@ -504,11 +514,11 @@ const data = (options: IFieldOptions, noKey?: boolean) => { const binary = (options: IFieldOptions) => { const { value = '' } = options; - + if (value && !value.includes('base64:')) { error(options, ERROR_MSG.BASE64); } - + if (value && !isBase64(value.replace('base64:', ''))) { error(options, ERROR_MSG.BASE64); } @@ -516,9 +526,9 @@ const binary = (options: IFieldOptions) => { const publicKey = (options: IFieldOptions) => { required(options); - + const { value = '' } = options; - + if (!value || typeof value !== 'string') { error(options, ERROR_MSG.PUB_KEY); } @@ -528,11 +538,11 @@ const publicKey = (options: IFieldOptions) => { } catch (e) { error(options, ERROR_MSG.BASE58); } - + if (pk && pk.length === 32) { return void 0; } - + error(options, ERROR_MSG.PUB_KEY); }; @@ -543,11 +553,11 @@ const script = (options: IFieldOptions) => { const asset_script = (options: IFieldOptions) => { const { value } = options; - + if (!value || !value.replace('base64:', '')) { error(options, ERROR_MSG.EMPTY_BASE64); } - + script(options); }; @@ -557,11 +567,11 @@ const call = (options: IFieldOptions) => { if (value == null) { return; } - + if (!value || typeof value !== 'object') { error(options, ERROR_MSG.WRONG_TYPE); } - + const functionValue = { key: 'call.function', value: value.function, @@ -569,13 +579,13 @@ const call = (options: IFieldOptions) => { type: 'string', name: 'function' }; - + string(functionValue); - + if (value.function === '') { error(functionValue, ERROR_MSG.REQUIRED); } - + const argsValue = { key: 'call.args', value: value.args, @@ -583,7 +593,7 @@ const call = (options: IFieldOptions) => { type: 'args', name: 'args' }; - + if (argsValue.value) { data(argsValue, true); } @@ -592,23 +602,23 @@ const call = (options: IFieldOptions) => { const payment = (options: IFieldOptions) => { required(options); const { value } = options; - + if (typeof value !== 'object' || typeof value.length !== 'number' || !value.forEach) { error(options, ERROR_MSG.WRONG_TYPE); } - + const errors = (value || []).map((amount: any, index: number) => { const dataErrors = []; - + try { money({ ...options, value: amount, name: `${options.name}:${index}`, optional: false }); } catch (e) { dataErrors.push(e); } - + return dataErrors; }).filter((item: any) => item.length); - + if (errors.length) { error(options, errors); error(options, errors); diff --git a/src/prepareTx/interfaces.ts b/src/prepareTx/interfaces.ts index 6736a76..84fffa0 100644 --- a/src/prepareTx/interfaces.ts +++ b/src/prepareTx/interfaces.ts @@ -25,8 +25,9 @@ export type TSignData = IDataTxData | ISetScriptData | ISponsorshipData | - ISetAssetScriptData| - IScriptInvocationData; + ISetAssetScriptData | + IScriptInvocationData | + ISIgnUpdateAssetInfo; export interface ISignAuthData { data: IAuthData; @@ -73,6 +74,11 @@ export interface ISignBurn { type: SIGN_TYPE.BURN; } +export interface ISIgnUpdateAssetInfo { + data: IUpdateAssetInfo; + type: SIGN_TYPE.UPDATE_ASSET_INFO; +} + export interface ISignExchange { data: IExchange; type: SIGN_TYPE.EXCHANGE; @@ -214,6 +220,12 @@ export interface IBurn extends ICreateTxData { amount: string | BigNumber | Money; } +export interface IUpdateAssetInfo extends ICreateTxData { + assetId: string; + name: string; + description: string; +} + export interface IExchange extends ICreateTxData { buyOrder: IOrder; sellOrder: IOrder; diff --git a/src/prepareTx/schemas.ts b/src/prepareTx/schemas.ts index c37fd81..38a6130 100644 --- a/src/prepareTx/schemas.ts +++ b/src/prepareTx/schemas.ts @@ -105,6 +105,18 @@ export const getValidateSchema = (networkByte: number) => { //@ts-ignore fieldsType.timestamp()('timestamp', null, processors.timestamp), ], + [SIGN_TYPE.UPDATE_ASSET_INFO]: [ + fieldsType.number()('type', null, processors.addValue(() => SIGN_TYPE.UPDATE_ASSET_INFO), true), + fieldsType.string()('senderPublicKey', null, null, true), + fieldsType.number()('chainId', null, processors.addValue(() => networkByte), true), + //@ts-ignore + fieldsType.numberLike()('fee', null, processors.toBigNumber), + //@ts-ignore + fieldsType.timestamp()('timestamp', null, processors.timestamp), + fieldsType.asset()('assetId'), + fieldsType.assetName()('name'), + fieldsType.assetDescription()('description'), + ], [SIGN_TYPE.SPONSORSHIP]: [ fieldsType.string()('senderPublicKey', null, null, true), //@ts-ignore @@ -207,7 +219,7 @@ export const getValidateSchema = (networkByte: number) => { [SIGN_TYPE.SCRIPT_INVOCATION]: [ fieldsType.number()('type', null, processors.addValue(() => SIGN_TYPE.SCRIPT_INVOCATION), true), fieldsType.number()('version', null, processors.addValue(() => 1), true), - + fieldsType.string()('senderPublicKey', null, null, true), fieldsType.aliasOrAddress(networkByte)('dApp'), //@ts-ignore diff --git a/src/utils.ts b/src/utils.ts index 5d92006..e60baf1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -54,7 +54,8 @@ export const TRANSACTION_TYPE = { // TODO Remove after refactor ts-types lib SET_SCRIPT: 13 as 13, SPONSORSHIP: 14 as 14, SET_ASSET_SCRIPT: 15 as 15, - SCRIPT_INVOCATION: 16 as 16 + SCRIPT_INVOCATION: 16 as 16, + UPDATE_ASSET_INFO: 17 as 17, }; export function currentCreateOrderFactory(config: IFeeConfig, minOrderFee: BigNumber): (order: IExchangeTransactionOrder, hasMatcherScript?: boolean, smartAssetIdList?: Array) => BigNumber { diff --git a/test/tests_WavesKeeperAdapter.ts b/test/tests_WavesKeeperAdapter.ts index ced22bc..270be60 100644 --- a/test/tests_WavesKeeperAdapter.ts +++ b/test/tests_WavesKeeperAdapter.ts @@ -119,7 +119,8 @@ describe('WavesKeeper adapter test', () => { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: '' + attachment: '', + version: 2 } }; @@ -134,19 +135,20 @@ describe('WavesKeeper adapter test', () => { expect(e).toBe('Done'); } }); - + it('Test convert UInt8Array transfer', async () => { - + const data = { type: 4, data: { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: new Uint8Array([1,2,3,4]) + attachment: new Uint8Array([1,2,3,4]), + version: 2 } }; - + try { WavesKeeperAdapter.setApiExtension(keeperMock); const users = await WavesKeeperAdapter.getUserList(); diff --git a/test/tests_currentFee.ts b/test/tests_currentFee.ts index 63cc35e..0c10794 100644 --- a/test/tests_currentFee.ts +++ b/test/tests_currentFee.ts @@ -81,7 +81,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: true, @@ -95,7 +96,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: false, @@ -109,7 +111,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: true, @@ -126,7 +129,8 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true + reissuable: true, + version: 2 } }, hasScript: false, @@ -143,7 +147,8 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -158,7 +163,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -173,7 +179,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: false, @@ -188,7 +195,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -203,6 +211,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: false, @@ -217,6 +226,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: true, @@ -231,6 +241,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: true, @@ -244,7 +255,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address + recipient: seed.address, + version: 2 } }, hasScript: false, @@ -258,7 +270,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address + recipient: seed.address, + version: 2 } }, hasScript: true, @@ -271,7 +284,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id + leaseId: TEST_ASSET.id, + version: 2 } }, hasScript: false, @@ -284,7 +298,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id + leaseId: TEST_ASSET.id, + version: 2 } }, hasScript: true, @@ -297,7 +312,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: 'some' + alias: 'some', + version: 2 } }, hasScript: false, @@ -310,7 +326,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: '123123123123123123123123123343' + alias: '123123123123123123123123123343', + version: 2 } }, hasScript: true, @@ -328,7 +345,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -346,7 +364,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -364,7 +383,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -385,7 +405,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -406,7 +427,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -427,7 +449,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -451,7 +474,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -475,7 +499,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -499,7 +524,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -514,7 +540,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ] + ], + version: 1 } }, hasScript: false, @@ -529,7 +556,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ] + ], + version: 1 } }, hasScript: true, @@ -542,7 +570,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '' + script: '', + version: 1 } }, hasScript: false, @@ -555,7 +584,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '' + script: '', + version: 1 } }, hasScript: true, @@ -568,7 +598,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET) + minSponsoredAssetFee: new Money(1, TEST_ASSET), + version: 1 } }, hasScript: false, @@ -581,7 +612,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET) + minSponsoredAssetFee: new Money(1, TEST_ASSET), + version: 1 } }, hasScript: true, @@ -595,7 +627,8 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH' + script: 'base64:AQa3b8tH', + version: 1 } }, hasScript: false, @@ -609,7 +642,8 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH' + script: 'base64:AQa3b8tH', + version: 1 } }, hasScript: true, diff --git a/test/tests_validators.ts b/test/tests_validators.ts index 6cf4a90..bcb9eb9 100644 --- a/test/tests_validators.ts +++ b/test/tests_validators.ts @@ -25,15 +25,15 @@ const testAsset = new Asset({ }); describe('Check validators', () => { - + let adapter: SeedAdapter; - + beforeEach(() => { adapter = new SeedAdapter(testSeed); }); - + describe('check order validations', () => { - + const data = { matcherPublicKey: 'AHLRHBJYtxwqjCcBYnFWeDco8hGJicWYrFd5yM5bWmNh', orderType: 'sell', @@ -42,13 +42,13 @@ describe('Check validators', () => { matcherFee: Money.fromTokens('0.003', testAsset), expiration: Date.now(), }; - + it('valid order', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data } } as any; - + expect( (() => { const signable = adapter.makeSignable(signData); @@ -57,13 +57,13 @@ describe('Check validators', () => { })() ).toBe(true) }); - + it('invalid order type', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data, orderType: 'none' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -74,13 +74,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('orderType'); } }); - + it('invalid order amount', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data, amount: '10' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -92,54 +92,55 @@ describe('Check validators', () => { } }); }); - + describe('check transfer validations', () => { const data = { amount: Money.fromTokens(1, testAsset), fee: Money.fromTokens(0.0001, testAsset), recipient: 'send2', timestamp: Date.now(), + version: 2 }; - + it('valid transfer', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('valid transfer bytes', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, transfers: [2, 15, 40, 20] } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('valid transfer UInt8 bytes', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, transfers: new Uint8Array([2, 15, 40, 20]) } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('invalid transfer amount', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, amount: '' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -150,13 +151,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('amount'); } }); - + it('invalid transfer fee', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, fee: '' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -167,13 +168,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('fee'); } }); - + it('invalid transfer attachment', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, attachment: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -184,13 +185,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } }); - + it('invalid transfer recipient', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, recipient: '3Mz9N7YPfZPWGd4yYaX6H53Gcgrq6ifYiH7' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -201,13 +202,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_ADDRESS); } }); - + it('invalid transfer timestamp', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, timestamp: '3Mz9N7YPfZPWGd4yYaX6H53Gcgrq6ifYiH7' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -219,34 +220,35 @@ describe('Check validators', () => { } }); }); - + describe('check mass-transfer validations', () => { - + const data = { amount: Money.fromTokens(1, testAsset), fee: Money.fromTokens(0.0001, testAsset), transfers: [{ amount: '1', recipient: 'test1' }], totalAmount: new Money(1, testAsset), timestamp: Date.now(), + version: 1 }; - + it('valid mass transfer', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data } } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true) }); - + it('mass transfer invalid transfers required', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data, transfers: null } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -257,13 +259,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.REQUIRED); } }); - + it('mass transfer invalid transfers type', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data, transfers: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -274,7 +276,7 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } }); - + it('mass transfer invalid transfers address and amount', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, @@ -285,7 +287,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -293,23 +295,23 @@ describe('Check validators', () => { const e = getError(error); expect(e.length).toEqual(1); expect(e[0].field).toEqual('transfers'); - + expect(e[0].message.length).toEqual(2); expect(e[0].message[0].length).toEqual(2); expect(e[0].message[0][0].field).toEqual('transfers:0:amount'); expect(e[0].message[0][0].message).toEqual(ERROR_MSG.WRONG_NUMBER); expect(e[0].message[0][1].field).toEqual('transfers:0:recipient'); expect(e[0].message[0][1].message).toEqual(ERROR_MSG.SMALL_FIELD); - + expect(e[0].message[1].length).toEqual(1); expect(e[0].message[1][0].field).toEqual('transfers:1:recipient'); expect(e[0].message[1][0].message).toEqual(ERROR_MSG.WRONG_ADDRESS); } }); }); - + describe('check issure validations', () => { - + const data = { name: 'test', fee: Money.fromTokens(1, testAsset), @@ -317,37 +319,38 @@ describe('Check validators', () => { quantity: 100000, precision: 7, reissuable: true, + version: 2 }; - + it('issure no script valid', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data } } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true); }); - + it('issure has script valid', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data }, script: 'base64:AbCd' } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true); }); - + it('issure invalid name', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, name: 'P' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -357,12 +360,12 @@ describe('Check validators', () => { expect(e[0].field).toEqual('name'); expect(e[0].message).toEqual(ERROR_MSG.SMALL_FIELD); } - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, name: 'японамама' } } as any; - + try { adapter.makeSignable(signData2); } catch (error) { @@ -372,13 +375,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.LARGE_FIELD); } }); - + it('issure invalid description', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, description: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -388,14 +391,14 @@ describe('Check validators', () => { expect(e[0].field).toEqual('description'); expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } - + const desc = (new Array(1002).join('T')); - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, description: desc } } as any; - + try { adapter.makeSignable(signData2); expect('Fail').toBe('Done'); @@ -406,13 +409,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.LARGE_FIELD); } }); - + it('issure invalid precision', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, precision: -1 } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -422,12 +425,12 @@ describe('Check validators', () => { expect(e[0].field).toEqual('precision'); expect(e[0].message).toEqual(ERROR_MSG.SMALL_FIELD); } - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, precision: '10' } } as any; - + try { adapter.makeSignable(signData2); expect('Fail').toBe('Done'); @@ -439,9 +442,9 @@ describe('Check validators', () => { } }); }); - + describe('check data validations', () => { - + const data = { fee: Money.fromTokens(0.003, testAsset), data: [ @@ -450,25 +453,26 @@ describe('Check validators', () => { { key: 'integer', value: '20', type: 'integer' }, { key: 'boolean', value: false, type: 'boolean' }, ], + version: 1 }; - + it('valid data', () => { const signData = { type: SIGN_TYPE.DATA, data: { ...data } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('invalid data', () => { const signData = { type: SIGN_TYPE.DATA, data: { ...data, data: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -479,7 +483,7 @@ describe('Check validators', () => { expect(e[0].field).toEqual('data'); } }); - + it('invalid data binary', () => { const signData = { type: SIGN_TYPE.DATA, @@ -489,7 +493,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -500,7 +504,7 @@ describe('Check validators', () => { expect(e[0].message[0].field).toEqual('data:0:value'); } }); - + it('invalid data binary no base64', () => { const signData = { type: SIGN_TYPE.DATA, @@ -510,7 +514,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -521,7 +525,7 @@ describe('Check validators', () => { expect(e[0].message[0].field).toEqual('data:0:value'); } }); - + it('invalid data type', () => { const signData = { type: SIGN_TYPE.DATA, @@ -531,7 +535,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData).getBytes().catch(e => { }); @@ -544,5 +548,5 @@ describe('Check validators', () => { } }); }); - + }); From f76ac64581413854f8e4617be913b7585afa1395 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 14:40:41 +0300 Subject: [PATCH 05/12] revert tests --- test/tests_WavesKeeperAdapter.ts | 12 ++- test/tests_currentFee.ts | 96 +++++++------------- test/tests_validators.ts | 146 +++++++++++++++---------------- 3 files changed, 107 insertions(+), 147 deletions(-) diff --git a/test/tests_WavesKeeperAdapter.ts b/test/tests_WavesKeeperAdapter.ts index 270be60..ced22bc 100644 --- a/test/tests_WavesKeeperAdapter.ts +++ b/test/tests_WavesKeeperAdapter.ts @@ -119,8 +119,7 @@ describe('WavesKeeper adapter test', () => { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: '', - version: 2 + attachment: '' } }; @@ -135,20 +134,19 @@ describe('WavesKeeper adapter test', () => { expect(e).toBe('Done'); } }); - + it('Test convert UInt8Array transfer', async () => { - + const data = { type: 4, data: { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: new Uint8Array([1,2,3,4]), - version: 2 + attachment: new Uint8Array([1,2,3,4]) } }; - + try { WavesKeeperAdapter.setApiExtension(keeperMock); const users = await WavesKeeperAdapter.getUserList(); diff --git a/test/tests_currentFee.ts b/test/tests_currentFee.ts index 0c10794..63cc35e 100644 --- a/test/tests_currentFee.ts +++ b/test/tests_currentFee.ts @@ -81,8 +81,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET), - version: 2 + amount: new Money(1, TEST_ASSET) } }, hasScript: true, @@ -96,8 +95,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET), - version: 2 + amount: new Money(1, TEST_ASSET) } }, hasScript: false, @@ -111,8 +109,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET), - version: 2 + amount: new Money(1, TEST_ASSET) } }, hasScript: true, @@ -129,8 +126,7 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true, - version: 2 + reissuable: true } }, hasScript: false, @@ -147,8 +143,7 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true, - version: 2 + reissuable: true } }, hasScript: true, @@ -163,8 +158,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true, - version: 2 + reissuable: true } }, hasScript: true, @@ -179,8 +173,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true, - version: 2 + reissuable: true } }, hasScript: false, @@ -195,8 +188,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true, - version: 2 + reissuable: true } }, hasScript: true, @@ -211,7 +203,6 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - version: 2 } }, hasScript: false, @@ -226,7 +217,6 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - version: 2 } }, hasScript: true, @@ -241,7 +231,6 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - version: 2 } }, hasScript: true, @@ -255,8 +244,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address, - version: 2 + recipient: seed.address } }, hasScript: false, @@ -270,8 +258,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address, - version: 2 + recipient: seed.address } }, hasScript: true, @@ -284,8 +271,7 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id, - version: 2 + leaseId: TEST_ASSET.id } }, hasScript: false, @@ -298,8 +284,7 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id, - version: 2 + leaseId: TEST_ASSET.id } }, hasScript: true, @@ -312,8 +297,7 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: 'some', - version: 2 + alias: 'some' } }, hasScript: false, @@ -326,8 +310,7 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: '123123123123123123123123123343', - version: 2 + alias: '123123123123123123123123123343' } }, hasScript: true, @@ -345,8 +328,7 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -364,8 +346,7 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -383,8 +364,7 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: true, @@ -405,8 +385,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -427,8 +406,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -449,8 +427,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: true, @@ -474,8 +451,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -499,8 +475,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: false, @@ -524,8 +499,7 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }], - version: 1 + }] } }, hasScript: true, @@ -540,8 +514,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ], - version: 1 + ] } }, hasScript: false, @@ -556,8 +529,7 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ], - version: 1 + ] } }, hasScript: true, @@ -570,8 +542,7 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '', - version: 1 + script: '' } }, hasScript: false, @@ -584,8 +555,7 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '', - version: 1 + script: '' } }, hasScript: true, @@ -598,8 +568,7 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET), - version: 1 + minSponsoredAssetFee: new Money(1, TEST_ASSET) } }, hasScript: false, @@ -612,8 +581,7 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET), - version: 1 + minSponsoredAssetFee: new Money(1, TEST_ASSET) } }, hasScript: true, @@ -627,8 +595,7 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH', - version: 1 + script: 'base64:AQa3b8tH' } }, hasScript: false, @@ -642,8 +609,7 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH', - version: 1 + script: 'base64:AQa3b8tH' } }, hasScript: true, diff --git a/test/tests_validators.ts b/test/tests_validators.ts index bcb9eb9..6cf4a90 100644 --- a/test/tests_validators.ts +++ b/test/tests_validators.ts @@ -25,15 +25,15 @@ const testAsset = new Asset({ }); describe('Check validators', () => { - + let adapter: SeedAdapter; - + beforeEach(() => { adapter = new SeedAdapter(testSeed); }); - + describe('check order validations', () => { - + const data = { matcherPublicKey: 'AHLRHBJYtxwqjCcBYnFWeDco8hGJicWYrFd5yM5bWmNh', orderType: 'sell', @@ -42,13 +42,13 @@ describe('Check validators', () => { matcherFee: Money.fromTokens('0.003', testAsset), expiration: Date.now(), }; - + it('valid order', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data } } as any; - + expect( (() => { const signable = adapter.makeSignable(signData); @@ -57,13 +57,13 @@ describe('Check validators', () => { })() ).toBe(true) }); - + it('invalid order type', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data, orderType: 'none' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -74,13 +74,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('orderType'); } }); - + it('invalid order amount', () => { const signData = { type: SIGN_TYPE.CREATE_ORDER, data: { ...data, amount: '10' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -92,55 +92,54 @@ describe('Check validators', () => { } }); }); - + describe('check transfer validations', () => { const data = { amount: Money.fromTokens(1, testAsset), fee: Money.fromTokens(0.0001, testAsset), recipient: 'send2', timestamp: Date.now(), - version: 2 }; - + it('valid transfer', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('valid transfer bytes', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, transfers: [2, 15, 40, 20] } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('valid transfer UInt8 bytes', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, transfers: new Uint8Array([2, 15, 40, 20]) } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('invalid transfer amount', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, amount: '' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -151,13 +150,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('amount'); } }); - + it('invalid transfer fee', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, fee: '' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -168,13 +167,13 @@ describe('Check validators', () => { expect(e[0].field).toEqual('fee'); } }); - + it('invalid transfer attachment', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, attachment: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -185,13 +184,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } }); - + it('invalid transfer recipient', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, recipient: '3Mz9N7YPfZPWGd4yYaX6H53Gcgrq6ifYiH7' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -202,13 +201,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_ADDRESS); } }); - + it('invalid transfer timestamp', () => { const signData = { type: SIGN_TYPE.TRANSFER, data: { ...data, timestamp: '3Mz9N7YPfZPWGd4yYaX6H53Gcgrq6ifYiH7' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -220,35 +219,34 @@ describe('Check validators', () => { } }); }); - + describe('check mass-transfer validations', () => { - + const data = { amount: Money.fromTokens(1, testAsset), fee: Money.fromTokens(0.0001, testAsset), transfers: [{ amount: '1', recipient: 'test1' }], totalAmount: new Money(1, testAsset), timestamp: Date.now(), - version: 1 }; - + it('valid mass transfer', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data } } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true) }); - + it('mass transfer invalid transfers required', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data, transfers: null } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -259,13 +257,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.REQUIRED); } }); - + it('mass transfer invalid transfers type', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, data: { ...data, transfers: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -276,7 +274,7 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } }); - + it('mass transfer invalid transfers address and amount', () => { const signData = { type: SIGN_TYPE.MASS_TRANSFER, @@ -287,7 +285,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -295,23 +293,23 @@ describe('Check validators', () => { const e = getError(error); expect(e.length).toEqual(1); expect(e[0].field).toEqual('transfers'); - + expect(e[0].message.length).toEqual(2); expect(e[0].message[0].length).toEqual(2); expect(e[0].message[0][0].field).toEqual('transfers:0:amount'); expect(e[0].message[0][0].message).toEqual(ERROR_MSG.WRONG_NUMBER); expect(e[0].message[0][1].field).toEqual('transfers:0:recipient'); expect(e[0].message[0][1].message).toEqual(ERROR_MSG.SMALL_FIELD); - + expect(e[0].message[1].length).toEqual(1); expect(e[0].message[1][0].field).toEqual('transfers:1:recipient'); expect(e[0].message[1][0].message).toEqual(ERROR_MSG.WRONG_ADDRESS); } }); }); - + describe('check issure validations', () => { - + const data = { name: 'test', fee: Money.fromTokens(1, testAsset), @@ -319,38 +317,37 @@ describe('Check validators', () => { quantity: 100000, precision: 7, reissuable: true, - version: 2 }; - + it('issure no script valid', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data } } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true); }); - + it('issure has script valid', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data }, script: 'base64:AbCd' } as any; - + expect( (() => !!adapter.makeSignable(signData))() ).toBe(true); }); - + it('issure invalid name', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, name: 'P' } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -360,12 +357,12 @@ describe('Check validators', () => { expect(e[0].field).toEqual('name'); expect(e[0].message).toEqual(ERROR_MSG.SMALL_FIELD); } - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, name: 'японамама' } } as any; - + try { adapter.makeSignable(signData2); } catch (error) { @@ -375,13 +372,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.LARGE_FIELD); } }); - + it('issure invalid description', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, description: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -391,14 +388,14 @@ describe('Check validators', () => { expect(e[0].field).toEqual('description'); expect(e[0].message).toEqual(ERROR_MSG.WRONG_TYPE); } - + const desc = (new Array(1002).join('T')); - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, description: desc } } as any; - + try { adapter.makeSignable(signData2); expect('Fail').toBe('Done'); @@ -409,13 +406,13 @@ describe('Check validators', () => { expect(e[0].message).toEqual(ERROR_MSG.LARGE_FIELD); } }); - + it('issure invalid precision', () => { const signData = { type: SIGN_TYPE.ISSUE, data: { ...data, precision: -1 } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -425,12 +422,12 @@ describe('Check validators', () => { expect(e[0].field).toEqual('precision'); expect(e[0].message).toEqual(ERROR_MSG.SMALL_FIELD); } - + const signData2 = { type: SIGN_TYPE.ISSUE, data: { ...data, precision: '10' } } as any; - + try { adapter.makeSignable(signData2); expect('Fail').toBe('Done'); @@ -442,9 +439,9 @@ describe('Check validators', () => { } }); }); - + describe('check data validations', () => { - + const data = { fee: Money.fromTokens(0.003, testAsset), data: [ @@ -453,26 +450,25 @@ describe('Check validators', () => { { key: 'integer', value: '20', type: 'integer' }, { key: 'boolean', value: false, type: 'boolean' }, ], - version: 1 }; - + it('valid data', () => { const signData = { type: SIGN_TYPE.DATA, data: { ...data } } as any; - + expect( (() => (!!adapter.makeSignable(signData)))() ).toBe(true) }); - + it('invalid data', () => { const signData = { type: SIGN_TYPE.DATA, data: { ...data, data: {} } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -483,7 +479,7 @@ describe('Check validators', () => { expect(e[0].field).toEqual('data'); } }); - + it('invalid data binary', () => { const signData = { type: SIGN_TYPE.DATA, @@ -493,7 +489,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -504,7 +500,7 @@ describe('Check validators', () => { expect(e[0].message[0].field).toEqual('data:0:value'); } }); - + it('invalid data binary no base64', () => { const signData = { type: SIGN_TYPE.DATA, @@ -514,7 +510,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData); expect('Fail').toBe('Done'); @@ -525,7 +521,7 @@ describe('Check validators', () => { expect(e[0].message[0].field).toEqual('data:0:value'); } }); - + it('invalid data type', () => { const signData = { type: SIGN_TYPE.DATA, @@ -535,7 +531,7 @@ describe('Check validators', () => { ] } } as any; - + try { adapter.makeSignable(signData).getBytes().catch(e => { }); @@ -548,5 +544,5 @@ describe('Check validators', () => { } }); }); - + }); From 6b59931c8a23230474d18c80f2cf93a4a70d041b Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 15:44:48 +0300 Subject: [PATCH 06/12] added new types serialize --- src/prepareTx/constants.ts | 16 +++++- test/tests_WavesKeeperAdapter.ts | 12 ++-- test/tests_currentFee.ts | 96 +++++++++++++++++++++----------- 3 files changed, 87 insertions(+), 37 deletions(-) diff --git a/src/prepareTx/constants.ts b/src/prepareTx/constants.ts index 3d02d49..5bf2ca4 100644 --- a/src/prepareTx/constants.ts +++ b/src/prepareTx/constants.ts @@ -173,7 +173,8 @@ export const SIGN_TYPES: Record = { }, [SIGN_TYPE.TRANSFER]: { getBytes: { - 2: binary.serializeTx + 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: (data, networkByte: number) => (toNode({ ...data, @@ -185,6 +186,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.ISSUE]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => toNode( { @@ -199,6 +201,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.REISSUE]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => { const quantity = data.amount || data.quantity; @@ -209,6 +212,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.BURN]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => { const quantity = data.amount || data.quantity; @@ -230,6 +234,7 @@ export const SIGN_TYPES: Record = { 0: (data) => binary.serializeTx({ ...data, version: 1 }), 1: binary.serializeTx, 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => { const tx = toNode(data); @@ -246,6 +251,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.LEASE]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: (data, networkByte: number) => (toNode({ ...data, @@ -256,6 +262,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.CANCEL_LEASING]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => toNode(data, wavesTransactions.cancelLease), adapter: 'signTransaction' @@ -263,6 +270,7 @@ export const SIGN_TYPES: Record = { [SIGN_TYPE.CREATE_ALIAS]: { getBytes: { 2: binary.serializeTx, + 3: binary.serializeTx, }, toNode: data => ({ ...toNode(data, wavesTransactions.alias), chainId: data.chainId }), adapter: 'signTransaction' @@ -271,6 +279,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: (data, networkByte: number) => (toNode({ ...data, @@ -287,6 +296,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: data => toNode(data, wavesTransactions.data), adapter: 'signTransaction' @@ -295,6 +305,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: data => toNode( { @@ -309,6 +320,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: data => toNode(data, wavesTransactions.sponsorship), adapter: 'signTransaction' @@ -317,6 +329,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: data => toNode({ ...data, @@ -330,6 +343,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: binary.serializeTx, }, toNode: (data, networkByte: number) => (toNode({ ...data, diff --git a/test/tests_WavesKeeperAdapter.ts b/test/tests_WavesKeeperAdapter.ts index ced22bc..270be60 100644 --- a/test/tests_WavesKeeperAdapter.ts +++ b/test/tests_WavesKeeperAdapter.ts @@ -119,7 +119,8 @@ describe('WavesKeeper adapter test', () => { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: '' + attachment: '', + version: 2 } }; @@ -134,19 +135,20 @@ describe('WavesKeeper adapter test', () => { expect(e).toBe('Done'); } }); - + it('Test convert UInt8Array transfer', async () => { - + const data = { type: 4, data: { fee: new Money(0.1, testAsset), amount: new Money(1, testAsset), recipient: 'test', - attachment: new Uint8Array([1,2,3,4]) + attachment: new Uint8Array([1,2,3,4]), + version: 2 } }; - + try { WavesKeeperAdapter.setApiExtension(keeperMock); const users = await WavesKeeperAdapter.getUserList(); diff --git a/test/tests_currentFee.ts b/test/tests_currentFee.ts index 63cc35e..0c10794 100644 --- a/test/tests_currentFee.ts +++ b/test/tests_currentFee.ts @@ -81,7 +81,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: true, @@ -95,7 +96,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: false, @@ -109,7 +111,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), recipient: seed.address, - amount: new Money(1, TEST_ASSET) + amount: new Money(1, TEST_ASSET), + version: 2 } }, hasScript: true, @@ -126,7 +129,8 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true + reissuable: true, + version: 2 } }, hasScript: false, @@ -143,7 +147,8 @@ const TEST_LIST: Array = [ description: 'My asset description', quantity: new BigNumber(500), precision: 1, - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -158,7 +163,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -173,7 +179,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: false, @@ -188,7 +195,8 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules['5'].fee, WAVES_ASSET), quantity: new BigNumber(500), - reissuable: true + reissuable: true, + version: 2 } }, hasScript: true, @@ -203,6 +211,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: false, @@ -217,6 +226,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: true, @@ -231,6 +241,7 @@ const TEST_LIST: Array = [ assetId: TEST_ASSET.id, fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), + version: 2 } }, hasScript: true, @@ -244,7 +255,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address + recipient: seed.address, + version: 2 } }, hasScript: false, @@ -258,7 +270,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), amount: new BigNumber(500), - recipient: seed.address + recipient: seed.address, + version: 2 } }, hasScript: true, @@ -271,7 +284,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id + leaseId: TEST_ASSET.id, + version: 2 } }, hasScript: false, @@ -284,7 +298,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - leaseId: TEST_ASSET.id + leaseId: TEST_ASSET.id, + version: 2 } }, hasScript: true, @@ -297,7 +312,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: 'some' + alias: 'some', + version: 2 } }, hasScript: false, @@ -310,7 +326,8 @@ const TEST_LIST: Array = [ data: { timestamp: Date.now(), fee: new Money(CONFIG.calculate_fee_rules.default.fee, WAVES_ASSET), - alias: '123123123123123123123123123343' + alias: '123123123123123123123123123343', + version: 2 } }, hasScript: true, @@ -328,7 +345,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -346,7 +364,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -364,7 +383,8 @@ const TEST_LIST: Array = [ transfers: [{ amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -385,7 +405,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -406,7 +427,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -427,7 +449,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -451,7 +474,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -475,7 +499,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: false, @@ -499,7 +524,8 @@ const TEST_LIST: Array = [ }, { amount: 1, recipient: seed.address - }] + }], + version: 1 } }, hasScript: true, @@ -514,7 +540,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ] + ], + version: 1 } }, hasScript: false, @@ -529,7 +556,8 @@ const TEST_LIST: Array = [ timestamp: Date.now(), data: [ { key: 'test', type: 'string', value: '123' } - ] + ], + version: 1 } }, hasScript: true, @@ -542,7 +570,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '' + script: '', + version: 1 } }, hasScript: false, @@ -555,7 +584,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - script: '' + script: '', + version: 1 } }, hasScript: true, @@ -568,7 +598,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET) + minSponsoredAssetFee: new Money(1, TEST_ASSET), + version: 1 } }, hasScript: false, @@ -581,7 +612,8 @@ const TEST_LIST: Array = [ data: { fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), - minSponsoredAssetFee: new Money(1, TEST_ASSET) + minSponsoredAssetFee: new Money(1, TEST_ASSET), + version: 1 } }, hasScript: true, @@ -595,7 +627,8 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH' + script: 'base64:AQa3b8tH', + version: 1 } }, hasScript: false, @@ -609,7 +642,8 @@ const TEST_LIST: Array = [ fee: new Money(1, WAVES_ASSET), timestamp: Date.now(), assetId: TEST_ASSET.id, - script: 'base64:AQa3b8tH' + script: 'base64:AQa3b8tH', + version: 1 } }, hasScript: true, From b4110b4894788350d93c7ce13cc9a1a04799cba3 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 15:49:21 +0300 Subject: [PATCH 07/12] current version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index baaf8fa..ec26dc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0", + "version": "5.12.0-beta.2", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From e0674237b427b2dc449c3a1eaa3172d8fba65afd Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 15:57:28 +0300 Subject: [PATCH 08/12] version up --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec26dc5..f357bb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0-beta.2", + "version": "5.12.0-beta.3", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From 98ac3fca99e49d87747f83805d1b32596a9deaf0 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 16:25:57 +0300 Subject: [PATCH 09/12] 6.0.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fbf6c1..3176fcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0", + "version": "6.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f357bb3..f77d9b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0-beta.3", + "version": "6.0.0", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From 7795b76fb4c207ed87c882811e41fff12f3b26ae Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 16:50:54 +0300 Subject: [PATCH 10/12] 6.0.0-beta.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fbf6c1..6fb02d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0", + "version": "6.0.0-beta.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f357bb3..b893436 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0-beta.3", + "version": "6.0.0-beta.1", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From 13aaa6a966c32341376ae6a36d203a3ab86721c8 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 16:53:13 +0300 Subject: [PATCH 11/12] down version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f77d9b1..f357bb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "6.0.0", + "version": "5.12.0-beta.3", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT", From 788455354a188fc643980a2bc4c8ad740a5e4140 Mon Sep 17 00:00:00 2001 From: Max Axenov Date: Wed, 5 Aug 2020 16:54:35 +0300 Subject: [PATCH 12/12] 6.0.0-beta.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fbf6c1..6fb02d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0", + "version": "6.0.0-beta.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f357bb3..b893436 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/signature-adapter", - "version": "5.12.0-beta.3", + "version": "6.0.0-beta.1", "types": "dist/index.d.ts", "main": "dist/index.js", "license": "MIT",