aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorAra Kevonian <=>2018-04-09 22:05:46 +0800
committerAra Kevonian <=>2018-04-09 22:05:46 +0800
commitc80b42712a9fc73c05c32cd3d3396a6a02a7969f (patch)
treeb5584fedccf988847ce1e50f85cd28023d4993ad /packages/0x.js
parent8d76d74a1713dcec140c8d43f9ea7612b5cc38f1 (diff)
downloaddexon-sol-tools-c80b42712a9fc73c05c32cd3d3396a6a02a7969f.tar.gz
dexon-sol-tools-c80b42712a9fc73c05c32cd3d3396a6a02a7969f.tar.zst
dexon-sol-tools-c80b42712a9fc73c05c32cd3d3396a6a02a7969f.zip
Lint/Prettify
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/CHANGELOG.md2
-rw-r--r--packages/0x.js/package.json25
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts39
-rw-r--r--packages/0x.js/test/exchange_wrapper_test.ts5
4 files changed, 33 insertions, 38 deletions
diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md
index 63c82ac94..76f82d93e 100644
--- a/packages/0x.js/CHANGELOG.md
+++ b/packages/0x.js/CHANGELOG.md
@@ -4,7 +4,9 @@ Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
+
## v0.36.0 - TBD
+
* Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder
## v0.35.0 - _April 2, 2018_
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 882b40733..e62f948b4 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -2,43 +2,38 @@
"name": "0x.js",
"version": "0.35.0",
"description": "A javascript library for interacting with the 0x protocol",
- "keywords": [
- "0x.js",
- "0xproject",
- "ethereum",
- "tokens",
- "exchange"
- ],
+ "keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean generate_contract_wrappers",
"build": "run-p build:umd:prod build:commonjs; exit 0;",
- "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
+ "generate_contract_wrappers":
+ "node ../abi-gen/lib/index.js --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test:circleci": "run-s test:coverage",
"test": "run-s clean test:commonjs",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
- "update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
+ "update_contracts":
+ "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
"clean": "shx rm -rf _bundles lib test_temp scripts",
"build:umd:prod": "NODE_ENV=production webpack",
- "build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
+ "build:commonjs":
+ "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"test:commonjs": "run-s build:commonjs run_mocha",
"run_mocha": "mocha lib/test/**/*_test.js --timeout 10000 --bail --exit",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
"docs:stage": "yarn build && node ./scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
- "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
+ "upload_docs_json":
+ "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
},
"config": {
"artifacts": "TokenTransferProxy Exchange TokenRegistry Token EtherToken",
"postpublish": {
- "assets": [
- "packages/0x.js/_bundles/index.js",
- "packages/0x.js/_bundles/index.min.js"
- ],
+ "assets": ["packages/0x.js/_bundles/index.js", "packages/0x.js/_bundles/index.min.js"],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts",
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index fb1877f4a..b6949e465 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -16,19 +16,19 @@ import { artifacts } from '../artifacts';
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
import {
-BlockRange,
-EventCallback,
-ExchangeContractErrCodes,
-ExchangeContractErrs,
-IndexedFilterValues,
-MethodOpts,
-OrderAddresses,
-OrderCancellationRequest,
-OrderFillRequest,
-OrderState,
-OrderTransactionOpts,
-OrderValues,
-ValidateOrderFillableOpts,
+ BlockRange,
+ EventCallback,
+ ExchangeContractErrCodes,
+ ExchangeContractErrs,
+ IndexedFilterValues,
+ MethodOpts,
+ OrderAddresses,
+ OrderCancellationRequest,
+ OrderFillRequest,
+ OrderState,
+ OrderTransactionOpts,
+ OrderValues,
+ ValidateOrderFillableOpts,
} from '../types';
import { assert } from '../utils/assert';
import { decorators } from '../utils/decorators';
@@ -39,10 +39,10 @@ import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import {
-ExchangeContract,
-ExchangeContractEventArgs,
-ExchangeEvents,
-LogErrorContractEventArgs,
+ ExchangeContract,
+ ExchangeContractEventArgs,
+ ExchangeEvents,
+ LogErrorContractEventArgs,
} from './generated/exchange';
import { TokenWrapper } from './token_wrapper';
const SHOULD_VALIDATE_BY_DEFAULT = true;
@@ -886,10 +886,7 @@ export class ExchangeWrapper extends ContractWrapper {
BlockParamLiteral.Latest,
);
const orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(this);
- const orderStateUtils = new OrderStateUtils(
- balanceAndProxyAllowanceLazyStore,
- orderFilledCancelledLazyStore,
- );
+ const orderStateUtils = new OrderStateUtils(balanceAndProxyAllowanceLazyStore, orderFilledCancelledLazyStore);
return orderStateUtils.getOrderStateAsync(signedOrder);
}
/**
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts
index b6eaa2591..dd55d06a2 100644
--- a/packages/0x.js/test/exchange_wrapper_test.ts
+++ b/packages/0x.js/test/exchange_wrapper_test.ts
@@ -14,7 +14,8 @@ import {
LogCancelContractEventArgs,
LogFillContractEventArgs,
OrderCancellationRequest,
- OrderFillRequest, OrderState, OrderStateInvalid,
+ OrderFillRequest,
+ OrderState,
SignedOrder,
Token,
ZeroEx,
@@ -1156,7 +1157,7 @@ describe('ExchangeWrapper', () => {
expect(args.maker).to.be.equal(differentMakerAddress);
});
});
- describe('#getOrderState', () => {
+ describe('#getOrderStateAsync', () => {
let maker: string;
let taker: string;
let makerToken: Token;