aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-02-07 07:29:19 +0800
committerGitHub <noreply@github.com>2018-02-07 07:29:19 +0800
commit548246c05f128d23d701d9b738ce53deaf783f63 (patch)
tree2dd525ed3624352160c1de2747b7eb7932e28820 /packages/0x.js
parent629653425da973df0ac5d21d11da5a61c3a31e09 (diff)
parent4be8eca3fe6a81b468776f5413f25ec726e4e752 (diff)
downloaddexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.gz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.bz2
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.lz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.xz
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.tar.zst
dexon-sol-tools-548246c05f128d23d701d9b738ce53deaf783f63.zip
Merge pull request #355 from 0xProject/feature/subproviders/nonce-tracker
Nonce tracker subprovider
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts3
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts3
-rw-r--r--packages/0x.js/src/index.ts10
-rw-r--r--packages/0x.js/src/order_watcher/event_watcher.ts4
-rw-r--r--packages/0x.js/src/order_watcher/order_state_watcher.ts3
-rw-r--r--packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts2
-rw-r--r--packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts2
-rw-r--r--packages/0x.js/src/types.ts14
-rw-r--r--packages/0x.js/src/utils/exchange_transfer_simulator.ts3
-rw-r--r--packages/0x.js/test/exchange_transfer_simulator_test.ts3
-rw-r--r--packages/0x.js/test/exchange_wrapper_test.ts3
-rw-r--r--packages/0x.js/test/order_validation_test.ts3
12 files changed, 26 insertions, 27 deletions
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index d913e8d9b..b313273b5 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -1,4 +1,4 @@
-import { LogWithDecodedArgs, RawLog } from '@0xproject/types';
+import { BlockParamLiteral, LogWithDecodedArgs, RawLog } from '@0xproject/types';
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
@@ -7,7 +7,6 @@ import * as Web3 from 'web3';
import {
Artifact,
- BlockParamLiteral,
BlockRange,
ContractEventArgs,
ContractEvents,
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index 63c0d073a..e0c85505c 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -1,5 +1,5 @@
import { schemas } from '@0xproject/json-schemas';
-import { DecodedLogArgs, LogWithDecodedArgs } from '@0xproject/types';
+import { BlockParamLiteral, DecodedLogArgs, LogWithDecodedArgs } from '@0xproject/types';
import { AbiDecoder, BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@@ -7,7 +7,6 @@ import * as Web3 from 'web3';
import { artifacts } from '../artifacts';
import {
- BlockParamLiteral,
BlockRange,
ECSignature,
EventCallback,
diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts
index 41e67e177..c3c8854da 100644
--- a/packages/0x.js/src/index.ts
+++ b/packages/0x.js/src/index.ts
@@ -2,7 +2,6 @@ export { ZeroEx } from './0x';
export {
Order,
- BlockParamLiteral,
SignedOrder,
ECSignature,
ZeroExError,
@@ -14,7 +13,6 @@ export {
TokenEvents,
IndexedFilterValues,
BlockRange,
- BlockParam,
OrderCancellationRequest,
OrderFillRequest,
LogErrorContractEventArgs,
@@ -44,6 +42,12 @@ export {
OrderState,
} from './types';
-export { ContractEventArg, LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
+export {
+ BlockParamLiteral,
+ BlockParam,
+ ContractEventArg,
+ LogWithDecodedArgs,
+ TransactionReceiptWithDecodedLogs,
+} from '@0xproject/types';
export { TransactionReceipt } from '@0xproject/types';
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts
index 5d05bfb60..e67b93251 100644
--- a/packages/0x.js/src/order_watcher/event_watcher.ts
+++ b/packages/0x.js/src/order_watcher/event_watcher.ts
@@ -3,7 +3,9 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import { BlockParamLiteral, EventWatcherCallback, ZeroExError } from '../types';
+import { BlockParamLiteral } from '@0xproject/types';
+
+import { EventWatcherCallback, ZeroExError } from '../types';
import { assert } from '../utils/assert';
const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200;
diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts
index 1ad1a90b1..a9b3eba68 100644
--- a/packages/0x.js/src/order_watcher/order_state_watcher.ts
+++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts
@@ -1,5 +1,5 @@
import { schemas } from '@0xproject/json-schemas';
-import { LogWithDecodedArgs } from '@0xproject/types';
+import { BlockParamLiteral, LogWithDecodedArgs } from '@0xproject/types';
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@@ -11,7 +11,6 @@ import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allow
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
import {
ApprovalContractEventArgs,
- BlockParamLiteral,
ContractEventArgs,
DepositContractEventArgs,
EtherTokenEvents,
diff --git a/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts b/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
index 33feea105..ede1319fe 100644
--- a/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
+++ b/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
@@ -1,8 +1,8 @@
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
-import { BlockParamLiteral } from '../types';
/**
* Copy on read store for balances/proxyAllowances of tokens/accounts
diff --git a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
index e22364c09..0a0d93406 100644
--- a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
+++ b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
@@ -1,8 +1,8 @@
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
-import { BlockParamLiteral } from '../types';
/**
* Copy on read store for filled/cancelled taker amounts
diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts
index a0deb91c9..a2d1b9eb4 100644
--- a/packages/0x.js/src/types.ts
+++ b/packages/0x.js/src/types.ts
@@ -1,5 +1,7 @@
-import { ContractEventArg, LogWithDecodedArgs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
+
+import { BlockParam, BlockParamLiteral, ContractEventArg, LogWithDecodedArgs } from '@0xproject/types';
+
import * as Web3 from 'web3';
export enum ZeroExError {
@@ -219,16 +221,6 @@ export interface IndexedFilterValues {
[index: string]: ContractEventArg;
}
-// 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 BlockRange {
fromBlock: BlockParam;
toBlock: BlockParam;
diff --git a/packages/0x.js/src/utils/exchange_transfer_simulator.ts b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
index 662cd210c..9a920c643 100644
--- a/packages/0x.js/src/utils/exchange_transfer_simulator.ts
+++ b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
@@ -1,9 +1,10 @@
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
-import { BlockParamLiteral, ExchangeContractErrs, TradeSide, TransferType } from '../types';
+import { ExchangeContractErrs, TradeSide, TransferType } from '../types';
enum FailureReason {
Balance = 'balance',
diff --git a/packages/0x.js/test/exchange_transfer_simulator_test.ts b/packages/0x.js/test/exchange_transfer_simulator_test.ts
index e85a1640f..ba0ee9059 100644
--- a/packages/0x.js/test/exchange_transfer_simulator_test.ts
+++ b/packages/0x.js/test/exchange_transfer_simulator_test.ts
@@ -1,9 +1,10 @@
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import { ExchangeContractErrs, Token, ZeroEx } from '../src';
-import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
+import { TradeSide, TransferType } from '../src/types';
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
import { chaiSetup } from './utils/chai_setup';
diff --git a/packages/0x.js/test/exchange_wrapper_test.ts b/packages/0x.js/test/exchange_wrapper_test.ts
index 044298601..325426438 100644
--- a/packages/0x.js/test/exchange_wrapper_test.ts
+++ b/packages/0x.js/test/exchange_wrapper_test.ts
@@ -1,4 +1,5 @@
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
@@ -18,7 +19,7 @@ import {
Token,
ZeroEx,
} from '../src';
-import { BlockParamLiteral, DoneCallback } from '../src/types';
+import { DoneCallback } from '../src/types';
import { chaiSetup } from './utils/chai_setup';
import { constants } from './utils/constants';
diff --git a/packages/0x.js/test/order_validation_test.ts b/packages/0x.js/test/order_validation_test.ts
index 934e2e51f..b3dc42396 100644
--- a/packages/0x.js/test/order_validation_test.ts
+++ b/packages/0x.js/test/order_validation_test.ts
@@ -1,11 +1,12 @@
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
+import { BlockParamLiteral } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as Sinon from 'sinon';
import * as Web3 from 'web3';
import { ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError } from '../src';
-import { BlockParamLiteral, TradeSide, TransferType } from '../src/types';
+import { TradeSide, TransferType } from '../src/types';
import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator';
import { OrderValidationUtils } from '../src/utils/order_validation_utils';