Compare commits

...

37 Commits

Author SHA1 Message Date
Brandon Millman
547bee38c0 Update CHANGELOG 2018-01-17 21:55:04 -08:00
Leonid
60614ba250 Merge pull request #321 from 0xProject/fix/fill-up-to-validation
Fix fillOrdersUpTo validation
2018-01-17 23:56:08 +01:00
Leonid Logvinov
278f68ae77 Fix the typos 2018-01-17 16:22:47 +01:00
Leonid
0e3bd0c6c1 Merge pull request #320 from joincivil/feature/default-account
Fix web3 typing defaultAccount not allowing `undefined`
2018-01-16 13:34:14 +01:00
Olaf Tomalka
86668eb7b9 Added PR number to web3 typings changelog 2018-01-16 13:24:53 +01:00
Leonid Logvinov
771f65c858 Update the CHANGELOG 2018-01-16 11:25:31 +01:00
Leonid Logvinov
89d6326a83 Fix fillOrdersUpTo balances validation 2018-01-16 11:22:04 +01:00
Leonid Logvinov
8b81ea162f Add a regression test for fillUpToValidation 2018-01-16 11:08:17 +01:00
Olaf Tomalka
a53e6db537 Fix web3 typing defaultAccount not allowing undefined
The default value for the defaultAccount property is undefined,
this happens in real-life scenarios, and so the type should
explicitly warn users about it
2018-01-15 16:02:42 +01:00
Leonid
62e3feeb94 Merge pull request #319 from 0xProject/feature/final-monorepo
Import last TS packages into the monorepo
2018-01-13 02:03:22 +01:00
Leonid
a950494503 Merge pull request #312 from 0xProject/feature/error-reporting-intervals
Better error handling on async/sync intervals
2018-01-13 00:51:23 +01:00
Leonid Logvinov
3cb310122e Sort packages alphabetically in README 2018-01-13 00:50:07 +01:00
Leonid Logvinov
feace988b4 Add postpublish scripts 2018-01-12 22:16:45 +01:00
Leonid Logvinov
6a56f20928 Return after checking for an error and add an explanatory comment 2018-01-12 21:39:51 +01:00
Brandon Millman
80a46d14be Merge pull request #318 from 0xProject/feature/httpClientErrorImprovements
Improve HttpClient errors
2018-01-12 12:18:03 -08:00
Brandon Millman
fbcbf066cd Stop appending /v0 to HttpClient api endpoint urls 2018-01-12 11:53:14 -08:00
Leonid Logvinov
4d30e1115f Add chai-as-promised-typescript-typings 2018-01-12 17:48:15 +01:00
Leonid Logvinov
897cfb491c Remove redundant type refs 2018-01-12 17:23:59 +01:00
Brandon Millman
c2c7512431 Improve HttpClient errors 2018-01-12 08:01:41 -08:00
Leonid Logvinov
568cf4d182 Add web3-typescript-typings and chai-as-promised-typescript-typings to the main monorepo 2018-01-12 16:55:16 +01:00
Leonid Logvinov
f54330f1c5 Import chai-as-promised-typescript-typings 2018-01-12 16:49:48 +01:00
Leonid Logvinov
97e01d7a42 Fix @bmilman linkedin link 2018-01-12 15:32:29 +01:00
Leonid
4be3e000e1 Merge pull request #317 from 0xProject/feature/new-team-members
[WIP] Add @tom and @dekz while removing @PhABC
2018-01-12 15:25:05 +01:00
Leonid Logvinov
b47baa9ee1 Add new team photos 2018-01-12 15:22:44 +01:00
Leonid Logvinov
f6c98112df Add a CHANGELOG to a website 2018-01-11 17:45:51 +01:00
Leonid Logvinov
94d29ab22e Add @tom and @dekz while removing @PhABC 2018-01-11 17:45:51 +01:00
Leonid Logvinov
b0b179550a Prettify package.json files 2018-01-11 17:45:36 +01:00
Leonid Logvinov
41c7ab4f9c Update dependencies in yarn.lock 2018-01-11 17:38:22 +01:00
Leonid Logvinov
432c7c63fe Fix a version in web3-typescript-typings CHANGELOG 2018-01-11 14:44:30 +01:00
Leonid Logvinov
2bba1ae292 Publish
- 0x.js@0.29.2
 - @0xproject/abi-gen@0.1.1
 - @0xproject/connect@0.4.1
 - contracts@2.1.3
 - @0xproject/kovan_faucets@1.0.4
 - web3-typescript-typings@0.9.3
 - @0xproject/web3-wrapper@0.1.4
 - @0xproject/website@0.0.6
2018-01-11 14:43:58 +01:00
Leonid Logvinov
7830d518e0 Add types for getData on a web3 contract 2018-01-11 14:40:16 +01:00
Leonid Logvinov
571b3c4da8 Add types for getData on a web3 contract 2018-01-11 14:25:49 +01:00
Leonid Logvinov
5b6f8d4c3f Apply prettier 2018-01-11 13:44:01 +01:00
Leonid Logvinov
ae57b21b98 Update the CHANGELOG 2018-01-11 13:22:37 +01:00
Leonid Logvinov
292c3bbff8 Make some callbacks failable and add error handling 2018-01-11 13:22:04 +01:00
Leonid Logvinov
065570ebf5 Add an error handler parameter to intervals 2018-01-11 13:22:04 +01:00
Leonid Logvinov
1f5dfd71d5 Add forgotten CHANGELOG changes 2018-01-11 13:16:58 +01:00
60 changed files with 2131 additions and 255 deletions

View File

