From f4a2e227e1a7224fbbe9c99d9aa033d176a9c4de Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 29 Jul 2018 21:58:39 +0200 Subject: Remove all in-package monorepo-scripts by adding doc gen/upload and aggregate release note publishing to publish script --- packages/utils/package.json | 8 +++----- packages/utils/src/monorepo_scripts/postpublish.ts | 8 -------- 2 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 packages/utils/src/monorepo_scripts/postpublish.ts (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index b1a0d8eb9..b2ce9a17e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -9,10 +9,9 @@ "types": "lib/index.d.ts", "scripts": { "watch_without_deps": "tsc -w", - "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", - "clean": "shx rm -rf lib scripts", - "lint": "tslint --project .", - "manual:postpublish": "yarn build; node ./scripts/postpublish.js" + "build": "tsc", + "clean": "shx rm -rf lib", + "lint": "tslint --project ." }, "license": "Apache-2.0", "repository": { @@ -24,7 +23,6 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^1.0.4", "@0xproject/tslint-config": "^1.0.4", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", diff --git a/packages/utils/src/monorepo_scripts/postpublish.ts b/packages/utils/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/utils/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); -- cgit v1.2.3 From c00c477307e305e2d380779bb74fa29b31072c4c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 17:39:35 +0100 Subject: Add doc comments to AbiDecoder --- packages/utils/src/abi_decoder.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 7f93e746e..58a58dea2 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -15,12 +15,25 @@ import * as _ from 'lodash'; import { addressUtils } from './address_utils'; import { BigNumber } from './configured_bignumber'; +/** + * AbiDecoder allows you to decode event logs given a set of supplied contract ABI's. It takes the contract's event + * signature from the ABI and attempts to decode the logs using it. + */ export class AbiDecoder { private readonly _methodIds: { [signatureHash: string]: EventAbi } = {}; + /** + * Instantiate an AbiDecoder + * @param abiArrays An array of contract ABI's + * @return AbiDecoder instance + */ constructor(abiArrays: AbiDefinition[][]) { _.forEach(abiArrays, this.addABI.bind(this)); } - // This method can only decode logs from the 0x & ERC20 smart contracts + /** + * Attempt to decode a log given the ABI's the AbiDecoder knows about. + * @param log The log to attempt to decode + * @return The decoded log if the requisite ABI was available. Otherwise the log unaltered. + */ public tryToDecodeLogOrNoop(log: LogEntry): LogWithDecodedArgs | RawLog { const methodId = log.topics[0]; const event = this._methodIds[methodId]; @@ -75,6 +88,10 @@ export class AbiDecoder { }; } } + /** + * Add additional ABI definitions to the AbiDecoder + * @param abiArray An array of ABI definitions to add to the AbiDecoder + */ public addABI(abiArray: AbiDefinition[]): void { if (_.isUndefined(abiArray)) { return; -- cgit v1.2.3 From b38ef579fb75c777fac2eef3d4bcda2c97014f0b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 24 Aug 2018 19:11:10 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 13 +++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 796a99a5a..6edafb946 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1535133899, + "version": "1.0.6", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "1.0.5", "changes": [ diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index bdde2687d..a2d4d115b 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,9 +5,14 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v1.0.5 - _August 13, 2018_ +## v1.0.6 - _August 24, 2018_ + + * Dependencies updated + +## v1.0.5 - _August 14, 2018_ * Increased BigNumber decimal precision from 20 to 78 (#807) + * Store different ABIs for events with same function signature and different amount of indexed arguments (#933) ## v1.0.4 - _July 26, 2018_ @@ -25,7 +30,7 @@ CHANGELOG * Add `AbortController` polyfill to `fetchAsync` (#903) -## v1.0.0 - _July 19, 2018_ +## v1.0.0 - _July 20, 2018_ * Add `fetchAsync` which adds a default timeout to all requests (#874) @@ -43,7 +48,7 @@ CHANGELOG * Dependencies updated -## v0.7.0 - _May 31, 2018_ +## v0.7.0 - _June 1, 2018_ * Incorrect publish that was unpublished @@ -51,7 +56,7 @@ CHANGELOG * Dependencies updated -## v0.6.1 - _May 4, 2018_ +## v0.6.1 - _May 5, 2018_ * Dependencies updated -- cgit v1.2.3 From 7f585a15f526e0a61fd822cdefb7087fc6bb8934 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 24 Aug 2018 19:11:27 +0100 Subject: Publish - 0x.js@1.0.1-rc.4 - @0xproject/abi-gen@1.0.6 - @0xproject/assert@1.0.6 - @0xproject/base-contract@2.0.0 - @0xproject/connect@2.0.0-rc.1 - @0xproject/contract-wrappers@1.0.1-rc.4 - contracts@2.1.41 - @0xproject/dev-utils@1.0.5 - ethereum-types@1.0.5 - @0xproject/fill-scenarios@1.0.1-rc.4 - @0xproject/forwarder-helper@1.0.1-rc.1 - @0xproject/json-schemas@1.0.1-rc.5 - @0xproject/metacoin@0.0.16 - @0xproject/migrations@1.0.5 - @0xproject/monorepo-scripts@1.0.6 - @0xproject/order-utils@1.0.1-rc.4 - @0xproject/order-watcher@1.0.1-rc.4 - @0xproject/react-docs@1.0.6 - @0xproject/react-shared@1.0.7 - @0xproject/sol-compiler@1.1.0 - @0xproject/sol-cov@2.1.0 - @0xproject/sol-resolver@1.0.6 - @0xproject/sra-api@1.0.1-rc.5 - @0xproject/sra-report@1.0.6 - @0xproject/subproviders@2.0.0 - @0xproject/testnet-faucets@1.0.42 - @0xproject/tslint-config@1.0.6 - @0xproject/types@1.0.1-rc.5 - @0xproject/typescript-typings@1.0.5 - @0xproject/utils@1.0.6 - @0xproject/web3-wrapper@2.0.0 - @0xproject/website@0.0.45 --- packages/utils/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 4568352e1..b4795cefd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.5", + "version": "1.0.6", "engines": { "node": ">=6.12" }, @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.5", + "@0xproject/tslint-config": "^1.0.6", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.0.1-rc.4", - "@0xproject/typescript-typings": "^1.0.4", + "@0xproject/types": "^1.0.1-rc.5", + "@0xproject/typescript-typings": "^1.0.5", "@types/node": "^8.0.53", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.4", + "ethereum-types": "^1.0.5", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 4475fefd07cac0ca166d31526edf4738cca1f16c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 14:47:56 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 6edafb946..446355007 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1535377027, + "version": "1.0.7", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1535133899, "version": "1.0.6", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index a2d4d115b..f7e877a58 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.7 - _August 27, 2018_ + + * Dependencies updated + ## v1.0.6 - _August 24, 2018_ * Dependencies updated -- cgit v1.2.3 From 00a4fa5f7c1da8deae703b36b6bbed024cf9e111 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 27 Aug 2018 14:48:24 +0100 Subject: Publish - 0x.js@1.0.1-rc.6 - @0xproject/abi-gen@1.0.7 - @0xproject/assert@1.0.7 - @0xproject/base-contract@2.0.1 - @0xproject/connect@2.0.0-rc.2 - @0xproject/contract-wrappers@1.0.1-rc.5 - contracts@2.1.42 - @0xproject/dev-utils@1.0.6 - @0xproject/fill-scenarios@1.0.1-rc.5 - @0xproject/forwarder-helper@1.0.1-rc.2 - @0xproject/json-schemas@1.0.1-rc.6 - @0xproject/metacoin@0.0.17 - @0xproject/migrations@1.0.6 - @0xproject/monorepo-scripts@1.0.7 - @0xproject/order-utils@1.0.1-rc.6 - @0xproject/order-watcher@1.0.1-rc.5 - @0xproject/react-docs@1.0.7 - @0xproject/react-shared@1.0.8 - @0xproject/sol-compiler@1.1.1 - @0xproject/sol-cov@2.1.1 - @0xproject/sol-resolver@1.0.7 - @0xproject/sra-report@1.0.7 - @0xproject/sra-spec@1.0.1-rc.6 - @0xproject/subproviders@2.0.1 - @0xproject/testnet-faucets@1.0.43 - @0xproject/types@1.0.1-rc.6 - @0xproject/utils@1.0.7 - @0xproject/web3-wrapper@2.0.1 - @0xproject/website@0.0.46 --- packages/utils/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index b4795cefd..c72fb4c83 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.6", + "version": "1.0.7", "engines": { "node": ">=6.12" }, @@ -41,7 +41,7 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.0.1-rc.5", + "@0xproject/types": "^1.0.1-rc.6", "@0xproject/typescript-typings": "^1.0.5", "@types/node": "^8.0.53", "abortcontroller-polyfill": "^1.1.9", -- cgit v1.2.3 From e7d5ceb9c5487a5851dbfc1f8bdbe0182fedaef2 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 29 Aug 2018 11:15:30 -0700 Subject: feat: Add support for TypeScript project references (#991) * Update all package.json and tsconfig.json * fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs * Fix webpack config for 0x.js * Fix linter errors by adding rootDir to tsconfig.json as needed * Add build:ts and watch:ts commands to package.json * Update sra-spec to work with project references * Update tsconfig.json with latest new/removed packages * Add TypeScript as devDependency at root * Add missing rootDir to forwarder-helper package * Use a separate tsconfig file for typedoc * Fix linter errors * Apply PR feedback (add comments) * Fix 0x.js tsconfig --- packages/utils/package.json | 3 +-- packages/utils/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index c72fb4c83..d93163e81 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -8,8 +8,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "watch_without_deps": "tsc -w", - "build": "tsc", + "build": "tsc -b", "clean": "shx rm -rf lib", "lint": "tslint --project .", "test": "yarn run_mocha", diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 8b4cd47a2..718e623c7 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig", "compilerOptions": { - "outDir": "lib" + "outDir": "lib", + "rootDir": "." }, "include": ["src/**/*", "test/**/*"] } -- cgit v1.2.3 From b525ccc825b80dfc02d7cd1ccf479aa5b5c93992 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 4 Sep 2018 15:02:50 +0200 Subject: Remove types for detect-node from typescript-typings --- packages/utils/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index d93163e81..15a8516a7 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -28,6 +28,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { "@0xproject/tslint-config": "^1.0.6", + "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", -- cgit v1.2.3 From 481a752e70f6d9b558fb0aaadd4de87899fd9b1a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:34 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 446355007..c1b7db100 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1536142250, + "version": "1.0.8", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1535377027, "version": "1.0.7", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index f7e877a58..2452cf42e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.8 - _September 5, 2018_ + + * Dependencies updated + ## v1.0.7 - _August 27, 2018_ * Dependencies updated -- cgit v1.2.3 From 174b36059368631eeaec3ec7c0a3847350b55d73 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:45 +0100 Subject: Publish - 0x.js@1.0.1 - @0xproject/abi-gen@1.0.8 - @0xproject/assert@1.0.8 - @0xproject/base-contract@2.0.2 - @0xproject/connect@2.0.0 - @0xproject/contract-wrappers@1.0.1 - contracts@2.1.43 - @0xproject/dev-utils@1.0.7 - ethereum-types@1.0.6 - @0xproject/fill-scenarios@1.0.1 - @0xproject/forwarder-helper@1.0.1 - @0xproject/json-schemas@1.0.1 - @0xproject/metacoin@0.0.18 - @0xproject/migrations@1.0.7 - @0xproject/monorepo-scripts@1.0.8 - @0xproject/order-utils@1.0.1 - @0xproject/order-watcher@1.0.1 - @0xproject/react-docs@1.0.8 - @0xproject/react-shared@1.0.9 - @0xproject/sol-compiler@1.1.2 - @0xproject/sol-cov@2.1.2 - @0xproject/sol-resolver@1.0.8 - @0xproject/sra-report@1.0.8 - @0xproject/sra-spec@1.0.1 - @0xproject/subproviders@2.0.2 - @0xproject/testnet-faucets@1.0.44 - @0xproject/tslint-config@1.0.7 - @0xproject/types@1.0.1 - @0xproject/typescript-typings@2.0.0 - @0xproject/utils@1.0.8 - @0xproject/web3-wrapper@2.0.2 - @0xproject/website@0.0.47 --- packages/utils/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 15a8516a7..831b6c819 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.7", + "version": "1.0.8", "engines": { "node": ">=6.12" }, @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.6", + "@0xproject/tslint-config": "^1.0.7", "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.0.1-rc.6", - "@0xproject/typescript-typings": "^1.0.5", + "@0xproject/types": "^1.0.1", + "@0xproject/typescript-typings": "^2.0.0", "@types/node": "^8.0.53", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.5", + "ethereum-types": "^1.0.6", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From ecbdf5f12bc9a1e654241f2051f152a1d5fea5bc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 12 Sep 2018 11:02:14 +0200 Subject: Upgrade to TS version of ethers --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 831b6c819..c9e8fba83 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -49,7 +49,7 @@ "detect-node": "2.0.3", "ethereum-types": "^1.0.6", "ethereumjs-util": "^5.1.1", - "ethers": "3.0.22", + "ethers": "^4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", "js-sha3": "^0.7.0", "lodash": "^4.17.5" -- cgit v1.2.3 From 5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Sep 2018 14:04:13 +0200 Subject: Fixes for the breaking changes in ethers --- packages/utils/src/abi_decoder.ts | 4 ++-- packages/utils/src/abi_utils.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 265eb105e..ea8c91d10 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -47,7 +47,7 @@ export class AbiDecoder { let decodedData: any[]; try { - decodedData = ethersInterface.events[event.name].parse(log.data); + decodedData = ethersInterface.events[event.name].decode(log.data); } catch (error) { if (error.code === ethers.errors.INVALID_ARGUMENT) { // Because we index events by Method ID, and Method IDs are derived from the method @@ -99,7 +99,7 @@ export class AbiDecoder { const ethersInterface = new ethers.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { - const topic = ethersInterface.events[abi.name].topics[0]; + const topic = ethersInterface.events[abi.name].topic; const numIndexedArgs = _.reduce(abi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); this._methodIds[topic] = { ...this._methodIds[topic], diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index c9b70966c..b5ab28ba2 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -4,11 +4,17 @@ import * as _ from 'lodash'; import { BigNumber } from './configured_bignumber'; +type ParamName = null | string | NestedParamName; +interface NestedParamName { + name: string | null; + names: ParamName[]; +} + // Note(albrow): This function is unexported in ethers.js. Copying it here for // now. // Source: https://github.com/ethers-io/ethers.js/blob/884593ab76004a808bf8097e9753fb5f8dcc3067/contracts/interface.js#L30 -function parseEthersParams(params: DataItem[]): { names: ethers.ParamName[]; types: string[] } { - const names: ethers.ParamName[] = []; +function parseEthersParams(params: DataItem[]): { names: ParamName[]; types: string[] } { + const names: ParamName[] = []; const types: string[] = []; params.forEach((param: DataItem) => { @@ -37,7 +43,7 @@ function parseEthersParams(params: DataItem[]): { names: ethers.ParamName[]; typ // returns true if x is equal to y and false otherwise. Performs some minimal // type conversion and data massaging for x and y, depending on type. name and // type should typically be derived from parseEthersParams. -function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): boolean { +function isAbiDataEqual(name: ParamName, type: string, x: any, y: any): boolean { if (_.isUndefined(x) && _.isUndefined(y)) { return true; } else if (_.isUndefined(x) && !_.isUndefined(y)) { @@ -89,7 +95,7 @@ function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): b // const nestedName = _.isString(name.names[i]) ? (name.names[i] as string) - : ((name.names[i] as ethers.NestedParamName).name as string); + : ((name.names[i] as NestedParamName).name as string); if (!isAbiDataEqual(name.names[i], types[i], x[nestedName], y[nestedName])) { return false; } -- cgit v1.2.3 From 3167bfde1a426e567de1b2f9809062217bb19b6b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 11:47:30 +0200 Subject: Remove unused import --- packages/utils/src/abi_utils.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index b5ab28ba2..598ea5fcc 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -1,5 +1,4 @@ import { AbiDefinition, AbiType, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; -import * as ethers from 'ethers'; import * as _ from 'lodash'; import { BigNumber } from './configured_bignumber'; -- cgit v1.2.3 From f3deabccf4e6caec57351a09f82b3f786122b5ea Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 12:10:25 +0200 Subject: Add CHANGELOG entries --- packages/utils/CHANGELOG.json | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index c1b7db100..1a868d676 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Make abi_decoder compatible with ethers ^4.0.0", + "pr": 1069 + } + ] + }, { "timestamp": 1536142250, "version": "1.0.8", -- cgit v1.2.3 From 7dd28d6fab1d47a287422a0f51d63ba69d1c4dbc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 16:37:20 +0200 Subject: Don't depend on a specific version of node types --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 831b6c819..588f45708 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -43,7 +43,7 @@ "dependencies": { "@0xproject/types": "^1.0.1", "@0xproject/typescript-typings": "^2.0.0", - "@types/node": "^8.0.53", + "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", -- cgit v1.2.3 From 5446de630886422f1795e06d638a200ab62763ef Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 16:59:16 +0200 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index c1b7db100..7449355ce 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537541580, + "version": "1.0.9", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1536142250, "version": "1.0.8", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 2452cf42e..aa2c08940 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.9 - _September 21, 2018_ + + * Dependencies updated + ## v1.0.8 - _September 5, 2018_ * Dependencies updated -- cgit v1.2.3 From 29f6adc2ed57720d2c2aab7b760a4bcfec5d7b37 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 16:59:27 +0200 Subject: Publish - 0x.js@1.0.4 - @0xproject/abi-gen@1.0.9 - @0xproject/assert@1.0.9 - @0xproject/base-contract@2.0.3 - @0xproject/connect@2.0.2 - @0xproject/contract-wrappers@1.0.4 - contracts@2.1.45 - @0xproject/dev-utils@1.0.8 - ethereum-types@1.0.7 - @0xproject/fill-scenarios@1.0.3 - @0xproject/forwarder-helper@1.0.4 - @0xproject/json-schemas@1.0.2 - @0xproject/metacoin@0.0.19 - @0xproject/migrations@1.0.10 - @0xproject/monorepo-scripts@1.0.9 - @0xproject/order-utils@1.0.3 - @0xproject/order-watcher@1.0.4 - @0xproject/react-docs@1.0.9 - @0xproject/react-shared@1.0.10 - @0xproject/sol-compiler@1.1.3 - @0xproject/sol-cov@2.1.3 - @0xproject/sol-resolver@1.0.9 - @0xproject/sra-report@1.0.9 - @0xproject/sra-spec@1.0.2 - @0xproject/subproviders@2.0.3 - @0xproject/testnet-faucets@1.0.47 - @0xproject/types@1.0.2 - @0xproject/typescript-typings@2.0.1 - @0xproject/utils@1.0.9 - @0xproject/web3-wrapper@2.0.3 - @0xproject/website@0.0.50 --- packages/utils/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 588f45708..a3977cef6 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.8", + "version": "1.0.9", "engines": { "node": ">=6.12" }, @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.0.1", - "@0xproject/typescript-typings": "^2.0.0", + "@0xproject/types": "^1.0.2", + "@0xproject/typescript-typings": "^2.0.1", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.6", + "ethereum-types": "^1.0.7", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 411813d8d9f23d535f10dd3fdd9e824b244bf187 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 25 Sep 2018 13:48:44 +0200 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 7449355ce..1536c1960 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537875740, + "version": "1.0.10", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1537541580, "version": "1.0.9", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index aa2c08940..ff26a0900 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.10 - _September 25, 2018_ + + * Dependencies updated + ## v1.0.9 - _September 21, 2018_ * Dependencies updated -- cgit v1.2.3 From 78ef98c27ce954f7e46b261b0809ff9d8d70519b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 25 Sep 2018 13:48:55 +0200 Subject: Publish - 0x.js@1.0.5 - @0xproject/abi-gen@1.0.10 - @0xproject/assert@1.0.10 - @0xproject/asset-buyer@1.0.0 - @0xproject/base-contract@2.0.4 - @0xproject/connect@2.0.3 - @0xproject/contract-wrappers@1.0.5 - contracts@2.1.46 - @0xproject/dev-utils@1.0.9 - @0xproject/fill-scenarios@1.0.4 - @0xproject/json-schemas@1.0.3 - @0xproject/metacoin@0.0.20 - @0xproject/migrations@1.0.11 - @0xproject/order-utils@1.0.4 - @0xproject/order-watcher@1.0.5 - @0xproject/react-docs@1.0.10 - @0xproject/react-shared@1.0.11 - @0xproject/sol-compiler@1.1.4 - @0xproject/sol-cov@2.1.4 - @0xproject/sol-resolver@1.0.10 - @0xproject/sra-report@1.0.10 - @0xproject/sra-spec@1.0.3 - @0xproject/subproviders@2.0.4 - @0xproject/testnet-faucets@1.0.48 - @0xproject/types@1.1.0 - @0xproject/utils@1.0.10 - @0xproject/web3-wrapper@3.0.0 - @0xproject/website@0.0.51 --- packages/utils/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index a3977cef6..77d11c41c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.9", + "version": "1.0.10", "engines": { "node": ">=6.12" }, @@ -41,7 +41,7 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.0.2", + "@0xproject/types": "^1.1.0", "@0xproject/typescript-typings": "^2.0.1", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", -- cgit v1.2.3 From 900a8aee76237778398a5940e723ce30c4af1860 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:33:55 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 1536c1960..d395a7dec 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537907159, + "version": "1.0.11", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1537875740, "version": "1.0.10", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index ff26a0900..60b6d1b7e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.11 - _September 25, 2018_ + + * Dependencies updated + ## v1.0.10 - _September 25, 2018_ * Dependencies updated -- cgit v1.2.3 From 1b35a6e3b5d050fa33097b35e1d739ca13c6806e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:34:14 +0100 Subject: Publish - 0x.js@1.0.6 - @0xproject/abi-gen@1.0.11 - @0xproject/assert@1.0.11 - @0xproject/asset-buyer@1.0.1 - @0xproject/base-contract@2.0.5 - @0xproject/connect@2.0.4 - @0xproject/contract-wrappers@2.0.0 - contracts@2.1.47 - @0xproject/dev-utils@1.0.10 - ethereum-types@1.0.8 - @0xproject/fill-scenarios@1.0.5 - @0xproject/json-schemas@1.0.4 - @0xproject/metacoin@0.0.21 - @0xproject/migrations@1.0.12 - @0xproject/order-utils@1.0.5 - @0xproject/order-watcher@2.0.0 - @0xproject/react-docs@1.0.11 - @0xproject/react-shared@1.0.12 - @0xproject/sol-compiler@1.1.5 - @0xproject/sol-cov@2.1.5 - @0xproject/sol-resolver@1.0.11 - @0xproject/sra-report@1.0.11 - @0xproject/sra-spec@1.0.4 - @0xproject/subproviders@2.0.5 - @0xproject/testnet-faucets@1.0.49 - @0xproject/types@1.1.1 - @0xproject/typescript-typings@2.0.2 - @0xproject/utils@1.0.11 - @0xproject/web3-wrapper@3.0.1 - @0xproject/website@0.0.52 --- packages/utils/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 77d11c41c..1fd2f57fa 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.10", + "version": "1.0.11", "engines": { "node": ">=6.12" }, @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.0", - "@0xproject/typescript-typings": "^2.0.1", + "@0xproject/types": "^1.1.1", + "@0xproject/typescript-typings": "^2.0.2", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.7", + "ethereum-types": "^1.0.8", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From a51919db0e2414dc345f55ce7ad4fc50286dfd19 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 27 Sep 2018 11:24:03 +0200 Subject: Remove ethers.js carret as it's a beta version --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 8b9161ce7..db265dd8f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -49,7 +49,7 @@ "detect-node": "2.0.3", "ethereum-types": "^1.0.8", "ethereumjs-util": "^5.1.1", - "ethers": "^4.0.0-beta.14", + "ethers": "4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", "js-sha3": "^0.7.0", "lodash": "^4.17.5" -- cgit v1.2.3 From c354129b6f4a8b9373655ecb29ffb4ae87f19c56 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 28 Sep 2018 19:15:38 +0100 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 3 ++- packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index b4f438966..a24d58b30 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Make abi_decoder compatible with ethers ^4.0.0", "pr": 1069 } - ] + ], + "timestamp": 1538157789 }, { "timestamp": 1537907159, diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 60b6d1b7e..80b3bfd2d 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.0 - _September 28, 2018_ + + * Make abi_decoder compatible with ethers ^4.0.0 (#1069) + ## v1.0.11 - _September 25, 2018_ * Dependencies updated -- cgit v1.2.3 From ac14dd2b29b42ef4d2a46db9b70d4d30cf9bd40f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 28 Sep 2018 19:16:07 +0100 Subject: Publish - 0x.js@1.0.7 - @0xproject/abi-gen@1.0.12 - @0xproject/assert@1.0.12 - @0xproject/asset-buyer@1.0.2 - @0xproject/base-contract@3.0.0 - @0xproject/connect@3.0.0 - @0xproject/contract-wrappers@2.0.1 - contracts@2.1.48 - @0xproject/dev-utils@1.0.11 - ethereum-types@1.0.9 - @0xproject/fill-scenarios@1.0.6 - @0xproject/json-schemas@1.0.5 - @0xproject/metacoin@0.0.22 - @0xproject/migrations@1.0.13 - @0xproject/monorepo-scripts@1.0.10 - @0xproject/order-utils@1.0.6 - @0xproject/order-watcher@2.1.0 - @0xproject/react-docs@1.0.12 - @0xproject/react-shared@1.0.13 - @0xproject/sol-compiler@1.1.6 - @0xproject/sol-cov@2.1.6 - @0xproject/sol-doc@1.0.1 - @0xproject/sol-resolver@1.0.12 - @0xproject/sra-report@1.0.12 - @0xproject/sra-spec@1.0.5 - @0xproject/subproviders@2.0.6 - @0xproject/testnet-faucets@1.0.50 - @0xproject/types@1.1.2 - @0xproject/typescript-typings@3.0.0 - @0xproject/utils@2.0.0 - @0xproject/web3-wrapper@3.0.2 - @0xproject/website@0.0.53 --- packages/utils/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index db265dd8f..a68a05d52 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "1.0.11", + "version": "2.0.0", "engines": { "node": ">=6.12" }, @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.1", - "@0xproject/typescript-typings": "^2.0.2", + "@0xproject/types": "^1.1.2", + "@0xproject/typescript-typings": "^3.0.0", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.8", + "ethereum-types": "^1.0.9", "ethereumjs-util": "^5.1.1", "ethers": "4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 8b7888b736b9a18f03166c9095a2dec65eca4d66 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 2 Oct 2018 12:37:34 +0200 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index a24d58b30..b666ee829 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1538475601, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.0.0", "changes": [ diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 80b3bfd2d..c62e414f8 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.1 - _October 2, 2018_ + + * Dependencies updated + ## v2.0.0 - _September 28, 2018_ * Make abi_decoder compatible with ethers ^4.0.0 (#1069) -- cgit v1.2.3 From f80faf0b4870fcd6be259c4a1a46a64054d2aa31 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 2 Oct 2018 14:45:16 +0200 Subject: Update package.json versions to match the npm ones --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index a68a05d52..68869565c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "2.0.0", + "version": "2.0.1", "engines": { "node": ">=6.12" }, -- cgit v1.2.3 From f4e4eef48e703afb923ba4f969fc77f32be81745 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 1 Oct 2018 16:37:35 +0200 Subject: Introduce a build:ci command that doesn't build webpack bundles --- packages/utils/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 68869565c..d2ed67554 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -9,6 +9,7 @@ "types": "lib/src/index.d.ts", "scripts": { "build": "tsc -b", + "build:ci": "yarn build", "clean": "shx rm -rf lib", "lint": "tslint --project .", "test": "yarn run_mocha", -- cgit v1.2.3 From 266440f7c3f922fc998e53e1fa08db97e1a479cb Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 4 Oct 2018 15:51:56 -0700 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 12 ++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index b666ee829..237ebeecc 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1538693146, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1538475601, "version": "2.0.1", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index c62e414f8..fa731ecf0 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _October 4, 2018_ + + * Dependencies updated + ## v2.0.1 - _October 2, 2018_ * Dependencies updated @@ -37,7 +41,7 @@ CHANGELOG * Dependencies updated -## v1.0.5 - _August 14, 2018_ +## v1.0.5 - _August 13, 2018_ * Increased BigNumber decimal precision from 20 to 78 (#807) * Store different ABIs for events with same function signature and different amount of indexed arguments (#933) @@ -58,7 +62,7 @@ CHANGELOG * Add `AbortController` polyfill to `fetchAsync` (#903) -## v1.0.0 - _July 20, 2018_ +## v1.0.0 - _July 19, 2018_ * Add `fetchAsync` which adds a default timeout to all requests (#874) @@ -76,7 +80,7 @@ CHANGELOG * Dependencies updated -## v0.7.0 - _June 1, 2018_ +## v0.7.0 - _May 31, 2018_ * Incorrect publish that was unpublished @@ -84,7 +88,7 @@ CHANGELOG * Dependencies updated -## v0.6.1 - _May 5, 2018_ +## v0.6.1 - _May 4, 2018_ * Dependencies updated -- cgit v1.2.3 From b5d88079d9876677ff983f02f55d8f98bc7ab439 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 4 Oct 2018 15:52:06 -0700 Subject: Publish - 0x.js@1.0.8 - @0xproject/abi-gen@1.0.13 - @0xproject/assert@1.0.13 - @0xproject/asset-buyer@2.0.0 - @0xproject/base-contract@3.0.1 - @0xproject/connect@3.0.1 - @0xproject/contract-wrappers@2.0.2 - contracts@2.1.49 - @0xproject/dev-utils@1.0.12 - ethereum-types@1.0.11 - @0xproject/fill-scenarios@1.0.7 - @0xproject/instant@0.0.2 - @0xproject/json-schemas@1.0.7 - @0xproject/metacoin@0.0.23 - @0xproject/migrations@1.0.14 - @0xproject/monorepo-scripts@1.0.11 - @0xproject/order-utils@1.0.7 - @0xproject/order-watcher@2.1.1 - @0xproject/react-docs@1.0.13 - @0xproject/react-shared@1.0.15 - @0xproject/sol-compiler@1.1.7 - @0xproject/sol-cov@2.1.7 - @0xproject/sol-doc@1.0.2 - @0xproject/sol-resolver@1.0.14 - @0xproject/sra-report@1.0.13 - @0xproject/sra-spec@1.0.6 - @0xproject/subproviders@2.0.7 - @0xproject/testnet-faucets@1.0.51 - @0xproject/tslint-config@1.0.8 - @0xproject/types@1.1.4 - @0xproject/typescript-typings@3.0.2 - @0xproject/utils@2.0.2 - @0xproject/web3-wrapper@3.0.3 - @0xproject/website@0.0.54 --- packages/utils/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index d2ed67554..f1017f84d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "2.0.1", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.7", + "@0xproject/tslint-config": "^1.0.8", "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -42,13 +42,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.2", - "@0xproject/typescript-typings": "^3.0.0", + "@0xproject/types": "^1.1.4", + "@0xproject/typescript-typings": "^3.0.2", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.9", + "ethereum-types": "^1.0.11", "ethereumjs-util": "^5.1.1", "ethers": "4.0.0-beta.14", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 2a82ff48c061eacb3b6f9fb36eeae7f515b6d11d Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 4 Oct 2018 17:12:35 +1000 Subject: Move SignTypedData to utils package --- packages/utils/src/index.ts | 1 + packages/utils/src/sign_typed_data_utils.ts | 81 ++++++++++++++++ packages/utils/test/sign_typed_data_utils_test.ts | 107 ++++++++++++++++++++++ 3 files changed, 189 insertions(+) create mode 100644 packages/utils/src/sign_typed_data_utils.ts create mode 100644 packages/utils/test/sign_typed_data_utils_test.ts (limited to 'packages/utils') diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 9d01e5bc5..0723e5788 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -9,3 +9,4 @@ export { abiUtils } from './abi_utils'; export { NULL_BYTES } from './constants'; export { errorUtils } from './error_utils'; export { fetchAsync } from './fetch_async'; +export { signTypedDataUtils } from './sign_typed_data_utils'; diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts new file mode 100644 index 000000000..902d8530c --- /dev/null +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -0,0 +1,81 @@ +import * as ethUtil from 'ethereumjs-util'; +import * as ethers from 'ethers'; + +export interface EIP712Parameter { + name: string; + type: string; +} + +export interface EIP712Types { + [key: string]: EIP712Parameter[]; +} +export interface EIP712TypedData { + types: EIP712Types; + domain: any; + message: any; + primaryType: string; +} + +export const signTypedDataUtils = { + findDependencies(primaryType: string, types: EIP712Types, found: string[] = []): string[] { + if (found.includes(primaryType) || types[primaryType] === undefined) { + return found; + } + found.push(primaryType); + for (const field of types[primaryType]) { + for (const dep of signTypedDataUtils.findDependencies(field.type, types, found)) { + if (!found.includes(dep)) { + found.push(dep); + } + } + } + return found; + }, + encodeType(primaryType: string, types: EIP712Types): string { + let deps = signTypedDataUtils.findDependencies(primaryType, types); + deps = deps.filter(d => d !== primaryType); + deps = [primaryType].concat(deps.sort()); + let result = ''; + for (const dep of deps) { + result += `${dep}(${types[dep].map(({ name, type }) => `${type} ${name}`).join(',')})`; + } + return result; + }, + encodeData(primaryType: string, data: any, types: EIP712Types): string { + const encodedTypes = ['bytes32']; + const encodedValues = [signTypedDataUtils.typeHash(primaryType, types)]; + for (const field of types[primaryType]) { + let value = data[field.name]; + if (field.type === 'string' || field.type === 'bytes') { + value = ethUtil.sha3(value); + encodedTypes.push('bytes32'); + encodedValues.push(value); + } else if (types[field.type] !== undefined) { + encodedTypes.push('bytes32'); + value = ethUtil.sha3(signTypedDataUtils.encodeData(field.type, value, types)); + encodedValues.push(value); + } else if (field.type.lastIndexOf(']') === field.type.length - 1) { + throw new Error('Arrays currently unimplemented in encodeData'); + } else { + encodedTypes.push(field.type); + encodedValues.push(value); + } + } + return ethers.utils.defaultAbiCoder.encode(encodedTypes, encodedValues); + }, + typeHash(primaryType: string, types: EIP712Types): Buffer { + return ethUtil.sha3(signTypedDataUtils.encodeType(primaryType, types)); + }, + structHash(primaryType: string, data: any, types: EIP712Types): Buffer { + return ethUtil.sha3(signTypedDataUtils.encodeData(primaryType, data, types)); + }, + signTypedDataHash(typedData: EIP712TypedData): Buffer { + return ethUtil.sha3( + Buffer.concat([ + Buffer.from('1901', 'hex'), + signTypedDataUtils.structHash('EIP712Domain', typedData.domain, typedData.types), + signTypedDataUtils.structHash(typedData.primaryType, typedData.message, typedData.types), + ]), + ); + }, +}; diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts new file mode 100644 index 000000000..b21ffefa0 --- /dev/null +++ b/packages/utils/test/sign_typed_data_utils_test.ts @@ -0,0 +1,107 @@ +import * as chai from 'chai'; +import 'mocha'; + +import { signTypedDataUtils } from '../src/sign_typed_data_utils'; + +const expect = chai.expect; + +describe('signTypedDataUtils', () => { + describe('signTypedDataHash', () => { + const signTypedDataHashHex = '0x55eaa6ec02f3224d30873577e9ddd069a288c16d6fb407210eecbc501fa76692'; + const signTypedData = { + types: { + EIP712Domain: [ + { + name: 'name', + type: 'string', + }, + { + name: 'version', + type: 'string', + }, + { + name: 'verifyingContract', + type: 'address', + }, + ], + Order: [ + { + name: 'makerAddress', + type: 'address', + }, + { + name: 'takerAddress', + type: 'address', + }, + { + name: 'feeRecipientAddress', + type: 'address', + }, + { + name: 'senderAddress', + type: 'address', + }, + { + name: 'makerAssetAmount', + type: 'uint256', + }, + { + name: 'takerAssetAmount', + type: 'uint256', + }, + { + name: 'makerFee', + type: 'uint256', + }, + { + name: 'takerFee', + type: 'uint256', + }, + { + name: 'expirationTimeSeconds', + type: 'uint256', + }, + { + name: 'salt', + type: 'uint256', + }, + { + name: 'makerAssetData', + type: 'bytes', + }, + { + name: 'takerAssetData', + type: 'bytes', + }, + ], + }, + domain: { + name: '0x Protocol', + version: '2', + verifyingContract: '0x0000000000000000000000000000000000000000', + }, + message: { + makerAddress: '0x0000000000000000000000000000000000000000', + takerAddress: '0x0000000000000000000000000000000000000000', + makerAssetAmount: '1000000000000000000', + takerAssetAmount: '1000000000000000000', + expirationTimeSeconds: '12345', + makerFee: '0', + takerFee: '0', + feeRecipientAddress: '0x0000000000000000000000000000000000000000', + senderAddress: '0x0000000000000000000000000000000000000000', + salt: '12345', + makerAssetData: '0x0000000000000000000000000000000000000000', + takerAssetData: '0x0000000000000000000000000000000000000000', + exchangeAddress: '0x0000000000000000000000000000000000000000', + }, + primaryType: 'Order', + }; + it.only('creates a known hash of the sign typed data', () => { + const hash = signTypedDataUtils.signTypedDataHash(signTypedData).toString('hex'); + const hashHex = `0x${hash}`; + expect(hashHex).to.be.eq(signTypedDataHashHex); + console.log(hash); + }); + }); +}); -- cgit v1.2.3 From 3e2fe40a11919f09f1f454c71f02aaa147b46b0c Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 4 Oct 2018 17:32:54 +1000 Subject: Add eth_signTypedData support to our wallet subproviders --- packages/utils/src/sign_typed_data_utils.ts | 60 ++++++++++------------- packages/utils/test/sign_typed_data_utils_test.ts | 45 ++++++++++++++--- 2 files changed, 65 insertions(+), 40 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index 902d8530c..b72fd099b 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -1,29 +1,30 @@ import * as ethUtil from 'ethereumjs-util'; import * as ethers from 'ethers'; -export interface EIP712Parameter { - name: string; - type: string; -} - -export interface EIP712Types { - [key: string]: EIP712Parameter[]; -} -export interface EIP712TypedData { - types: EIP712Types; - domain: any; - message: any; - primaryType: string; -} +import { EIP712TypedData, EIP712Types } from '@0xproject/types'; export const signTypedDataUtils = { - findDependencies(primaryType: string, types: EIP712Types, found: string[] = []): string[] { + /** + * Computes the Sign Typed Data hash + * @param typedData An object that conforms to the EIP712TypedData interface + * @return A Buffer containing the hash of the sign typed data. + */ + signTypedDataHash(typedData: EIP712TypedData): Buffer { + return ethUtil.sha3( + Buffer.concat([ + Buffer.from('1901', 'hex'), + signTypedDataUtils._structHash('EIP712Domain', typedData.domain, typedData.types), + signTypedDataUtils._structHash(typedData.primaryType, typedData.message, typedData.types), + ]), + ); + }, + _findDependencies(primaryType: string, types: EIP712Types, found: string[] = []): string[] { if (found.includes(primaryType) || types[primaryType] === undefined) { return found; } found.push(primaryType); for (const field of types[primaryType]) { - for (const dep of signTypedDataUtils.findDependencies(field.type, types, found)) { + for (const dep of signTypedDataUtils._findDependencies(field.type, types, found)) { if (!found.includes(dep)) { found.push(dep); } @@ -31,8 +32,8 @@ export const signTypedDataUtils = { } return found; }, - encodeType(primaryType: string, types: EIP712Types): string { - let deps = signTypedDataUtils.findDependencies(primaryType, types); + _encodeType(primaryType: string, types: EIP712Types): string { + let deps = signTypedDataUtils._findDependencies(primaryType, types); deps = deps.filter(d => d !== primaryType); deps = [primaryType].concat(deps.sort()); let result = ''; @@ -41,9 +42,9 @@ export const signTypedDataUtils = { } return result; }, - encodeData(primaryType: string, data: any, types: EIP712Types): string { + _encodeData(primaryType: string, data: any, types: EIP712Types): string { const encodedTypes = ['bytes32']; - const encodedValues = [signTypedDataUtils.typeHash(primaryType, types)]; + const encodedValues = [signTypedDataUtils._typeHash(primaryType, types)]; for (const field of types[primaryType]) { let value = data[field.name]; if (field.type === 'string' || field.type === 'bytes') { @@ -52,7 +53,7 @@ export const signTypedDataUtils = { encodedValues.push(value); } else if (types[field.type] !== undefined) { encodedTypes.push('bytes32'); - value = ethUtil.sha3(signTypedDataUtils.encodeData(field.type, value, types)); + value = ethUtil.sha3(signTypedDataUtils._encodeData(field.type, value, types)); encodedValues.push(value); } else if (field.type.lastIndexOf(']') === field.type.length - 1) { throw new Error('Arrays currently unimplemented in encodeData'); @@ -63,19 +64,10 @@ export const signTypedDataUtils = { } return ethers.utils.defaultAbiCoder.encode(encodedTypes, encodedValues); }, - typeHash(primaryType: string, types: EIP712Types): Buffer { - return ethUtil.sha3(signTypedDataUtils.encodeType(primaryType, types)); + _typeHash(primaryType: string, types: EIP712Types): Buffer { + return ethUtil.sha3(signTypedDataUtils._encodeType(primaryType, types)); }, - structHash(primaryType: string, data: any, types: EIP712Types): Buffer { - return ethUtil.sha3(signTypedDataUtils.encodeData(primaryType, data, types)); - }, - signTypedDataHash(typedData: EIP712TypedData): Buffer { - return ethUtil.sha3( - Buffer.concat([ - Buffer.from('1901', 'hex'), - signTypedDataUtils.structHash('EIP712Domain', typedData.domain, typedData.types), - signTypedDataUtils.structHash(typedData.primaryType, typedData.message, typedData.types), - ]), - ); + _structHash(primaryType: string, data: any, types: EIP712Types): Buffer { + return ethUtil.sha3(signTypedDataUtils._encodeData(primaryType, data, types)); }, }; diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts index b21ffefa0..e1cb4f6e1 100644 --- a/packages/utils/test/sign_typed_data_utils_test.ts +++ b/packages/utils/test/sign_typed_data_utils_test.ts @@ -7,8 +7,37 @@ const expect = chai.expect; describe('signTypedDataUtils', () => { describe('signTypedDataHash', () => { - const signTypedDataHashHex = '0x55eaa6ec02f3224d30873577e9ddd069a288c16d6fb407210eecbc501fa76692'; - const signTypedData = { + const simpleSignTypedDataHashHex = '0xb460d69ca60383293877cd765c0f97bd832d66bca720f7e32222ce1118832493'; + const simpleSignTypedData = { + types: { + EIP712Domain: [ + { + name: 'name', + type: 'string', + }, + ], + Test: [ + { + name: 'testAddress', + type: 'address', + }, + { + name: 'testNumber', + type: 'uint256', + }, + ], + }, + domain: { + name: 'Test', + }, + message: { + testAddress: '0x0000000000000000000000000000000000000000', + testNumber: '12345', + }, + primaryType: 'Test', + }; + const orderSignTypedDataHashHex = '0x55eaa6ec02f3224d30873577e9ddd069a288c16d6fb407210eecbc501fa76692'; + const orderSignTypedData = { types: { EIP712Domain: [ { @@ -97,11 +126,15 @@ describe('signTypedDataUtils', () => { }, primaryType: 'Order', }; - it.only('creates a known hash of the sign typed data', () => { - const hash = signTypedDataUtils.signTypedDataHash(signTypedData).toString('hex'); + it('creates a hash of the test sign typed data', () => { + const hash = signTypedDataUtils.signTypedDataHash(simpleSignTypedData).toString('hex'); + const hashHex = `0x${hash}`; + expect(hashHex).to.be.eq(simpleSignTypedDataHashHex); + }); + it('creates a hash of the order sign typed data', () => { + const hash = signTypedDataUtils.signTypedDataHash(orderSignTypedData).toString('hex'); const hashHex = `0x${hash}`; - expect(hashHex).to.be.eq(signTypedDataHashHex); - console.log(hash); + expect(hashHex).to.be.eq(orderSignTypedDataHashHex); }); }); }); -- cgit v1.2.3 From 75d274f330dc0c18577e764ca77ffb36d5a3f27e Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 5 Oct 2018 11:45:53 +1000 Subject: Return SignedOrder from signing utils. Create a helper back in EIP712Utils for code cleanup. Moved constants in order-utils into the constants object --- packages/utils/src/sign_typed_data_utils.ts | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index b72fd099b..657a59ed0 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -1,7 +1,8 @@ import * as ethUtil from 'ethereumjs-util'; import * as ethers from 'ethers'; +import * as _ from 'lodash'; -import { EIP712TypedData, EIP712Types } from '@0xproject/types'; +import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0xproject/types'; export const signTypedDataUtils = { /** @@ -42,32 +43,40 @@ export const signTypedDataUtils = { } return result; }, - _encodeData(primaryType: string, data: any, types: EIP712Types): string { + _encodeData(primaryType: string, data: EIP712Object, types: EIP712Types): string { const encodedTypes = ['bytes32']; - const encodedValues = [signTypedDataUtils._typeHash(primaryType, types)]; + const encodedValues: Array = [signTypedDataUtils._typeHash(primaryType, types)]; for (const field of types[primaryType]) { - let value = data[field.name]; + const value = data[field.name]; if (field.type === 'string' || field.type === 'bytes') { - value = ethUtil.sha3(value); + const hashValue = ethUtil.sha3(value as string); encodedTypes.push('bytes32'); - encodedValues.push(value); + encodedValues.push(hashValue); } else if (types[field.type] !== undefined) { encodedTypes.push('bytes32'); - value = ethUtil.sha3(signTypedDataUtils._encodeData(field.type, value, types)); - encodedValues.push(value); + const hashValue = ethUtil.sha3( + // tslint:disable-next-line:no-unnecessary-type-assertion + signTypedDataUtils._encodeData(field.type, value as EIP712Object, types), + ); + encodedValues.push(hashValue); } else if (field.type.lastIndexOf(']') === field.type.length - 1) { throw new Error('Arrays currently unimplemented in encodeData'); } else { encodedTypes.push(field.type); - encodedValues.push(value); + const normalizedValue = signTypedDataUtils._normalizeValue(field.type, value); + encodedValues.push(normalizedValue); } } return ethers.utils.defaultAbiCoder.encode(encodedTypes, encodedValues); }, + _normalizeValue(type: string, value: any): EIP712ObjectValue { + const normalizedValue = type === 'uint256' && _.isObject(value) && value.isBigNumber ? value.toString() : value; + return normalizedValue; + }, _typeHash(primaryType: string, types: EIP712Types): Buffer { return ethUtil.sha3(signTypedDataUtils._encodeType(primaryType, types)); }, - _structHash(primaryType: string, data: any, types: EIP712Types): Buffer { + _structHash(primaryType: string, data: EIP712Object, types: EIP712Types): Buffer { return ethUtil.sha3(signTypedDataUtils._encodeData(primaryType, data, types)); }, }; -- cgit v1.2.3 From 9e8031d5e3cf94cabe07685be510397367e90413 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Tue, 9 Oct 2018 18:26:13 +1100 Subject: Throw and handle errors from Providers. In web3 wrapper when a response contains an error field we throw this rather than return response.result which is often undefined. In Signature Utils we handle the error thrown when a user rejects the signing dialogue to prevent double signing. Exposed the ZeroExTransaction JSON schema. In Website only use the MetamaskSubprovider if we can detect the provider is Metamask --- packages/utils/src/sign_typed_data_utils.ts | 6 +++--- packages/utils/test/sign_typed_data_utils_test.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index 657a59ed0..cd5bcb42f 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -6,11 +6,11 @@ import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@ export const signTypedDataUtils = { /** - * Computes the Sign Typed Data hash + * Generates the EIP712 Typed Data hash for signing * @param typedData An object that conforms to the EIP712TypedData interface - * @return A Buffer containing the hash of the sign typed data. + * @return A Buffer containing the hash of the typed data. */ - signTypedDataHash(typedData: EIP712TypedData): Buffer { + generateTypedDataHash(typedData: EIP712TypedData): Buffer { return ethUtil.sha3( Buffer.concat([ Buffer.from('1901', 'hex'), diff --git a/packages/utils/test/sign_typed_data_utils_test.ts b/packages/utils/test/sign_typed_data_utils_test.ts index e1cb4f6e1..dcba08b04 100644 --- a/packages/utils/test/sign_typed_data_utils_test.ts +++ b/packages/utils/test/sign_typed_data_utils_test.ts @@ -127,12 +127,12 @@ describe('signTypedDataUtils', () => { primaryType: 'Order', }; it('creates a hash of the test sign typed data', () => { - const hash = signTypedDataUtils.signTypedDataHash(simpleSignTypedData).toString('hex'); + const hash = signTypedDataUtils.generateTypedDataHash(simpleSignTypedData).toString('hex'); const hashHex = `0x${hash}`; expect(hashHex).to.be.eq(simpleSignTypedDataHashHex); }); it('creates a hash of the order sign typed data', () => { - const hash = signTypedDataUtils.signTypedDataHash(orderSignTypedData).toString('hex'); + const hash = signTypedDataUtils.generateTypedDataHash(orderSignTypedData).toString('hex'); const hashHex = `0x${hash}`; expect(hashHex).to.be.eq(orderSignTypedDataHashHex); }); -- cgit v1.2.3 From 31ee8870b80579caf3762c1178043bb5bb6fe4fb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 9 Oct 2018 12:15:42 +0200 Subject: Upgrade ethers.js version --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index f1017f84d..20b0f0c86 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -50,7 +50,7 @@ "detect-node": "2.0.3", "ethereum-types": "^1.0.11", "ethereumjs-util": "^5.1.1", - "ethers": "4.0.0-beta.14", + "ethers": "~4.0.4", "isomorphic-fetch": "^2.2.1", "js-sha3": "^0.7.0", "lodash": "^4.17.5" -- cgit v1.2.3 From 22160df2d2d5aef63c3e2c3f502ac15119b18e07 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 9 Oct 2018 12:55:10 +0200 Subject: Fix ethers build issue --- packages/utils/src/abi_decoder.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ea8c91d10..836037f30 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -9,7 +9,8 @@ import { RawLog, SolidityTypes, } from 'ethereum-types'; -import * as ethers from 'ethers'; +import { ethers } from 'ethers'; +import { Interface } from 'ethers/utils/interface'; import * as _ from 'lodash'; import { addressUtils } from './address_utils'; @@ -41,7 +42,7 @@ export class AbiDecoder { return log; } const event = this._methodIds[methodId][numIndexedArgs]; - const ethersInterface = new ethers.Interface([event]); + const ethersInterface = new Interface([event]); const decodedParams: DecodedLogArgs = {}; let topicsIndex = 1; @@ -96,7 +97,7 @@ export class AbiDecoder { if (_.isUndefined(abiArray)) { return; } - const ethersInterface = new ethers.Interface(abiArray); + const ethersInterface = new Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { const topic = ethersInterface.events[abi.name].topic; -- cgit v1.2.3 From f93774f855d5735aff975cdb87c61aad624b4c9a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 9 Oct 2018 15:46:13 +0200 Subject: Stop accesing ethers private methods --- packages/utils/src/abi_decoder.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 836037f30..ac3e54efb 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -10,7 +10,6 @@ import { SolidityTypes, } from 'ethereum-types'; import { ethers } from 'ethers'; -import { Interface } from 'ethers/utils/interface'; import * as _ from 'lodash'; import { addressUtils } from './address_utils'; @@ -42,7 +41,7 @@ export class AbiDecoder { return log; } const event = this._methodIds[methodId][numIndexedArgs]; - const ethersInterface = new Interface([event]); + const ethersInterface = new ethers.utils.Interface([event]); const decodedParams: DecodedLogArgs = {}; let topicsIndex = 1; @@ -97,7 +96,7 @@ export class AbiDecoder { if (_.isUndefined(abiArray)) { return; } - const ethersInterface = new Interface(abiArray); + const ethersInterface = new ethers.utils.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { const topic = ethersInterface.events[abi.name].topic; -- cgit v1.2.3 From 770cf529334543a1d23cdfa0fad1672879cda974 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 9 Oct 2018 14:21:56 -0700 Subject: Remove unused copyfiles dependencies --- packages/utils/package.json | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 20b0f0c86..f365cf97f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -33,7 +33,6 @@ "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", - "copyfiles": "^2.0.0", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", "npm-run-all": "^4.1.2", -- cgit v1.2.3 From 852f50d1a0e2d7f6c95231406c8604f9e56dc1dc Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 17 Oct 2018 17:09:35 +0100 Subject: chore: Re-cast to EventAbi after checking the the type is set to 'event' --- packages/utils/src/abi_decoder.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ac3e54efb..9cc863909 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -99,11 +99,12 @@ export class AbiDecoder { const ethersInterface = new ethers.utils.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { - const topic = ethersInterface.events[abi.name].topic; - const numIndexedArgs = _.reduce(abi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); + const eventAbi = abi as EventAbi; + const topic = ethersInterface.events[eventAbi.name].topic; + const numIndexedArgs = _.reduce(eventAbi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); this._methodIds[topic] = { ...this._methodIds[topic], - [numIndexedArgs]: abi, + [numIndexedArgs]: eventAbi, }; } }); -- cgit v1.2.3 From bdae4ba2a2c9b7b3b41c352c628cb11cd4a1f295 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 17 Oct 2018 18:23:06 +0100 Subject: chore: tslint fix --- packages/utils/src/abi_decoder.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 9cc863909..c0b2c7950 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -99,6 +99,7 @@ export class AbiDecoder { const ethersInterface = new ethers.utils.Interface(abiArray); _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { + // tslint:disable-next-line:no-unnecessary-type-assertion const eventAbi = abi as EventAbi; const topic = ethersInterface.events[eventAbi.name].topic; const numIndexedArgs = _.reduce(eventAbi.inputs, (sum, input) => (input.indexed ? sum + 1 : sum), 0); -- cgit v1.2.3 From 9f924e459c43c023e35ab7222cd9824cc0e67411 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 21:51:56 +1100 Subject: chore: change package org from 0xproject to 0x --- packages/utils/package.json | 8 ++++---- packages/utils/src/sign_typed_data_utils.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index f365cf97f..43844e535 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,5 +1,5 @@ { - "name": "@0xproject/utils", + "name": "@0x/utils", "version": "2.0.2", "engines": { "node": ">=6.12" @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/tslint-config": "^1.0.8", + "@0x/tslint-config": "^1.0.8", "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -41,8 +41,8 @@ "typescript": "3.0.1" }, "dependencies": { - "@0xproject/types": "^1.1.4", - "@0xproject/typescript-typings": "^3.0.2", + "@0x/types": "^1.1.4", + "@0x/typescript-typings": "^3.0.2", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index cd5bcb42f..6963b9084 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -2,7 +2,7 @@ import * as ethUtil from 'ethereumjs-util'; import * as ethers from 'ethers'; import * as _ from 'lodash'; -import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0xproject/types'; +import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0x/types'; export const signTypedDataUtils = { /** -- cgit v1.2.3 From 88c929a408d17d8d1f4604187f8b1b04e94dab73 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 22:01:04 +1100 Subject: chore: change tslint.json from 0xproject to 0x --- packages/utils/tslint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/tslint.json b/packages/utils/tslint.json index ffaefe83a..dd9053357 100644 --- a/packages/utils/tslint.json +++ b/packages/utils/tslint.json @@ -1,3 +1,3 @@ { - "extends": ["@0xproject/tslint-config"] + "extends": ["@0x/tslint-config"] } -- cgit v1.2.3 From 2735fb4fa6901dc528aea5f642512c161b842efd Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 22:03:47 +1100 Subject: chore: change README.md from 0xproject to 0x --- packages/utils/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/README.md b/packages/utils/README.md index c9a2f5846..0b15f00c5 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -1,25 +1,25 @@ -## @0xproject/utils +## @0x/utils Utils to be shared across 0x projects and packages ## Installation ```bash -yarn add @0xproject/utils +yarn add @0x/utils ``` If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: ```json "compilerOptions": { - "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], + "typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"], } ``` ## Usage ```javascript -import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0xproject/utils'; +import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0x/utils'; ``` ## Troubleshooting @@ -62,13 +62,13 @@ yarn install To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: ```bash -PKG=@0xproject/utils yarn build +PKG=@0x/utils yarn build ``` Or continuously rebuild on change: ```bash -PKG=@0xproject/utils yarn watch +PKG=@0x/utils yarn watch ``` ### Clean -- cgit v1.2.3 From aa4a474e1dc79ec4da299663b20e56f6cf01518a Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 18 Oct 2018 23:11:56 +1100 Subject: chore: update ethers import in utils --- packages/utils/src/abi_decoder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index c0b2c7950..2da46db35 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -9,7 +9,7 @@ import { RawLog, SolidityTypes, } from 'ethereum-types'; -import { ethers } from 'ethers'; +import * as ethers from 'ethers'; import * as _ from 'lodash'; import { addressUtils } from './address_utils'; -- cgit v1.2.3 From 7e49db23010ed5a20b100e08802be08c2dadda2b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 18 Oct 2018 15:52:32 +0200 Subject: Fix ethereum-types versions --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index 43844e535..f2faa63b1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -47,7 +47,7 @@ "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.0.11", + "ethereum-types": "^1.1.0", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 71d1e6b0ecb4bfb5cfa44cf35b924682383beba2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 18 Oct 2018 16:02:49 +0200 Subject: Updated CHANGELOGS --- packages/utils/CHANGELOG.json | 9 +++++++++ packages/utils/CHANGELOG.md | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 237ebeecc..7594581d4 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1539871071, + "version": "2.0.3", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1538693146, "version": "2.0.2", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index fa731ecf0..45b2cd0c2 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _October 18, 2018_ + + * Dependencies updated + ## v2.0.2 - _October 4, 2018_ * Dependencies updated @@ -41,7 +45,7 @@ CHANGELOG * Dependencies updated -## v1.0.5 - _August 13, 2018_ +## v1.0.5 - _August 14, 2018_ * Increased BigNumber decimal precision from 20 to 78 (#807) * Store different ABIs for events with same function signature and different amount of indexed arguments (#933) -- cgit v1.2.3 From 8b62b350b1fed6a0d8827ca9ed5fcec3e78ae82f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 18 Oct 2018 16:03:00 +0200 Subject: Publish - 0x.js@2.0.0 - @0x/abi-gen@1.0.14 - @0x/abi-gen-wrappers@1.0.1 - @0x/assert@1.0.14 - @0x/asset-buyer@2.1.0 - @0x/base-contract@3.0.2 - @0x/connect@3.0.2 - @0x/contract-addresses@1.0.1 - @0x/contract-artifacts@1.0.1 - @0x/contract-wrappers@3.0.0 - contracts@2.1.50 - @0x/dev-tools-pages@0.0.2 - @0x/dev-utils@1.0.13 - ethereum-types@1.1.1 - @0x/fill-scenarios@1.0.8 - @0x/instant@0.0.3 - @0x/json-schemas@2.0.0 - @0x/metacoin@0.0.24 - @0x/migrations@2.0.0 - @0x/monorepo-scripts@1.0.12 - @0x/order-utils@2.0.0 - @0x/order-watcher@2.2.0 - @0x/react-docs@1.0.14 - @0x/react-shared@1.0.17 - @0x/sol-compiler@1.1.8 - @0x/sol-cov@2.1.8 - @0x/sol-doc@1.0.3 - @0x/sol-resolver@1.0.15 - @0x/sra-spec@1.0.7 - @0x/subproviders@2.1.0 - @0x/testnet-faucets@1.0.52 - @0x/tslint-config@1.0.9 - @0x/types@1.2.0 - @0x/typescript-typings@3.0.3 - @0x/utils@2.0.3 - @0x/web3-wrapper@3.1.0 - @0x/website@0.0.55 --- packages/utils/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index f2faa63b1..f89cfda17 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/utils", - "version": "2.0.2", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -28,7 +28,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0x/tslint-config": "^1.0.8", + "@0x/tslint-config": "^1.0.9", "@types/detect-node": "2.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -41,13 +41,13 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/types": "^1.1.4", - "@0x/typescript-typings": "^3.0.2", + "@0x/types": "^1.2.0", + "@0x/typescript-typings": "^3.0.3", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^1.1.0", + "ethereum-types": "^1.1.1", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "isomorphic-fetch": "^2.2.1", -- cgit v1.2.3 From 2c04ee3f5e4438f9ae51944e7ea6bd6b501317a7 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 23 Oct 2018 18:30:11 -0700 Subject: chore: Add --format stylish to tslint --- packages/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils') diff --git a/packages/utils/package.json b/packages/utils/package.json index f89cfda17..4e0df9275 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -11,7 +11,7 @@ "build": "tsc -b", "build:ci": "yarn build", "clean": "shx rm -rf lib", - "lint": "tslint --project .", + "lint": "tslint --format stylish --project .", "test": "yarn run_mocha", "test:circleci": "yarn test:coverage", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit", -- cgit v1.2.3