diff options
Diffstat (limited to 'src/ts/0x.js.ts')
-rw-r--r-- | src/ts/0x.js.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ts/0x.js.ts b/src/ts/0x.js.ts index ba922d3db..7c6557b5b 100644 --- a/src/ts/0x.js.ts +++ b/src/ts/0x.js.ts @@ -1,25 +1,22 @@ import * as BigNumber from 'bignumber.js'; import * as BN from 'bn.js'; import * as ethUtil from 'ethereumjs-util'; +import * as Web3 from 'web3'; import * as ethABI from 'ethereumjs-abi'; import * as _ from 'lodash'; import {constants} from './utils/constants'; import {assert} from './utils/assert'; +import {Web3Wrapper} from './web3_wrapper'; +import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; +import contract = require('truffle-contract'); import {ECSignatureSchema} from './schemas/ec_signature_schema'; -import {SolidityTypes} from './types'; - -/** - * Elliptic Curve signature - */ -export interface ECSignature { - v: number; - r: string; - s: string; -} +import {SolidityTypes, ECSignature} from './types'; const MAX_DIGITS_IN_UNSIGNED_256_INT = 78; export class ZeroEx { + public web3Wrapper: Web3Wrapper; + public exchange: ExchangeWrapper; /** * Computes the orderHash given the order parameters and returns it as a hex encoded string. */ @@ -129,7 +126,6 @@ export class ZeroEx { const baseUnitAmount = amount.times(unit); return baseUnitAmount; } - /** * Converts BigNumber instance to BN * The only we convert to BN is to remain compatible with `ethABI. soliditySHA3 ` that @@ -139,4 +135,8 @@ export class ZeroEx { private static bigNumberToBN(value: BigNumber.BigNumber) { return new BN(value.toString(), 10); } + constructor(web3: Web3) { + this.web3Wrapper = new Web3Wrapper(web3); + this.exchange = new ExchangeWrapper(this.web3Wrapper); + } } |