diff options
Diffstat (limited to 'packages/asset-buyer/src/types.ts')
-rw-r--r-- | packages/asset-buyer/src/types.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/asset-buyer/src/types.ts b/packages/asset-buyer/src/types.ts index d5d6be695..0bf2323bd 100644 --- a/packages/asset-buyer/src/types.ts +++ b/packages/asset-buyer/src/types.ts @@ -75,6 +75,13 @@ export interface BuyQuoteRequestOpts { slippagePercentage: number; } +/* + * Options for checking liquidity + * + * shouldForceOrderRefresh: If set to true, new orders and state will be fetched instead of waiting for the next orderRefreshIntervalMs. Defaults to false. + */ +export interface LiquidityRequestOpts extends Pick<BuyQuoteRequestOpts, 'shouldForceOrderRefresh'> {} + /** * ethAmount: The desired amount of eth to spend. Defaults to buyQuote.worstCaseQuoteInfo.totalEthAmount. * takerAddress: The address to perform the buy. Defaults to the first available address from the provider. @@ -117,7 +124,19 @@ export enum AssetBuyerError { TransactionValueTooLow = 'TRANSACTION_VALUE_TOO_LOW', } +/** + * orders: An array of signed orders + * remainingFillableMakerAssetAmounts: A list of fillable amounts for the signed orders. The index of an item in the array associates the amount with the corresponding order. + */ export interface OrdersAndFillableAmounts { orders: SignedOrder[]; remainingFillableMakerAssetAmounts: BigNumber[]; } + +/** + * Represents available liquidity for a given assetData + */ +export interface LiquidityForAssetData { + tokensAvailableInBaseUnits: number; + ethValueAvailableInWei: number; +} |