Merge branch 'v2-prototype' into refactor/order-utils/for-v2

* v2-prototype: (33 commits)
  Only show ProviderDisplay in portal
  Improve sol-cov docs
  Remove old parse code
  Refactor order parser and add shared order support to new portal
  Add generate and fill order routes
  Address feedback
  Override ethereumjs-tx version
  Fix missing key
  Update placeholder param ordering
  Change userEtherBalanceInWei to optional so we can know if its loading
  Add loading state to ProviderDisplay
  Tweaks
  Add Placeholder component
  Add StandardIconRow
  Split render into loading and loaaded
  Fix linter errors
  Fix linter errors
  Add ethereum-types to extraFileIncludes
  Introduce ethereum-types package
  Remove merge conflicts from yarn.lock
  ...

# Conflicts:
#	packages/contracts/src/utils/exchange_wrapper.ts
#	packages/contracts/src/utils/match_order_tester.ts
#	packages/contracts/src/utils/types.ts
#	packages/contracts/test/exchange/core.ts
#	packages/contracts/test/exchange/match_orders.ts
#	packages/contracts/test/libraries/lib_bytes.ts
#	packages/sol-cov/package.json
This commit is contained in:
Fabio Berger
2018-06-01 13:05:17 -07:00
130 changed files with 1229 additions and 1132 deletions

View File

@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
environment:
CONTRACTS_COMMIT_HASH: '9ed05f5'
working_directory: ~/repo
@@ -11,91 +11,68 @@ jobs:
- checkout
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-packages-{{ .Branch }}
- yarn-packages-master
- yarn-packages-
- run:
name: yarn
command: yarn --frozen-lockfile
command: yarn --frozen-lockfile install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
name: Save Yarn Package Cache
key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip
- run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot
- node_modules/
- run: node ./node_modules/lerna/bin/lerna.js bootstrap
- run: yarn build
- save_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo
test-installation:
test-1:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:installation
test-0xjs:
docker:
- image: circleci/node:6.12
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn wsrun test:circleci 0x.js
- save_cache:
key: coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/0x.js/coverage/lcov.info
test-contracts:
docker:
- image: circleci/node:6.12
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn wsrun test:circleci contracts
test-sol-compiler:
docker:
- image: circleci/node:6.12
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn wsrun test:circleci @0xproject/contract-wrappers
- run: yarn wsrun test:circleci @0xproject/sol-compiler
- save_cache:
key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/contract-wrappers/coverage/lcov.info
- save_cache:
key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/sol-compiler/coverage/lcov.info
test-rest:
test-contracts:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: testrpc
command: npm run testrpc -- --db testrpc_snapshot
background: true
- run: yarn wsrun test:circleci --exclude contracts --exclude 0x.js --exclude @0xproject/sol-compiler --stages --exclude-missing
- run: yarn wsrun test:circleci contracts
test-2:
docker:
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun test:circleci @0xproject/assert
- run: yarn wsrun test:circleci @0xproject/connect
- run: yarn wsrun test:circleci @0xproject/dev-utils
- run: yarn wsrun test:circleci @0xproject/json-schemas
- run: yarn wsrun test:circleci @0xproject/subproviders
- run: yarn wsrun test:circleci @0xproject/sol-cov
- run: yarn wsrun test:circleci @0xproject/metacoin
- save_cache:
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
paths:
@@ -124,27 +101,19 @@ jobs:
key: coverage-metacoin-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/packages/metacoin/coverage/lcov.info
lint:
static-tests:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lerna:run lint
prettier:
working_directory: ~/repo
docker:
- image: circleci/node:6.12
- image: circleci/node:9
steps:
- restore_cache:
keys:
- repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn prettier:ci
- run: yarn lerna:run lint
submit-coverage:
docker:
- image: circleci/node:6.12
- image: circleci/node:9
working_directory: ~/repo
steps:
- restore_cache:
@@ -156,6 +125,9 @@ jobs:
- restore_cache:
keys:
- coverage-connect-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }}
@@ -168,6 +140,9 @@ jobs:
- restore_cache:
keys:
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-contracts-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }}
@@ -183,29 +158,19 @@ workflows:
main:
jobs:
- build
# - test-installation:
# requires:
# - build
- test-0xjs:
- test-1:
requires:
- build
- test-2:
requires:
- build
- test-contracts:
requires:
- build
- test-sol-compiler:
requires:
- build
- test-rest:
requires:
- build
- prettier:
requires:
- build
- lint:
- static-tests:
requires:
- build
- submit-coverage:
requires:
- test-0xjs
- test-sol-compiler
- test-rest
- test-1
- test-2

View File

@@ -35,10 +35,13 @@
"async-child-process": "^1.1.1",
"coveralls": "^3.0.0",
"ganache-cli": "^6.1.0",
"lcov-result-merger": "^2.0.0",
"lcov-result-merger": "^3.0.0",
"lerna": "^2.5.1",
"npm-run-all": "^4.1.2",
"prettier": "^1.11.1",
"wsrun": "^2.2.0"
},
"resolutions": {
"ethereumjs-tx": "0xProject/ethereumjs-tx#fake-tx-include-signature-by-default"
}
}

View File

@@ -44,6 +44,7 @@
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts",
"../ethereum-types/src/index.ts",
"../contract-wrappers/src/types.ts",
"../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts",
@@ -108,6 +109,7 @@
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
},

View File

@@ -27,9 +27,9 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"ethereum-types": "^0.0.1",
"chalk": "^2.3.0",
"glob": "^7.1.2",
"handlebars": "^4.0.11",

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env node
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from '@0xproject/types';
import { abiUtils, logUtils } from '@0xproject/utils';
import chalk from 'chalk';
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
import * as fs from 'fs';
import { sync as globSync } from 'glob';
import * as Handlebars from 'handlebars';

View File

