diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-03-17 02:23:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-17 02:23:28 +0800 |
commit | d4c1b3b0bd26e730ce6687469cdf7283877543e1 (patch) | |
tree | 630ec3651c82e8b7d4e1802ea2842e6585316584 /packages/0x.js/src/utils | |
parent | 2acb7676407537b2793f34def0fd384720ad1b0b (diff) | |
parent | bbdb07263499760d9bc3de8b83285367b299eb6f (diff) | |
download | dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar.gz dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar.bz2 dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar.lz dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar.xz dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.tar.zst dexon-sol-tools-d4c1b3b0bd26e730ce6687469cdf7283877543e1.zip |
Merge pull request #456 from 0xProject/feature/connect/consolidate-types
Add SignedOrder, Order, and ECSignature types to the types package
Diffstat (limited to 'packages/0x.js/src/utils')
-rw-r--r-- | packages/0x.js/src/utils/assert.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/src/utils/order_state_utils.ts | 10 | ||||
-rw-r--r-- | packages/0x.js/src/utils/order_validation_utils.ts | 3 | ||||
-rw-r--r-- | packages/0x.js/src/utils/signature_utils.ts | 3 | ||||
-rw-r--r-- | packages/0x.js/src/utils/utils.ts | 4 |
5 files changed, 7 insertions, 15 deletions
diff --git a/packages/0x.js/src/utils/assert.ts b/packages/0x.js/src/utils/assert.ts index c21f2dbca..5e8004cd0 100644 --- a/packages/0x.js/src/utils/assert.ts +++ b/packages/0x.js/src/utils/assert.ts @@ -3,11 +3,11 @@ import { assert as sharedAssert } from '@0xproject/assert'; // tslint:disable-next-line:no-unused-variable import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable +import { ECSignature } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; -import { ECSignature } from '../types'; import { signatureUtils } from '../utils/signature_utils'; export const assert = { diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts index b7a55ff42..38189443b 100644 --- a/packages/0x.js/src/utils/order_state_utils.ts +++ b/packages/0x.js/src/utils/order_state_utils.ts @@ -1,3 +1,4 @@ +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; @@ -6,14 +7,7 @@ import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper'; import { RemainingFillableCalculator } from '../order_watcher/remaining_fillable_calculator'; import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store'; import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store'; -import { - ExchangeContractErrs, - OrderRelevantState, - OrderState, - OrderStateInvalid, - OrderStateValid, - SignedOrder, -} from '../types'; +import { ExchangeContractErrs, OrderRelevantState, OrderState, OrderStateInvalid, OrderStateValid } from '../types'; const ACCEPTABLE_RELATIVE_ROUNDING_ERROR = 0.0001; diff --git a/packages/0x.js/src/utils/order_validation_utils.ts b/packages/0x.js/src/utils/order_validation_utils.ts index 917d414c8..f32bf43d0 100644 --- a/packages/0x.js/src/utils/order_validation_utils.ts +++ b/packages/0x.js/src/utils/order_validation_utils.ts @@ -1,9 +1,10 @@ +import { Order, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import { ZeroEx } from '../0x'; import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper'; -import { ExchangeContractErrs, Order, SignedOrder, TradeSide, TransferType, ZeroExError } from '../types'; +import { ExchangeContractErrs, TradeSide, TransferType, ZeroExError } from '../types'; import { constants } from '../utils/constants'; import { utils } from '../utils/utils'; diff --git a/packages/0x.js/src/utils/signature_utils.ts b/packages/0x.js/src/utils/signature_utils.ts index b0f1d61ef..46f167339 100644 --- a/packages/0x.js/src/utils/signature_utils.ts +++ b/packages/0x.js/src/utils/signature_utils.ts @@ -1,7 +1,6 @@ +import { ECSignature } from '@0xproject/types'; import * as ethUtil from 'ethereumjs-util'; -import { ECSignature } from '../types'; - export const signatureUtils = { isValidSignature(data: string, signature: ECSignature, signerAddress: string): boolean { const dataBuff = ethUtil.toBuffer(data); diff --git a/packages/0x.js/src/utils/utils.ts b/packages/0x.js/src/utils/utils.ts index 3e98de84f..c8bcd907e 100644 --- a/packages/0x.js/src/utils/utils.ts +++ b/packages/0x.js/src/utils/utils.ts @@ -1,12 +1,10 @@ -import { SolidityTypes } from '@0xproject/types'; +import { Order, SignedOrder, SolidityTypes } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import BN = require('bn.js'); import * as ethABI from 'ethereumjs-abi'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { Order, SignedOrder } from '../types'; - export const utils = { /** * Converts BigNumber instance to BN |