diff --git a/web3.js/.eslintrc.js b/web3.js/.eslintrc.js index 5cb586ce87..44b378b941 100644 --- a/web3.js/.eslintrc.js +++ b/web3.js/.eslintrc.js @@ -3,6 +3,7 @@ module.exports = { browser: true, es6: true, node: true, + mocha: true, }, extends: [ 'eslint:recommended', diff --git a/web3.js/.gitignore b/web3.js/.gitignore index 7cc5fcd60c..ac1f2b5f38 100644 --- a/web3.js/.gitignore +++ b/web3.js/.gitignore @@ -11,6 +11,7 @@ node_modules # Coverage coverage +.nyc_output # Release lib diff --git a/web3.js/flow-typed/bn.js.js b/web3.js/flow-typed/bn.js.js deleted file mode 100644 index 5412142593..0000000000 --- a/web3.js/flow-typed/bn.js.js +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'bn.js' { - // TODO: Fill in types - declare module.exports: any; -} diff --git a/web3.js/flow-typed/bs58.js b/web3.js/flow-typed/bs58.js deleted file mode 100644 index 191d28dace..0000000000 --- a/web3.js/flow-typed/bs58.js +++ /dev/null @@ -1,6 +0,0 @@ -declare module "bs58" { - declare module.exports: { - encode(input: Buffer): string; - decode(input: string): Buffer; - }; -} diff --git a/web3.js/flow-typed/buffer-layout.js b/web3.js/flow-typed/buffer-layout.js deleted file mode 100644 index 9dd66fe11c..0000000000 --- a/web3.js/flow-typed/buffer-layout.js +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'buffer-layout' { - // TODO: Fill in types - declare module.exports: any; -} diff --git a/web3.js/flow-typed/elfy.js b/web3.js/flow-typed/elfy.js deleted file mode 100644 index 8c40e7ca82..0000000000 --- a/web3.js/flow-typed/elfy.js +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'elfy' { - // TODO: Fill in types - declare module.exports: any; -} diff --git a/web3.js/flow-typed/jayson.js b/web3.js/flow-typed/jayson.js deleted file mode 100644 index 09e1bd5b46..0000000000 --- a/web3.js/flow-typed/jayson.js +++ /dev/null @@ -1,3 +0,0 @@ -declare module 'jayson/lib/client/browser' { - declare module.exports: any; -} diff --git a/web3.js/flow-typed/js-sha3.js b/web3.js/flow-typed/js-sha3.js deleted file mode 100644 index 5f08f8ec19..0000000000 --- a/web3.js/flow-typed/js-sha3.js +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'js-sha3' { - // TODO: Fill in types - declare module.exports: any; -} diff --git a/web3.js/flow-typed/node-fetch.js b/web3.js/flow-typed/node-fetch.js deleted file mode 100644 index 2535d15bc3..0000000000 --- a/web3.js/flow-typed/node-fetch.js +++ /dev/null @@ -1,27 +0,0 @@ -declare module 'node-fetch' { - declare export type Config = { - method?: string; - headers?: {[key: string]: string}; - compress?: bool; - body?: Buffer|string; - size?: number; - } - - declare export class Headers { - get(name: string): ?string; - set(name: string, value: string): void; - } - - declare export class Response { - url: string; - status: string; - statusText: string; - headers: Headers; - ok: bool; - - json(): Promise; - text(): Promise; - } - - declare export default (url: string, config?: Config) => Promise; -} diff --git a/web3.js/flow-typed/npm/@solana/spl-token_vx.x.x.js b/web3.js/flow-typed/npm/@solana/spl-token_vx.x.x.js index f86f65e94a..a0cf7160e8 100644 --- a/web3.js/flow-typed/npm/@solana/spl-token_vx.x.x.js +++ b/web3.js/flow-typed/npm/@solana/spl-token_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 069c76ac6f0b539483367fd95c435241 -// flow-typed version: <>/@solana/spl-token_v0.0.4/flow_v0.130.0 +// flow-typed signature: 31deb8fc07c5ce70371c5efad579a253 +// flow-typed version: <>/@solana/spl-token_v^0.0.13/flow_v0.130.0 /** * This is an autogenerated libdef stub for: diff --git a/web3.js/flow-typed/npm/bn.js_vx.x.x.js b/web3.js/flow-typed/npm/bn.js_vx.x.x.js new file mode 100644 index 0000000000..9aa89b64a2 --- /dev/null +++ b/web3.js/flow-typed/npm/bn.js_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: 8da8649cde7e433ccfab3b776be3b79b +// flow-typed version: <>/bn.js_v^5.0.0/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'bn.js' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'bn.js' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'bn.js/lib/bn' { + declare module.exports: any; +} + +// Filename aliases +declare module 'bn.js/lib/bn.js' { + declare module.exports: $Exports<'bn.js/lib/bn'>; +} diff --git a/web3.js/flow-typed/npm/bs58_vx.x.x.js b/web3.js/flow-typed/npm/bs58_vx.x.x.js new file mode 100644 index 0000000000..458b1468cc --- /dev/null +++ b/web3.js/flow-typed/npm/bs58_vx.x.x.js @@ -0,0 +1,33 @@ +// flow-typed signature: f3d56571af5a1fa4e9a01cf0c8719c35 +// flow-typed version: <>/bs58_v^4.0.1/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'bs58' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'bs58' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ + + +// Filename aliases +declare module 'bs58/index' { + declare module.exports: $Exports<'bs58'>; +} +declare module 'bs58/index.js' { + declare module.exports: $Exports<'bs58'>; +} diff --git a/web3.js/flow-typed/npm/buffer-layout_vx.x.x.js b/web3.js/flow-typed/npm/buffer-layout_vx.x.x.js new file mode 100644 index 0000000000..d6fd8faedb --- /dev/null +++ b/web3.js/flow-typed/npm/buffer-layout_vx.x.x.js @@ -0,0 +1,53 @@ +// flow-typed signature: 1d431fcaaa378246e77473538c349228 +// flow-typed version: <>/buffer-layout_v^1.2.0/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'buffer-layout' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'buffer-layout' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'buffer-layout/jsdoc/custom/local' { + declare module.exports: any; +} + +declare module 'buffer-layout/lib/Layout' { + declare module.exports: any; +} + +declare module 'buffer-layout/test/examples' { + declare module.exports: any; +} + +declare module 'buffer-layout/test/LayoutTest' { + declare module.exports: any; +} + +// Filename aliases +declare module 'buffer-layout/jsdoc/custom/local.js' { + declare module.exports: $Exports<'buffer-layout/jsdoc/custom/local'>; +} +declare module 'buffer-layout/lib/Layout.js' { + declare module.exports: $Exports<'buffer-layout/lib/Layout'>; +} +declare module 'buffer-layout/test/examples.js' { + declare module.exports: $Exports<'buffer-layout/test/examples'>; +} +declare module 'buffer-layout/test/LayoutTest.js' { + declare module.exports: $Exports<'buffer-layout/test/LayoutTest'>; +} diff --git a/web3.js/flow-typed/npm/buffer_vx.x.x.js b/web3.js/flow-typed/npm/buffer_vx.x.x.js new file mode 100644 index 0000000000..9d7f69e9e5 --- /dev/null +++ b/web3.js/flow-typed/npm/buffer_vx.x.x.js @@ -0,0 +1,33 @@ +// flow-typed signature: 8dedcebf9a48fa95d40824e83a7eef7d +// flow-typed version: <>/buffer_v6.0.1/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'buffer' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'buffer' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ + + +// Filename aliases +declare module 'buffer/index' { + declare module.exports: $Exports<'buffer'>; +} +declare module 'buffer/index.js' { + declare module.exports: $Exports<'buffer'>; +} diff --git a/web3.js/flow-typed/npm/chai-as-promised_vx.x.x.js b/web3.js/flow-typed/npm/chai-as-promised_vx.x.x.js new file mode 100644 index 0000000000..8e9fe5c47b --- /dev/null +++ b/web3.js/flow-typed/npm/chai-as-promised_vx.x.x.js @@ -0,0 +1,32 @@ +// flow-typed signature: 70e0166de5b4ddabe4c61a208b761844 +// flow-typed version: <>/chai-as-promised_v^7.1.1/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'chai-as-promised' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'chai-as-promised' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'chai-as-promised/lib/chai-as-promised' { + declare module.exports: any; +} + +// Filename aliases +declare module 'chai-as-promised/lib/chai-as-promised.js' { + declare module.exports: $Exports<'chai-as-promised/lib/chai-as-promised'>; +} diff --git a/web3.js/flow-typed/npm/chai_v4.x.x.js b/web3.js/flow-typed/npm/chai_v4.x.x.js new file mode 100644 index 0000000000..98de99ca2d --- /dev/null +++ b/web3.js/flow-typed/npm/chai_v4.x.x.js @@ -0,0 +1,304 @@ +// flow-typed signature: 055d97c4302b7989c7221251421dca7c +// flow-typed version: 673c7738c2/chai_v4.x.x/flow_>=v0.104.x + +declare module "chai" { + declare type ExpectChain = { + and: ExpectChain, + at: ExpectChain, + be: ExpectChain, + been: ExpectChain, + have: ExpectChain, + has: ExpectChain, + is: ExpectChain, + of: ExpectChain, + same: ExpectChain, + that: ExpectChain, + to: ExpectChain, + which: ExpectChain, + with: ExpectChain, + not: ExpectChain, + deep: ExpectChain, + any: ExpectChain, + all: ExpectChain, + own: ExpectChain, + a: ExpectChain & ((type: string, message?: string) => ExpectChain), + an: ExpectChain & ((type: string, message?: string) => ExpectChain), + include: ExpectChain & ((value: mixed, message?: string) => ExpectChain), + includes: ExpectChain & ((value: mixed, message?: string) => ExpectChain), + contain: ExpectChain & ((value: mixed, message?: string) => ExpectChain), + contains: ExpectChain & ((value: mixed, message?: string) => ExpectChain), + eq: (value: T, message?: string) => ExpectChain, + eql: (value: T, message?: string) => ExpectChain, + equal: (value: T, message?: string) => ExpectChain, + equals: (value: T, message?: string) => ExpectChain, + above: (value: T & number, message?: string) => ExpectChain, + gt: (value: T & number, message?: string) => ExpectChain, + greaterThan: (value: T & number, message?: string) => ExpectChain, + least: (value: T & number, message?: string) => ExpectChain, + below: (value: T & number, message?: string) => ExpectChain, + lessThan: (value: T & number, message?: string) => ExpectChain, + lt: (value: T & number, message?: string) => ExpectChain, + most: (value: T & number, message?: string) => ExpectChain, + within: (start: T & number, finish: T & number, message?: string) => ExpectChain, + instanceof: (constructor: mixed, message?: string) => ExpectChain, + instanceOf: (constructor: mixed, message?: string) => ExpectChain, + nested: ExpectChain, + property:

( + name: string, + value?: P, + message?: string + ) => ExpectChain

& ((name: string) => ExpectChain), + length: ExpectChain & ((value: number, message?: string) => ExpectChain), + lengthOf: (value: number, message?: string) => ExpectChain, + match: (regex: RegExp, message?: string) => ExpectChain, + matches: (regex: RegExp, message?: string) => ExpectChain, + string: (string: string, message?: string) => ExpectChain, + key: (key: string) => ExpectChain, + keys: ( + key: string | Array, + ...keys: Array + ) => ExpectChain, + throw: ( + err?: Class | Error | RegExp | string, + errMsgMatcher?: RegExp | string, + msg?: string + ) => ExpectChain, + respondTo: (method: string, message?: string) => ExpectChain, + itself: ExpectChain, + satisfy: (method: (value: T) => boolean, message?: string) => ExpectChain, + closeTo: (expected: T & number, delta: number, message?: string) => ExpectChain, + members: (set: mixed, message?: string) => ExpectChain, + oneOf: (list: Array, message?: string) => ExpectChain, + change: (obj: mixed, key: string, message?: string) => ExpectChain, + increase: (obj: mixed, key: string, message?: string) => ExpectChain, + decrease: (obj: mixed, key: string, message?: string) => ExpectChain, + by: (delta: number, message?: string) => ExpectChain, + ordered: ExpectChain, + // dirty-chai + ok: () => ExpectChain, + true: () => ExpectChain, + false: () => ExpectChain, + null: () => ExpectChain, + undefined: () => ExpectChain, + exist: () => ExpectChain, + empty: () => ExpectChain, + extensible: () => ExpectChain, + sealed: () => ExpectChain, + frozen: () => ExpectChain, + NaN: () => ExpectChain, + // chai-immutable + size: (n: number) => ExpectChain, + // sinon-chai + called: () => ExpectChain, + callCount: (n: number) => ExpectChain, + calledOnce: () => ExpectChain, + calledTwice: () => ExpectChain, + calledThrice: () => ExpectChain, + calledBefore: (spy: mixed) => ExpectChain, + calledAfter: (spy: mixed) => ExpectChain, + calledImmediatelyBefore: (spy: mixed) => ExpectChain, + calledImmediatelyAfter: (spy: mixed) => ExpectChain, + calledWith: (...args: Array) => ExpectChain, + calledOnceWith: (...args: Array) => ExpectChain, + calledWithMatch: (...args: Array) => ExpectChain, + calledWithExactly: (...args: Array) => ExpectChain, + calledOnceWithExactly: (...args: Array) => ExpectChain, + returned: (returnVal: mixed) => ExpectChain, + alwaysReturned: (returnVal: mixed) => ExpectChain, + // chai-as-promised + eventually: ExpectChain, + resolvedWith: (value: mixed) => Promise & ExpectChain, + resolved: () => Promise & ExpectChain, + rejectedWith: ( + value: mixed, + errMsgMatcher?: RegExp | string, + msg?: string + ) => Promise & ExpectChain, + rejected: () => Promise & ExpectChain, + notify: (callback: () => mixed) => ExpectChain, + fulfilled: () => Promise & ExpectChain, + // chai-subset + containSubset: (obj: {...} | Array< {...} >) => ExpectChain, + // chai-redux-mock-store + dispatchedActions: ( + actions: Array<{...} | ((action: {...}) => any)> + ) => ExpectChain, + dispatchedTypes: (actions: Array) => ExpectChain, + // chai-enzyme + attr: (key: string, val?: any) => ExpectChain, + data: (key: string, val?: any) => ExpectChain, + prop: (key: string, val?: any) => ExpectChain, + state: (key: string, val?: any) => ExpectChain, + value: (val: string) => ExpectChain, + className: (val: string) => ExpectChain, + text: (val: string) => ExpectChain, + // chai-karma-snapshot + matchSnapshot: (lang?: any, update?: boolean, msg?: any) => ExpectChain, + ... + }; + + + declare var expect: { + (actual: T, message?: string): ExpectChain, + fail: ((message?: string) => void) & ((actual: any, expected: any, message?: string, operator?: string) => void), + ... + }; + + declare function use(plugin: (chai: Object, utils: Object) => void): void; + + declare class assert { + static (expression: mixed, message?: string): void; + static fail( + actual: mixed, + expected: mixed, + message?: string, + operator?: string + ): void; + + static isOk(object: mixed, message?: string): void; + static isNotOk(object: mixed, message?: string): void; + + static empty(object: mixed, message?: string): void; + static isEmpty(object: mixed, message?: string): void; + static notEmpty(object: mixed, message?: string): void; + static isNotEmpty(object: mixed, message?: string): void; + + static equal(actual: mixed, expected: mixed, message?: string): void; + static notEqual(actual: mixed, expected: mixed, message?: string): void; + + static strictEqual(act: mixed, exp: mixed, msg?: string): void; + static notStrictEqual(act: mixed, exp: mixed, msg?: string): void; + + static deepEqual(act: mixed, exp: mixed, msg?: string): void; + static notDeepEqual(act: mixed, exp: mixed, msg?: string): void; + + static ok(val: mixed, msg?: string): void; + static isTrue(val: mixed, msg?: string): void; + static isNotTrue(val: mixed, msg?: string): void; + static isFalse(val: mixed, msg?: string): void; + static isNotFalse(val: mixed, msg?: string): void; + + static isNull(val: mixed, msg?: string): void; + static isNotNull(val: mixed, msg?: string): void; + + static isUndefined(val: mixed, msg?: string): void; + static isDefined(val: mixed, msg?: string): void; + + static isNaN(val: mixed, msg?: string): void; + static isNotNaN(val: mixed, msg?: string): void; + + static isAbove(val: number, abv: number, msg?: string): void; + static isBelow(val: number, blw: number, msg?: string): void; + + static exists(val : mixed, msg? : string) : void; + static notExists(val : mixed, msg? : string) : void; + + static isAtMost(val: number, atmst: number, msg?: string): void; + static isAtLeast(val: number, atlst: number, msg?: string): void; + + static isFunction(val: mixed, msg?: string): void; + static isNotFunction(val: mixed, msg?: string): void; + + static isObject(val: mixed, msg?: string): void; + static isNotObject(val: mixed, msg?: string): void; + + static isArray(val: mixed, msg?: string): void; + static isNotArray(val: mixed, msg?: string): void; + + static isString(val: mixed, msg?: string): void; + static isNotString(val: mixed, msg?: string): void; + + static isNumber(val: mixed, msg?: string): void; + static isNotNumber(val: mixed, msg?: string): void; + + static isBoolean(val: mixed, msg?: string): void; + static isNotBoolean(val: mixed, msg?: string): void; + + static typeOf(val: mixed, type: string, msg?: string): void; + static notTypeOf(val: mixed, type: string, msg?: string): void; + + static instanceOf(val: mixed, constructor: Class< * >, msg?: string): void; + static notInstanceOf(val: mixed, constructor: Class< * >, msg?: string): void; + + static include(exp: string, inc: mixed, msg?: string): void; + static include(exp: Array, inc: T, msg?: string): void; + + static notInclude(exp: string, inc: mixed, msg?: string): void; + static notInclude(exp: Array, inc: T, msg?: string): void; + + static deepInclude(haystack : T[] | string, needle : $Shape, msg?: string) : void; + static notDeepInclude(haystack : T[] | string, needle : $Shape, msg?: string) : void; + + static match(exp: mixed, re: RegExp, msg?: string): void; + static notMatch(exp: mixed, re: RegExp, msg?: string): void; + + static property(obj: Object, prop: string, msg?: string): void; + static notProperty(obj: Object, prop: string, msg?: string): void; + static deepProperty(obj: Object, prop: string, msg?: string): void; + static notDeepProperty(obj: Object, prop: string, msg?: string): void; + + static propertyVal( + obj: Object, + prop: string, + val: mixed, + msg?: string + ): void; + static propertyNotVal( + obj: Object, + prop: string, + val: mixed, + msg?: string + ): void; + + static deepPropertyVal( + obj: Object, + prop: string, + val: mixed, + msg?: string + ): void; + static deepPropertyNotVal( + obj: Object, + prop: string, + val: mixed, + msg?: string + ): void; + + static lengthOf(exp: mixed, len: number, msg?: string): void; + + static throws( + func: () => any, + err?: Class | Error | RegExp | string, + errorMsgMatcher?: string | RegExp, + msg?: string + ): void; + static doesNotThrow( + func: () => any, + err?: Class | Error | RegExp | string, + errorMsgMatcher?: string | RegExp, + msg?: string + ): void; + + static closeTo( + actual: number, + expected: number, + delta: number, + msg?: string + ): void; + static approximately( + actual: number, + expected: number, + delta: number, + msg?: string + ): void; + + // chai-immutable + static sizeOf(val: mixed, length: number): void; + } + + declare var config: { + includeStack: boolean, + showDiff: boolean, + truncateThreshold: number, + ... + }; +} diff --git a/web3.js/flow-typed/npm/crypto-hash_vx.x.x.js b/web3.js/flow-typed/npm/crypto-hash_vx.x.x.js index 7acfdfa8ff..9df2f839dd 100644 --- a/web3.js/flow-typed/npm/crypto-hash_vx.x.x.js +++ b/web3.js/flow-typed/npm/crypto-hash_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: bd59b655ec89c675a5f5c2188a37c49d -// flow-typed version: <>/crypto-hash_v1.2.2/flow_v0.120.1 +// flow-typed signature: c51ef53d90f82520f7f635d7c316e3ad +// flow-typed version: <>/crypto-hash_v^1.2.2/flow_v0.130.0 /** * This is an autogenerated libdef stub for: diff --git a/web3.js/flow-typed/npm/jayson_vx.x.x.js b/web3.js/flow-typed/npm/jayson_vx.x.x.js new file mode 100644 index 0000000000..5b04577b7e --- /dev/null +++ b/web3.js/flow-typed/npm/jayson_vx.x.x.js @@ -0,0 +1,251 @@ +// flow-typed signature: 8403af7bdb08869a610e6cf3c8467ca2 +// flow-typed version: <>/jayson_v^3.4.4/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'jayson' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'jayson' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'jayson/bin/jayson' { + declare module.exports: any; +} + +declare module 'jayson/lib/client/browser' { + declare module.exports: any; +} + +declare module 'jayson/lib/client/http' { + declare module.exports: any; +} + +declare module 'jayson/lib/client/https' { + declare module.exports: any; +} + +declare module 'jayson/lib/client' { + declare module.exports: any; +} + +declare module 'jayson/lib/client/tcp' { + declare module.exports: any; +} + +declare module 'jayson/lib/client/tls' { + declare module.exports: any; +} + +declare module 'jayson/lib/generateRequest' { + declare module.exports: any; +} + +declare module 'jayson/lib' { + declare module.exports: any; +} + +declare module 'jayson/lib/method' { + declare module.exports: any; +} + +declare module 'jayson/lib/server/http' { + declare module.exports: any; +} + +declare module 'jayson/lib/server/https' { + declare module.exports: any; +} + +declare module 'jayson/lib/server' { + declare module.exports: any; +} + +declare module 'jayson/lib/server/middleware' { + declare module.exports: any; +} + +declare module 'jayson/lib/server/tcp' { + declare module.exports: any; +} + +declare module 'jayson/lib/server/tls' { + declare module.exports: any; +} + +declare module 'jayson/lib/utils' { + declare module.exports: any; +} + +declare module 'jayson/promise' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client/browser' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client/http' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client/https' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client/tcp' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/client/tls' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/method' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/server' { + declare module.exports: any; +} + +declare module 'jayson/promise/lib/utils' { + declare module.exports: any; +} + +// Filename aliases +declare module 'jayson/bin/jayson.js' { + declare module.exports: $Exports<'jayson/bin/jayson'>; +} +declare module 'jayson/index' { + declare module.exports: $Exports<'jayson'>; +} +declare module 'jayson/index.js' { + declare module.exports: $Exports<'jayson'>; +} +declare module 'jayson/lib/client/browser/index' { + declare module.exports: $Exports<'jayson/lib/client/browser'>; +} +declare module 'jayson/lib/client/browser/index.js' { + declare module.exports: $Exports<'jayson/lib/client/browser'>; +} +declare module 'jayson/lib/client/http.js' { + declare module.exports: $Exports<'jayson/lib/client/http'>; +} +declare module 'jayson/lib/client/https.js' { + declare module.exports: $Exports<'jayson/lib/client/https'>; +} +declare module 'jayson/lib/client/index' { + declare module.exports: $Exports<'jayson/lib/client'>; +} +declare module 'jayson/lib/client/index.js' { + declare module.exports: $Exports<'jayson/lib/client'>; +} +declare module 'jayson/lib/client/tcp.js' { + declare module.exports: $Exports<'jayson/lib/client/tcp'>; +} +declare module 'jayson/lib/client/tls.js' { + declare module.exports: $Exports<'jayson/lib/client/tls'>; +} +declare module 'jayson/lib/generateRequest.js' { + declare module.exports: $Exports<'jayson/lib/generateRequest'>; +} +declare module 'jayson/lib/index' { + declare module.exports: $Exports<'jayson/lib'>; +} +declare module 'jayson/lib/index.js' { + declare module.exports: $Exports<'jayson/lib'>; +} +declare module 'jayson/lib/method.js' { + declare module.exports: $Exports<'jayson/lib/method'>; +} +declare module 'jayson/lib/server/http.js' { + declare module.exports: $Exports<'jayson/lib/server/http'>; +} +declare module 'jayson/lib/server/https.js' { + declare module.exports: $Exports<'jayson/lib/server/https'>; +} +declare module 'jayson/lib/server/index' { + declare module.exports: $Exports<'jayson/lib/server'>; +} +declare module 'jayson/lib/server/index.js' { + declare module.exports: $Exports<'jayson/lib/server'>; +} +declare module 'jayson/lib/server/middleware.js' { + declare module.exports: $Exports<'jayson/lib/server/middleware'>; +} +declare module 'jayson/lib/server/tcp.js' { + declare module.exports: $Exports<'jayson/lib/server/tcp'>; +} +declare module 'jayson/lib/server/tls.js' { + declare module.exports: $Exports<'jayson/lib/server/tls'>; +} +declare module 'jayson/lib/utils.js' { + declare module.exports: $Exports<'jayson/lib/utils'>; +} +declare module 'jayson/promise/index' { + declare module.exports: $Exports<'jayson/promise'>; +} +declare module 'jayson/promise/index.js' { + declare module.exports: $Exports<'jayson/promise'>; +} +declare module 'jayson/promise/lib/client/browser/index' { + declare module.exports: $Exports<'jayson/promise/lib/client/browser'>; +} +declare module 'jayson/promise/lib/client/browser/index.js' { + declare module.exports: $Exports<'jayson/promise/lib/client/browser'>; +} +declare module 'jayson/promise/lib/client/http.js' { + declare module.exports: $Exports<'jayson/promise/lib/client/http'>; +} +declare module 'jayson/promise/lib/client/https.js' { + declare module.exports: $Exports<'jayson/promise/lib/client/https'>; +} +declare module 'jayson/promise/lib/client/index' { + declare module.exports: $Exports<'jayson/promise/lib/client'>; +} +declare module 'jayson/promise/lib/client/index.js' { + declare module.exports: $Exports<'jayson/promise/lib/client'>; +} +declare module 'jayson/promise/lib/client/tcp.js' { + declare module.exports: $Exports<'jayson/promise/lib/client/tcp'>; +} +declare module 'jayson/promise/lib/client/tls.js' { + declare module.exports: $Exports<'jayson/promise/lib/client/tls'>; +} +declare module 'jayson/promise/lib/index' { + declare module.exports: $Exports<'jayson/promise/lib'>; +} +declare module 'jayson/promise/lib/index.js' { + declare module.exports: $Exports<'jayson/promise/lib'>; +} +declare module 'jayson/promise/lib/method.js' { + declare module.exports: $Exports<'jayson/promise/lib/method'>; +} +declare module 'jayson/promise/lib/server.js' { + declare module.exports: $Exports<'jayson/promise/lib/server'>; +} +declare module 'jayson/promise/lib/utils.js' { + declare module.exports: $Exports<'jayson/promise/lib/utils'>; +} diff --git a/web3.js/flow-typed/npm/js-sha3_vx.x.x.js b/web3.js/flow-typed/npm/js-sha3_vx.x.x.js new file mode 100644 index 0000000000..54aaec2c29 --- /dev/null +++ b/web3.js/flow-typed/npm/js-sha3_vx.x.x.js @@ -0,0 +1,39 @@ +// flow-typed signature: 3f5253ee300391e662d9c724d020a98e +// flow-typed version: <>/js-sha3_v^0.8.0/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'js-sha3' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'js-sha3' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'js-sha3/build/sha3.min' { + declare module.exports: any; +} + +declare module 'js-sha3/src/sha3' { + declare module.exports: any; +} + +// Filename aliases +declare module 'js-sha3/build/sha3.min.js' { + declare module.exports: $Exports<'js-sha3/build/sha3.min'>; +} +declare module 'js-sha3/src/sha3.js' { + declare module.exports: $Exports<'js-sha3/src/sha3'>; +} diff --git a/web3.js/flow-typed/npm/mocha_v8.x.x.js b/web3.js/flow-typed/npm/mocha_v8.x.x.js new file mode 100644 index 0000000000..7affb5c0c2 --- /dev/null +++ b/web3.js/flow-typed/npm/mocha_v8.x.x.js @@ -0,0 +1,238 @@ +// flow-typed signature: 195cec6dc98ab7533f0eb927ee493f99 +// flow-typed version: 1a6d5d1968/mocha_v8.x.x/flow_>=v0.104.x + +declare interface $npm$mocha$SetupOptions { + slow?: number; + timeout?: number; + ui?: string; + globals?: Array; + reporter?: any; + bail?: boolean; + ignoreLeaks?: boolean; + grep?: any; +} + +declare type $npm$mocha$done = (error?: any) => any; + +// declare interface $npm$mocha$SuiteCallbackContext { +// timeout(ms: number): void; +// retries(n: number): void; +// slow(ms: number): void; +// } + +// declare interface $npm$mocha$TestCallbackContext { +// skip(): void; +// timeout(ms: number): void; +// retries(n: number): void; +// slow(ms: number): void; +// [index: string]: any; +// } + +declare interface $npm$mocha$Suite { + parent: $npm$mocha$Suite; + title: string; + fullTitle(): string; +} + +declare type $npm$mocha$ContextDefinition = {| + (description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite; + only(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): $npm$mocha$Suite; + skip(description: string, callback: (/* this: $npm$mocha$SuiteCallbackContext */) => void): void; + timeout(ms: number): void; +|} + +declare type $npm$mocha$TestDefinition = {| + (expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test; + only(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): $npm$mocha$Test; + skip(expectation: string, callback?: (/* this: $npm$mocha$TestCallbackContext, */ done: $npm$mocha$done) => mixed): void; + timeout(ms: number): void; + state: 'failed' | 'passed'; +|} + +declare interface $npm$mocha$Runner {} + +declare class $npm$mocha$BaseReporter { + stats: { + suites: number, + tests: number, + passes: number, + pending: number, + failures: number, + ... + }; + + constructor(runner: $npm$mocha$Runner): $npm$mocha$BaseReporter; +} + +declare class $npm$mocha$DocReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$DotReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$HTMLReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$HTMLCovReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONCovReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$JSONStreamReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$LandingReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$ListReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$MarkdownReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$MinReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$NyanReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$ProgressReporter extends $npm$mocha$BaseReporter { + constructor(runner: $npm$mocha$Runner, options?: { + open?: string, + complete?: string, + incomplete?: string, + close?: string, + ... + }): $npm$mocha$ProgressReporter; +} +declare class $npm$mocha$SpecReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$TAPReporter extends $npm$mocha$BaseReporter {} +declare class $npm$mocha$XUnitReporter extends $npm$mocha$BaseReporter { + constructor(runner: $npm$mocha$Runner, options?: any): $npm$mocha$XUnitReporter; +} + +declare class $npm$mocha$Mocha { + currentTest: $npm$mocha$TestDefinition; + constructor(options?: { + grep?: RegExp, + ui?: string, + reporter?: string, + timeout?: number, + reporterOptions?: any, + slow?: number, + bail?: boolean, + ... + }): $npm$mocha$Mocha; + setup(options: $npm$mocha$SetupOptions): this; + bail(value?: boolean): this; + addFile(file: string): this; + reporter(name: string): this; + reporter(reporter: (runner: $npm$mocha$Runner, options: any) => any): this; + ui(value: string): this; + grep(value: string): this; + grep(value: RegExp): this; + invert(): this; + ignoreLeaks(value: boolean): this; + checkLeaks(): this; + throwError(error: Error): void; + growl(): this; + globals(value: string): this; + globals(values: Array): this; + useColors(value: boolean): this; + useInlineDiffs(value: boolean): this; + timeout(value: number): this; + slow(value: number): this; + enableTimeouts(value: boolean): this; + asyncOnly(value: boolean): this; + noHighlighting(value: boolean): this; + run(onComplete?: (failures: number) => void): $npm$mocha$Runner; + + static reporters: { + Doc: $npm$mocha$DocReporter, + Dot: $npm$mocha$DotReporter, + HTML: $npm$mocha$HTMLReporter, + HTMLCov: $npm$mocha$HTMLCovReporter, + JSON: $npm$mocha$JSONReporter, + JSONCov: $npm$mocha$JSONCovReporter, + JSONStream: $npm$mocha$JSONStreamReporter, + Landing: $npm$mocha$LandingReporter, + List: $npm$mocha$ListReporter, + Markdown: $npm$mocha$MarkdownReporter, + Min: $npm$mocha$MinReporter, + Nyan: $npm$mocha$NyanReporter, + Progress: $npm$mocha$ProgressReporter, + ... + }; +} + +// declare interface $npm$mocha$HookCallbackContext { +// skip(): void; +// timeout(ms: number): void; +// [index: string]: any; +// } + +declare interface $npm$mocha$Runnable { + title: string; + fn: Function; + async: boolean; + sync: boolean; + timedOut: boolean; +} + +declare interface $npm$mocha$Test extends $npm$mocha$Runnable { + parent: $npm$mocha$Suite; + pending: boolean; + state: 'failed' | 'passed' | void; + fullTitle(): string; + timeout(ms: number): void; +} + +// declare interface $npm$mocha$BeforeAndAfterContext extends $npm$mocha$HookCallbackContext { +// currentTest: $npm$mocha$Test; +// } + +declare var mocha: $npm$mocha$Mocha; +declare var describe: $npm$mocha$ContextDefinition; +declare var xdescribe: $npm$mocha$ContextDefinition; +declare var context: $npm$mocha$ContextDefinition; +declare var suite: $npm$mocha$ContextDefinition; +declare var it: $npm$mocha$TestDefinition; +declare var xit: $npm$mocha$TestDefinition; +declare var test: $npm$mocha$TestDefinition; +declare var specify: $npm$mocha$TestDefinition; + +type Run = () => void; + +declare var run: Run; + +type Setup = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type Teardown = (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type SuiteSetup = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type SuiteTeardown = (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type Before = + | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type After = + | (callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$HookCallbackContext, */ done: $npm$mocha$done) => mixed) => void; +type BeforeEach = + | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; +type AfterEach = + | (callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void + | (description: string, callback: (/* this: $npm$mocha$BeforeAndAfterContext, */ done: $npm$mocha$done) => mixed) => void; + + +declare var setup: Setup; +declare var teardown: Teardown; +declare var suiteSetup: SuiteSetup; +declare var suiteTeardown; +declare var before: Before +declare var after: After; +declare var beforeEach: BeforeEach; +declare var afterEach: AfterEach; + +declare module "mocha" { + declare export var mocha: $npm$mocha$TestDefinition; + declare export var describe: $npm$mocha$ContextDefinition; + declare export var xdescribe: $npm$mocha$ContextDefinition; + declare export var context: $npm$mocha$ContextDefinition; + declare export var suite: $npm$mocha$ContextDefinition; + declare export var it: $npm$mocha$TestDefinition; + declare export var xit: $npm$mocha$TestDefinition; + declare export var test: $npm$mocha$TestDefinition; + declare export var specify: $npm$mocha$TestDefinition; + + declare export var run: Run; + + declare export var setup: Setup; + declare export var teardown: Teardown; + declare export var suiteSetup: SuiteSetup; + declare export var suiteTeardown: SuiteTeardown; + declare export var before: Before; + declare export var after: After; + declare export var beforeEach: BeforeEach; + declare export var afterEach: AfterEach; + + declare export default $npm$mocha$Mocha; +} diff --git a/web3.js/flow-typed/npm/mockttp_vx.x.x.js b/web3.js/flow-typed/npm/mockttp_vx.x.x.js new file mode 100644 index 0000000000..801bffe046 --- /dev/null +++ b/web3.js/flow-typed/npm/mockttp_vx.x.x.js @@ -0,0 +1,263 @@ +// flow-typed signature: e6c04a408e31a0534a8f15ba158400d1 +// flow-typed version: <>/mockttp_v^1.1.0/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'mockttp' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'mockttp' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'mockttp/dist/client/introspection-query' { + declare module.exports: any; +} + +declare module 'mockttp/dist/client/mocked-endpoint-client' { + declare module.exports: any; +} + +declare module 'mockttp/dist/client/mockttp-client' { + declare module.exports: any; +} + +declare module 'mockttp/dist/main-browser' { + declare module.exports: any; +} + +declare module 'mockttp/dist/main' { + declare module.exports: any; +} + +declare module 'mockttp/dist/mockttp' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/base-rule-builder' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/completion-checkers' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/matchers' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/requests/request-handlers' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/requests/request-rule-builder' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/requests/request-rule' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/rule-serialization' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/websockets/websocket-handlers' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/websockets/websocket-rule-builder' { + declare module.exports: any; +} + +declare module 'mockttp/dist/rules/websockets/websocket-rule' { + declare module.exports: any; +} + +declare module 'mockttp/dist/server/http-combo-server' { + declare module.exports: any; +} + +declare module 'mockttp/dist/server/mocked-endpoint' { + declare module.exports: any; +} + +declare module 'mockttp/dist/server/mockttp-server' { + declare module.exports: any; +} + +declare module 'mockttp/dist/standalone/mockttp-standalone' { + declare module.exports: any; +} + +declare module 'mockttp/dist/standalone/standalone-bin' { + declare module.exports: any; +} + +declare module 'mockttp/dist/standalone/standalone-model' { + declare module.exports: any; +} + +declare module 'mockttp/dist/types' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/destroyable-server' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/fs' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/normalize-url' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/promise' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/request-utils' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/serialization' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/socket-util' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/tls' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/type-utils' { + declare module.exports: any; +} + +declare module 'mockttp/dist/util/util' { + declare module.exports: any; +} + +declare module 'mockttp/docs/runkitExample' { + declare module.exports: any; +} + +// Filename aliases +declare module 'mockttp/dist/client/introspection-query.js' { + declare module.exports: $Exports<'mockttp/dist/client/introspection-query'>; +} +declare module 'mockttp/dist/client/mocked-endpoint-client.js' { + declare module.exports: $Exports<'mockttp/dist/client/mocked-endpoint-client'>; +} +declare module 'mockttp/dist/client/mockttp-client.js' { + declare module.exports: $Exports<'mockttp/dist/client/mockttp-client'>; +} +declare module 'mockttp/dist/main-browser.js' { + declare module.exports: $Exports<'mockttp/dist/main-browser'>; +} +declare module 'mockttp/dist/main.js' { + declare module.exports: $Exports<'mockttp/dist/main'>; +} +declare module 'mockttp/dist/mockttp.js' { + declare module.exports: $Exports<'mockttp/dist/mockttp'>; +} +declare module 'mockttp/dist/rules/base-rule-builder.js' { + declare module.exports: $Exports<'mockttp/dist/rules/base-rule-builder'>; +} +declare module 'mockttp/dist/rules/completion-checkers.js' { + declare module.exports: $Exports<'mockttp/dist/rules/completion-checkers'>; +} +declare module 'mockttp/dist/rules/matchers.js' { + declare module.exports: $Exports<'mockttp/dist/rules/matchers'>; +} +declare module 'mockttp/dist/rules/requests/request-handlers.js' { + declare module.exports: $Exports<'mockttp/dist/rules/requests/request-handlers'>; +} +declare module 'mockttp/dist/rules/requests/request-rule-builder.js' { + declare module.exports: $Exports<'mockttp/dist/rules/requests/request-rule-builder'>; +} +declare module 'mockttp/dist/rules/requests/request-rule.js' { + declare module.exports: $Exports<'mockttp/dist/rules/requests/request-rule'>; +} +declare module 'mockttp/dist/rules/rule-serialization.js' { + declare module.exports: $Exports<'mockttp/dist/rules/rule-serialization'>; +} +declare module 'mockttp/dist/rules/websockets/websocket-handlers.js' { + declare module.exports: $Exports<'mockttp/dist/rules/websockets/websocket-handlers'>; +} +declare module 'mockttp/dist/rules/websockets/websocket-rule-builder.js' { + declare module.exports: $Exports<'mockttp/dist/rules/websockets/websocket-rule-builder'>; +} +declare module 'mockttp/dist/rules/websockets/websocket-rule.js' { + declare module.exports: $Exports<'mockttp/dist/rules/websockets/websocket-rule'>; +} +declare module 'mockttp/dist/server/http-combo-server.js' { + declare module.exports: $Exports<'mockttp/dist/server/http-combo-server'>; +} +declare module 'mockttp/dist/server/mocked-endpoint.js' { + declare module.exports: $Exports<'mockttp/dist/server/mocked-endpoint'>; +} +declare module 'mockttp/dist/server/mockttp-server.js' { + declare module.exports: $Exports<'mockttp/dist/server/mockttp-server'>; +} +declare module 'mockttp/dist/standalone/mockttp-standalone.js' { + declare module.exports: $Exports<'mockttp/dist/standalone/mockttp-standalone'>; +} +declare module 'mockttp/dist/standalone/standalone-bin.js' { + declare module.exports: $Exports<'mockttp/dist/standalone/standalone-bin'>; +} +declare module 'mockttp/dist/standalone/standalone-model.js' { + declare module.exports: $Exports<'mockttp/dist/standalone/standalone-model'>; +} +declare module 'mockttp/dist/types.js' { + declare module.exports: $Exports<'mockttp/dist/types'>; +} +declare module 'mockttp/dist/util/destroyable-server.js' { + declare module.exports: $Exports<'mockttp/dist/util/destroyable-server'>; +} +declare module 'mockttp/dist/util/fs.js' { + declare module.exports: $Exports<'mockttp/dist/util/fs'>; +} +declare module 'mockttp/dist/util/normalize-url.js' { + declare module.exports: $Exports<'mockttp/dist/util/normalize-url'>; +} +declare module 'mockttp/dist/util/promise.js' { + declare module.exports: $Exports<'mockttp/dist/util/promise'>; +} +declare module 'mockttp/dist/util/request-utils.js' { + declare module.exports: $Exports<'mockttp/dist/util/request-utils'>; +} +declare module 'mockttp/dist/util/serialization.js' { + declare module.exports: $Exports<'mockttp/dist/util/serialization'>; +} +declare module 'mockttp/dist/util/socket-util.js' { + declare module.exports: $Exports<'mockttp/dist/util/socket-util'>; +} +declare module 'mockttp/dist/util/tls.js' { + declare module.exports: $Exports<'mockttp/dist/util/tls'>; +} +declare module 'mockttp/dist/util/type-utils.js' { + declare module.exports: $Exports<'mockttp/dist/util/type-utils'>; +} +declare module 'mockttp/dist/util/util.js' { + declare module.exports: $Exports<'mockttp/dist/util/util'>; +} +declare module 'mockttp/docs/runkitExample.js' { + declare module.exports: $Exports<'mockttp/docs/runkitExample'>; +} diff --git a/web3.js/flow-typed/mz.js b/web3.js/flow-typed/npm/mz_vx.x.x.js similarity index 93% rename from web3.js/flow-typed/mz.js rename to web3.js/flow-typed/npm/mz_vx.x.x.js index b4b12f404b..aadd70d977 100644 --- a/web3.js/flow-typed/mz.js +++ b/web3.js/flow-typed/npm/mz_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: ed29f42bf4f4916e4f3ba1f5e7343c9d -// flow-typed version: <>/mz_v2.7.0/flow_v0.81.0 +// flow-typed signature: 13be1c0af46f0b45a9b2f67afe924e06 +// flow-typed version: <>/mz_v^2.7.0/flow_v0.130.0 /** * This is an autogenerated libdef stub for: diff --git a/web3.js/flow-typed/npm/node-fetch_v2.x.x.js b/web3.js/flow-typed/npm/node-fetch_v2.x.x.js new file mode 100644 index 0000000000..3f37f21b73 --- /dev/null +++ b/web3.js/flow-typed/npm/node-fetch_v2.x.x.js @@ -0,0 +1,133 @@ +// flow-typed signature: 800c99f4687ac083d3ed2dd6b9ee9457 +// flow-typed version: 711a5f887a/node-fetch_v2.x.x/flow_>=v0.104.x + +declare module 'node-fetch' { + import type http from 'http'; + import type https from 'https'; + import type { URL } from 'url'; + import type { Readable } from 'stream'; + + declare export type AbortSignal = { + +aborted: boolean; + +onabort: (event?: { ... }) => void; + + +addEventListener: (name: string, cb: () => mixed) => void; + +removeEventListener: (name: string, cb: () => mixed) => void; + +dispatchEvent: (event: { ... }) => void; + ..., + } + + declare export class Request mixins Body { + constructor(input: string | { href: string, ... } | Request, init?: RequestInit): this; + context: RequestContext; + headers: Headers; + method: string; + redirect: RequestRedirect; + referrer: string; + url: string; + + // node-fetch extensions + agent: http.Agent | https.Agent; + compress: boolean; + counter: number; + follow: number; + hostname: string; + port: number; + protocol: string; + size: number; + timeout: number; + } + + declare type HeaderObject = { [index: string]: string, ... } + + declare type RequestInit = {| + body?: BodyInit, + headers?: HeaderObject, + method?: string, + redirect?: RequestRedirect, + signal?: AbortSignal | null, + + // node-fetch extensions + agent?: (URL => (http.Agent | https.Agent)) | http.Agent | https.Agent | null; + compress?: boolean, + follow?: number, + size?: number, + timeout?: number, + |}; + + declare export interface FetchError extends Error { + name: 'FetchError'; + type: string; + code: ?number; + errno: ?number; + } + + declare export interface AbortError extends Error { + name: 'AbortError'; + type: 'aborted'; + } + + declare type RequestContext = + 'audio' | 'beacon' | 'cspreport' | 'download' | 'embed' | + 'eventsource' | 'favicon' | 'fetch' | 'font' | 'form' | 'frame' | + 'hyperlink' | 'iframe' | 'image' | 'imageset' | 'import' | + 'internal' | 'location' | 'manifest' | 'object' | 'ping' | 'plugin' | + 'prefetch' | 'script' | 'serviceworker' | 'sharedworker' | + 'subresource' | 'style' | 'track' | 'video' | 'worker' | + 'xmlhttprequest' | 'xslt'; + declare type RequestRedirect = 'error' | 'follow' | 'manual'; + + declare export class Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string; + getAll(name: string): Array; + has(name: string): boolean; + raw(): { [k: string]: string[], ... }; + set(name: string, value: string): void; + } + + declare export class Body { + buffer(): Promise; + json(): Promise; + json(): Promise; + text(): Promise; + body: stream$Readable; + bodyUsed: boolean; + } + + declare export class Response mixins Body { + constructor(body?: BodyInit, init?: ResponseInit): this; + clone(): Response; + error(): Response; + redirect(url: string, status: number): Response; + headers: Headers; + ok: boolean; + status: number; + statusText: string; + size: number; + timeout: number; + type: ResponseType; + url: string; + } + + declare type ResponseType = + | 'basic' + | 'cors' + | 'default' + | 'error' + | 'opaque' + | 'opaqueredirect'; + + declare interface ResponseInit { + headers?: HeaderInit, + status: number, + statusText?: string, + } + + declare type HeaderInit = Headers | Array; + declare type BodyInit = string | null | Buffer | Blob | Readable; + + declare export default function fetch(url: string | Request, init?: RequestInit): Promise +} diff --git a/web3.js/flow-typed/npm/rpc-websockets_vx.x.x.js b/web3.js/flow-typed/npm/rpc-websockets_vx.x.x.js new file mode 100644 index 0000000000..dfdcebe135 --- /dev/null +++ b/web3.js/flow-typed/npm/rpc-websockets_vx.x.x.js @@ -0,0 +1,150 @@ +// flow-typed signature: f1593e42a1e3a50eb251415b72e1305b +// flow-typed version: <>/rpc-websockets_v^7.4.2/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'rpc-websockets' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'rpc-websockets' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'rpc-websockets/build-ts/index.browser' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/client' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/client/client.types' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/client/websocket.browser' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/client/websocket' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/server' { + declare module.exports: any; +} + +declare module 'rpc-websockets/build-ts/lib/utils' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/index.browser-bundle' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/index.browser' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/client' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/client/client.types' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/client/websocket.browser' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/client/websocket' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/server' { + declare module.exports: any; +} + +declare module 'rpc-websockets/dist/lib/utils' { + declare module.exports: any; +} + +// Filename aliases +declare module 'rpc-websockets/build-ts/index.browser.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/index.browser'>; +} +declare module 'rpc-websockets/build-ts/index' { + declare module.exports: $Exports<'rpc-websockets/build-ts'>; +} +declare module 'rpc-websockets/build-ts/index.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts'>; +} +declare module 'rpc-websockets/build-ts/lib/client.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/client'>; +} +declare module 'rpc-websockets/build-ts/lib/client/client.types.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/client/client.types'>; +} +declare module 'rpc-websockets/build-ts/lib/client/websocket.browser.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/client/websocket.browser'>; +} +declare module 'rpc-websockets/build-ts/lib/client/websocket.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/client/websocket'>; +} +declare module 'rpc-websockets/build-ts/lib/server.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/server'>; +} +declare module 'rpc-websockets/build-ts/lib/utils.js' { + declare module.exports: $Exports<'rpc-websockets/build-ts/lib/utils'>; +} +declare module 'rpc-websockets/dist/index.browser-bundle.js' { + declare module.exports: $Exports<'rpc-websockets/dist/index.browser-bundle'>; +} +declare module 'rpc-websockets/dist/index.browser.js' { + declare module.exports: $Exports<'rpc-websockets/dist/index.browser'>; +} +declare module 'rpc-websockets/dist/index' { + declare module.exports: $Exports<'rpc-websockets/dist'>; +} +declare module 'rpc-websockets/dist/index.js' { + declare module.exports: $Exports<'rpc-websockets/dist'>; +} +declare module 'rpc-websockets/dist/lib/client.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/client'>; +} +declare module 'rpc-websockets/dist/lib/client/client.types.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/client/client.types'>; +} +declare module 'rpc-websockets/dist/lib/client/websocket.browser.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/client/websocket.browser'>; +} +declare module 'rpc-websockets/dist/lib/client/websocket.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/client/websocket'>; +} +declare module 'rpc-websockets/dist/lib/server.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/server'>; +} +declare module 'rpc-websockets/dist/lib/utils.js' { + declare module.exports: $Exports<'rpc-websockets/dist/lib/utils'>; +} diff --git a/web3.js/flow-typed/npm/secp256k1_vx.x.x.js b/web3.js/flow-typed/npm/secp256k1_vx.x.x.js new file mode 100644 index 0000000000..389c5887cb --- /dev/null +++ b/web3.js/flow-typed/npm/secp256k1_vx.x.x.js @@ -0,0 +1,62 @@ +// flow-typed signature: 010ed80dfa77343a07cd101a9453f460 +// flow-typed version: <>/secp256k1_v^4.0.2/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'secp256k1' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'secp256k1' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'secp256k1/bindings' { + declare module.exports: any; +} + +declare module 'secp256k1/elliptic' { + declare module.exports: any; +} + +declare module 'secp256k1/lib/elliptic' { + declare module.exports: any; +} + +declare module 'secp256k1/lib' { + declare module.exports: any; +} + +// Filename aliases +declare module 'secp256k1/bindings.js' { + declare module.exports: $Exports<'secp256k1/bindings'>; +} +declare module 'secp256k1/elliptic.js' { + declare module.exports: $Exports<'secp256k1/elliptic'>; +} +declare module 'secp256k1/index' { + declare module.exports: $Exports<'secp256k1'>; +} +declare module 'secp256k1/index.js' { + declare module.exports: $Exports<'secp256k1'>; +} +declare module 'secp256k1/lib/elliptic.js' { + declare module.exports: $Exports<'secp256k1/lib/elliptic'>; +} +declare module 'secp256k1/lib/index' { + declare module.exports: $Exports<'secp256k1/lib'>; +} +declare module 'secp256k1/lib/index.js' { + declare module.exports: $Exports<'secp256k1/lib'>; +} diff --git a/web3.js/flow-typed/npm/sinon_vx.x.x.js b/web3.js/flow-typed/npm/sinon_vx.x.x.js new file mode 100644 index 0000000000..877d495832 --- /dev/null +++ b/web3.js/flow-typed/npm/sinon_vx.x.x.js @@ -0,0 +1,340 @@ +// flow-typed signature: be25eb3acc001250afea0eb7dacd26f6 +// flow-typed version: <>/sinon_v^9.2.4/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'sinon' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'sinon' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'sinon/lib/sinon-esm' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/assert' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/behavior' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/blob' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/collect-own-methods' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/color' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/create-sandbox' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/default-behaviors' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/fake' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/mock-expectation' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/mock' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/proxy-call-util' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/proxy-call' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/proxy-invoke' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/proxy' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/restore-object' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/sandbox' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/spy-formatters' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/spy' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/stub' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/throw-on-falsy-object' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/default-config' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/export-async-behaviors' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/extend' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/format' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/function-to-string' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/get-config' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/get-next-tick' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/get-property-descriptor' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/is-es-module' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/is-non-existent-property' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/is-property-configurable' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/is-restorable' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/next-tick' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/restore' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/times-in-words' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/use-promise-library' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/walk-object' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/walk' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/core/wrap-method' { + declare module.exports: any; +} + +declare module 'sinon/lib/sinon/util/fake-timers' { + declare module.exports: any; +} + +declare module 'sinon/pkg/sinon-esm' { + declare module.exports: any; +} + +declare module 'sinon/pkg/sinon-no-sourcemaps' { + declare module.exports: any; +} + +declare module 'sinon/pkg/sinon' { + declare module.exports: any; +} + +// Filename aliases +declare module 'sinon/lib/sinon-esm.js' { + declare module.exports: $Exports<'sinon/lib/sinon-esm'>; +} +declare module 'sinon/lib/sinon.js' { + declare module.exports: $Exports<'sinon/lib/sinon'>; +} +declare module 'sinon/lib/sinon/assert.js' { + declare module.exports: $Exports<'sinon/lib/sinon/assert'>; +} +declare module 'sinon/lib/sinon/behavior.js' { + declare module.exports: $Exports<'sinon/lib/sinon/behavior'>; +} +declare module 'sinon/lib/sinon/blob.js' { + declare module.exports: $Exports<'sinon/lib/sinon/blob'>; +} +declare module 'sinon/lib/sinon/collect-own-methods.js' { + declare module.exports: $Exports<'sinon/lib/sinon/collect-own-methods'>; +} +declare module 'sinon/lib/sinon/color.js' { + declare module.exports: $Exports<'sinon/lib/sinon/color'>; +} +declare module 'sinon/lib/sinon/create-sandbox.js' { + declare module.exports: $Exports<'sinon/lib/sinon/create-sandbox'>; +} +declare module 'sinon/lib/sinon/default-behaviors.js' { + declare module.exports: $Exports<'sinon/lib/sinon/default-behaviors'>; +} +declare module 'sinon/lib/sinon/fake.js' { + declare module.exports: $Exports<'sinon/lib/sinon/fake'>; +} +declare module 'sinon/lib/sinon/mock-expectation.js' { + declare module.exports: $Exports<'sinon/lib/sinon/mock-expectation'>; +} +declare module 'sinon/lib/sinon/mock.js' { + declare module.exports: $Exports<'sinon/lib/sinon/mock'>; +} +declare module 'sinon/lib/sinon/proxy-call-util.js' { + declare module.exports: $Exports<'sinon/lib/sinon/proxy-call-util'>; +} +declare module 'sinon/lib/sinon/proxy-call.js' { + declare module.exports: $Exports<'sinon/lib/sinon/proxy-call'>; +} +declare module 'sinon/lib/sinon/proxy-invoke.js' { + declare module.exports: $Exports<'sinon/lib/sinon/proxy-invoke'>; +} +declare module 'sinon/lib/sinon/proxy.js' { + declare module.exports: $Exports<'sinon/lib/sinon/proxy'>; +} +declare module 'sinon/lib/sinon/restore-object.js' { + declare module.exports: $Exports<'sinon/lib/sinon/restore-object'>; +} +declare module 'sinon/lib/sinon/sandbox.js' { + declare module.exports: $Exports<'sinon/lib/sinon/sandbox'>; +} +declare module 'sinon/lib/sinon/spy-formatters.js' { + declare module.exports: $Exports<'sinon/lib/sinon/spy-formatters'>; +} +declare module 'sinon/lib/sinon/spy.js' { + declare module.exports: $Exports<'sinon/lib/sinon/spy'>; +} +declare module 'sinon/lib/sinon/stub.js' { + declare module.exports: $Exports<'sinon/lib/sinon/stub'>; +} +declare module 'sinon/lib/sinon/throw-on-falsy-object.js' { + declare module.exports: $Exports<'sinon/lib/sinon/throw-on-falsy-object'>; +} +declare module 'sinon/lib/sinon/util/core/default-config.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/default-config'>; +} +declare module 'sinon/lib/sinon/util/core/export-async-behaviors.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/export-async-behaviors'>; +} +declare module 'sinon/lib/sinon/util/core/extend.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/extend'>; +} +declare module 'sinon/lib/sinon/util/core/format.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/format'>; +} +declare module 'sinon/lib/sinon/util/core/function-to-string.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/function-to-string'>; +} +declare module 'sinon/lib/sinon/util/core/get-config.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/get-config'>; +} +declare module 'sinon/lib/sinon/util/core/get-next-tick.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/get-next-tick'>; +} +declare module 'sinon/lib/sinon/util/core/get-property-descriptor.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/get-property-descriptor'>; +} +declare module 'sinon/lib/sinon/util/core/is-es-module.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/is-es-module'>; +} +declare module 'sinon/lib/sinon/util/core/is-non-existent-property.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/is-non-existent-property'>; +} +declare module 'sinon/lib/sinon/util/core/is-property-configurable.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/is-property-configurable'>; +} +declare module 'sinon/lib/sinon/util/core/is-restorable.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/is-restorable'>; +} +declare module 'sinon/lib/sinon/util/core/next-tick.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/next-tick'>; +} +declare module 'sinon/lib/sinon/util/core/restore.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/restore'>; +} +declare module 'sinon/lib/sinon/util/core/times-in-words.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/times-in-words'>; +} +declare module 'sinon/lib/sinon/util/core/use-promise-library.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/use-promise-library'>; +} +declare module 'sinon/lib/sinon/util/core/walk-object.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/walk-object'>; +} +declare module 'sinon/lib/sinon/util/core/walk.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/walk'>; +} +declare module 'sinon/lib/sinon/util/core/wrap-method.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/core/wrap-method'>; +} +declare module 'sinon/lib/sinon/util/fake-timers.js' { + declare module.exports: $Exports<'sinon/lib/sinon/util/fake-timers'>; +} +declare module 'sinon/pkg/sinon-esm.js' { + declare module.exports: $Exports<'sinon/pkg/sinon-esm'>; +} +declare module 'sinon/pkg/sinon-no-sourcemaps.js' { + declare module.exports: $Exports<'sinon/pkg/sinon-no-sourcemaps'>; +} +declare module 'sinon/pkg/sinon.js' { + declare module.exports: $Exports<'sinon/pkg/sinon'>; +} diff --git a/web3.js/flow-typed/npm/superstruct_vx.x.x.js b/web3.js/flow-typed/npm/superstruct_vx.x.x.js new file mode 100644 index 0000000000..079264dba2 --- /dev/null +++ b/web3.js/flow-typed/npm/superstruct_vx.x.x.js @@ -0,0 +1,56 @@ +// flow-typed signature: 93e1c7b898500d4a0bfe05d7e7bdd0b9 +// flow-typed version: <>/superstruct_v^0.8.3/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'superstruct' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'superstruct' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'superstruct/lib/index.es' { + declare module.exports: any; +} + +declare module 'superstruct/lib' { + declare module.exports: any; +} + +declare module 'superstruct/umd/superstruct' { + declare module.exports: any; +} + +declare module 'superstruct/umd/superstruct.min' { + declare module.exports: any; +} + +// Filename aliases +declare module 'superstruct/lib/index.es.js' { + declare module.exports: $Exports<'superstruct/lib/index.es'>; +} +declare module 'superstruct/lib/index' { + declare module.exports: $Exports<'superstruct/lib'>; +} +declare module 'superstruct/lib/index.js' { + declare module.exports: $Exports<'superstruct/lib'>; +} +declare module 'superstruct/umd/superstruct.js' { + declare module.exports: $Exports<'superstruct/umd/superstruct'>; +} +declare module 'superstruct/umd/superstruct.min.js' { + declare module.exports: $Exports<'superstruct/umd/superstruct.min'>; +} diff --git a/web3.js/flow-typed/npm/tweetnacl_vx.x.x.js b/web3.js/flow-typed/npm/tweetnacl_vx.x.x.js new file mode 100644 index 0000000000..55012a5051 --- /dev/null +++ b/web3.js/flow-typed/npm/tweetnacl_vx.x.x.js @@ -0,0 +1,53 @@ +// flow-typed signature: 607d90b805d229d69250b382713c4087 +// flow-typed version: <>/tweetnacl_v^1.0.0/flow_v0.130.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'tweetnacl' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'tweetnacl' { + declare module.exports: any; +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ +declare module 'tweetnacl/nacl-fast' { + declare module.exports: any; +} + +declare module 'tweetnacl/nacl-fast.min' { + declare module.exports: any; +} + +declare module 'tweetnacl/nacl' { + declare module.exports: any; +} + +declare module 'tweetnacl/nacl.min' { + declare module.exports: any; +} + +// Filename aliases +declare module 'tweetnacl/nacl-fast.js' { + declare module.exports: $Exports<'tweetnacl/nacl-fast'>; +} +declare module 'tweetnacl/nacl-fast.min.js' { + declare module.exports: $Exports<'tweetnacl/nacl-fast.min'>; +} +declare module 'tweetnacl/nacl.js' { + declare module.exports: $Exports<'tweetnacl/nacl'>; +} +declare module 'tweetnacl/nacl.min.js' { + declare module.exports: $Exports<'tweetnacl/nacl.min'>; +} diff --git a/web3.js/flow-typed/rpc-websockets.js b/web3.js/flow-typed/rpc-websockets.js deleted file mode 100644 index a26d5fa785..0000000000 --- a/web3.js/flow-typed/rpc-websockets.js +++ /dev/null @@ -1,88 +0,0 @@ -// flow-typed signature: 31b3dc13d06052ea505e8da9ca72c537 -// flow-typed version: <>/rpc-websockets_v4.3.3/flow_v0.84.0 - -/** - * This is an autogenerated libdef stub for: - * - * 'rpc-websockets' - * - * Fill this stub out by replacing all the `any` types. - * - * Once filled out, we encourage you to share your work with the - * community by sending a pull request to: - * https://github.com/flowtype/flow-typed - */ - -declare module 'rpc-websockets' { - declare module.exports: any; -} - -/** - * We include stubs for each file inside this npm package in case you need to - * require those files directly. Feel free to delete any files that aren't - * needed. - */ -declare module 'rpc-websockets/dist/index.browser-bundle' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/index.browser' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/index' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/client' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/client/websocket.browser' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/client/websocket' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/handler' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/server' { - declare module.exports: any; -} - -declare module 'rpc-websockets/dist/lib/utils' { - declare module.exports: any; -} - -// Filename aliases -declare module 'rpc-websockets/dist/index.browser-bundle.js' { - declare module.exports: $Exports<'rpc-websockets/dist/index.browser-bundle'>; -} -declare module 'rpc-websockets/dist/index.browser.js' { - declare module.exports: $Exports<'rpc-websockets/dist/index.browser'>; -} -declare module 'rpc-websockets/dist/index.js' { - declare module.exports: $Exports<'rpc-websockets/dist/index'>; -} -declare module 'rpc-websockets/dist/lib/client.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/client'>; -} -declare module 'rpc-websockets/dist/lib/client/websocket.browser.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/client/websocket.browser'>; -} -declare module 'rpc-websockets/dist/lib/client/websocket.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/client/websocket'>; -} -declare module 'rpc-websockets/dist/lib/handler.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/handler'>; -} -declare module 'rpc-websockets/dist/lib/server.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/server'>; -} -declare module 'rpc-websockets/dist/lib/utils.js' { - declare module.exports: $Exports<'rpc-websockets/dist/lib/utils'>; -} diff --git a/web3.js/flow-typed/secp256k1.js b/web3.js/flow-typed/secp256k1.js deleted file mode 100644 index 84743e1e83..0000000000 --- a/web3.js/flow-typed/secp256k1.js +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'secp256k1' { - // TODO: Fill in types - declare module.exports: any; -} diff --git a/web3.js/flow-typed/superstruct.js b/web3.js/flow-typed/superstruct.js deleted file mode 100644 index f95d4c9f8f..0000000000 --- a/web3.js/flow-typed/superstruct.js +++ /dev/null @@ -1,16 +0,0 @@ -declare module 'superstruct' { - declare type StructFunc = { - (any): any, - object(schema: any): any; - union(schema: any): any; - array(schema: any): any; - literal(schema: any): any; - tuple(schema: any): any; - pick(schema: any): any; - record(schema: any): any; - }; - - declare module.exports: { - struct: StructFunc; - } -} diff --git a/web3.js/flow-typed/tweetnacl.js b/web3.js/flow-typed/tweetnacl.js deleted file mode 100644 index 552b47a8a6..0000000000 --- a/web3.js/flow-typed/tweetnacl.js +++ /dev/null @@ -1,24 +0,0 @@ -declare module "tweetnacl" { - declare type KeyPair = { - publicKey: Buffer; - secretKey: Buffer; - }; - - declare type KeypairFunc = { - (): KeyPair, - fromSecretKey(secretKey: Buffer): KeyPair, - fromSeed(seed: Uint8Array): KeyPair, - }; - - declare type DetachedFunc = { - (text: Buffer, secretKey: Buffer): Buffer, - verify(message: Buffer, signature: Buffer|null, publicKey: Buffer): bool, - }; - - declare module.exports: { - sign: { - keyPair: KeypairFunc; - detached: DetachedFunc; - }; - }; -} diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index ec108da0c1..d203d71a90 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -17870,18 +17870,18 @@ } }, "rollup": { - "version": "2.38.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.38.3.tgz", - "integrity": "sha512-FVx/XzR2DtCozKNDBjHJCHIgkC12rNg/ruAeoYWjLeeKfSKgwhh+lDLDhuCkuRG/fsup8py8dKBTlHdvUFX32A==", + "version": "2.38.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.38.5.tgz", + "integrity": "sha512-VoWt8DysFGDVRGWuHTqZzT02J0ASgjVq/hPs9QcBOGMd7B+jfTr/iqMVEyOi901rE3xq+Deq66GzIT1yt7sGwQ==", "dev": true, "requires": { "fsevents": "~2.3.1" }, "dependencies": { "fsevents": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz", - "integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true } diff --git a/web3.js/package.json b/web3.js/package.json index 3bc8895106..f5fcbba082 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -72,12 +72,12 @@ "pretty:fix": "prettier --write '{,{examples,src,test}/**/}*.{j,t}s'", "re": "semantic-release --repository-url git@github.com:solana-labs/solana-web3.js.git", "test": "npm run build:fixtures && mocha './test/**/*.test.js'", + "test:cover": "nyc --reporter=lcov mocha './test/**/*.test.js'", "test:browser": "TEST_LIVE=1 npm run build:fixtures && npm run build:browser-test && mocha-headless-chrome -f http://localhost:8080/mocha.html --timeout 180000", "test:browser-with-server": "start-server-and-test 'http-server -p 8080' 8080 test:browser", "test:browser-with-test-validator": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health test:browser-with-server", "test:live": "TEST_LIVE=1 npm run test", - "test:live-with-test-validator": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health test:live", - "test:watch": "npm run build:fixtures && npm run test" + "test:live-with-test-validator": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health test:live" }, "dependencies": { "@babel/runtime": "^7.12.5", @@ -113,14 +113,11 @@ "@solana/spl-token": "^0.0.13", "@typescript-eslint/eslint-plugin": "^4.14.2", "@typescript-eslint/parser": "^4.14.2", - "acorn": "^8.0.1", "babel-eslint": "^11.0.0-beta.2", "chai": "^4.3.0", "chai-as-promised": "^7.1.1", "codecov": "^3.0.4", "cross-env": "7.0.3", - "elfy": "^1.0.0", - "enzyme": "3.11.0", "esdoc": "^1.1.0", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-flow-type-plugin": "^1.1.0", @@ -131,19 +128,18 @@ "eslint-config-prettier": "^7.0.0", "eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-import": "2.22.1", + "eslint-plugin-mocha": "^8.0.0", "eslint-plugin-prettier": "^3.0.0", "esm": "^3.2.25", "flow-bin": "0.130.0", "flow-remove-types": "^2.143.1", "flow-typed": "3.2.1", - "fs-file-tree": "1.1.1", "http-server": "^0.12.3", - "marked": "^1.1.0", "mocha": "^8.2.1", "mocha-headless-chrome": "^3.1.0", "mockttp": "^1.1.0", "mz": "^2.7.0", - "npm-run-all": "^4.1.5", + "nyc": "^15.1.0", "prettier": "^2.0.0", "rimraf": "3.0.2", "rollup": "2.38.5", @@ -154,8 +150,6 @@ "sinon": "^9.2.4", "start-server-and-test": "^1.12.0", "typescript": "^4.1.3", - "watch": "^1.0.2", - "webpack": "^5.21.0", - "webpack-cli": "^4.5.0" + "watch": "^1.0.2" } } diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index ce3ecab443..f8798a24c0 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -1423,7 +1423,7 @@ const SendTransactionRpcResult = jsonRpcResult('string'); * @property {number} parent Parent of the current slot * @property {number} root The root block of the current slot's fork */ -type SlotInfo = { +export type SlotInfo = { slot: number, parent: number, root: number, @@ -1480,7 +1480,7 @@ type AccountInfo = { * @property {PublicKey} accountId * @property {AccountInfo} accountInfo */ -type KeyedAccountInfo = { +export type KeyedAccountInfo = { accountId: PublicKey, accountInfo: AccountInfo, }; diff --git a/web3.js/src/publickey.js b/web3.js/src/publickey.js index bd2f741416..d448c4782f 100644 --- a/web3.js/src/publickey.js +++ b/web3.js/src/publickey.js @@ -6,7 +6,6 @@ import nacl from 'tweetnacl'; import {sha256} from 'crypto-hash'; import {Buffer} from 'buffer'; -//$FlowFixMe let naclLowLevel = nacl.lowlevel; type PublicKeyNonce = [PublicKey, number]; // This type exists to workaround an esdoc parse error diff --git a/web3.js/test/account.test.js b/web3.js/test/account.test.js index 97ead73642..bf6c5d8a81 100644 --- a/web3.js/test/account.test.js +++ b/web3.js/test/account.test.js @@ -1,8 +1,9 @@ // @flow -import {Account} from '../src/account'; import {expect} from 'chai'; import {Buffer} from 'buffer'; +import {Account} from '../src/account'; + describe('Account', () => { it('generate new account', () => { const account = new Account(); diff --git a/web3.js/test/agent-manager.test.js b/web3.js/test/agent-manager.test.js index c731fdd2dc..dad49e2f42 100644 --- a/web3.js/test/agent-manager.test.js +++ b/web3.js/test/agent-manager.test.js @@ -1,7 +1,8 @@ // @flow -import {AgentManager, DESTROY_TIMEOUT_MS} from '../src/agent-manager'; import {expect} from 'chai'; + +import {AgentManager, DESTROY_TIMEOUT_MS} from '../src/agent-manager'; import {sleep} from '../src/util/sleep'; describe('AgentManager', () => { diff --git a/web3.js/test/cluster.test.js b/web3.js/test/cluster.test.js index 6e00f691d9..2b58424262 100644 --- a/web3.js/test/cluster.test.js +++ b/web3.js/test/cluster.test.js @@ -1,7 +1,9 @@ // @flow -import {clusterApiUrl} from '../src/util/cluster'; + import {expect} from 'chai'; +import {clusterApiUrl} from '../src/util/cluster'; + describe('Cluster Util', () => { it('invalid', () => { expect(() => { diff --git a/web3.js/test/connection.test.js b/web3.js/test/connection.test.js index 323af03b10..9f4a9b961f 100644 --- a/web3.js/test/connection.test.js +++ b/web3.js/test/connection.test.js @@ -21,29 +21,20 @@ import {DEFAULT_TICKS_PER_SLOT, NUM_TICKS_PER_SECOND} from '../src/timing'; import {MOCK_PORT, url} from './url'; import {BLOCKHASH_CACHE_TIMEOUT_MS} from '../src/connection'; import {sleep} from '../src/util/sleep'; -import type {TransactionSignature} from '../src/transaction'; -import type { - Commitment, - SignatureStatus, - TransactionError, - KeyedAccountInfo, - SlotInfo, -} from '../src/connection'; - import { helpers, mockErrorMessage, mockErrorResponse, - uniqueSignature, - uniqueBlockhash, mockRpcResponse, mockServer, } from './mocks/rpc-http'; -import { - stubRpcWebSocket, - restoreRpcWebSocket, - mockRpcMessage, -} from './mocks/rpc-websockets'; +import {stubRpcWebSocket, restoreRpcWebSocket} from './mocks/rpc-websockets'; +import type {TransactionSignature} from '../src/transaction'; +import type { + SignatureStatus, + TransactionError, + KeyedAccountInfo, +} from '../src/connection'; use(chaiAsPromised); @@ -1712,12 +1703,9 @@ describe('Connection', () => { lamports: 9, }), ); - const signature3 = await sendAndConfirmTransaction( - connection, - transaction3, - [accountFrom], - {preflightCommitment: 'singleGossip'}, - ); + await sendAndConfirmTransaction(connection, transaction3, [accountFrom], { + preflightCommitment: 'singleGossip', + }); expect(transaction2.recentBlockhash).to.eq(transaction3.recentBlockhash); // Sleep until blockhash cache times out @@ -1956,7 +1944,7 @@ describe('Connection', () => { }); it('slot notification', async () => { - let notifiedSlotInfo: SlotInfo; + let notifiedSlotInfo; const subscriptionId = connection.onSlotChange(slotInfo => { notifiedSlotInfo = slotInfo; }); diff --git a/web3.js/test/fixtures/noop-c/build.sh b/web3.js/test/fixtures/noop-c/build.sh new file mode 100755 index 0000000000..0043703b15 --- /dev/null +++ b/web3.js/test/fixtures/noop-c/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -ex + +cd "$(dirname "$0")" + +make -C ../../../examples/bpf-c-noop/ +cp ../../../examples/bpf-c-noop/out/noop.so . diff --git a/web3.js/test/fixtures/noop-rust/build.sh b/web3.js/test/fixtures/noop-rust/build.sh new file mode 100755 index 0000000000..622775f783 --- /dev/null +++ b/web3.js/test/fixtures/noop-rust/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -ex + +cd "$(dirname "$0")" + +cargo build-bpf --manifest-path=../../../examples/bpf-rust-noop/Cargo.toml +cp ../../../examples/bpf-rust-noop/target/deploy/solana_bpf_rust_noop.so . diff --git a/web3.js/test/mocks/rpc-http.js b/web3.js/test/mocks/rpc-http.js index 2c009016cf..8754a8ea63 100644 --- a/web3.js/test/mocks/rpc-http.js +++ b/web3.js/test/mocks/rpc-http.js @@ -3,12 +3,13 @@ import bs58 from 'bs58'; import BN from 'bn.js'; import * as mockttp from 'mockttp'; -import {mockRpcMessage} from './rpc-websockets'; -import {Connection} from '../../src'; +import {mockRpcMessage} from './rpc-websockets'; +import {Account, Connection, PublicKey, Transaction} from '../../src'; import type {Commitment} from '../../src/connection'; -export const mockServer = process.env.TEST_LIVE || mockttp.getLocal(); +export const mockServer: mockttp.Mockttp = + process.env.TEST_LIVE || mockttp.getLocal(); let uniqueCounter = 0; export const uniqueSignature = () => { @@ -33,19 +34,22 @@ export const mockRpcResponse = async ({ }: { method: string, params: Array, - value: any, - error: any, + value?: any, + error?: any, withContext?: boolean, }) => { if (process.env.TEST_LIVE) return; - let result = withContext - ? { - context: { - slot: 11, - }, - value, - } - : value; + + let result = value; + if (withContext) { + result = { + context: { + slot: 11, + }, + value, + }; + } + await mockServer .post('/') .withJsonBodyIncluding({ @@ -69,7 +73,7 @@ const recentBlockhash = async ({ commitment, }: { connection: Connection, - commitment: ?Commitment, + commitment?: Commitment, }) => { const blockhash = uniqueBlockhash(); const params = []; @@ -117,13 +121,16 @@ const processTransaction = async ({ value: signature, }); - const sendOptions = err - ? { - skipPreflight: true, - } - : { - preflightCommitment: commitment, - }; + let sendOptions; + if (err) { + sendOptions = { + skipPreflight: true, + }; + } else { + sendOptions = { + preflightCommitment: commitment, + }; + } await connection.sendEncodedTransaction(encoded, sendOptions); diff --git a/web3.js/test/mocks/rpc-websockets.js b/web3.js/test/mocks/rpc-websockets.js index 59e9fe4fa6..87a03452aa 100644 --- a/web3.js/test/mocks/rpc-websockets.js +++ b/web3.js/test/mocks/rpc-websockets.js @@ -3,6 +3,7 @@ import {Client as LiveClient} from 'rpc-websockets'; import {expect} from 'chai'; import sinon from 'sinon'; + import {Connection} from '../../src'; type RpcRequest = { @@ -62,6 +63,7 @@ export const restoreRpcWebSocket = (connection: Connection) => { }; class MockClient { + client: LiveClient; mockOpen = false; subscriptionCounter = 0; diff --git a/web3.js/test/publickey.test.js b/web3.js/test/publickey.test.js index ce9738a3d5..87fc128748 100644 --- a/web3.js/test/publickey.test.js +++ b/web3.js/test/publickey.test.js @@ -1,10 +1,11 @@ // @flow import BN from 'bn.js'; import {Buffer} from 'buffer'; -import {PublicKey, MAX_SEED_LENGTH} from '../src/publickey'; import {expect, use} from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import {PublicKey, MAX_SEED_LENGTH} from '../src/publickey'; + use(chaiAsPromised); describe('PublicKey', function () { diff --git a/web3.js/test/rollup.config.js b/web3.js/test/rollup.config.js index 1596e60586..74a0c34fc7 100644 --- a/web3.js/test/rollup.config.js +++ b/web3.js/test/rollup.config.js @@ -10,11 +10,6 @@ import replace from '@rollup/plugin-replace'; export default { input: { - // include: [ - // 'test/account.test.js', - // 'test/cluster.test.js', - // 'test/stake-program.test.js', - // ], include: ['test/**/*.test.js'], exclude: ['test/agent-manager.test.js', 'test/bpf-loader.test.js'], }, diff --git a/web3.js/test/secp256k1-program.test.js b/web3.js/test/secp256k1-program.test.js index fa06171fa3..ee9bb982c1 100644 --- a/web3.js/test/secp256k1-program.test.js +++ b/web3.js/test/secp256k1-program.test.js @@ -1,7 +1,7 @@ // @flow import {Buffer} from 'buffer'; -import createKeccakHash from 'keccak'; +import {keccak_256} from 'js-sha3'; import {privateKeyVerify, ecdsaSign, publicKeyCreate} from 'secp256k1'; import { @@ -13,7 +13,7 @@ import { Secp256k1Program, } from '../src'; import {url} from './url'; -import {helpers} from './mocks/rpc-http'; +import {toBuffer} from '../src/util/to-buffer'; const randomPrivateKey = () => { let privateKey; @@ -29,9 +29,9 @@ if (process.env.TEST_LIVE) { const privateKey = randomPrivateKey(); const publicKey = publicKeyCreate(privateKey, false); const message = Buffer.from('This is a message'); - const messageHash = createKeccakHash('keccak256') - .update(message) - .digest(); + const messageHash = Buffer.from( + keccak_256.update(toBuffer(message)).digest(), + ); const {signature, recid: recoveryId} = ecdsaSign(messageHash, privateKey); const connection = new Connection(url, 'singleGossip'); diff --git a/web3.js/test/shortvec-encoding.test.js b/web3.js/test/shortvec-encoding.test.js index 07abcc8886..9d96897ce3 100644 --- a/web3.js/test/shortvec-encoding.test.js +++ b/web3.js/test/shortvec-encoding.test.js @@ -1,6 +1,7 @@ // @flow import {expect} from 'chai'; + import {decodeLength, encodeLength} from '../src/util/shortvec-encoding'; function checkDecodedArray(array: Array, expectedValue: number) { diff --git a/web3.js/test/transaction-payer.test.js b/web3.js/test/transaction-payer.test.js index 3996ea2554..d49cd4ee8a 100644 --- a/web3.js/test/transaction-payer.test.js +++ b/web3.js/test/transaction-payer.test.js @@ -1,5 +1,6 @@ // @flow +import base58 from 'bs58'; import {expect} from 'chai'; import { @@ -10,22 +11,8 @@ import { LAMPORTS_PER_SOL, } from '../src'; import {MOCK_PORT, url} from './url'; - -import { - helpers, - mockErrorMessage, - mockErrorResponse, - uniqueSignature, - uniqueBlockhash, - mockRpcResponse, - mockServer, -} from './mocks/rpc-http'; -import { - stubRpcWebSocket, - restoreRpcWebSocket, - mockRpcMessage, -} from './mocks/rpc-websockets'; -import base58 from 'bs58'; +import {helpers, mockRpcResponse, mockServer} from './mocks/rpc-http'; +import {stubRpcWebSocket, restoreRpcWebSocket} from './mocks/rpc-websockets'; describe('Transaction Payer', () => { let connection: Connection; diff --git a/web3.js/test/transaction.test.js b/web3.js/test/transaction.test.js index b47ea76339..b7efd8bd91 100644 --- a/web3.js/test/transaction.test.js +++ b/web3.js/test/transaction.test.js @@ -2,7 +2,7 @@ import bs58 from 'bs58'; import {Buffer} from 'buffer'; import nacl from 'tweetnacl'; -import {expect, use} from 'chai'; +import {expect} from 'chai'; import {Account} from '../src/account'; import {PublicKey} from '../src/publickey';