In @0x/abi-gen-wrappers: Regenerate wrappers.

This commit is contained in:
Lawrence Forman
2019-04-26 14:02:27 -04:00
parent 6d835f5cc1
commit 943d648225
20 changed files with 1427 additions and 73 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "4.3.0",
"changes": [
{
"note": "Update wrapper functions to expose `awaitTransactionSuccessAsync()` methods",
"pr": TODO
}
]
},
{
"version": "4.2.0",
"changes": [

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type AssetProxyOwnerEventArgs =
@@ -148,6 +159,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
owner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.removeOwner.sendTransactionAsync(owner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
owner: string,
txData: Partial<TxData> = {},
@@ -224,6 +246,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
transactionId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.revokeConfirmation.sendTransactionAsync(transactionId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
transactionId: BigNumber,
txData: Partial<TxData> = {},
@@ -358,6 +391,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
transactionId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.executeRemoveAuthorizedAddressAtIndex.sendTransactionAsync(transactionId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
transactionId: BigNumber,
txData: Partial<TxData> = {},
@@ -493,6 +537,19 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
assetProxyContract: string,
isRegistered: boolean,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.registerAssetProxy.sendTransactionAsync(assetProxyContract,
isRegistered
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
assetProxyContract: string,
isRegistered: boolean,
@@ -575,6 +632,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
owner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.addOwner.sendTransactionAsync(owner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
owner: string,
txData: Partial<TxData> = {},
@@ -679,6 +747,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_secondsTimeLocked: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.changeTimeLock.sendTransactionAsync(_secondsTimeLocked
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_secondsTimeLocked: BigNumber,
txData: Partial<TxData> = {},
@@ -953,6 +1032,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_required: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.changeRequirement.sendTransactionAsync(_required
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_required: BigNumber,
txData: Partial<TxData> = {},
@@ -1029,6 +1119,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
transactionId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.confirmTransaction.sendTransactionAsync(transactionId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
transactionId: BigNumber,
txData: Partial<TxData> = {},
@@ -1111,6 +1212,21 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
destination: string,
value: BigNumber,
data: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.submitTransaction.sendTransactionAsync(destination,
value,
data
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
destination: string,
value: BigNumber,
@@ -1282,6 +1398,19 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
owner: string,
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.replaceOwner.sendTransactionAsync(owner,
newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
owner: string,
newOwner: string,
@@ -1364,6 +1493,17 @@ export class AssetProxyOwnerContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
transactionId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as AssetProxyOwnerContract;
const txHash = await self.executeTransaction.sendTransactionAsync(transactionId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
transactionId: BigNumber,
txData: Partial<TxData> = {},
@@ -1489,7 +1629,7 @@ _secondsTimeLocked
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('AssetProxyOwner', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('AssetProxyOwner', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -80,6 +91,25 @@ export class CoordinatorContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
transaction: {salt: BigNumber;signerAddress: string;data: string},
txOrigin: string,
transactionSignature: string,
approvalExpirationTimeSeconds: BigNumber[],
approvalSignatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as CoordinatorContract;
const txHash = await self.executeTransaction.sendTransactionAsync(transaction,
txOrigin,
transactionSignature,
approvalExpirationTimeSeconds,
approvalSignatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
transaction: {salt: BigNumber;signerAddress: string;data: string},
txOrigin: string,

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type CoordinatorRegistryEventArgs =
@@ -50,6 +61,17 @@ export class CoordinatorRegistryContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
coordinatorEndpoint: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as CoordinatorRegistryContract;
const txHash = await self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
coordinatorEndpoint: string,
txData: Partial<TxData> = {},

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type DummyERC20TokenEventArgs =
@@ -88,6 +99,19 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_spender: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.approve.sendTransactionAsync(_spender,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_spender: string,
_value: BigNumber,
@@ -202,6 +226,21 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.transferFrom.sendTransactionAsync(_from,
_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -396,6 +435,17 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.mint.sendTransactionAsync(_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_value: BigNumber,
txData: Partial<TxData> = {},
@@ -475,6 +525,19 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.transfer.sendTransactionAsync(_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_to: string,
_value: BigNumber,
@@ -590,6 +653,19 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_target: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.setBalance.sendTransactionAsync(_target,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_target: string,
_value: BigNumber,
@@ -672,6 +748,17 @@ export class DummyERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC20TokenContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -823,7 +910,7 @@ _totalSupply
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('DummyERC20Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('DummyERC20Token', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type DummyERC721TokenEventArgs =
@@ -124,6 +135,19 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_approved: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.approve.sendTransactionAsync(_approved,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_approved: string,
_tokenId: BigNumber,
@@ -212,6 +236,21 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.transferFrom.sendTransactionAsync(_from,
_to,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -303,6 +342,19 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_to: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.mint.sendTransactionAsync(_to,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_to: string,
_tokenId: BigNumber,
@@ -391,6 +443,21 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.safeTransferFrom1.sendTransactionAsync(_from,
_to,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -590,6 +657,19 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_owner: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.burn.sendTransactionAsync(_owner,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_owner: string,
_tokenId: BigNumber,
@@ -675,6 +755,19 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_operator: string,
_approved: boolean,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.setApprovalForAll.sendTransactionAsync(_operator,
_approved
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_operator: string,
_approved: boolean,
@@ -766,6 +859,23 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
_data: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.safeTransferFrom2.sendTransactionAsync(_from,
_to,
_tokenId,
_data
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -890,6 +1000,17 @@ export class DummyERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DummyERC721TokenContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -1001,7 +1122,7 @@ _symbol
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('DummyERC721Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('DummyERC721Token', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -38,6 +49,17 @@ export class DutchAuctionContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DutchAuctionContract;
const txHash = await self.getAuctionDetails.sendTransactionAsync(order
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
txData: Partial<TxData> = {},
@@ -123,6 +145,23 @@ export class DutchAuctionContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
buySignature: string,
sellSignature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as DutchAuctionContract;
const txHash = await self.matchOrders.sendTransactionAsync(buyOrder,
sellOrder,
buySignature,
sellSignature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
@@ -245,7 +284,7 @@ export class DutchAuctionContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('DutchAuction', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('DutchAuction', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ERC20ProxyEventArgs =
@@ -57,6 +68,17 @@ export class ERC20ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20ProxyContract;
const txHash = await self.addAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -161,6 +183,17 @@ export class ERC20ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20ProxyContract;
const txHash = await self.removeAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -266,6 +299,19 @@ export class ERC20ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
index: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20ProxyContract;
const txHash = await self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
index
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
index: BigNumber,
@@ -428,6 +474,17 @@ export class ERC20ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20ProxyContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -525,7 +582,7 @@ export class ERC20ProxyContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('ERC20Proxy', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('ERC20Proxy', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ERC20TokenEventArgs =
@@ -62,6 +73,19 @@ export class ERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_spender: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20TokenContract;
const txHash = await self.approve.sendTransactionAsync(_spender,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_spender: string,
_value: BigNumber,
@@ -176,6 +200,21 @@ export class ERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20TokenContract;
const txHash = await self.transferFrom.sendTransactionAsync(_from,
_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -295,6 +334,19 @@ export class ERC20TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC20TokenContract;
const txHash = await self.transfer.sendTransactionAsync(_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_to: string,
_value: BigNumber,
@@ -428,7 +480,7 @@ export class ERC20TokenContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('ERC20Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('ERC20Token', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ERC721ProxyEventArgs =
@@ -57,6 +68,17 @@ export class ERC721ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721ProxyContract;
const txHash = await self.addAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -161,6 +183,17 @@ export class ERC721ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721ProxyContract;
const txHash = await self.removeAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -266,6 +299,19 @@ export class ERC721ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
index: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721ProxyContract;
const txHash = await self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
index
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
index: BigNumber,
@@ -428,6 +474,17 @@ export class ERC721ProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721ProxyContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -525,7 +582,7 @@ export class ERC721ProxyContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('ERC721Proxy', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('ERC721Proxy', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ERC721TokenEventArgs =
@@ -98,6 +109,19 @@ export class ERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_approved: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721TokenContract;
const txHash = await self.approve.sendTransactionAsync(_approved,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_approved: string,
_tokenId: BigNumber,
@@ -186,6 +210,21 @@ export class ERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721TokenContract;
const txHash = await self.transferFrom.sendTransactionAsync(_from,
_to,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -280,6 +319,21 @@ export class ERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721TokenContract;
const txHash = await self.safeTransferFrom1.sendTransactionAsync(_from,
_to,
_tokenId
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -427,6 +481,19 @@ export class ERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_operator: string,
_approved: boolean,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721TokenContract;
const txHash = await self.setApprovalForAll.sendTransactionAsync(_operator,
_approved
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_operator: string,
_approved: boolean,
@@ -518,6 +585,23 @@ export class ERC721TokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_tokenId: BigNumber,
_data: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ERC721TokenContract;
const txHash = await self.safeTransferFrom2.sendTransactionAsync(_from,
_to,
_tokenId,
_data
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -663,7 +747,7 @@ export class ERC721TokenContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('ERC721Token', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('ERC721Token', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ExchangeEventArgs =
@@ -127,6 +138,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.batchFillOrders.sendTransactionAsync(orders,
takerAssetFillAmounts,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
@@ -249,6 +275,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
hash: string,
signerAddress: string,
signature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.preSign.sendTransactionAsync(hash,
signerAddress,
signature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
hash: string,
signerAddress: string,
@@ -346,6 +387,23 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
leftSignature: string,
rightSignature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.matchOrders.sendTransactionAsync(leftOrder,
rightOrder,
leftSignature,
rightSignature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
leftOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
rightOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
@@ -446,6 +504,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
signature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.fillOrderNoThrow.sendTransactionAsync(order,
takerAssetFillAmount,
signature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
@@ -562,6 +635,17 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.batchCancelOrders.sendTransactionAsync(orders
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
txData: Partial<TxData> = {},
@@ -644,6 +728,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.batchFillOrKillOrders.sendTransactionAsync(orders,
takerAssetFillAmounts,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
@@ -732,6 +831,17 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
targetOrderEpoch: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.cancelOrdersUpTo.sendTransactionAsync(targetOrderEpoch
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
targetOrderEpoch: BigNumber,
txData: Partial<TxData> = {},
@@ -814,6 +924,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.batchFillOrdersNoThrow.sendTransactionAsync(orders,
takerAssetFillAmounts,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmounts: BigNumber[],
@@ -964,6 +1089,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
signature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.fillOrKillOrder.sendTransactionAsync(order,
takerAssetFillAmount,
signature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
@@ -1055,6 +1195,19 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
validatorAddress: string,
approval: boolean,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.setSignatureValidatorApproval.sendTransactionAsync(validatorAddress,
approval
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
validatorAddress: string,
approval: boolean,
@@ -1173,6 +1326,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmount: BigNumber,
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.marketSellOrders.sendTransactionAsync(orders,
takerAssetFillAmount,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmount: BigNumber,
@@ -1383,6 +1551,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.marketBuyOrdersNoThrow.sendTransactionAsync(orders,
makerAssetFillAmount,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
@@ -1477,6 +1660,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
signature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.fillOrder.sendTransactionAsync(order,
takerAssetFillAmount,
signature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
takerAssetFillAmount: BigNumber,
@@ -1574,6 +1772,23 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
salt: BigNumber,
signerAddress: string,
data: string,
signature: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.executeTransaction.sendTransactionAsync(salt,
signerAddress,
data,
signature
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
salt: BigNumber,
signerAddress: string,
@@ -1668,6 +1883,17 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
assetProxy: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.registerAssetProxy.sendTransactionAsync(assetProxy
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
assetProxy: string,
txData: Partial<TxData> = {},
@@ -1772,6 +1998,17 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.cancelOrder.sendTransactionAsync(order
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
txData: Partial<TxData> = {},
@@ -1910,6 +2147,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmount: BigNumber,
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.marketSellOrdersNoThrow.sendTransactionAsync(orders,
takerAssetFillAmount,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
takerAssetFillAmount: BigNumber,
@@ -2030,6 +2282,21 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
signatures: string[],
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.marketBuyOrders.sendTransactionAsync(orders,
makerAssetFillAmount,
signatures
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
@@ -2144,6 +2411,17 @@ export class ExchangeContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ExchangeContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -2274,7 +2552,7 @@ export class ExchangeContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('Exchange', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('Exchange', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -56,6 +67,29 @@ export class ForwarderContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
signatures: string[],
feeOrders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
feeSignatures: string[],
feePercentage: BigNumber,
feeRecipient: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ForwarderContract;
const txHash = await self.marketBuyOrdersWithEth.sendTransactionAsync(orders,
makerAssetFillAmount,
signatures,
feeOrders,
feeSignatures,
feePercentage,
feeRecipient
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
makerAssetFillAmount: BigNumber,
@@ -171,6 +205,19 @@ export class ForwarderContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
assetData: string,
amount: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ForwarderContract;
const txHash = await self.withdrawAsset.sendTransactionAsync(assetData,
amount
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
assetData: string,
amount: BigNumber,
@@ -294,6 +341,27 @@ export class ForwarderContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
signatures: string[],
feeOrders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
feeSignatures: string[],
feePercentage: BigNumber,
feeRecipient: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ForwarderContract;
const txHash = await self.marketSellOrdersWithEth.sendTransactionAsync(orders,
signatures,
feeOrders,
feeSignatures,
feePercentage,
feeRecipient
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
signatures: string[],
@@ -400,6 +468,17 @@ export class ForwarderContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ForwarderContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -518,7 +597,7 @@ _wethAssetData
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('Forwarder', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('Forwarder', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -38,6 +49,17 @@ export class IAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as IAssetProxyContract;
const txHash = await self.addAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -114,6 +136,17 @@ export class IAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as IAssetProxyContract;
const txHash = await self.removeAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -193,6 +226,19 @@ export class IAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
index: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as IAssetProxyContract;
const txHash = await self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
index
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
index: BigNumber,
@@ -284,6 +330,23 @@ export class IAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
assetData: string,
from: string,
to: string,
amount: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as IAssetProxyContract;
const txHash = await self.transferFrom.sendTransactionAsync(assetData,
from,
to,
amount
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
assetData: string,
from: string,
@@ -430,6 +493,17 @@ export class IAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as IAssetProxyContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -91,7 +102,7 @@ export class IValidatorContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('IValidator', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('IValidator', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -89,7 +100,7 @@ export class IWalletContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('IWallet', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('IWallet', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type MultiAssetProxyEventArgs =
@@ -92,6 +103,17 @@ export class MultiAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as MultiAssetProxyContract;
const txHash = await self.addAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -224,6 +246,17 @@ export class MultiAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as MultiAssetProxyContract;
const txHash = await self.removeAuthorizedAddress.sendTransactionAsync(target
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
txData: Partial<TxData> = {},
@@ -329,6 +362,19 @@ export class MultiAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
target: string,
index: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as MultiAssetProxyContract;
const txHash = await self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
index
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
target: string,
index: BigNumber,
@@ -465,6 +511,17 @@ export class MultiAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
assetProxy: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as MultiAssetProxyContract;
const txHash = await self.registerAssetProxy.sendTransactionAsync(assetProxy
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
assetProxy: string,
txData: Partial<TxData> = {},
@@ -567,6 +624,17 @@ export class MultiAssetProxyContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
newOwner: string,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as MultiAssetProxyContract;
const txHash = await self.transferOwnership.sendTransactionAsync(newOwner
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
newOwner: string,
txData: Partial<TxData> = {},
@@ -664,7 +732,7 @@ export class MultiAssetProxyContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('MultiAssetProxy', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('MultiAssetProxy', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
@@ -283,7 +294,7 @@ _zrxAssetData
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('OrderValidator', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('OrderValidator', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type WETH9EventArgs =
@@ -102,6 +113,19 @@ export class WETH9Contract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
guy: string,
wad: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as WETH9Contract;
const txHash = await self.approve.sendTransactionAsync(guy,
wad
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
guy: string,
wad: BigNumber,
@@ -216,6 +240,21 @@ export class WETH9Contract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
src: string,
dst: string,
wad: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as WETH9Contract;
const txHash = await self.transferFrom.sendTransactionAsync(src,
dst,
wad
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
src: string,
dst: string,
@@ -304,6 +343,17 @@ export class WETH9Contract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
wad: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as WETH9Contract;
const txHash = await self.withdraw.sendTransactionAsync(wad
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
wad: BigNumber,
txData: Partial<TxData> = {},
@@ -463,6 +513,19 @@ export class WETH9Contract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
dst: string,
wad: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as WETH9Contract;
const txHash = await self.transfer.sendTransactionAsync(dst,
wad
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
dst: string,
wad: BigNumber,
@@ -542,6 +605,15 @@ export class WETH9Contract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as WETH9Contract;
const txHash = await self.deposit.sendTransactionAsync();
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
txData: Partial<TxData> = {},
): Promise<number> {
@@ -663,7 +735,7 @@ export class WETH9Contract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('WETH9', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('WETH9', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count

View File

@@ -1,13 +1,24 @@
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
// tslint:disable:no-unused-variable
// tslint:disable:no-unbound-method
import { BaseContract } from '@0x/base-contract';
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, TxData, TxDataPayable, SupportedProvider } from 'ethereum-types';
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
import {
BlockParam,
BlockParamLiteral,
CallData,
ContractAbi,
ContractArtifact,
DecodedLogArgs,
MethodAbi,
TransactionReceiptWithDecodedLogs,
TxData,
TxDataPayable,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
import { SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as ethers from 'ethers';
import * as _ from 'lodash';
// tslint:enable:no-unused-variable
export type ZRXTokenEventArgs =
@@ -88,6 +99,19 @@ export class ZRXTokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_spender: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ZRXTokenContract;
const txHash = await self.approve.sendTransactionAsync(_spender,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_spender: string,
_value: BigNumber,
@@ -202,6 +226,21 @@ export class ZRXTokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_from: string,
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ZRXTokenContract;
const txHash = await self.transferFrom.sendTransactionAsync(_from,
_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_from: string,
_to: string,
@@ -373,6 +412,19 @@ export class ZRXTokenContract extends BaseContract {
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
return txHash;
},
async awaitTransactionSuccessAsync(
_to: string,
_value: BigNumber,
pollingIntervalMs?: number,
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
const self = this as any as ZRXTokenContract;
const txHash = await self.transfer.sendTransactionAsync(_to,
_value
);
const receiptPromise = self._web3Wrapper.awaitTransactionSuccessAsync(txHash, pollingIntervalMs) as PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>;
receiptPromise.txHash = txHash;
return receiptPromise;
},
async estimateGasAsync(
_to: string,
_value: BigNumber,
@@ -506,7 +558,7 @@ export class ZRXTokenContract extends BaseContract {
return contractInstance;
}
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
super('ZRXToken', abi, address, providerUtils.standardizeOrThrow(supportedProvider), txDefaults);
super('ZRXToken', abi, address, supportedProvider, txDefaults);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count