@@ -18,18 +18,21 @@ This repository contains all the 0x developer tools written in TypeScript. Our h
### Published Packages ### Published Packages
| Package | Version | Description | | Package | Version | Description |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol | | [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs | | [`chai-as-promised-typescript-typings`](/packages/chai-as-promised-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-as-promised-typescript-typings.svg)](https://www.npmjs.com/package/chai-as-promised-typescript-typings) | Chai as promised typescript typings |
| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages | | [`chai-typescript-typings`](/packages/chai-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-typescript-typings.svg)](https://www.npmjs.com/package/chai-typescript-typings) | Chai typescript typings |
| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api | | [`web3-typescript-typings`](/packages/web3-typescript-typings) | [![npm](https://img.shields.io/npm/v/web3-typescript-typings.svg)](https://www.npmjs.com/package/web3-typescript-typings) | Web3 typescript typings |
| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas | | [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) | | [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules | | [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api |
| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations | | [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities | | [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | | [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | |
### Private Packages ### Private Packages

View File

@@ -1,5 +1,11 @@
# CHANGELOG # CHANGELOG
## v0.30.0 - _January 17, 2018_
* Add an error parameter to the order watcher callback (#312)
* Fix a bug making it impossible to catch some errors from awaitTransactionMinedAsync (#312)
* Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders (#321)
## v0.29.1 - _January 11, 2018_ ## v0.29.1 - _January 11, 2018_
* Fixed bignumber config issue #301 (#305) * Fixed bignumber config issue #301 (#305)

View File

@@ -1,29 +1,27 @@
{ {
"name": "0x.js", "name": "0x.js",
"version": "0.29.1", "version": "0.29.2",
"description": "A javascript library for interacting with the 0x protocol", "description": "A javascript library for interacting with the 0x protocol",
"keywords": [ "keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
"0x.js",
"0xproject",
"ethereum",
"tokens",
"exchange"
],
"main": "lib/src/index.js", "main": "lib/src/index.js",
"types": "lib/src/index.d.ts", "types": "lib/src/index.d.ts",
"scripts": { "scripts": {
"prebuild": "run-s clean generate_contract_wrappers", "prebuild": "run-s clean generate_contract_wrappers",
"build": "run-p build:umd:prod build:commonjs; exit 0;", "build": "run-p build:umd:prod build:commonjs; exit 0;",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
"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":
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated", "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",
"generate_contract_wrappers":
"node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test:circleci": "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test:circleci":
"run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi",
"test": "run-s clean test:commonjs", "test": "run-s clean test:commonjs",
"test:umd": "./scripts/test_umd.sh", "test:umd": "./scripts/test_umd.sh",
"test:coverage": "nyc npm run test --all", "test:coverage": "nyc npm run test --all",
"report_test_coverage": "nyc report --reporter=text-lcov | coveralls", "report_test_coverage": "nyc report --reporter=text-lcov | coveralls",
"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", "clean": "shx rm -rf _bundles lib test_temp",
"build:umd:dev": "webpack", "build:umd:dev": "webpack",
"build:umd:prod": "NODE_ENV=production webpack", "build:umd:prod": "NODE_ENV=production webpack",
@@ -45,7 +43,7 @@
"node": ">=6.0.0" "node": ">=6.0.0"
}, },
"devDependencies": { "devDependencies": {
"@0xproject/abi-gen": "^0.1.0", "@0xproject/abi-gen": "^0.1.1",
"@0xproject/dev-utils": "^0.0.4", "@0xproject/dev-utils": "^0.0.4",
"@0xproject/tslint-config": "^0.4.1", "@0xproject/tslint-config": "^0.4.1",
"@0xproject/types": "^0.1.3", "@0xproject/types": "^0.1.3",
@@ -80,14 +78,14 @@
"typedoc": "~0.8.0", "typedoc": "~0.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-provider-engine": "^13.0.1", "web3-provider-engine": "^13.0.1",
"web3-typescript-typings": "^0.9.1", "web3-typescript-typings": "^0.9.3",
"webpack": "^3.1.0" "webpack": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@0xproject/assert": "^0.0.10", "@0xproject/assert": "^0.0.10",
"@0xproject/json-schemas": "^0.7.2", "@0xproject/json-schemas": "^0.7.2",
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.1.3",
"@0xproject/web3-wrapper": "^0.1.3", "@0xproject/web3-wrapper": "^0.1.4",
"bintrees": "^1.0.2", "bintrees": "^1.0.2",
"bn.js": "^4.11.8", "bn.js": "^4.11.8",
"compare-versions": "^3.0.1", "compare-versions": "^3.0.1",

View File

@@ -8,26 +8,21 @@ const S3BucketPath = 's3://0xjs-docs-jsons/';
let tag; let tag;
let version; let version;
postpublish_utils.getLatestTagAndVersionAsync(subPackageName) postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) { .then(function(result) {
tag = result.tag; tag = result.tag;
version = result.version; version = result.version;
const releaseName = postpublish_utils.getReleaseName(subPackageName, version); const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
const assets = [ const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
__dirname + '/../_bundles/index.js', return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
__dirname + '/../_bundles/index.min.js',
];
return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
}) })
.then(function(release) { .then(function(release) {
console.log('POSTPUBLISH: Release successful, generating docs...'); console.log('POSTPUBLISH: Release successful, generating docs...');
const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json'; const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
return execAsync( return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
'JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', cwd,
{ });
cwd,
}
);
}) })
.then(function(result) { .then(function(result) {
if (result.stderr !== '') { if (result.stderr !== '') {
@@ -39,6 +34,7 @@ postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', { return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
cwd, cwd,
}); });
}).catch (function(err) { })
.catch(function(err) {
throw err; throw err;
}); });

View File

@@ -302,26 +302,33 @@ export class ZeroEx {
const txReceiptPromise = new Promise( const txReceiptPromise = new Promise(
(resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => { (resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => {
const intervalId = intervalUtils.setAsyncExcludingInterval(async () => { const intervalId = intervalUtils.setAsyncExcludingInterval(
if (timeoutExceeded) { async () => {
intervalUtils.clearAsyncExcludingInterval(intervalId); if (timeoutExceeded) {
return reject(ZeroExError.TransactionMiningTimeout); intervalUtils.clearAsyncExcludingInterval(intervalId);
} return reject(ZeroExError.TransactionMiningTimeout);
}
const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash); const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash);
if (!_.isNull(transactionReceipt)) { if (!_.isNull(transactionReceipt)) {
intervalUtils.clearAsyncExcludingInterval(intervalId);
const logsWithDecodedArgs = _.map(
transactionReceipt.logs,
this._abiDecoder.tryToDecodeLogOrNoop.bind(this._abiDecoder),
);
const transactionReceiptWithDecodedLogArgs: TransactionReceiptWithDecodedLogs = {
...transactionReceipt,
logs: logsWithDecodedArgs,
};
resolve(transactionReceiptWithDecodedLogArgs);
}
},
pollingIntervalMs,
(err: Error) => {
intervalUtils.clearAsyncExcludingInterval(intervalId); intervalUtils.clearAsyncExcludingInterval(intervalId);
const logsWithDecodedArgs = _.map( reject(err);
transactionReceipt.logs, },
this._abiDecoder.tryToDecodeLogOrNoop.bind(this._abiDecoder), );
);
const transactionReceiptWithDecodedLogArgs: TransactionReceiptWithDecodedLogs = {
...transactionReceipt,
logs: logsWithDecodedArgs,
};
resolve(transactionReceiptWithDecodedLogArgs);
}
}, pollingIntervalMs);
}, },
); );

View File

@@ -167,6 +167,7 @@ export class ContractWrapper {
this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval( this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval(
this._reconcileBlockAsync.bind(this), this._reconcileBlockAsync.bind(this),
constants.DEFAULT_BLOCK_POLLING_INTERVAL, constants.DEFAULT_BLOCK_POLLING_INTERVAL,
this._onReconcileBlockError.bind(this),
); );
let isRemoved = false; let isRemoved = false;
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded( this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
@@ -177,6 +178,12 @@ export class ContractWrapper {
this._onLogStateChanged.bind(this, isRemoved), 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 { private _setNetworkId(networkId: number): void {
this._networkId = networkId; this._networkId = networkId;
} }
@@ -190,18 +197,11 @@ export class ContractWrapper {
delete this._blockAndLogStreamerIfExists; delete this._blockAndLogStreamerIfExists;
} }
private async _reconcileBlockAsync(): Promise<void> { private async _reconcileBlockAsync(): Promise<void> {
try { const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest);
const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest); // We need to coerce to Block type cause Web3.Block includes types for mempool blocks
// We need to coerce to Block type cause Web3.Block includes types for mempool blocks if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) { // If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined
// If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
}
} catch (err) {
const filterTokens = _.keys(this._filterCallbacks);
_.each(filterTokens, filterToken => {
this._unsubscribe(filterToken, err);
});
} }
} }
} }

View File

@@ -258,16 +258,18 @@ export class ExchangeWrapper extends ContractWrapper {
? SHOULD_VALIDATE_BY_DEFAULT ? SHOULD_VALIDATE_BY_DEFAULT
: orderTransactionOpts.shouldValidate; : orderTransactionOpts.shouldValidate;
if (shouldValidate) { if (shouldValidate) {
let filledTakerTokenAmount = new BigNumber(0);
const zrxTokenAddress = this.getZRXTokenAddress(); const zrxTokenAddress = this.getZRXTokenAddress();
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
for (const signedOrder of signedOrders) { for (const signedOrder of signedOrders) {
await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync( const singleFilledTakerTokenAmount = await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeEmulator, exchangeTradeEmulator,
signedOrder, signedOrder,
fillTakerTokenAmount, fillTakerTokenAmount.minus(filledTakerTokenAmount),
takerAddress, takerAddress,
zrxTokenAddress, zrxTokenAddress,
); );
filledTakerTokenAmount = filledTakerTokenAmount.plus(singleFilledTakerTokenAmount);
} }
} }

View File

@@ -1,5 +1,3 @@
/// <reference types='chai-typescript-typings' />
/// <reference types='chai-as-promised-typescript-typings' />
declare module 'web3_beta'; declare module 'web3_beta';
declare module 'chai-bignumber'; declare module 'chai-bignumber';
declare module 'dirty-chai'; declare module 'dirty-chai';

View File

@@ -36,6 +36,10 @@ export class EventWatcher {
this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval( this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
this._pollForBlockchainEventsAsync.bind(this, callback), this._pollForBlockchainEventsAsync.bind(this, callback),
this._pollingIntervalMs, this._pollingIntervalMs,
(err: Error) => {
this.unsubscribe();
callback(err);
},
); );
} }
public unsubscribe(): void { public unsubscribe(): void {
@@ -78,7 +82,7 @@ export class EventWatcher {
...log, ...log,
}; };
if (!_.isUndefined(this._intervalIdIfExists)) { if (!_.isUndefined(this._intervalIdIfExists)) {
callback(logEvent); callback(null, logEvent);
} }
} }
} }

View File

@@ -30,16 +30,17 @@ export class ExpirationWatcher {
if (!_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) { if (!_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) {
throw new Error(ZeroExError.SubscriptionAlreadyPresent); throw new Error(ZeroExError.SubscriptionAlreadyPresent);
} }
this._orderExpirationCheckingIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval( this._orderExpirationCheckingIntervalIdIfExists = intervalUtils.setInterval(
this._pruneExpiredOrders.bind(this, callback), this._pruneExpiredOrders.bind(this, callback),
this._orderExpirationCheckingIntervalMs, this._orderExpirationCheckingIntervalMs,
_.noop, // _pruneExpiredOrders never throws
); );
} }
public unsubscribe(): void { public unsubscribe(): void {
if (_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) { if (_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) {
throw new Error(ZeroExError.SubscriptionNotFound); throw new Error(ZeroExError.SubscriptionNotFound);
} }
intervalUtils.clearAsyncExcludingInterval(this._orderExpirationCheckingIntervalIdIfExists); intervalUtils.clearInterval(this._orderExpirationCheckingIntervalIdIfExists);
delete this._orderExpirationCheckingIntervalIdIfExists; delete this._orderExpirationCheckingIntervalIdIfExists;
} }
public addOrder(orderHash: string, expirationUnixTimestampMs: BigNumber): void { public addOrder(orderHash: string, expirationUnixTimestampMs: BigNumber): void {

View File

@@ -155,6 +155,10 @@ export class OrderStateWatcher {
this._cleanupJobIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval( this._cleanupJobIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
this._cleanupAsync.bind(this), this._cleanupAsync.bind(this),
this._cleanupJobInterval, this._cleanupJobInterval,
(err: Error) => {
this.unsubscribe();
callback(err);
},
); );
} }
/** /**
@@ -207,11 +211,19 @@ export class OrderStateWatcher {
if (!_.isUndefined(this._orderByOrderHash[orderHash])) { if (!_.isUndefined(this._orderByOrderHash[orderHash])) {
this.removeOrder(orderHash); this.removeOrder(orderHash);
if (!_.isUndefined(this._callbackIfExists)) { if (!_.isUndefined(this._callbackIfExists)) {
this._callbackIfExists(orderState); this._callbackIfExists(null, orderState);
} }
} }
} }
private async _onEventWatcherCallbackAsync(log: LogEvent): Promise<void> { private async _onEventWatcherCallbackAsync(err: Error | null, logIfExists?: LogEvent): Promise<void> {
if (!_.isNull(err)) {
if (!_.isUndefined(this._callbackIfExists)) {
this._callbackIfExists(err);
this.unsubscribe();
}
return;
}
const log = logIfExists as LogEvent; // At this moment we are sure that no error occured and log is defined.
const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop(log); const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop(log);
const isLogDecoded = !_.isUndefined((maybeDecodedLog as LogWithDecodedArgs<any>).event); const isLogDecoded = !_.isUndefined((maybeDecodedLog as LogWithDecodedArgs<any>).event);
if (!isLogDecoded) { if (!isLogDecoded) {
@@ -332,7 +344,7 @@ export class OrderStateWatcher {
} else { } else {
this._orderStateByOrderHashCache[orderHash] = orderState; this._orderStateByOrderHashCache[orderHash] = orderState;
} }
this._callbackIfExists(orderState); this._callbackIfExists(null, orderState);
} }
} }
private _addToDependentOrderHashes(signedOrder: SignedOrder, orderHash: string): void { private _addToDependentOrderHashes(signedOrder: SignedOrder, orderHash: string): void {

View File

@@ -51,7 +51,7 @@ export interface DecodedLogEvent<ArgsType> {
} }
export type EventCallback<ArgsType> = (err: null | Error, log?: DecodedLogEvent<ArgsType>) => void; export type EventCallback<ArgsType> = (err: null | Error, log?: DecodedLogEvent<ArgsType>) => void;
export type EventWatcherCallback = (log: LogEvent) => void; export type EventWatcherCallback = (err: null | Error, log?: LogEvent) => void;
export enum SolidityTypes { export enum SolidityTypes {
Address = 'address', Address = 'address',
@@ -406,5 +406,5 @@ export interface OrderStateInvalid {
export type OrderState = OrderStateValid | OrderStateInvalid; export type OrderState = OrderStateValid | OrderStateInvalid;
export type OnOrderStateChangeCallback = (orderState: OrderState) => void; export type OnOrderStateChangeCallback = (err: Error | null, orderState?: OrderState) => void;
// tslint:disable:max-file-line-count // tslint:disable:max-file-line-count

View File

@@ -10,6 +10,7 @@ import { EventWatcher } from '../src/order_watcher/event_watcher';
import { DoneCallback } from '../src/types'; import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup'; import { chaiSetup } from './utils/chai_setup';
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
import { web3Factory } from './utils/web3_factory'; import { web3Factory } from './utils/web3_factory';
chaiSetup.configure(); chaiSetup.configure();
@@ -77,13 +78,14 @@ describe('EventWatcher', () => {
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync'); const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
getLogsStub.onCall(0).returns(logs); getLogsStub.onCall(0).returns(logs);
stubs.push(getLogsStub); stubs.push(getLogsStub);
const callback = (event: LogEvent) => { const expectedToBeCalledOnce = false;
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
const expectedLogEvent = expectedLogEvents.shift(); const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent); expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) { if (_.isEmpty(expectedLogEvents)) {
done(); done();
} }
}; });
eventWatcher.subscribe(callback); eventWatcher.subscribe(callback);
}); });
it('correctly computes the difference and emits only changes', (done: DoneCallback) => { it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
@@ -111,13 +113,14 @@ describe('EventWatcher', () => {
getLogsStub.onCall(0).returns(initialLogs); getLogsStub.onCall(0).returns(initialLogs);
getLogsStub.onCall(1).returns(changedLogs); getLogsStub.onCall(1).returns(changedLogs);
stubs.push(getLogsStub); stubs.push(getLogsStub);
const callback = (event: LogEvent) => { const expectedToBeCalledOnce = false;
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
const expectedLogEvent = expectedLogEvents.shift(); const expectedLogEvent = expectedLogEvents.shift();
expect(event).to.be.deep.equal(expectedLogEvent); expect(event).to.be.deep.equal(expectedLogEvent);
if (_.isEmpty(expectedLogEvents)) { if (_.isEmpty(expectedLogEvents)) {
done(); done();
} }
}; });
eventWatcher.subscribe(callback); eventWatcher.subscribe(callback);
}); });
}); });

View File

@@ -536,7 +536,7 @@ describe('ExchangeWrapper', () => {
), ),
).to.be.rejectedWith(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem); ).to.be.rejectedWith(ExchangeContractErrs.BatchOrdersMustHaveAtLeastOneItem);
}); });
it('should successfully fill up to specified amount', async () => { it('should successfully fill up to specified amount when all orders are fully funded', async () => {
const txHash = await zeroEx.exchange.fillOrdersUpToAsync( const txHash = await zeroEx.exchange.fillOrdersUpToAsync(
signedOrders, signedOrders,
fillUpToAmount, fillUpToAmount,
@@ -550,6 +550,37 @@ describe('ExchangeWrapper', () => {
const remainingFillAmount = fillableAmount.minus(1); const remainingFillAmount = fillableAmount.minus(1);
expect(anotherFilledAmount).to.be.bignumber.equal(remainingFillAmount); expect(anotherFilledAmount).to.be.bignumber.equal(remainingFillAmount);
}); });
it('should successfully fill up to specified amount even if filling all orders would fail', async () => {
const missingBalance = new BigNumber(1); // User will still have enough balance to fill up to 9,
// but won't have 10 to fully fill all orders in a batch.
await zeroEx.token.transferAsync(makerTokenAddress, makerAddress, coinbase, missingBalance);
const txHash = await zeroEx.exchange.fillOrdersUpToAsync(
signedOrders,
fillUpToAmount,
shouldThrowOnInsufficientBalanceOrAllowance,
takerAddress,
);
await zeroEx.awaitTransactionMinedAsync(txHash);
const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex);
const anotherFilledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(anotherOrderHashHex);
expect(filledAmount).to.be.bignumber.equal(fillableAmount);
const remainingFillAmount = fillableAmount.minus(1);
expect(anotherFilledAmount).to.be.bignumber.equal(remainingFillAmount);
});
});
describe('failed batch fills', () => {
it("should fail validation if user doesn't have enough balance without fill up to", async () => {
const missingBalance = new BigNumber(2); // User will only have enough balance to fill up to 8
await zeroEx.token.transferAsync(makerTokenAddress, makerAddress, coinbase, missingBalance);
return expect(
zeroEx.exchange.fillOrdersUpToAsync(
signedOrders,
fillUpToAmount,
shouldThrowOnInsufficientBalanceOrAllowance,
takerAddress,
),
).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance);
});
}); });
describe('order transaction options', () => { describe('order transaction options', () => {
const emptyFillUpToAmount = new BigNumber(0); const emptyFillUpToAmount = new BigNumber(0);

View File

@@ -20,7 +20,7 @@ import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup'; import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants'; import { constants } from './utils/constants';
import { FillScenarios } from './utils/fill_scenarios'; import { FillScenarios } from './utils/fill_scenarios';
import { reportNoErrorCallbackErrors } from './utils/report_callback_errors'; import { reportNodeCallbackErrors } from './utils/report_callback_errors';
import { TokenUtils } from './utils/token_utils'; import { TokenUtils } from './utils/token_utils';
import { web3Factory } from './utils/web3_factory'; import { web3Factory } from './utils/web3_factory';
@@ -134,7 +134,7 @@ describe('OrderStateWatcher', () => {
); );
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false(); expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid; const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.orderHash).to.be.equal(orderHash);
@@ -154,7 +154,7 @@ describe('OrderStateWatcher', () => {
fillableAmount, fillableAmount,
); );
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
throw new Error('OrderState callback fired for irrelevant order'); throw new Error('OrderState callback fired for irrelevant order');
}); });
zeroEx.orderStateWatcher.subscribe(callback); zeroEx.orderStateWatcher.subscribe(callback);
@@ -178,7 +178,7 @@ describe('OrderStateWatcher', () => {
); );
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false(); expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid; const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.orderHash).to.be.equal(orderHash);
@@ -202,7 +202,7 @@ describe('OrderStateWatcher', () => {
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false(); expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid; const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.orderHash).to.be.equal(orderHash);
@@ -234,7 +234,7 @@ describe('OrderStateWatcher', () => {
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.true(); expect(orderState.isValid).to.be.true();
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
expect(validOrderState.orderHash).to.be.equal(orderHash); expect(validOrderState.orderHash).to.be.equal(orderHash);
@@ -273,7 +273,7 @@ describe('OrderStateWatcher', () => {
fillableAmount, fillableAmount,
taker, taker,
); );
const callback = reportNoErrorCallbackErrors(done)(); const callback = reportNodeCallbackErrors(done)();
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
zeroEx.orderStateWatcher.subscribe(callback); zeroEx.orderStateWatcher.subscribe(callback);
await zeroEx.token.setProxyAllowanceAsync(zrxTokenAddress, maker, new BigNumber(0)); await zeroEx.token.setProxyAllowanceAsync(zrxTokenAddress, maker, new BigNumber(0));
@@ -295,7 +295,7 @@ describe('OrderStateWatcher', () => {
const fillAmountInBaseUnits = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals); const fillAmountInBaseUnits = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.true(); expect(orderState.isValid).to.be.true();
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
expect(validOrderState.orderHash).to.be.equal(orderHash); expect(validOrderState.orderHash).to.be.equal(orderHash);
@@ -330,7 +330,7 @@ describe('OrderStateWatcher', () => {
const changedMakerApprovalAmount = ZeroEx.toBaseUnitAmount(new BigNumber(3), decimals); const changedMakerApprovalAmount = ZeroEx.toBaseUnitAmount(new BigNumber(3), decimals);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
const orderRelevantState = validOrderState.orderRelevantState; const orderRelevantState = validOrderState.orderRelevantState;
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
@@ -360,7 +360,7 @@ describe('OrderStateWatcher', () => {
const transferAmount = makerBalance.sub(remainingAmount); const transferAmount = makerBalance.sub(remainingAmount);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.true(); expect(orderState.isValid).to.be.true();
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
const orderRelevantState = validOrderState.orderRelevantState; const orderRelevantState = validOrderState.orderRelevantState;
@@ -395,7 +395,7 @@ describe('OrderStateWatcher', () => {
const transferTokenAmount = makerFee.sub(remainingTokenAmount); const transferTokenAmount = makerFee.sub(remainingTokenAmount);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.true(); expect(orderState.isValid).to.be.true();
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
const orderRelevantState = validOrderState.orderRelevantState; const orderRelevantState = validOrderState.orderRelevantState;
@@ -429,7 +429,7 @@ describe('OrderStateWatcher', () => {
const transferTokenAmount = makerFee.sub(remainingTokenAmount); const transferTokenAmount = makerFee.sub(remainingTokenAmount);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
const orderRelevantState = validOrderState.orderRelevantState; const orderRelevantState = validOrderState.orderRelevantState;
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
@@ -464,7 +464,7 @@ describe('OrderStateWatcher', () => {
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
const orderRelevantState = validOrderState.orderRelevantState; const orderRelevantState = validOrderState.orderRelevantState;
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
@@ -492,7 +492,7 @@ describe('OrderStateWatcher', () => {
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false(); expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid; const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.orderHash).to.be.equal(orderHash);
@@ -516,7 +516,7 @@ describe('OrderStateWatcher', () => {
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false(); expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid; const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.orderHash).to.be.equal(orderHash);
@@ -543,7 +543,7 @@ describe('OrderStateWatcher', () => {
const orderHash = ZeroEx.getOrderHashHex(signedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder);
zeroEx.orderStateWatcher.addOrder(signedOrder); zeroEx.orderStateWatcher.addOrder(signedOrder);
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => { const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.true(); expect(orderState.isValid).to.be.true();
const validOrderState = orderState as OrderStateValid; const validOrderState = orderState as OrderStateValid;
expect(validOrderState.orderHash).to.be.equal(orderHash); expect(validOrderState.orderHash).to.be.equal(orderHash);

View File

@@ -25,7 +25,7 @@ export const reportNoErrorCallbackErrors = (done: DoneCallback, expectToBeCalled
}; };
}; };
export const reportNodeCallbackErrors = (done: DoneCallback) => { export const reportNodeCallbackErrors = (done: DoneCallback, expectToBeCalledOnce = true) => {
return <T>(f?: (value: T) => void) => { return <T>(f?: (value: T) => void) => {
const wrapped = (error: Error | null, value: T | undefined) => { const wrapped = (error: Error | null, value: T | undefined) => {
if (!_.isNull(error)) { if (!_.isNull(error)) {
@@ -37,7 +37,9 @@ export const reportNodeCallbackErrors = (done: DoneCallback) => {
} }
try { try {
f(value as T); f(value as T);
done(); if (expectToBeCalledOnce) {
done();
}
} catch (err) { } catch (err) {
done(err); done(err);
} }

View File

@@ -7,10 +7,10 @@ const path = require('path');
const production = process.env.NODE_ENV === 'production'; const production = process.env.NODE_ENV === 'production';
let entry = { let entry = {
'index': './src/index.ts', index: './src/index.ts',
}; };
if (production) { if (production) {
entry = _.assign({}, entry, {'index.min': './src/index.ts'}); entry = _.assign({}, entry, { 'index.min': './src/index.ts' });
} }
module.exports = { module.exports = {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@0xproject/abi-gen", "name": "@0xproject/abi-gen",
"version": "0.1.0", "version": "0.1.1",
"description": "Generate contract wrappers from ABI and handlebars templates", "description": "Generate contract wrappers from ABI and handlebars templates",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@@ -43,6 +43,6 @@
"shx": "^0.2.2", "shx": "^0.2.2",
"tslint": "5.8.0", "tslint": "5.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1" "web3-typescript-typings": "^0.9.3"
} }
} }

View File

@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
const subPackageName = packageJSON.name; const subPackageName = packageJSON.name;
postpublish_utils.getLatestTagAndVersionAsync(subPackageName) postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) { .then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = []; const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
}) })
.catch (function(err) { .catch(function(err) {
throw err; throw err;
}); });

View File

@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
const subPackageName = packageJSON.name; const subPackageName = packageJSON.name;
postpublish_utils.getLatestTagAndVersionAsync(subPackageName) postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) { .then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = []; const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
}) })
.catch (function(err) { .catch(function(err) {
throw err; throw err;
}); });

View File

@@ -0,0 +1,3 @@
# CHANGELOG
## v0.x.x - _TBD, 2018_

View File

@@ -0,0 +1,43 @@
## chai-as-promised-typescript-typings
Fork of type definitions for chai-as-promised that includes changes made by dirty-chai
## Installation
```bash
yarn add -D chai-as-promised-typescript-typings
```
## Usage
Add the following line within an `include` section of your `tsconfig.json`
```json
"./node_modules/chai-as-promised-typescript-typings/index.d.ts"
```
## Contributing
We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install Dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Lint
```bash
yarn lint
```

View File

@@ -0,0 +1,268 @@
// Type definitions for chai-as-promised
// Project: https://github.com/domenic/chai-as-promised/
// Definitions by: jt000 <https://github.com/jt000>, Yuki Kokubun <https://github.com/Kuniwak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'chai-as-promised' {
function chaiAsPromised(chai: any, utils: any): void;
namespace chaiAsPromised {
}
export = chaiAsPromised;
}
// tslint:disable:no-namespace ban-types member-ordering
declare namespace Chai {
// For BDD API
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
eventually: PromisedAssertion;
fulfilled: PromisedAssertion;
become(expected: any): PromisedAssertion;
rejected(): PromisedAssertion;
rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion;
notify(fn: Function): PromisedAssertion;
}
// Eventually does not have .then(), but PromisedAssertion have.
interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison {
// From chai-as-promised
become(expected: PromiseLike<any>): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: () => PromisedAssertion;
rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion;
notify(fn: Function): PromisedAssertion;
// From chai
not: PromisedAssertion;
deep: PromisedDeep;
all: PromisedKeyFilter;
a: PromisedTypeComparison;
an: PromisedTypeComparison;
include: PromisedInclude;
contain: PromisedInclude;
ok: PromisedAssertion;
true: () => PromisedAssertion;
false: () => PromisedAssertion;
null: PromisedAssertion;
undefined: PromisedAssertion;
exist: PromisedAssertion;
empty: PromisedAssertion;
arguments: PromisedAssertion;
Arguments: PromisedAssertion;
equal: PromisedEqual;
equals: PromisedEqual;
eq: PromisedEqual;
eql: PromisedEqual;
eqls: PromisedEqual;
property: PromisedProperty;
ownProperty: PromisedOwnProperty;
haveOwnProperty: PromisedOwnProperty;
length: PromisedLength;
lengthOf: PromisedLength;
match(regexp: RegExp | string, message?: string): PromisedAssertion;
string(string: string, message?: string): PromisedAssertion;
keys: PromisedKeys;
key(string: string): PromisedAssertion;
throw: PromisedThrow;
throws: PromisedThrow;
Throw: PromisedThrow;
respondTo(method: string, message?: string): PromisedAssertion;
itself: PromisedAssertion;
satisfy(matcher: Function, message?: string): PromisedAssertion;
closeTo(expected: number, delta: number, message?: string): PromisedAssertion;
members: PromisedMembers;
}
interface PromisedAssertion extends Eventually, PromiseLike<any> {}
interface PromisedLanguageChains {
eventually: Eventually;
// From chai
to: PromisedAssertion;
be: PromisedAssertion;
been: PromisedAssertion;
is: PromisedAssertion;
that: PromisedAssertion;
which: PromisedAssertion;
and: PromisedAssertion;
has: PromisedAssertion;
have: PromisedAssertion;
with: PromisedAssertion;
at: PromisedAssertion;
of: PromisedAssertion;
same: PromisedAssertion;
}
interface PromisedNumericComparison {
above: PromisedNumberComparer;
gt: PromisedNumberComparer;
greaterThan: PromisedNumberComparer;
least: PromisedNumberComparer;
gte: PromisedNumberComparer;
below: PromisedNumberComparer;
lt: PromisedNumberComparer;
lessThan: PromisedNumberComparer;
most: PromisedNumberComparer;
lte: PromisedNumberComparer;
within(start: number, finish: number, message?: string): PromisedAssertion;
}
type PromisedNumberComparer = (value: number, message?: string) => PromisedAssertion;
interface PromisedTypeComparison {
(type: string, message?: string): PromisedAssertion;
instanceof: PromisedInstanceOf;
instanceOf: PromisedInstanceOf;
}
type PromisedInstanceOf = (constructor: Object, message?: string) => PromisedAssertion;
interface PromisedDeep {
equal: PromisedEqual;
include: PromisedInclude;
property: PromisedProperty;
}
interface PromisedKeyFilter {
keys: PromisedKeys;
}
type PromisedEqual = (value: any, message?: string) => PromisedAssertion;
type PromisedProperty = (name: string, value?: any, message?: string) => PromisedAssertion;
type PromisedOwnProperty = (name: string, message?: string) => PromisedAssertion;
interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison {
(length: number, message?: string): PromisedAssertion;
}
interface PromisedInclude {
(value: Object | string | number, message?: string): PromisedAssertion;
keys: PromisedKeys;
members: PromisedMembers;
all: PromisedKeyFilter;
}
interface PromisedKeys {
(...keys: string[]): PromisedAssertion;
(keys: any[]): PromisedAssertion;
}
interface PromisedThrow {
(): PromisedAssertion;
(expected: string | RegExp, message?: string): PromisedAssertion;
(constructor: Error | Function, expected?: string | RegExp, message?: string): PromisedAssertion;
}
type PromisedMembers = (set: any[], message?: string) => PromisedAssertion;
// For Assert API
interface Assert {
eventually: PromisedAssert;
isFulfilled(promise: PromiseLike<any>, message?: string): PromiseLike<void>;
becomes(promise: PromiseLike<any>, expected: any, message?: string): PromiseLike<void>;
doesNotBecome(promise: PromiseLike<any>, expected: any, message?: string): PromiseLike<void>;
isRejected(promise: PromiseLike<any>, message?: string): PromiseLike<void>;
isRejected(promise: PromiseLike<any>, expected: any | RegExp, message?: string): PromiseLike<void>;
notify(fn: Function): PromiseLike<void>;
}
export interface PromisedAssert {
fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike<void>;
ok(val: any, msg?: string): PromiseLike<void>;
notOk(val: any, msg?: string): PromiseLike<void>;
equal(act: any, exp: any, msg?: string): PromiseLike<void>;
notEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
strictEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
notStrictEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
deepEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
notDeepEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
isTrue(val: any, msg?: string): PromiseLike<void>;
isFalse(val: any, msg?: string): PromiseLike<void>;
isNull(val: any, msg?: string): PromiseLike<void>;
isNotNull(val: any, msg?: string): PromiseLike<void>;
isUndefined(val: any, msg?: string): PromiseLike<void>;
isDefined(val: any, msg?: string): PromiseLike<void>;
isFunction(val: any, msg?: string): PromiseLike<void>;
isNotFunction(val: any, msg?: string): PromiseLike<void>;
isObject(val: any, msg?: string): PromiseLike<void>;
isNotObject(val: any, msg?: string): PromiseLike<void>;
isArray(val: any, msg?: string): PromiseLike<void>;
isNotArray(val: any, msg?: string): PromiseLike<void>;
isString(val: any, msg?: string): PromiseLike<void>;
isNotString(val: any, msg?: string): PromiseLike<void>;
isNumber(val: any, msg?: string): PromiseLike<void>;
isNotNumber(val: any, msg?: string): PromiseLike<void>;
isBoolean(val: any, msg?: string): PromiseLike<void>;
isNotBoolean(val: any, msg?: string): PromiseLike<void>;
typeOf(val: any, type: string, msg?: string): PromiseLike<void>;
notTypeOf(val: any, type: string, msg?: string): PromiseLike<void>;
instanceOf(val: any, type: Function, msg?: string): PromiseLike<void>;
notInstanceOf(val: any, type: Function, msg?: string): PromiseLike<void>;
include(exp: string | any[], inc: any, msg?: string): PromiseLike<void>;
notInclude(exp: string | any[], inc: any, msg?: string): PromiseLike<void>;
match(exp: any, re: RegExp, msg?: string): PromiseLike<void>;
notMatch(exp: any, re: RegExp, msg?: string): PromiseLike<void>;
property(obj: Object, prop: string, msg?: string): PromiseLike<void>;
notProperty(obj: Object, prop: string, msg?: string): PromiseLike<void>;
deepProperty(obj: Object, prop: string, msg?: string): PromiseLike<void>;
notDeepProperty(obj: Object, prop: string, msg?: string): PromiseLike<void>;
propertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike<void>;
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike<void>;
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike<void>;
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike<void>;
lengthOf(exp: any, len: number, msg?: string): PromiseLike<void>;
// alias frenzy
throw(fn: Function, msg?: string): PromiseLike<void>;
throw(fn: Function, regExp: RegExp): PromiseLike<void>;
throw(fn: Function, errType: Function, msg?: string): PromiseLike<void>;
throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike<void>;
throws(fn: Function, msg?: string): PromiseLike<void>;
throws(fn: Function, regExp: RegExp): PromiseLike<void>;
throws(fn: Function, errType: Function, msg?: string): PromiseLike<void>;
throws(fn: Function, errType: Function, regExp: RegExp): PromiseLike<void>;
Throw(fn: Function, msg?: string): PromiseLike<void>;
Throw(fn: Function, regExp: RegExp): PromiseLike<void>;
Throw(fn: Function, errType: Function, msg?: string): PromiseLike<void>;
Throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike<void>;
doesNotThrow(fn: Function, msg?: string): PromiseLike<void>;
doesNotThrow(fn: Function, regExp: RegExp): PromiseLike<void>;
doesNotThrow(fn: Function, errType: Function, msg?: string): PromiseLike<void>;
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromiseLike<void>;
operator(val: any, operator: string, val2: any, msg?: string): PromiseLike<void>;
closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike<void>;
sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
ifError(val: any, msg?: string): PromiseLike<void>;
}
}

View File

@@ -0,0 +1,21 @@
{
"name": "chai-as-promised-typescript-typings",
"version": "0.0.3",
"description": "Typescript type definitions for chai-as-promised",
"main": "index.d.ts",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/0xProject/0x.js.git"
},
"author": "Fabio Berger",
"contributors": ["Leonid Logvinov <logvinov.leon@gmail.com>"],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
},
"homepage": "https://github.com/0xProject/0x.js/packages/chai-as-promised-typescript-typings#readme",
"dependencies": {
"chai-typescript-typings": "^0.0.0"
}
}

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -0,0 +1,3 @@
{
"extends": ["tslint-config-0xproject"]
}

View File

@@ -0,0 +1,3 @@
# CHANGELOG
## v0.x.x - _TBD, 2018_

View File

@@ -0,0 +1,43 @@
## chai-typescript-typings
Fork of type definitions for chai that includes changes made by dirty-chai
## Installation
```bash
yarn add -D chai-typescript-typings
```
## Usage
Add the following line within an `include` section of your `tsconfig.json`
```json
"./node_modules/chai-typescript-typings/index.d.ts"
```
## Contributing
We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository.
Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.
### Install Dependencies
If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:
```bash
yarn config set workspaces-experimental true
```
Then install dependencies
```bash
yarn install
```
### Lint
```bash
yarn lint
```

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
{
"name": "chai-typescript-typings",
"version": "0.0.1",
"description": "Typescript type definitions for chai",
"main": "index.d.ts",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/0xProject/0x.js.git"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
},
"homepage": "https://github.com/0xProject/0x.js/packages/chai-typescript-typings#readme"
}

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -0,0 +1,3 @@
{
"extends": ["tslint-config-0xproject"]
}

View File

@@ -1,6 +1,12 @@
# CHANGELOG # CHANGELOG
## vx.x.x ## v0.5.0 - _January 17, 2018_
* Sanitize api endpoint url and remove trailing slashes (#318)
* Improve error message text in HttpClient (#318)
* Stop appending '/v0' to api endpoint url in HttpClient (#318)
## v0.4.0 - _January 11, 2018_
* Prevent getFeesAsync method on HttpClient from mutating input (#296) * Prevent getFeesAsync method on HttpClient from mutating input (#296)

View File

@@ -1,21 +1,16 @@
{ {
"name": "@0xproject/connect", "name": "@0xproject/connect",
"version": "0.4.0", "version": "0.4.1",
"description": "A javascript library for interacting with the standard relayer api", "description": "A javascript library for interacting with the standard relayer api",
"keywords": [ "keywords": ["connect", "0xproject", "ethereum", "tokens", "exchange"],
"connect",
"0xproject",
"ethereum",
"tokens",
"exchange"
],
"main": "lib/src/index.js", "main": "lib/src/index.js",
"types": "lib/src/index.d.ts", "types": "lib/src/index.d.ts",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"clean": "shx rm -rf _bundles lib test_temp", "clean": "shx rm -rf _bundles lib test_temp",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
"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",
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures", "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"run_mocha": "mocha lib/test/**/*_test.js", "run_mocha": "mocha lib/test/**/*_test.js",
@@ -64,6 +59,6 @@
"tslint": "5.8.0", "tslint": "5.8.0",
"typedoc": "~0.8.0", "typedoc": "~0.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1" "web3-typescript-typings": "^0.9.3"
} }
} }

