framework for exchange swap quote consumer

This commit is contained in:
David Sun
2019-06-21 09:38:59 -07:00
parent e4a5518a7c
commit 4b09204936
2 changed files with 16 additions and 6 deletions

View File

@@ -51,7 +51,7 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumer<ExchangeMark
}
public getSmartContractParamsOrThrow = (quote: SwapQuote, opts: Partial<SwapQuoteGetOutputOpts>): SmartContractParamsInfo<ExchangeMarketBuySmartContractParams> => {
}
public executeSwapQuoteOrThrowAsync = async (quote: SwapQuote, opts: Partial<SwapQuoteExecutionOpts>): Promise<string> => {

View File

@@ -66,6 +66,17 @@ export interface SmartContractParamsInfo<T> {
methodAbi: MethodAbi;
}
/**
* orders: An array of objects conforming to SignedOrder. These orders can be used to cover the requested assetBuyAmount plus slippage.
* makerAssetFillAmount: The amount of makerAsset to swap for.
* signatures: An array of signatures that attest that the maker of the orders in fact made the orders.
*/
export interface ExchangeMarketBuySmartContractParams {
orders: SignedOrder[];
makerAssetFillAmount: BigNumber;
signatures: string[];
}
/**
* orders: An array of objects conforming to SignedOrder. These orders can be used to cover the requested assetBuyAmount plus slippage.
* makerAssetFillAmount: The amount of makerAsset to swap for.
@@ -76,10 +87,7 @@ export interface SmartContractParamsInfo<T> {
* feePercentage: percentage (up to 5%) of the taker asset paid to feeRecipient
* feeRecipient: address of the receiver of the feePercentage of taker asset
*/
export interface ForwarderMarketBuySmartContractParams {
orders: SignedOrder[];
makerAssetFillAmount: BigNumber;
signatures: string[];
export interface ForwarderMarketBuySmartContractParams extends ExchangeMarketBuySmartContractParams {
feeOrders: SignedOrder[];
feeSignatures: string[];
feePercentage: BigNumber;
@@ -87,7 +95,9 @@ export interface ForwarderMarketBuySmartContractParams {
}
export interface ExchangeMarketBuySmartContractParams {
orders: SignedOrder[];
makerAssetFillAmount: BigNumber;
signatures: string[];
}
/**