diff --git a/package-lock.json b/package-lock.json index 6f1ae71..3dd391e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "@waves/waves-transactions", - "version": "4.2.10", + "version": "4.3.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@waves/waves-transactions", - "version": "4.2.10", + "version": "4.3.10", "license": "MIT", "dependencies": { "@waves/marshall": "^0.15.0-beta.1", - "@waves/node-api-js": "^1.2.10", - "@waves/protobuf-serialization": "1.4.3", + "@waves/node-api-js": "^1.3.10", + "@waves/protobuf-serialization": "1.5.2", "@waves/ts-lib-crypto": "1.4.3", - "@waves/ts-types": "1.1.0", + "@waves/ts-types": "1.2.0", "axios": "^0.19.0", "long": "^4.0.0" }, @@ -31,15 +31,15 @@ "rimraf": "^2.6.2", "terser-webpack-plugin": "^1.2.3", "ts-jest": "^24.0.2", - "ts-jsdoc": "^3.0.1", - "ts-loader": "^5.3.3", + "ts-jsdoc": "^3.2.2", + "ts-loader": "^5.4.5", "ts-node": "^7.0.1", "tslint": "^5.20.1", "typed-ts-events": "^1.1.1", "typedoc": "^0.19.2", "typedoc-clarity-theme": "^1.1.0", "typedoc-plugin-external-module-name": "^2.1.0", - "typescript": "^3.7.2", + "typescript": "^3.9.10", "typescript-json-schema": "^0.43.0", "webpack": "^4.30.0", "webpack-cli": "^3.1.0" @@ -718,7 +718,7 @@ "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", @@ -733,12 +733,12 @@ "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -747,27 +747,27 @@ "node_modules/@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@types/axios": { "version": "0.14.0", @@ -923,13 +923,13 @@ } }, "node_modules/@waves/node-api-js": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/@waves/node-api-js/-/node-api-js-1.2.10.tgz", - "integrity": "sha512-hbflpF/aJ23cWwDiPxJkTcHPaPoMVkezc1uXdJtnuiqGnKLfkmL4w9suQ/H9YcbAdcxZccFmQqxl+lT8/Slq5w==", + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@waves/node-api-js/-/node-api-js-1.3.10.tgz", + "integrity": "sha512-P3hQiw8K27tVt6S1MEnKejcPEaHbpPjW6NAn6wrT+9anuh1BTmjJPnuqwaU8WrLEC4faYBgssnhF8JsX5MrkvA==", "dependencies": { "@types/node-fetch": "^2.5.4", "@waves/bignumber": "^1.1.1", - "@waves/ts-types": "^1.0.12", + "@waves/ts-types": "1.2.0", "node-fetch": "^2.6.7", "typed-ts-events": "^1.1.1" } @@ -940,9 +940,9 @@ "integrity": "sha512-zBHIQUjjMYMQXNQcwJwzNShUZnoTM6JfVJDwa0eDGUVk+JAKVGiXxv/k29Ng9TsIDi97hwVravlPPwfZcy4XXQ==" }, "node_modules/@waves/protobuf-serialization": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@waves/protobuf-serialization/-/protobuf-serialization-1.4.3.tgz", - "integrity": "sha512-qloPEDn9FsiZWLX8y7CWQXXxX+RGq1zPN5AaYmOBrrZ5Z8EA4hoTVINkQFpl2VbfSpRjI5XpwsxbkL3QhgCodw==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@waves/protobuf-serialization/-/protobuf-serialization-1.5.2.tgz", + "integrity": "sha512-oqgjP9P8AWhj8vDQW7aXYSYP+67g311vFDsY0oddMJvTJ+hvSM6rRG2y7H8KE1dekTUwp6cyRCNlsw2KueEk7g==", "dependencies": { "@types/long": "^4.0.0", "protobufjs": "^6.8.8" @@ -958,9 +958,9 @@ } }, "node_modules/@waves/ts-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-1.1.0.tgz", - "integrity": "sha512-SGHj4cIIvMAhDPiDhbpEzP2UqNF3VgTssGf6UaJ7vwzxq0W1pqz2lKMDe9pZup9p9rEETGW4Yy3+K1G7OGOLxA==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-1.2.0.tgz", + "integrity": "sha512-ddb0wTZj1Onh5CaQNTg0d7ivjKSaTymcJ0fwuEzLoEypuS9g5soJpbWIF+GApduxWt4lksXqaZjEJIU2EFTdeQ==" }, "node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -1153,6 +1153,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", "dev": true }, "node_modules/acorn": { @@ -1705,6 +1706,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -1717,6 +1719,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -2917,6 +2920,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -2929,6 +2933,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -3092,6 +3097,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "deprecated": "Use your platform's native DOMException instead", "dev": true, "dependencies": { "webidl-conversions": "^4.0.2" @@ -3583,6 +3589,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -3595,6 +3602,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -3657,6 +3665,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "deprecated": "This module is no longer supported.", "dev": true }, "node_modules/file-set": { @@ -3896,7 +3905,7 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", "dev": true, "hasInstallScript": true, "optional": true, @@ -4596,6 +4605,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "deprecated": "Please upgrade to v0.1.7", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -4709,6 +4719,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "deprecated": "Please upgrade to v0.1.5", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -7301,9 +7312,9 @@ } }, "node_modules/protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -7317,7 +7328,7 @@ "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", + "@types/node": "^13.7.0", "long": "^4.0.0" }, "bin": { @@ -7326,9 +7337,9 @@ } }, "node_modules/protobufjs/node_modules/@types/node": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", - "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==" + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" }, "node_modules/prr": { "version": "1.0.1", @@ -8200,6 +8211,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -8212,6 +8224,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", "dev": true, "dependencies": { "kind-of": "^6.0.0" @@ -10207,6 +10220,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.", "dev": true, "dependencies": { "browser-process-hrtime": "^1.0.0" @@ -11276,7 +11290,7 @@ "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "@protobufjs/base64": { "version": "1.1.2", @@ -11291,12 +11305,12 @@ "@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "requires": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -11305,27 +11319,27 @@ "@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "@types/axios": { "version": "0.14.0", @@ -11480,13 +11494,13 @@ } }, "@waves/node-api-js": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/@waves/node-api-js/-/node-api-js-1.2.10.tgz", - "integrity": "sha512-hbflpF/aJ23cWwDiPxJkTcHPaPoMVkezc1uXdJtnuiqGnKLfkmL4w9suQ/H9YcbAdcxZccFmQqxl+lT8/Slq5w==", + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@waves/node-api-js/-/node-api-js-1.3.10.tgz", + "integrity": "sha512-P3hQiw8K27tVt6S1MEnKejcPEaHbpPjW6NAn6wrT+9anuh1BTmjJPnuqwaU8WrLEC4faYBgssnhF8JsX5MrkvA==", "requires": { "@types/node-fetch": "^2.5.4", "@waves/bignumber": "^1.1.1", - "@waves/ts-types": "^1.0.12", + "@waves/ts-types": "1.2.0", "node-fetch": "^2.6.7", "typed-ts-events": "^1.1.1" } @@ -11497,9 +11511,9 @@ "integrity": "sha512-zBHIQUjjMYMQXNQcwJwzNShUZnoTM6JfVJDwa0eDGUVk+JAKVGiXxv/k29Ng9TsIDi97hwVravlPPwfZcy4XXQ==" }, "@waves/protobuf-serialization": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@waves/protobuf-serialization/-/protobuf-serialization-1.4.3.tgz", - "integrity": "sha512-qloPEDn9FsiZWLX8y7CWQXXxX+RGq1zPN5AaYmOBrrZ5Z8EA4hoTVINkQFpl2VbfSpRjI5XpwsxbkL3QhgCodw==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@waves/protobuf-serialization/-/protobuf-serialization-1.5.2.tgz", + "integrity": "sha512-oqgjP9P8AWhj8vDQW7aXYSYP+67g311vFDsY0oddMJvTJ+hvSM6rRG2y7H8KE1dekTUwp6cyRCNlsw2KueEk7g==", "requires": { "@types/long": "^4.0.0", "protobufjs": "^6.8.8" @@ -11515,9 +11529,9 @@ } }, "@waves/ts-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-1.1.0.tgz", - "integrity": "sha512-SGHj4cIIvMAhDPiDhbpEzP2UqNF3VgTssGf6UaJ7vwzxq0W1pqz2lKMDe9pZup9p9rEETGW4Yy3+K1G7OGOLxA==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@waves/ts-types/-/ts-types-1.2.0.tgz", + "integrity": "sha512-ddb0wTZj1Onh5CaQNTg0d7ivjKSaTymcJ0fwuEzLoEypuS9g5soJpbWIF+GApduxWt4lksXqaZjEJIU2EFTdeQ==" }, "@webassemblyjs/ast": { "version": "1.9.0", @@ -16682,9 +16696,9 @@ } }, "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz", + "integrity": "sha512-yvAslS0hNdBhlSKckI4R1l7wunVilX66uvrjzE4MimiAt7/qw1nLpMhZrn/ObuUTM/c3Xnfl01LYMdcSJe6dwg==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -16697,14 +16711,14 @@ "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", + "@types/node": "^13.7.0", "long": "^4.0.0" }, "dependencies": { "@types/node": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", - "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==" + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" } } }, diff --git a/package.json b/package.json index bdc613c..522f437 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waves/waves-transactions", - "version": "4.2.10", + "version": "4.3.10", "description": "Build and sign(multi-sign) transactions for Waves blockchain.", "keywords": [ "waves", @@ -54,15 +54,15 @@ "rimraf": "^2.6.2", "terser-webpack-plugin": "^1.2.3", "ts-jest": "^24.0.2", - "ts-jsdoc": "^3.0.1", - "ts-loader": "^5.3.3", + "ts-jsdoc": "^3.2.2", + "ts-loader": "^5.4.5", "ts-node": "^7.0.1", "tslint": "^5.20.1", "typed-ts-events": "^1.1.1", "typedoc": "^0.19.2", "typedoc-clarity-theme": "^1.1.0", "typedoc-plugin-external-module-name": "^2.1.0", - "typescript": "^3.7.2", + "typescript": "^3.9.10", "typescript-json-schema": "^0.43.0", "webpack": "^4.30.0", "webpack-cli": "^3.1.0" @@ -73,10 +73,10 @@ }, "dependencies": { "@waves/marshall": "^0.15.0-beta.1", - "@waves/node-api-js": "^1.2.10", - "@waves/protobuf-serialization": "1.4.3", + "@waves/node-api-js": "^1.3.10", + "@waves/protobuf-serialization": "1.5.2", "@waves/ts-lib-crypto": "1.4.3", - "@waves/ts-types": "1.1.0", + "@waves/ts-types": "1.2.0", "axios": "^0.19.0", "long": "^4.0.0" } diff --git a/src/proto-serialize.ts b/src/proto-serialize.ts index 8800084..9ce5f64 100644 --- a/src/proto-serialize.ts +++ b/src/proto-serialize.ts @@ -82,9 +82,7 @@ export function protoBytesToSignedTx(bytes: Uint8Array): TTx { export function protoBytesToTx(bytes: Uint8Array): TTransaction { const t = wavesProto.waves.Transaction.decode(bytes) - const res = protoTxDataToTx(t) - - return res + return protoTxDataToTx(t) } export function protoTxDataToTx(t: wavesProto.waves.Transaction): TTransaction { @@ -189,7 +187,7 @@ export function protoTxDataToTx(t: wavesProto.waves.Transaction): TTransaction { if (de.hasOwnProperty('intValue')) return { key: de.key, type: 'integer', - value: convertNumber(de.intValue!) + value: convertNumber(de.intValue!), } if (de.hasOwnProperty('stringValue')) return {key: de.key, type: 'string', value: de.stringValue} return {key: de.key, value: null} @@ -213,7 +211,7 @@ export function protoTxDataToTx(t: wavesProto.waves.Transaction): TTransaction { } res.payment = t.invokeScript!.payments!.map(p => ({ amount: convertNumber(p.amount!), - assetId: p.hasOwnProperty('assetId') ? base58Encode(p.assetId!) : null + assetId: p.hasOwnProperty('assetId') ? base58Encode(p.assetId!) : null, })) break case 'updateAssetInfo': @@ -436,6 +434,7 @@ export const signedTxToProto = (t: TTx): wavesProto.waves.ISignedTransaction => const orderToProto = (o: any): wavesProto.waves.IOrder => { let priceMode + let attachment if (o.version === 4 && 'priceMode' in o) { if (o.priceMode === 0 || o.priceMode === 'default') { priceMode = undefined @@ -445,6 +444,10 @@ const orderToProto = (o: any): wavesProto.waves.IOrder => { : priceMode = wavesProto.waves.Order.PriceMode.FIXED_DECIMALS } else priceMode = undefined + if (o.version === 4 && 'attachment' in o) { + attachment = base64Decode(o.attachment.startsWith('base64:') ? o.attachment.slice(7) : o.attachment) + } else attachment = undefined + const isNullOrWaves = (asset: string | null) => asset == null || asset.toLowerCase() == 'waves' return ({ chainId: o.chainId, @@ -464,6 +467,7 @@ const orderToProto = (o: any): wavesProto.waves.IOrder => { proofs: o.proofs?.map(base58Decode), eip712Signature: o.eip712Signature ? base16Decode(o.eip712Signature.slice(2)) : undefined, priceMode: priceMode, + attachment: attachment, }) } @@ -473,7 +477,7 @@ const orderFromProto = (po: wavesProto.waves.IOrder): SignedIExchangeTransaction po.priceMode === 1 ? priceMode = 'fixedDecimals' : priceMode = 'assetDecimals' - } + } else priceMode = undefined return { version: po.version! as 1 | 2 | 3 | 4, @@ -492,9 +496,10 @@ const orderFromProto = (po: wavesProto.waves.IOrder): SignedIExchangeTransaction expiration: po.expiration!.toNumber(), matcherFee: convertNumber(po.matcherFee!.amount!), matcherFeeAssetId: po.matcherFee!.assetId == null ? null : base58Encode(po.matcherFee!.assetId), + attachment: po.attachment?.length ? base64Encode(po.attachment) : undefined, // @ts-ignore priceMode: priceMode, - eip712Signature: po.eip712Signature?.length ? `0x${base16Encode(po.eip712Signature)}` : undefined + eip712Signature: po.eip712Signature?.length ? `0x${base16Encode(po.eip712Signature)}` : undefined, } } @@ -510,7 +515,7 @@ const massTransferItemToProto = (mti: MassTransferItem): wavesProto.waves.MassTr recipient: recipientToProto(mti.recipient), amount: mti.amount == 0 ? null : Long.fromValue(mti.amount), }) -export const dataEntryToProto = (de: DataTransactionEntry): wavesProto.waves.DataTransactionData.IDataEntry => ({ +export const dataEntryToProto = (de: DataTransactionEntry): wavesProto.waves.IDataEntry => ({ key: de.key, intValue: de.type === 'integer' ? Long.fromValue(de.value) : undefined, boolValue: de.type === 'boolean' ? de.value : undefined, diff --git a/src/requests/order.ts b/src/requests/order.ts index d7858ce..f087c0a 100644 --- a/src/requests/order.ts +++ b/src/requests/order.ts @@ -101,6 +101,7 @@ export function order(paramsOrOrder: any, seed?: TSeedTypes): SignedIExchangeTra // @ts-ignore ord.chainId = networkByte(paramsOrOrder.chainId, 87) if (paramsOrOrder.eip712Signature) ord.eip712Signature = paramsOrOrder.eip712Signature + if (paramsOrOrder.attachment) ord.attachment = paramsOrOrder.attachment } const bytes = ord.version > 3 ? orderToProtoBytes(ord) : binary.serializeOrder(ord) diff --git a/src/transactions.ts b/src/transactions.ts index dec3dd1..de5e742 100644 --- a/src/transactions.ts +++ b/src/transactions.ts @@ -9,7 +9,7 @@ import { TransactionType } from '@waves/ts-types/src' import {InvokeScriptCallArgument} from '@waves/ts-types/src/parts' -import {EthereumTransaction} from '@waves/ts-types' +import {EthereumTransaction, ExchangeTransactionOrderType} from '@waves/ts-types' export interface WithId { /** @@ -190,7 +190,7 @@ export interface IOrderParams { matcherPublicKey: string price: LONG amount: LONG - orderType: 'buy' | 'sell', + orderType: ExchangeTransactionOrderType, amountAsset: string | null priceAsset: string | null senderPublicKey?: string diff --git a/test/proto-serialize.test.ts b/test/proto-serialize.test.ts index 8cf7d37..0f1fc2c 100644 --- a/test/proto-serialize.test.ts +++ b/test/proto-serialize.test.ts @@ -1,26 +1,29 @@ -import { exampleTxs } from './exampleTxs' -import {broadcast, libs, waitForTx, WithId} from '../src' -import { protoBytesToTx, txToProtoBytes } from '../src/proto-serialize' -import { transfer } from '../src/transactions/transfer' -import { issue } from '../src/transactions/issue' -import { reissue } from '../src/transactions/reissue' -import { alias } from '../src/transactions/alias' -import { burn } from '../src/transactions/burn' -import { data } from '../src/transactions/data' -import { lease } from '../src/transactions/lease' -import { cancelLease } from '../src/transactions/cancel-lease' -import { setScript } from '../src/transactions/set-script' -import { setAssetScript } from '../src/transactions/set-asset-script' -import { invokeScript } from '../src/transactions/invoke-script' -import { sponsorship } from '../src/transactions/sponsorship' -import { txs } from './example-proto-tx' -import { massTransfer } from '../src/transactions/mass-transfer' -import { updateAssetInfo } from '../src/transactions/update-asset-info' +import {exampleTxs} from './exampleTxs' +import { + alias, + broadcast, + burn, + cancelLease, + data, + invokeScript, + issue, + lease, + libs, + massTransfer, + reissue, + setAssetScript, + setScript, + sponsorship, + transfer, + updateAssetInfo, + waitForTx +} from '../src' +import {protoBytesToTx, txToProtoBytes} from '../src/proto-serialize' +import {txs} from './example-proto-tx' import {randomHexString, TIMEOUT} from './integration/config' import {address} from '@waves/ts-lib-crypto' import {issueMinimalParams} from './minimalParams' -import {deleteProofsAndId} from "./utils"; - +import {deleteProofsAndId} from './utils' const nodeUrl = 'http://localhost:6869/' @@ -42,15 +45,15 @@ describe('serialize/deserialize', () => { it('type: ' + tx.type, () => { // deleteProofsAndId(tx) //const parsed = protoBytesToTx(txToProtoBytes(tx)) - const txWithoutProofAndId = deleteProofsAndId(tx); - const protoBytes = txToProtoBytes(txWithoutProofAndId); - const parsed = protoBytesToTx(protoBytes); - expect(parsed).toMatchObject(txWithoutProofAndId); + const txWithoutProofAndId = deleteProofsAndId(tx) + const protoBytes = txToProtoBytes(txWithoutProofAndId) + const parsed = protoBytesToTx(protoBytes) + expect(parsed).toMatchObject(txWithoutProofAndId) }) }) it('correctly serialized transactions', () => { - Object.entries(txs).forEach(([name, { Bytes, Json }]) => { + Object.entries(txs).forEach(([, { Bytes, Json }]) => { const actualBytes = libs.crypto.base16Encode(txToProtoBytes(Json as any)) const expectedBytes = libs.crypto.base16Encode(libs.crypto.base64Decode(Bytes)) expect(expectedBytes).toBe(actualBytes) diff --git a/test/transactions/burn.test.ts b/test/transactions/burn.test.ts index b845024..b52a538 100644 --- a/test/transactions/burn.test.ts +++ b/test/transactions/burn.test.ts @@ -1,4 +1,4 @@ -import {base64Decode, base64Encode, publicKey} from '@waves/ts-lib-crypto' +import {publicKey} from '@waves/ts-lib-crypto' import {burn} from '../../src' import {burnMinimalParams} from '../minimalParams' import { @@ -6,10 +6,9 @@ import { checkProtoSerializeDeserialize, errorMessageByTemplate, validateTxSignature -} from '../../test/utils' -import {burnTx} from "./expected/proto/burn.tx" -import {burnBinaryTx} from "./expected/binary/burn.tx" -import {binary} from '@waves/marshall' +} from '../utils' +import {burnTx} from './expected/proto/burn.tx' +import {burnBinaryTx} from './expected/binary/burn.tx' describe('burn', () => { @@ -42,7 +41,7 @@ describe('burn', () => { it('Should not create with zero amount', () => { expect(() => burn({ ...burnMinimalParams, - amount: 0 + amount: 0, }, stringSeed)).toThrowError('tx "amount", has wrong data: 0. Check tx data.') }) diff --git a/test/transactions/exchange.test.ts b/test/transactions/exchange.test.ts index e9962da..35c740b 100644 --- a/test/transactions/exchange.test.ts +++ b/test/transactions/exchange.test.ts @@ -1,33 +1,12 @@ //const seed1 = 'alter bar cycle pioneer library eye calm soft swing motion limit taste supreme afford caution' //complex account -<<<<<<< HEAD -import {burn, exchange, IOrderParams, order, waitForTx} from '../../src' -import {Seed} from "../../src/seedUtils" -======= -import {burn, exchange, order} from '../../src' ->>>>>>> master -import { - base16Decode, - base58Decode, - base58Encode, - base64Decode, - base64Encode, - decryptSeed, -<<<<<<< HEAD - privateKey, publicKey -======= - privateKey ->>>>>>> master -} from '@waves/ts-lib-crypto' - -var fs = require("fs") -import {protoBytesToSignedTx, protoBytesToTx, txToProtoBytes} from '../../src/proto-serialize' -<<<<<<< HEAD -import {broadcast} from '../../src' -import {API_BASE, TIMEOUT} from '../integration/config' -======= -import {broadcast} from '@waves/node-api-js/es/api-node/transactions' ->>>>>>> master +import {broadcast, exchange, order} from '../../src' +import {Seed} from '../../src/seedUtils' +import {publicKey} from '@waves/ts-lib-crypto' +import {txToProtoBytes} from '../../src/proto-serialize' + +var fs = require('fs') + const seed1 = 'shoe used festival regular fancy electric powder symptom stool physical cabbage need accuse silly ring' //plain acc @@ -44,7 +23,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -56,7 +35,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -86,7 +65,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -98,7 +77,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -114,7 +93,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 'T', fee: 700000, - version: 1 + version: 1, } // @ts-ignore @@ -130,7 +109,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -142,7 +121,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -158,7 +137,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 2 + version: 2, } // @ts-ignore @@ -173,7 +152,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -185,7 +164,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -201,7 +180,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 2 + version: 2, } // @ts-ignore @@ -216,7 +195,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -228,7 +207,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -244,7 +223,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 2 + version: 2, } // @ts-ignore @@ -259,7 +238,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -271,7 +250,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -287,7 +266,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 2 + version: 2, } // @ts-ignore @@ -302,7 +281,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -314,7 +293,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -330,7 +309,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 2 + version: 2, } // @ts-ignore @@ -345,7 +324,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -357,7 +336,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -373,7 +352,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 + version: 3, } // @ts-ignore @@ -388,7 +367,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -400,7 +379,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -416,7 +395,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 + version: 3, } // @ts-ignore @@ -431,7 +410,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -443,7 +422,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -459,7 +438,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 + version: 3, } // @ts-ignore @@ -474,7 +453,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -486,7 +465,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -502,7 +481,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 + version: 3, } // @ts-ignore @@ -517,7 +496,7 @@ describe('exchange', () => { amount: 100, price: 500000000, matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'buy' as 'buy', @@ -529,7 +508,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -545,50 +524,7 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 - } - - // @ts-ignore - //console.log( - const tx = exchange({...txOk}, seed1) - expect(tx).toMatchObject({...txOk}) - }) - - it('Should build exchange tx ver3-3-3', () => { - const order1 = { - version: 3, - amount: 100, - price: 500000000, - matcherFee: 100, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", - priceAsset: null, - matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', - orderType: 'buy' as 'buy', - } - - const order2 = { version: 3, - matcherFee: 100, - matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', - amount: 100, - price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", - priceAsset: null, - matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', - orderType: 'sell' as 'sell', - } - - - const txOk = { - order1: order(order1, seed1), - order2: order(order2, seed2), - price: 500000000, - amount: 100, - buyMatcherFee: 100, - sellMatcherFee: 100, - chainId: 84, - fee: 700000, - version: 3 } // @ts-ignore @@ -615,7 +551,7 @@ describe('exchange', () => { matcherFeeAssetId: 'DvXjujyWbi7ARdExyayN42gcfBKGTBRgYYyPWMxy5grK', amount: 100, price: 500000000, - amountAsset: "3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg", + amountAsset: '3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg', priceAsset: null, matcherPublicKey: 'BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E', orderType: 'sell' as 'sell', @@ -631,72 +567,74 @@ describe('exchange', () => { sellMatcherFee: 100, chainId: 84, fee: 700000, - version: 3 + version: 3, } // @ts-ignore const tx = exchange({...txOk}, seed1) expect(tx).toMatchObject({...txOk}) }) -<<<<<<< HEAD + it('', async () => { const nodeUrl = 'https://nodes-testnet.wavesnodes.com/' - const buy_seed = 'reject cheese exist bracket kitten body dress piece meadow tuition involve slight estate front fog' - const sell_seed = 'reject cheese exist bracket kitten body dress piece meadow tuition involve slight estate front fog' - const matcher_seed = 'reject cheese exist bracket kitten body dress piece meadow tuition involve slight estate front fog' + const buy_seed = 'acc0' + const sell_seed = 'acc0' + const matcher_seed = 'acc0' const buy_params = { - chainId: 84, + chainId: 'T', version: 4, amount: 123, - price: 123, - priceAsset: '25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', + price: 12_300_000, + priceAsset: '2jwWMYV12tVeAhMyKy8HphyaMAgQHJL2fWzZgYNCHkNk', amountAsset: null, matcherPublicKey: publicKey(matcher_seed), - orderType: 'buy', + orderType: 'buy' as 'buy', matcherFee: 300000, matcherFeeAssetId: null, - priceMode: 'fixedDecimals' + priceMode: 'fixedDecimals' as 'fixedDecimals', + attachment: 'base64:dGVzdA==', } const sell_params = { - chainId: 84, - version: 4, + chainId: 'T', + version: 3, amount: 123, price: 123, - priceAsset: '25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', + priceAsset: '2jwWMYV12tVeAhMyKy8HphyaMAgQHJL2fWzZgYNCHkNk', amountAsset: null, matcherPublicKey: publicKey(matcher_seed), - orderType: 'sell', + orderType: 'sell' as 'sell', matcherFee: 300000, matcherFeeAssetId: null, - priceMode: 'fixedDecimals' + // priceMode: 'fixedDecimals', } const buyOrder = order(buy_params, buy_seed) const sellOrder = order(sell_params, sell_seed) const exchange_params = { - chainId: 84, + chainId: 'T', type: 7, version: 3, order1: buyOrder, order2: sellOrder, - amount: 10000000, - price: 7000, + amount: 100, + price: 12_300_000, buyMatcherFee: 300000, sellMatcherFee: 300000, fee: 300000, - feeAssetId: null + feeAssetId: null, } const exchangeTx = exchange(exchange_params, matcher_seed) console.log('exchangeTx', JSON.stringify(exchangeTx, undefined, ' ')) const tx = await broadcast(exchangeTx, nodeUrl).then(resp => console.log(resp)).catch(rej => console.log(rej)) console.log('tx', JSON.stringify(tx, undefined, ' ')) - // await waitForTx(mtt.id, {apiBase: API_BASE, timeout: TIMEOUT}) + }) + it('ex', async () => { const fs = require('fs') @@ -718,10 +656,10 @@ describe('exchange', () => { priceAsset: '25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', amountAsset: null, matcherPublicKey: publicKey(matcher_seed), - orderType: 'buy', + orderType: 'buy' as 'buy', matcherFee: 300000, matcherFeeAssetId: null, - priceMode: 'fixedDecimals' + priceMode: 'fixedDecimals' as 'fixedDecimals', } const sell_params = { @@ -732,18 +670,16 @@ describe('exchange', () => { priceAsset: '25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT', amountAsset: null, matcherPublicKey: publicKey(matcher_seed), - orderType: 'sell', + orderType: 'sell' as 'sell', matcherFee: 300000, timestamp: t, expiration: t + 29 * 24 * 60 * 60 * 1000, - priceMode: 'fixedDecimals' + priceMode: 'fixedDecimals' as 'fixedDecimals', } const sellOrder = order(sell_params, sell_seed) - // console.log('sellOrder', sellOrder) const buyOrder = order(buy_params, buy_seed) - // console.log('buyOrder', buyOrder) const exchange_params = { chainId: 84, @@ -755,19 +691,18 @@ describe('exchange', () => { amount: 123, buyMatcherFee: 300000, sellMatcherFee: 300000, - fee: 300000 + fee: 300000, } const exchangeTx = exchange(exchange_params, matcher_seed) console.log(exchangeTx) await broadcast(exchangeTx, nodeUrl)//.then(resp => console.log(resp)).catch(rej => console.log(rej)) - const txbytes = txToProtoBytes(exchangeTx) -// fs.writeFile('bytes.txt', txbytes, function(err, result){ -// if(err) console.log('error', err); +// const txbytes = txToProtoBytes(exchangeTx) +// fs.writeFile('bytes.txt', txbytes, function(err, result){ +// if(err) console.log('error', err); // }); }, 60000 ) -======= ->>>>>>> master + })