Compare commits

...

80 Commits

Author SHA1 Message Date
Fabio Berger
dfeea78615 Publish
- 0x.js@0.38.6
 - @0xproject/abi-gen@0.3.4
 - @0xproject/assert@0.2.14
 - @0xproject/base-contract@0.3.6
 - @0xproject/connect@0.6.17
 - @0xproject/contract-wrappers@0.1.1
 - contracts@2.1.35
 - @0xproject/dev-utils@0.4.6
 - @0xproject/fill-scenarios@0.0.6
 - @0xproject/json-schemas@0.8.3
 - @0xproject/metacoin@0.0.10
 - @0xproject/migrations@0.0.10
 - @0xproject/order-utils@0.0.9
 - @0xproject/order-watcher@0.0.8
 - @0xproject/react-docs-example@0.0.15
 - @0xproject/react-docs@0.0.16
 - @0xproject/react-shared@0.2.3
 - @0xproject/sol-compiler@0.5.4
 - @0xproject/sol-cov@0.1.3
 - @0xproject/sra-report@0.1.6
 - @0xproject/subproviders@0.10.6
 - @0xproject/testnet-faucets@1.0.36
 - @0xproject/typescript-typings@0.4.3
 - @0xproject/utils@0.7.3
 - @0xproject/web3-wrapper@0.7.3
 - @0xproject/website@0.0.39
2018-07-18 15:10:58 +02:00
Fabio Berger
c8b93adcd0 Updated CHANGELOGS 2018-07-18 15:10:52 +02:00
Fabio Berger
2b02ddc588 Merge pull request #885 from 0xProject/bug-fixes
Development Bug Fixes
2018-07-18 14:21:21 +02:00
Fabio Berger
80c7c23151 Add missing dep 2018-07-18 12:55:49 +02:00
Fabio Berger
c068b574e5 Add PR nr. 2018-07-17 18:49:00 +02:00
Fabio Berger
9a20d4e1c9 Update comments 2018-07-17 18:48:53 +02:00
Fabio Berger
cca471a1ce Add back ethers-contracts types for Aquaduct 2018-07-17 17:05:37 +02:00
Fabio Berger
66d63e8f4f Add isVerbose flag to contract-wrappers subscribe methods 2018-07-17 16:55:55 +02:00
Fabio Berger
e678fed55b Fix bug where we accidentally force Blockstream to always call bound methods with latest param 2018-07-17 16:47:10 +02:00
Fabio Berger
9b10349b7c Remove stateLayer option from OrderWatcher 2018-07-17 16:46:06 +02:00
Fabio Berger
48838e1e98 Add .vscode to gitignore 2018-07-10 14:44:49 +02:00
Fabio Berger
eafd666ecd Move sol-compiler to deps to fix type error 2018-07-10 14:44:07 +02:00
Fabio Berger
599554b785 Publish
- 0x.js@0.38.5
 - @0xproject/abi-gen@0.3.3
 - @0xproject/assert@0.2.13
 - @0xproject/base-contract@0.3.5
 - @0xproject/connect@0.6.16
 - @0xproject/contract-wrappers@0.1.0
 - contracts@2.1.34
 - @0xproject/dev-utils@0.4.5
 - @0xproject/fill-scenarios@0.0.5
 - @0xproject/json-schemas@0.8.2
 - @0xproject/metacoin@0.0.9
 - @0xproject/migrations@0.0.9
 - @0xproject/monorepo-scripts@0.2.2
 - @0xproject/order-utils@0.0.8
 - @0xproject/order-watcher@0.0.7
 - @0xproject/react-docs-example@0.0.14
 - @0xproject/react-docs@0.0.15
 - @0xproject/react-shared@0.2.2
 - @0xproject/sol-compiler@0.5.3
 - @0xproject/sol-cov@0.1.2
 - @0xproject/sol-resolver@0.0.8
 - @0xproject/sra-report@0.1.5
 - @0xproject/subproviders@0.10.5
 - @0xproject/testnet-faucets@1.0.35
 - @0xproject/tslint-config@0.4.21
 - @0xproject/types@0.8.2
 - @0xproject/typescript-typings@0.4.2
 - @0xproject/utils@0.7.2
 - @0xproject/web3-wrapper@0.7.2
 - @0xproject/website@0.0.38
2018-07-09 17:24:22 +02:00
Fabio Berger
d57d282cab Updated CHANGELOGS 2018-07-09 17:24:12 +02:00
Fabio Berger
562bef98e2 reset dep cache 2018-07-09 16:57:40 +02:00
Fabio Berger
900f819be8 Use node v9 everywhere 2018-07-09 16:54:34 +02:00
Fabio Berger
e7337c2451 Update yarn.lock 2018-07-09 16:30:46 +02:00
Fabio Berger
dc81193132 Update package so works with node v9 2018-07-09 16:22:46 +02:00
Fabio Berger
fa868b4963 Bump up node version to v9 2018-07-09 16:09:31 +02:00
Fabio Berger
62945ad363 Updated contract-wrappers to use blockstream v5 and stop unsubscribing on blocksteam error 2018-07-09 15:35:08 +02:00
Fabio Berger
61c38d35be Update yarn.lock 2018-07-09 14:14:03 +02:00
Fabio Berger
4e0ec72896 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Add missing import
  Extend from DecodedLogArgs and fix type names
  Update ethers typings & changelog
  Back-port order-watcher changes from v2-prototype
  Back-port over utils changes from v2-prototype
2018-07-09 14:10:29 +02:00
Fabio Berger
c28289e9a8 Back-port prePublish fixes 2018-07-09 14:05:29 +02:00
Fabio Berger
e7e9ddf232 remove excess new line 2018-07-09 14:03:17 +02:00
Fabio Berger
f03784ba37 update web3-provider-engine in subproviders 2018-07-09 14:01:47 +02:00
Fabio Berger
2445e23c0b Merge pull request #842 from 0xProject/back-port-v2-prototype
Back-port changes from v2-prototype in order to publish working Order-watcher
2018-07-09 13:53:15 +02:00
Fabio Berger
cd29483187 merge development 2018-07-09 13:52:21 +02:00
Fabio Berger
9bacbdab48 Add missing import 2018-07-09 13:47:33 +02:00
Fabio Berger
551d484fb7 Extend from DecodedLogArgs and fix type names 2018-07-09 13:03:53 +02:00
Fabio Berger
ff66432b83 Update ethers typings & changelog 2018-07-09 12:33:44 +02:00
Fabio Berger
a7ae82a2d1 Back-port order-watcher changes from v2-prototype 2018-07-09 12:31:06 +02:00
Fabio Berger
5f34b5a80e Back-port over utils changes from v2-prototype 2018-07-09 11:48:30 +02:00
Leonid Logvinov
8fca2a8116 Merge pull request #768 from galkin/development
Improve 'web3-provider-engine' typings
2018-06-27 09:24:33 +03:00
Nikita Galkin
5472500119 Improve 'web3-provider-engine' typings 2018-06-25 12:22:54 +03:00
Fabio Berger
8fb5c29b4b Publish
- 0x.js@0.38.4
 - @0xproject/abi-gen@0.3.2
 - @0xproject/assert@0.2.12
 - @0xproject/base-contract@0.3.4
 - @0xproject/connect@0.6.15
 - @0xproject/contract-wrappers@0.0.5
 - contracts@2.1.33
 - @0xproject/dev-utils@0.4.4
 - @0xproject/fill-scenarios@0.0.4
 - @0xproject/json-schemas@0.8.1
 - @0xproject/metacoin@0.0.8
 - @0xproject/migrations@0.0.8
 - @0xproject/monorepo-scripts@0.2.1
 - @0xproject/order-utils@0.0.7
 - @0xproject/order-watcher@0.0.6
 - @0xproject/react-docs-example@0.0.13
 - @0xproject/react-docs@0.0.14
 - @0xproject/react-shared@0.2.1
 - @0xproject/sol-compiler@0.5.2
 - @0xproject/sol-cov@0.1.1
 - @0xproject/sol-resolver@0.0.7
 - @0xproject/sra-report@0.1.4
 - @0xproject/subproviders@0.10.4
 - @0xproject/testnet-faucets@1.0.34
 - @0xproject/tslint-config@0.4.20
 - @0xproject/types@0.8.1
 - @0xproject/typescript-typings@0.4.1
 - @0xproject/utils@0.7.1
 - @0xproject/web3-wrapper@0.7.1
 - @0xproject/website@0.0.37
2018-06-19 10:48:07 +02:00
Fabio Berger
40a061a5ca Updated CHANGELOGS 2018-06-19 10:48:00 +02:00
Fabio Berger
2ef82592a3 Improve error message 2018-06-19 10:36:19 +02:00
Fabio Berger
14b5448d70 Add missing timestamp 2018-06-19 10:35:22 +02:00
Fabio Berger
e7d45e47bf Remove the hotfix for Ethersjs and instead update to the fixed version in all packages 2018-06-19 10:30:49 +02:00
Fabio Berger
28268d4355 Update versions and CHANGELOG's to account for unpublished versions on NPM 2018-06-18 23:18:42 +02:00
Fabio Berger
50fa02c1d1 Small fixes 2018-06-18 23:16:44 +02:00
Fabio Berger
b36ff9103d Merge pull request #718 from 0xProject/improvement/publishing-flow
Improve Pre-publishing flow
2018-06-18 23:01:36 +02:00
Fabio Berger
f032c2466c Use semver package instead of getNextPatchVersion 2018-06-18 19:22:31 +02:00
Fabio Berger
b63ddc9be4 Use semver external librarty instead of semverUtils 2018-06-18 19:00:39 +02:00
Fabio Berger
171430b617 small fixes 2018-06-18 17:58:17 +02:00
Fabio Berger
d561043774 Show all errors of a given kind at once rather then throwing after the first instance is encountered 2018-06-18 17:41:03 +02:00
Fabio Berger
b1871e9ddd fix package.json 2018-06-18 16:57:22 +02:00
Fabio Berger
b4a5e7258c Add the following prePublish checks:
- That package version matches latest NPM package version (including unpublished versions)
- That changelogs are properly formatted (lastEntry version >= currentVersion, no accidental timestamps)
- Checks for and removes any git tags locally and remotely that might be left-over from a previous failed publish

Moved changelog related helpers to changelogUtils and other small cleanup refactors.
2018-06-18 16:55:59 +02:00
Fabio Berger
3c75debdf9 Remove the remove_tags script 2018-06-18 16:46:54 +02:00
Fabio Berger
84d1053f73 Add missing timestamp to web3-wrapper changelog 2018-06-15 17:11:30 +02:00
Fabio Berger
f9df42f5d9 Fix incorrect merges 2018-06-15 16:58:36 +02:00
Leonid Logvinov
4414ef0a0f fix cherry-pick 2018-06-15 16:51:13 +02:00
Leonid Logvinov
b7729ada38 fix cherry-pick 2018-06-15 16:48:29 +02:00
Leonid Logvinov
3da67feeb2 Add prepublish_checks 2018-06-15 16:45:18 +02:00
Leonid Logvinov
8a0d563a32 Add CHANGELOG entry 2018-06-15 16:44:48 +02:00
Leonid Logvinov
612fc4a949 Fix cherry-pick 2018-06-15 16:44:35 +02:00
Fabio Berger
bf915ce403 Merge pull request #709 from 0xProject/feature/pin-deps
[DEVELOPMENT] Ethersjs Issue Hot Fix
2018-06-15 14:14:45 +02:00
Fabio Berger
0f9ea9773e Add lib/test and ganache.log to npmignore 2018-06-15 14:14:30 +02:00
Fabio Berger
447a3a6c26 Fix prettier 2018-06-15 13:53:26 +02:00
Fabio Berger
f1cc16c44d Export OrderWatcherConfig from 0x.js 2018-06-15 13:38:25 +02:00
Fabio Berger
aae16b6343 Add ganache.log to gitignore 2018-06-15 13:37:08 +02:00
Fabio Berger
834e1538d1 Fix typos, versions and other mistypings 2018-06-15 11:48:52 +02:00
Leonid Logvinov
afc489bc2c Pin all external dependencies 2018-06-14 21:25:36 -07:00
Leonid Logvinov
3e061e7364 Fix the is not a function bug caused by breaking patch version https://github.com/ethers-io/ethers.js/issues/201 2018-06-14 12:31:57 -07:00
Leonid Logvinov
6395c2a8b2 Update changelogs 2018-06-04 11:19:59 -07:00
Leonid Logvinov
c8225288cd v0.7.0 2018-06-04 11:15:00 -07:00
Leonid Logvinov
4a108aa67d Set default params and jsonrpc in Web3Wrapper._sendRawPayloadAsync 2018-06-04 11:11:18 -07:00
Leonid Logvinov
fd9b3e0dcf Add default jsonRpcId to raw payloads sent from web3Wrapper 2018-06-01 16:01:04 -07:00
Leonid Logvinov
f94b647e61 Publish
- 0x.js@0.38.3
 - contracts@2.1.32
 - @0xproject/order-watcher@0.0.5
 - @0xproject/sra-report@0.1.3
 - @0xproject/testnet-faucets@1.0.33
 - @0xproject/website@0.0.36
2018-05-29 11:29:07 -07:00
Leonid Logvinov
2eccc3efaf Updated CHANGELOGS 2018-05-29 11:29:01 -07:00
Leonid Logvinov
972341725e Remove UMD bundles from order-watcher 2018-05-29 11:13:50 -07:00
Leonid Logvinov
40b10fd29d Publish
- 0x.js@0.38.2
 - @0xproject/contract-wrappers@0.0.4
 - contracts@2.1.31
 - @0xproject/order-watcher@0.0.4
 - @0xproject/sra-report@0.1.2
 - @0xproject/testnet-faucets@1.0.32
 - @0xproject/website@0.0.35
