diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-06 23:39:32 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-02-07 09:27:47 +0800 |
commit | 47adad5122cea7c2bac54c6e6b83be55a2b6609a (patch) | |
tree | e99adfb1c9c25f4d320dffc90c5fd92946d66efe | |
parent | 745f209f7e59bc604c22114d92dcff6eec670abb (diff) | |
download | dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar.gz dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar.bz2 dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar.lz dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar.xz dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.tar.zst dexon-sol-tools-47adad5122cea7c2bac54c6e6b83be55a2b6609a.zip |
Remove generated files
5 files changed, 0 insertions, 2208 deletions
diff --git a/packages/contracts/src/contract_wrappers/generated/dummy_token.ts b/packages/contracts/src/contract_wrappers/generated/dummy_token.ts deleted file mode 100644 index 788cbfe3f..000000000 --- a/packages/contracts/src/contract_wrappers/generated/dummy_token.ts +++ /dev/null @@ -1,434 +0,0 @@ -/** - * This file is auto-generated using abi-gen. Don't edit directly. - * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. - */ -// tslint:disable-next-line:no-unused-variable -import { TxData, TxDataPayable } from '@0xproject/types'; -import { BigNumber, classUtils, promisify } from '@0xproject/utils'; -import * as Web3 from 'web3'; - -import {BaseContract} from './base_contract'; - -export class DummyTokenContract extends BaseContract { - public name = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as DummyTokenContract; - const result = await promisify<string - >( - self._web3ContractInstance.name.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public approve = { - async sendTransactionAsync( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.approve.estimateGasAsync.bind( - self, - _spender, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.approve, self._web3ContractInstance, - )( - _spender, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.approve.estimateGas, self._web3ContractInstance, - )( - _spender, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.approve.getData(); - return abiEncodedTransactionData; - }, - }; - public totalSupply = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as DummyTokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.totalSupply.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public transferFrom = { - async sendTransactionAsync( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferFrom.estimateGasAsync.bind( - self, - _from, - _to, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferFrom, self._web3ContractInstance, - )( - _from, - _to, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferFrom.estimateGas, self._web3ContractInstance, - )( - _from, - _to, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferFrom.getData(); - return abiEncodedTransactionData; - }, - }; - public decimals = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as DummyTokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.decimals.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public balanceOf = { - async callAsync( - _owner: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as DummyTokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.balanceOf.call, - self._web3ContractInstance, - )( - _owner, - ); - return result; - }, - }; - public owner = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as DummyTokenContract; - const result = await promisify<string - >( - self._web3ContractInstance.owner.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public symbol = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as DummyTokenContract; - const result = await promisify<string - >( - self._web3ContractInstance.symbol.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public mint = { - async sendTransactionAsync( - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.mint.estimateGasAsync.bind( - self, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.mint, self._web3ContractInstance, - )( - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.mint.estimateGas, self._web3ContractInstance, - )( - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.mint.getData(); - return abiEncodedTransactionData; - }, - }; - public transfer = { - async sendTransactionAsync( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transfer.estimateGasAsync.bind( - self, - _to, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transfer, self._web3ContractInstance, - )( - _to, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transfer.estimateGas, self._web3ContractInstance, - )( - _to, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.transfer.getData(); - return abiEncodedTransactionData; - }, - }; - public allowance = { - async callAsync( - _owner: string, - _spender: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as DummyTokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.allowance.call, - self._web3ContractInstance, - )( - _owner, - _spender, - ); - return result; - }, - }; - public setBalance = { - async sendTransactionAsync( - _target: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.setBalance.estimateGasAsync.bind( - self, - _target, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.setBalance, self._web3ContractInstance, - )( - _target, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _target: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.setBalance.estimateGas, self._web3ContractInstance, - )( - _target, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _target: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.setBalance.getData(); - return abiEncodedTransactionData; - }, - }; - public transferOwnership = { - async sendTransactionAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferOwnership.estimateGasAsync.bind( - self, - newOwner, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferOwnership, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as DummyTokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferOwnership.estimateGas, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - newOwner: string, - txData: TxData = {}, - ): string { - const self = this as DummyTokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferOwnership.getData(); - return abiEncodedTransactionData; - }, - }; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); - } -} // tslint:disable:max-file-line-count diff --git a/packages/contracts/src/contract_wrappers/generated/exchange.ts b/packages/contracts/src/contract_wrappers/generated/exchange.ts deleted file mode 100644 index c328ec725..000000000 --- a/packages/contracts/src/contract_wrappers/generated/exchange.ts +++ /dev/null @@ -1,728 +0,0 @@ -/** - * This file is auto-generated using abi-gen. Don't edit directly. - * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. - */ -// tslint:disable-next-line:no-unused-variable -import { TxData, TxDataPayable } from '@0xproject/types'; -import { BigNumber, classUtils, promisify } from '@0xproject/utils'; -import * as Web3 from 'web3'; - -import {BaseContract} from './base_contract'; - -export class ExchangeContract extends BaseContract { - public isRoundingError = { - async callAsync( - numerator: BigNumber, - denominator: BigNumber, - target: BigNumber, - defaultBlock?: Web3.BlockParam, - ): Promise<boolean - > { - const self = this as ExchangeContract; - const result = await promisify<boolean - >( - self._web3ContractInstance.isRoundingError.call, - self._web3ContractInstance, - )( - numerator, - denominator, - target, - ); - return result; - }, - }; - public filled = { - async callAsync( - index: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as ExchangeContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.filled.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public cancelled = { - async callAsync( - index: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as ExchangeContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.cancelled.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public fillOrdersUpTo = { - async sendTransactionAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.fillOrdersUpTo.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.fillOrdersUpTo, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.fillOrdersUpTo.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.fillOrdersUpTo.getData(); - return abiEncodedTransactionData; - }, - }; - public cancelOrder = { - async sendTransactionAsync( - orderAddresses: string[], - orderValues: BigNumber[], - cancelTakerTokenAmount: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.cancelOrder.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - cancelTakerTokenAmount, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.cancelOrder, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - cancelTakerTokenAmount, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[], - orderValues: BigNumber[], - cancelTakerTokenAmount: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.cancelOrder.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - cancelTakerTokenAmount, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[], - orderValues: BigNumber[], - cancelTakerTokenAmount: BigNumber, - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.cancelOrder.getData(); - return abiEncodedTransactionData; - }, - }; - public ZRX_TOKEN_CONTRACT = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as ExchangeContract; - const result = await promisify<string - >( - self._web3ContractInstance.ZRX_TOKEN_CONTRACT.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public batchFillOrKillOrders = { - async sendTransactionAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.batchFillOrKillOrders.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - fillTakerTokenAmounts, - v, - r, - s, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.batchFillOrKillOrders, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmounts, - v, - r, - s, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.batchFillOrKillOrders.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmounts, - v, - r, - s, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.batchFillOrKillOrders.getData(); - return abiEncodedTransactionData; - }, - }; - public fillOrKillOrder = { - async sendTransactionAsync( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.fillOrKillOrder.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - fillTakerTokenAmount, - v, - r, - s, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.fillOrKillOrder, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - v, - r, - s, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.fillOrKillOrder.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - v, - r, - s, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.fillOrKillOrder.getData(); - return abiEncodedTransactionData; - }, - }; - public getUnavailableTakerTokenAmount = { - async callAsync( - orderHash: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as ExchangeContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.getUnavailableTakerTokenAmount.call, - self._web3ContractInstance, - )( - orderHash, - ); - return result; - }, - }; - public isValidSignature = { - async callAsync( - signer: string, - hash: string, - v: number|BigNumber, - r: string, - s: string, - defaultBlock?: Web3.BlockParam, - ): Promise<boolean - > { - const self = this as ExchangeContract; - const result = await promisify<boolean - >( - self._web3ContractInstance.isValidSignature.call, - self._web3ContractInstance, - )( - signer, - hash, - v, - r, - s, - ); - return result; - }, - }; - public getPartialAmount = { - async callAsync( - numerator: BigNumber, - denominator: BigNumber, - target: BigNumber, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as ExchangeContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.getPartialAmount.call, - self._web3ContractInstance, - )( - numerator, - denominator, - target, - ); - return result; - }, - }; - public TOKEN_TRANSFER_PROXY_CONTRACT = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as ExchangeContract; - const result = await promisify<string - >( - self._web3ContractInstance.TOKEN_TRANSFER_PROXY_CONTRACT.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public batchFillOrders = { - async sendTransactionAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.batchFillOrders.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - fillTakerTokenAmounts, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.batchFillOrders, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmounts, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.batchFillOrders.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmounts, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[][], - orderValues: BigNumber[][], - fillTakerTokenAmounts: BigNumber[], - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: Array<number|BigNumber>, - r: string[], - s: string[], - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.batchFillOrders.getData(); - return abiEncodedTransactionData; - }, - }; - public batchCancelOrders = { - async sendTransactionAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - cancelTakerTokenAmounts: BigNumber[], - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.batchCancelOrders.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - cancelTakerTokenAmounts, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.batchCancelOrders, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - cancelTakerTokenAmounts, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[][], - orderValues: BigNumber[][], - cancelTakerTokenAmounts: BigNumber[], - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.batchCancelOrders.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - cancelTakerTokenAmounts, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[][], - orderValues: BigNumber[][], - cancelTakerTokenAmounts: BigNumber[], - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.batchCancelOrders.getData(); - return abiEncodedTransactionData; - }, - }; - public fillOrder = { - async sendTransactionAsync( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.fillOrder.estimateGasAsync.bind( - self, - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.fillOrder, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as ExchangeContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.fillOrder.estimateGas, self._web3ContractInstance, - )( - orderAddresses, - orderValues, - fillTakerTokenAmount, - shouldThrowOnInsufficientBalanceOrAllowance, - v, - r, - s, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - orderAddresses: string[], - orderValues: BigNumber[], - fillTakerTokenAmount: BigNumber, - shouldThrowOnInsufficientBalanceOrAllowance: boolean, - v: number|BigNumber, - r: string, - s: string, - txData: TxData = {}, - ): string { - const self = this as ExchangeContract; - const abiEncodedTransactionData = self._web3ContractInstance.fillOrder.getData(); - return abiEncodedTransactionData; - }, - }; - public getOrderHash = { - async callAsync( - orderAddresses: string[], - orderValues: BigNumber[], - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as ExchangeContract; - const result = await promisify<string - >( - self._web3ContractInstance.getOrderHash.call, - self._web3ContractInstance, - )( - orderAddresses, - orderValues, - ); - return result; - }, - }; - public EXTERNAL_QUERY_GAS_LIMIT = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as ExchangeContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.EXTERNAL_QUERY_GAS_LIMIT.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public VERSION = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as ExchangeContract; - const result = await promisify<string - >( - self._web3ContractInstance.VERSION.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); - } -} // tslint:disable:max-file-line-count diff --git a/packages/contracts/src/contract_wrappers/generated/token.ts b/packages/contracts/src/contract_wrappers/generated/token.ts deleted file mode 100644 index 5ad96da1e..000000000 --- a/packages/contracts/src/contract_wrappers/generated/token.ts +++ /dev/null @@ -1,215 +0,0 @@ -/** - * This file is auto-generated using abi-gen. Don't edit directly. - * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. - */ -// tslint:disable-next-line:no-unused-variable -import { TxData, TxDataPayable } from '@0xproject/types'; -import { BigNumber, classUtils, promisify } from '@0xproject/utils'; -import * as Web3 from 'web3'; - -import {BaseContract} from './base_contract'; - -export class TokenContract extends BaseContract { - public approve = { - async sendTransactionAsync( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.approve.estimateGasAsync.bind( - self, - _spender, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.approve, self._web3ContractInstance, - )( - _spender, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.approve.estimateGas, self._web3ContractInstance, - )( - _spender, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _spender: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as TokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.approve.getData(); - return abiEncodedTransactionData; - }, - }; - public transferFrom = { - async sendTransactionAsync( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferFrom.estimateGasAsync.bind( - self, - _from, - _to, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferFrom, self._web3ContractInstance, - )( - _from, - _to, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferFrom.estimateGas, self._web3ContractInstance, - )( - _from, - _to, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _from: string, - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as TokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferFrom.getData(); - return abiEncodedTransactionData; - }, - }; - public balanceOf = { - async callAsync( - _owner: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as TokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.balanceOf.call, - self._web3ContractInstance, - )( - _owner, - ); - return result; - }, - }; - public transfer = { - async sendTransactionAsync( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transfer.estimateGasAsync.bind( - self, - _to, - _value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transfer, self._web3ContractInstance, - )( - _to, - _value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transfer.estimateGas, self._web3ContractInstance, - )( - _to, - _value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _to: string, - _value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as TokenContract; - const abiEncodedTransactionData = self._web3ContractInstance.transfer.getData(); - return abiEncodedTransactionData; - }, - }; - public allowance = { - async callAsync( - _owner: string, - _spender: string, - defaultBlock?: Web3.BlockParam, - ): Promise<BigNumber - > { - const self = this as TokenContract; - const result = await promisify<BigNumber - >( - self._web3ContractInstance.allowance.call, - self._web3ContractInstance, - )( - _owner, - _spender, - ); - return result; - }, - }; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); - } -} // tslint:disable:max-file-line-count diff --git a/packages/contracts/src/contract_wrappers/generated/token_registry.ts b/packages/contracts/src/contract_wrappers/generated/token_registry.ts deleted file mode 100644 index 635f9f214..000000000 --- a/packages/contracts/src/contract_wrappers/generated/token_registry.ts +++ /dev/null @@ -1,548 +0,0 @@ -/** - * This file is auto-generated using abi-gen. Don't edit directly. - * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. - */ -// tslint:disable-next-line:no-unused-variable -import { TxData, TxDataPayable } from '@0xproject/types'; -import { BigNumber, classUtils, promisify } from '@0xproject/utils'; -import * as Web3 from 'web3'; - -import {BaseContract} from './base_contract'; - -export class TokenRegistryContract extends BaseContract { - public removeToken = { - async sendTransactionAsync( - _token: string, - _index: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.removeToken.estimateGasAsync.bind( - self, - _token, - _index, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.removeToken, self._web3ContractInstance, - )( - _token, - _index, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _index: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.removeToken.estimateGas, self._web3ContractInstance, - )( - _token, - _index, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _index: BigNumber, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.removeToken.getData(); - return abiEncodedTransactionData; - }, - }; - public getTokenAddressByName = { - async callAsync( - _name: string, - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenRegistryContract; - const result = await promisify<string - >( - self._web3ContractInstance.getTokenAddressByName.call, - self._web3ContractInstance, - )( - _name, - ); - return result; - }, - }; - public getTokenAddressBySymbol = { - async callAsync( - _symbol: string, - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenRegistryContract; - const result = await promisify<string - >( - self._web3ContractInstance.getTokenAddressBySymbol.call, - self._web3ContractInstance, - )( - _symbol, - ); - return result; - }, - }; - public setTokenSwarmHash = { - async sendTransactionAsync( - _token: string, - _swarmHash: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.setTokenSwarmHash.estimateGasAsync.bind( - self, - _token, - _swarmHash, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.setTokenSwarmHash, self._web3ContractInstance, - )( - _token, - _swarmHash, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _swarmHash: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.setTokenSwarmHash.estimateGas, self._web3ContractInstance, - )( - _token, - _swarmHash, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _swarmHash: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.setTokenSwarmHash.getData(); - return abiEncodedTransactionData; - }, - }; - public getTokenMetaData = { - async callAsync( - _token: string, - defaultBlock?: Web3.BlockParam, - ): Promise<[string, string, string, BigNumber, string, string] - > { - const self = this as TokenRegistryContract; - const result = await promisify<[string, string, string, BigNumber, string, string] - >( - self._web3ContractInstance.getTokenMetaData.call, - self._web3ContractInstance, - )( - _token, - ); - return result; - }, - }; - public owner = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenRegistryContract; - const result = await promisify<string - >( - self._web3ContractInstance.owner.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public addToken = { - async sendTransactionAsync( - _token: string, - _name: string, - _symbol: string, - _decimals: number|BigNumber, - _ipfsHash: string, - _swarmHash: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.addToken.estimateGasAsync.bind( - self, - _token, - _name, - _symbol, - _decimals, - _ipfsHash, - _swarmHash, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.addToken, self._web3ContractInstance, - )( - _token, - _name, - _symbol, - _decimals, - _ipfsHash, - _swarmHash, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _name: string, - _symbol: string, - _decimals: number|BigNumber, - _ipfsHash: string, - _swarmHash: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.addToken.estimateGas, self._web3ContractInstance, - )( - _token, - _name, - _symbol, - _decimals, - _ipfsHash, - _swarmHash, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _name: string, - _symbol: string, - _decimals: number|BigNumber, - _ipfsHash: string, - _swarmHash: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.addToken.getData(); - return abiEncodedTransactionData; - }, - }; - public setTokenName = { - async sendTransactionAsync( - _token: string, - _name: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.setTokenName.estimateGasAsync.bind( - self, - _token, - _name, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.setTokenName, self._web3ContractInstance, - )( - _token, - _name, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _name: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.setTokenName.estimateGas, self._web3ContractInstance, - )( - _token, - _name, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _name: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.setTokenName.getData(); - return abiEncodedTransactionData; - }, - }; - public tokens = { - async callAsync( - index: string, - defaultBlock?: Web3.BlockParam, - ): Promise<[string, string, string, BigNumber, string, string] - > { - const self = this as TokenRegistryContract; - const result = await promisify<[string, string, string, BigNumber, string, string] - >( - self._web3ContractInstance.tokens.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public tokenAddresses = { - async callAsync( - index: BigNumber, - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenRegistryContract; - const result = await promisify<string - >( - self._web3ContractInstance.tokenAddresses.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public getTokenByName = { - async callAsync( - _name: string, - defaultBlock?: Web3.BlockParam, - ): Promise<[string, string, string, BigNumber, string, string] - > { - const self = this as TokenRegistryContract; - const result = await promisify<[string, string, string, BigNumber, string, string] - >( - self._web3ContractInstance.getTokenByName.call, - self._web3ContractInstance, - )( - _name, - ); - return result; - }, - }; - public getTokenAddresses = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string[] - > { - const self = this as TokenRegistryContract; - const result = await promisify<string[] - >( - self._web3ContractInstance.getTokenAddresses.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public setTokenIpfsHash = { - async sendTransactionAsync( - _token: string, - _ipfsHash: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.setTokenIpfsHash.estimateGasAsync.bind( - self, - _token, - _ipfsHash, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.setTokenIpfsHash, self._web3ContractInstance, - )( - _token, - _ipfsHash, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _ipfsHash: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.setTokenIpfsHash.estimateGas, self._web3ContractInstance, - )( - _token, - _ipfsHash, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _ipfsHash: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.setTokenIpfsHash.getData(); - return abiEncodedTransactionData; - }, - }; - public getTokenBySymbol = { - async callAsync( - _symbol: string, - defaultBlock?: Web3.BlockParam, - ): Promise<[string, string, string, BigNumber, string, string] - > { - const self = this as TokenRegistryContract; - const result = await promisify<[string, string, string, BigNumber, string, string] - >( - self._web3ContractInstance.getTokenBySymbol.call, - self._web3ContractInstance, - )( - _symbol, - ); - return result; - }, - }; - public setTokenSymbol = { - async sendTransactionAsync( - _token: string, - _symbol: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.setTokenSymbol.estimateGasAsync.bind( - self, - _token, - _symbol, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.setTokenSymbol, self._web3ContractInstance, - )( - _token, - _symbol, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - _token: string, - _symbol: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.setTokenSymbol.estimateGas, self._web3ContractInstance, - )( - _token, - _symbol, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - _token: string, - _symbol: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.setTokenSymbol.getData(); - return abiEncodedTransactionData; - }, - }; - public transferOwnership = { - async sendTransactionAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferOwnership.estimateGasAsync.bind( - self, - newOwner, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferOwnership, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenRegistryContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferOwnership.estimateGas, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - newOwner: string, - txData: TxData = {}, - ): string { - const self = this as TokenRegistryContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferOwnership.getData(); - return abiEncodedTransactionData; - }, - }; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); - } -} // tslint:disable:max-file-line-count diff --git a/packages/contracts/src/contract_wrappers/generated/token_transfer_proxy.ts b/packages/contracts/src/contract_wrappers/generated/token_transfer_proxy.ts deleted file mode 100644 index a5a40d47f..000000000 --- a/packages/contracts/src/contract_wrappers/generated/token_transfer_proxy.ts +++ /dev/null @@ -1,283 +0,0 @@ -/** - * This file is auto-generated using abi-gen. Don't edit directly. - * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates. - */ -// tslint:disable-next-line:no-unused-variable -import { TxData, TxDataPayable } from '@0xproject/types'; -import { BigNumber, classUtils, promisify } from '@0xproject/utils'; -import * as Web3 from 'web3'; - -import {BaseContract} from './base_contract'; - -export class TokenTransferProxyContract extends BaseContract { - public transferFrom = { - async sendTransactionAsync( - token: string, - from: string, - to: string, - value: BigNumber, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferFrom.estimateGasAsync.bind( - self, - token, - from, - to, - value, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferFrom, self._web3ContractInstance, - )( - token, - from, - to, - value, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - token: string, - from: string, - to: string, - value: BigNumber, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferFrom.estimateGas, self._web3ContractInstance, - )( - token, - from, - to, - value, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - token: string, - from: string, - to: string, - value: BigNumber, - txData: TxData = {}, - ): string { - const self = this as TokenTransferProxyContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferFrom.getData(); - return abiEncodedTransactionData; - }, - }; - public addAuthorizedAddress = { - async sendTransactionAsync( - target: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.addAuthorizedAddress.estimateGasAsync.bind( - self, - target, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.addAuthorizedAddress, self._web3ContractInstance, - )( - target, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - target: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.addAuthorizedAddress.estimateGas, self._web3ContractInstance, - )( - target, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - target: string, - txData: TxData = {}, - ): string { - const self = this as TokenTransferProxyContract; - const abiEncodedTransactionData = self._web3ContractInstance.addAuthorizedAddress.getData(); - return abiEncodedTransactionData; - }, - }; - public authorities = { - async callAsync( - index: BigNumber, - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenTransferProxyContract; - const result = await promisify<string - >( - self._web3ContractInstance.authorities.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public removeAuthorizedAddress = { - async sendTransactionAsync( - target: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.removeAuthorizedAddress.estimateGasAsync.bind( - self, - target, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.removeAuthorizedAddress, self._web3ContractInstance, - )( - target, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - target: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.removeAuthorizedAddress.estimateGas, self._web3ContractInstance, - )( - target, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - target: string, - txData: TxData = {}, - ): string { - const self = this as TokenTransferProxyContract; - const abiEncodedTransactionData = self._web3ContractInstance.removeAuthorizedAddress.getData(); - return abiEncodedTransactionData; - }, - }; - public owner = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string - > { - const self = this as TokenTransferProxyContract; - const result = await promisify<string - >( - self._web3ContractInstance.owner.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public authorized = { - async callAsync( - index: string, - defaultBlock?: Web3.BlockParam, - ): Promise<boolean - > { - const self = this as TokenTransferProxyContract; - const result = await promisify<boolean - >( - self._web3ContractInstance.authorized.call, - self._web3ContractInstance, - )( - index, - ); - return result; - }, - }; - public getAuthorizedAddresses = { - async callAsync( - defaultBlock?: Web3.BlockParam, - ): Promise<string[] - > { - const self = this as TokenTransferProxyContract; - const result = await promisify<string[] - >( - self._web3ContractInstance.getAuthorizedAddresses.call, - self._web3ContractInstance, - )( - ); - return result; - }, - }; - public transferOwnership = { - async sendTransactionAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<string> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - self.transferOwnership.estimateGasAsync.bind( - self, - newOwner, - ), - ); - const txHash = await promisify<string>( - self._web3ContractInstance.transferOwnership, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return txHash; - }, - async estimateGasAsync( - newOwner: string, - txData: TxData = {}, - ): Promise<number> { - const self = this as TokenTransferProxyContract; - const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( - txData, - ); - const gas = await promisify<number>( - self._web3ContractInstance.transferOwnership.estimateGas, self._web3ContractInstance, - )( - newOwner, - txDataWithDefaults, - ); - return gas; - }, - getABIEncodedTransactionData( - newOwner: string, - txData: TxData = {}, - ): string { - const self = this as TokenTransferProxyContract; - const abiEncodedTransactionData = self._web3ContractInstance.transferOwnership.getData(); - return abiEncodedTransactionData; - }, - }; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial<TxData>) { - super(web3ContractInstance, defaults); - classUtils.bindAll(this, ['_web3ContractInstance', '_defaults']); - } -} // tslint:disable:max-file-line-count |