feat: Prune Paths + Fast ABI (#183)
* Cull paths which cannot improve price * fixes and rename * optimizations * disable ABI optimization for sampler * fix lint * use fastabi * Update to fastabi 0.0.2 * update packages * Fix NaN case * update to published packages * rebased * Update generated wrappers
This commit is contained in:
parent
5946d32a7d
commit
cd296b8767
@ -1,4 +1,17 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "6.8.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Prune paths which cannot improve the best path",
|
||||||
|
"pr": 183
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Use FastABI for Sampler ABI encoding and decoding",
|
||||||
|
"pr": 183
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "6.7.0",
|
"version": "6.7.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/assert": "^3.0.26",
|
"@0x/assert": "^3.0.26",
|
||||||
"@0x/base-contract": "^6.3.2",
|
"@0x/base-contract": "^6.4.0",
|
||||||
"@0x/contract-addresses": "^6.0.0",
|
"@0x/contract-addresses": "^6.0.0",
|
||||||
"@0x/contract-wrappers": "^13.15.0",
|
"@0x/contract-wrappers": "^13.15.0",
|
||||||
"@0x/contracts-erc20": "^3.3.6",
|
"@0x/contracts-erc20": "^3.3.6",
|
||||||
@ -84,11 +84,12 @@
|
|||||||
"decimal.js": "^10.2.0",
|
"decimal.js": "^10.2.0",
|
||||||
"ethereum-types": "^3.5.0",
|
"ethereum-types": "^3.5.0",
|
||||||
"ethereumjs-util": "^7.0.10",
|
"ethereumjs-util": "^7.0.10",
|
||||||
|
"fast-abi": "^0.0.2",
|
||||||
"heartbeats": "^5.0.1",
|
"heartbeats": "^5.0.1",
|
||||||
"lodash": "^4.17.11"
|
"lodash": "^4.17.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@0x/base-contract": "^6.3.2",
|
"@0x/abi-gen": "^5.6.0",
|
||||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||||
"@0x/contracts-exchange": "^3.2.28",
|
"@0x/contracts-exchange": "^3.2.28",
|
||||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||||
|
@ -2,7 +2,8 @@ import { ChainId, getContractAddressesForChainOrThrow } from '@0x/contract-addre
|
|||||||
import { FillQuoteTransformerOrderType, LimitOrder } from '@0x/protocol-utils';
|
import { FillQuoteTransformerOrderType, LimitOrder } from '@0x/protocol-utils';
|
||||||
import { BigNumber, providerUtils } from '@0x/utils';
|
import { BigNumber, providerUtils } from '@0x/utils';
|
||||||
import Axios, { AxiosInstance } from 'axios';
|
import Axios, { AxiosInstance } from 'axios';
|
||||||
import { BlockParamLiteral, SupportedProvider, ZeroExProvider } from 'ethereum-types';
|
import { BlockParamLiteral, MethodAbi, SupportedProvider, ZeroExProvider } from 'ethereum-types';
|
||||||
|
import { FastABI } from 'fast-abi';
|
||||||
import { Agent as HttpAgent } from 'http';
|
import { Agent as HttpAgent } from 'http';
|
||||||
import { Agent as HttpsAgent } from 'https';
|
import { Agent as HttpsAgent } from 'https';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@ -122,12 +123,19 @@ export class SwapQuoter {
|
|||||||
{ block: BlockParamLiteral.Latest, overrides: defaultCodeOverrides },
|
{ block: BlockParamLiteral.Latest, overrides: defaultCodeOverrides },
|
||||||
options.samplerOverrides,
|
options.samplerOverrides,
|
||||||
);
|
);
|
||||||
|
const fastAbi = new FastABI(ERC20BridgeSamplerContract.ABI() as MethodAbi[]);
|
||||||
const samplerContract = new ERC20BridgeSamplerContract(
|
const samplerContract = new ERC20BridgeSamplerContract(
|
||||||
this._contractAddresses.erc20BridgeSampler,
|
this._contractAddresses.erc20BridgeSampler,
|
||||||
this.provider,
|
this.provider,
|
||||||
{
|
{
|
||||||
gas: samplerGasLimit,
|
gas: samplerGasLimit,
|
||||||
},
|
},
|
||||||
|
{},
|
||||||
|
undefined,
|
||||||
|
{
|
||||||
|
encodeInput: (fnName: string, values: any) => fastAbi.encodeInput(fnName, values),
|
||||||
|
decodeOutput: (fnName: string, data: string) => fastAbi.decodeOutput(fnName, data),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
this._marketOperationUtils = new MarketOperationUtils(
|
this._marketOperationUtils = new MarketOperationUtils(
|
||||||
|
@ -1025,7 +1025,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
|||||||
},
|
},
|
||||||
[ERC20BridgeSource.Uniswap]: () => 90e3,
|
[ERC20BridgeSource.Uniswap]: () => 90e3,
|
||||||
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
||||||
return (fillData as LiquidityProviderFillData).gasCost;
|
return (fillData as LiquidityProviderFillData).gasCost || 100e3;
|
||||||
},
|
},
|
||||||
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
|
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
|
||||||
[ERC20BridgeSource.Kyber]: () => 450e3,
|
[ERC20BridgeSource.Kyber]: () => 450e3,
|
||||||
|
@ -152,7 +152,7 @@ function dexSamplesToFills(
|
|||||||
const { source, fillData } = sample;
|
const { source, fillData } = sample;
|
||||||
const input = sample.input.minus(prevSample ? prevSample.input : 0);
|
const input = sample.input.minus(prevSample ? prevSample.input : 0);
|
||||||
const output = sample.output.minus(prevSample ? prevSample.output : 0);
|
const output = sample.output.minus(prevSample ? prevSample.output : 0);
|
||||||
const fee = fees[source] === undefined ? 0 : fees[source]!(sample.fillData);
|
const fee = fees[source] === undefined ? 0 : fees[source]!(sample.fillData) || 0;
|
||||||
let penalty = ZERO_AMOUNT;
|
let penalty = ZERO_AMOUNT;
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
// Only the first fill in a DEX path incurs a penalty.
|
// Only the first fill in a DEX path incurs a penalty.
|
||||||
|
@ -152,6 +152,17 @@ export class Path {
|
|||||||
return getRate(this.side, input, output);
|
return getRate(this.side, input, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the best possible rate this path can offer, given the fills.
|
||||||
|
*/
|
||||||
|
public bestRate(): BigNumber {
|
||||||
|
const best = this.fills.reduce((prevRate, curr) => {
|
||||||
|
const currRate = getRate(this.side, curr.input, curr.output);
|
||||||
|
return prevRate.isLessThan(currRate) ? currRate : prevRate;
|
||||||
|
}, new BigNumber(0));
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
public adjustedSlippage(maxRate: BigNumber): number {
|
public adjustedSlippage(maxRate: BigNumber): number {
|
||||||
if (maxRate.eq(0)) {
|
if (maxRate.eq(0)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4,7 +4,7 @@ import * as _ from 'lodash';
|
|||||||
import { MarketOperation } from '../../types';
|
import { MarketOperation } from '../../types';
|
||||||
|
|
||||||
import { DEFAULT_PATH_PENALTY_OPTS, Path, PathPenaltyOpts } from './path';
|
import { DEFAULT_PATH_PENALTY_OPTS, Path, PathPenaltyOpts } from './path';
|
||||||
import { Fill } from './types';
|
import { ERC20BridgeSource, Fill } from './types';
|
||||||
|
|
||||||
// tslint:disable: prefer-for-of custom-no-magic-numbers completed-docs no-bitwise
|
// tslint:disable: prefer-for-of custom-no-magic-numbers completed-docs no-bitwise
|
||||||
|
|
||||||
@ -22,12 +22,13 @@ export async function findOptimalPathAsync(
|
|||||||
opts: PathPenaltyOpts = DEFAULT_PATH_PENALTY_OPTS,
|
opts: PathPenaltyOpts = DEFAULT_PATH_PENALTY_OPTS,
|
||||||
): Promise<Path | undefined> {
|
): Promise<Path | undefined> {
|
||||||
// Sort fill arrays by descending adjusted completed rate.
|
// Sort fill arrays by descending adjusted completed rate.
|
||||||
const sortedPaths = fillsToSortedPaths(fills, side, targetInput, opts);
|
// Remove any paths which cannot impact the optimal path
|
||||||
|
const sortedPaths = reducePaths(fillsToSortedPaths(fills, side, targetInput, opts), side);
|
||||||
if (sortedPaths.length === 0) {
|
if (sortedPaths.length === 0) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
const rates = rateBySourcePathId(sortedPaths);
|
||||||
let optimalPath = sortedPaths[0];
|
let optimalPath = sortedPaths[0];
|
||||||
const rates = rateBySourcePathId(side, fills, targetInput);
|
|
||||||
for (const [i, path] of sortedPaths.slice(1).entries()) {
|
for (const [i, path] of sortedPaths.slice(1).entries()) {
|
||||||
optimalPath = mixPaths(side, optimalPath, path, targetInput, runLimit * RUN_LIMIT_DECAY_FACTOR ** i, rates);
|
optimalPath = mixPaths(side, optimalPath, path, targetInput, runLimit * RUN_LIMIT_DECAY_FACTOR ** i, rates);
|
||||||
// Yield to event loop.
|
// Yield to event loop.
|
||||||
@ -44,10 +45,47 @@ export function fillsToSortedPaths(
|
|||||||
opts: PathPenaltyOpts,
|
opts: PathPenaltyOpts,
|
||||||
): Path[] {
|
): Path[] {
|
||||||
const paths = fills.map(singleSourceFills => Path.create(side, singleSourceFills, targetInput, opts));
|
const paths = fills.map(singleSourceFills => Path.create(side, singleSourceFills, targetInput, opts));
|
||||||
const sortedPaths = paths.sort((a, b) => b.adjustedCompleteRate().comparedTo(a.adjustedCompleteRate()));
|
const sortedPaths = paths.sort((a, b) => {
|
||||||
|
const aRate = a.adjustedCompleteRate();
|
||||||
|
const bRate = b.adjustedCompleteRate();
|
||||||
|
// There is a case where the adjusted completed rate isn't sufficient for the desired amount
|
||||||
|
// resulting in a NaN div by 0 (output)
|
||||||
|
if (bRate.isNaN()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (aRate.isNaN()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return bRate.comparedTo(aRate);
|
||||||
|
});
|
||||||
return sortedPaths;
|
return sortedPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove paths which have no impact on the optimal path
|
||||||
|
export function reducePaths(sortedPaths: Path[], side: MarketOperation): Path[] {
|
||||||
|
// Any path which has a min rate that is less than the best adjusted completed rate has no chance of improving
|
||||||
|
// the overall route.
|
||||||
|
const bestNonNativeCompletePath = sortedPaths.filter(
|
||||||
|
p => p.isComplete() && p.fills[0].source !== ERC20BridgeSource.Native,
|
||||||
|
)[0];
|
||||||
|
|
||||||
|
// If there is no complete path then just go ahead with the sorted paths
|
||||||
|
// I.e if the token only exists on sources which cannot sell to infinity
|
||||||
|
// or buys where X is greater than all the tokens available in the pools
|
||||||
|
if (!bestNonNativeCompletePath) {
|
||||||
|
return sortedPaths;
|
||||||
|
}
|
||||||
|
const bestNonNativeCompletePathAdjustedRate = bestNonNativeCompletePath.adjustedCompleteRate();
|
||||||
|
if (!bestNonNativeCompletePathAdjustedRate.isGreaterThan(0)) {
|
||||||
|
return sortedPaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filteredPaths = sortedPaths.filter(p =>
|
||||||
|
p.bestRate().isGreaterThanOrEqualTo(bestNonNativeCompletePathAdjustedRate),
|
||||||
|
);
|
||||||
|
return filteredPaths;
|
||||||
|
}
|
||||||
|
|
||||||
function mixPaths(
|
function mixPaths(
|
||||||
side: MarketOperation,
|
side: MarketOperation,
|
||||||
pathA: Path,
|
pathA: Path,
|
||||||
@ -98,17 +136,6 @@ function mixPaths(
|
|||||||
return bestPath;
|
return bestPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
function rateBySourcePathId(
|
function rateBySourcePathId(paths: Path[]): { [id: string]: BigNumber } {
|
||||||
side: MarketOperation,
|
return _.fromPairs(paths.map(p => [p.fills[0].sourcePathId, p.adjustedRate()]));
|
||||||
fills: Fill[][],
|
|
||||||
targetInput: BigNumber,
|
|
||||||
): { [id: string]: BigNumber } {
|
|
||||||
const flattenedFills = _.flatten(fills);
|
|
||||||
const sourcePathIds = flattenedFills.filter(f => f.index === 0).map(f => f.sourcePathId);
|
|
||||||
return Object.assign(
|
|
||||||
{},
|
|
||||||
...sourcePathIds.map(s => ({
|
|
||||||
[s]: Path.create(side, flattenedFills.filter(f => f.sourcePathId === s), targetInput).adjustedRate(),
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -141,6 +141,13 @@ export class SamplerOperations {
|
|||||||
orders: SignedNativeOrder[],
|
orders: SignedNativeOrder[],
|
||||||
exchangeAddress: string,
|
exchangeAddress: string,
|
||||||
): BatchedOperation<BigNumber[]> {
|
): BatchedOperation<BigNumber[]> {
|
||||||
|
// Skip checking empty or invalid orders on-chain, returning a constant
|
||||||
|
if (orders.length === 0) {
|
||||||
|
return SamplerOperations.constant<BigNumber[]>([]);
|
||||||
|
}
|
||||||
|
if (orders.length === 1 && orders[0].order.maker === NULL_ADDRESS) {
|
||||||
|
return SamplerOperations.constant<BigNumber[]>([ZERO_AMOUNT]);
|
||||||
|
}
|
||||||
return new SamplerContractOperation({
|
return new SamplerContractOperation({
|
||||||
source: ERC20BridgeSource.Native,
|
source: ERC20BridgeSource.Native,
|
||||||
contract: this._samplerContract,
|
contract: this._samplerContract,
|
||||||
@ -154,6 +161,13 @@ export class SamplerOperations {
|
|||||||
orders: SignedNativeOrder[],
|
orders: SignedNativeOrder[],
|
||||||
exchangeAddress: string,
|
exchangeAddress: string,
|
||||||
): BatchedOperation<BigNumber[]> {
|
): BatchedOperation<BigNumber[]> {
|
||||||
|
// Skip checking empty or invalid orders on-chain, returning a constant
|
||||||
|
if (orders.length === 0) {
|
||||||
|
return SamplerOperations.constant<BigNumber[]>([]);
|
||||||
|
}
|
||||||
|
if (orders.length === 1 && orders[0].order.maker === NULL_ADDRESS) {
|
||||||
|
return SamplerOperations.constant<BigNumber[]>([ZERO_AMOUNT]);
|
||||||
|
}
|
||||||
return new SamplerContractOperation({
|
return new SamplerContractOperation({
|
||||||
source: ERC20BridgeSource.Native,
|
source: ERC20BridgeSource.Native,
|
||||||
contract: this._samplerContract,
|
contract: this._samplerContract,
|
||||||
|
@ -299,6 +299,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
||||||
[ERC20BridgeSource.Eth2Dai]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Eth2Dai]: createDecreasingRates(NUM_SAMPLES),
|
||||||
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
||||||
|
[ERC20BridgeSource.Kyber]: createDecreasingRates(NUM_SAMPLES),
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FillDataBySource {
|
interface FillDataBySource {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -528,6 +529,9 @@ export class BrokerContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as BrokerContract;
|
const self = (this as any) as BrokerContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -914,7 +918,7 @@ export class BrokerContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = BrokerContract.deployedBytecode,
|
deployedBytecode: string | undefined = BrokerContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'Broker',
|
'Broker',
|
||||||
@ -924,7 +928,7 @@ export class BrokerContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
BrokerContract.ABI().forEach((item, index) => {
|
BrokerContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -552,6 +553,9 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as CoordinatorContract;
|
const self = (this as any) as CoordinatorContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -966,7 +970,7 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = CoordinatorContract.deployedBytecode,
|
deployedBytecode: string | undefined = CoordinatorContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'Coordinator',
|
'Coordinator',
|
||||||
@ -976,7 +980,7 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
CoordinatorContract.ABI().forEach((item, index) => {
|
CoordinatorContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -1569,6 +1570,9 @@ export class DevUtilsContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as DevUtilsContract;
|
const self = (this as any) as DevUtilsContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -3371,7 +3375,7 @@ export class DevUtilsContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = DevUtilsContract.deployedBytecode,
|
deployedBytecode: string | undefined = DevUtilsContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'DevUtils',
|
'DevUtils',
|
||||||
@ -3381,7 +3385,7 @@ export class DevUtilsContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
DevUtilsContract.ABI().forEach((item, index) => {
|
DevUtilsContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -400,6 +401,9 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -759,7 +763,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ERC20TokenContract.deployedBytecode,
|
deployedBytecode: string | undefined = ERC20TokenContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'ERC20Token',
|
'ERC20Token',
|
||||||
@ -769,7 +773,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -490,6 +491,9 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ERC721TokenContract;
|
const self = (this as any) as ERC721TokenContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -1039,7 +1043,7 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ERC721TokenContract.deployedBytecode,
|
deployedBytecode: string | undefined = ERC721TokenContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'ERC721Token',
|
'ERC721Token',
|
||||||
@ -1049,7 +1053,7 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -3200,6 +3201,9 @@ export class ExchangeContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ExchangeContract;
|
const self = (this as any) as ExchangeContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -6261,7 +6265,7 @@ export class ExchangeContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ExchangeContract.deployedBytecode,
|
deployedBytecode: string | undefined = ExchangeContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'Exchange',
|
'Exchange',
|
||||||
@ -6271,7 +6275,7 @@ export class ExchangeContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ExchangeEventArgs, ExchangeEvents>(
|
this._subscriptionManager = new SubscriptionManager<ExchangeEventArgs, ExchangeEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -752,6 +753,9 @@ export class ForwarderContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ForwarderContract;
|
const self = (this as any) as ForwarderContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -1589,7 +1593,7 @@ export class ForwarderContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ForwarderContract.deployedBytecode,
|
deployedBytecode: string | undefined = ForwarderContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'Forwarder',
|
'Forwarder',
|
||||||
@ -1599,7 +1603,7 @@ export class ForwarderContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ForwarderEventArgs, ForwarderEvents>(
|
this._subscriptionManager = new SubscriptionManager<ForwarderEventArgs, ForwarderEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -254,6 +255,9 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as GodsUnchainedValidatorContract;
|
const self = (this as any) as GodsUnchainedValidatorContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -304,7 +308,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = GodsUnchainedValidatorContract.deployedBytecode,
|
deployedBytecode: string | undefined = GodsUnchainedValidatorContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'GodsUnchainedValidator',
|
'GodsUnchainedValidator',
|
||||||
@ -314,7 +318,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
GodsUnchainedValidatorContract.ABI().forEach((item, index) => {
|
GodsUnchainedValidatorContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -323,6 +324,9 @@ export class IAssetDataContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as IAssetDataContract;
|
const self = (this as any) as IAssetDataContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -758,7 +762,7 @@ export class IAssetDataContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = IAssetDataContract.deployedBytecode,
|
deployedBytecode: string | undefined = IAssetDataContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'IAssetData',
|
'IAssetData',
|
||||||
@ -768,7 +772,7 @@ export class IAssetDataContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
IAssetDataContract.ABI().forEach((item, index) => {
|
IAssetDataContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -304,6 +305,9 @@ export class ILiquidityProviderContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ILiquidityProviderContract;
|
const self = (this as any) as ILiquidityProviderContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -477,7 +481,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ILiquidityProviderContract.deployedBytecode,
|
deployedBytecode: string | undefined = ILiquidityProviderContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'ILiquidityProvider',
|
'ILiquidityProvider',
|
||||||
@ -487,7 +491,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
ILiquidityProviderContract.ABI().forEach((item, index) => {
|
ILiquidityProviderContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -468,6 +469,9 @@ export class ITransformERC20Contract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as ITransformERC20Contract;
|
const self = (this as any) as ITransformERC20Contract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -1082,7 +1086,7 @@ export class ITransformERC20Contract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = ITransformERC20Contract.deployedBytecode,
|
deployedBytecode: string | undefined = ITransformERC20Contract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'ITransformERC20',
|
'ITransformERC20',
|
||||||
@ -1092,7 +1096,7 @@ export class ITransformERC20Contract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ITransformERC20EventArgs, ITransformERC20Events>(
|
this._subscriptionManager = new SubscriptionManager<ITransformERC20EventArgs, ITransformERC20Events>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -3358,6 +3359,9 @@ export class IZeroExContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as IZeroExContract;
|
const self = (this as any) as IZeroExContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -7338,7 +7342,7 @@ export class IZeroExContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = IZeroExContract.deployedBytecode,
|
deployedBytecode: string | undefined = IZeroExContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'IZeroEx',
|
'IZeroEx',
|
||||||
@ -7348,7 +7352,7 @@ export class IZeroExContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<IZeroExEventArgs, IZeroExEvents>(
|
this._subscriptionManager = new SubscriptionManager<IZeroExEventArgs, IZeroExEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -226,6 +227,9 @@ export class MaximumGasPriceContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as MaximumGasPriceContract;
|
const self = (this as any) as MaximumGasPriceContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -298,7 +302,7 @@ export class MaximumGasPriceContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = MaximumGasPriceContract.deployedBytecode,
|
deployedBytecode: string | undefined = MaximumGasPriceContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'MaximumGasPrice',
|
'MaximumGasPrice',
|
||||||
@ -308,7 +312,7 @@ export class MaximumGasPriceContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
MaximumGasPriceContract.ABI().forEach((item, index) => {
|
MaximumGasPriceContract.ABI().forEach((item, index) => {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -1669,6 +1670,9 @@ export class StakingContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as StakingContract;
|
const self = (this as any) as StakingContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -3731,7 +3735,7 @@ export class StakingContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = StakingContract.deployedBytecode,
|
deployedBytecode: string | undefined = StakingContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'Staking',
|
'Staking',
|
||||||
@ -3741,7 +3745,7 @@ export class StakingContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<StakingEventArgs, StakingEvents>(
|
this._subscriptionManager = new SubscriptionManager<StakingEventArgs, StakingEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -796,6 +797,9 @@ export class StakingProxyContract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as StakingProxyContract;
|
const self = (this as any) as StakingProxyContract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -1745,7 +1749,7 @@ export class StakingProxyContract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = StakingProxyContract.deployedBytecode,
|
deployedBytecode: string | undefined = StakingProxyContract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'StakingProxy',
|
'StakingProxy',
|
||||||
@ -1755,7 +1759,7 @@ export class StakingProxyContract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<StakingProxyEventArgs, StakingProxyEvents>(
|
this._subscriptionManager = new SubscriptionManager<StakingProxyEventArgs, StakingProxyEvents>(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// tslint:disable:no-unused-variable
|
// tslint:disable:no-unused-variable
|
||||||
import {
|
import {
|
||||||
AwaitTransactionSuccessOpts,
|
AwaitTransactionSuccessOpts,
|
||||||
|
EncoderOverrides,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
@ -524,6 +525,9 @@ export class WETH9Contract extends BaseContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||||
|
if (this._encoderOverrides.decodeOutput) {
|
||||||
|
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||||
|
}
|
||||||
const functionSignature = this.getFunctionSignature(methodName);
|
const functionSignature = this.getFunctionSignature(methodName);
|
||||||
const self = (this as any) as WETH9Contract;
|
const self = (this as any) as WETH9Contract;
|
||||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||||
@ -1028,7 +1032,7 @@ export class WETH9Contract extends BaseContract {
|
|||||||
txDefaults?: Partial<TxData>,
|
txDefaults?: Partial<TxData>,
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
deployedBytecode: string | undefined = WETH9Contract.deployedBytecode,
|
deployedBytecode: string | undefined = WETH9Contract.deployedBytecode,
|
||||||
encodingRules?: EncodingRules,
|
encoderOverrides?: Partial<EncoderOverrides>,
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
'WETH9',
|
'WETH9',
|
||||||
@ -1038,7 +1042,7 @@ export class WETH9Contract extends BaseContract {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
logDecodeDependencies,
|
logDecodeDependencies,
|
||||||
deployedBytecode,
|
deployedBytecode,
|
||||||
encodingRules,
|
encoderOverrides,
|
||||||
);
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<WETH9EventArgs, WETH9Events>(
|
this._subscriptionManager = new SubscriptionManager<WETH9EventArgs, WETH9Events>(
|
||||||
|
@ -3,6 +3,7 @@ export {
|
|||||||
ContractEvent,
|
ContractEvent,
|
||||||
ContractFunctionObj,
|
ContractFunctionObj,
|
||||||
ContractTxFunctionObj,
|
ContractTxFunctionObj,
|
||||||
|
EncoderOverrides,
|
||||||
SendTransactionOpts,
|
SendTransactionOpts,
|
||||||
SubscriptionErrors,
|
SubscriptionErrors,
|
||||||
} from '@0x/base-contract';
|
} from '@0x/base-contract';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user