Normalize the dependencies

This commit is contained in:
Leonid Logvinov 2018-01-25 15:12:46 +01:00
parent 2f65fadeaa
commit 1e9147b8bb
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
21 changed files with 76 additions and 147 deletions

View File

@ -2,27 +2,24 @@
"name": "0x.js", "name": "0x.js",
"version": "0.31.0", "version": "0.31.0",
"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", "test:circleci": "run-s test:coverage report_test_coverage",
"test": "run-s clean test:commonjs", "test": "run-s clean test:commonjs",
"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:prod": "NODE_ENV=production webpack", "build:umd:prod": "NODE_ENV=production webpack",
"build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;", "build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;",
@ -66,7 +63,7 @@
"nyc": "^11.0.1", "nyc": "^11.0.1",
"opn-cli": "^3.1.0", "opn-cli": "^3.1.0",
"request": "^2.81.0", "request": "^2.81.0",
"request-promise-native": "^1.0.4", "request-promise-native": "^1.0.5",
"shx": "^0.2.2", "shx": "^0.2.2",
"sinon": "^4.0.0", "sinon": "^4.0.0",
"source-map-support": "^0.5.0", "source-map-support": "^0.5.0",
@ -89,7 +86,7 @@
"ethereumjs-abi": "^0.6.4", "ethereumjs-abi": "^0.6.4",
"ethereumjs-blockstream": "^2.0.6", "ethereumjs-blockstream": "^2.0.6",
"ethereumjs-util": "^5.1.1", "ethereumjs-util": "^5.1.1",
"js-sha3": "^0.6.1", "js-sha3": "^0.7.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"uuid": "^3.1.0", "uuid": "^3.1.0",
"web3": "^0.20.0" "web3": "^0.20.0"

View File

@ -1,6 +1,6 @@
import { schemas } from '@0xproject/json-schemas'; import { schemas } from '@0xproject/json-schemas';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { LogWithDecodedArgs } from '@0xproject/types'; import { LogWithDecodedArgs } from '@0xproject/types';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash'; import * as _ from 'lodash';

View File

@ -1,4 +1,4 @@
import { ContractEventArg, DecodedLogArgs, LogWithDecodedArgs, TransactionReceipt } from '@0xproject/types'; import { ContractEventArg, LogWithDecodedArgs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils'; import { BigNumber } from '@0xproject/utils';
import * as Web3 from 'web3'; import * as Web3 from 'web3';

View File

@ -9,15 +9,13 @@
"url": "git+https://github.com/0xProject/0x.js.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/0x.js/issues" "url": "https://github.com/0xProject/0x.js/issues"
}, },
"homepage": "https://github.com/0xProject/0x.js/packages/chai-as-promised-typescript-typings#readme", "homepage": "https://github.com/0xProject/0x.js/packages/chai-as-promised-typescript-typings#readme",
"dependencies": { "dependencies": {
"chai-typescript-typings": "^0.0.0" "chai-typescript-typings": "^0.0.2"
} }
} }

View File

@ -600,4 +600,3 @@ contract Exchange is SafeMath {
return Token(token).allowance.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner, TOKEN_TRANSFER_PROXY_CONTRACT); // Limit gas to prevent reentrancy return Token(token).allowance.gas(EXTERNAL_QUERY_GAS_LIMIT)(owner, TOKEN_TRANSFER_PROXY_CONTRACT); // Limit gas to prevent reentrancy
} }
} }

View File

@ -52,7 +52,7 @@
"truffle": "^4.0.1", "truffle": "^4.0.1",
"tslint": "5.8.0", "tslint": "5.8.0",
"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.7", "web3-typescript-typings": "^0.9.7",
"yargs": "^10.0.3" "yargs": "^10.0.3"

View File

