diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-08-24 01:58:33 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-08-24 01:58:33 +0800 |
commit | 57c104119c409c053eb977553c92341c3ca83afd (patch) | |
tree | 7f1129fd01001604e7412e33ccef202c1ff90612 /packages/order-watcher | |
parent | cd5c73550b969fe0a87524143ce617749935427a (diff) | |
parent | 6e27324a341801e1a2d8d6989d749dfe021ae39b (diff) | |
download | dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.gz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.bz2 dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.lz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.xz dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.tar.zst dexon-sol-tools-57c104119c409c053eb977553c92341c3ca83afd.zip |
Merge branch 'development' into feature/forwarder-helper/init
* development: (187 commits)
Remove trailing slash
Fix linter
Stop nesting interfaces and add necessary type exports
Remove duplicate type and remove nested interface
Add support for rending the Tuple type
Add missing keyu
Remove excessive timestamp
Improve doc commebnt
Remove docs catch-all endpoint
Fix comments
Look for all TS mapped types
Add catch and exit with non-zero
Remove superfluous dep
Fix CHANGELOG entry
Fix double assignment
Upgrade Typedoc to 0.12.0, which works with TS 3.x
Fix prettier issues
Enable dry run of release publishing and handle git tags existing
update yarn.lock
Missing/superfluous type exports from connect
...
Diffstat (limited to 'packages/order-watcher')
-rw-r--r-- | packages/order-watcher/CHANGELOG.json | 14 | ||||
-rw-r--r-- | packages/order-watcher/package.json | 13 | ||||
-rw-r--r-- | packages/order-watcher/src/artifacts.ts | 2 | ||||
-rw-r--r-- | packages/order-watcher/src/index.ts | 12 | ||||
-rw-r--r-- | packages/order-watcher/src/monorepo_scripts/postpublish.ts | 8 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 6 | ||||
-rw-r--r-- | packages/order-watcher/src/utils/assert.ts | 4 |
7 files changed, 39 insertions, 20 deletions
diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 6a365f314..ee6d5540a 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,5 +1,19 @@ [ { + "version": "1.0.1-rc.4", + "changes": [ + { + "note": + "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "pr": 924 + }, + { + "note": "Remove exporting types: `BlockParamLiteral`, `BlockParam`, `Order`", + "pr": 924 + } + ] + }, + { "version": "1.0.1-rc.3", "changes": [ { diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 510b3f023..121f3f3f4 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -13,7 +13,7 @@ "types": "lib/src/index.d.ts", "scripts": { "watch_without_deps": "yarn pre_build && tsc -w", - "build": "yarn pre_build && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "build": "yarn pre_build && tsc", "pre_build": "run-s update_artifacts copy_artifacts generate_contract_wrappers", "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*", "generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers", @@ -24,12 +24,15 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", "update_artifacts": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;", - "clean": "shx rm -rf _bundles lib test_temp scripts test/artifacts src/generated_contract_wrappers", + "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers generated_docs", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", - "manual:postpublish": "yarn build; node ./scripts/postpublish.js" + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { - "contracts_v2_beta": "AssetProxyOwner ERC20Proxy ERC20Token ERC721Proxy ERC721Token Exchange Forwarder OrderValidator WETH9 ZRXToken" + "contracts_v2_beta": "AssetProxyOwner ERC20Proxy ERC20Token ERC721Proxy ERC721Token Exchange Forwarder OrderValidator WETH9 ZRXToken", + "postpublish": { + "assets": [] + } }, "repository": { "type": "git", @@ -43,8 +46,6 @@ "@0xproject/abi-gen": "^1.0.5", "@0xproject/dev-utils": "^1.0.4", "@0xproject/migrations": "^1.0.4", - "@0xproject/monorepo-scripts": "^1.0.5", - "@0xproject/sol-compiler": "^1.0.5", "@0xproject/tslint-config": "^1.0.5", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", diff --git a/packages/order-watcher/src/artifacts.ts b/packages/order-watcher/src/artifacts.ts index d47e619c2..520066a24 100644 --- a/packages/order-watcher/src/artifacts.ts +++ b/packages/order-watcher/src/artifacts.ts @@ -1,4 +1,4 @@ -import { ContractArtifact } from '@0xproject/sol-compiler'; +import { ContractArtifact } from 'ethereum-types'; import * as ERC20Token from './artifacts/ERC20Token.json'; import * as ERC721Token from './artifacts/ERC721Token.json'; diff --git a/packages/order-watcher/src/index.ts b/packages/order-watcher/src/index.ts index 5f84554c8..8efca6217 100644 --- a/packages/order-watcher/src/index.ts +++ b/packages/order-watcher/src/index.ts @@ -1,8 +1,14 @@ export { OrderWatcher } from './order_watcher/order_watcher'; -export { OrderStateValid, OrderStateInvalid, OrderState } from '@0xproject/types'; +export { + OrderStateValid, + OrderStateInvalid, + OrderState, + ExchangeContractErrs, + OrderRelevantState, +} from '@0xproject/types'; export { OnOrderStateChangeCallback, OrderWatcherConfig } from './types'; -export { Order, SignedOrder } from '@0xproject/types'; -export { BlockParamLiteral, BlockParam, Provider } from 'ethereum-types'; +export { SignedOrder } from '@0xproject/types'; +export { JSONRPCRequestPayload, JSONRPCErrorCallback, Provider, JSONRPCResponsePayload } from 'ethereum-types'; diff --git a/packages/order-watcher/src/monorepo_scripts/postpublish.ts b/packages/order-watcher/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/order-watcher/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index e2d6fc270..d4c5cca4b 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -87,6 +87,12 @@ export class OrderWatcher { private readonly _cleanupJobInterval: number; private _cleanupJobIntervalIdIfExists?: NodeJS.Timer; private _callbackIfExists?: OnOrderStateChangeCallback; + /** + * Instantiate a new OrderWatcher + * @param provider Web3 provider to use for JSON RPC calls + * @param networkId NetworkId to watch orders on + * @param partialConfig Optional configurations + */ constructor( provider: Provider, networkId: number, diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index a891a60d2..e4a1e2c7b 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -7,7 +7,7 @@ import { BigNumber } from '@0xproject/utils'; // tslint:enable:no-unused-variable import { Provider } from 'ethereum-types'; -import { isValidSignatureAsync } from '@0xproject/order-utils'; +import { signatureUtils } from '@0xproject/order-utils'; export const assert = { ...sharedAssert, @@ -17,7 +17,7 @@ export const assert = { signature: string, signerAddress: string, ): Promise<void> { - const isValid = await isValidSignatureAsync(provider, orderHash, signature, signerAddress); + const isValid = await signatureUtils.isValidSignatureAsync(provider, orderHash, signature, signerAddress); assert.assert(isValid, `Expected order with hash '${orderHash}' to have a valid signature`); }, }; |