2018-05-29 11:12:33 -07:00
Leonid Logvinov
b31fcffc76 Updated CHANGELOGS 2018-05-29 11:12:26 -07:00
Leonid Logvinov
ec222ea0cd Remove UMD bundles from contract-wrappers 2018-05-29 11:04:00 -07:00
Leonid Logvinov
5533220da0 Publish
- 0x.js@0.38.1
 - @0xproject/connect@0.6.14
 - @0xproject/contract-wrappers@0.0.3
 - contracts@2.1.30
 - @0xproject/fill-scenarios@0.0.3
 - @0xproject/order-utils@0.0.6
 - @0xproject/order-watcher@0.0.3
 - @0xproject/sra-report@0.1.1
 - @0xproject/testnet-faucets@1.0.31
 - @0xproject/website@0.0.34
2018-05-29 11:01:25 -07:00
Leonid Logvinov
6ee7024457 Updated CHANGELOGS 2018-05-29 11:01:18 -07:00
Fabio Berger
f839ac9c58 Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
  Correct documentation variable name
  Publish
  Updated CHANGELOGS
  Updated CHANGELOGS
  Change publish command name
2018-05-22 16:39:15 -07:00
Fabio Berger
1a8b1460a6 Fix signature verification test 2018-05-22 16:38:57 -07:00
Leonid Logvinov
feac0779a4 Merge pull request #608 from prettymuchbryce/docs-fix
Correct documentation variable name
2018-05-22 15:38:27 -07:00
Bryce Neal
d9eeb0421c Correct documentation variable name 2018-05-22 13:37:38 -07:00
140 changed files with 3499 additions and 1756 deletions

View File

@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
environment:
CONTRACTS_COMMIT_HASH: '9ed05f5'
working_directory: ~/repo
@@ -11,12 +11,12 @@ jobs:
- checkout
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-v1-{{ checksum "package.json" }}
- run:
name: yarn
command: yarn --frozen-lockfile
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-v1-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip
@@ -29,7 +29,7 @@ jobs:
- ~/repo
test-installation:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -38,7 +38,7 @@ jobs:
- run: yarn test:installation
test-0xjs:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -55,7 +55,7 @@ jobs:
- ~/repo/packages/0x.js/coverage/lcov.info
test-contracts:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -72,7 +72,7 @@ jobs:
- ~/repo/packages/contracts/coverage/lcov.info
test-sol-compiler:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -89,7 +89,7 @@ jobs:
- ~/repo/packages/sol-compiler/coverage/lcov.info
test-rest:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -131,7 +131,7 @@ jobs:
lint:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
- image: circleci/node:9
steps:
- restore_cache:
keys:
@@ -140,7 +140,7 @@ jobs:
prettier:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
- image: circleci/node:9
steps:
- restore_cache:
keys:
@@ -148,7 +148,7 @@ jobs:
- run: yarn prettier:ci
submit-coverage:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:

5
.gitignore vendored
View File