@@ -1,4 +1,4 @@
import { EventAbi, MethodAbi } from '@0xproject/types';
import { EventAbi, MethodAbi } from 'ethereum-types';
export enum ParamKind {
Input = 'input',

View File

@@ -1,4 +1,4 @@
import { AbiType, ConstructorAbi, DataItem } from '@0xproject/types';
import { AbiType, ConstructorAbi, DataItem } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import * as path from 'path';

View File

@@ -42,7 +42,7 @@
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/types": "^0.7.0",
"ethereum-types": "^0.0.1",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",

View File

@@ -1,3 +1,5 @@
import { abiUtils, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import {
AbiDefinition,
AbiType,
@@ -8,9 +10,7 @@ import {
Provider,
TxData,
TxDataPayable,
} from '@0xproject/types';
import { abiUtils, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
} from 'ethereum-types';
import * as ethers from 'ethers';
import * as _ from 'lodash';

View File

@@ -1,4 +1,4 @@
import { DataItem } from '@0xproject/types';
import { DataItem } from 'ethereum-types';
import * as _ from 'lodash';
// tslint:disable-next-line:completed-docs

View File

@@ -85,6 +85,7 @@
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"ethereumjs-blockstream": "^2.0.6",
"ethereumjs-util": "^5.1.1",
"ethers": "^3.0.15",

View File

@@ -2,11 +2,11 @@
* This file is auto-generated using abi-gen. Don't edit directly.
* Templates can be found at https://github.com/0xProject/0x-monorepo/tree/development/packages/contract_templates.
*/
// tslint:disable:no-consecutive-blank-lines
// tslint:disable:no-consecutive-blank-lines ordered-imports
// tslint:disable-next-line:no-unused-variable
import { BaseContract } from '@0xproject/base-contract';
import { ContractArtifact } from '@0xproject/sol-compiler';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
import { BigNumber, classUtils, logUtils, promisify } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as ethers from 'ethers';

View File

@@ -1,4 +1,4 @@
export interface {{name}}ContractEventArgs {
export interface {{name}}ContractEventArgs extends DecodedLogArgs {
{{#each inputs}}
{{name}}: {{#returnType type components}}{{/returnType}};
{{/each}}

View File

@@ -48,7 +48,9 @@
"@0xproject/subproviders": "^0.10.1",
"@0xproject/sol-cov": "^0.0.11",
"@types/lodash": "4.14.104",
"@types/bn.js": "^4.11.0",
"@types/node": "^8.0.53",
"@types/ethereumjs-abi": "^0.6.0",
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
@@ -73,6 +75,7 @@
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"bn.js": "^4.11.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-util": "^5.1.1",

View File

@@ -1,6 +1,6 @@
import { Provider } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
import { DummyERC20TokenContract } from '../contract_wrappers/generated/dummy_e_r_c20_token';

View File

@@ -1,7 +1,7 @@
import { generatePseudoRandomSalt } from '@0xproject/order-utils';
import { Provider } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
import { DummyERC721TokenContract } from '../contract_wrappers/generated/dummy_e_r_c721_token';

View File

@@ -1,6 +1,7 @@
import { AssetProxyId, Provider, SignedOrder, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { AssetProxyId, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { LogEntry, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
import { ExchangeContract } from '../contract_wrappers/generated/exchange';

View File

@@ -1,13 +1,14 @@
import { ContractArtifact } from '@0xproject/sol-compiler';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import {
AbiDefinition,
DecodedLogArgs,
LogEntry,
LogWithDecodedArgs,
RawLog,
TransactionReceiptWithDecodedLogs,
} from '@0xproject/types';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
} from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts } from './artifacts';
@@ -36,7 +37,7 @@ export class LogDecoder {
});
this._abiDecoder = new AbiDecoder(abiArrays);
}
public decodeLogOrThrow<ArgsType>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog {
public decodeLogOrThrow<ArgsType extends DecodedLogArgs>(log: LogEntry): LogWithDecodedArgs<ArgsType> | RawLog {
const logWithDecodedArgsOrLog = this._abiDecoder.tryToDecodeLogOrNoop(log);
if (_.isUndefined((logWithDecodedArgsOrLog as LogWithDecodedArgs<ArgsType>).args)) {
throw new Error(`Unable to decode log: ${JSON.stringify(log)}`);

View File

@@ -1,8 +1,9 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils';
import { AssetProxyId, LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { AssetProxyId, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';

View File

@@ -1,6 +1,6 @@
import { Provider, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import * as _ from 'lodash';
import { AssetProxyOwnerContract } from '../contract_wrappers/generated/asset_proxy_owner';

View File

@@ -1,16 +1,21 @@
import * as Web3 from 'web3';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider } from 'ethereum-types';
import { TokenRegistryContract } from '../contract_wrappers/generated/token_registry';
import { Token } from './types';
import { constants } from './constants';
export class TokenRegWrapper {
private _tokenReg: TokenRegistryContract;
constructor(tokenRegContract: TokenRegistryContract) {
private _web3Wrapper: Web3Wrapper;
constructor(tokenRegContract: TokenRegistryContract, provider: Provider) {
this._tokenReg = tokenRegContract;
this._web3Wrapper = new Web3Wrapper(provider);
}
public async addTokenAsync(token: Token, from: string): Promise<string> {
const tx = this._tokenReg.addToken.sendTransactionAsync(
const txHash = await this._tokenReg.addToken.sendTransactionAsync(
token.address as string,
token.name,
token.symbol,
@@ -19,7 +24,8 @@ export class TokenRegWrapper {
token.swarmHash,
{ from },
);
return tx;
await this._web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
return txHash;
}
public async getTokenMetaDataAsync(tokenAddress: string): Promise<Token> {
const data = await this._tokenReg.getTokenMetaData.callAsync(tokenAddress);

View File

@@ -1,5 +1,6 @@
import { AbiDefinition, ContractAbi, Order, OrderWithoutExchangeAddress } from '@0xproject/types';
import { Order, OrderWithoutExchangeAddress } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { AbiDefinition, ContractAbi } from 'ethereum-types';
export interface ERC20BalancesByOwner {
[ownerAddress: string]: {

View File

@@ -1,7 +1,7 @@
import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils';
import { prependSubprovider } from '@0xproject/subproviders';
import { Provider } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider } from 'ethereum-types';
import { coverage } from './coverage';

View File

@@ -1,7 +1,7 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { LogWithDecodedArgs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
import * as Web3 from 'web3';
@@ -66,8 +66,14 @@ describe('AssetProxyOwner', () => {
SECONDS_TIME_LOCKED,
);
multiSigWrapper = new MultiSigWrapper(multiSig, provider);
await erc20Proxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: initialOwner });
await erc721Proxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: initialOwner });
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: initialOwner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721Proxy.transferOwnership.sendTransactionAsync(multiSig.address, { from: initialOwner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();

View File

@@ -83,7 +83,10 @@ describe('EtherToken', () => {
it('should convert ether tokens to ether with sufficient balance', async () => {
const ethToDeposit = new BigNumber(Web3Wrapper.toWei(new BigNumber(1)));
await etherToken.deposit.sendTransactionAsync({ value: ethToDeposit });
await web3Wrapper.awaitTransactionSuccessAsync(
await etherToken.deposit.sendTransactionAsync({ value: ethToDeposit }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const initEthTokenBalance = await etherToken.balanceOf.callAsync(account);
const initEthBalance = await web3Wrapper.getBalanceInWeiAsync(account);
const ethTokensToWithdraw = initEthTokenBalance;

View File

@@ -1,9 +1,10 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils';
import { AssetProxyId, LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { AssetProxyId, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import 'make-promises-safe';

View File

@@ -1,9 +1,10 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, crypto } from '@0xproject/order-utils';
import { AssetProxyId, LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { AssetProxyId, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';

View File

@@ -1,9 +1,10 @@
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
import { AssetProxyId, LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { AssetProxyId } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import BN = require('bn.js');
import * as chai from 'chai';
import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as Web3 from 'web3';

View File

@@ -1,8 +1,8 @@
import { BlockchainLifecycle, web3Factory } from '@0xproject/dev-utils';
import { LogWithDecodedArgs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
import * as Web3 from 'web3';

View File

@@ -35,7 +35,7 @@ describe('TokenRegistry', () => {
owner = accounts[0];
notOwner = accounts[1];
tokenReg = await TokenRegistryContract.deployFrom0xArtifactAsync(artifacts.TokenRegistry, provider, txDefaults);
tokenRegWrapper = new TokenRegWrapper(tokenReg);
tokenRegWrapper = new TokenRegWrapper(tokenReg, provider);
});
beforeEach(async () => {
await blockchainLifecycle.startAsync();

View File

@@ -1,6 +1,6 @@
// import { ECSignature, SignedOrder, ZeroEx } from '0x.js';
// import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
// import { ExchangeContractErrs } from '@0xproject/types';
// import { ExchangeContractErrs } from 'ethereum-types';
// import { BigNumber } from '@0xproject/utils';
// import { Web3Wrapper } from '@0xproject/web3-wrapper';
// import * as chai from 'chai';

View File

@@ -64,7 +64,10 @@ describe('UnlimitedAllowanceToken', () => {
const receiver = spender;
const initOwnerBalance = await token.balanceOf.callAsync(owner);
const amountToTransfer = new BigNumber(1);
await token.transfer.sendTransactionAsync(receiver, amountToTransfer, { from: owner });
await web3Wrapper.awaitTransactionSuccessAsync(
await token.transfer.sendTransactionAsync(receiver, amountToTransfer, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const finalOwnerBalance = await token.balanceOf.callAsync(owner);
const finalReceiverBalance = await token.balanceOf.callAsync(receiver);
@@ -86,7 +89,10 @@ describe('UnlimitedAllowanceToken', () => {
it('should throw if owner has insufficient balance', async () => {
const ownerBalance = await token.balanceOf.callAsync(owner);
const amountToTransfer = ownerBalance.plus(1);
await token.approve.sendTransactionAsync(spender, amountToTransfer, { from: owner });
await web3Wrapper.awaitTransactionSuccessAsync(
await token.approve.sendTransactionAsync(spender, amountToTransfer, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
return expect(
token.transferFrom.callAsync(owner, spender, amountToTransfer, {
from: spender,
@@ -121,11 +127,17 @@ describe('UnlimitedAllowanceToken', () => {
const initOwnerBalance = await token.balanceOf.callAsync(owner);
const amountToTransfer = initOwnerBalance;
const initSpenderAllowance = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner });
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
});
await web3Wrapper.awaitTransactionSuccessAsync(
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const newSpenderAllowance = await token.allowance.callAsync(owner, spender);
expect(initSpenderAllowance).to.be.bignumber.equal(newSpenderAllowance);
@@ -135,11 +147,17 @@ describe('UnlimitedAllowanceToken', () => {
const initOwnerBalance = await token.balanceOf.callAsync(owner);
const amountToTransfer = initOwnerBalance;
const initSpenderAllowance = initOwnerBalance;
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner });
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
});
await web3Wrapper.awaitTransactionSuccessAsync(
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const newOwnerBalance = await token.balanceOf.callAsync(owner);
const newSpenderBalance = await token.balanceOf.callAsync(spender);
@@ -152,11 +170,17 @@ describe('UnlimitedAllowanceToken', () => {
const initOwnerBalance = await token.balanceOf.callAsync(owner);
const amountToTransfer = initOwnerBalance;
const initSpenderAllowance = initOwnerBalance;
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner });
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
});
await web3Wrapper.awaitTransactionSuccessAsync(
await token.approve.sendTransactionAsync(spender, initSpenderAllowance, { from: owner }),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await token.transferFrom.sendTransactionAsync(owner, spender, amountToTransfer, {
from: spender,
gas: constants.MAX_TOKEN_TRANSFERFROM_GAS,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
const newSpenderAllowance = await token.allowance.callAsync(owner, spender);
expect(newSpenderAllowance).to.be.bignumber.equal(0);

View File

@@ -46,6 +46,7 @@
"dependencies": {
"@0xproject/subproviders": "^0.10.2",
"@0xproject/types": "^0.7.0",
"ethereum-types": "^0.0.1",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/web3-wrapper": "^0.6.4",
"lodash": "^4.17.4",

View File

@@ -7,7 +7,7 @@ import ProviderEngine = require('web3-provider-engine');
import RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
import { EmptyWalletSubprovider, FakeGasEstimateSubprovider, GanacheSubprovider } from '@0xproject/subproviders';
import { Provider } from '@0xproject/types';
import { Provider } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import * as process from 'process';

View File

@@ -1,6 +1,6 @@
import { BlockParamLiteral } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { BlockParamLiteral } from 'ethereum-types';
import 'make-promises-safe';
import 'mocha';

View File

@@ -1,6 +1,6 @@
import { BlockParamLiteral } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { BlockParamLiteral } from 'ethereum-types';
import 'make-promises-safe';
import 'mocha';

View File

@@ -0,0 +1,6 @@
.*
yarn-error.log
/scripts/
/src/
tsconfig.json
/lib/monorepo_scripts/

View File

@@ -0,0 +1,11 @@
[
{
"version": "0.0.1",
"changes": [
{
"note": "Initial publish",
"pr": "642"
}
]
}
]

View File

@@ -0,0 +1,61 @@
## ethereum-types
Typescript types shared across Ethereum-related packages/libraries/tools.
## Installation
```bash
yarn add -D ethereum-types
```
## Usage
```javascript
import { TransactionReceipt, TxData, TxDataPayable } from 'ethereum-types';
```
## Contributing
We welcome improvements and fixes from the wider community! 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
```
### Build
To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
PKG=ethereum-types yarn build
```
Or continuously rebuild on change:
```bash
PKG=ethereum-types yarn watch
```
### Clean
```bash
yarn clean
```
### Lint
```bash
yarn lint
```

View File

@@ -0,0 +1,42 @@
{
"name": "ethereum-types",
"version": "0.0.1",
"engines": {
"node": ">=6.12"
},
"description": "Ethereum types",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"watch": "tsc -w",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib scripts",
"lint": "tslint --project .",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"bugs": {
"url": "https://github.com/0xProject/0x-monorepo/issues"
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/ethereum-types/README.md",
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "2.7.1"
},
"dependencies": {
"@types/node": "^8.0.53",
"bignumber.js": "~4.1.0"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -0,0 +1,6 @@
declare module '*.json' {
const json: any;
/* tslint:disable */
export default json;
/* tslint:enable */
}

View File

@@ -0,0 +1,281 @@
import { BigNumber } from 'bignumber.js';
export type JSONRPCErrorCallback = (err: Error | null, result?: JSONRPCResponsePayload) => void;
/**
* Do not create your own provider. Use an existing provider from a Web3 or ProviderEngine library
* Read more about Providers in the 0x wiki.
*/
export interface Provider {
sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
}
export type ContractAbi = AbiDefinition[];
export type AbiDefinition = FunctionAbi | EventAbi;
export type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi;
export type ConstructorStateMutability = 'nonpayable' | 'payable';
export type StateMutability = 'pure' | 'view' | ConstructorStateMutability;
export interface MethodAbi {
type: AbiType.Function;
name: string;
inputs: DataItem[];
outputs: DataItem[];
constant: boolean;
stateMutability: StateMutability;
payable: boolean;
}
export interface ConstructorAbi {
type: AbiType.Constructor;
inputs: DataItem[];
payable: boolean;
stateMutability: ConstructorStateMutability;
}
export interface FallbackAbi {
type: AbiType.Fallback;
payable: boolean;
}
export interface EventParameter extends DataItem {
indexed: boolean;
}
export interface EventAbi {
type: AbiType.Event;
name: string;
inputs: EventParameter[];
anonymous: boolean;
}
export interface DataItem {
name: string;
type: string;
components?: DataItem[];
}
export enum OpCode {
DelegateCall = 'DELEGATECALL',
Revert = 'REVERT',
Create = 'CREATE',
Stop = 'STOP',
Invalid = 'INVALID',
CallCode = 'CALLCODE',
StaticCall = 'STATICCALL',
Return = 'RETURN',
Call = 'CALL',
SelfDestruct = 'SELFDESTRUCT',
}
export interface StructLog {
depth: number;
error: string;
gas: number;
gasCost: number;
memory: string[];
op: OpCode;
pc: number;
stack: string[];
storage: { [location: string]: string };
}
export interface TransactionTrace {
gas: number;
returnValue: any;
structLogs: StructLog[];
}
export type Unit =
| 'kwei'
| 'ada'
| 'mwei'
| 'babbage'
| 'gwei'
| 'shannon'
| 'szabo'
| 'finney'
| 'ether'
| 'kether'
| 'grand'
| 'einstein'
| 'mether'
| 'gether'
| 'tether';
export interface JSONRPCRequestPayload {
params: any[];
method: string;
id: number;
jsonrpc: string;
}
export interface JSONRPCResponsePayload {
result: any;
id: number;
jsonrpc: string;
}
export interface AbstractBlock {
number: number | null;
hash: string | null;
parentHash: string;
nonce: string | null;
sha3Uncles: string;
logsBloom: string | null;
transactionsRoot: string;
stateRoot: string;
miner: string;
difficulty: BigNumber;
totalDifficulty: BigNumber;
extraData: string;
size: number;
gasLimit: number;
gasUsed: number;
timestamp: number;
uncles: string[];
}
export interface BlockWithoutTransactionData extends AbstractBlock {
transactions: string[];
}
export interface BlockWithTransactionData extends AbstractBlock {
transactions: Transaction[];
}
export interface Transaction {
hash: string;
nonce: number;
blockHash: string | null;
blockNumber: number | null;
transactionIndex: number | null;
from: string;
to: string | null;
value: BigNumber;
gasPrice: BigNumber;
gas: number;
input: string;
}
export interface CallTxDataBase {
to?: string;
value?: number | string | BigNumber;
gas?: number | string | BigNumber;
gasPrice?: number | string | BigNumber;
data?: string;
nonce?: number;
}
export interface TxData extends CallTxDataBase {
from: string;
}
export interface CallData extends CallTxDataBase {
from?: string;
}
export interface FilterObject {
fromBlock?: number | string;
toBlock?: number | string;
address?: string;
topics?: LogTopic[];
}
export type LogTopic = null | string | string[];
export interface DecodedLogEntry<A> extends LogEntry {
event: string;
args: A;
}
export interface DecodedLogEntryEvent<A> extends DecodedLogEntry<A> {
removed: boolean;
}
export interface LogEntryEvent extends LogEntry {
removed: boolean;
}
export interface LogEntry {
logIndex: number | null;
transactionIndex: number | null;
transactionHash: string;
blockHash: string | null;
blockNumber: number | null;
address: string;
data: string;
topics: string[];
}
export interface TxDataPayable extends TxData {
value?: BigNumber;
}
export interface TransactionReceipt {
blockHash: string;
blockNumber: number;
transactionHash: string;
transactionIndex: number;
from: string;
to: string;
status: null | string | 0 | 1;
cumulativeGasUsed: number;
gasUsed: number;
contractAddress: string | null;
logs: LogEntry[];
}
export enum AbiType {
Function = 'function',
Constructor = 'constructor',
Event = 'event',
Fallback = 'fallback',
}
export type ContractEventArg = string | BigNumber | number | boolean;
export interface DecodedLogArgs {
[argName: string]: ContractEventArg;
}
export interface LogWithDecodedArgs<ArgsType extends DecodedLogArgs> extends DecodedLogEntry<ArgsType> {}
export type RawLog = LogEntry;
export enum BlockParamLiteral {
Earliest = 'earliest',
Latest = 'latest',
Pending = 'pending',
}
export type BlockParam = BlockParamLiteral | number;
export interface RawLogEntry {
logIndex: string | null;
transactionIndex: string | null;
transactionHash: string;
blockHash: string | null;
blockNumber: string | null;
address: string;
data: string;
topics: string[];
}
export enum SolidityTypes {
Address = 'address',
Uint256 = 'uint256',
Uint8 = 'uint8',
Uint = 'uint',
}
/**
* Contains the logs returned by a TransactionReceipt. We attempt to decode the
* logs using AbiDecoder. If we have the logs corresponding ABI, we decode it,
* otherwise we don't.
*/
export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
logs: Array<LogWithDecodedArgs<DecodedLogArgs> | LogEntry>;
}

View File

@@ -0,0 +1,8 @@
import { postpublishUtils } from '@0xproject/monorepo-scripts';
import * as packageJSON from '../package.json';
import * as tsConfigJSON from '../tsconfig.json';
const cwd = `${__dirname}/..`;
// tslint:disable-next-line:no-floating-promises
postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd);

View File

@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"typeRoots": ["../../node_modules/@types"],
"outDir": "lib"
},
"include": ["src/**/*"]
}

View File

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

View File

@@ -39,6 +39,7 @@
"@0xproject/base-contract": "^0.3.2",
"@0xproject/order-utils": "0.0.5",
"@0xproject/types": "0.7.0",
"ethereum-types": "^0.0.1",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",

View File

@@ -27,7 +27,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/json-schemas/",
"s3StagingBucketPath": "s3://staging-doc-jsons/json-schemas/"

View File

@@ -35,6 +35,7 @@
"@0xproject/types": "^0.7.0",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"ethers": "^3.0.15",
"lodash": "^4.17.4",
"web3-provider-engine": "^14.0.4"

View File

@@ -1,9 +1,9 @@
import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils';
import { ContractArtifact } from '@0xproject/sol-compiler';
import { LogWithDecodedArgs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import 'make-promises-safe';
import * as MetacoinArtifact from '../artifacts/Metacoin.json';

View File

@@ -53,6 +53,7 @@
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"ethers": "^3.0.15",
"lodash": "^4.17.4"
},

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { devConstants, web3Factory } from '@0xproject/dev-utils';
import { Provider } from '@0xproject/types';
import { logUtils } from '@0xproject/utils';
import { Provider } from 'ethereum-types';
import * as path from 'path';
import * as yargs from 'yargs';

View File

@@ -1,6 +1,6 @@
import { Provider, TxData } from '@0xproject/types';
import { BigNumber, NULL_BYTES } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import { ArtifactWriter } from '../artifact_writer';

View File

@@ -1,6 +1,6 @@
import { Provider, TxData } from '@0xproject/types';
import { BigNumber, NULL_BYTES } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import { ArtifactWriter } from '../artifact_writer';

View File

@@ -30,7 +30,8 @@
"postpublish": {
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/order-utils/",
"s3StagingBucketPath": "s3://staging-doc-jsons/order-utils/"
@@ -50,6 +51,8 @@
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/ethereumjs-abi": "^0.6.0",
"@types/bn.js": "^4.11.0",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",

View File

@@ -86,6 +86,7 @@
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"ethereum-types": "^0.0.1",
"bintrees": "^1.0.2",
"ethers": "^3.0.15",
"lodash": "^4.17.4"

View File

@@ -28,6 +28,7 @@
"@0xproject/dev-utils": "^0.4.2",
"@0xproject/monorepo-scripts": "^0.1.20",
"@0xproject/tslint-config": "^0.4.18",
"@types/compare-versions": "^3.0.0",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",

View File

@@ -41,6 +41,7 @@
"@types/react": "16.3.13",
"@types/react-dom": "^16.0.3",
"@types/react-scroll": "0.0.31",
"@types/is-mobile": "0.3.0",
"basscss": "^8.0.3",
"is-mobile": "^0.2.2",
"lodash": "^4.17.4",

View File

@@ -28,7 +28,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/sol-compiler/",
"s3StagingBucketPath": "s3://staging-doc-jsons/sol-compiler/"
@@ -80,6 +81,7 @@
"@0xproject/utils": "^0.6.2",
"@0xproject/web3-wrapper": "^0.6.4",
"@types/yargs": "^11.0.0",
"ethereum-types": "^0.0.1",
"chalk": "^2.3.0",
"ethereumjs-util": "^5.1.1",
"isomorphic-fetch": "^2.2.1",

View File

@@ -11,9 +11,9 @@ import {
Resolver,
URLResolver,
} from '@0xproject/sol-resolver';
import { ContractAbi } from '@0xproject/types';
import { logUtils, promisify } from '@0xproject/utils';
import chalk from 'chalk';
import { ContractAbi } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
import * as fs from 'fs';
import 'isomorphic-fetch';

View File

@@ -1,4 +1,4 @@
import { AbiDefinition, AbiType, ContractAbi, DataItem } from '@0xproject/types';
import { AbiDefinition, AbiType, ContractAbi, DataItem } from 'ethereum-types';
import * as _ from 'lodash';
import * as web3Abi from 'web3-eth-abi';

View File

@@ -1,4 +1,4 @@
import { ContractAbi, Provider, TxData } from '@0xproject/types';
import { ContractAbi, Provider, TxData } from 'ethereum-types';
import * as solc from 'solc';
import * as Web3 from 'web3';
import * as yargs from 'yargs';

View File

@@ -1,5 +1,5 @@
import { web3Factory } from '@0xproject/dev-utils';
import { Provider } from '@0xproject/types';
import { Provider } from 'ethereum-types';
import * as Web3 from 'web3';
const providerConfigs = { shouldUseInProcessGanache: true };

View File

@@ -29,7 +29,8 @@
"docPublishConfigs": {
"extraFileIncludes": [
"../subproviders/src/types.ts",
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/sol-cov/",
"s3StagingBucketPath": "s3://staging-doc-jsons/sol-cov/"
@@ -48,9 +49,9 @@
"dependencies": {
"@0xproject/sol-compiler": "^0.5.0",
"@0xproject/subproviders": "^0.10.2",
"@0xproject/types": "1.0.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"ethereum-types": "^0.0.1",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
@@ -67,6 +68,7 @@
"@types/istanbul": "^0.4.30",
"@types/loglevel": "^1.5.3",
"@types/mkdirp": "^0.5.1",
"@types/solidity-parser-antlr": "^0.2.0",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
"@types/rimraf": "^2.0.2",

View File

@@ -1,5 +1,5 @@
import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders';
import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from '@0xproject/types';
import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import { Lock } from 'semaphore-async-await';

View File

@@ -1,5 +1,5 @@
import { OpCode, StructLog, TransactionTrace } from '@0xproject/types';
import { addressUtils, BigNumber, logUtils } from '@0xproject/utils';
import { OpCode, StructLog, TransactionTrace } from 'ethereum-types';
import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
import * as fs from 'fs';
import * as _ from 'lodash';

View File

@@ -1,5 +1,5 @@
import { OpCode, StructLog } from '@0xproject/types';
import * as chai from 'chai';
import { OpCode, StructLog } from 'ethereum-types';
import * as fs from 'fs';
import * as _ from 'lodash';
import 'mocha';

View File

@@ -31,7 +31,8 @@
"assets": [],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts"
"../types/src/index.ts",
"../ethereum-types/src/index.ts"
],
"s3BucketPath": "s3://doc-jsons/subproviders/",
"s3StagingBucketPath": "s3://staging-doc-jsons/subproviders/"
@@ -45,6 +46,7 @@
"@0xproject/utils": "^0.6.2",
"@ledgerhq/hw-app-eth": "^4.3.0",
"@ledgerhq/hw-transport-u2f": "^4.3.0",
"ethereum-types": "^0.0.1",
"bip39": "^2.5.0",
"bn.js": "^4.11.8",
"ethereumjs-tx": "^1.3.3",
@@ -61,6 +63,9 @@
"@0xproject/tslint-config": "^0.4.18",
"@0xproject/utils": "^0.6.2",
"@types/bip39": "^2.4.0",
"@types/bn.js": "^4.11.0",
"@types/hdkey": "^0.7.0",
"@types/ethereumjs-tx": "^1.0.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",

View File

@@ -1,6 +1,6 @@
import { assert } from '@0xproject/assert';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types';
import { addressUtils } from '@0xproject/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
import * as _ from 'lodash';
import { Callback, ErrorCallback, PartialTxParams, ResponseWithTxParams, WalletSubproviderErrors } from '../types';

View File

@@ -1,4 +1,4 @@
import { JSONRPCRequestPayload } from '@0xproject/types';
import { JSONRPCRequestPayload } from 'ethereum-types';
import { Callback, ErrorCallback } from '../types';

View File

@@ -1,4 +1,4 @@
import { JSONRPCRequestPayload } from '@0xproject/types';
import { JSONRPCRequestPayload } from 'ethereum-types';
import { Callback, ErrorCallback } from '../types';

View File

@@ -1,4 +1,4 @@
import { JSONRPCRequestPayload, Provider } from '@0xproject/types';
import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
import * as Ganache from 'ganache-core';
import { Callback, ErrorCallback } from '../types';

View File

@@ -1,4 +1,4 @@
import { JSONRPCRequestPayload, Provider } from '@0xproject/types';
import { JSONRPCRequestPayload, Provider } from 'ethereum-types';
import * as _ from 'lodash';
import * as Web3 from 'web3';

View File

@@ -1,6 +1,6 @@
import * as _ from 'lodash';
import { BlockParamLiteral, JSONRPCRequestPayload } from '@0xproject/types';
import { BlockParamLiteral, JSONRPCRequestPayload } from 'ethereum-types';
import EthereumTx = require('ethereumjs-tx');
import ethUtil = require('ethereumjs-util');
import providerEngineUtils = require('web3-provider-engine/util/rpc-cache-utils');

View File

@@ -1,5 +1,5 @@
import { JSONRPCRequestPayload } from '@0xproject/types';
import { promisify } from '@0xproject/utils';
import { JSONRPCRequestPayload } from 'ethereum-types';
import * as _ from 'lodash';
import { Callback } from '../types';

View File

@@ -1,5 +1,5 @@
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types';
import { promisify } from '@0xproject/utils';
import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
import * as Web3 from 'web3';
import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../types';

View File

@@ -1,4 +1,5 @@
import { ECSignature, JSONRPCRequestPayload } from '@0xproject/types';
import { ECSignature } from '@0xproject/types';
import { JSONRPCRequestPayload } from 'ethereum-types';
import HDNode = require('hdkey');
import * as _ from 'lodash';

View File

@@ -1,10 +1,11 @@
import { DoneCallback, JSONRPCResponsePayload } from '@0xproject/types';
import { DoneCallback } from '@0xproject/types';
import { promisify } from '@0xproject/utils';
import Eth from '@ledgerhq/hw-app-eth';
// HACK: This dependency is optional and tslint skips optional dependencies
// tslint:disable-next-line:no-implicit-dependencies
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as ethUtils from 'ethereumjs-util';
import * as _ from 'lodash';
import 'make-promises-safe';

View File

@@ -1,5 +1,5 @@
import { JSONRPCResponsePayload } from '@0xproject/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as ethUtils from 'ethereumjs-util';
import * as _ from 'lodash';
import 'make-promises-safe';

View File

@@ -1,5 +1,5 @@
import { JSONRPCResponsePayload } from '@0xproject/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as ethUtils from 'ethereumjs-util';
import * as _ from 'lodash';
import 'make-promises-safe';

View File

@@ -1,5 +1,5 @@
import { JSONRPCResponsePayload } from '@0xproject/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as ethUtils from 'ethereumjs-util';
import * as _ from 'lodash';
import 'make-promises-safe';

View File

@@ -1,5 +1,6 @@
import { DoneCallback, JSONRPCResponsePayload } from '@0xproject/types';
import { DoneCallback } from '@0xproject/types';
import * as chai from 'chai';
import { JSONRPCResponsePayload } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
import Web3 = require('web3');

View File

@@ -20,7 +20,6 @@
"dependencies": {
"0x.js": "^0.38.0",
"@0xproject/subproviders": "^0.10.2",
"@0xproject/types": "^0.7.0",
"@0xproject/typescript-typings": "^0.3.2",
"@0xproject/utils": "^0.6.2",
"body-parser": "^1.17.1",
@@ -37,6 +36,7 @@
"@types/body-parser": "^1.16.1",
"@types/express": "^4.0.35",
"@types/lodash": "4.14.104",
"ethereum-types": "^0.0.1",
"awesome-typescript-loader": "^3.1.3",
"gulp": "^3.9.1",
"make-promises-safe": "^1.1.0",

View File

@@ -1,6 +1,6 @@
import { Order, SignedOrder, ZeroEx } from '0x.js';
import { Provider } from '@0xproject/types';
import { BigNumber, logUtils } from '@0xproject/utils';
import { Provider } from 'ethereum-types';
import * as express from 'express';
import * as _ from 'lodash';
import * as Web3 from 'web3';

View File

@@ -34,7 +34,8 @@
},
"dependencies": {
"@types/node": "^8.0.53",
"bignumber.js": "~4.1.0"
"bignumber.js": "~4.1.0",
"ethereum-types": "^0.0.1"
},
"publishConfig": {
"access": "public"

View File

@@ -1,285 +1,5 @@
import { BigNumber } from 'bignumber.js';
export type JSONRPCErrorCallback = (err: Error | null, result?: JSONRPCResponsePayload) => void;
/**
* Do not create your own provider. Use an existing provider from a Web3 or ProviderEngine library
* Read more about Providers in the 0x wiki.
*/
export interface Provider {
sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
}
export type ContractAbi = AbiDefinition[];
export type AbiDefinition = FunctionAbi | EventAbi;
export type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi;
export type ConstructorStateMutability = 'nonpayable' | 'payable';
export type StateMutability = 'pure' | 'view' | ConstructorStateMutability;
export interface MethodAbi {
type: AbiType.Function;
name: string;
inputs: DataItem[];
outputs: DataItem[];
constant: boolean;
stateMutability: StateMutability;
payable: boolean;
}
export interface ConstructorAbi {
type: AbiType.Constructor;
inputs: DataItem[];
payable: boolean;
stateMutability: ConstructorStateMutability;
}
export interface FallbackAbi {
type: AbiType.Fallback;
payable: boolean;
}
export interface EventParameter extends DataItem {
indexed: boolean;
}
export interface EventAbi {
type: AbiType.Event;
name: string;
inputs: EventParameter[];
anonymous: boolean;
}
export interface DataItem {
name: string;
type: string;
components?: DataItem[];
}
export enum OpCode {
DelegateCall = 'DELEGATECALL',
Revert = 'REVERT',
Create = 'CREATE',
Stop = 'STOP',
Invalid = 'INVALID',
CallCode = 'CALLCODE',
StaticCall = 'STATICCALL',
Return = 'RETURN',
Call = 'CALL',
SelfDestruct = 'SELFDESTRUCT',
}
export interface StructLog {
depth: number;
error: string;
gas: number;
gasCost: number;
memory: string[];
op: OpCode;
pc: number;
stack: string[];
storage: { [location: string]: string };
}
export interface TransactionTrace {
gas: number;
returnValue: any;
structLogs: StructLog[];
}
export type Unit =
| 'kwei'
| 'ada'
| 'mwei'
| 'babbage'
| 'gwei'
| 'shannon'
| 'szabo'
| 'finney'
| 'ether'
| 'kether'
| 'grand'
| 'einstein'
| 'mether'
| 'gether'
| 'tether';
export interface JSONRPCRequestPayload {
params: any[];
method: string;
id: number;
jsonrpc: string;
}
export interface JSONRPCResponsePayload {
result: any;
id: number;
jsonrpc: string;
}
export interface AbstractBlock {
number: number | null;
hash: string | null;
parentHash: string;
nonce: string | null;
sha3Uncles: string;
logsBloom: string | null;
transactionsRoot: string;
stateRoot: string;
miner: string;
difficulty: BigNumber;
totalDifficulty: BigNumber;
extraData: string;
size: number;
gasLimit: number;
gasUsed: number;
timestamp: number;
uncles: string[];
}
export interface BlockWithoutTransactionData extends AbstractBlock {
transactions: string[];
}
export interface BlockWithTransactionData extends AbstractBlock {
transactions: Transaction[];
}
export interface Transaction {
hash: string;
nonce: number;
blockHash: string | null;
blockNumber: number | null;
transactionIndex: number | null;
from: string;
to: string | null;
value: BigNumber;
gasPrice: BigNumber;
gas: number;
input: string;
}
export interface CallTxDataBase {
to?: string;
value?: number | string | BigNumber;
gas?: number | string | BigNumber;
gasPrice?: number | string | BigNumber;
data?: string;
nonce?: number;
}
export interface TxData extends CallTxDataBase {
from: string;
}
export interface CallData extends CallTxDataBase {
from?: string;
}
export interface FilterObject {
fromBlock?: number | string;
toBlock?: number | string;
address?: string;
topics?: LogTopic[];
}
export type LogTopic = null | string | string[];
export interface DecodedLogEntry<A> extends LogEntry {
event: string;
args: A;
}
export interface DecodedLogEntryEvent<A> extends DecodedLogEntry<A> {
removed: boolean;
}
export interface LogEntryEvent extends LogEntry {
removed: boolean;
}
export interface LogEntry {
logIndex: number | null;
transactionIndex: number | null;
transactionHash: string;
blockHash: string | null;
blockNumber: number | null;
address: string;
data: string;
topics: string[];
}
export interface TxDataPayable extends TxData {
value?: BigNumber;
}
export interface TransactionReceipt {
blockHash: string;
blockNumber: number;
transactionHash: string;
transactionIndex: number;
from: string;
to: string;
status: null | string | 0 | 1;
cumulativeGasUsed: number;
gasUsed: number;
contractAddress: string | null;
logs: LogEntry[];
}
export enum AbiType {
Function = 'function',
Constructor = 'constructor',
Event = 'event',
Fallback = 'fallback',
}
export type ContractEventArg = string | BigNumber | number;
export interface DecodedLogArgs {
[argName: string]: ContractEventArg;
}
export interface LogWithDecodedArgs<ArgsType> extends DecodedLogEntry<ArgsType> {}
export type RawLog = LogEntry;
export enum SolidityTypes {
Address = 'address',
Uint256 = 'uint256',
Uint8 = 'uint8',
Uint = 'uint',
}
/**
* Contains the logs returned by a TransactionReceipt. We attempt to decode the
* logs using AbiDecoder. If we have the logs corresponding ABI, we decode it,
* otherwise we don't.
*/
export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
logs: Array<LogWithDecodedArgs<DecodedLogArgs> | LogEntry>;
}
// Earliest is omitted by design. It is simply an alias for the `0` constant and
// is thus not very helpful. Moreover, this type is used in places that only accept
// `latest` or `pending`.
export enum BlockParamLiteral {
Latest = 'latest',
Pending = 'pending',
}
export type BlockParam = BlockParamLiteral | number;
export interface RawLogEntry {
logIndex: string | null;
transactionIndex: string | null;
transactionHash: string;
blockHash: string | null;
blockNumber: string | null;
address: string;
data: string;
topics: string[];
}
import { ContractAbi, DecodedLogArgs, LogEntry, LogWithDecodedArgs, TransactionReceipt } from 'ethereum-types';
export interface Order {
senderAddress: string;

View File

@@ -1,17 +1,17 @@
[
{
"version": "0.5.0",
"changes": [
{
"note": "Add types for `react-popper`, remove types for `react-joyride`"
}
]
},
{
"version": "0.4.0",
"changes": [
{
"note": "Add types for `react-joyride`"
},
{
"note": "Add types for `react-popper`, remove types for `react-joyride`"
},
{
"note":
"Remove types for blockies, bn.js, compare-versions, ethereumjs-abi, ethereumjs-tx, find-versions, hdkey, is-mobile, solidity-parser-antlr, xml-js as they were moved to DefinitelyTyped",
"pr": 641
}
]
},

View File

@@ -25,13 +25,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme",
"dependencies": {
"@0xproject/types": "^0.7.0",
"ethereum-types": "^0.0.1",
"bignumber.js": "~4.1.0"
},
"devDependencies": {
"@0xproject/monorepo-scripts": "^0.1.20",
"copyfiles": "^1.2.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2"
},
"publishConfig": {

View File

@@ -1,11 +0,0 @@
// blockies declarations
declare interface BlockiesIcon {
toDataURL(): string;
}
declare interface BlockiesConfig {
seed: string;
}
declare function blockies(config: BlockiesConfig): BlockiesIcon;
declare module 'blockies' {
export = blockies;
}

View File

@@ -1,57 +0,0 @@
declare module 'bn.js' {
import { Buffer } from 'buffer';
type Endianness = 'le' | 'be';
class BN {
constructor(num: number | string | number[] | Buffer, base?: number, endian?: Endianness);
public clone(): BN;
public toString(base?: number, length?: number): string;
public toNumber(): number;
public toJSON(): string;
public toArray(endian?: Endianness, length?: number): number[];
public toBuffer(endian?: Endianness, length?: number): Buffer;
public bitLength(): number;
public zeroBits(): number;
public byteLength(): number;
public isNeg(): boolean;
public isEven(): boolean;
public isOdd(): boolean;
public isZero(): boolean;
public cmp(b: any): number;
public lt(b: any): boolean;
public lte(b: any): boolean;
public gt(b: any): boolean;
public gte(b: any): boolean;
public eq(b: any): boolean;
public isBN(b: any): boolean;
public neg(): BN;
public abs(): BN;
public add(b: BN): BN;
public sub(b: BN): BN;
public mul(b: BN): BN;
public sqr(): BN;
public pow(b: BN): BN;
public div(b: BN): BN;
public mod(b: BN): BN;
public divRound(b: BN): BN;
public or(b: BN): BN;
public and(b: BN): BN;
public xor(b: BN): BN;
public setn(b: number): BN;
public shln(b: number): BN;
public shrn(b: number): BN;
public testn(b: number): boolean;
public maskn(b: number): BN;
public bincn(b: number): BN;
public notn(w: number): BN;
public gcd(b: BN): BN;
public egcd(b: BN): { a: BN; b: BN; gcd: BN };
public invm(b: BN): BN;
}
export = BN;
}

View File

@@ -1,5 +0,0 @@
// compare-version declarations
declare function compareVersions(firstVersion: string, secondVersion: string): number;
declare module 'compare-versions' {
export = compareVersions;
}

View File

@@ -1,5 +0,0 @@
declare module 'ethereumjs-abi' {
const soliditySHA3: (argTypes: string[], args: any[]) => Buffer;
const soliditySHA256: (argTypes: string[], args: any[]) => Buffer;
const methodID: (name: string, types: string[]) => Buffer;
}

View File

@@ -1,14 +0,0 @@
declare module 'ethereumjs-tx' {
class EthereumTx {
public raw: Buffer[];
public r: Buffer;
public s: Buffer;
public v: Buffer;
public nonce: Buffer;
public serialize(): Buffer;
public sign(buffer: Buffer): void;
public getSenderAddress(): Buffer;
constructor(txParams: any);
}
export = EthereumTx;
}

View File

@@ -1,5 +1,5 @@
declare module 'ethers' {
import { TxData } from '@0xproject/types';
import { TxData } from 'ethereum-types';
export interface TransactionDescription {
name: string;

View File

@@ -1,4 +0,0 @@
declare function findVersions(version: string): string[];
declare module 'find-versions' {
export = findVersions;
}

View File

@@ -1,5 +1,5 @@
declare module 'ganache-core' {
import { Provider } from '@0xproject/types';
import { Provider } from 'ethereum-types';
export interface GanacheOpts {
verbose?: boolean;
logger?: {

View File

@@ -1,11 +0,0 @@
declare module 'hdkey' {
class HDNode {
public static fromMasterSeed(seed: Buffer): HDNode;
public publicKey: Buffer;
public privateKey: Buffer;
public chainCode: Buffer;
public constructor();
public derive(path: string): HDNode;
}
export = HDNode;
}

View File

@@ -1,4 +0,0 @@
declare function isMobile(): boolean;
declare module 'is-mobile' {
export = isMobile;
}

View File

@@ -114,7 +114,7 @@ declare module 'solc' {
message: string;
formattedMessage?: string;
}
import { ContractAbi } from '@0xproject/types';
import { ContractAbi } from 'ethereum-types';
export interface StandardContractOutput {
abi: ContractAbi;
evm: {

View File

@@ -1,314 +0,0 @@
declare module 'solidity-parser-antlr' {
export interface BaseASTNode {
range: [number, number];
}
export interface SourceUnit extends BaseASTNode {}
export interface PragmaDirective extends BaseASTNode {}
export interface PragmaName extends BaseASTNode {}
export interface PragmaValue extends BaseASTNode {}
export interface Version extends BaseASTNode {}
export interface VersionOperator extends BaseASTNode {}
export interface VersionConstraint extends BaseASTNode {}
export interface ImportDeclaration extends BaseASTNode {}
export interface ImportDirective extends BaseASTNode {}
export interface ContractDefinition extends BaseASTNode {}
export interface InheritanceSpecifier extends BaseASTNode {}
export interface ContractPart extends BaseASTNode {}
export interface StateVariableDeclaration extends BaseASTNode {
variables: VariableDeclaration[];
}
export interface UsingForDeclaration extends BaseASTNode {}
export interface StructDefinition extends BaseASTNode {}
export interface ModifierDefinition extends BaseASTNode {
name: string;
}
export interface ModifierInvocation extends BaseASTNode {
name: string;
}
export interface FunctionDefinition extends BaseASTNode {
name: string;
}
export interface ReturnParameters extends BaseASTNode {}
export interface ModifierList extends BaseASTNode {}
export interface EventDefinition extends BaseASTNode {}
export interface EnumValue extends BaseASTNode {}
export interface EnumDefinition extends BaseASTNode {}
export interface ParameterList extends BaseASTNode {}
export interface Parameter extends BaseASTNode {}
export interface EventParameterList extends BaseASTNode {}
export interface EventParameter extends BaseASTNode {}
export interface FunctionTypeParameterList extends BaseASTNode {}
export interface FunctionTypeParameter extends BaseASTNode {}
export interface VariableDeclaration extends BaseASTNode {
visibility: 'public' | 'private';
isStateVar: boolean;
}
export interface TypeName extends BaseASTNode {}
export interface UserDefinedTypeName extends BaseASTNode {}
export interface Mapping extends BaseASTNode {}
export interface FunctionTypeName extends BaseASTNode {}
export interface StorageLocation extends BaseASTNode {}
export interface StateMutability extends BaseASTNode {}
export interface Block extends BaseASTNode {}
export interface Statement extends BaseASTNode {}
export interface ExpressionStatement extends BaseASTNode {
expression: ASTNode;
}
export interface IfStatement extends BaseASTNode {
trueBody: ASTNode;
falseBody: ASTNode;
}
export interface WhileStatement extends BaseASTNode {}
export interface SimpleStatement extends BaseASTNode {}
export interface ForStatement extends BaseASTNode {}
export interface InlineAssemblyStatement extends BaseASTNode {}
export interface DoWhileStatement extends BaseASTNode {}
export interface ContinueStatement extends BaseASTNode {}
export interface BreakStatement extends BaseASTNode {}
export interface ReturnStatement extends BaseASTNode {}
export interface ThrowStatement extends BaseASTNode {}
export interface VariableDeclarationStatement extends BaseASTNode {}
export interface IdentifierList extends BaseASTNode {}
export interface ElementaryTypeName extends BaseASTNode {}
export interface Expression extends BaseASTNode {}
export interface PrimaryExpression extends BaseASTNode {}
export interface ExpressionList extends BaseASTNode {}
export interface NameValueList extends BaseASTNode {}
export interface NameValue extends BaseASTNode {}
export interface FunctionCallArguments extends BaseASTNode {}
export interface AssemblyBlock extends BaseASTNode {}
export interface AssemblyItem extends BaseASTNode {}
export interface AssemblyExpression extends BaseASTNode {}
export interface AssemblyCall extends BaseASTNode {}
export interface AssemblyLocalDefinition extends BaseASTNode {}
export interface AssemblyAssignment extends BaseASTNode {}
export interface AssemblyIdentifierOrList extends BaseASTNode {}
export interface AssemblyIdentifierList extends BaseASTNode {}
export interface AssemblyStackAssignment extends BaseASTNode {}
export interface LabelDefinition extends BaseASTNode {}
export interface AssemblySwitch extends BaseASTNode {}
export interface AssemblyCase extends BaseASTNode {}
export interface AssemblyFunctionDefinition extends BaseASTNode {}
export interface AssemblyFunctionReturns extends BaseASTNode {}
export interface AssemblyFor extends BaseASTNode {}
export interface AssemblyIf extends BaseASTNode {}
export interface AssemblyLiteral extends BaseASTNode {}
export interface SubAssembly extends BaseASTNode {}
export interface TupleExpression extends BaseASTNode {}
export interface ElementaryTypeNameExpression extends BaseASTNode {}
export interface NumberLiteral extends BaseASTNode {}
export interface Identifier extends BaseASTNode {}
export type BinOp =
| '+'
| '-'
| '*'
| '/'
| '**'
| '%'
| '<<'
| '>>'
| '&&'
| '||'
| '&'
| '|'
| '^'
| '<'
| '>'
| '<='
| '>='
| '=='
| '!='
| '='
| '|='
| '^='
| '&='
| '<<='
| '>>='
| '+='
| '-='
| '*='
| '/='
| '%=';
export interface BinaryOperation extends BaseASTNode {
left: ASTNode;
right: ASTNode;
operator: BinOp;
}
export interface Conditional extends BaseASTNode {
trueExpression: ASTNode;
falseExpression: ASTNode;
}
export type ASTNode =
| SourceUnit
| PragmaDirective
| PragmaName
| PragmaValue
| Version
| VersionOperator
| VersionConstraint
| ImportDeclaration
| ImportDirective
| ContractDefinition
| InheritanceSpecifier
| ContractPart
| StateVariableDeclaration
| UsingForDeclaration
| StructDefinition
| ModifierDefinition
| ModifierInvocation
| FunctionDefinition
| ReturnParameters
| ModifierList
| EventDefinition
| EnumValue
| EnumDefinition
| ParameterList
| Parameter
| EventParameterList
| EventParameter
| FunctionTypeParameterList
| FunctionTypeParameter
| VariableDeclaration
| TypeName
| UserDefinedTypeName
| Mapping
| FunctionTypeName
| StorageLocation
| StateMutability
| Block
| Statement
| ExpressionStatement
| IfStatement
| WhileStatement
| SimpleStatement
| ForStatement
| InlineAssemblyStatement
| DoWhileStatement
| ContinueStatement
| BreakStatement
| ReturnStatement
| ThrowStatement
| VariableDeclarationStatement
| IdentifierList
| ElementaryTypeName
| Expression
| PrimaryExpression
| ExpressionList
| NameValueList
| NameValue
| FunctionCallArguments
| AssemblyBlock
| AssemblyItem
| AssemblyExpression
| AssemblyCall
| AssemblyLocalDefinition
| AssemblyAssignment
| AssemblyIdentifierOrList
| AssemblyIdentifierList
| AssemblyStackAssignment
| LabelDefinition
| AssemblySwitch
| AssemblyCase
| AssemblyFunctionDefinition
| AssemblyFunctionReturns
| AssemblyFor
| AssemblyIf
| AssemblyLiteral
| SubAssembly
| TupleExpression
| ElementaryTypeNameExpression
| NumberLiteral
| Identifier
| BinaryOperation
| Conditional;
export interface Visitor {
SourceUnit?: (node: SourceUnit) => void;
PragmaDirective?: (node: PragmaDirective) => void;
PragmaName?: (node: PragmaName) => void;
PragmaValue?: (node: PragmaValue) => void;
Version?: (node: Version) => void;
VersionOperator?: (node: VersionOperator) => void;
VersionConstraint?: (node: VersionConstraint) => void;
ImportDeclaration?: (node: ImportDeclaration) => void;
ImportDirective?: (node: ImportDirective) => void;
ContractDefinition?: (node: ContractDefinition) => void;
InheritanceSpecifier?: (node: InheritanceSpecifier) => void;
ContractPart?: (node: ContractPart) => void;
StateVariableDeclaration?: (node: StateVariableDeclaration) => void;
UsingForDeclaration?: (node: UsingForDeclaration) => void;
StructDefinition?: (node: StructDefinition) => void;
ModifierDefinition?: (node: ModifierDefinition) => void;
ModifierInvocation?: (node: ModifierInvocation) => void;
FunctionDefinition?: (node: FunctionDefinition) => void;
ReturnParameters?: (node: ReturnParameters) => void;
ModifierList?: (node: ModifierList) => void;
EventDefinition?: (node: EventDefinition) => void;
EnumValue?: (node: EnumValue) => void;
EnumDefinition?: (node: EnumDefinition) => void;
ParameterList?: (node: ParameterList) => void;
Parameter?: (node: Parameter) => void;
EventParameterList?: (node: EventParameterList) => void;
EventParameter?: (node: EventParameter) => void;
FunctionTypeParameterList?: (node: FunctionTypeParameterList) => void;
FunctionTypeParameter?: (node: FunctionTypeParameter) => void;
VariableDeclaration?: (node: VariableDeclaration) => void;
TypeName?: (node: TypeName) => void;
UserDefinedTypeName?: (node: UserDefinedTypeName) => void;
Mapping?: (node: Mapping) => void;
FunctionTypeName?: (node: FunctionTypeName) => void;
StorageLocation?: (node: StorageLocation) => void;
StateMutability?: (node: StateMutability) => void;
Block?: (node: Block) => void;
Statement?: (node: Statement) => void;
ExpressionStatement?: (node: ExpressionStatement) => void;
IfStatement?: (node: IfStatement) => void;
WhileStatement?: (node: WhileStatement) => void;
SimpleStatement?: (node: SimpleStatement) => void;
ForStatement?: (node: ForStatement) => void;
InlineAssemblyStatement?: (node: InlineAssemblyStatement) => void;
DoWhileStatement?: (node: DoWhileStatement) => void;
ContinueStatement?: (node: ContinueStatement) => void;
BreakStatement?: (node: BreakStatement) => void;
ReturnStatement?: (node: ReturnStatement) => void;
ThrowStatement?: (node: ThrowStatement) => void;
VariableDeclarationStatement?: (node: VariableDeclarationStatement) => void;
IdentifierList?: (node: IdentifierList) => void;
ElementaryTypeName?: (node: ElementaryTypeName) => void;
Expression?: (node: Expression) => void;
PrimaryExpression?: (node: PrimaryExpression) => void;
ExpressionList?: (node: ExpressionList) => void;
NameValueList?: (node: NameValueList) => void;
NameValue?: (node: NameValue) => void;
FunctionCallArguments?: (node: FunctionCallArguments) => void;
AssemblyBlock?: (node: AssemblyBlock) => void;
AssemblyItem?: (node: AssemblyItem) => void;
AssemblyExpression?: (node: AssemblyExpression) => void;
AssemblyCall?: (node: AssemblyCall) => void;
AssemblyLocalDefinition?: (node: AssemblyLocalDefinition) => void;
AssemblyAssignment?: (node: AssemblyAssignment) => void;
AssemblyIdentifierOrList?: (node: AssemblyIdentifierOrList) => void;
AssemblyIdentifierList?: (node: AssemblyIdentifierList) => void;
AssemblyStackAssignment?: (node: AssemblyStackAssignment) => void;
LabelDefinition?: (node: LabelDefinition) => void;
AssemblySwitch?: (node: AssemblySwitch) => void;
AssemblyCase?: (node: AssemblyCase) => void;
AssemblyFunctionDefinition?: (node: AssemblyFunctionDefinition) => void;
AssemblyFunctionReturns?: (node: AssemblyFunctionReturns) => void;
AssemblyFor?: (node: AssemblyFor) => void;
AssemblyIf?: (node: AssemblyIf) => void;
AssemblyLiteral?: (node: AssemblyLiteral) => void;
SubAssembly?: (node: SubAssembly) => void;
TupleExpression?: (node: TupleExpression) => void;
ElementaryTypeNameExpression?: (node: ElementaryTypeNameExpression) => void;
NumberLiteral?: (node: NumberLiteral) => void;
Identifier?: (node: Identifier) => void;
BinaryOperation?: (node: BinaryOperation) => void;
Conditional?: (node: Conditional) => void;
}
export interface ParserOpts {
range?: boolean;
}
export function parse(sourceCode: string, parserOpts: ParserOpts): ASTNode;
export function visit(ast: ASTNode, visitor: Visitor): void;
}

View File

@@ -1,5 +1,5 @@
declare module 'truffle-hdwallet-provider' {
import { JSONRPCRequestPayload, JSONRPCResponsePayload, Provider } from '@0xproject/types';
import { JSONRPCRequestPayload, JSONRPCResponsePayload, Provider } from 'ethereum-types';
class HDWalletProvider implements Provider {
constructor(mnemonic: string, rpcUrl: string);
public sendAsync(

Some files were not shown because too many files have changed in this diff Show More