From 8dde61df987c3c093953aa41abf3e8c4987327f2 Mon Sep 17 00:00:00 2001 From: nazhmik Date: Thu, 30 Jul 2020 19:03:07 +0300 Subject: [PATCH] feature/support_protobuf_txs --- package-lock.json | 268 ++++++++++++++++++++--------- package.json | 4 +- src/Signable.ts | 2 +- src/adapters/SeedAdapter.ts | 28 +-- src/adapters/WavesKeeperAdapter.ts | 28 +-- src/prepareTx/constants.ts | 2 + 6 files changed, 223 insertions(+), 109 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fbf6c1..b20ba5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -557,6 +557,60 @@ "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.13.1.tgz", "integrity": "sha512-ag2wX5VcAqPMKooCn/S6kKblVlsn74ixtagpwR+6GdFqYa/bspH8mWw+zwcdzSwa/wbOQRuY75zH52qBonfXBA==" }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, "@types/babel__core": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.7.tgz", @@ -599,9 +653,9 @@ } }, "@types/base64-js": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/base64-js/-/base64-js-1.2.5.tgz", - "integrity": "sha1-WCskdhaabLpGCiFNR2x0REHYc9U=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ZmI0sZGAUNXUfMWboWwi4LcfpoVUYldyN6Oe0oJ5cCsHDU/LlRq8nQKPXhYLOx36QYSW9bNIb1vvRrD6K7Llgw==" }, "@types/bignumber.js": { "version": "5.0.0", @@ -642,20 +696,35 @@ "integrity": "sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==", "dev": true }, + "@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" + }, "@types/node": { - "version": "13.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.1.tgz", - "integrity": "sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g==", - "dev": true + "version": "13.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.1.tgz", + "integrity": "sha512-E6M6N0blf/jiZx8Q3nb0vNaswQeEyn0XlupO+xN6DtJ6r6IT4nXrTry7zhIfYvFCl3/8Cu6WIysmUBKiqV0bqQ==" }, "@types/node-fetch": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.6.tgz", - "integrity": "sha512-2w0NTwMWF1d3NJMK0Uiq2UNN8htVCyOWOD0jIPjPgC5Ph/YP4dVhs9YxxcMcuLuwAslz0dVEcZQUaqkLs3IzOQ==", - "dev": true, + "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==", "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==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } } }, "@types/ramda": { @@ -714,14 +783,35 @@ } }, "@waves/marshall": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@waves/marshall/-/marshall-0.9.1.tgz", - "integrity": "sha512-DWBUKDno7ahI4ogMtaTbXujF1j2RoIHK68Xi9ZTd1Tk1FwnSfHXjEnkRLJ7qoRwZibVYmrxiOPN0t+LNkueTnw==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@waves/marshall/-/marshall-0.10.0.tgz", + "integrity": "sha512-I51GmHK7+acy3oqq+NvXrx4ZQNqNmzt9wZvr5dMJ8b9uj4mijqLocojNP03c1/7PR2SIZ56T5sQlHcP1GWWGXw==", "requires": { "@types/base64-js": "^1.2.5", - "@waves/bignumber": "0.0.1", + "@types/long": "^4.0.0", "@waves/parse-json-bignumber": "^1.0.1", - "base64-js": "^1.3.0" + "base64-js": "^1.3.0", + "long": "^4.0.0" + } + }, + "@waves/money-like-to-node": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@waves/money-like-to-node/-/money-like-to-node-0.0.10.tgz", + "integrity": "sha512-To1ya2WUpElVYhLZKK+knd2qXLQlaxd/rATUoguZJHKs7H+PxhbalrBESmQG9yNQYGcnvGv+DE2ZGUZpqDcPQw==", + "requires": { + "@waves/ts-types": "^0.2.0" + } + }, + "@waves/node-api-js": { + "version": "0.1.4-beta.1", + "resolved": "https://registry.npmjs.org/@waves/node-api-js/-/node-api-js-0.1.4-beta.1.tgz", + "integrity": "sha512-BfUiXyujJNOkTp+P8dtIMrojD/aydJQ6jQXYprb2Y6S5R9dVx02yYyyd3czy0cB9Pa/PjuuC3vQtxx79tyHBKg==", + "requires": { + "@types/node-fetch": "^2.5.4", + "@waves/bignumber": "0.0.1", + "@waves/ts-types": "^0.3.2", + "node-fetch": "^2.6.0", + "typed-ts-events": "^1.1.1" }, "dependencies": { "@waves/bignumber": { @@ -735,19 +825,20 @@ } } }, - "@waves/money-like-to-node": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@waves/money-like-to-node/-/money-like-to-node-0.0.10.tgz", - "integrity": "sha512-To1ya2WUpElVYhLZKK+knd2qXLQlaxd/rATUoguZJHKs7H+PxhbalrBESmQG9yNQYGcnvGv+DE2ZGUZpqDcPQw==", - "requires": { - "@waves/ts-types": "^0.2.0" - } - }, "@waves/parse-json-bignumber": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@waves/parse-json-bignumber/-/parse-json-bignumber-1.0.3.tgz", "integrity": "sha512-zBHIQUjjMYMQXNQcwJwzNShUZnoTM6JfVJDwa0eDGUVk+JAKVGiXxv/k29Ng9TsIDi97hwVravlPPwfZcy4XXQ==" }, + "@waves/protobuf-serialization": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@waves/protobuf-serialization/-/protobuf-serialization-1.2.4.tgz", + "integrity": "sha512-Qrq1Yle0oa4WC+R7KolK4LqdIKZXVlpDvJoT3Q+Sav8Q0oZ84W7zXPNRl99aqQtZ40YTN6JPmpHndDA28pQrlw==", + "requires": { + "@types/long": "^4.0.0", + "protobufjs": "^6.8.8" + } + }, "@waves/ts-lib-crypto": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@waves/ts-lib-crypto/-/ts-lib-crypto-1.4.3.tgz", @@ -758,18 +849,21 @@ } }, "@waves/ts-types": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.2.2.tgz", - "integrity": "sha512-C6kc8co7JEbmLxof3TzYzadtWOIt7ePOz+NUaEW9uNi2qjKz7Z56s2fkJJ+vjJq0O88Lj7uI4gsNOQRwZenv6g==" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-0.3.2.tgz", + "integrity": "sha512-HMP8498rjlQ4Yslpzxnd0XFw6JPRmlQjmTFUZjsUMQpqJ5+4+xXF50TjKcDp/poteJLK4hPVx10B0kZoL+8xWQ==" }, "@waves/waves-transactions": { - "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==", + "version": "4.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@waves/waves-transactions/-/waves-transactions-4.0.0-beta.18.tgz", + "integrity": "sha512-O5aWsgeXAOLwEhZFgzqCZTfeYdgfs806YztUPHT0v6+W7/yFZX1FirJGLPE9ceFDgfrzBFP1PMDLfilMF8rybw==", "requires": { - "@waves/marshall": "^0.9.1", - "@waves/ts-lib-crypto": "^1.4.3", - "axios": "^0.19.0" + "@waves/marshall": "^0.10.0", + "@waves/node-api-js": "0.1.4-beta.1", + "@waves/protobuf-serialization": "^1.2.4", + "@waves/ts-lib-crypto": "^1.4.2", + "@waves/ts-types": "^0.3.2", + "long": "^4.0.0" } }, "JSONStream": { @@ -982,8 +1076,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { "version": "2.1.2", @@ -1003,14 +1096,6 @@ "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", "dev": true }, - "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", - "requires": { - "follow-redirects": "1.5.10" - } - }, "babel-jest": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", @@ -1574,7 +1659,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -1852,8 +1936,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "deps-sort": { "version": "2.0.1", @@ -2330,14 +2413,6 @@ "locate-path": "^3.0.0" } }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "requires": { - "debug": "=3.1.0" - } - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -2397,7 +2472,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2418,12 +2494,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2438,17 +2516,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2565,7 +2646,8 @@ "inherits": { "version": "2.0.4", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2577,6 +2659,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2591,6 +2674,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2598,12 +2682,14 @@ "minimist": { "version": "1.2.5", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.9.0", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2622,6 +2708,7 @@ "version": "0.5.3", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "^1.2.5" } @@ -2711,7 +2798,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2723,6 +2811,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2800,7 +2889,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2836,6 +2926,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2855,6 +2946,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2898,12 +2990,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -4164,6 +4258,11 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -4272,14 +4371,12 @@ "mime-db": { "version": "1.43.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", - "dev": true + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" }, "mime-types": { "version": "2.1.26", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", - "dev": true, "requires": { "mime-db": "1.43.0" } @@ -4373,7 +4470,8 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, "nan": { "version": "2.14.0", @@ -4416,8 +4514,7 @@ "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", - "dev": true + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, "node-forge": { "version": "0.8.5", @@ -4835,14 +4932,24 @@ "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, + "protobufjs": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.1.tgz", + "integrity": "sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ==", "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.4" + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" } }, "psl": { @@ -5988,6 +6095,11 @@ "prelude-ls": "~1.1.2" } }, + "typed-ts-events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/typed-ts-events/-/typed-ts-events-1.1.1.tgz", + "integrity": "sha512-sYjxQrhBTg3HGzNBOXSURlIfmUGXS//dVGY08ofz9dbusX/IdcN8LD9SsFNbk4UgHy8reQPgSZw+ADpkLcPtDA==" + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", diff --git a/package.json b/package.json index baaf8fa..30928ca 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "@waves/data-entities": "^2.0.3", "@waves/ledger": "^3.6.1", "@waves/money-like-to-node": "0.0.10", - "@waves/ts-types": "^0.2.0", - "@waves/waves-transactions": "^3.25.1", + "@waves/ts-types": "^0.3.2", + "@waves/waves-transactions": "^4.0.0-beta.18", "ramda": "^0.25.0" }, "scripts": { diff --git a/src/Signable.ts b/src/Signable.ts index 0aca78d..aed5ba5 100644 --- a/src/Signable.ts +++ b/src/Signable.ts @@ -58,7 +58,7 @@ export class Signable { } const version = this._forSign.data.version; - + if (!availableVersions.includes(version)) { throw new SignError(`Can\'t sign data with type "${this.type}" and version "${version}"`, ERRORS.VERSION_IS_NOT_SUPPORTED); } diff --git a/src/adapters/SeedAdapter.ts b/src/adapters/SeedAdapter.ts index fd47e02..b176458 100644 --- a/src/adapters/SeedAdapter.ts +++ b/src/adapters/SeedAdapter.ts @@ -76,20 +76,20 @@ 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.ISSUE]: [2, 3], + [SIGN_TYPE.TRANSFER]: [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] }; } diff --git a/src/adapters/WavesKeeperAdapter.ts b/src/adapters/WavesKeeperAdapter.ts index a98ccb4..92bced8 100644 --- a/src/adapters/WavesKeeperAdapter.ts +++ b/src/adapters/WavesKeeperAdapter.ts @@ -11,20 +11,20 @@ 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.ISSUE]: [2, 3], + [SIGN_TYPE.TRANSFER]: [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] }; export class WavesKeeperAdapter extends Adapter { diff --git a/src/prepareTx/constants.ts b/src/prepareTx/constants.ts index edcea53..64dba5c 100644 --- a/src/prepareTx/constants.ts +++ b/src/prepareTx/constants.ts @@ -1,6 +1,7 @@ import { IAdapterSignMethods } from './interfaces'; import { libs } from '@waves/waves-transactions'; import * as wavesTransactions from '@waves/waves-transactions'; +import { txToProtoBytes } from '@waves/waves-transactions/dist/proto-serialize'; import { toNode as mlToNode } from '@waves/money-like-to-node'; import { prepare } from './prepare'; import processors = prepare.processors; @@ -284,6 +285,7 @@ export const SIGN_TYPES: Record = { getBytes: { 0: binary.serializeTx, 1: binary.serializeTx, + 2: txToProtoBytes }, toNode: data => toNode( {