View File

@@ -8,22 +8,20 @@ const S3BucketPath = 's3://connect-docs-jsons/';
let tag; let tag;
let version; let version;
postpublish_utils.getLatestTagAndVersionAsync(subPackageName) postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) { .then(function(result) {
tag = result.tag; tag = result.tag;
version = result.version; version = result.version;
const releaseName = postpublish_utils.getReleaseName(subPackageName, version); const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
return postpublish_utils.publishReleaseNotes(tag, releaseName); return postpublish_utils.publishReleaseNotes(tag, releaseName);
}) })
.then(function(release) { .then(function(release) {
console.log('POSTPUBLISH: Release successful, generating docs...'); console.log('POSTPUBLISH: Release successful, generating docs...');
const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json'; const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
return execAsync( return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
'JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', cwd,
{ });
cwd,
}
);
}) })
.then(function(result) { .then(function(result) {
if (result.stderr !== '') { if (result.stderr !== '') {
@@ -35,6 +33,7 @@ postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', { return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
cwd, cwd,
}); });
}).catch (function(err) { })
.catch(function(err) {
throw err; throw err;
}); });

View File

@@ -20,6 +20,7 @@ import {
} from './types'; } from './types';
import { relayerResponseJsonParsers } from './utils/relayer_response_json_parsers'; import { relayerResponseJsonParsers } from './utils/relayer_response_json_parsers';
const TRAILING_SLASHES_REGEX = /\/+$/;
/** /**
* This class includes all the functionality related to interacting with a set of HTTP endpoints * This class includes all the functionality related to interacting with a set of HTTP endpoints
* that implement the standard relayer API v0 * that implement the standard relayer API v0
@@ -33,7 +34,7 @@ export class HttpClient implements Client {
*/ */
constructor(url: string) { constructor(url: string) {
assert.isHttpUrl('url', url); assert.isHttpUrl('url', url);
this._apiEndpointUrl = url; this._apiEndpointUrl = url.replace(TRAILING_SLASHES_REGEX, ''); // remove trailing slashes
} }
/** /**
* Retrieve token pair info from the API * Retrieve token pair info from the API
@@ -130,20 +131,22 @@ export class HttpClient implements Client {
const stringifiedParams = queryString.stringify(params); const stringifiedParams = queryString.stringify(params);
query = `?${stringifiedParams}`; query = `?${stringifiedParams}`;
} }
const url = `${this._apiEndpointUrl}/v0${path}${query}`; const url = `${this._apiEndpointUrl}${path}${query}`;
const headers = new Headers({ const headers = new Headers({
'content-type': 'application/json', 'content-type': 'application/json',
}); });
const response = await fetch(url, { const response = await fetch(url, {
method: requestType, method: requestType,
body: JSON.stringify(payload), body: JSON.stringify(payload),
headers, headers,
}); });
if (!response.ok) {
throw Error(response.statusText);
}
const json = await response.json(); const json = await response.json();
if (!response.ok) {
const errorString = `${response.status} - ${response.statusText}\n${requestType} ${url}\n${JSON.stringify(
json,
)}`;
throw Error(errorString);
}
return json; return json;
} }
} }

View File

@@ -29,14 +29,23 @@ describe('HttpClient', () => {
afterEach(() => { afterEach(() => {
fetchMock.restore(); fetchMock.restore();
}); });
describe('#constructor', () => {
it('should remove trailing slashes from api url', async () => {
const urlWithTrailingSlash = 'https://slash.com/';
const urlWithoutTrailingSlash = 'https://slash.com';
const client = new HttpClient(urlWithTrailingSlash);
const sanitizedUrl = (client as any)._apiEndpointUrl;
expect(sanitizedUrl).to.be.deep.equal(urlWithoutTrailingSlash);
});
});
describe('#getTokenPairsAsync', () => { describe('#getTokenPairsAsync', () => {
const url = `${relayUrl}/v0/token_pairs`; const url = `${relayUrl}/token_pairs`;
it('gets token pairs', async () => { it('gets token pairs', async () => {
fetchMock.get(url, tokenPairsResponseJSON); fetchMock.get(url, tokenPairsResponseJSON);
const tokenPairs = await relayerClient.getTokenPairsAsync(); const tokenPairs = await relayerClient.getTokenPairsAsync();
expect(tokenPairs).to.be.deep.equal(tokenPairsResponse); expect(tokenPairs).to.be.deep.equal(tokenPairsResponse);
}); });
it('gets specfic token pairs for request', async () => { it('gets specific token pairs for request', async () => {
const tokenAddress = '0x323b5d4c32345ced77393b3530b1eed0f346429d'; const tokenAddress = '0x323b5d4c32345ced77393b3530b1eed0f346429d';
const tokenPairsRequest = { const tokenPairsRequest = {
tokenA: tokenAddress, tokenA: tokenAddress,
@@ -52,7 +61,7 @@ describe('HttpClient', () => {
}); });
}); });
describe('#getOrdersAsync', () => { describe('#getOrdersAsync', () => {
const url = `${relayUrl}/v0/orders`; const url = `${relayUrl}/orders`;
it('gets orders', async () => { it('gets orders', async () => {
fetchMock.get(url, ordersResponseJSON); fetchMock.get(url, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync(); const orders = await relayerClient.getOrdersAsync();
@@ -75,7 +84,7 @@ describe('HttpClient', () => {
}); });
describe('#getOrderAsync', () => { describe('#getOrderAsync', () => {
const orderHash = '0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f'; const orderHash = '0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
const url = `${relayUrl}/v0/order/${orderHash}`; const url = `${relayUrl}/order/${orderHash}`;
it('gets order', async () => { it('gets order', async () => {
fetchMock.get(url, orderResponseJSON); fetchMock.get(url, orderResponseJSON);
const order = await relayerClient.getOrderAsync(orderHash); const order = await relayerClient.getOrderAsync(orderHash);
@@ -91,7 +100,7 @@ describe('HttpClient', () => {
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d', baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
quoteTokenAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32', quoteTokenAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
}; };
const url = `${relayUrl}/v0/orderbook?baseTokenAddress=${request.baseTokenAddress}&quoteTokenAddress=${ const url = `${relayUrl}/orderbook?baseTokenAddress=${request.baseTokenAddress}&quoteTokenAddress=${
request.quoteTokenAddress request.quoteTokenAddress
}`; }`;
it('gets order book', async () => { it('gets order book', async () => {
@@ -116,7 +125,7 @@ describe('HttpClient', () => {
salt: new BigNumber('256'), salt: new BigNumber('256'),
expirationUnixTimestampSec: new BigNumber('42'), expirationUnixTimestampSec: new BigNumber('42'),
}; };
const url = `${relayUrl}/v0/fees`; const url = `${relayUrl}/fees`;
it('gets fees', async () => { it('gets fees', async () => {
fetchMock.post(url, feesResponseJSON); fetchMock.post(url, feesResponseJSON);
const fees = await relayerClient.getFeesAsync(request); const fees = await relayerClient.getFeesAsync(request);

View File

@@ -1,14 +1,15 @@
{ {
"private": true, "private": true,
"name": "contracts", "name": "contracts",
"version": "2.1.2", "version": "2.1.3",
"description": "Smart contract components of 0x protocol", "description": "Smart contract components of 0x protocol",
"main": "index.js", "main": "index.js",
"directories": { "directories": {
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"build": "rm -rf ./lib; copyfiles ./build/**/* ./deploy/solc/solc_bin/* ./deploy/test/fixtures/contracts/**/* ./deploy/test/fixtures/contracts/* ./lib; tsc;", "build":
"rm -rf ./lib; copyfiles ./build/**/* ./deploy/solc/solc_bin/* ./deploy/test/fixtures/contracts/**/* ./deploy/test/fixtures/contracts/* ./lib; tsc;",
"test": "npm run build; truffle test", "test": "npm run build; truffle test",
"compile": "npm run build; node lib/deploy/cli.js compile", "compile": "npm run build; node lib/deploy/cli.js compile",
"clean": "rm -rf ./lib", "clean": "rm -rf ./lib",
@@ -51,14 +52,14 @@
"types-bn": "^0.0.1", "types-bn": "^0.0.1",
"types-ethereumjs-util": "0xProject/types-ethereumjs-util", "types-ethereumjs-util": "0xProject/types-ethereumjs-util",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1", "web3-typescript-typings": "^0.9.3",
"yargs": "^10.0.3" "yargs": "^10.0.3"
}, },
"dependencies": { "dependencies": {
"0x.js": "^0.29.1", "0x.js": "^0.29.2",
"@0xproject/json-schemas": "^0.7.2", "@0xproject/json-schemas": "^0.7.2",
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.1.3",
"@0xproject/web3-wrapper": "^0.1.3", "@0xproject/web3-wrapper": "^0.1.4",
"bluebird": "^3.5.0", "bluebird": "^3.5.0",
"bn.js": "^4.11.8", "bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4", "ethereumjs-abi": "^0.6.4",

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
const subPackageName = packageJSON.name; const subPackageName = packageJSON.name;
postpublish_utils.getLatestTagAndVersionAsync(subPackageName) postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) { .then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = []; const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
}) })
.catch (function(err) { .catch(function(err) {
throw err; throw err;
}); });

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "@0xproject/kovan_faucets", "name": "@0xproject/kovan_faucets",
"version": "1.0.3", "version": "1.0.4",
"description": "A faucet micro-service that dispenses test ERC20 tokens or Ether", "description": "A faucet micro-service that dispenses test ERC20 tokens or Ether",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
@@ -14,7 +14,7 @@
"author": "Fabio Berger", "author": "Fabio Berger",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"0x.js": "^0.29.1", "0x.js": "^0.29.2",
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.1.3",
"body-parser": "^1.17.1", "body-parser": "^1.17.1",
"ethereumjs-tx": "^1.3.3", "ethereumjs-tx": "^1.3.3",
@@ -36,7 +36,7 @@
"source-map-loader": "^0.1.6", "source-map-loader": "^0.1.6",
"tslint": "5.8.0", "tslint": "5.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1", "web3-typescript-typings": "^0.9.3",
"webpack": "^3.1.0", "webpack": "^3.1.0",
"webpack-node-externals": "^1.6.0" "webpack-node-externals": "^1.6.0"
} }

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -12,9 +12,9 @@ export const errorReporter = {
rollbar.handleUncaughtExceptions(configs.ROLLBAR_ACCESS_KEY); rollbar.handleUncaughtExceptions(configs.ROLLBAR_ACCESS_KEY);
process.on('unhandledRejection', (err: Error) => { process.on('unhandledRejection', async (err: Error) => {
utils.consoleLog(`Uncaught exception ${err}. Stack: ${err.stack}`); utils.consoleLog(`Uncaught exception ${err}. Stack: ${err.stack}`);
this.report(err); await this.reportAsync(err);
process.exit(1); process.exit(1);
}); });
}, },

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -1,5 +1,3 @@
/// <reference types='chai-typescript-typings' />
/// <reference types='chai-as-promised-typescript-typings' />
declare module 'dirty-chai'; declare module 'dirty-chai';
declare module 'es6-promisify'; declare module 'es6-promisify';

View File

@@ -8,22 +8,12 @@
"clean": "shx rm -rf lib", "clean": "shx rm -rf lib",
"lint": "tslint --project . 'rules/**/*.ts'" "lint": "tslint --project . 'rules/**/*.ts'"
}, },
"files": [ "files": ["tslint.js", "README.md", "LICENSE"],
"tslint.js",
"README.md",
"LICENSE"
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/0xProject/0x.js.git" "url": "git://github.com/0xProject/0x.js.git"
}, },
"keywords": [ "keywords": ["tslint", "config", "0xProject", "typescript", "ts"],
"tslint",
"config",
"0xProject",
"typescript",
"ts"
],
"author": { "author": {
"name": "Fabio Berger", "name": "Fabio Berger",
"email": "fabio@0xproject.com" "email": "fabio@0xproject.com"

View File

@@ -1,3 +1,6 @@
# CHANGELOG # CHANGELOG
## vx.x.x ## v0.2.0 - _January 17, 2018_
* Add `onError` parameter to `intervalUtils.setAsyncExcludingInterval` (#312)
* Add `intervalUtils.setInterval` (#312)

View File

@@ -1,14 +1,18 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
export const intervalUtils = { export const intervalUtils = {
setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number) { setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number, onError: (err: Error) => void) {
let locked = false; let locked = false;
const intervalId = setInterval(async () => { const intervalId = setInterval(async () => {
if (locked) { if (locked) {
return; return;
} else { } else {
locked = true; locked = true;
await fn(); try {
await fn();
} catch (err) {
onError(err);
}
locked = false; locked = false;
} }
}, intervalMs); }, intervalMs);
@@ -17,4 +21,17 @@ export const intervalUtils = {
clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void { clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void {
clearInterval(intervalId); clearInterval(intervalId);
}, },
setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void) {
const intervalId = setInterval(() => {
try {
fn();
} catch (err) {
onError(err);
}
}, intervalMs);
return intervalId;
},
clearInterval(intervalId: NodeJS.Timer): void {
clearInterval(intervalId);
},
}; };

View File

@@ -0,0 +1,6 @@
# CHANGELOG
## v0.9.3 - _January 11, 2018_
* Add type for getData on a contract
* Fixed the `defaultAccount` not allowing for `undefined` value (#320)

View File

@@ -107,6 +107,7 @@ declare module 'web3' {
interface Contract<A extends ContractInstance> { interface Contract<A extends ContractInstance> {
at(address: string): A; at(address: string): A;
getData(...args: any[]): string;
'new'(...args: any[]): A; 'new'(...args: any[]): A;
} }
@@ -169,7 +170,7 @@ declare module 'web3' {
gasPrice: BigNumber.BigNumber; gasPrice: BigNumber.BigNumber;
accounts: string[]; accounts: string[];
blockNumber: number; blockNumber: number;
defaultAccount: string; defaultAccount?: string;
defaultBlock: Web3.BlockParam; defaultBlock: Web3.BlockParam;
syncing: Web3.SyncingResult; syncing: Web3.SyncingResult;
compile: { compile: {

View File

@@ -1,6 +1,6 @@
{ {
"name": "web3-typescript-typings", "name": "web3-typescript-typings",
"version": "0.9.1", "version": "0.9.3",
"description": "Typescript type definitions for web3", "description": "Typescript type definitions for web3",
"main": "index.d.ts", "main": "index.d.ts",
"types": "index.d.ts", "types": "index.d.ts",
@@ -9,17 +9,15 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/0xProject/web3-typescript-typings.git" "url": "git+https://github.com/0xProject/0x.js.git"
}, },
"author": "Fabio Berger", "author": "Fabio Berger",
"contributors": [ "contributors": ["Leonid Logvinov <logvinov.leon@gmail.com>"],
"Leonid Logvinov <logvinov.leon@gmail.com>"
],
"license": "Apache-2.0", "license": "Apache-2.0",
"bugs": { "bugs": {
"url": "https://github.com/0xProject/web3-typescript-typings/issues" "url": "https://github.com/0xProject/0x.js/issues"
}, },
"homepage": "https://github.com/0xProject/web3-typescript-typings#readme", "homepage": "https://github.com/0xProject/0x.js/packages/web3-typescript-typings#readme",
"devDependencies": { "devDependencies": {
"@types/bignumber.js": "^4.0.2", "@types/bignumber.js": "^4.0.2",
"tslint": "^5.5.0", "tslint": "^5.5.0",

View File

@@ -0,0 +1,15 @@
const postpublish_utils = require('../../../scripts/postpublish_utils');
const packageJSON = require('../package.json');
const subPackageName = packageJSON.name;
postpublish_utils
.getLatestTagAndVersionAsync(subPackageName)
.then(function(result) {
const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
const assets = [];
return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
})
.catch(function(err) {
throw err;
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "@0xproject/web3-wrapper", "name": "@0xproject/web3-wrapper",
"version": "0.1.3", "version": "0.1.4",
"description": "Wraps around web3 and gives a nicer interface", "description": "Wraps around web3 and gives a nicer interface",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@@ -26,7 +26,7 @@
"shx": "^0.2.2", "shx": "^0.2.2",
"tslint": "5.8.0", "tslint": "5.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1" "web3-typescript-typings": "^0.9.3"
}, },
"dependencies": { "dependencies": {
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.1.3",

View File

@@ -0,0 +1,5 @@
# CHANGELOG
## v0.x.x - _TBD_
* Added new team members to the about page (#317)

View File

@@ -1,6 +1,6 @@
{ {
"name": "@0xproject/website", "name": "@0xproject/website",
"version": "0.0.5", "version": "0.0.6",
"private": true, "private": true,
"description": "Website and 0x portal dapp", "description": "Website and 0x portal dapp",
"scripts": { "scripts": {
@@ -8,9 +8,12 @@
"clean": "shx rm -f public/bundle*", "clean": "shx rm -f public/bundle*",
"lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'", "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
"dev": "webpack-dev-server --content-base public --https", "dev": "webpack-dev-server --content-base public --https",
"update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../website/contracts; done;", "update_contracts":
"deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../website/contracts; done;",
"deploy_live": "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" "deploy_staging":
"npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"deploy_live":
"npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers"
}, },
"config": { "config": {
"artifacts": "Mintable" "artifacts": "Mintable"
@@ -18,7 +21,7 @@
"author": "Fabio Berger", "author": "Fabio Berger",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"0x.js": "^0.29.1", "0x.js": "^0.29.2",
"@0xproject/subproviders": "^0.3.0", "@0xproject/subproviders": "^0.3.0",
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.1.3",
"accounting": "^0.4.1", "accounting": "^0.4.1",
@@ -98,7 +101,7 @@
"style-loader": "0.13.x", "style-loader": "0.13.x",
"tslint": "5.8.0", "tslint": "5.8.0",
"typescript": "~2.6.1", "typescript": "~2.6.1",
"web3-typescript-typings": "^0.9.1", "web3-typescript-typings": "^0.9.3",
"webpack": "^3.1.0", "webpack": "^3.1.0",
"webpack-dev-middleware": "^1.10.0", "webpack-dev-middleware": "^1.10.0",
"webpack-dev-server": "^2.5.0" "webpack-dev-server": "^2.5.0"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -40,6 +40,9 @@ const teamRow1: ProfileInfo[] = [
github: 'https://github.com/fabioberger', github: 'https://github.com/fabioberger',
medium: 'https://medium.com/@fabioberger', medium: 'https://medium.com/@fabioberger',
}, },
];
const teamRow2: ProfileInfo[] = [
{ {
name: 'Alex Xu', name: 'Alex Xu',
title: 'Director of Operations', title: 'Director of Operations',
@@ -48,11 +51,8 @@ const teamRow1: ProfileInfo[] = [
image: '/images/team/alex.jpg', image: '/images/team/alex.jpg',
linkedIn: 'https://www.linkedin.com/in/alex-xu/', linkedIn: 'https://www.linkedin.com/in/alex-xu/',
github: '', github: '',
medium: '', medium: 'https://medium.com/@aqxu',
}, },
];
const teamRow2: ProfileInfo[] = [
{ {
name: 'Leonid Logvinov', name: 'Leonid Logvinov',
title: 'Engineer', title: 'Engineer',
@@ -61,7 +61,7 @@ const teamRow2: ProfileInfo[] = [
image: '/images/team/leonid.png', image: '/images/team/leonid.png',
linkedIn: 'https://www.linkedin.com/in/leonidlogvinov/', linkedIn: 'https://www.linkedin.com/in/leonidlogvinov/',
github: 'https://github.com/LogvinovLeon', github: 'https://github.com/LogvinovLeon',
medium: '', medium: 'https://medium.com/@Logvinov',
}, },
{ {
name: 'Ben Burns', name: 'Ben Burns',
@@ -73,23 +73,36 @@ const teamRow2: ProfileInfo[] = [
github: '', github: '',
medium: '', medium: '',
}, },
{ ];
name: 'Philippe Castonguay',
title: 'Dev Relations Manager', const teamRow3: ProfileInfo[] = [
description: `Developer relations. Previously computational neuroscience \
research at Janelia. Statistics at Western University. MA Dropout.`,
image: '/images/team/philippe.png',
linkedIn: '',
github: 'https://github.com/PhABC',
medium: '',
},
{ {
name: 'Brandon Millman', name: 'Brandon Millman',
title: 'Senior Engineer', title: 'Senior Engineer',
description: `Full-stack engineer. Previously senior software engineer at \ description: `Full-stack engineer. Previously senior software engineer at \
Twitter. Electrical and Computer Engineering at Duke.`, Twitter. Electrical and Computer Engineering at Duke.`,
image: '/images/team/brandon.png', image: '/images/team/brandon.png',
linkedIn: 'https://www.linkedin.com/company-beta/17942619/', linkedIn: 'https://www.linkedin.com/in/brandon-millman-b093a022/',
github: 'https://github.com/BMillman19',
medium: 'https://medium.com/@bchillman',
},
{
name: 'Tom Schmidt',
title: 'Product Manager',
description: `Previously engineering at Apple, product management at Facebook and Instagram. Computer Science at Stanford.`,
image: '/images/team/tom.jpg',
linkedIn: 'https://www.linkedin.com/in/tomhschmidt/',
github: 'https://github.com/tomhschmidt',
medium: '',
},
{
name: 'Jacob Evans',
title: 'Blockchain Engineer',
description: `Previously software engineer at Qantas and RSA Security.`,
image: '/images/team/jacob.jpg',
linkedIn: 'https://www.linkedin.com/in/dekzter/',
github: 'https://github.com/dekz',
medium: '',
}, },
]; ];
@@ -181,6 +194,7 @@ export class About extends React.Component<AboutProps, AboutState> {
<div className="pt3 md-px4 lg-px0"> <div className="pt3 md-px4 lg-px0">
<div className="clearfix pb3">{this._renderProfiles(teamRow1)}</div> <div className="clearfix pb3">{this._renderProfiles(teamRow1)}</div>
<div className="clearfix">{this._renderProfiles(teamRow2)}</div> <div className="clearfix">{this._renderProfiles(teamRow2)}</div>
<div className="clearfix">{this._renderProfiles(teamRow3)}</div>
</div> </div>
<div className="pt3 pb2"> <div className="pt3 pb2">
<div <div

View File

@@ -47,7 +47,7 @@ export function Profile(props: ProfileProps) {
<div style={{ minHeight: 60, lineHeight: 1.4 }} className="pt1 pb2 mx-auto lg-h6 md-h6 sm-h5 sm-center"> <div style={{ minHeight: 60, lineHeight: 1.4 }} className="pt1 pb2 mx-auto lg-h6 md-h6 sm-h5 sm-center">
{props.profileInfo.description} {props.profileInfo.description}
</div> </div>
<div className="flex pb3 mx-auto sm-hide xs-hide" style={{ width: 180, opacity: 0.5 }}> <div className="flex pb3 mx-auto sm-hide xs-hide" style={{ width: 280, opacity: 0.5 }}>
{renderSocialMediaIcons(props.profileInfo)} {renderSocialMediaIcons(props.profileInfo)}
</div> </div>
</div> </div>

107
yarn.lock
View File

@@ -1662,8 +1662,8 @@ caniuse-api@^1.5.2:
lodash.uniq "^4.5.0" lodash.uniq "^4.5.0"
caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
version "1.0.30000789" version "1.0.30000790"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000789.tgz#5cf3fec75480041ab162ca06413153141e234325" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000790.tgz#a8023e6eb9fe9c0ef3d60b4427ce104ea87d381c"
capture-stack-trace@^1.0.0: capture-stack-trace@^1.0.0:
version "1.0.0" version "1.0.0"
@@ -1680,12 +1680,6 @@ center-align@^0.1.1:
align-text "^0.1.3" align-text "^0.1.3"
lazy-cache "^1.0.3" lazy-cache "^1.0.3"
chai-as-promised-typescript-typings@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/chai-as-promised-typescript-typings/-/chai-as-promised-typescript-typings-0.0.3.tgz#8694287ebe2dd6c18a96667c38151d714d6ecbb6"
dependencies:
chai-typescript-typings "^0.0.0"
chai-as-promised@^7.1.0: chai-as-promised@^7.1.0:
version "7.1.1" version "7.1.1"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0"
@@ -1700,10 +1694,6 @@ chai-typescript-typings@^0.0.0:
version "0.0.0" version "0.0.0"
resolved "https://registry.yarnpkg.com/chai-typescript-typings/-/chai-typescript-typings-0.0.0.tgz#52e076d72cf29129c94ab1dba6e33ce3828a0724" resolved "https://registry.yarnpkg.com/chai-typescript-typings/-/chai-typescript-typings-0.0.0.tgz#52e076d72cf29129c94ab1dba6e33ce3828a0724"
chai-typescript-typings@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/chai-typescript-typings/-/chai-typescript-typings-0.0.1.tgz#433dee303b0b2978ad0dd03129df0a5afb791274"
chai@^4.0.1: chai@^4.0.1:
version "4.1.2" version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
@@ -1809,13 +1799,12 @@ clap@^1.0.9:
chalk "^1.1.3" chalk "^1.1.3"
class-utils@^0.3.5: class-utils@^0.3.5:
version "0.3.5" version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.5.tgz#17e793103750f9627b2176ea34cfd1b565903c80" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
dependencies: dependencies:
arr-union "^3.1.0" arr-union "^3.1.0"
define-property "^0.2.5" define-property "^0.2.5"
isobject "^3.0.0" isobject "^3.0.0"
lazy-cache "^2.0.2"
static-extend "^0.1.1" static-extend "^0.1.1"
classnames@^2.2.5: classnames@^2.2.5:
@@ -1982,9 +1971,9 @@ commander@2.9.0:
dependencies: dependencies:
graceful-readlink ">= 1.0.0" graceful-readlink ">= 1.0.0"
commander@^2.9.0: commander@^2.12.1, commander@^2.9.0:
version "2.12.2" version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
commondir@^1.0.1: commondir@^1.0.1:
version "1.0.1" version "1.0.1"
@@ -2805,8 +2794,8 @@ dns-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"
dns-packet@^1.0.1: dns-packet@^1.0.1:
version "1.2.2" version "1.3.0"
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.2.2.tgz#a8a26bec7646438963fc86e06f8f8b16d6c8bf7a" resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.0.tgz#7e2b33bf992678a44534c7117d39196bda684d33"
dependencies: dependencies:
ip "^1.1.0" ip "^1.1.0"
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
@@ -2870,9 +2859,9 @@ duplexer@^0.1.1, duplexer@~0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
duplexify@^3.1.2, duplexify@^3.4.2: duplexify@^3.4.2, duplexify@^3.5.3:
version "3.5.1" version "3.5.3"
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.3.tgz#8b5818800df92fd0125b27ab896491912858243e"
dependencies: dependencies:
end-of-stream "^1.0.0" end-of-stream "^1.0.0"
inherits "^2.0.1" inherits "^2.0.1"
@@ -2934,8 +2923,8 @@ encoding@^0.1.11:
iconv-lite "~0.4.13" iconv-lite "~0.4.13"
end-of-stream@^1.0.0, end-of-stream@^1.1.0: end-of-stream@^1.0.0, end-of-stream@^1.1.0:
version "1.4.0" version "1.4.1"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
dependencies: dependencies:
once "^1.4.0" once "^1.4.0"
@@ -5036,7 +5025,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
js-yaml@^3.6.1: js-yaml@^3.6.1, js-yaml@^3.7.0:
version "3.10.0" version "3.10.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
dependencies: dependencies:
@@ -5620,8 +5609,8 @@ log-driver@^1.2.5:
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056"
loglevel@^1.4.1: loglevel@^1.4.1:
version "1.6.0" version "1.6.1"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.0.tgz#ae0caa561111498c5ba13723d6fb631d24003934" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
lolex@^1.6.0: lolex@^1.6.0:
version "1.6.0" version "1.6.0"
@@ -6191,17 +6180,17 @@ node-pre-gyp@^0.6.39:
tar-pack "^3.4.0" tar-pack "^3.4.0"
nodemon@^1.11.0: nodemon@^1.11.0:
version "1.14.10" version "1.14.11"
resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.14.10.tgz#836d33ff0f89ad111b8d49e5e3b3cb872e36304e" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.14.11.tgz#cc0009dd8d82f126f3aba50ace7e753827a8cebc"
dependencies: dependencies:
chokidar "^1.7.0" chokidar "^2.0.0"
debug "^2.6.8" debug "^3.1.0"
ignore-by-default "^1.0.1" ignore-by-default "^1.0.1"
minimatch "^3.0.4" minimatch "^3.0.4"
pstree.remy "^1.1.0" pstree.remy "^1.1.0"
semver "^5.4.1" semver "^5.4.1"
touch "^3.1.0" touch "^3.1.0"
undefsafe "0.0.3" undefsafe "^2.0.1"
update-notifier "^2.3.0" update-notifier "^2.3.0"
noms@0.0.0: noms@0.0.0:
@@ -7175,13 +7164,20 @@ pump@^1.0.0:
end-of-stream "^1.1.0" end-of-stream "^1.1.0"
once "^1.3.1" once "^1.3.1"
pumpify@^1.3.3: pump@^2.0.0:
version "1.3.5" version "2.0.0"
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.5.tgz#1b671c619940abcaeac0ad0e3a3c164be760993b" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.0.tgz#7946da1c8d622b098e2ceb2d3476582470829c9d"
dependencies: dependencies:
duplexify "^3.1.2" end-of-stream "^1.1.0"
inherits "^2.0.1" once "^1.3.1"
pump "^1.0.0"
pumpify@^1.3.3:
version "1.3.6"
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.6.tgz#00d40e5ded0a3bf1e0788b1c0cf426a42882ab64"
dependencies:
duplexify "^3.5.3"
inherits "^2.0.3"
pump "^2.0.0"
punycode@1.3.2: punycode@1.3.2:
version "1.3.2" version "1.3.2"
@@ -7252,8 +7248,8 @@ randomatic@^1.1.3:
kind-of "^4.0.0" kind-of "^4.0.0"
randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
version "2.0.5" version "2.0.6"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80"
dependencies: dependencies:
safe-buffer "^5.1.0" safe-buffer "^5.1.0"
@@ -9091,7 +9087,7 @@ truffle@^4.0.1:
original-require "^1.0.1" original-require "^1.0.1"
solc "0.4.18" solc "0.4.18"
tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.1: tslib@^1.0.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
version "1.8.1" version "1.8.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac"
@@ -9115,7 +9111,7 @@ tslint-react@^3.0.0, tslint-react@^3.2.0:
dependencies: dependencies:
tsutils "^2.13.1" tsutils "^2.13.1"
tslint@5.8.0, tslint@^5.5.0: tslint@5.8.0:
version "5.8.0" version "5.8.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13" resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13"
dependencies: dependencies:
@@ -9131,6 +9127,23 @@ tslint@5.8.0, tslint@^5.5.0:
tslib "^1.7.1" tslib "^1.7.1"
tsutils "^2.12.1" tsutils "^2.12.1"
tslint@^5.5.0:
version "5.9.1"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae"
dependencies:
babel-code-frame "^6.22.0"
builtin-modules "^1.1.1"
chalk "^2.3.0"
commander "^2.12.1"
diff "^3.2.0"
glob "^7.1.1"
js-yaml "^3.7.0"
minimatch "^3.0.4"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.8.0"
tsutils "^2.12.1"
tsutils@^1.4.0: tsutils@^1.4.0:
version "1.9.1" version "1.9.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0"
@@ -9269,9 +9282,11 @@ unc-path-regex@^0.1.2:
version "0.1.2" version "0.1.2"
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
undefsafe@0.0.3: undefsafe@^2.0.1:
version "0.0.3" version "2.0.1"
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-0.0.3.tgz#ecca3a03e56b9af17385baac812ac83b994a962f" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.1.tgz#03b2f2a16c94556e14b2edef326cd66aaf82707a"
dependencies:
debug "^2.2.0"
underscore@1.8.3: underscore@1.8.3:
version "1.8.3" version "1.8.3"