aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher
diff options
context:
space:
mode:
Diffstat (limited to 'packages/order-watcher')
-rw-r--r--packages/order-watcher/CHANGELOG.json14
-rw-r--r--packages/order-watcher/package.json13
-rw-r--r--packages/order-watcher/src/artifacts.ts2
-rw-r--r--packages/order-watcher/src/index.ts12
-rw-r--r--packages/order-watcher/src/monorepo_scripts/postpublish.ts8
-rw-r--r--packages/order-watcher/src/order_watcher/order_watcher.ts6
-rw-r--r--packages/order-watcher/src/utils/assert.ts4
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`);
},
};