From 99f232c228032a194d1d536886679d465b1ff1ca Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:08:17 +0000 Subject: [PATCH 01/10] web3-shh package.json for types --- packages/web3-shh/package.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/web3-shh/package.json b/packages/web3-shh/package.json index b4b750a4a7b..f45dc362fe9 100644 --- a/packages/web3-shh/package.json +++ b/packages/web3-shh/package.json @@ -11,9 +11,11 @@ "scripts": { "build": "rollup -c", "dev": "rollup -c -w", - "test": "jest" + "test": "jest", + "dtslint": "dtslint types" }, "dependencies": { + "web3-core": "1.0.0-beta.36", "web3-core-helpers": "1.0.0-beta.36", "web3-core-method": "1.0.0-beta.36", "web3-core-subscriptions": "1.0.0-beta.36", @@ -21,7 +23,11 @@ "web3-providers": "1.0.0-beta.36", "web3-utils": "1.0.0-beta.36" }, + "devDependencies": { + "dtslint": "^0.3.0" + }, "files": [ - "dist" + "dist", + "types/index.d.ts" ] } From 2dde705e186c9608532ad3bd2e7c2b686c66bf68 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:08:30 +0000 Subject: [PATCH 02/10] web3-shh package-lock.json --- packages/web3-shh/package-lock.json | 398 +++++++++++++++++++++++++++- 1 file changed, 389 insertions(+), 9 deletions(-) diff --git a/packages/web3-shh/package-lock.json b/packages/web3-shh/package-lock.json index 3276e649339..8883ca9836d 100644 --- a/packages/web3-shh/package-lock.json +++ b/packages/web3-shh/package-lock.json @@ -2,18 +2,398 @@ "requires": true, "lockfileVersion": 1, "dependencies": { - "@babel/runtime": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.1.5.tgz", - "integrity": "sha512-xKnPpXG/pvK1B90JkwwxSGii90rQGKtzcMt2gI5G6+M0REXaq6rOHsGC2ay6/d0Uje7zzvSzjEzfR3ENhFlrfA==", + "@types/parsimmon": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.0.tgz", + "integrity": "sha512-bsTIJFVQv7jnvNiC42ld2pQW2KRI+pAG243L+iATvqzy3X6+NH1obz2itRKDZZ8VVhN3wjwYax/VBGCcXzgTqQ==" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "1.0.3" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.3" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "definitelytyped-header-parser": { + "version": "github:Microsoft/definitelytyped-header-parser#e0561530379dfa01324a89936b75d90b20df9bd2", + "requires": { + "@types/parsimmon": "1.10.0", + "parsimmon": "1.12.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + }, + "dtslint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-0.3.0.tgz", + "integrity": "sha512-3oWL8MD+2nKaxmNzrt8EAissP63hNSJ4OLr/itvNnPdAAl+7vxnjQ8p2Zdk0MNgdenqwk7GcaUDz7fQHaPgCyA==", + "requires": { + "definitelytyped-header-parser": "github:Microsoft/definitelytyped-header-parser#e0561530379dfa01324a89936b75d90b20df9bd2", + "fs-promise": "2.0.3", + "strip-json-comments": "2.0.1", + "tslint": "5.11.0", + "typescript": "3.3.0-dev.20181214" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "requires": { + "graceful-fs": "4.1.15", + "jsonfile": "2.4.0" + } + }, + "fs-promise": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", + "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", + "requires": { + "any-promise": "1.3.0", + "fs-extra": "2.1.2", + "mz": "2.7.0", + "thenify-all": "1.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "4.1.15" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "regenerator-runtime": "^0.12.0" + "wrappy": "1.0.2" } }, - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + "parsimmon": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.12.0.tgz", + "integrity": "sha512-uC/BjuSfb4jfaWajKCp1mVncXXq+V1twbcYChbTxN3GM7fn+8XoHwUdvUz+PTaFtDSCRQxU8+Rnh+iMhAkVwdw==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "requires": { + "path-parse": "1.0.6" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "1.3.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": "3.3.0" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "tslint": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", + "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.19.0", + "diff": "3.5.0", + "glob": "7.1.3", + "js-yaml": "3.12.0", + "minimatch": "3.0.4", + "resolve": "1.8.1", + "semver": "5.6.0", + "tslib": "1.9.3", + "tsutils": "2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "requires": { + "tslib": "1.9.3" + } + }, + "typescript": { + "version": "3.3.0-dev.20181214", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.0-dev.20181214.tgz", + "integrity": "sha512-dy3hilVp3gHsKEqj837gzo6YLn5IuX+5obTkdLJuvceYQ1B/fBnj4Y+FB44IQdmZ4oaeQd5+7u+uI6vDvp5FhQ==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" } } } From a7d8633347bfb916542c857ce24e1f0b76098214 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:08:45 +0000 Subject: [PATCH 03/10] web3-shh typings --- packages/web3-shh/types/index.d.ts | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 packages/web3-shh/types/index.d.ts diff --git a/packages/web3-shh/types/index.d.ts b/packages/web3-shh/types/index.d.ts new file mode 100644 index 00000000000..34fa64fe75a --- /dev/null +++ b/packages/web3-shh/types/index.d.ts @@ -0,0 +1,111 @@ +/* + This file is part of web3.js. + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file index.d.ts + * @author Josh Stevens + * @date 2018 + */ + +import * as net from 'net'; +import {AbstractWeb3Module, Web3ModuleOptions, Providers} from 'web3-core'; +import {AbstractProviderAdapter, provider, BatchRequest} from 'web3-providers'; +import {Network} from 'web3-net'; + +export class Shh extends AbstractWeb3Module { + constructor( + provider: AbstractProviderAdapter | provider, + options?: Web3ModuleOptions + ); + setProvider(provider: AbstractProviderAdapter | provider, net?: net.Server): boolean; + readonly providers: Providers; + readonly givenProvider: provider | null; + BatchRequest: new() => BatchRequest; + net: Network; + getVersion(callback?: (error: Error, version: string) => void): Promise; // update docs + getInfo(callback?: (error: Error, info: Info) => void): Promise; // update docs + setMaxMessageSize(size: number, callback?: (error: Error, result: boolean) => void): Promise; // update docs + setMinPoW(pow: number, callback?: (error: Error, result: boolean) => void): Promise; // update docs + markTrustedPeer(enode: string, callback?: (error: Error, result: boolean) => void): Promise // update docs + newKeyPair(callback?: (error: Error, key: string) => void): Promise; // update docs + addPrivateKey(privateKey: string, callback?: (error: Error, privateKey: string) => void): Promise; // update docs + deleteKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs + hasKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs + getPublicKey(id: string, callback?: (error: Error, publicKey: string) => void): Promise; // update docs + getPrivateKey(id: string, callback?: (error: Error, privateKey: string) => void): Promise; // update docs + newSymKey(callback?: (error: Error, key: string) => void): Promise; // update docs + addSymKey(symKey: string, callback?: (error: Error, key: string) => void): Promise; // update docs + generateSymKeyFromPassword(password: string, callback?: (error: Error, key: string) => void): Promise; // update docs + hasSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs + getSymKey(id: string, callback?: (error: Error, key: string) => void): Promise; // update docs + deleteSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise // update docs + post(object: PostWithSymKey | PostWithPubKey, callback?: (error: Error, result: string) => void): Promise; + subscribe(string: 'messages', options: SubscriptionOptions, callback?: (error: Error, message: Notification, subscription: any) => void): Subscribe; + clearSubscriptions(): boolean; + newMessageFilter(options?: SubscriptionOptions): Promise; // update docs + deleteMessageFilter(id: string): Promise; // update docs + getFilterMessages(id: string): Promise; // update docs +} + +export interface Info { + messages: number; + maxMessageSize: number; + memory: number; + minPow: number; +} + +export interface PostBase { + sig?: string; + ttl: number; + topic: string; + payload: string; + padding?: number; + powTime?: number; + powTarget?: number; + targetPeer?: number; +} + +export interface PostWithSymKey extends PostBase { + symKeyID: string; +} + +export interface PostWithPubKey extends PostBase { + pubKey: string; +} + +export interface SubscriptionOptions { + symKeyID?: string; + privateKeyID?: string; + sig?: string; + topics?: string[]; + minPow?: number; + allowP2P?: boolean; + ttl?: number; +} + +export interface Notification { + hash: string; + sig?: string; + recipientPublicKey?: string; + timestamp: string; + ttl: number; + topic: string; + payload: string; + padding: number; + pow: number; +} + +export interface Subscribe { + on(type: 'data', handler: (data: Notification) => void): void; + on(type: 'error', handler: (data: Error) => void): void; +} From d7327424791a9d7243ded09520ed9e5cd454a5e4 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:09:34 +0000 Subject: [PATCH 04/10] web3-shh typings tests --- packages/web3-shh/types/tests/shh-test.ts | 193 ++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 packages/web3-shh/types/tests/shh-test.ts diff --git a/packages/web3-shh/types/tests/shh-test.ts b/packages/web3-shh/types/tests/shh-test.ts new file mode 100644 index 00000000000..2c994a5cf41 --- /dev/null +++ b/packages/web3-shh/types/tests/shh-test.ts @@ -0,0 +1,193 @@ +/* + This file is part of web3.js. + web3.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + web3.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with web3.js. If not, see . +*/ +/** + * @file eth-tests.ts + * @author Josh Stevens + * @date 2018 + */ + +import {Shh, Info, Notification} from 'web3-shh'; + +const shh = new Shh('https://localhost:5000'); + +// $ExpectType boolean +shh.setProvider('https://localhost:3000'); + +// $ExpectType Providers +shh.providers; + +// $ExpectType Providers +shh.providers; + +// $ExpectType Providers +shh.providers; + +// $ExpectType string | HttpProvider | IpcProvider | WebsocketProvider | null +shh.givenProvider; + +// $ExpectType AbstractProviderAdapter +shh.currentProvider; + +// $ExpectType BatchRequest +new shh.BatchRequest(); + +// $ExpectType Promise +shh.net.getId(); +// $ExpectType Promise +shh.net.getId((error: Error, id: number) => {}); + +// $ExpectType Promise +shh.net.isListening(); +// $ExpectType Promise +shh.net.isListening((error: Error, listening: boolean) => {}); + +// $ExpectType Promise +shh.net.getPeerCount(); +// $ExpectType Promise +shh.net.getPeerCount((error: Error, peerCount: number) => {}); + +// $ExpectType Promise +shh.getVersion(); +// $ExpectType Promise +shh.getVersion((error: Error, version: string) => {}); + +// $ExpectType Promise +shh.getInfo(); +// $ExpectType Promise +shh.getInfo((error: Error, info: Info) => {}); + +// $ExpectType Promise +shh.setMaxMessageSize(1234565); +// $ExpectType Promise +shh.setMaxMessageSize(1234565, (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.setMinPoW(0.9); +// $ExpectType Promise +shh.setMinPoW(0.9, (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.markTrustedPeer('test'); +// $ExpectType Promise +shh.markTrustedPeer('test', (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.newKeyPair(); +// $ExpectType Promise +shh.newKeyPair((error: Error, key: string) => {}); + +// $ExpectType Promise +shh.addPrivateKey('0x8bda3abeb454847b515fa9b404cede50b1cc63cfdeddd4999d074284b4c21e15'); +// $ExpectType Promise +shh.addPrivateKey('0x8bda3abeb454847b515fa9b404cede50b1cc63cfdeddd4999d074284b4c21e15', (error: Error, privateKey: string) => {}); + +// $ExpectType Promise +shh.deleteKeyPair('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f') +// $ExpectType Promise +shh.deleteKeyPair('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.hasKeyPair('fe22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f'); +// $ExpectType Promise +shh.hasKeyPair('fe22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.getPublicKey('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f') +// $ExpectType Promise +shh.getPublicKey('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, publicKey: string) => {}); + +// $ExpectType Promise +shh.getPrivateKey('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f'); +// $ExpectType Promise +shh.getPrivateKey('3e22b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, privateKey: string) => {}); + +// $ExpectType Promise +shh.newSymKey(); +// $ExpectType Promise +shh.newSymKey((error: Error, key: string) => {}); + +// $ExpectType Promise +shh.addSymKey('0x5e11b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f'); +// $ExpectType Promise +shh.addSymKey('0x5e11b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, key: string) => {}); + +// $ExpectType Promise +shh.generateSymKeyFromPassword('Never use this password - password!'); +// $ExpectType Promise +shh.generateSymKeyFromPassword('Never use this password - password!', (error: Error, key: string) => {}); + +// $ExpectType Promise +shh.hasSymKey('f6dcf21ed6a17bd78d8c4c63195ab997b3b65ea683705501eae82d32667adc92'); +// $ExpectType Promise +shh.hasSymKey('f6dcf21ed6a17bd78d8c4c63195ab997b3b65ea683705501eae82d32667adc92', (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.getSymKey('af33b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f'); +// $ExpectType Promise +shh.getSymKey('af33b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, key: string) => {}); + +// $ExpectType Promise +shh.deleteSymKey('bf31b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f'); +// $ExpectType Promise +shh.deleteSymKey('bf31b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', (error: Error, result: boolean) => {}); + +// $ExpectType Promise +shh.post({ + symKeyID: 'sd3', + sig: 'sds5', + ttl: 10, + topic: '0xffaadd11', + payload: '0xffffffdddddd1122', + powTime: 3, + powTarget: 0.5 +}); +// $ExpectType Promise +shh.post({ + symKeyID: 'sd3', + sig: 'sds5', + ttl: 10, + topic: '0xffaadd11', + payload: '0xffffffdddddd1122', + powTime: 3, + powTarget: 0.5 +}, (error: Error, result: string) => {}); + +// $ExpectType Subscribe +shh.subscribe('messages', { + symKeyID: 'bf31b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', + sig: '0x04d1574d4eab8f3dde4d2dc7ed2c4d699d77cbbdd09167b8fffa099652ce4df00c4c6e0263eafe05007a46fdf0c8d32b11aeabcd3abbc7b2bc2bb967368a68e9c6', + ttl: 20, + topics: ['0xffddaa11'], + minPow: 0.8, +}); +// $ExpectType Subscribe +shh.subscribe('messages', { + symKeyID: 'bf31b9ffc2387e18636e0a3d0c56b023264c16e78a2adcba1303cefc685e610f', + sig: '0x04d1574d4eab8f3dde4d2dc7ed2c4d699d77cbbdd09167b8fffa099652ce4df00c4c6e0263eafe05007a46fdf0c8d32b11aeabcd3abbc7b2bc2bb967368a68e9c6', + ttl: 20, + topics: ['0xffddaa11'], + minPow: 0.8, +}, (error: Error, message: Notification, subscription: any) => {}); + +// $ExpectType boolean +shh.clearSubscriptions(); + +// $ExpectType Promise +shh.newMessageFilter(); + +// $ExpectType Promise +shh.deleteMessageFilter('2b47fbafb3cce24570812a82e6e93cd9e2551bbc4823f6548ff0d82d2206b326'); + +// $ExpectType Promise +shh.getFilterMessages('2b47fbafb3cce24570812a82e6e93cd9e2551bbc4823f6548ff0d82d2206b326'); From f6663ee382840e49ee6d430f6e21f7b8561ba1d3 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:09:45 +0000 Subject: [PATCH 05/10] web3-shh tsconfig --- packages/web3-shh/types/tsconfig.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/web3-shh/types/tsconfig.json diff --git a/packages/web3-shh/types/tsconfig.json b/packages/web3-shh/types/tsconfig.json new file mode 100644 index 00000000000..9f1cde7c87a --- /dev/null +++ b/packages/web3-shh/types/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true, + "allowSyntheticDefaultImports": true, + "baseUrl": ".", + "paths": { + "web3-shh": ["."] + } + } +} From 10bb65cf9b6259f378e4b637bb1c3b7888cf321e Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:09:55 +0000 Subject: [PATCH 06/10] web3-shh tslint.json --- packages/web3-shh/types/tslint.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/web3-shh/types/tslint.json diff --git a/packages/web3-shh/types/tslint.json b/packages/web3-shh/types/tslint.json new file mode 100644 index 00000000000..871d605704b --- /dev/null +++ b/packages/web3-shh/types/tslint.json @@ -0,0 +1,11 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "semicolon": false, + "no-import-default-of-export-equals": false, + "file-name-casing": [true, "kebab-case"], + "whitespace": false, + "no-unnecessary-class": false, + "unified-signatures": false + } +} From c1fc4cd5b7c1f19cd67904f65c88c5a8b01092b4 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:31:45 +0000 Subject: [PATCH 07/10] update incorrect docs for web3-shh --- docs/web3-shh.rst | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/web3-shh.rst b/docs/web3-shh.rst index 3b724d47d30..c8400e36a20 100644 --- a/docs/web3-shh.rst +++ b/docs/web3-shh.rst @@ -63,7 +63,7 @@ Returns ------- -``String`` - The version of the current whisper running. +``Promise`` returns ``String`` - The version of the current whisper running. ------- @@ -103,7 +103,7 @@ Returns ------- -``Object`` - The information of the node with the following properties: +``Promise`` returns ``Object`` - The information of the node with the following properties: - ``messages`` - ``Number``: Number of currently floating messages. - ``maxMessageSize`` - ``Number``: The current message size limit in bytes. @@ -153,7 +153,7 @@ Returns ------- -``Boolean`` - ``true`` on success, error on failure. +``Promise`` returns ``Boolean`` - ``true`` on success, error on failure. ------- @@ -196,7 +196,7 @@ Returns ------- -``Boolean`` - ``true`` on success, error on failure. +``Promise`` returns ``Boolean`` - ``true`` on success, error on failure. ------- @@ -237,7 +237,7 @@ Returns ------- -``Boolean`` - ``true`` on success, error on failure. +``Promise`` returns ``Boolean`` - ``true`` on success, error on failure. ------- @@ -275,7 +275,7 @@ Returns ------- -``String`` - Key ID on success and an error on failure. +``Promise`` returns ``String`` - Key ID on success and an error on failure. ------- @@ -314,7 +314,7 @@ Returns ------- -``String`` - Key ID on success and an error on failure. +``Promise`` returns ``String`` - Key ID on success and an error on failure. ------- @@ -353,7 +353,7 @@ Returns ------- -``Boolean`` - ``true`` on success, error on failure. +``Promise`` returns ``Boolean`` - ``true`` on success, error on failure. ------- @@ -392,7 +392,7 @@ Returns ------- -``Boolean`` - ``true`` on if the key pair exist in the node, ``false`` if not. Error on failure. +``Promise`` returns ``Boolean`` - ``true`` on if the key pair exist in the node, ``false`` if not. Error on failure. ------- @@ -431,7 +431,7 @@ Returns ------- -``String`` - Public key on success and an error on failure. +``Promise`` returns ``String`` - Public key on success and an error on failure. ------- @@ -470,7 +470,7 @@ Returns ------- -``String`` - Private key on success and an error on failure. +``Promise`` returns ``String`` - Private key on success and an error on failure. ------- @@ -509,7 +509,7 @@ Returns ------- -``String`` - Key ID on success and an error on failure. +``Promise`` returns ``String`` - Key ID on success and an error on failure. ------- @@ -548,7 +548,7 @@ Returns ------- -``String`` - Key ID on success and an error on failure. +``Promise`` returns ``String`` - Key ID on success and an error on failure. ------- @@ -587,7 +587,7 @@ Returns ------- -``String`` - Key ID on success and an error on failure. +``Promise`` returns ``String`` - Key ID on success and an error on failure. ------- @@ -626,7 +626,7 @@ Returns ------- -``Boolean`` - ``true`` on if the symmetric key exist in the node, ``false`` if not. Error on failure. +``Promise`` returns ``Boolean`` - ``true`` on if the symmetric key exist in the node, ``false`` if not. Error on failure. ------- @@ -665,7 +665,7 @@ Returns ------- -``String`` - The raw symmetric key on success and an error on failure. +``Promise`` returns ``String`` - The raw symmetric key on success and an error on failure. ------- @@ -704,7 +704,7 @@ Returns ------- -``Boolean`` - ``true`` on if the symmetric key was deleted, error on failure. +``Promise`` returns ``Boolean`` - ``true`` on if the symmetric key was deleted, error on failure. ------- @@ -753,7 +753,7 @@ Parameters Returns ------- -``Promise`` - returns a promise. Upon success, the ``then`` function will be passed a string representing the hash of the sent message. On error, the ``catch`` function will be passed a string containing the reason for the error. +``Promise`` returns ``Promise`` - returns a promise. Upon success, the ``then`` function will be passed a string representing the hash of the sent message. On error, the ``catch`` function will be passed a string containing the reason for the error. ------- @@ -934,7 +934,7 @@ Parameters Returns ------- -``String``: The filter ID. +``Promise`` returns ``String``: The filter ID. ------- Example @@ -968,7 +968,7 @@ Parameters Returns ------- -``Boolean``: ``true`` on success, error on failure. +``Promise`` returns ``Boolean``: ``true`` on success, error on failure. ------- Example @@ -1003,7 +1003,7 @@ Parameters Returns ------- -``Array``: Returns an array of message objects like :ref:`web3.shh.subscribe() notification returns ` +``Promise`` returns ``Array``: Returns an array of message objects like :ref:`web3.shh.subscribe() notification returns ` ------- Example From daaf9c789d71c49ae5f77a46658970da14838ec1 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:32:00 +0000 Subject: [PATCH 08/10] `getFilterMessages` returns a array no object --- packages/web3-shh/types/index.d.ts | 2 +- packages/web3-shh/types/tests/shh-test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-shh/types/index.d.ts b/packages/web3-shh/types/index.d.ts index 34fa64fe75a..520ef1b8e7e 100644 --- a/packages/web3-shh/types/index.d.ts +++ b/packages/web3-shh/types/index.d.ts @@ -54,7 +54,7 @@ export class Shh extends AbstractWeb3Module { clearSubscriptions(): boolean; newMessageFilter(options?: SubscriptionOptions): Promise; // update docs deleteMessageFilter(id: string): Promise; // update docs - getFilterMessages(id: string): Promise; // update docs + getFilterMessages(id: string): Promise; // update docs } export interface Info { diff --git a/packages/web3-shh/types/tests/shh-test.ts b/packages/web3-shh/types/tests/shh-test.ts index 2c994a5cf41..c1459e7f31b 100644 --- a/packages/web3-shh/types/tests/shh-test.ts +++ b/packages/web3-shh/types/tests/shh-test.ts @@ -189,5 +189,5 @@ shh.newMessageFilter(); // $ExpectType Promise shh.deleteMessageFilter('2b47fbafb3cce24570812a82e6e93cd9e2551bbc4823f6548ff0d82d2206b326'); -// $ExpectType Promise +// $ExpectType Promise shh.getFilterMessages('2b47fbafb3cce24570812a82e6e93cd9e2551bbc4823f6548ff0d82d2206b326'); From 8b295ba6a41ee652053358c6ec2ed079ad366050 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:32:53 +0000 Subject: [PATCH 09/10] remove the `update docs` reminder --- packages/web3-shh/types/index.d.ts | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/web3-shh/types/index.d.ts b/packages/web3-shh/types/index.d.ts index 520ef1b8e7e..5b15f2c1459 100644 --- a/packages/web3-shh/types/index.d.ts +++ b/packages/web3-shh/types/index.d.ts @@ -32,29 +32,29 @@ export class Shh extends AbstractWeb3Module { readonly givenProvider: provider | null; BatchRequest: new() => BatchRequest; net: Network; - getVersion(callback?: (error: Error, version: string) => void): Promise; // update docs - getInfo(callback?: (error: Error, info: Info) => void): Promise; // update docs - setMaxMessageSize(size: number, callback?: (error: Error, result: boolean) => void): Promise; // update docs - setMinPoW(pow: number, callback?: (error: Error, result: boolean) => void): Promise; // update docs - markTrustedPeer(enode: string, callback?: (error: Error, result: boolean) => void): Promise // update docs - newKeyPair(callback?: (error: Error, key: string) => void): Promise; // update docs - addPrivateKey(privateKey: string, callback?: (error: Error, privateKey: string) => void): Promise; // update docs - deleteKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs - hasKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs - getPublicKey(id: string, callback?: (error: Error, publicKey: string) => void): Promise; // update docs - getPrivateKey(id: string, callback?: (error: Error, privateKey: string) => void): Promise; // update docs - newSymKey(callback?: (error: Error, key: string) => void): Promise; // update docs - addSymKey(symKey: string, callback?: (error: Error, key: string) => void): Promise; // update docs - generateSymKeyFromPassword(password: string, callback?: (error: Error, key: string) => void): Promise; // update docs - hasSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise; // update docs - getSymKey(id: string, callback?: (error: Error, key: string) => void): Promise; // update docs - deleteSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise // update docs + getVersion(callback?: (error: Error, version: string) => void): Promise; + getInfo(callback?: (error: Error, info: Info) => void): Promise; + setMaxMessageSize(size: number, callback?: (error: Error, result: boolean) => void): Promise; + setMinPoW(pow: number, callback?: (error: Error, result: boolean) => void): Promise; + markTrustedPeer(enode: string, callback?: (error: Error, result: boolean) => void): Promise + newKeyPair(callback?: (error: Error, key: string) => void): Promise; + addPrivateKey(privateKey: string, callback?: (error: Error, privateKey: string) => void): Promise; + deleteKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; + hasKeyPair(id: string, callback?: (error: Error, result: boolean) => void): Promise; + getPublicKey(id: string, callback?: (error: Error, publicKey: string) => void): Promise; + getPrivateKey(id: string, callback?: (error: Error, privateKey: string) => void): Promise; + newSymKey(callback?: (error: Error, key: string) => void): Promise; + addSymKey(symKey: string, callback?: (error: Error, key: string) => void): Promise; + generateSymKeyFromPassword(password: string, callback?: (error: Error, key: string) => void): Promise; + hasSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise; + getSymKey(id: string, callback?: (error: Error, key: string) => void): Promise; + deleteSymKey(id: string, callback?: (error: Error, result: boolean) => void): Promise post(object: PostWithSymKey | PostWithPubKey, callback?: (error: Error, result: string) => void): Promise; subscribe(string: 'messages', options: SubscriptionOptions, callback?: (error: Error, message: Notification, subscription: any) => void): Subscribe; clearSubscriptions(): boolean; - newMessageFilter(options?: SubscriptionOptions): Promise; // update docs - deleteMessageFilter(id: string): Promise; // update docs - getFilterMessages(id: string): Promise; // update docs + newMessageFilter(options?: SubscriptionOptions): Promise; + deleteMessageFilter(id: string): Promise; + getFilterMessages(id: string): Promise; } export interface Info { From 53adab12a3d8cf2cc498972fb39db78b06dcc057 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Sat, 15 Dec 2018 15:41:58 +0000 Subject: [PATCH 10/10] make sure `shh-test.ts` is the correct @file --- packages/web3-shh/types/tests/shh-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-shh/types/tests/shh-test.ts b/packages/web3-shh/types/tests/shh-test.ts index c1459e7f31b..cf88ce407d5 100644 --- a/packages/web3-shh/types/tests/shh-test.ts +++ b/packages/web3-shh/types/tests/shh-test.ts @@ -12,7 +12,7 @@ along with web3.js. If not, see . */ /** - * @file eth-tests.ts + * @file shh-tests.ts * @author Josh Stevens * @date 2018 */