Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
awaitTransactionSuccessAsync(
txData?: Partial,
pollingIntervalMs?: number,
timeoutMs?: number,
): PromiseWithTransactionHash {
const self = (this as any) as AbiGenDummyContract;
const txHashPromise = self.nonPureMethod.sendTransactionAsync(txData);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
pollingIntervalMs,
timeoutMs,
);
})(),
);
},
/**
awaitTransactionSuccessAsync(
newOwner: string,
txData?: Partial,
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('newOwner', newOwner);
const self = (this as any) as ERC20ProxyContract;
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData, opts);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
awaitTransactionSuccessAsync(
target: string,
index: BigNumber,
txData?: Partial,
pollingIntervalMs?: number,
timeoutMs?: number,
): PromiseWithTransactionHash {
assert.isString('target', target);
assert.isBigNumber('index', index);
const self = (this as any) as ERC20ProxyContract;
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
target.toLowerCase(),
index,
txData,
);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
pollingIntervalMs,
timeoutMs,
);
})(),
);
},
/**
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('assetData', assetData);
assert.isString('from', from);
assert.isString('to', to);
assert.isBigNumber('amount', amount);
const self = (this as any) as IAssetProxyContract;
const txHashPromise = self.transferFrom.sendTransactionAsync(
assetData,
from.toLowerCase(),
to.toLowerCase(),
amount,
txData,
opts,
);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
awaitTransactionSuccessAsync(
target: string,
txData?: Partial,
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('target', target);
const self = (this as any) as ERC721ProxyContract;
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData, opts);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('assetData', assetData);
assert.isString('from', from);
assert.isString('to', to);
assert.isBigNumber('amount', amount);
const self = (this as any) as ERC1155ProxyContract;
const txHashPromise = self.transferFrom.sendTransactionAsync(
assetData,
from.toLowerCase(),
to.toLowerCase(),
amount,
txData,
opts,
);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
sellSignature: string,
txData?: Partial,
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('buySignature', buySignature);
assert.isString('sellSignature', sellSignature);
const self = (this as any) as DutchAuctionContract;
const txHashPromise = self.matchOrders.sendTransactionAsync(
buyOrder,
sellOrder,
buySignature,
sellSignature,
txData,
opts,
);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
awaitTransactionSuccessAsync(
owner: string,
newOwner: string,
txData?: Partial,
pollingIntervalMs?: number,
timeoutMs?: number,
): PromiseWithTransactionHash {
assert.isString('owner', owner);
assert.isString('newOwner', newOwner);
const self = this as any as AssetProxyOwnerContract;
const txHashPromise = self.replaceOwner.sendTransactionAsync(owner,
newOwner
, txData);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
pollingIntervalMs,
timeoutMs,
);
})(),
);
},
async estimateGasAsync(
awaitTransactionSuccessAsync(
target: string,
txData?: Partial,
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('target', target);
const self = (this as any) as MultiAssetProxyContract;
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData, opts);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**
_value: BigNumber,
txData?: Partial,
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
): PromiseWithTransactionHash {
assert.isString('_from', _from);
assert.isString('_to', _to);
assert.isBigNumber('_value', _value);
const self = (this as any) as ZRXTokenContract;
const txHashPromise = self.transferFrom.sendTransactionAsync(
_from.toLowerCase(),
_to.toLowerCase(),
_value,
txData,
opts,
);
return new PromiseWithTransactionHash(
txHashPromise,
(async (): Promise => {
// When the transaction hash resolves, wait for it to be mined.
return self._web3Wrapper.awaitTransactionSuccessAsync(
await txHashPromise,
opts.pollingIntervalMs,
opts.timeoutMs,
);
})(),
);
},
/**