Move BlockParam and BlockParamLiteral to shared types
This commit is contained in:
@@ -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,6 @@ 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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/tslint-config": "^0.4.7",
|
||||
"@0xproject/types": "^0.1.9",
|
||||
"@0xproject/utils": "^0.3.0",
|
||||
"@types/lodash": "^4.14.86",
|
||||
"@types/mocha": "^2.2.42",
|
||||
|
||||
@@ -10,7 +10,7 @@ export { InjectedWeb3Subprovider } from './subproviders/injected_web3';
|
||||
export { RedundantRPCSubprovider } from './subproviders/redundant_rpc';
|
||||
export { LedgerSubprovider } from './subproviders/ledger';
|
||||
export { NonceTrackerSubprovider } from './subproviders/nonce_tracker';
|
||||
export { ECSignature, LedgerWalletSubprovider, LedgerCommunicationClient } from './types';
|
||||
export { ECSignature, LedgerWalletSubprovider, LedgerCommunicationClient, NonceSubproviderErrors } from './types';
|
||||
|
||||
/**
|
||||
* A factory method for creating a LedgerEthereumClient usable in a browser context.
|
||||
|
||||
@@ -4,14 +4,16 @@ import EthereumTx = require('ethereumjs-tx');
|
||||
import ethUtil = require('ethereumjs-util');
|
||||
import providerEngineUtils = require('web3-provider-engine/util/rpc-cache-utils');
|
||||
|
||||
import { BlockParamLiteral } from '@0xproject/types';
|
||||
|
||||
import {
|
||||
BlockParamLiteral,
|
||||
ErrorCallback,
|
||||
JSONRPCPayload,
|
||||
NonceSubproviderErrors,
|
||||
OptionalNextCallback,
|
||||
} from '../types';
|
||||
|
||||
|
||||
import { Subprovider } from './subprovider';
|
||||
|
||||
const NONCE_TOO_LOW_ERROR_MESSAGE = 'Transaction nonce is too low';
|
||||
|
||||
@@ -118,10 +118,5 @@ export enum NonceSubproviderErrors {
|
||||
CannotDetermineAddressFromPayload = 'CANNOT_DETERMINE_ADDRESS_FROM_PAYLOAD',
|
||||
}
|
||||
|
||||
// Re-defined BlockParamLiteral here, rather than import it from 0x.js.
|
||||
export enum BlockParamLiteral {
|
||||
Pending = 'pending',
|
||||
}
|
||||
|
||||
export type OptionalNextCallback = (callback?: (err: Error | null, result: any, cb: any) => void) => void;
|
||||
export type ErrorCallback = (err: Error | null, data?: any) => void;
|
||||
|
||||
@@ -56,3 +56,13 @@ export enum SolidityTypes {
|
||||
export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
|
||||
logs: Array<LogWithDecodedArgs<DecodedLogArgs> | Web3.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;
|
||||
|
||||
Reference in New Issue
Block a user