@ -147,9 +147,8 @@ describe('Exchange', () => {
takerTokenAmount: new BigNumber(3), takerTokenAmount: new BigNumber(3),
}); });
const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0); expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0);
const fillTakerTokenAmount1 = new BigNumber(2); const fillTakerTokenAmount1 = new BigNumber(2);
@ -157,9 +156,8 @@ describe('Exchange', () => {
fillTakerTokenAmount: fillTakerTokenAmount1, fillTakerTokenAmount: fillTakerTokenAmount1,
}); });
const filledTakerTokenAmountAfter1 = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter1 = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountAfter1).to.be.bignumber.equal(fillTakerTokenAmount1); expect(filledTakerTokenAmountAfter1).to.be.bignumber.equal(fillTakerTokenAmount1);
const fillTakerTokenAmount2 = new BigNumber(1); const fillTakerTokenAmount2 = new BigNumber(1);
@ -167,9 +165,8 @@ describe('Exchange', () => {
fillTakerTokenAmount: fillTakerTokenAmount2, fillTakerTokenAmount: fillTakerTokenAmount2,
}); });
const filledTakerTokenAmountAfter2 = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter2 = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountAfter2).to.be.bignumber.equal(filledTakerTokenAmountAfter1); expect(filledTakerTokenAmountAfter2).to.be.bignumber.equal(filledTakerTokenAmountAfter1);
}); });
@ -179,17 +176,15 @@ describe('Exchange', () => {
takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18),
}); });
const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0); expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0);
const fillTakerTokenAmount = order.params.takerTokenAmount.div(2); const fillTakerTokenAmount = order.params.takerTokenAmount.div(2);
await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount }); await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount });
const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount); expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount);
const newBalances = await dmyBalances.getAsync(); const newBalances = await dmyBalances.getAsync();
@ -232,17 +227,15 @@ describe('Exchange', () => {
takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18), takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100), 18),
}); });
const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0); expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0);
const fillTakerTokenAmount = order.params.takerTokenAmount.div(2); const fillTakerTokenAmount = order.params.takerTokenAmount.div(2);
await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount }); await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount });
const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount); expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount);
const newBalances = await dmyBalances.getAsync(); const newBalances = await dmyBalances.getAsync();
@ -285,17 +278,15 @@ describe('Exchange', () => {
takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18),
}); });
const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0); expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0);
const fillTakerTokenAmount = order.params.takerTokenAmount.div(2); const fillTakerTokenAmount = order.params.takerTokenAmount.div(2);
await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount }); await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount });
const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount); expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(fillTakerTokenAmount);
const newBalances = await dmyBalances.getAsync(); const newBalances = await dmyBalances.getAsync();
@ -339,17 +330,15 @@ describe('Exchange', () => {
takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18), takerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(200), 18),
}); });
const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountBefore = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0); expect(filledTakerTokenAmountBefore).to.be.bignumber.equal(0);
const fillTakerTokenAmount = order.params.takerTokenAmount.div(2); const fillTakerTokenAmount = order.params.takerTokenAmount.div(2);
await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount }); await exWrapper.fillOrderAsync(order, taker, { fillTakerTokenAmount });
const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync( const filledTakerTokenAmountAfter = await zeroEx.exchange.getFilledTakerAmountAsync(order.params
order.params.orderHashHex, .orderHashHex as string);
);
const expectedFillAmountTAfter = fillTakerTokenAmount.add(filledTakerTokenAmountBefore); const expectedFillAmountTAfter = fillTakerTokenAmount.add(filledTakerTokenAmountBefore);
expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(expectedFillAmountTAfter); expect(filledTakerTokenAmountAfter).to.be.bignumber.equal(expectedFillAmountTAfter);
@ -678,7 +667,7 @@ describe('Exchange', () => {
expect(newBalances).to.be.deep.equal(balances); expect(newBalances).to.be.deep.equal(balances);
}); });
it.skip('should throw if getBalance or getAllowance attempts to change state and \ it('should throw if getBalance or getAllowance attempts to change state and \
shouldThrowOnInsufficientBalanceOrAllowance = false', async () => { shouldThrowOnInsufficientBalanceOrAllowance = false', async () => {
const maliciousToken = await deployer.deployAsync('MaliciousToken'); const maliciousToken = await deployer.deployAsync('MaliciousToken');
await maliciousToken.approve(tokenTransferProxy.address, INITIAL_ALLOWANCE, { from: taker }); await maliciousToken.approve(tokenTransferProxy.address, INITIAL_ALLOWANCE, { from: taker });
@ -691,7 +680,7 @@ describe('Exchange', () => {
exWrapper.fillOrderAsync(order, taker, { exWrapper.fillOrderAsync(order, taker, {
shouldThrowOnInsufficientBalanceOrAllowance: false, shouldThrowOnInsufficientBalanceOrAllowance: false,
}), }),
).to.be.rejectedWith(constants.REVERT); ).to.be.rejectedWith(constants.INVALID_OPCODE);
}); });
it('should not change balances if an order is expired', async () => { it('should not change balances if an order is expired', async () => {

View File

@ -175,7 +175,7 @@ describe('TokenRegistry', () => {
}); });
it('should change the token symbol when called by owner', async () => { it('should change the token symbol when called by owner', async () => {
const res = await tokenReg.setTokenSymbol(token1.address, token2.symbol, { from: owner }); await tokenReg.setTokenSymbol(token1.address, token2.symbol, { from: owner });
const [newData, oldData] = await Promise.all([ const [newData, oldData] = await Promise.all([
tokenRegWrapper.getTokenBySymbolAsync(token2.symbol), tokenRegWrapper.getTokenBySymbolAsync(token2.symbol),
tokenRegWrapper.getTokenBySymbolAsync(token1.symbol), tokenRegWrapper.getTokenBySymbolAsync(token1.symbol),
@ -216,7 +216,7 @@ describe('TokenRegistry', () => {
it('should remove token metadata when called by owner', async () => { it('should remove token metadata when called by owner', async () => {
const index = 0; const index = 0;
const res = await tokenReg.removeToken(token1.address, index, { await tokenReg.removeToken(token1.address, index, {
from: owner, from: owner,
}); });
const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address); const tokenData = await tokenRegWrapper.getTokenMetaDataAsync(token1.address);

View File

@ -4,8 +4,6 @@
"outDir": "lib", "outDir": "lib",
"baseUrl": ".", "baseUrl": ".",
"declaration": false, "declaration": false,
"strictNullChecks": false,
"strictFunctionTypes": false,
"allowJs": true "allowJs": true
}, },
"include": [ "include": [

View File

@ -1,4 +1,4 @@
import { ExchangeContractEventArgs, TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js'; import { TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js';
import { BigNumber } from '@0xproject/utils'; import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as Web3 from 'web3'; import * as Web3 from 'web3';
@ -108,9 +108,14 @@ export class ExchangeWrapper {
public async batchFillOrKillOrdersAsync( public async batchFillOrKillOrdersAsync(
orders: Order[], orders: Order[],
from: string, from: string,
opts: { fillTakerTokenAmounts?: BigNumber[] } = {}, opts: { fillTakerTokenAmounts?: BigNumber[]; shouldThrowOnInsufficientBalanceOrAllowance?: boolean } = {},
): Promise<TransactionReceiptWithDecodedLogs> { ): Promise<TransactionReceiptWithDecodedLogs> {
const params = formatters.createBatchFill(orders, undefined, opts.fillTakerTokenAmounts); const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance;
const params = formatters.createBatchFill(
orders,
shouldThrowOnInsufficientBalanceOrAllowance,
opts.fillTakerTokenAmounts,
);
const txHash = await this._exchange.batchFillOrKillOrders( const txHash = await this._exchange.batchFillOrKillOrders(
params.orderAddresses, params.orderAddresses,
params.orderValues, params.orderValues,
@ -128,10 +133,7 @@ export class ExchangeWrapper {
public async fillOrdersUpToAsync( public async fillOrdersUpToAsync(
orders: Order[], orders: Order[],
from: string, from: string,
opts: { opts: { fillTakerTokenAmount: BigNumber; shouldThrowOnInsufficientBalanceOrAllowance?: boolean },
fillTakerTokenAmount?: BigNumber;
shouldThrowOnInsufficientBalanceOrAllowance?: boolean;
} = {},
): Promise<TransactionReceiptWithDecodedLogs> { ): Promise<TransactionReceiptWithDecodedLogs> {
const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance; const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance;
const params = formatters.createFillUpTo( const params = formatters.createFillUpTo(

View File

@ -35,9 +35,9 @@ export const formatters = {
order.params.expirationTimestampInSec, order.params.expirationTimestampInSec,
order.params.salt, order.params.salt,
]); ]);
batchFill.v.push(order.params.v); batchFill.v.push(order.params.v as number);
batchFill.r.push(order.params.r); batchFill.r.push(order.params.r as string);
batchFill.s.push(order.params.s); batchFill.s.push(order.params.s as string);
if (fillTakerTokenAmounts.length < orders.length) { if (fillTakerTokenAmounts.length < orders.length) {
batchFill.fillTakerTokenAmounts.push(order.params.takerTokenAmount); batchFill.fillTakerTokenAmounts.push(order.params.takerTokenAmount);
} }
@ -74,9 +74,9 @@ export const formatters = {
order.params.expirationTimestampInSec, order.params.expirationTimestampInSec,
order.params.salt, order.params.salt,
]); ]);
fillUpTo.v.push(order.params.v); fillUpTo.v.push(order.params.v as number);
fillUpTo.r.push(order.params.r); fillUpTo.r.push(order.params.r as string);
fillUpTo.s.push(order.params.s); fillUpTo.s.push(order.params.s as string);
}); });
return fillUpTo; return fillUpTo;
}, },

View File

@ -1,16 +1,11 @@
import { BigNumber, promisify } from '@0xproject/utils'; import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Web3Wrapper } from '@0xproject/web3-wrapper';
import ethUtil = require('ethereumjs-util'); import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash'; import * as _ from 'lodash';
import Web3 = require('web3');
import { crypto } from './crypto'; import { crypto } from './crypto';
import { OrderParams } from './types'; import { OrderParams } from './types';
// In order to benefit from type-safety, we re-assign the global web3 instance injected by Truffle
// with type `any` to a variable of type `Web3`.
const web3: Web3 = (global as any).web3;
export class Order { export class Order {
public params: OrderParams; public params: OrderParams;
private _web3Wrapper: Web3Wrapper; private _web3Wrapper: Web3Wrapper;

View File

@ -13,7 +13,7 @@ export class OrderFactory {
this._defaultOrderParams = defaultOrderParams; this._defaultOrderParams = defaultOrderParams;
this._web3Wrapper = web3Wrapper; this._web3Wrapper = web3Wrapper;
} }
public async newSignedOrderAsync(customOrderParams: OptionalOrderParams = {}) { public async newSignedOrderAsync(customOrderParams: OptionalOrderParams = {}): Promise<Order> {
const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000)); const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000));
const orderParams: OrderParams = _.assign( const orderParams: OrderParams = _.assign(
{}, {},

View File

@ -34,7 +34,7 @@
"web3-typescript-typings": "^0.9.7" "web3-typescript-typings": "^0.9.7"
}, },
"dependencies": { "dependencies": {
"@0xproject/utils": "^0.1.3", "@0xproject/utils": "^0.2.1",
"@0xproject/web3-wrapper": "^0.1.8", "@0xproject/web3-wrapper": "^0.1.8",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"solc": "^0.4.18", "solc": "^0.4.18",

View File

@ -21,12 +21,12 @@
"devDependencies": { "devDependencies": {
"@0xproject/tslint-config": "^0.4.5", "@0xproject/tslint-config": "^0.4.5",
"@types/lodash": "^4.14.86", "@types/lodash": "^4.14.86",
"@0xproject/types": "^0.1.4", "@0xproject/types": "^0.1.5",
"npm-run-all": "^4.1.2", "npm-run-all": "^4.1.2",
"shx": "^0.2.2", "shx": "^0.2.2",
"tslint": "5.8.0", "tslint": "5.8.0",
"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"
}, },
"dependencies": { "dependencies": {

View File

@ -49,7 +49,7 @@
"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.7.2", "web3-typescript-typings": "^0.9.5",
"webpack": "^3.1.0" "webpack": "^3.1.0"
} }
} }

View File

@ -22,11 +22,10 @@
"@0xproject/tslint-config": "^0.4.5", "@0xproject/tslint-config": "^0.4.5",
"shx": "^0.2.2", "shx": "^0.2.2",
"tslint": "5.8.0", "tslint": "5.8.0",
"web3-typescript-typings": "^0.9.4", "web3-typescript-typings": "^0.9.5",
"typescript": "~2.6.1" "typescript": "~2.6.1"
}, },
"dependencies": { "dependencies": {
"@0xproject/utils": "^0.2.3",
"bignumber.js": "~4.1.0", "bignumber.js": "~4.1.0",
"web3": "^0.20.0" "web3": "^0.20.0"
} }

View File

@ -20,12 +20,12 @@
"homepage": "https://github.com/0xProject/0x.js/packages/utils/README.md", "homepage": "https://github.com/0xProject/0x.js/packages/utils/README.md",
"devDependencies": { "devDependencies": {
"@0xproject/tslint-config": "^0.4.5", "@0xproject/tslint-config": "^0.4.5",
"@0xproject/types": "^0.1.4", "@0xproject/types": "^0.1.5",
"@types/lodash": "^4.14.86", "@types/lodash": "^4.14.86",
"npm-run-all": "^4.1.2", "npm-run-all": "^4.1.2",
"shx": "^0.2.2", "shx": "^0.2.2",
"tslint": "5.8.0", "tslint": "5.8.0",
"web3-typescript-typings": "^0.9.4", "web3-typescript-typings": "^0.9.5",
"typescript": "~2.6.1" "typescript": "~2.6.1"
}, },
"dependencies": { "dependencies": {

View File

@ -3,6 +3,7 @@ import * as _ from 'lodash';
import * as Web3 from 'web3'; import * as Web3 from 'web3';
import * as SolidityCoder from 'web3/lib/solidity/coder'; import * as SolidityCoder from 'web3/lib/solidity/coder';
// tslint:disable-next-line:no-unused-variable
import { BigNumber } from './configured_bignumber'; import { BigNumber } from './configured_bignumber';
export class AbiDecoder { export class AbiDecoder {

View File

@ -12,9 +12,7 @@
"url": "git+https://github.com/0xProject/0x.js.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/0x.js/issues" "url": "https://github.com/0xProject/0x.js/issues"
@ -22,7 +20,7 @@
"homepage": "https://github.com/0xProject/0x.js/packages/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.8.0",
"tslint-config-0xproject": "^0.0.2", "tslint-config-0xproject": "^0.0.2",
"typescript": "~2.6.1" "typescript": "~2.6.1"
}, },

View File

@ -2,14 +2,6 @@
# yarn lockfile v1 # yarn lockfile v1
"@0xproject/utils@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-0.1.3.tgz#58a9c7e19ab7710e0af17a0c2f1c7fc1b3140e85"
dependencies:
bignumber.js "~4.1.0"
js-sha3 "^0.7.0"
lodash "^4.17.4"
"@types/accounting@^0.4.1": "@types/accounting@^0.4.1":
version "0.4.1" version "0.4.1"
resolved "https://registry.yarnpkg.com/@types/accounting/-/accounting-0.4.1.tgz#865d9f5694fd7c438fba34eb4bc82eec6f34cdd5" resolved "https://registry.yarnpkg.com/@types/accounting/-/accounting-0.4.1.tgz#865d9f5694fd7c438fba34eb4bc82eec6f34cdd5"
@ -1291,10 +1283,6 @@ big.js@^3.1.3:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e"
bignumber.js@^4.0.2, bignumber.js@~4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1"
"bignumber.js@git+https://github.com/debris/bignumber.js#master": "bignumber.js@git+https://github.com/debris/bignumber.js#master":
version "2.0.7" version "2.0.7"
resolved "git+https://github.com/debris/bignumber.js#c7a38de919ed75e6fb6ba38051986e294b328df9" resolved "git+https://github.com/debris/bignumber.js#c7a38de919ed75e6fb6ba38051986e294b328df9"
@ -1307,6 +1295,10 @@ bignumber.js@^4.0.2, bignumber.js@~4.1.0:
version "2.0.7" version "2.0.7"
resolved "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" resolved "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934"
bignumber.js@~4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1"
binary-extensions@^1.0.0: binary-extensions@^1.0.0:
version "1.11.0" version "1.11.0"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205"
@ -1698,10 +1690,6 @@ chai-bignumber@^2.0.1:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-2.0.2.tgz#de6c219c690b2d66b646ad6930096f9ba2199643" resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-2.0.2.tgz#de6c219c690b2d66b646ad6930096f9ba2199643"
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@^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"
@ -1979,7 +1967,7 @@ commander@2.9.0:
dependencies: dependencies:
graceful-readlink ">= 1.0.0" graceful-readlink ">= 1.0.0"
commander@^2.12.1, commander@^2.9.0: commander@^2.9.0:
version "2.13.0" version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
@ -3215,7 +3203,7 @@ ethereumjs-util@4.5.0, ethereumjs-util@^4.0.1, ethereumjs-util@^4.3.0, ethereumj
rlp "^2.0.0" rlp "^2.0.0"
secp256k1 "^3.0.1" secp256k1 "^3.0.1"
ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2: ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1:
version "5.1.3" version "5.1.3"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.1.3.tgz#0c1f6efb1da9c5b6720a65697859fc0be6672df0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.1.3.tgz#0c1f6efb1da9c5b6720a65697859fc0be6672df0"
dependencies: dependencies:
@ -5021,10 +5009,6 @@ js-sha3@^0.3.1:
version "0.3.1" version "0.3.1"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243"
js-sha3@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.6.1.tgz#5b89f77a7477679877f58c4a075240934b1f95c0"
js-sha3@^0.7.0: js-sha3@^0.7.0:
version "0.7.0" version "0.7.0"
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.7.0.tgz#0a5c57b36f79882573b2d84051f8bb85dd1bd63a"
@ -5033,7 +5017,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.7.0: js-yaml@^3.6.1:
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:
@ -7765,7 +7749,7 @@ request-promise-core@1.1.1:
dependencies: dependencies:
lodash "^4.13.1" lodash "^4.13.1"
request-promise-native@^1.0.4, request-promise-native@^1.0.5: request-promise-native@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5"
dependencies: dependencies:
@ -9095,7 +9079,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.0, tslib@^1.8.1: tslib@^1.0.0, tslib@^1.7.1, 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"
@ -9135,23 +9119,6 @@ tslint@5.8.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"
@ -9229,14 +9196,6 @@ types-bn@^0.0.1:
dependencies: dependencies:
bn.js "4.11.7" bn.js "4.11.7"
types-ethereumjs-util@0xProject/types-ethereumjs-util:
version "0.0.6"
resolved "https://codeload.github.com/0xProject/types-ethereumjs-util/tar.gz/0c5058e4f9d6585f7c7c1f88939546acb14323b8"
dependencies:
bn.js "^4.11.7"
buffer "^5.0.6"
rlp "^2.0.0"
types-ethereumjs-util@0xproject/types-ethereumjs-util: types-ethereumjs-util@0xproject/types-ethereumjs-util:
version "0.0.6" version "0.0.6"
resolved "https://codeload.github.com/0xproject/types-ethereumjs-util/tar.gz/0c5058e4f9d6585f7c7c1f88939546acb14323b8" resolved "https://codeload.github.com/0xproject/types-ethereumjs-util/tar.gz/0c5058e4f9d6585f7c7c1f88939546acb14323b8"
@ -9643,12 +9602,6 @@ web3-provider-engine@^8.4.0:
xhr "^2.2.0" xhr "^2.2.0"
xtend "^4.0.1" xtend "^4.0.1"
web3-typescript-typings@^0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.7.2.tgz#5312bb786936a9c91381eee7af3d02ac21cf13b3"
dependencies:
bignumber.js "^4.0.2"
web3-utils@1.0.0-beta.27: web3-utils@1.0.0-beta.27:
version "1.0.0-beta.27" version "1.0.0-beta.27"
resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.27.tgz#d097d5c336a16b9f6ca9b60af68dd15c0643214b" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.27.tgz#d097d5c336a16b9f6ca9b60af68dd15c0643214b"