factored out interfaces in types.ts
This commit is contained in:
@@ -2,14 +2,7 @@ import { IERC20BridgeSamplerContract } from '@0x/contract-wrappers';
|
|||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
|
|
||||||
import { samplerOperations } from './sampler_operations';
|
import { samplerOperations } from './sampler_operations';
|
||||||
|
import { BatchedOperation } from './types';
|
||||||
/**
|
|
||||||
* A composable operation the be run in `DexOrderSampler.executeAsync()`.
|
|
||||||
*/
|
|
||||||
export interface BatchedOperation<TResult> {
|
|
||||||
encodeCall(contract: IERC20BridgeSamplerContract): string;
|
|
||||||
handleCallResultsAsync(contract: IERC20BridgeSamplerContract, callResults: string): Promise<TResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate sample amounts up to `maxFillAmount`.
|
* Generate sample amounts up to `maxFillAmount`.
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import { constants } from 'zlib';
|
|||||||
|
|
||||||
import { BigNumber, ERC20BridgeSource, SignedOrder } from '../..';
|
import { BigNumber, ERC20BridgeSource, SignedOrder } from '../..';
|
||||||
|
|
||||||
import { BatchedOperation } from './sampler';
|
import { BatchedOperation, DexSample } from './types';
|
||||||
import { DexSample } from './types';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composable operations that can be batched in a single transaction,
|
* Composable operations that can be batched in a single transaction,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { IERC20BridgeSamplerContract } from '@0x/contract-wrappers';
|
||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
|
|
||||||
import { SignedOrderWithFillableAmounts } from '../../types';
|
import { SignedOrderWithFillableAmounts } from '../../types';
|
||||||
@@ -176,3 +177,11 @@ export interface GetMarketOrdersOpts {
|
|||||||
*/
|
*/
|
||||||
fees: { [source: string]: BigNumber };
|
fees: { [source: string]: BigNumber };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A composable operation the be run in `DexOrderSampler.executeAsync()`.
|
||||||
|
*/
|
||||||
|
export interface BatchedOperation<TResult> {
|
||||||
|
encodeCall(contract: IERC20BridgeSamplerContract): string;
|
||||||
|
handleCallResultsAsync(contract: IERC20BridgeSamplerContract, callResults: string): Promise<TResult>;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user