@@ -67,6 +67,9 @@ generated_docs/
TODO.md
# VSCode file
.vscode
packages/website/public/bundle*
packages/react-docs/example/public/bundle*
@@ -93,3 +96,5 @@ packages/sol-compiler/solc_bin/
# Monorepo scripts
packages/*/scripts/
ganache.log

View File

@@ -13,16 +13,18 @@
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
"report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls",
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js",
"run:publish": "run-s install:all rebuild script:publish",
"run:publish:dry": "run-s install:all rebuild script:publish:dry",
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish",
"run:publish:dry": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish:dry",
"script:prepublish_checks": "node ./packages/monorepo-scripts/lib/prepublish_checks.js",
"script:publish": "node ./packages/monorepo-scripts/lib/publish.js",
"script:publish:dry": "IS_DRY_RUN=true yarn script:publish",
"install:all": "yarn install",
"wsrun": "wsrun",
"lerna:run": "lerna run",
"watch": "wsrun watch $PKG -r --stages --done-criteria='complete|successfully'",
"build": "wsrun build $PKG -r --stages",
"clean": "wsrun clean $PKG -r --parallel",
"watch": "wsrun watch $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
"build": "wsrun build $PKG --fast-exit -r --stages",
"build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
"rebuild": "run-s clean build",
"test": "wsrun test $PKG --serial --exclude-missing",
"stage_docs": "wsrun docs:stage $PKG --parallel --exclude-missing",
@@ -32,13 +34,13 @@
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
},
"devDependencies": {
"async-child-process": "^1.1.1",
"async-child-process": "1.1.1",
"coveralls": "^3.0.0",
"ganache-cli": "^6.1.0",
"lcov-result-merger": "^2.0.0",
"lcov-result-merger": "^3.0.0",
"lerna": "^2.5.1",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"npm-run-all": "4.1.2",
"prettier": "1.12.1",
"wsrun": "^2.2.0"
}
}

View File

@@ -9,3 +9,5 @@ test/
/generated_docs/
/scripts/
/lib/src/monorepo_scripts/
/lib/test/
ganache.log

View File

@@ -1,4 +1,58 @@
[
{
"timestamp": 1531919263,
"version": "0.38.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.38.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.38.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527617805,
"version": "0.38.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527617227,
"version": "0.38.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.38.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.38.0",
"changes": [

View File

@@ -5,12 +5,36 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.38.6 - _July 18, 2018_
* Dependencies updated
## v0.38.5 - _July 9, 2018_
* Dependencies updated
## v0.38.4 - _June 19, 2018_
* Dependencies updated
## v0.38.3 - _May 29, 2018_
* Dependencies updated
## v0.38.2 - _May 29, 2018_
* Dependencies updated
## v0.38.1 - _May 29, 2018_
* Dependencies updated
## v0.38.0 - _May 22, 2018_
* Renamed createOrderStateWatcher to createOrderWatcherAsync since it is now async (#579)
* Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage (#579)
## v0.37.2 - _May 4, 2018_
## v0.37.2 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "0x.js",
"version": "0.38.0",
"version": "0.38.6",
"engines": {
"node": ">=6.12"
},
@@ -66,50 +66,49 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/migrations": "^0.0.6",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/migrations": "^0.0.10",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/sinon": "^2.2.2",
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"opn-cli": "^3.1.0",
"prettier": "^1.11.1",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"@types/mocha": "2.2.48",
"@types/node": "9.6.0",
"@types/sinon": "2.3.7",
"awesome-typescript-loader": "3.5.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"json-loader": "0.5.7",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"opn-cli": "3.1.0",
"prettier": "1.12.1",
"shx": "0.2.2",
"sinon": "4.4.9",
"source-map-support": "0.5.4",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1",
"webpack": "^3.1.0"
"webpack": "3.11.0"
},
"dependencies": {
"@0xproject/assert": "^0.2.10",
"@0xproject/base-contract": "^0.3.2",
"@0xproject/contract-wrappers": "^0.0.2",
"@0xproject/order-utils": "^0.0.5",
"@0xproject/order-watcher": "^0.0.2",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
"@0xproject/assert": "^0.2.14",
"@0xproject/base-contract": "^0.3.6",
"@0xproject/contract-wrappers": "^0.1.1",
"@0xproject/order-utils": "^0.0.9",
"@0xproject/order-watcher": "^0.0.8",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethers": "3.0.22",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -19,6 +19,8 @@ export {
TransactionReceiptWithDecodedLogs,
} from '@0xproject/types';
export { OrderWatcherConfig } from '@0xproject/order-watcher';
export {
EventCallback,
ContractEvent,

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.3.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.3.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.3.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.3.1",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"version": "0.3.0",
"changes": [

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.3.4 - _July 18, 2018_
* Dependencies updated
## v0.3.3 - _July 9, 2018_
* Dependencies updated
## v0.3.2 - _June 19, 2018_
* Dependencies updated
## v0.3.1 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.3.0 - _May 22, 2018_
* Properly export the executable binary (#588)
## v0.2.13 - _May 4, 2018_
## v0.2.13 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/abi-gen",
"version": "0.3.0",
"version": "0.3.4",
"engines": {
"node": ">=6.12"
},
@@ -27,29 +27,29 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"chalk": "^2.3.0",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"to-snake-case": "^1.0.0",
"yargs": "^10.0.3"
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"chalk": "2.3.2",
"glob": "7.1.1",
"handlebars": "4.0.11",
"lodash": "4.17.10",
"mkdirp": "0.5.1",
"to-snake-case": "1.0.0",
"yargs": "11.1.0"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/glob": "^5.0.33",
"@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.1",
"@types/node": "^8.0.53",
"@types/yargs": "^10.0.0",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/glob": "5.0.35",
"@types/handlebars": "4.0.36",
"@types/mkdirp": "0.5.2",
"@types/node": "9.6.0",
"@types/yargs": "10.0.2",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.2.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.2.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.2.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.2.11",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527008270,
"version": "0.2.10",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.2.14 - _July 18, 2018_
* Dependencies updated
## v0.2.13 - _July 9, 2018_
* Dependencies updated
## v0.2.12 - _June 19, 2018_
* Dependencies updated
## v0.2.11 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.2.10 - _May 22, 2018_
* Dependencies updated
## v0.2.9 - _May 4, 2018_
## v0.2.9 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/assert",
"version": "0.2.10",
"version": "0.2.14",
"engines": {
"node": ">=6.12"
},
@@ -30,28 +30,28 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"@types/mocha": "2.2.48",
"@types/valid-url": "1.0.2",
"chai": "4.1.2",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"lodash": "^4.17.4",
"valid-url": "^1.0.9"
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"lodash": "4.17.10",
"valid-url": "1.0.9"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,41 @@
[
{
"timestamp": 1531919263,
"version": "0.3.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.3.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.3.4",
"changes": [
{
"note":
"Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201"
}
],
"timestamp": 1529397769
},
{
"timestamp": 1527810075,
"version": "0.3.3",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
]
},
{
"timestamp": 1527008270,
"version": "0.3.2",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.3.6 - _July 18, 2018_
* Dependencies updated
## v0.3.5 - _July 9, 2018_
* Dependencies updated
## v0.3.4 - _June 19, 2018_
* Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201
## v0.3.3 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.3.2 - _May 22, 2018_
* Dependencies updated
## v0.3.1 - _May 4, 2018_
## v0.3.1 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/base-contract",
"version": "0.3.2",
"version": "0.3.6",
"engines": {
"node": ">=6.12"
},
@@ -29,25 +29,25 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"chai": "4.1.2",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethers": "3.0.22",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.6.17",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.6.16",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.6.15",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.6.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527008270,
"version": "0.6.13",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.6.17 - _July 18, 2018_
* Dependencies updated
## v0.6.16 - _July 9, 2018_
* Dependencies updated
## v0.6.15 - _June 19, 2018_
* Dependencies updated
## v0.6.14 - _May 29, 2018_
* Dependencies updated
## v0.6.13 - _May 22, 2018_
* Dependencies updated
## v0.6.12 - _May 4, 2018_
## v0.6.12 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/connect",
"version": "0.6.13",
"version": "0.6.17",
"engines": {
"node": ">=6.12"
},
@@ -50,37 +50,37 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
"dependencies": {
"@0xproject/assert": "^0.2.10",
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
"query-string": "^5.0.1",
"websocket": "^1.0.25"
"@0xproject/assert": "^0.2.14",
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"isomorphic-fetch": "2.2.1",
"lodash": "4.17.10",
"query-string": "4.3.4",
"websocket": "1.0.25"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/fetch-mock": "^5.12.1",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/fetch-mock": "5.12.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/query-string": "^5.0.1",
"@types/websocket": "^0.0.34",
"async-child-process": "^1.1.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"fetch-mock": "^5.13.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"@types/mocha": "2.2.48",
"@types/query-string": "5.1.0",
"@types/websocket": "0.0.34",
"async-child-process": "1.1.1",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"fetch-mock": "5.13.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typedoc": "0.8.0",
"typescript": "2.7.1"
},
"publishConfig": {

View File

@@ -16,7 +16,7 @@ export interface OrderbookChannel {
}
/**
* heartbeatInterval: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
* heartbeatIntervalMs: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
*/
export interface WebSocketOrderbookChannelConfig {
heartbeatIntervalMs?: number;

View File

@@ -1,4 +1,50 @@
[
{
"timestamp": 1531919263,
"version": "0.1.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.1.0",
"changes": [
{
"note":
"Update Blockstream dep. to V5.0 and no longer force unsubscribe on blockstream error (which are not recoverable)"
}
],
"timestamp": 1531149657
},
{
"timestamp": 1529397769,
"version": "0.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527617227,
"version": "0.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.2",
"changes": [

View File

@@ -5,6 +5,26 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.1.1 - _July 18, 2018_
* Dependencies updated
## v0.1.0 - _July 9, 2018_
* Update Blockstream dep. to V5.0 and no longer force unsubscribe on blockstream error (which are not recoverable)
## v0.0.5 - _June 19, 2018_
* Dependencies updated
## v0.0.4 - _May 29, 2018_
* Dependencies updated
## v0.0.3 - _May 29, 2018_
* Dependencies updated
## v0.0.2 - _May 22, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/contract-wrappers",
"version": "0.0.2",
"version": "0.1.1",
"description": "Smart TS wrappers for 0x smart contracts",
"keywords": [
"0xproject",
@@ -27,13 +27,7 @@
},
"config": {
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels",
"postpublish": {
"assets": [
"packages/contract-wrappers/_bundles/index.js",
"packages/contract-wrappers/_bundles/index.min.js"
]
}
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels"
},
"repository": {
"type": "git",
@@ -44,53 +38,53 @@
"node": ">=6.0.0"
},
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/migrations": "^0.0.6",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/subproviders": "^0.10.2",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/migrations": "^0.0.10",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/subproviders": "^0.10.6",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/sinon": "^2.2.2",
"@types/uuid": "^3.4.2",
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"opn-cli": "^3.1.0",
"prettier": "^1.11.1",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"@types/mocha": "2.2.48",
"@types/node": "9.6.0",
"@types/sinon": "2.3.7",
"@types/uuid": "3.4.3",
"awesome-typescript-loader": "3.5.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"opn-cli": "3.1.0",
"prettier": "1.12.1",
"shx": "0.2.2",
"sinon": "4.4.9",
"source-map-support": "0.5.4",
"tslint": "5.8.0",
"typescript": "2.7.1",
"web3-provider-engine": "^14.0.4"
"web3-provider-engine": "13.8.0"
},
"dependencies": {
"@0xproject/assert": "^0.2.10",
"@0xproject/base-contract": "^0.3.2",
"@0xproject/fill-scenarios": "^0.0.2",
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/order-utils": "^0.0.5",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereumjs-blockstream": "^2.0.6",
"ethereumjs-util": "^5.1.1",
"ethers": "^3.0.15",
"js-sha3": "^0.7.0",
"lodash": "^4.17.4",
"uuid": "^3.1.0"
"@0xproject/assert": "^0.2.14",
"@0xproject/base-contract": "^0.3.6",
"@0xproject/fill-scenarios": "^0.0.6",
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/order-utils": "^0.0.9",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethereumjs-blockstream": "5.0.0",
"ethereumjs-util": "5.1.5",
"ethers": "3.0.22",
"js-sha3": "0.7.0",
"lodash": "4.17.10",
"uuid": "3.2.1"
},
"publishConfig": {
"access": "public"

View File

@@ -7,9 +7,9 @@ import {
LogWithDecodedArgs,
RawLog,
} from '@0xproject/types';
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
import { intervalUtils, logUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream';
import * as _ from 'lodash';
import {
@@ -38,7 +38,7 @@ const CONTRACT_NAME_TO_NOT_FOUND_ERROR: {
export class ContractWrapper {
protected _web3Wrapper: Web3Wrapper;
protected _networkId: number;
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer;
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer<Block, Log> | undefined;
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
private _filters: { [filterToken: string]: FilterObject };
private _filterCallbacks: {
@@ -46,6 +46,13 @@ export class ContractWrapper {
};
private _onLogAddedSubscriptionToken: string | undefined;
private _onLogRemovedSubscriptionToken: string | undefined;
private static _onBlockstreamError(isVerbose: boolean, err: Error): void {
// Noop on blockstream errors since they are automatically
// recovered from and don't cause Blockstream to exit.
if (isVerbose) {
logUtils.warn(err.message);
}
}
constructor(web3Wrapper: Web3Wrapper, networkId: number) {
this._web3Wrapper = web3Wrapper;
this._networkId = networkId;
@@ -81,10 +88,11 @@ export class ContractWrapper {
indexFilterValues: IndexedFilterValues,
abi: ContractAbi,
callback: EventCallback<ArgsType>,
isVerbose: boolean = false,
): string {
const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi);
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
this._startBlockAndLogStream();
this._startBlockAndLogStream(isVerbose);
}
const filterToken = filterUtils.generateUUID();
this._filters[filterToken] = filter;
@@ -155,20 +163,21 @@ export class ContractWrapper {
}
});
}
private _startBlockAndLogStream(): void {
private _startBlockAndLogStream(isVerbose: boolean): void {
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
throw new Error(ContractWrappersError.SubscriptionAlreadyPresent);
}
this._blockAndLogStreamerIfExists = new BlockAndLogStreamer(
this._web3Wrapper.getBlockAsync.bind(this._web3Wrapper),
this._web3Wrapper.getLogsAsync.bind(this._web3Wrapper),
ContractWrapper._onBlockstreamError.bind(this, isVerbose),
);
const catchAllLogFilter = {};
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
this._reconcileBlockAsync.bind(this),
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
this._onReconcileBlockError.bind(this),
ContractWrapper._onBlockstreamError.bind(this, isVerbose),
);
let isRemoved = false;
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
@@ -179,12 +188,6 @@ export class ContractWrapper {
this._onLogStateChanged.bind(this, isRemoved),
);
}
private _onReconcileBlockError(err: Error): void {
const filterTokens = _.keys(this._filterCallbacks);
_.each(filterTokens, filterToken => {
this._unsubscribe(filterToken, err);
});
}
private _setNetworkId(networkId: number): void {
this._networkId = networkId;
}

View File

@@ -133,6 +133,7 @@ export class EtherTokenWrapper extends ContractWrapper {
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{_owner: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends EtherTokenContractEventArgs>(
@@ -140,6 +141,7 @@ export class EtherTokenWrapper extends ContractWrapper {
eventName: EtherTokenEvents,
indexFilterValues: IndexedFilterValues,
callback: EventCallback<ArgsType>,
isVerbose: boolean = false,
): string {
assert.isETHAddressHex('etherTokenAddress', etherTokenAddress);
const normalizedEtherTokenAddress = etherTokenAddress.toLowerCase();
@@ -152,6 +154,7 @@ export class EtherTokenWrapper extends ContractWrapper {
indexFilterValues,
artifacts.EtherToken.abi,
callback,
isVerbose,
);
return subscriptionToken;
}

View File

@@ -652,12 +652,14 @@ export class ExchangeWrapper extends ContractWrapper {
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends ExchangeContractEventArgs>(
eventName: ExchangeEvents,
indexFilterValues: IndexedFilterValues,
callback: EventCallback<ArgsType>,
isVerbose: boolean = false,
): string {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
@@ -669,6 +671,7 @@ export class ExchangeWrapper extends ContractWrapper {
indexFilterValues,
artifacts.Exchange.abi,
callback,
isVerbose,
);
return subscriptionToken;
}

View File

@@ -350,6 +350,7 @@ export class TokenWrapper extends ContractWrapper {
* @param indexFilterValues An object where the keys are indexed args returned by the event and
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
* @param callback Callback that gets called when a log is added/removed
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
* @return Subscription token used later to unsubscribe
*/
public subscribe<ArgsType extends TokenContractEventArgs>(
@@ -357,6 +358,7 @@ export class TokenWrapper extends ContractWrapper {
eventName: TokenEvents,
indexFilterValues: IndexedFilterValues,
callback: EventCallback<ArgsType>,
isVerbose: boolean = false,
): string {
assert.isETHAddressHex('tokenAddress', tokenAddress);
const normalizedTokenAddress = tokenAddress.toLowerCase();
@@ -369,6 +371,7 @@ export class TokenWrapper extends ContractWrapper {
indexFilterValues,
artifacts.Token.abi,
callback,
isVerbose,
);
return subscriptionToken;
}

View File

@@ -51,34 +51,6 @@ describe('SubscriptionTest', () => {
_.each(stubs, s => s.restore());
stubs = [];
});
it('Should receive the Error when an error occurs while fetching the block', (done: DoneCallback) => {
(async () => {
const errMsg = 'Error fetching block';
const callback = callbackErrorReporter.assertNodeCallbackError(done, errMsg);
stubs = [Sinon.stub((contractWrappers as any)._web3Wrapper, 'getBlockAsync').throws(new Error(errMsg))];
contractWrappers.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await contractWrappers.token.setAllowanceAsync(
tokenAddress,
coinbase,
addressWithoutFunds,
allowanceAmount,
);
})().catch(done);
});
it('Should receive the Error when an error occurs while reconciling the new block', (done: DoneCallback) => {
(async () => {
const errMsg = 'Error fetching logs';
const callback = callbackErrorReporter.assertNodeCallbackError(done, errMsg);
stubs = [Sinon.stub((contractWrappers as any)._web3Wrapper, 'getLogsAsync').throws(new Error(errMsg))];
contractWrappers.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await contractWrappers.token.setAllowanceAsync(
tokenAddress,
coinbase,
addressWithoutFunds,
allowanceAmount,
);
})().catch(done);
});
it('Should allow unsubscribeAll to be called successfully after an error', (done: DoneCallback) => {
(async () => {
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;

View File

@@ -6,7 +6,7 @@
// tslint:disable-next-line:no-unused-variable
import { BaseContract } from '@0xproject/base-contract';
import { ContractArtifact } from '@0xproject/sol-compiler';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
import { BigNumber, classUtils, logUtils, promisify } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as ethers from 'ethers';

View File

@@ -1,4 +1,4 @@
export interface {{name}}ContractEventArgs {
export interface {{name}}ContractEventArgs extends DecodedLogArgs {
{{#each inputs}}
{{name}}: {{#returnType type components}}{{/returnType}};
{{/each}}

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "contracts",
"version": "2.1.29",
"version": "2.1.35",
"engines": {
"node": ">=6.12"
},
@@ -42,40 +42,40 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md",
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/node": "^8.0.53",
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"shx": "^0.2.2",
"solc": "^0.4.23",
"@types/node": "9.6.0",
"@types/yargs": "10.0.2",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"prettier": "1.12.1",
"shx": "0.2.2",
"solc": "0.4.23",
"tslint": "5.8.0",
"typescript": "2.7.1",
"yargs": "^10.0.3"
"yargs": "11.1.0"
},
"dependencies": {
"0x.js": "^0.38.0",
"@0xproject/base-contract": "^0.3.2",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-util": "^5.1.1",
"ethers": "^3.0.15",
"lodash": "^4.17.4",
"web3": "^0.20.0"
"0x.js": "^0.38.6",
"@0xproject/base-contract": "^0.3.6",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"bn.js": "4.11.7",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "5.1.5",
"ethers": "3.0.22",
"lodash": "4.17.10",
"web3": "0.20.6"
}
}

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.4.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.4.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.4.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.4.3",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"version": "0.4.2",
"changes": [

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.4.6 - _July 18, 2018_
* Dependencies updated
## v0.4.5 - _July 9, 2018_
* Dependencies updated
## v0.4.4 - _June 19, 2018_
* Dependencies updated
## v0.4.3 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.4.2 - _May 22, 2018_
* Move callbackErrorReporter over from 0x.js (#579)
## v0.4.1 - _May 4, 2018_
## v0.4.1 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/dev-utils",
"version": "0.4.2",
"version": "0.4.6",
"engines": {
"node": ">=6.12"
},
@@ -29,29 +29,29 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"@types/mocha": "2.2.48",
"chai": "4.1.2",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/sol-cov": "^0.0.11",
"@0xproject/subproviders": "^0.10.2",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/web3-wrapper": "^0.6.4",
"lodash": "^4.17.4",
"web3": "^0.20.0",
"web3-provider-engine": "^14.0.4"
"@0xproject/sol-cov": "^0.1.3",
"@0xproject/subproviders": "^0.10.6",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/web3-wrapper": "^0.7.3",
"lodash": "4.17.10",
"web3": "0.20.6",
"web3-provider-engine": "13.8.0"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527008544,
"version": "0.0.2",

View File

@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.6 - _July 18, 2018_
* Dependencies updated
## v0.0.5 - _July 9, 2018_
* Dependencies updated
## v0.0.4 - _June 19, 2018_
* Dependencies updated
## v0.0.3 - _May 29, 2018_
* Dependencies updated
## v0.0.2 - _May 22, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/fill-scenarios",
"version": "0.0.2",
"version": "0.0.6",
"description": "0x order fill scenario generator",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@@ -23,27 +23,27 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md",
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/base-contract": "^0.3.2",
"@0xproject/order-utils": "^0.0.5",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
"@0xproject/base-contract": "^0.3.6",
"@0xproject/order-utils": "^0.0.9",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethers": "3.0.22",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.8.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.8.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.8.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.8.0",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527008794,
"version": "0.7.24",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.8.3 - _July 18, 2018_
* Dependencies updated
## v0.8.2 - _July 9, 2018_
* Dependencies updated
## v0.8.1 - _June 19, 2018_
* Dependencies updated
## v0.8.0 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.7.24 - _May 22, 2018_
* Dependencies updated
## v0.7.23 - _May 4, 2018_
## v0.7.23 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/json-schemas",
"version": "0.7.24",
"version": "0.8.3",
"engines": {
"node": ">=6.12"
},
@@ -45,27 +45,27 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md",
"dependencies": {
"@0xproject/typescript-typings": "^0.3.2",
"@types/node": "^8.0.53",
"jsonschema": "^1.2.0",
"lodash.values": "^4.3.0"
"@0xproject/typescript-typings": "^0.4.3",
"@types/node": "9.6.0",
"jsonschema": "1.2.2",
"lodash.values": "4.3.0"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/utils": "^0.6.2",
"@types/lodash.foreach": "^4.5.3",
"@types/lodash.values": "^4.3.3",
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"lodash.foreach": "^4.5.0",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@0xproject/utils": "^0.7.3",
"@types/lodash.foreach": "4.5.3",
"@types/lodash.values": "4.3.3",
"@types/mocha": "2.2.48",
"chai": "4.1.2",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"lodash.foreach": "4.5.0",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1"

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/metacoin",
"version": "0.0.7",
"version": "0.0.10",
"engines": {
"node": ">=6.12"
},
@@ -26,28 +26,28 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/base-contract": "^0.3.2",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/sol-cov": "^0.0.11",
"@0xproject/subproviders": "^0.10.2",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/types": "^0.7.0",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethers": "^3.0.15",
"lodash": "^4.17.4",
"web3-provider-engine": "^14.0.4"
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/base-contract": "^0.3.6",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/sol-cov": "^0.1.3",
"@0xproject/subproviders": "^0.10.6",
"@0xproject/tslint-config": "^0.4.21",
"@0xproject/types": "^0.8.2",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethers": "3.0.22",
"lodash": "4.17.10",
"web3-provider-engine": "13.8.0"
},
"devDependencies": {
"@0xproject/dev-utils": "^0.4.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"@0xproject/dev-utils": "^0.4.6",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
}

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.0.10",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.0.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.7",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527008794,
"version": "0.0.6",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.10 - _July 18, 2018_
* Dependencies updated
## v0.0.9 - _July 9, 2018_
* Dependencies updated
## v0.0.8 - _June 19, 2018_
* Dependencies updated
## v0.0.7 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.0.6 - _May 22, 2018_
* Dependencies updated
## v0.0.5 - _May 4, 2018_
## v0.0.5 - _May 5, 2018_
* Dependencies updated

View File

@@ -668,5 +668,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
"links": {},
"constructorArgs": "[\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
}
}
}

View File

@@ -715,5 +715,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
"links": {},
"constructorArgs": "[[\"0x5409ed021d9299bf6814279a6a1411a7e866a631\",\"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb\"],\"2\",\"0\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
}
}
}

View File

@@ -590,5 +590,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
"links": {},
"constructorArgs": "[]"
}
}
}

View File

@@ -226,5 +226,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
"links": {},
"constructorArgs": "[]"
}
}
}

View File

@@ -322,5 +322,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
"links": {},
"constructorArgs": "[]"
}
}
}

View File

@@ -278,5 +278,11 @@
}
}
},
"networks": {}
"networks": {
"50": {
"address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
"links": {},
"constructorArgs": "[]"
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/migrations",
"version": "0.0.6",
"version": "0.0.10",
"engines": {
"node": ">=6.12"
},
@@ -24,24 +24,24 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/types": "^0.7.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/tslint-config": "^0.4.21",
"@0xproject/types": "^0.8.2",
"make-promises-safe": "1.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/base-contract": "^0.3.2",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
"@0xproject/base-contract": "^0.3.6",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"ethers": "3.0.22",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,32 @@
[
{
"timestamp": 1531149657,
"version": "0.2.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.2.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529081166,
"version": "0.2.0",
"changes": [
{
"note": "Add `prepublish_checks` script",
"pr": 650
}
]
},
{
"timestamp": 1527008794,
"version": "0.1.20",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.2.2 - _July 9, 2018_
* Dependencies updated
## v0.2.1 - _June 19, 2018_
* Dependencies updated
## v0.2.0 - _June 15, 2018_
* Add `prepublish_checks` script (#650)
## v0.1.20 - _May 22, 2018_
* Dependencies updated

View File

@@ -8,8 +8,6 @@ This repository contains a few helpful scripts for working with this mono repo.
**`yarn find_unused_deps`**: Sometimes we accidentally leave dependencies listed in `package.json` that are no longer being used. This script finds potential dependencies that might no longer be in use. Please verify that it is no longer in use before removing, the `depcheck` package we use under-the-hood doesn't handle some TS quirks perfectly.
**`yarn remove_tags`**: Our publishing script calls `lerna publish` under-the-hood. If this command fails, it might have created new versioned git tags for each package. Removing these manually is tedious, so you can also run this command instead. Before doing so, check to see if `lerna` already created the publish commit. If so, first revert that with `git reset --hard HEAD~1`, then run this command.
**`yarn test:publish`**: Execute a test-run of the publish script. This dry run won't actually publish, nor will it commit/push anything to Github.
## Usage

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/monorepo-scripts",
"version": "0.1.20",
"version": "0.2.2",
"engines": {
"node": ">=6.12"
},
@@ -14,11 +14,10 @@
"build": "tsc",
"test:publish": "run-s build script:publish",
"find_unused_deps": "run-s build script:find_unused_deps",
"remove_tags": "run-s build script:remove_tags",
"script:deps_versions": "node ./lib/deps_versions.js",
"script:prepublish_checks": "node ./lib/prepublish_checks.js",
"script:publish": "IS_DRY_RUN=true node ./lib/publish.js",
"script:find_unused_deps": "node ./lib/find_unused_dependencies.js",
"script:remove_tags": "node ./lib/remove_tags.js"
"script:find_unused_deps": "node ./lib/find_unused_dependencies.js"
},
"repository": {
"type": "git",
@@ -30,32 +29,35 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/monorepo-scripts/README.md",
"devDependencies": {
"@types/glob": "^5.0.33",
"@types/node": "^8.0.53",
"@types/opn": "^5.1.0",
"@types/rimraf": "^2.0.2",
"depcheck": "^0.6.9",
"lerna-get-packages": "^1.0.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"@types/glob": "5.0.35",
"@types/node": "9.6.0",
"@types/opn": "5.1.0",
"@types/rimraf": "2.0.2",
"@types/semver": "5.5.0",
"depcheck": "0.6.9",
"lerna-get-packages": "1.0.0",
"make-promises-safe": "1.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@types/depcheck": "^0.6.0",
"async-child-process": "^1.1.1",
"chalk": "^2.3.0",
"es6-promisify": "^5.0.0",
"glob": "^7.1.2",
"lodash": "^4.17.4",
"@types/depcheck": "0.6.0",
"async-child-process": "1.1.1",
"chalk": "2.3.2",
"es6-promisify": "5.0.0",
"glob": "7.1.1",
"isomorphic-fetch": "2.2.1",
"lodash": "4.17.10",
"moment": "2.21.0",
"opn": "^5.3.0",
"promisify-child-process": "^1.0.5",
"prompt": "^1.0.0",
"opn": "5.3.0",
"promisify-child-process": "1.0.5",
"prompt": "1.0.0",
"publish-release": "0xproject/publish-release",
"rimraf": "^2.6.2",
"semver-diff": "^2.1.0",
"rimraf": "2.6.2",
"semver": "5.5.0",
"semver-diff": "2.1.0",
"semver-sort": "0.0.4"
},
"publishConfig": {

View File

@@ -5,7 +5,7 @@ import * as fs from 'fs';
import { sync as globSync } from 'glob';
import * as _ from 'lodash';
import { utils } from './utils';
import { utils } from './utils/utils';
interface Dependencies {
[depName: string]: string;

View File

@@ -7,7 +7,7 @@ import * as _ from 'lodash';
import { exec as execAsync } from 'promisify-child-process';
import { constants } from './constants';
import { utils } from './utils';
import { utils } from './utils/utils';
// For some reason, `depcheck` hangs on some packages. Add them here.
const IGNORE_PACKAGES = ['@0xproject/sol-compiler'];

View File

@@ -7,7 +7,7 @@ import * as publishRelease from 'publish-release';
import semverSort = require('semver-sort');
import { constants } from './constants';
import { utils } from './utils';
import { utils } from './utils/utils';
const publishReleaseAsync = promisify(publishRelease);
const generatedDocsDirectoryName = 'generated_docs';

View File

@@ -0,0 +1,190 @@
import * as _ from 'lodash';
import { exec as execAsync } from 'promisify-child-process';
import semver = require('semver');
import semverSort = require('semver-sort');
import { constants } from './constants';
import { changelogUtils } from './utils/changelog_utils';
import { npmUtils } from './utils/npm_utils';
import { utils } from './utils/utils';
async function prepublishChecksAsync(): Promise<void> {
const shouldIncludePrivate = false;
const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicLernaPackages);
await checkChangelogFormatAsync(updatedPublicLernaPackages);
await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicLernaPackages);
await checkPublishRequiredSetupAsync();
}
async function checkGitTagsForNextVersionAndDeleteIfExistAsync(
updatedPublicLernaPackages: LernaPackage[],
): Promise<void> {
const packageNames = _.map(updatedPublicLernaPackages, lernaPackage => lernaPackage.package.name);
const localGitTags = await utils.getLocalGitTagsAsync();
const localTagVersionsByPackageName = await utils.getGitTagsByPackageNameAsync(packageNames, localGitTags);
const remoteGitTags = await utils.getRemoteGitTagsAsync();
const remoteTagVersionsByPackageName = await utils.getGitTagsByPackageNameAsync(packageNames, remoteGitTags);
for (const lernaPackage of updatedPublicLernaPackages) {
const currentVersion = lernaPackage.package.version;
const packageName = lernaPackage.package.name;
const packageLocation = lernaPackage.location;
const nextVersion = await utils.getNextPackageVersionAsync(currentVersion, packageName, packageLocation);
const remoteTagVersions = remoteTagVersionsByPackageName[packageName];
if (_.includes(remoteTagVersions, nextVersion)) {
const tagName = `:refs/tags/${packageName}@${nextVersion}`;
await utils.removeRemoteTagAsync(tagName);
}
const localTagVersions = localTagVersionsByPackageName[packageName];
if (_.includes(localTagVersions, nextVersion)) {
const tagName = `${packageName}@${nextVersion}`;
await utils.removeLocalTagAsync(tagName);
}
}
}
async function checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(
updatedPublicLernaPackages: LernaPackage[],
): Promise<void> {
utils.log('Check package versions against npmjs.org...');
const versionMismatches = [];
for (const lernaPackage of updatedPublicLernaPackages) {
const packageName = lernaPackage.package.name;
const packageVersion = lernaPackage.package.version;
const packageRegistryJsonIfExists = await npmUtils.getPackageRegistryJsonIfExistsAsync(packageName);
if (_.isUndefined(packageRegistryJsonIfExists)) {
continue; // noop for packages not yet published to NPM
}
const allVersionsIncludingUnpublished = npmUtils.getPreviouslyPublishedVersions(packageRegistryJsonIfExists);
const sortedVersions = semverSort.desc(allVersionsIncludingUnpublished);
const latestNPMVersion = sortedVersions[0];
if (packageVersion !== latestNPMVersion) {
versionMismatches.push({
packageJsonVersion: packageVersion,
npmVersion: latestNPMVersion,
packageName,
});
}
}
if (!_.isEmpty(versionMismatches)) {
utils.log(`Found version mismatches between package.json and NPM published versions (might be unpublished).`);
_.each(versionMismatches, versionMismatch => {
utils.log(
`${versionMismatch.packageName}: ${versionMismatch.packageJsonVersion} package.json, ${
versionMismatch.npmVersion
} on NPM`,
);
});
throw new Error(`Please fix the above package.json/NPM inconsistencies.`);
}
}
async function checkChangelogFormatAsync(updatedPublicLernaPackages: LernaPackage[]): Promise<void> {
utils.log('Check CHANGELOGs for inconsistencies...');
const changeLogInconsistencies = [];
for (const lernaPackage of updatedPublicLernaPackages) {
const packageName = lernaPackage.package.name;
const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location);
const currentVersion = lernaPackage.package.version;
if (!_.isEmpty(changelog)) {
const lastEntry = changelog[0];
const doesLastEntryHaveTimestamp = !_.isUndefined(lastEntry.timestamp);
if (semver.lt(lastEntry.version, currentVersion)) {
changeLogInconsistencies.push({
packageJsonVersion: currentVersion,
changelogVersion: lastEntry.version,
packageName,
});
} else if (semver.gt(lastEntry.version, currentVersion) && doesLastEntryHaveTimestamp) {
// Remove incorrectly added timestamp
delete changelog[0].timestamp;
// Save updated CHANGELOG.json
await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog);
utils.log(`${packageName}: Removed timestamp from latest CHANGELOG.json entry.`);
}
}
}
if (!_.isEmpty(changeLogInconsistencies)) {
utils.log(`CHANGELOG versions cannot below package.json versions:`);
_.each(changeLogInconsistencies, inconsistency => {
utils.log(
`${inconsistency.packageName}: ${inconsistency.packageJsonVersion} package.json, ${
inconsistency.changelogVersion
} CHANGELOG.json`,
);
});
throw new Error('Fix the above inconsistencies to continue.');
}
}
async function checkPublishRequiredSetupAsync(): Promise<void> {
// check to see if logged into npm before publishing
try {
// HACK: for some reason on some setups, the `npm whoami` will not recognize a logged-in user
// unless run with `sudo` (i.e Fabio's NVM setup) but is fine for others (Jacob's NVM setup).
utils.log('Checking that the user is logged in on npm...');
await execAsync(`sudo npm whoami`);
} catch (err) {
throw new Error('You must be logged into npm in the commandline to publish. Run `npm login` and try again.');
}
// Check to see if Git personal token setup
if (_.isUndefined(constants.githubPersonalAccessToken)) {
throw new Error(
'You must have a Github personal access token set to an envVar named `GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS`. Add it then try again.',
);
}
// Check Yarn version is 1.X
utils.log('Checking the yarn version...');
const result = await execAsync(`yarn --version`);
const version = result.stdout;
const versionSegments = version.split('.');
const majorVersion = _.parseInt(versionSegments[0]);
if (majorVersion < 1) {
throw new Error('Your yarn version must be v1.x or higher. Upgrade yarn and try again.');
}
// Check that `aws` commandline tool is installed
try {
utils.log('Checking that aws CLI tool is installed...');
await execAsync(`aws help`);
} catch (err) {
throw new Error('You must have `awscli` commandline tool installed. Install it and try again.');
}
// Check that `aws` credentials are setup
try {
utils.log('Checking that aws credentials are configured...');
await execAsync(`aws sts get-caller-identity`);
} catch (err) {
throw new Error('You must setup your AWS credentials by running `aws configure`. Do this and try again.');
}
utils.log('Checking that git branch is up to date with upstream...');
await execAsync('git fetch');
const res = await execAsync('git status -bs'); // s - short format, b - branch info
/**
* Possible outcomes
* ## branch_name...origin/branch_name [behind n]
* ## branch_name...origin/branch_name [ahead n]
* ## branch_name...origin/branch_name
*/
const gitShortStatusHeader = res.stdout.split('\n')[0];
if (gitShortStatusHeader.includes('behind')) {
throw new Error('Your branch is behind upstream. Please pull before publishing.');
} else if (gitShortStatusHeader.includes('ahead')) {
throw new Error('Your branch is ahead of upstream. Please push before publishing.');
}
}
prepublishChecksAsync().catch(err => {
utils.log(err.message);
process.exit(1);
});

View File

@@ -1,26 +1,24 @@
#!/usr/bin/env node
import * as promisify from 'es6-promisify';
import * as fs from 'fs';
import lernaGetPackages = require('lerna-get-packages');
import * as _ from 'lodash';
import * as moment from 'moment';
import opn = require('opn');
import * as path from 'path';
import { exec as execAsync, spawn } from 'promisify-child-process';
import * as prompt from 'prompt';
import semver = require('semver');
import semverDiff = require('semver-diff');
import semverSort = require('semver-sort');
import { constants } from './constants';
import { Changelog, Changes, PackageToVersionChange, SemVerIndex, UpdatedPackage } from './types';
import { utils } from './utils';
import { PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
import { changelogUtils } from './utils/changelog_utils';
import { utils } from './utils/utils';
const DOC_GEN_COMMAND = 'docs:json';
const NPM_NAMESPACE = '@0xproject/';
const IS_DRY_RUN = process.env.IS_DRY_RUN === 'true';
const TODAYS_TIMESTAMP = moment().unix();
const LERNA_EXECUTABLE = './node_modules/lerna/bin/lerna.js';
const semverNameToIndex: { [semver: string]: number } = {
patch: SemVerIndex.Patch,
minor: SemVerIndex.Minor,
@@ -39,11 +37,6 @@ const packageNameToWebsitePath: { [name: string]: string } = {
};
(async () => {
const hasRequiredSetup = await checkPublishRequiredSetupAsync();
if (!hasRequiredSetup) {
return; // abort
}
// Fetch public, updated Lerna packages
const shouldIncludePrivate = false;
const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
@@ -114,54 +107,6 @@ package.ts. Please add an entry for it and try again.`,
}
}
async function checkPublishRequiredSetupAsync(): Promise<boolean> {
// check to see if logged into npm before publishing
try {
// HACK: for some reason on some setups, the `npm whoami` will not recognize a logged-in user
// unless run with `sudo` (i.e Fabio's NVM setup) but is fine for others (Jacob's N setup).
await execAsync(`sudo npm whoami`);
} catch (err) {
utils.log('You must be logged into npm in the commandline to publish. Run `npm login` and try again.');
return false;
}
// Check to see if Git personal token setup
if (_.isUndefined(constants.githubPersonalAccessToken)) {
utils.log(
'You must have a Github personal access token set to an envVar named `GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS`. Add it then try again.',
);
return false;
}
// Check Yarn version is 1.X
const result = await execAsync(`yarn --version`);
const version = result.stdout;
const versionSegments = version.split('.');
const majorVersion = _.parseInt(versionSegments[0]);
if (majorVersion < 1) {
utils.log('Your yarn version must be v1.x or higher. Upgrade yarn and try again.');
return false;
}
// Check that `aws` commandline tool is installed
try {
await execAsync(`aws help`);
} catch (err) {
utils.log('You must have `awscli` commandline tool installed. Install it and try again.');
return false;
}
// Check that `aws` credentials are setup
try {
await execAsync(`aws sts get-caller-identity`);
} catch (err) {
utils.log('You must setup your AWS credentials by running `aws configure`. Do this and try again.');
return false;
}
return true;
}
async function pushChangelogsToGithubAsync(): Promise<void> {
await execAsync(`git add . --all`, { cwd: constants.monorepoRootPath });
await execAsync(`git commit -m "Updated CHANGELOGS"`, { cwd: constants.monorepoRootPath });
@@ -173,55 +118,50 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
const packageToVersionChange: PackageToVersionChange = {};
for (const lernaPackage of updatedPublicLernaPackages) {
const packageName = lernaPackage.package.name;
const changelogJSONPath = path.join(lernaPackage.location, 'CHANGELOG.json');
const changelogJSON = utils.getChangelogJSONOrCreateIfMissing(changelogJSONPath);
let changelogs: Changelog[];
try {
changelogs = JSON.parse(changelogJSON);
} catch (err) {
throw new Error(
`${lernaPackage.package.name}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`,
);
}
let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location);
const currentVersion = lernaPackage.package.version;
const shouldAddNewEntry = shouldAddNewChangelogEntry(currentVersion, changelogs);
const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry(
lernaPackage.package.name,
currentVersion,
changelog,
);
if (shouldAddNewEntry) {
// Create a new entry for a patch version with generic changelog entry.
const nextPatchVersion = utils.getNextPatchVersion(currentVersion);
const newChangelogEntry: Changelog = {
const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');
if (_.isNull(nextPatchVersionIfValid)) {
throw new Error(`Encountered invalid semver version: ${currentVersion} for package: ${packageName}`);
}
const newChangelogEntry: VersionChangelog = {
timestamp: TODAYS_TIMESTAMP,
version: nextPatchVersion,
version: nextPatchVersionIfValid,
changes: [
{
note: 'Dependencies updated',
},
],
};
changelogs = [newChangelogEntry, ...changelogs];
packageToVersionChange[packageName] = semverDiff(currentVersion, nextPatchVersion);
changelog = [newChangelogEntry, ...changelog];
packageToVersionChange[packageName] = semverDiff(currentVersion, nextPatchVersionIfValid);
} else {
// Update existing entry with timestamp
const lastEntry = changelogs[0];
const lastEntry = changelog[0];
if (_.isUndefined(lastEntry.timestamp)) {
lastEntry.timestamp = TODAYS_TIMESTAMP;
}
// Check version number is correct.
const proposedNextVersion = lastEntry.version;
lastEntry.version = updateVersionNumberIfNeeded(currentVersion, proposedNextVersion);
changelogs[0] = lastEntry;
changelog[0] = lastEntry;
packageToVersionChange[packageName] = semverDiff(currentVersion, lastEntry.version);
}
// Save updated CHANGELOG.json
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelogs, null, '\t'));
await utils.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog);
utils.log(`${packageName}: Updated CHANGELOG.json`);
// Generate updated CHANGELOG.md
const changelogMd = generateChangelogMd(changelogs);
const changelogMdPath = path.join(lernaPackage.location, 'CHANGELOG.md');
fs.writeFileSync(changelogMdPath, changelogMd);
await utils.prettifyAsync(changelogMdPath, constants.monorepoRootPath);
const changelogMd = changelogUtils.generateChangelogMd(changelog);
await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelogMd);
utils.log(`${packageName}: Updated CHANGELOG.md`);
}
@@ -231,7 +171,8 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }): Promise<void> {
// HACK: Lerna publish does not provide a way to specify multiple package versions via
// flags so instead we need to interact with their interactive prompt interface.
const child = spawn('lerna', ['publish', '--registry=https://registry.npmjs.org/'], {
const PACKAGE_REGISTRY = 'https://registry.npmjs.org/';
const child = spawn('lerna', ['publish', `--registry=${PACKAGE_REGISTRY}`], {
cwd: constants.monorepoRootPath,
});
let shouldPrintOutput = false;
@@ -270,55 +211,16 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin
}
function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string {
const updatedVersionIfValid = semver.inc(currentVersion, 'patch');
if (_.isNull(updatedVersionIfValid)) {
throw new Error(`Encountered invalid semver: ${currentVersion}`);
}
if (proposedNextVersion === currentVersion) {
return utils.getNextPatchVersion(currentVersion);
return updatedVersionIfValid;
}
const sortedVersions = semverSort.desc([proposedNextVersion, currentVersion]);
if (sortedVersions[0] !== proposedNextVersion) {
return utils.getNextPatchVersion(currentVersion);
return updatedVersionIfValid;
}
return proposedNextVersion;
}
function shouldAddNewChangelogEntry(currentVersion: string, changelogs: Changelog[]): boolean {
if (_.isEmpty(changelogs)) {
return true;
}
const lastEntry = changelogs[0];
const isLastEntryCurrentVersion = lastEntry.version === currentVersion;
return isLastEntryCurrentVersion;
}
function generateChangelogMd(changelogs: Changelog[]): string {
let changelogMd = `<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
`;
_.each(changelogs, changelog => {
if (_.isUndefined(changelog.timestamp)) {
throw new Error(
'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version',
);
}
const date = moment(`${changelog.timestamp}`, 'X').format('MMMM D, YYYY');
const title = `\n## v${changelog.version} - _${date}_\n\n`;
changelogMd += title;
let changes = '';
_.each(changelog.changes, change => {
let line = ` * ${change.note}`;
if (!_.isUndefined(change.pr)) {
line += ` (#${change.pr})`;
}
line += '\n';
changes += line;
});
changelogMd += `${changes}`;
});
return changelogMd;
}

View File

@@ -1,58 +0,0 @@
#!/usr/bin/env node
import lernaGetPackages = require('lerna-get-packages');
import * as _ from 'lodash';
import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
import semverSort = require('semver-sort');
import { constants } from './constants';
import { Changelog } from './types';
import { utils } from './utils';
(async () => {
const shouldIncludePrivate = true;
const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
for (const lernaPackage of updatedPublicLernaPackages) {
const packageName = lernaPackage.package.name;
const currentVersion = lernaPackage.package.version;
const changelogJSONPath = path.join(lernaPackage.location, 'CHANGELOG.json');
// Private packages don't have changelogs, and their versions are always incremented
// by a patch version.
const changelogJSONIfExists = utils.getChangelogJSONIfExists(changelogJSONPath);
let latestChangelogVersion: string;
if (!_.isUndefined(changelogJSONIfExists)) {
let changelogs: Changelog[];
try {
changelogs = JSON.parse(changelogJSONIfExists);
} catch (err) {
throw new Error(
`${lernaPackage.package.name}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`,
);
}
latestChangelogVersion = changelogs[0].version;
} else {
latestChangelogVersion = utils.getNextPatchVersion(currentVersion);
}
const sortedVersions = semverSort.desc([latestChangelogVersion, currentVersion]);
if (sortedVersions[0] === latestChangelogVersion && latestChangelogVersion !== currentVersion) {
const tagName = `${packageName}@${latestChangelogVersion}`;
try {
await execAsync(`git tag -d ${tagName}`, { cwd: constants.monorepoRootPath });
utils.log(`removed tag: ${tagName}`);
} catch (err) {
if (_.includes(err.message, 'not found')) {
utils.log(`Could not find tag: ${tagName}`);
} else {
throw err;
}
}
}
}
})().catch(err => {
utils.log(err);
process.exit(1);
});

View File

@@ -7,7 +7,7 @@ import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
import * as rimraf from 'rimraf';
import { utils } from './utils';
import { utils } from './utils/utils';
(async () => {
const monorepoRootPath = path.join(__dirname, '../../..');

View File

@@ -4,15 +4,17 @@ export interface UpdatedPackage {
private: boolean;
}
export interface Changes {
export interface Change {
note: string;
pr?: number;
}
export interface Changelog {
export type Changelog = VersionChangelog[];
export interface VersionChangelog {
timestamp?: number;
version: string;
changes: Changes[];
changes: Change[];
}
export enum SemVerIndex {
@@ -25,3 +27,16 @@ export enum SemVerIndex {
export interface PackageToVersionChange {
[name: string]: string;
}
export interface PackageRegistryJson {
versions: {
[version: string]: any;
};
time: {
[version: string]: string;
};
}
export interface GitTagsByPackageName {
[packageName: string]: string[];
}

View File

@@ -1,64 +0,0 @@
import * as fs from 'fs';
import lernaGetPackages = require('lerna-get-packages');
import * as _ from 'lodash';
import { exec as execAsync, spawn } from 'promisify-child-process';
import { constants } from './constants';
import { UpdatedPackage } from './types';
export const utils = {
log(...args: any[]): void {
console.log(...args); // tslint:disable-line:no-console
},
getNextPatchVersion(currentVersion: string): string {
const versionSegments = currentVersion.split('.');
const patch = _.parseInt(_.last(versionSegments) as string);
const newPatch = patch + 1;
const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`;
return newPatchVersion;
},
async prettifyAsync(filePath: string, cwd: string): Promise<void> {
await execAsync(`prettier --write ${filePath} --config .prettierrc`, {
cwd,
});
},
async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> {
const updatedPublicPackages = await this.getLernaUpdatedPackagesAsync(shouldIncludePrivate);
const updatedPackageNames = _.map(updatedPublicPackages, pkg => pkg.name);
const allLernaPackages = lernaGetPackages(constants.monorepoRootPath);
const updatedPublicLernaPackages = _.filter(allLernaPackages, pkg => {
return _.includes(updatedPackageNames, pkg.package.name);
});
return updatedPublicLernaPackages;
},
async getLernaUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<UpdatedPackage[]> {
const result = await execAsync(`${constants.lernaExecutable} updated --json`, {
cwd: constants.monorepoRootPath,
});
const updatedPackages = JSON.parse(result.stdout);
if (!shouldIncludePrivate) {
const updatedPublicPackages = _.filter(updatedPackages, updatedPackage => !updatedPackage.private);
return updatedPublicPackages;
}
return updatedPackages;
},
getChangelogJSONIfExists(changelogPath: string): string | undefined {
try {
const changelogJSON = fs.readFileSync(changelogPath, 'utf-8');
return changelogJSON;
} catch (err) {
return undefined;
}
},
getChangelogJSONOrCreateIfMissing(changelogPath: string): string {
const changelogIfExists = this.getChangelogJSONIfExists(changelogPath);
if (_.isUndefined(changelogIfExists)) {
// If none exists, create new, empty one.
const emptyChangelogJSON = JSON.stringify([]);
fs.writeFileSync(changelogPath, emptyChangelogJSON);
return emptyChangelogJSON;
}
return changelogIfExists;
},
};

View File

@@ -0,0 +1,108 @@
import * as fs from 'fs';
import * as _ from 'lodash';
import * as moment from 'moment';
import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
import semver = require('semver');
import { constants } from '../constants';
import { Change, Changelog, VersionChangelog } from '../types';
const CHANGELOG_MD_HEADER = `
<!--
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
`;
export const changelogUtils = {
getChangelogMdTitle(versionChangelog: VersionChangelog): string {
if (_.isUndefined(versionChangelog.timestamp)) {
throw new Error(
`All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version. Got: ${JSON.stringify(
versionChangelog,
)}`,
);
}
const date = moment(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
const title = `\n## v${versionChangelog.version} - _${date}_\n\n`;
return title;
},
getChangelogMdChange(change: Change): string {
let line = ` * ${change.note}`;
if (!_.isUndefined(change.pr)) {
line += ` (#${change.pr})`;
}
return line;
},
generateChangelogMd(changelog: Changelog): string {
let changelogMd = CHANGELOG_MD_HEADER;
_.each(changelog, versionChangelog => {
const title = changelogUtils.getChangelogMdTitle(versionChangelog);
changelogMd += title;
const changelogVersionLines = _.map(
versionChangelog.changes,
changelogUtils.getChangelogMdChange.bind(changelogUtils),
);
changelogMd += `${_.join(changelogVersionLines, '\n')}`;
});
return changelogMd;
},
shouldAddNewChangelogEntry(packageName: string, currentVersion: string, changelog: Changelog): boolean {
if (_.isEmpty(changelog)) {
return true;
}
const lastEntry = changelog[0];
if (semver.lt(lastEntry.version, currentVersion)) {
throw new Error(
`Found CHANGELOG version lower then current package version. ${packageName} current: ${currentVersion}, Changelog: ${
lastEntry.version
}`,
);
}
const isLastEntryCurrentVersion = lastEntry.version === currentVersion;
return isLastEntryCurrentVersion;
},
getChangelogJSONIfExists(changelogPath: string): string | undefined {
try {
const changelogJSON = fs.readFileSync(changelogPath, 'utf-8');
return changelogJSON;
} catch (err) {
return undefined;
}
},
getChangelogOrCreateIfMissing(packageName: string, packageLocation: string): Changelog {
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
let changelogJsonIfExists = this.getChangelogJSONIfExists(changelogJSONPath);
if (_.isUndefined(changelogJsonIfExists)) {
// If none exists, create new, empty one.
changelogJsonIfExists = '[]';
fs.writeFileSync(changelogJSONPath, changelogJsonIfExists);
}
let changelog: Changelog;
try {
changelog = JSON.parse(changelogJsonIfExists);
} catch (err) {
throw new Error(`${packageName}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`);
}
return changelog;
},
async writeChangelogJsonFileAsync(packageLocation: string, changelog: Changelog): Promise<void> {
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelog, null, '\t'));
await this.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
},
async writeChangelogMdFileAsync(packageLocation: string, changelogMdString: string): Promise<void> {
const changelogMarkdownPath = path.join(packageLocation, 'CHANGELOG.md');
fs.writeFileSync(changelogMarkdownPath, changelogMdString);
await this.prettifyAsync(changelogMarkdownPath, constants.monorepoRootPath);
},
async prettifyAsync(filePath: string, cwd: string): Promise<void> {
await execAsync(`prettier --write ${filePath} --config .prettierrc`, {
cwd,
});
},
};

View File

@@ -0,0 +1,28 @@
import 'isomorphic-fetch';
import * as _ from 'lodash';
import { PackageRegistryJson } from '../types';
const NPM_REGISTRY_BASE_URL = 'https://registry.npmjs.org';
const SUCCESS_STATUS = 200;
const NOT_FOUND_STATUS = 404;
export const npmUtils = {
async getPackageRegistryJsonIfExistsAsync(packageName: string): Promise<PackageRegistryJson | undefined> {
const url = `${NPM_REGISTRY_BASE_URL}/${packageName}`;
const response = await fetch(url);
if (response.status === NOT_FOUND_STATUS) {
return undefined;
} else if (response.status !== SUCCESS_STATUS) {
throw new Error(`Request to ${url} failed. Check your internet connection and that npmjs.org is up.`);
}
const packageRegistryJson = await response.json();
return packageRegistryJson;
},
getPreviouslyPublishedVersions(packageRegistryJson: PackageRegistryJson): string[] {
const timeWithOnlyVersions = _.omit(packageRegistryJson.time, ['modified', 'created']);
const versions = _.keys(timeWithOnlyVersions);
return versions;
},
};

View File

@@ -0,0 +1,125 @@
import lernaGetPackages = require('lerna-get-packages');
import * as _ from 'lodash';
import { exec as execAsync } from 'promisify-child-process';
import semver = require('semver');
import { constants } from '../constants';
import { GitTagsByPackageName, UpdatedPackage } from '../types';
import { changelogUtils } from './changelog_utils';
export const utils = {
log(...args: any[]): void {
console.log(...args); // tslint:disable-line:no-console
},
async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> {
const updatedPublicPackages = await this.getLernaUpdatedPackagesAsync(shouldIncludePrivate);
const updatedPackageNames = _.map(updatedPublicPackages, pkg => pkg.name);
const allLernaPackages = lernaGetPackages(constants.monorepoRootPath);
const updatedPublicLernaPackages = _.filter(allLernaPackages, pkg => {
return _.includes(updatedPackageNames, pkg.package.name);
});
return updatedPublicLernaPackages;
},
async getLernaUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<UpdatedPackage[]> {
const result = await execAsync(`${constants.lernaExecutable} updated --json`, {
cwd: constants.monorepoRootPath,
});
const updatedPackages = JSON.parse(result.stdout);
if (!shouldIncludePrivate) {
const updatedPublicPackages = _.filter(updatedPackages, updatedPackage => !updatedPackage.private);
return updatedPublicPackages;
}
return updatedPackages;
},
async getNextPackageVersionAsync(
currentVersion: string,
packageName: string,
packageLocation: string,
): Promise<string> {
let nextVersionIfValid;
const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, packageLocation);
if (_.isEmpty(changelog)) {
nextVersionIfValid = semver.inc(currentVersion, 'patch');
}
const lastEntry = changelog[0];
if (semver.gt(currentVersion, lastEntry.version)) {
throw new Error(`Package.json version cannot be greater then last CHANGELOG entry. Check: ${packageName}`);
}
nextVersionIfValid = semver.eq(lastEntry.version, currentVersion)
? semver.inc(currentVersion, 'patch')
: lastEntry.version;
if (_.isNull(nextVersionIfValid)) {
throw new Error(`Encountered invalid semver: ${currentVersion} associated with ${packageName}`);
}
return nextVersionIfValid;
},
async getRemoteGitTagsAsync(): Promise<string[]> {
const result = await execAsync(`git ls-remote --tags`, {
cwd: constants.monorepoRootPath,
});
const tagsString = result.stdout;
const tagOutputs: string[] = tagsString.split('\n');
const tags = _.compact(
_.map(tagOutputs, tagOutput => {
const tag = tagOutput.split('refs/tags/')[1];
// Tags with `^{}` are duplicateous so we ignore them
// Source: https://stackoverflow.com/questions/15472107/when-listing-git-ls-remote-why-theres-after-the-tag-name
if (_.endsWith(tag, '^{}')) {
return undefined;
}
return tag;
}),
);
return tags;
},
async getLocalGitTagsAsync(): Promise<string[]> {
const result = await execAsync(`git tags`, {
cwd: constants.monorepoRootPath,
});
const tagsString = result.stdout;
const tags = tagsString.split('\n');
return tags;
},
async getGitTagsByPackageNameAsync(packageNames: string[], gitTags: string[]): Promise<GitTagsByPackageName> {
const tagVersionByPackageName: GitTagsByPackageName = {};
_.each(gitTags, tag => {
const packageNameIfExists = _.find(packageNames, name => {
return _.includes(tag, `${name}@`);
});
if (_.isUndefined(packageNameIfExists)) {
return; // ignore tags not related to a package we care about.
}
const splitTag = tag.split(`${packageNameIfExists}@`);
if (splitTag.length !== 2) {
throw new Error(`Unexpected tag name found: ${tag}`);
}
const version = splitTag[1];
(tagVersionByPackageName[packageNameIfExists] || (tagVersionByPackageName[packageNameIfExists] = [])).push(
version,
);
});
return tagVersionByPackageName;
},
async removeLocalTagAsync(tagName: string): Promise<void> {
try {
await execAsync(`git tag -d ${tagName}`, {
cwd: constants.monorepoRootPath,
});
} catch (err) {
throw new Error(`Failed to delete local git tag. Got err: ${err}`);
}
this.log(`Removed local tag: ${tagName}`);
},
async removeRemoteTagAsync(tagName: string): Promise<void> {
try {
await execAsync(`git push origin ${tagName}`, {
cwd: constants.monorepoRootPath,
});
} catch (err) {
throw new Error(`Failed to delete remote git tag. Got err: ${err}`);
}
this.log(`Removed remote tag: ${tagName}`);
},
};

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.0.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.5",
"changes": [

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.9 - _July 18, 2018_
* Dependencies updated
## v0.0.8 - _July 9, 2018_
* Dependencies updated
## v0.0.7 - _June 19, 2018_
* Dependencies updated
## v0.0.6 - _May 29, 2018_
* Dependencies updated
## v0.0.5 - _May 22, 2018_
* Add orderStateUtils, a module for computing order state needed to decide if an order is still valid
## v0.0.4 - _May 4, 2018_
## v0.0.4 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/order-utils",
"version": "0.0.5",
"version": "0.0.9",
"engines": {
"node": ">=6.12"
},
@@ -43,36 +43,36 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
"devDependencies": {
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"shx": "0.2.2",
"sinon": "4.4.9",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/assert": "^0.2.10",
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"@types/node": "^8.0.53",
"bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.4"
"@0xproject/assert": "^0.2.14",
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"@types/node": "9.6.0",
"bn.js": "4.11.7",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "5.1.5",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -99,7 +99,7 @@ function parseSignatureHexAsVRS(signatureHex: string): ECSignature {
// HACK: Sometimes v is returned as [0, 1] and sometimes as [27, 28]
// If it is returned as [0, 1], add 27 to both so it becomes [27, 28]
const lowestValidV = 27;
const isProperlyFormattedV = v < lowestValidV;
const isProperlyFormattedV = v >= lowestValidV;
if (!isProperlyFormattedV) {
v += lowestValidV;
}

View File

@@ -1,4 +1,63 @@
[
{
"timestamp": 1531919263,
"version": "0.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.7",
"changes": [
{
"note": "Switch out simple getLogs polling with ethereumjs-blockstream",
"pr": 825
},
{
"note": "Do not stop subscription if error is encountered",
"pr": 825
}
],
"timestamp": 1531149657
},
{
"timestamp": 1529397769,
"version": "0.0.6",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527617805,
"version": "0.0.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527617227,
"version": "0.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527616612,
"version": "0.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1527008794,
"version": "0.0.2",

View File

@@ -5,6 +5,31 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.8 - _July 18, 2018_
* Dependencies updated
## v0.0.7 - _July 9, 2018_
* Switch out simple getLogs polling with ethereumjs-blockstream (#825)
* Do not stop subscription if error is encountered (#825)
## v0.0.6 - _June 19, 2018_
* Dependencies updated
## v0.0.5 - _May 29, 2018_
* Dependencies updated
## v0.0.4 - _May 29, 2018_
* Dependencies updated
## v0.0.3 - _May 29, 2018_
* Dependencies updated
## v0.0.2 - _May 22, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/order-watcher",
"version": "0.0.2",
"version": "0.0.8",
"description": "An order watcher daemon that watches for order validity",
"keywords": [
"0x",
@@ -28,13 +28,7 @@
},
"config": {
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels",
"postpublish": {
"assets": [
"packages/order-watcher/_bundles/index.js",
"packages/order-watcher/_bundles/index.min.js"
]
}
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels"
},
"repository": {
"type": "git",
@@ -45,50 +39,52 @@
"node": ">=6.0.0"
},
"devDependencies": {
"@0xproject/abi-gen": "^0.3.0",
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/migrations": "^0.0.6",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/tslint-config": "^0.4.18",
"@types/bintrees": "^1.0.2",
"@0xproject/abi-gen": "^0.3.4",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/migrations": "^0.0.10",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/sol-compiler": "^0.5.4",
"@0xproject/tslint-config": "^0.4.21",
"@types/bintrees": "1.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/sinon": "^2.2.2",
"awesome-typescript-loader": "^3.1.3",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"opn-cli": "^3.1.0",
"prettier": "^1.11.1",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"@types/mocha": "2.2.48",
"@types/node": "9.6.0",
"@types/sinon": "2.3.7",
"awesome-typescript-loader": "3.5.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"chai-bignumber": "2.0.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"json-loader": "0.5.7",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"opn-cli": "3.1.0",
"prettier": "1.12.1",
"shx": "0.2.2",
"sinon": "4.4.9",
"source-map-support": "0.5.4",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/assert": "^0.2.10",
"@0xproject/base-contract": "^0.3.2",
"@0xproject/contract-wrappers": "^0.0.2",
"@0xproject/fill-scenarios": "^0.0.2",
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/order-utils": "^0.0.5",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"bintrees": "^1.0.2",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
"@0xproject/assert": "^0.2.14",
"@0xproject/base-contract": "^0.3.6",
"@0xproject/contract-wrappers": "^0.1.1",
"@0xproject/fill-scenarios": "^0.0.6",
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/order-utils": "^0.0.9",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"bintrees": "1.0.2",
"ethereum-types": "^0.0.2",
"ethereumjs-blockstream": "5.0.0",
"ethers": "3.0.22",
"lodash": "4.17.10"
},
"publishConfig": {
"access": "public"

View File

@@ -1,6 +1,7 @@
import { BlockParamLiteral, LogEntry } from '@0xproject/types';
import { intervalUtils } from '@0xproject/utils';
import { intervalUtils, logUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream';
import * as _ from 'lodash';
import { EventWatcherCallback, OrderWatcherError } from '../types';
@@ -19,81 +20,111 @@ enum LogEventState {
*/
export class EventWatcher {
private _web3Wrapper: Web3Wrapper;
private _blockAndLogStreamerIfExists: BlockAndLogStreamer<Block, Log> | undefined;
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
private _onLogAddedSubscriptionToken: string | undefined;
private _onLogRemovedSubscriptionToken: string | undefined;
private _pollingIntervalMs: number;
private _intervalIdIfExists?: NodeJS.Timer;
private _lastEvents: LogEntry[] = [];
private _stateLayer: BlockParamLiteral;
private _isVerbose: boolean;
constructor(
web3Wrapper: Web3Wrapper,
pollingIntervalIfExistsMs: undefined | number,
stateLayer: BlockParamLiteral = BlockParamLiteral.Latest,
isVerbose: boolean,
) {
this._isVerbose = isVerbose;
this._web3Wrapper = web3Wrapper;
this._stateLayer = stateLayer;
this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs)
? DEFAULT_EVENT_POLLING_INTERVAL_MS
: pollingIntervalIfExistsMs;
this._blockAndLogStreamerIfExists = undefined;
this._blockAndLogStreamIntervalIfExists = undefined;
this._onLogAddedSubscriptionToken = undefined;
this._onLogRemovedSubscriptionToken = undefined;
}
public subscribe(callback: EventWatcherCallback): void {
assert.isFunction('callback', callback);
if (!_.isUndefined(this._intervalIdIfExists)) {
if (!_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
throw new Error(OrderWatcherError.SubscriptionAlreadyPresent);
}
this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
this._pollForBlockchainEventsAsync.bind(this, callback),
this._pollingIntervalMs,
(err: Error) => {
this.unsubscribe();
callback(err);
},
);
this._startBlockAndLogStream(callback);
}
public unsubscribe(): void {
this._lastEvents = [];
if (!_.isUndefined(this._intervalIdIfExists)) {
intervalUtils.clearAsyncExcludingInterval(this._intervalIdIfExists);
delete this._intervalIdIfExists;
if (_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
throw new Error(OrderWatcherError.SubscriptionNotFound);
}
this._stopBlockAndLogStream();
}
private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise<void> {
const pendingEvents = await this._getEventsAsync();
if (_.isUndefined(pendingEvents)) {
// HACK: This should never happen, but happens frequently on CI due to a ganache bug
return;
private _startBlockAndLogStream(callback: EventWatcherCallback): void {
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
throw new Error(OrderWatcherError.SubscriptionAlreadyPresent);
}
if (pendingEvents.length === 0) {
// HACK: Sometimes when node rebuilds the pending block we get back the empty result.
// We don't want to emit a lot of removal events and bring them back after a couple of miliseconds,
// that's why we just ignore those cases.
return;
}
const removedEvents = _.differenceBy(this._lastEvents, pendingEvents, JSON.stringify);
const newEvents = _.differenceBy(pendingEvents, this._lastEvents, JSON.stringify);
await this._emitDifferencesAsync(removedEvents, LogEventState.Removed, callback);
await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback);
this._lastEvents = pendingEvents;
this._blockAndLogStreamerIfExists = new BlockAndLogStreamer(
this._web3Wrapper.getBlockAsync.bind(this._web3Wrapper),
this._web3Wrapper.getLogsAsync.bind(this._web3Wrapper),
this._onBlockAndLogStreamerError.bind(this),
);
const catchAllLogFilter = {};
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
this._reconcileBlockAsync.bind(this),
this._pollingIntervalMs,
this._onBlockAndLogStreamerError.bind(this),
);
let isRemoved = false;
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
);
isRemoved = true;
this._onLogRemovedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogRemoved(
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
);
}
private async _getEventsAsync(): Promise<LogEntry[]> {
const eventFilter = {
fromBlock: this._stateLayer,
toBlock: this._stateLayer,
};
const events = await this._web3Wrapper.getLogsAsync(eventFilter);
return events;
private _stopBlockAndLogStream(): void {
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
throw new Error(OrderWatcherError.SubscriptionNotFound);
}
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer);
delete this._blockAndLogStreamerIfExists;
delete this._blockAndLogStreamIntervalIfExists;
}
private async _onLogStateChangedAsync(
callback: EventWatcherCallback,
isRemoved: boolean,
log: LogEntry,
): Promise<void> {
await this._emitDifferencesAsync(log, isRemoved ? LogEventState.Removed : LogEventState.Added, callback);
}
private async _reconcileBlockAsync(): Promise<void> {
const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest);
// We need to coerce to Block type cause Web3.Block includes types for mempool blocks
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
// If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined
await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
}
}
private async _emitDifferencesAsync(
logs: LogEntry[],
log: LogEntry,
logEventState: LogEventState,
callback: EventWatcherCallback,
): Promise<void> {
for (const log of logs) {
const logEvent = {
removed: logEventState === LogEventState.Removed,
...log,
};
if (!_.isUndefined(this._intervalIdIfExists)) {
callback(null, logEvent);
}
const logEvent = {
removed: logEventState === LogEventState.Removed,
...log,
};
if (!_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
callback(null, logEvent);
}
}
private _onBlockAndLogStreamerError(err: Error): void {
// Since Blockstream errors are all recoverable, we simply log them if the verbose
// config is passed in.
if (this._isVerbose) {
logUtils.warn(err);
}
}
}

View File

@@ -19,6 +19,8 @@ export class ExpirationWatcher {
private _expirationMarginMs: number;
private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer;
constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) {
this._orderExpirationCheckingIntervalMs =
orderExpirationCheckingIntervalIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
this._expirationMarginMs = expirationMarginIfExistsMs || DEFAULT_EXPIRATION_MARGIN_MS;
this._orderExpirationCheckingIntervalMs =
expirationMarginIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;

View File

@@ -14,7 +14,7 @@ import {
Provider,
SignedOrder,
} from '@0xproject/types';
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
import { errorUtils, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@@ -39,7 +39,6 @@ import {
} from '../generated_contract_wrappers/token';
import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
import { assert } from '../utils/assert';
import { utils } from '../utils/utils';
import { EventWatcher } from './event_watcher';
import { ExpirationWatcher } from './expiration_watcher';
@@ -62,6 +61,7 @@ interface OrderStateByOrderHash {
// tslint:disable-next-line:custom-no-magic-numbers
const DEFAULT_CLEANUP_JOB_INTERVAL_MS = 1000 * 60 * 60; // 1h
const STATE_LAYER = BlockParamLiteral.Latest;
/**
* This class includes all the functionality related to watching a set of orders
@@ -92,16 +92,15 @@ export class OrderWatcher {
});
this._contractWrappers = new ContractWrappers(provider, { networkId });
const pollingIntervalIfExistsMs = _.isUndefined(config) ? undefined : config.eventPollingIntervalMs;
const stateLayer =
_.isUndefined(config) || _.isUndefined(config.stateLayer) ? BlockParamLiteral.Latest : config.stateLayer;
this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer);
const isVerbose = !_.isUndefined(config) && !_.isUndefined(config.isVerbose) ? config.isVerbose : false;
this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, STATE_LAYER, isVerbose);
this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(
this._contractWrappers.token,
stateLayer,
STATE_LAYER,
);
this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(
this._contractWrappers.exchange,
stateLayer,
STATE_LAYER,
);
this._orderStateUtils = new OrderStateUtils(
this._balanceAndProxyAllowanceLazyStore,
@@ -237,7 +236,6 @@ export class OrderWatcher {
if (!_.isNull(err)) {
if (!_.isUndefined(this._callbackIfExists)) {
this._callbackIfExists(err);
this.unsubscribe();
}
return;
}
@@ -344,7 +342,7 @@ export class OrderWatcher {
return; // noop
default:
throw utils.spawnSwitchErr('decodedLog.event', decodedLog.event);
throw errorUtils.spawnSwitchErr('decodedLog.event', decodedLog.event);
}
}
private async _emitRevalidateOrdersAsync(orderHashes: string[]): Promise<void> {

View File

@@ -1,18 +1,4 @@
import { BigNumber } from '@0xproject/utils';
import {
BlockParam,
BlockParamLiteral,
ContractAbi,
ContractEventArg,
ExchangeContractErrs,
FilterObject,
LogEntryEvent,
LogWithDecodedArgs,
Order,
OrderState,
SignedOrder,
} from '@0xproject/types';
import { BlockParamLiteral, LogEntryEvent, OrderState } from '@0xproject/types';
export enum OrderWatcherError {
SubscriptionAlreadyPresent = 'SUBSCRIPTION_ALREADY_PRESENT',
@@ -34,7 +20,7 @@ export interface OrderWatcherConfig {
eventPollingIntervalMs?: number;
expirationMarginMs?: number;
cleanupJobIntervalMs?: number;
stateLayer: BlockParamLiteral;
isVerbose?: boolean;
}
export type OnOrderStateChangeCallback = (err: Error | null, orderState?: OrderState) => void;

View File

@@ -1,12 +1,10 @@
import { assert as sharedAssert } from '@0xproject/assert';
// We need those two unused imports because they're actually used by sharedAssert which gets injected here
// tslint:disable-next-line:no-unused-variable
// tslint:disable:no-unused-variable
import { Schema } from '@0xproject/json-schemas';
// tslint:disable-next-line:no-unused-variable
import { ECSignature } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
import { isValidSignature } from '@0xproject/order-utils';

View File

@@ -1,9 +1,6 @@
import { BigNumber } from '@0xproject/utils';
export const utils = {
spawnSwitchErr(name: string, value: any): Error {
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
},
getCurrentUnixTimestampSec(): BigNumber {
const milisecondsInASecond = 1000;
return new BigNumber(Date.now() / milisecondsInASecond).round();

View File

@@ -1,127 +0,0 @@
import { callbackErrorReporter, web3Factory } from '@0xproject/dev-utils';
import { DoneCallback, LogEntry, LogEntryEvent } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'make-promises-safe';
import 'mocha';
import * as Sinon from 'sinon';
import { EventWatcher } from '../src/order_watcher/event_watcher';
import { chaiSetup } from './utils/chai_setup';
import { provider } from './utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
describe('EventWatcher', () => {
let stubs: Sinon.SinonStub[] = [];
let eventWatcher: EventWatcher;
let web3Wrapper: Web3Wrapper;
const logA: LogEntry = {
address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: [],
transactionHash: '0x004881d38cd4a8f72f1a0d68c8b9b8124504706041ff37019c1d1ed6bfda8e17',
transactionIndex: 0,
};
const logB: LogEntry = {
address: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
transactionIndex: 0,
};
const logC: LogEntry = {
address: '0x1d271f8b174adef58f1587ce68f8f27271ac4ca5',
blockHash: null,
blockNumber: null,
data: '',
logIndex: null,
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
transactionIndex: 0,
};
before(async () => {
const pollingIntervalMs = 10;
web3Wrapper = new Web3Wrapper(provider);
eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalMs);
});
afterEach(() => {
// clean up any stubs after the test has completed
_.each(stubs, s => s.restore());
stubs = [];
eventWatcher.unsubscribe();
});
it('correctly emits initial log events', (done: DoneCallback) => {
const logs: LogEntry[] = [logA, logB];
const expectedLogEvents = [
{
removed: false,
...logA,
},
{
removed: false,
...logB,
},
];
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
getLogsStub.onCall(0).returns(logs);
stubs.push(getLogsStub);
const expectedToBeCalledOnce = false;
const callback = callbackErrorReporter.reportNodeCallbackErrors(done, expectedToBeCalledOnce)(
(event: LogEntryEvent) => {
const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) {
done();
}
},
);
eventWatcher.subscribe(callback);
});
it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
const initialLogs: LogEntry[] = [logA, logB];
const changedLogs: LogEntry[] = [logA, logC];
const expectedLogEvents = [
{
removed: false,
...logA,
},
{
removed: false,
...logB,
},
{
removed: true,
...logB,
},
{
removed: false,
...logC,
},
];
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
getLogsStub.onCall(0).returns(initialLogs);
getLogsStub.onCall(1).returns(changedLogs);
stubs.push(getLogsStub);
const expectedToBeCalledOnce = false;
const callback = callbackErrorReporter.reportNodeCallbackErrors(done, expectedToBeCalledOnce)(
(event: LogEntryEvent) => {
const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) {
done();
}
},
);
eventWatcher.subscribe(callback);
});
});

View File

@@ -1,16 +1,14 @@
import { ContractWrappers } from '@0xproject/contract-wrappers';
import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils';
import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
import { FillScenarios } from '@0xproject/fill-scenarios';
import { getOrderHashHex } from '@0xproject/order-utils';
import { DoneCallback, Token } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'make-promises-safe';
import 'mocha';
import * as Sinon from 'sinon';
import { artifacts } from '../src/artifacts';
import { ExpirationWatcher } from '../src/order_watcher/expiration_watcher';
import { utils } from '../src/utils/utils';
@@ -108,7 +106,7 @@ describe('ExpirationWatcher', () => {
);
const orderHash = getOrderHashHex(signedOrder);
expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND));
const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (hash: string) => {
const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (_hash: string) => {
done(new Error('Emitted expiration went before the order actually expired'));
});
expirationWatcher.subscribe(callbackAsync);

View File

@@ -1,5 +1,6 @@
// tslint:disable:no-unnecessary-type-assertion
import { ContractWrappers } from '@0xproject/contract-wrappers';
import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils';
import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
import { FillScenarios } from '@0xproject/fill-scenarios';
import { getOrderHashHex } from '@0xproject/order-utils';
import {
@@ -15,7 +16,6 @@ import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'make-promises-safe';
import 'mocha';
import { OrderWatcher } from '../src/order_watcher/order_watcher';
@@ -46,15 +46,15 @@ describe('OrderWatcher', () => {
let taker: string;
let signedOrder: SignedOrder;
let orderWatcher: OrderWatcher;
const config = {
networkId: constants.TESTRPC_NETWORK_ID,
};
const decimals = constants.ZRX_DECIMALS;
const fillableAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5), decimals);
before(async () => {
contractWrappers = new ContractWrappers(provider, config);
const networkId = await web3Wrapper.getNetworkIdAsync();
orderWatcher = new OrderWatcher(provider, constants.TESTRPC_NETWORK_ID);
const config = {
networkId,
};
contractWrappers = new ContractWrappers(provider, config);
orderWatcher = new OrderWatcher(provider, networkId);
exchangeContractAddress = contractWrappers.exchange.getContractAddress();
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
[, maker, taker] = userAddresses;
@@ -157,7 +157,7 @@ describe('OrderWatcher', () => {
fillableAmount,
);
orderWatcher.addOrder(signedOrder);
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => {
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((_orderState: OrderState) => {
throw new Error('OrderState callback fired for irrelevant order');
});
orderWatcher.subscribe(callback);

View File

@@ -1 +1 @@
Welcome to the [Web3Wrapper](https://github.com/0xProject/0x-monorepo/packages/web3-wrapper) documentation! Web3Wrapper is a convenience wrapper around Web3.js, adding support for promises and other niceties.
Welcome to the [Web3Wrapper](https://github.com/0xProject/0x-monorepo/tree/development/packages/web3-wrapper) documentation! Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternative to [Web3.js](https://github.com/ethereum/web3.js/) written in TypeScript.

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@0xproject/react-docs-example",
"version": "0.0.12",
"version": "0.0.15",
"engines": {
"node": ">=6.12"
},
@@ -26,36 +26,36 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/tslint-config": "^0.4.21",
"@types/lodash": "4.14.104",
"@types/material-ui": "0.18.0",
"@types/node": "^8.0.53",
"@types/node": "9.6.0",
"@types/react": "16.3.13",
"@types/react-dom": "^16.0.3",
"@types/react-dom": "16.0.4",
"@types/react-tap-event-plugin": "0.0.30",
"awesome-typescript-loader": "^3.1.3",
"copyfiles": "^1.2.0",
"css-loader": "^0.28.9",
"json-loader": "^0.5.4",
"less": "^2.7.2",
"less-loader": "^2.2.3",
"make-promises-safe": "^1.1.0",
"raw-loader": "^0.5.1",
"shx": "^0.2.2",
"source-map-loader": "^0.2.3",
"style-loader": "^0.20.2",
"tslint": "^5.9.1",
"awesome-typescript-loader": "3.5.0",
"copyfiles": "1.2.0",
"css-loader": "0.28.11",
"json-loader": "0.5.7",
"less": "2.7.3",
"less-loader": "2.2.3",
"make-promises-safe": "1.1.0",
"raw-loader": "0.5.1",
"shx": "0.2.2",
"source-map-loader": "0.2.3",
"style-loader": "0.20.3",
"tslint": "5.9.1",
"typescript": "2.7.1",
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.1"
"webpack": "3.11.0",
"webpack-dev-server": "2.11.2"
},
"dependencies": {
"@0xproject/react-docs": "^0.0.12",
"basscss": "^8.0.3",
"lodash": "^4.17.4",
"material-ui": "^0.17.1",
"@0xproject/react-docs": "^0.0.16",
"basscss": "8.0.4",
"lodash": "4.17.10",
"material-ui": "0.17.4",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-tap-event-plugin": "^2.0.1"
"react-tap-event-plugin": "2.0.1"
}
}

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.0.16",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.0.15",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.0.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.13",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527009133,
"version": "0.0.12",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.16 - _July 18, 2018_
* Dependencies updated
## v0.0.15 - _July 9, 2018_
* Dependencies updated
## v0.0.14 - _June 19, 2018_
* Dependencies updated
## v0.0.13 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.0.12 - _May 22, 2018_
* Dependencies updated
## v0.0.11 - _May 4, 2018_
## v0.0.11 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/react-docs",
"version": "0.0.12",
"version": "0.0.16",
"engines": {
"node": ">=6.12"
},
@@ -25,33 +25,33 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "^5.9.1",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"shx": "0.2.2",
"tslint": "5.9.1",
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/react-shared": "^0.1.7",
"@0xproject/utils": "^0.6.2",
"@0xproject/react-shared": "^0.2.3",
"@0xproject/utils": "^0.7.3",
"@types/lodash": "4.14.104",
"@types/material-ui": "0.18.0",
"@types/node": "^8.0.53",
"@types/node": "9.6.0",
"@types/react": "16.3.13",
"@types/react-dom": "^16.0.3",
"@types/react-dom": "16.0.4",
"@types/react-scroll": "0.0.31",
"basscss": "^8.0.3",
"compare-versions": "^3.0.1",
"lodash": "^4.17.4",
"material-ui": "^0.17.1",
"basscss": "8.0.4",
"compare-versions": "3.1.0",
"lodash": "4.17.10",
"material-ui": "0.17.4",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-markdown": "^3.2.2",
"react-scroll": "^1.5.2",
"react-tooltip": "^3.2.7"
"react-markdown": "3.2.2",
"react-scroll": "1.7.7",
"react-tooltip": "3.4.0"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.2.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.2.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.2.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.2.0",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527009133,
"version": "0.1.7",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.2.3 - _July 18, 2018_
* Dependencies updated
## v0.2.2 - _July 9, 2018_
* Dependencies updated
## v0.2.1 - _June 19, 2018_
* Dependencies updated
## v0.2.0 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.1.7 - _May 22, 2018_
* Dependencies updated
## v0.1.6 - _May 4, 2018_
## v0.1.6 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/react-shared",
"version": "0.1.7",
"version": "0.2.3",
"engines": {
"node": ">=6.12"
},
@@ -25,32 +25,32 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "^5.9.1",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"copyfiles": "1.2.0",
"make-promises-safe": "1.1.0",
"shx": "0.2.2",
"tslint": "5.9.1",
"typescript": "2.7.1"
},
"dependencies": {
"@types/lodash": "4.14.104",
"@types/material-ui": "0.18.0",
"@types/node": "^8.0.53",
"@types/node": "9.6.0",
"@types/react": "16.3.13",
"@types/react-dom": "^16.0.3",
"@types/react-dom": "16.0.4",
"@types/react-scroll": "0.0.31",
"basscss": "^8.0.3",
"is-mobile": "^0.2.2",
"lodash": "^4.17.4",
"material-ui": "^0.17.1",
"basscss": "8.0.4",
"is-mobile": "0.2.2",
"lodash": "4.17.10",
"material-ui": "0.17.4",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-highlight": "0xproject/react-highlight",
"react-markdown": "^3.2.2",
"react-scroll": "^1.5.2",
"react-tap-event-plugin": "^2.0.1"
"react-markdown": "3.2.2",
"react-scroll": "1.7.7",
"react-tap-event-plugin": "2.0.1"
},
"publishConfig": {
"access": "public"

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.5.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.5.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.5.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.5.1",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"version": "0.5.0",
"changes": [

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.5.4 - _July 18, 2018_
* Dependencies updated
## v0.5.3 - _July 9, 2018_
* Dependencies updated
## v0.5.2 - _June 19, 2018_
* Dependencies updated
## v0.5.1 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.5.0 - _May 22, 2018_
* Properly export the executable binary (#588)
## v0.4.3 - _May 4, 2018_
## v0.4.3 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/sol-compiler",
"version": "0.5.0",
"version": "0.5.4",
"engines": {
"node": ">=6.12"
},
@@ -49,47 +49,47 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
"devDependencies": {
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/mkdirp": "^0.5.2",
"@types/require-from-string": "^1.2.0",
"@types/semver": "^5.5.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"@0xproject/dev-utils": "^0.4.6",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/mkdirp": "0.5.2",
"@types/require-from-string": "1.2.0",
"@types/semver": "5.5.0",
"chai": "4.1.2",
"chai-as-promised": "7.1.1",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"types-bn": "^0.0.1",
"types-bn": "0.0.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.10.2",
"web3-typescript-typings": "0.10.2",
"zeppelin-solidity": "1.8.0"
},
"dependencies": {
"@0xproject/json-schemas": "^0.7.24",
"@0xproject/sol-resolver": "^0.0.5",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"@types/yargs": "^11.0.0",
"chalk": "^2.3.0",
"ethereumjs-util": "^5.1.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"require-from-string": "^2.0.1",
"semver": "^5.5.0",
"solc": "^0.4.23",
"web3": "^0.20.0",
"web3-eth-abi": "^1.0.0-beta.24",
"yargs": "^10.0.3"
"@0xproject/json-schemas": "^0.8.3",
"@0xproject/sol-resolver": "^0.0.8",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"@0xproject/web3-wrapper": "^0.7.3",
"@types/yargs": "10.0.2",
"chalk": "2.3.2",
"ethereumjs-util": "5.1.5",
"isomorphic-fetch": "2.2.1",
"lodash": "4.17.10",
"mkdirp": "0.5.1",
"require-from-string": "2.0.1",
"semver": "5.5.0",
"solc": "0.4.23",
"web3": "0.20.6",
"web3-eth-abi": "1.0.0-beta.33",
"yargs": "11.1.0"
},
"publishConfig": {
"access": "public"

View File

@@ -32,7 +32,9 @@ const SEPARATOR = ',';
.help().argv;
const contracts = _.isUndefined(argv.contracts)
? undefined
: argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR);
: argv.contracts === DEFAULT_CONTRACTS_LIST
? DEFAULT_CONTRACTS_LIST
: argv.contracts.split(SEPARATOR);
const opts: CompilerOptions = {
contractsDir: argv.contractsDir,
artifactsDir: argv.artifactsDir,

View File

@@ -1,4 +1,40 @@
[
{
"timestamp": 1531919263,
"version": "0.1.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1531149657,
"version": "0.1.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.1.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.1.0",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527009134,
"version": "0.0.11",

View File

@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.1.3 - _July 18, 2018_
* Dependencies updated
## v0.1.2 - _July 9, 2018_
* Dependencies updated
## v0.1.1 - _June 19, 2018_
* Dependencies updated
## v0.1.0 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.0.11 - _May 22, 2018_
* Dependencies updated
## v0.0.10 - _May 4, 2018_
## v0.0.10 - _May 5, 2018_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0xproject/sol-cov",
"version": "0.0.11",
"version": "0.1.3",
"engines": {
"node": ">=6.12"
},
@@ -46,34 +46,34 @@
},
"homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md",
"dependencies": {
"@0xproject/subproviders": "^0.10.2",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
"lodash": "^4.17.4",
"mkdirp": "^0.5.1",
"semaphore-async-await": "^1.5.1",
"solidity-parser-antlr": "^0.2.8"
"@0xproject/subproviders": "^0.10.6",
"@0xproject/types": "^0.8.2",
"@0xproject/typescript-typings": "^0.4.3",
"@0xproject/utils": "^0.7.3",
"ethereumjs-util": "5.1.5",
"glob": "7.1.1",
"istanbul": "0.4.5",
"lodash": "4.17.10",
"mkdirp": "0.5.1",
"semaphore-async-await": "1.5.1",
"solidity-parser-antlr": "0.2.8"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/istanbul": "^0.4.30",
"@types/mkdirp": "^0.5.1",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"chai": "^4.0.1",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
"shx": "^0.2.2",
"sinon": "^4.0.0",
"@0xproject/monorepo-scripts": "^0.2.2",
"@0xproject/tslint-config": "^0.4.21",
"@types/istanbul": "0.4.30",
"@types/mkdirp": "0.5.2",
"@types/mocha": "2.2.48",
"@types/node": "9.6.0",
"chai": "4.1.2",
"copyfiles": "1.2.0",
"dirty-chai": "2.0.1",
"make-promises-safe": "1.1.0",
"mocha": "4.1.0",
"npm-run-all": "4.1.2",
"nyc": "11.6.0",
"shx": "0.2.2",
"sinon": "4.4.9",
"tslint": "5.8.0",
"typedoc": "0xProject/typedoc",
"typescript": "2.7.1"

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1531149657,
"version": "0.0.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1529397769,
"version": "0.0.7",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "0.0.6",
"changes": [
{
"note": "Incorrect publish that was unpublished"
}
],
"timestamp": 1527810075
},
{
"timestamp": 1527009133,
"version": "0.0.5",

View File

@@ -5,11 +5,23 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.0.8 - _July 9, 2018_
* Dependencies updated
## v0.0.7 - _June 19, 2018_
* Dependencies updated
## v0.0.6 - _June 1, 2018_
* Incorrect publish that was unpublished
## v0.0.5 - _May 22, 2018_
* Dependencies updated
## v0.0.4 - _May 4, 2018_
## v0.0.4 - _May 5, 2018_
* Dependencies updated

Some files were not shown because too many files have changed in this diff Show More