Compare commits
37 Commits
0x.js@0.29
...
web3-types
Author | SHA1 | Date | |
---|---|---|---|
|
547bee38c0 | ||
|
60614ba250 | ||
|
278f68ae77 | ||
|
0e3bd0c6c1 | ||
|
86668eb7b9 | ||
|
771f65c858 | ||
|
89d6326a83 | ||
|
8b81ea162f | ||
|
a53e6db537 | ||
|
62e3feeb94 | ||
|
a950494503 | ||
|
3cb310122e | ||
|
feace988b4 | ||
|
6a56f20928 | ||
|
80a46d14be | ||
|
fbcbf066cd | ||
|
4d30e1115f | ||
|
897cfb491c | ||
|
c2c7512431 | ||
|
568cf4d182 | ||
|
f54330f1c5 | ||
|
97e01d7a42 | ||
|
4be3e000e1 | ||
|
b47baa9ee1 | ||
|
f6c98112df | ||
|
94d29ab22e | ||
|
b0b179550a | ||
|
41c7ab4f9c | ||
|
432c7c63fe | ||
|
2bba1ae292 | ||
|
7830d518e0 | ||
|
571b3c4da8 | ||
|
5b6f8d4c3f | ||
|
ae57b21b98 | ||
|
292c3bbff8 | ||
|
065570ebf5 | ||
|
1f5dfd71d5 |
27
README.md
27
README.md
@@ -18,18 +18,21 @@ This repository contains all the 0x developer tools written in TypeScript. Our h
|
||||
|
||||
### Published Packages
|
||||
|
||||
| Package | Version | Description |
|
||||
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
||||
| [`0x.js`](/packages/0x.js) | [](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
|
||||
| [`@0xproject/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0xproject/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0xproject/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api |
|
||||
| [`@0xproject/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
|
||||
| [`@0xproject/subproviders`](/packages/subproviders) | [](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
|
||||
| [`@0xproject/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
|
||||
| [`@0xproject/types`](/packages/types) | [](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
|
||||
| [`@0xproject/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
|
||||
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper |
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
||||
| [`0x.js`](/packages/0x.js) | [](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
|
||||
| [`chai-as-promised-typescript-typings`](/packages/chai-as-promised-typescript-typings) | [](https://www.npmjs.com/package/chai-as-promised-typescript-typings) | Chai as promised typescript typings |
|
||||
| [`chai-typescript-typings`](/packages/chai-typescript-typings) | [](https://www.npmjs.com/package/chai-typescript-typings) | Chai typescript typings |
|
||||
| [`web3-typescript-typings`](/packages/web3-typescript-typings) | [](https://www.npmjs.com/package/web3-typescript-typings) | Web3 typescript typings |
|
||||
| [`@0xproject/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0xproject/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0xproject/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api |
|
||||
| [`@0xproject/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas |
|
||||
| [`@0xproject/subproviders`](/packages/subproviders) | [](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) |
|
||||
| [`@0xproject/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules |
|
||||
| [`@0xproject/types`](/packages/types) | [](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
|
||||
| [`@0xproject/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities |
|
||||
| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | |
|
||||
|
||||
### Private Packages
|
||||
|
||||
|
@@ -1,5 +1,11 @@
|
||||
# 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_
|
||||
|
||||
* Fixed bignumber config issue #301 (#305)
|
||||
|
@@ -1,29 +1,27 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "0.29.1",
|
||||
"version": "0.29.2",
|
||||
"description": "A javascript library for interacting with the 0x protocol",
|
||||
"keywords": [
|
||||
"0x.js",
|
||||
"0xproject",
|
||||
"ethereum",
|
||||
"tokens",
|
||||
"exchange"
|
||||
],
|
||||
"keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
|
||||
"main": "lib/src/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
"scripts": {
|
||||
"prebuild": "run-s clean generate_contract_wrappers",
|
||||
"build": "run-p build:umd:prod build:commonjs; exit 0;",
|
||||
"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",
|
||||
"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",
|
||||
"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",
|
||||
"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'",
|
||||
"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:umd": "./scripts/test_umd.sh",
|
||||
"test:coverage": "nyc npm run test --all",
|
||||
"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",
|
||||
"build:umd:dev": "webpack",
|
||||
"build:umd:prod": "NODE_ENV=production webpack",
|
||||
@@ -45,7 +43,7 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.1.0",
|
||||
"@0xproject/abi-gen": "^0.1.1",
|
||||
"@0xproject/dev-utils": "^0.0.4",
|
||||
"@0xproject/tslint-config": "^0.4.1",
|
||||
"@0xproject/types": "^0.1.3",
|
||||
@@ -80,14 +78,14 @@
|
||||
"typedoc": "~0.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-provider-engine": "^13.0.1",
|
||||
"web3-typescript-typings": "^0.9.1",
|
||||
"web3-typescript-typings": "^0.9.3",
|
||||
"webpack": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.0.10",
|
||||
"@0xproject/json-schemas": "^0.7.2",
|
||||
"@0xproject/utils": "^0.1.3",
|
||||
"@0xproject/web3-wrapper": "^0.1.3",
|
||||
"@0xproject/web3-wrapper": "^0.1.4",
|
||||
"bintrees": "^1.0.2",
|
||||
"bn.js": "^4.11.8",
|
||||
"compare-versions": "^3.0.1",
|
||||
|
@@ -8,26 +8,21 @@ const S3BucketPath = 's3://0xjs-docs-jsons/';
|
||||
|
||||
let tag;
|
||||
let version;
|
||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
postpublish_utils
|
||||
.getLatestTagAndVersionAsync(subPackageName)
|
||||
.then(function(result) {
|
||||
tag = result.tag;
|
||||
version = result.version;
|
||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||
const assets = [
|
||||
__dirname + '/../_bundles/index.js',
|
||||
__dirname + '/../_bundles/index.min.js',
|
||||
];
|
||||
return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
|
||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||
const assets = [__dirname + '/../_bundles/index.js', __dirname + '/../_bundles/index.min.js'];
|
||||
return postpublish_utils.publishReleaseNotes(tag, releaseName, assets);
|
||||
})
|
||||
.then(function(release) {
|
||||
console.log('POSTPUBLISH: Release successful, generating docs...');
|
||||
const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
|
||||
return execAsync(
|
||||
'JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json',
|
||||
{
|
||||
cwd,
|
||||
}
|
||||
);
|
||||
return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
|
||||
cwd,
|
||||
});
|
||||
})
|
||||
.then(function(result) {
|
||||
if (result.stderr !== '') {
|
||||
@@ -39,6 +34,7 @@ postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
|
||||
cwd,
|
||||
});
|
||||
}).catch (function(err) {
|
||||
})
|
||||
.catch(function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
@@ -302,26 +302,33 @@ export class ZeroEx {
|
||||
|
||||
const txReceiptPromise = new Promise(
|
||||
(resolve: (receipt: TransactionReceiptWithDecodedLogs) => void, reject) => {
|
||||
const intervalId = intervalUtils.setAsyncExcludingInterval(async () => {
|
||||
if (timeoutExceeded) {
|
||||
intervalUtils.clearAsyncExcludingInterval(intervalId);
|
||||
return reject(ZeroExError.TransactionMiningTimeout);
|
||||
}
|
||||
const intervalId = intervalUtils.setAsyncExcludingInterval(
|
||||
async () => {
|
||||
if (timeoutExceeded) {
|
||||
intervalUtils.clearAsyncExcludingInterval(intervalId);
|
||||
return reject(ZeroExError.TransactionMiningTimeout);
|
||||
}
|
||||
|
||||
const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash);
|
||||
if (!_.isNull(transactionReceipt)) {
|
||||
const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash);
|
||||
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);
|
||||
const logsWithDecodedArgs = _.map(
|
||||
transactionReceipt.logs,
|
||||
this._abiDecoder.tryToDecodeLogOrNoop.bind(this._abiDecoder),
|
||||
);
|
||||
const transactionReceiptWithDecodedLogArgs: TransactionReceiptWithDecodedLogs = {
|
||||
...transactionReceipt,
|
||||
logs: logsWithDecodedArgs,
|
||||
};
|
||||
resolve(transactionReceiptWithDecodedLogArgs);
|
||||
}
|
||||
}, pollingIntervalMs);
|
||||
reject(err);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
@@ -167,6 +167,7 @@ export class ContractWrapper {
|
||||
this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval(
|
||||
this._reconcileBlockAsync.bind(this),
|
||||
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
|
||||
this._onReconcileBlockError.bind(this),
|
||||
);
|
||||
let isRemoved = false;
|
||||
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
|
||||
@@ -177,6 +178,12 @@ export class ContractWrapper {
|
||||
this._onLogStateChanged.bind(this, isRemoved),
|
||||
);
|
||||
}
|
||||
private _onReconcileBlockError(err: Error): void {
|
||||
const filterTokens = _.keys(this._filterCallbacks);
|
||||
_.each(filterTokens, filterToken => {
|
||||
this._unsubscribe(filterToken, err);
|
||||
});
|
||||
}
|
||||
private _setNetworkId(networkId: number): void {
|
||||
this._networkId = networkId;
|
||||
}
|
||||
@@ -190,18 +197,11 @@ export class ContractWrapper {
|
||||
delete this._blockAndLogStreamerIfExists;
|
||||
}
|
||||
private async _reconcileBlockAsync(): Promise<void> {
|
||||
try {
|
||||
const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest);
|
||||
// We need to coerce to Block type cause Web3.Block includes types for mempool blocks
|
||||
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
// If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined
|
||||
await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
|
||||
}
|
||||
} catch (err) {
|
||||
const filterTokens = _.keys(this._filterCallbacks);
|
||||
_.each(filterTokens, filterToken => {
|
||||
this._unsubscribe(filterToken, err);
|
||||
});
|
||||
const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest);
|
||||
// We need to coerce to Block type cause Web3.Block includes types for mempool blocks
|
||||
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
// If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined
|
||||
await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -258,16 +258,18 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
? SHOULD_VALIDATE_BY_DEFAULT
|
||||
: orderTransactionOpts.shouldValidate;
|
||||
if (shouldValidate) {
|
||||
let filledTakerTokenAmount = new BigNumber(0);
|
||||
const zrxTokenAddress = this.getZRXTokenAddress();
|
||||
const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
|
||||
for (const signedOrder of signedOrders) {
|
||||
await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
|
||||
const singleFilledTakerTokenAmount = await this._orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
|
||||
exchangeTradeEmulator,
|
||||
signedOrder,
|
||||
fillTakerTokenAmount,
|
||||
fillTakerTokenAmount.minus(filledTakerTokenAmount),
|
||||
takerAddress,
|
||||
zrxTokenAddress,
|
||||
);
|
||||
filledTakerTokenAmount = filledTakerTokenAmount.plus(singleFilledTakerTokenAmount);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
packages/0x.js/src/globals.d.ts
vendored
2
packages/0x.js/src/globals.d.ts
vendored
@@ -1,5 +1,3 @@
|
||||
/// <reference types='chai-typescript-typings' />
|
||||
/// <reference types='chai-as-promised-typescript-typings' />
|
||||
declare module 'web3_beta';
|
||||
declare module 'chai-bignumber';
|
||||
declare module 'dirty-chai';
|
||||
|
@@ -36,6 +36,10 @@ export class EventWatcher {
|
||||
this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._pollForBlockchainEventsAsync.bind(this, callback),
|
||||
this._pollingIntervalMs,
|
||||
(err: Error) => {
|
||||
this.unsubscribe();
|
||||
callback(err);
|
||||
},
|
||||
);
|
||||
}
|
||||
public unsubscribe(): void {
|
||||
@@ -78,7 +82,7 @@ export class EventWatcher {
|
||||
...log,
|
||||
};
|
||||
if (!_.isUndefined(this._intervalIdIfExists)) {
|
||||
callback(logEvent);
|
||||
callback(null, logEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,16 +30,17 @@ export class ExpirationWatcher {
|
||||
if (!_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) {
|
||||
throw new Error(ZeroExError.SubscriptionAlreadyPresent);
|
||||
}
|
||||
this._orderExpirationCheckingIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._orderExpirationCheckingIntervalIdIfExists = intervalUtils.setInterval(
|
||||
this._pruneExpiredOrders.bind(this, callback),
|
||||
this._orderExpirationCheckingIntervalMs,
|
||||
_.noop, // _pruneExpiredOrders never throws
|
||||
);
|
||||
}
|
||||
public unsubscribe(): void {
|
||||
if (_.isUndefined(this._orderExpirationCheckingIntervalIdIfExists)) {
|
||||
throw new Error(ZeroExError.SubscriptionNotFound);
|
||||
}
|
||||
intervalUtils.clearAsyncExcludingInterval(this._orderExpirationCheckingIntervalIdIfExists);
|
||||
intervalUtils.clearInterval(this._orderExpirationCheckingIntervalIdIfExists);
|
||||
delete this._orderExpirationCheckingIntervalIdIfExists;
|
||||
}
|
||||
public addOrder(orderHash: string, expirationUnixTimestampMs: BigNumber): void {
|
||||
|
@@ -155,6 +155,10 @@ export class OrderStateWatcher {
|
||||
this._cleanupJobIntervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._cleanupAsync.bind(this),
|
||||
this._cleanupJobInterval,
|
||||
(err: Error) => {
|
||||
this.unsubscribe();
|
||||
callback(err);
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
@@ -207,11 +211,19 @@ export class OrderStateWatcher {
|
||||
if (!_.isUndefined(this._orderByOrderHash[orderHash])) {
|
||||
this.removeOrder(orderHash);
|
||||
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 isLogDecoded = !_.isUndefined((maybeDecodedLog as LogWithDecodedArgs<any>).event);
|
||||
if (!isLogDecoded) {
|
||||
@@ -332,7 +344,7 @@ export class OrderStateWatcher {
|
||||
} else {
|
||||
this._orderStateByOrderHashCache[orderHash] = orderState;
|
||||
}
|
||||
this._callbackIfExists(orderState);
|
||||
this._callbackIfExists(null, orderState);
|
||||
}
|
||||
}
|
||||
private _addToDependentOrderHashes(signedOrder: SignedOrder, orderHash: string): void {
|
||||
|
@@ -51,7 +51,7 @@ export interface DecodedLogEvent<ArgsType> {
|
||||
}
|
||||
|
||||
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 {
|
||||
Address = 'address',
|
||||
@@ -406,5 +406,5 @@ export interface 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
|
||||
|
@@ -10,6 +10,7 @@ import { EventWatcher } from '../src/order_watcher/event_watcher';
|
||||
import { DoneCallback } from '../src/types';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { reportNodeCallbackErrors } from './utils/report_callback_errors';
|
||||
import { web3Factory } from './utils/web3_factory';
|
||||
|
||||
chaiSetup.configure();
|
||||
@@ -77,13 +78,14 @@ describe('EventWatcher', () => {
|
||||
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
|
||||
getLogsStub.onCall(0).returns(logs);
|
||||
stubs.push(getLogsStub);
|
||||
const callback = (event: LogEvent) => {
|
||||
const expectedToBeCalledOnce = false;
|
||||
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
|
||||
const expectedLogEvent = expectedLogEvents.shift();
|
||||
expect(event).to.be.deep.equal(expectedLogEvent);
|
||||
if (_.isEmpty(expectedLogEvents)) {
|
||||
done();
|
||||
}
|
||||
};
|
||||
});
|
||||
eventWatcher.subscribe(callback);
|
||||
});
|
||||
it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
|
||||
@@ -111,13 +113,14 @@ describe('EventWatcher', () => {
|
||||
getLogsStub.onCall(0).returns(initialLogs);
|
||||
getLogsStub.onCall(1).returns(changedLogs);
|
||||
stubs.push(getLogsStub);
|
||||
const callback = (event: LogEvent) => {
|
||||
const expectedToBeCalledOnce = false;
|
||||
const callback = reportNodeCallbackErrors(done, expectedToBeCalledOnce)((event: LogEvent) => {
|
||||
const expectedLogEvent = expectedLogEvents.shift();
|
||||
expect(event).to.be.deep.equal(expectedLogEvent);
|
||||
if (_.isEmpty(expectedLogEvents)) {
|
||||
done();
|
||||
}
|
||||
};
|
||||
});
|
||||
eventWatcher.subscribe(callback);
|
||||
});
|
||||
});
|
||||
|
@@ -536,7 +536,7 @@ describe('ExchangeWrapper', () => {
|
||||
),
|
||||
).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(
|
||||
signedOrders,
|
||||
fillUpToAmount,
|
||||
@@ -550,6 +550,37 @@ describe('ExchangeWrapper', () => {
|
||||
const remainingFillAmount = fillableAmount.minus(1);
|
||||
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', () => {
|
||||
const emptyFillUpToAmount = new BigNumber(0);
|
||||
|
@@ -20,7 +20,7 @@ import { DoneCallback } from '../src/types';
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { constants } from './utils/constants';
|
||||
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 { web3Factory } from './utils/web3_factory';
|
||||
|
||||
@@ -134,7 +134,7 @@ describe('OrderStateWatcher', () => {
|
||||
);
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.false();
|
||||
const invalidOrderState = orderState as OrderStateInvalid;
|
||||
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -154,7 +154,7 @@ describe('OrderStateWatcher', () => {
|
||||
fillableAmount,
|
||||
);
|
||||
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');
|
||||
});
|
||||
zeroEx.orderStateWatcher.subscribe(callback);
|
||||
@@ -178,7 +178,7 @@ describe('OrderStateWatcher', () => {
|
||||
);
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.false();
|
||||
const invalidOrderState = orderState as OrderStateInvalid;
|
||||
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -202,7 +202,7 @@ describe('OrderStateWatcher', () => {
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.false();
|
||||
const invalidOrderState = orderState as OrderStateInvalid;
|
||||
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -234,7 +234,7 @@ describe('OrderStateWatcher', () => {
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.true();
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
expect(validOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -273,7 +273,7 @@ describe('OrderStateWatcher', () => {
|
||||
fillableAmount,
|
||||
taker,
|
||||
);
|
||||
const callback = reportNoErrorCallbackErrors(done)();
|
||||
const callback = reportNodeCallbackErrors(done)();
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
zeroEx.orderStateWatcher.subscribe(callback);
|
||||
await zeroEx.token.setProxyAllowanceAsync(zrxTokenAddress, maker, new BigNumber(0));
|
||||
@@ -295,7 +295,7 @@ describe('OrderStateWatcher', () => {
|
||||
const fillAmountInBaseUnits = ZeroEx.toBaseUnitAmount(new BigNumber(2), decimals);
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.true();
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
expect(validOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -330,7 +330,7 @@ describe('OrderStateWatcher', () => {
|
||||
const changedMakerApprovalAmount = ZeroEx.toBaseUnitAmount(new BigNumber(3), decimals);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
const orderRelevantState = validOrderState.orderRelevantState;
|
||||
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
|
||||
@@ -360,7 +360,7 @@ describe('OrderStateWatcher', () => {
|
||||
const transferAmount = makerBalance.sub(remainingAmount);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.true();
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
const orderRelevantState = validOrderState.orderRelevantState;
|
||||
@@ -395,7 +395,7 @@ describe('OrderStateWatcher', () => {
|
||||
const transferTokenAmount = makerFee.sub(remainingTokenAmount);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.true();
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
const orderRelevantState = validOrderState.orderRelevantState;
|
||||
@@ -429,7 +429,7 @@ describe('OrderStateWatcher', () => {
|
||||
const transferTokenAmount = makerFee.sub(remainingTokenAmount);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
const orderRelevantState = validOrderState.orderRelevantState;
|
||||
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
|
||||
@@ -464,7 +464,7 @@ describe('OrderStateWatcher', () => {
|
||||
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
const orderRelevantState = validOrderState.orderRelevantState;
|
||||
expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal(
|
||||
@@ -492,7 +492,7 @@ describe('OrderStateWatcher', () => {
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.false();
|
||||
const invalidOrderState = orderState as OrderStateInvalid;
|
||||
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -516,7 +516,7 @@ describe('OrderStateWatcher', () => {
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.false();
|
||||
const invalidOrderState = orderState as OrderStateInvalid;
|
||||
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
|
||||
@@ -543,7 +543,7 @@ describe('OrderStateWatcher', () => {
|
||||
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
|
||||
zeroEx.orderStateWatcher.addOrder(signedOrder);
|
||||
|
||||
const callback = reportNoErrorCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
expect(orderState.isValid).to.be.true();
|
||||
const validOrderState = orderState as OrderStateValid;
|
||||
expect(validOrderState.orderHash).to.be.equal(orderHash);
|
||||
|
@@ -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) => {
|
||||
const wrapped = (error: Error | null, value: T | undefined) => {
|
||||
if (!_.isNull(error)) {
|
||||
@@ -37,7 +37,9 @@ export const reportNodeCallbackErrors = (done: DoneCallback) => {
|
||||
}
|
||||
try {
|
||||
f(value as T);
|
||||
done();
|
||||
if (expectToBeCalledOnce) {
|
||||
done();
|
||||
}
|
||||
} catch (err) {
|
||||
done(err);
|
||||
}
|
||||
|
@@ -7,10 +7,10 @@ const path = require('path');
|
||||
const production = process.env.NODE_ENV === 'production';
|
||||
|
||||
let entry = {
|
||||
'index': './src/index.ts',
|
||||
index: './src/index.ts',
|
||||
};
|
||||
if (production) {
|
||||
entry = _.assign({}, entry, {'index.min': './src/index.ts'});
|
||||
entry = _.assign({}, entry, { 'index.min': './src/index.ts' });
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/abi-gen",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Generate contract wrappers from ABI and handlebars templates",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -43,6 +43,6 @@
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1"
|
||||
"web3-typescript-typings": "^0.9.3"
|
||||
}
|
||||
}
|
||||
|
@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
|
||||
|
||||
const subPackageName = packageJSON.name;
|
||||
|
||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
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) {
|
||||
.catch(function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
|
||||
|
||||
const subPackageName = packageJSON.name;
|
||||
|
||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
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) {
|
||||
.catch(function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
@@ -0,0 +1,3 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.x.x - _TBD, 2018_
|
43
packages/chai-as-promised-typescript-typings/README.md
Normal file
43
packages/chai-as-promised-typescript-typings/README.md
Normal 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
|
||||
```
|
268
packages/chai-as-promised-typescript-typings/index.d.ts
vendored
Normal file
268
packages/chai-as-promised-typescript-typings/index.d.ts
vendored
Normal 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>;
|
||||
}
|
||||
}
|
21
packages/chai-as-promised-typescript-typings/package.json
Normal file
21
packages/chai-as-promised-typescript-typings/package.json
Normal 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"
|
||||
}
|
||||
}
|
@@ -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;
|
||||
});
|
3
packages/chai-as-promised-typescript-typings/tslint.json
Normal file
3
packages/chai-as-promised-typescript-typings/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["tslint-config-0xproject"]
|
||||
}
|
3
packages/chai-typescript-typings/CHANGELOG.md
Normal file
3
packages/chai-typescript-typings/CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.x.x - _TBD, 2018_
|
43
packages/chai-typescript-typings/README.md
Normal file
43
packages/chai-typescript-typings/README.md
Normal 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
|
||||
```
|
1254
packages/chai-typescript-typings/index.d.ts
vendored
Normal file
1254
packages/chai-typescript-typings/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
16
packages/chai-typescript-typings/package.json
Normal file
16
packages/chai-typescript-typings/package.json
Normal 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"
|
||||
}
|
15
packages/chai-typescript-typings/scripts/postpublish.js
Normal file
15
packages/chai-typescript-typings/scripts/postpublish.js
Normal 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;
|
||||
});
|
3
packages/chai-typescript-typings/tslint.json
Normal file
3
packages/chai-typescript-typings/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["tslint-config-0xproject"]
|
||||
}
|
@@ -1,6 +1,12 @@
|
||||
# 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)
|
||||
|
||||
|
@@ -1,21 +1,16 @@
|
||||
{
|
||||
"name": "@0xproject/connect",
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"description": "A javascript library for interacting with the standard relayer api",
|
||||
"keywords": [
|
||||
"connect",
|
||||
"0xproject",
|
||||
"ethereum",
|
||||
"tokens",
|
||||
"exchange"
|
||||
],
|
||||
"keywords": ["connect", "0xproject", "ethereum", "tokens", "exchange"],
|
||||
"main": "lib/src/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "shx rm -rf _bundles lib test_temp",
|
||||
"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",
|
||||
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
||||
"run_mocha": "mocha lib/test/**/*_test.js",
|
||||
@@ -64,6 +59,6 @@
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "~0.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1"
|
||||
"web3-typescript-typings": "^0.9.3"
|
||||
}
|
||||
}
|
||||
|
@@ -8,22 +8,20 @@ const S3BucketPath = 's3://connect-docs-jsons/';
|
||||
|
||||
let tag;
|
||||
let version;
|
||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
postpublish_utils
|
||||
.getLatestTagAndVersionAsync(subPackageName)
|
||||
.then(function(result) {
|
||||
tag = result.tag;
|
||||
version = result.version;
|
||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||
return postpublish_utils.publishReleaseNotes(tag, releaseName);
|
||||
const releaseName = postpublish_utils.getReleaseName(subPackageName, version);
|
||||
return postpublish_utils.publishReleaseNotes(tag, releaseName);
|
||||
})
|
||||
.then(function(release) {
|
||||
console.log('POSTPUBLISH: Release successful, generating docs...');
|
||||
const jsonFilePath = __dirname + '/../' + postpublish_utils.generatedDocsDirectoryName + '/index.json';
|
||||
return execAsync(
|
||||
'JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json',
|
||||
{
|
||||
cwd,
|
||||
}
|
||||
);
|
||||
return execAsync('JSON_FILE_PATH=' + jsonFilePath + ' PROJECT_DIR=' + __dirname + '/.. yarn docs:json', {
|
||||
cwd,
|
||||
});
|
||||
})
|
||||
.then(function(result) {
|
||||
if (result.stderr !== '') {
|
||||
@@ -35,6 +33,7 @@ postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', {
|
||||
cwd,
|
||||
});
|
||||
}).catch (function(err) {
|
||||
})
|
||||
.catch(function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
@@ -20,6 +20,7 @@ import {
|
||||
} from './types';
|
||||
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
|
||||
* that implement the standard relayer API v0
|
||||
@@ -33,7 +34,7 @@ export class HttpClient implements Client {
|
||||
*/
|
||||
constructor(url: string) {
|
||||
assert.isHttpUrl('url', url);
|
||||
this._apiEndpointUrl = url;
|
||||
this._apiEndpointUrl = url.replace(TRAILING_SLASHES_REGEX, ''); // remove trailing slashes
|
||||
}
|
||||
/**
|
||||
* Retrieve token pair info from the API
|
||||
@@ -130,20 +131,22 @@ export class HttpClient implements Client {
|
||||
const stringifiedParams = queryString.stringify(params);
|
||||
query = `?${stringifiedParams}`;
|
||||
}
|
||||
const url = `${this._apiEndpointUrl}/v0${path}${query}`;
|
||||
const url = `${this._apiEndpointUrl}${path}${query}`;
|
||||
const headers = new Headers({
|
||||
'content-type': 'application/json',
|
||||
});
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: requestType,
|
||||
body: JSON.stringify(payload),
|
||||
headers,
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw Error(response.statusText);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -29,14 +29,23 @@ describe('HttpClient', () => {
|
||||
afterEach(() => {
|
||||
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', () => {
|
||||
const url = `${relayUrl}/v0/token_pairs`;
|
||||
const url = `${relayUrl}/token_pairs`;
|
||||
it('gets token pairs', async () => {
|
||||
fetchMock.get(url, tokenPairsResponseJSON);
|
||||
const tokenPairs = await relayerClient.getTokenPairsAsync();
|
||||
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 tokenPairsRequest = {
|
||||
tokenA: tokenAddress,
|
||||
@@ -52,7 +61,7 @@ describe('HttpClient', () => {
|
||||
});
|
||||
});
|
||||
describe('#getOrdersAsync', () => {
|
||||
const url = `${relayUrl}/v0/orders`;
|
||||
const url = `${relayUrl}/orders`;
|
||||
it('gets orders', async () => {
|
||||
fetchMock.get(url, ordersResponseJSON);
|
||||
const orders = await relayerClient.getOrdersAsync();
|
||||
@@ -75,7 +84,7 @@ describe('HttpClient', () => {
|
||||
});
|
||||
describe('#getOrderAsync', () => {
|
||||
const orderHash = '0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
|
||||
const url = `${relayUrl}/v0/order/${orderHash}`;
|
||||
const url = `${relayUrl}/order/${orderHash}`;
|
||||
it('gets order', async () => {
|
||||
fetchMock.get(url, orderResponseJSON);
|
||||
const order = await relayerClient.getOrderAsync(orderHash);
|
||||
@@ -91,7 +100,7 @@ describe('HttpClient', () => {
|
||||
baseTokenAddress: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
|
||||
quoteTokenAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
|
||||
};
|
||||
const url = `${relayUrl}/v0/orderbook?baseTokenAddress=${request.baseTokenAddress}"eTokenAddress=${
|
||||
const url = `${relayUrl}/orderbook?baseTokenAddress=${request.baseTokenAddress}"eTokenAddress=${
|
||||
request.quoteTokenAddress
|
||||
}`;
|
||||
it('gets order book', async () => {
|
||||
@@ -116,7 +125,7 @@ describe('HttpClient', () => {
|
||||
salt: new BigNumber('256'),
|
||||
expirationUnixTimestampSec: new BigNumber('42'),
|
||||
};
|
||||
const url = `${relayUrl}/v0/fees`;
|
||||
const url = `${relayUrl}/fees`;
|
||||
it('gets fees', async () => {
|
||||
fetchMock.post(url, feesResponseJSON);
|
||||
const fees = await relayerClient.getFeesAsync(request);
|
||||
|
@@ -1,14 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "contracts",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.3",
|
||||
"description": "Smart contract components of 0x protocol",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"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",
|
||||
"compile": "npm run build; node lib/deploy/cli.js compile",
|
||||
"clean": "rm -rf ./lib",
|
||||
@@ -51,14 +52,14 @@
|
||||
"types-bn": "^0.0.1",
|
||||
"types-ethereumjs-util": "0xProject/types-ethereumjs-util",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1",
|
||||
"web3-typescript-typings": "^0.9.3",
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"0x.js": "^0.29.1",
|
||||
"0x.js": "^0.29.2",
|
||||
"@0xproject/json-schemas": "^0.7.2",
|
||||
"@0xproject/utils": "^0.1.3",
|
||||
"@0xproject/web3-wrapper": "^0.1.3",
|
||||
"@0xproject/web3-wrapper": "^0.1.4",
|
||||
"bluebird": "^3.5.0",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereumjs-abi": "^0.6.4",
|
||||
|
15
packages/dev-utils/scripts/postpublish.js
Normal file
15
packages/dev-utils/scripts/postpublish.js
Normal 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;
|
||||
});
|
@@ -3,12 +3,13 @@ const packageJSON = require('../package.json');
|
||||
|
||||
const subPackageName = packageJSON.name;
|
||||
|
||||
postpublish_utils.getLatestTagAndVersionAsync(subPackageName)
|
||||
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) {
|
||||
.catch(function(err) {
|
||||
throw err;
|
||||
});
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@0xproject/kovan_faucets",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "A faucet micro-service that dispenses test ERC20 tokens or Ether",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
@@ -14,7 +14,7 @@
|
||||
"author": "Fabio Berger",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"0x.js": "^0.29.1",
|
||||
"0x.js": "^0.29.2",
|
||||
"@0xproject/utils": "^0.1.3",
|
||||
"body-parser": "^1.17.1",
|
||||
"ethereumjs-tx": "^1.3.3",
|
||||
@@ -36,7 +36,7 @@
|
||||
"source-map-loader": "^0.1.6",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1",
|
||||
"web3-typescript-typings": "^0.9.3",
|
||||
"webpack": "^3.1.0",
|
||||
"webpack-node-externals": "^1.6.0"
|
||||
}
|
||||
|
15
packages/kovan-faucets/scripts/postpublish.js
Normal file
15
packages/kovan-faucets/scripts/postpublish.js
Normal 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;
|
||||
});
|
@@ -12,9 +12,9 @@ export const errorReporter = {
|
||||
|
||||
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}`);
|
||||
this.report(err);
|
||||
await this.reportAsync(err);
|
||||
process.exit(1);
|
||||
});
|
||||
},
|
||||
|
15
packages/monorepo-scripts/scripts/postpublish.js
Normal file
15
packages/monorepo-scripts/scripts/postpublish.js
Normal 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;
|
||||
});
|
2
packages/subproviders/src/globals.d.ts
vendored
2
packages/subproviders/src/globals.d.ts
vendored
@@ -1,5 +1,3 @@
|
||||
/// <reference types='chai-typescript-typings' />
|
||||
/// <reference types='chai-as-promised-typescript-typings' />
|
||||
declare module 'dirty-chai';
|
||||
declare module 'es6-promisify';
|
||||
|
||||
|
@@ -8,22 +8,12 @@
|
||||
"clean": "shx rm -rf lib",
|
||||
"lint": "tslint --project . 'rules/**/*.ts'"
|
||||
},
|
||||
"files": [
|
||||
"tslint.js",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"files": ["tslint.js", "README.md", "LICENSE"],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/0xProject/0x.js.git"
|
||||
},
|
||||
"keywords": [
|
||||
"tslint",
|
||||
"config",
|
||||
"0xProject",
|
||||
"typescript",
|
||||
"ts"
|
||||
],
|
||||
"keywords": ["tslint", "config", "0xProject", "typescript", "ts"],
|
||||
"author": {
|
||||
"name": "Fabio Berger",
|
||||
"email": "fabio@0xproject.com"
|
||||
|
@@ -1,3 +1,6 @@
|
||||
# CHANGELOG
|
||||
|
||||
## vx.x.x
|
||||
## v0.2.0 - _January 17, 2018_
|
||||
|
||||
* Add `onError` parameter to `intervalUtils.setAsyncExcludingInterval` (#312)
|
||||
* Add `intervalUtils.setInterval` (#312)
|
||||
|
@@ -1,14 +1,18 @@
|
||||
import * as _ from 'lodash';
|
||||
|
||||
export const intervalUtils = {
|
||||
setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number) {
|
||||
setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number, onError: (err: Error) => void) {
|
||||
let locked = false;
|
||||
const intervalId = setInterval(async () => {
|
||||
if (locked) {
|
||||
return;
|
||||
} else {
|
||||
locked = true;
|
||||
await fn();
|
||||
try {
|
||||
await fn();
|
||||
} catch (err) {
|
||||
onError(err);
|
||||
}
|
||||
locked = false;
|
||||
}
|
||||
}, intervalMs);
|
||||
@@ -17,4 +21,17 @@ export const intervalUtils = {
|
||||
clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void {
|
||||
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);
|
||||
},
|
||||
};
|
||||
|
6
packages/web3-typescript-typings/CHANGELOG.md
Normal file
6
packages/web3-typescript-typings/CHANGELOG.md
Normal 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)
|
3
packages/web3-typescript-typings/index.d.ts
vendored
3
packages/web3-typescript-typings/index.d.ts
vendored
@@ -107,6 +107,7 @@ declare module 'web3' {
|
||||
|
||||
interface Contract<A extends ContractInstance> {
|
||||
at(address: string): A;
|
||||
getData(...args: any[]): string;
|
||||
'new'(...args: any[]): A;
|
||||
}
|
||||
|
||||
@@ -169,7 +170,7 @@ declare module 'web3' {
|
||||
gasPrice: BigNumber.BigNumber;
|
||||
accounts: string[];
|
||||
blockNumber: number;
|
||||
defaultAccount: string;
|
||||
defaultAccount?: string;
|
||||
defaultBlock: Web3.BlockParam;
|
||||
syncing: Web3.SyncingResult;
|
||||
compile: {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "web3-typescript-typings",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.3",
|
||||
"description": "Typescript type definitions for web3",
|
||||
"main": "index.d.ts",
|
||||
"types": "index.d.ts",
|
||||
@@ -9,17 +9,15 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/0xProject/web3-typescript-typings.git"
|
||||
"url": "git+https://github.com/0xProject/0x.js.git"
|
||||
},
|
||||
"author": "Fabio Berger",
|
||||
"contributors": [
|
||||
"Leonid Logvinov <logvinov.leon@gmail.com>"
|
||||
],
|
||||
"contributors": ["Leonid Logvinov <logvinov.leon@gmail.com>"],
|
||||
"license": "Apache-2.0",
|
||||
"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": {
|
||||
"@types/bignumber.js": "^4.0.2",
|
||||
"tslint": "^5.5.0",
|
||||
|
15
packages/web3-typescript-typings/scripts/postpublish.js
Normal file
15
packages/web3-typescript-typings/scripts/postpublish.js
Normal 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;
|
||||
});
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/web3-wrapper",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"description": "Wraps around web3 and gives a nicer interface",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -26,7 +26,7 @@
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1"
|
||||
"web3-typescript-typings": "^0.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/utils": "^0.1.3",
|
||||
|
5
packages/website/CHANGELOG.md
Normal file
5
packages/website/CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v0.x.x - _TBD_
|
||||
|
||||
* Added new team members to the about page (#317)
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/website",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"private": true,
|
||||
"description": "Website and 0x portal dapp",
|
||||
"scripts": {
|
||||
@@ -8,9 +8,12 @@
|
||||
"clean": "shx rm -f public/bundle*",
|
||||
"lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
|
||||
"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;",
|
||||
"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"
|
||||
"update_contracts":
|
||||
"for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../website/contracts; done;",
|
||||
"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": {
|
||||
"artifacts": "Mintable"
|
||||
@@ -18,7 +21,7 @@
|
||||
"author": "Fabio Berger",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"0x.js": "^0.29.1",
|
||||
"0x.js": "^0.29.2",
|
||||
"@0xproject/subproviders": "^0.3.0",
|
||||
"@0xproject/utils": "^0.1.3",
|
||||
"accounting": "^0.4.1",
|
||||
@@ -98,7 +101,7 @@
|
||||
"style-loader": "0.13.x",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "~2.6.1",
|
||||
"web3-typescript-typings": "^0.9.1",
|
||||
"web3-typescript-typings": "^0.9.3",
|
||||
"webpack": "^3.1.0",
|
||||
"webpack-dev-middleware": "^1.10.0",
|
||||
"webpack-dev-server": "^2.5.0"
|
||||
|
BIN
packages/website/public/images/team/jacob.jpg
Normal file
BIN
packages/website/public/images/team/jacob.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
BIN
packages/website/public/images/team/tom.jpg
Normal file
BIN
packages/website/public/images/team/tom.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
@@ -40,6 +40,9 @@ const teamRow1: ProfileInfo[] = [
|
||||
github: 'https://github.com/fabioberger',
|
||||
medium: 'https://medium.com/@fabioberger',
|
||||
},
|
||||
];
|
||||
|
||||
const teamRow2: ProfileInfo[] = [
|
||||
{
|
||||
name: 'Alex Xu',
|
||||
title: 'Director of Operations',
|
||||
@@ -48,11 +51,8 @@ const teamRow1: ProfileInfo[] = [
|
||||
image: '/images/team/alex.jpg',
|
||||
linkedIn: 'https://www.linkedin.com/in/alex-xu/',
|
||||
github: '',
|
||||
medium: '',
|
||||
medium: 'https://medium.com/@aqxu',
|
||||
},
|
||||
];
|
||||
|
||||
const teamRow2: ProfileInfo[] = [
|
||||
{
|
||||
name: 'Leonid Logvinov',
|
||||
title: 'Engineer',
|
||||
@@ -61,7 +61,7 @@ const teamRow2: ProfileInfo[] = [
|
||||
image: '/images/team/leonid.png',
|
||||
linkedIn: 'https://www.linkedin.com/in/leonidlogvinov/',
|
||||
github: 'https://github.com/LogvinovLeon',
|
||||
medium: '',
|
||||
medium: 'https://medium.com/@Logvinov',
|
||||
},
|
||||
{
|
||||
name: 'Ben Burns',
|
||||
@@ -73,23 +73,36 @@ const teamRow2: ProfileInfo[] = [
|
||||
github: '',
|
||||
medium: '',
|
||||
},
|
||||
{
|
||||
name: 'Philippe Castonguay',
|
||||
title: 'Dev Relations Manager',
|
||||
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: '',
|
||||
},
|
||||
];
|
||||
|
||||
const teamRow3: ProfileInfo[] = [
|
||||
{
|
||||
name: 'Brandon Millman',
|
||||
title: 'Senior Engineer',
|
||||
description: `Full-stack engineer. Previously senior software engineer at \
|
||||
Twitter. Electrical and Computer Engineering at Duke.`,
|
||||
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="clearfix pb3">{this._renderProfiles(teamRow1)}</div>
|
||||
<div className="clearfix">{this._renderProfiles(teamRow2)}</div>
|
||||
<div className="clearfix">{this._renderProfiles(teamRow3)}</div>
|
||||
</div>
|
||||
<div className="pt3 pb2">
|
||||
<div
|
||||
|
@@ -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">
|
||||
{props.profileInfo.description}
|
||||
</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)}
|
||||
</div>
|
||||
</div>
|
||||
|
107
yarn.lock
107
yarn.lock
@@ -1662,8 +1662,8 @@ caniuse-api@^1.5.2:
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
|
||||
version "1.0.30000789"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000789.tgz#5cf3fec75480041ab162ca06413153141e234325"
|
||||
version "1.0.30000790"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000790.tgz#a8023e6eb9fe9c0ef3d60b4427ce104ea87d381c"
|
||||
|
||||
capture-stack-trace@^1.0.0:
|
||||
version "1.0.0"
|
||||
@@ -1680,12 +1680,6 @@ center-align@^0.1.1:
|
||||
align-text "^0.1.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:
|
||||
version "7.1.1"
|
||||
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"
|
||||
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:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
|
||||
@@ -1809,13 +1799,12 @@ clap@^1.0.9:
|
||||
chalk "^1.1.3"
|
||||
|
||||
class-utils@^0.3.5:
|
||||
version "0.3.5"
|
||||
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.5.tgz#17e793103750f9627b2176ea34cfd1b565903c80"
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
|
||||
dependencies:
|
||||
arr-union "^3.1.0"
|
||||
define-property "^0.2.5"
|
||||
isobject "^3.0.0"
|
||||
lazy-cache "^2.0.2"
|
||||
static-extend "^0.1.1"
|
||||
|
||||
classnames@^2.2.5:
|
||||
@@ -1982,9 +1971,9 @@ commander@2.9.0:
|
||||
dependencies:
|
||||
graceful-readlink ">= 1.0.0"
|
||||
|
||||
commander@^2.9.0:
|
||||
version "2.12.2"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"
|
||||
commander@^2.12.1, commander@^2.9.0:
|
||||
version "2.13.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
|
||||
|
||||
commondir@^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"
|
||||
|
||||
dns-packet@^1.0.1:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.2.2.tgz#a8a26bec7646438963fc86e06f8f8b16d6c8bf7a"
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.0.tgz#7e2b33bf992678a44534c7117d39196bda684d33"
|
||||
dependencies:
|
||||
ip "^1.1.0"
|
||||
safe-buffer "^5.0.1"
|
||||
@@ -2870,9 +2859,9 @@ duplexer@^0.1.1, duplexer@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
|
||||
|
||||
duplexify@^3.1.2, duplexify@^3.4.2:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd"
|
||||
duplexify@^3.4.2, duplexify@^3.5.3:
|
||||
version "3.5.3"
|
||||
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.3.tgz#8b5818800df92fd0125b27ab896491912858243e"
|
||||
dependencies:
|
||||
end-of-stream "^1.0.0"
|
||||
inherits "^2.0.1"
|
||||
@@ -2934,8 +2923,8 @@ encoding@^0.1.11:
|
||||
iconv-lite "~0.4.13"
|
||||
|
||||
end-of-stream@^1.0.0, end-of-stream@^1.1.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206"
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
|
||||
dependencies:
|
||||
once "^1.4.0"
|
||||
|
||||
@@ -5036,7 +5025,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
|
||||
version "3.0.2"
|
||||
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"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
|
||||
dependencies:
|
||||
@@ -5620,8 +5609,8 @@ log-driver@^1.2.5:
|
||||
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056"
|
||||
|
||||
loglevel@^1.4.1:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.0.tgz#ae0caa561111498c5ba13723d6fb631d24003934"
|
||||
version "1.6.1"
|
||||
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
|
||||
|
||||
lolex@^1.6.0:
|
||||
version "1.6.0"
|
||||
@@ -6191,17 +6180,17 @@ node-pre-gyp@^0.6.39:
|
||||
tar-pack "^3.4.0"
|
||||
|
||||
nodemon@^1.11.0:
|
||||
version "1.14.10"
|
||||
resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.14.10.tgz#836d33ff0f89ad111b8d49e5e3b3cb872e36304e"
|
||||
version "1.14.11"
|
||||
resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.14.11.tgz#cc0009dd8d82f126f3aba50ace7e753827a8cebc"
|
||||
dependencies:
|
||||
chokidar "^1.7.0"
|
||||
debug "^2.6.8"
|
||||
chokidar "^2.0.0"
|
||||
debug "^3.1.0"
|
||||
ignore-by-default "^1.0.1"
|
||||
minimatch "^3.0.4"
|
||||
pstree.remy "^1.1.0"
|
||||
semver "^5.4.1"
|
||||
touch "^3.1.0"
|
||||
undefsafe "0.0.3"
|
||||
undefsafe "^2.0.1"
|
||||
update-notifier "^2.3.0"
|
||||
|
||||
noms@0.0.0:
|
||||
@@ -7175,13 +7164,20 @@ pump@^1.0.0:
|
||||
end-of-stream "^1.1.0"
|
||||
once "^1.3.1"
|
||||
|
||||
pumpify@^1.3.3:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.5.tgz#1b671c619940abcaeac0ad0e3a3c164be760993b"
|
||||
pump@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.0.tgz#7946da1c8d622b098e2ceb2d3476582470829c9d"
|
||||
dependencies:
|
||||
duplexify "^3.1.2"
|
||||
inherits "^2.0.1"
|
||||
pump "^1.0.0"
|
||||
end-of-stream "^1.1.0"
|
||||
once "^1.3.1"
|
||||
|
||||
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:
|
||||
version "1.3.2"
|
||||
@@ -7252,8 +7248,8 @@ randomatic@^1.1.3:
|
||||
kind-of "^4.0.0"
|
||||
|
||||
randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79"
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80"
|
||||
dependencies:
|
||||
safe-buffer "^5.1.0"
|
||||
|
||||
@@ -9091,7 +9087,7 @@ truffle@^4.0.1:
|
||||
original-require "^1.0.1"
|
||||
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"
|
||||
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:
|
||||
tsutils "^2.13.1"
|
||||
|
||||
tslint@5.8.0, tslint@^5.5.0:
|
||||
tslint@5.8.0:
|
||||
version "5.8.0"
|
||||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13"
|
||||
dependencies:
|
||||
@@ -9131,6 +9127,23 @@ tslint@5.8.0, tslint@^5.5.0:
|
||||
tslib "^1.7.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:
|
||||
version "1.9.1"
|
||||
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"
|
||||
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
|
||||
|
||||
undefsafe@0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-0.0.3.tgz#ecca3a03e56b9af17385baac812ac83b994a962f"
|
||||
undefsafe@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.1.tgz#03b2f2a16c94556e14b2edef326cd66aaf82707a"
|
||||
dependencies:
|
||||
debug "^2.2.0"
|
||||
|
||||
underscore@1.8.3:
|
||||
version "1.8.3"
|
||||
|
Reference in New Issue
Block a user