From 6cbd0d4537be3e51866c407dc01fb0efca0b50c2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 1 Dec 2017 22:46:21 -0600 Subject: Remove old contract typings --- packages/0x.js/src/types.ts | 165 +++----------------------------------------- 1 file changed, 11 insertions(+), 154 deletions(-) (limited to 'packages/0x.js') diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 5363b02ff..3586919cb 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -52,156 +52,6 @@ export interface DecodedLogEvent { export type EventCallback = (err: null|Error, log?: DecodedLogEvent) => void; export type EventWatcherCallback = (log: LogEvent) => void; -export interface ExchangeContract extends Web3.ContractInstance { - isValidSignature: { - callAsync: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string, - txOpts?: TxOpts) => Promise; - }; - ZRX_TOKEN_CONTRACT: { - callAsync: () => Promise; - }; - TOKEN_TRANSFER_PROXY_CONTRACT: { - callAsync: () => Promise; - }; - getUnavailableTakerTokenAmount: { - callAsync: (orderHash: string, defaultBlock?: Web3.BlockParam) => Promise; - }; - isRoundingError: { - callAsync: (takerTokenFillAmount: BigNumber, takerTokenAmount: BigNumber, - makerTokenAmount: BigNumber, txOpts?: TxOpts) => Promise; - }; - fillOrder: { - sendTransactionAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number, r: string, s: string, txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number, r: string, s: string, txOpts?: TxOpts) => Promise; - }; - batchFillOrders: { - sendTransactionAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmounts: BigNumber[], - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number[], r: string[], s: string[], txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmounts: BigNumber[], - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number[], r: string[], s: string[], txOpts?: TxOpts) => Promise; - }; - fillOrdersUpTo: { - sendTransactionAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number[], r: string[], s: string[], txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number[], r: string[], s: string[], txOpts?: TxOpts) => Promise; - }; - cancelOrder: { - sendTransactionAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - cancelTakerTokenAmount: BigNumber, txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - cancelTakerTokenAmount: BigNumber, - txOpts?: TxOpts) => Promise; - }; - batchCancelOrders: { - sendTransactionAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - cancelTakerTokenAmounts: BigNumber[], txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - cancelTakerTokenAmounts: BigNumber[], - txOpts?: TxOpts) => Promise; - }; - fillOrKillOrder: { - sendTransactionAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - fillTakerTokenAmount: BigNumber, - v: number, r: string, s: string, txOpts?: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues, - fillTakerTokenAmount: BigNumber, - v: number, r: string, s: string, txOpts?: TxOpts) => Promise; - }; - batchFillOrKillOrders: { - sendTransactionAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmounts: BigNumber[], - v: number[], r: string[], s: string[], txOpts: TxOpts) => Promise; - estimateGasAsync: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], - fillTakerTokenAmounts: BigNumber[], - v: number[], r: string[], s: string[], txOpts?: TxOpts) => Promise; - }; - filled: { - callAsync: (orderHash: string, defaultBlock?: Web3.BlockParam) => Promise; - }; - cancelled: { - callAsync: (orderHash: string, defaultBlock?: Web3.BlockParam) => Promise; - }; - getOrderHash: { - callAsync: (orderAddresses: OrderAddresses, orderValues: OrderValues) => Promise; - }; -} - -export interface TokenContract extends Web3.ContractInstance { - balanceOf: { - callAsync: (address: string, defaultBlock?: Web3.BlockParam) => Promise; - }; - allowance: { - callAsync: (ownerAddress: string, allowedAddress: string, - defaultBlock?: Web3.BlockParam) => Promise; - }; - transfer: { - sendTransactionAsync: (toAddress: string, amountInBaseUnits: BigNumber, - txOpts?: TxOpts) => Promise; - }; - transferFrom: { - sendTransactionAsync: (fromAddress: string, toAddress: string, amountInBaseUnits: BigNumber, - txOpts?: TxOpts) => Promise; - }; - approve: { - sendTransactionAsync: (proxyAddress: string, amountInBaseUnits: BigNumber, - txOpts?: TxOpts) => Promise; - }; -} - -export interface TokenRegistryContract extends Web3.ContractInstance { - getTokenMetaData: { - callAsync: (address: string) => Promise; - }; - getTokenAddresses: { - callAsync: () => Promise; - }; - getTokenAddressBySymbol: { - callAsync: (symbol: string) => Promise; - }; - getTokenAddressByName: { - callAsync: (name: string) => Promise; - }; - getTokenBySymbol: { - callAsync: (symbol: string) => Promise; - }; - getTokenByName: { - callAsync: (name: string) => Promise; - }; -} - -export interface EtherTokenContract extends Web3.ContractInstance { - deposit: { - sendTransactionAsync: (txOpts: TxOpts) => Promise; - }; - withdraw: { - sendTransactionAsync: (amount: BigNumber, txOpts: TxOpts) => Promise; - }; -} - -export interface TokenTransferProxyContract extends Web3.ContractInstance { - getAuthorizedAddresses: { - callAsync: () => Promise; - }; - authorized: { - callAsync: (address: string) => Promise; - }; -} - export enum SolidityTypes { Address = 'address', Uint256 = 'uint256', @@ -393,10 +243,6 @@ export type AsyncMethod = (...args: any[]) => Promise; */ export type Web3Provider = Web3.Provider; -export interface ExchangeContractByAddress { - [address: string]: ExchangeContract; -} - export interface JSONRPCPayload { params: any[]; method: string; @@ -540,6 +386,17 @@ export type OrderState = OrderStateValid|OrderStateInvalid; export type OnOrderStateChangeCallback = (orderState: OrderState) => void; +export interface TxData { + from?: string; + gas?: number; + gasPrice?: BigNumber; + nonce?: number; +} + +export interface TxDataPayable extends TxData { + value?: BigNumber; +} + export interface TransactionReceipt { blockHash: string; blockNumber: number; -- cgit