diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-09-25 19:55:07 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-09-25 19:55:07 +0800 |
commit | 47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f (patch) | |
tree | 22d6e22efb3428862a02eef72aca7546029c3086 /packages/asset-buyer/src/types.ts | |
parent | 89033e01e81fba91aecf62822b582f6f007f5494 (diff) | |
download | dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar.gz dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar.bz2 dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar.lz dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar.xz dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.tar.zst dexon-sol-tools-47f8b5d6fc941b3f9c5cf8bb00c3be6123be629f.zip |
Use options object convention everywhere, and make package private
Diffstat (limited to 'packages/asset-buyer/src/types.ts')
-rw-r--r-- | packages/asset-buyer/src/types.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/asset-buyer/src/types.ts b/packages/asset-buyer/src/types.ts index 141193b7b..67baa51c7 100644 --- a/packages/asset-buyer/src/types.ts +++ b/packages/asset-buyer/src/types.ts @@ -52,6 +52,11 @@ export interface BuyQuote { feePercentage?: number; } +/** + * feePercentage: The affiliate fee percentage. Defaults to 0. + * shouldForceOrderRefresh: If set to true, new orders and state will be fetched instead of waiting for the next orderRefreshIntervalMs. Defaults to false. + * slippagePercentage: The percentage buffer to add to account for slippage. Affects max ETH price estimates. Defaults to 0.2 (20%). + */ export interface BuyQuoteRequestOpts { feePercentage: number; shouldForceOrderRefresh: boolean; @@ -59,6 +64,28 @@ export interface BuyQuoteRequestOpts { } /** + * rate: The desired rate to execute the buy at. Affects the amount of ETH sent with the transaction, defaults to buyQuote.maxRate. + * takerAddress: The address to perform the buy. Defaults to the first available address from the provider. + * feeRecipient: The address where affiliate fees are sent. Defaults to null address (0x000...000). + */ +export interface BuyQuoteExecutionOpts { + rate?: BigNumber; + takerAddress?: string; + feeRecipient: string; +} + +/** + * networkId: The ethereum network id. Defaults to 1 (mainnet). + * orderRefreshIntervalMs: The interval in ms that getBuyQuoteAsync should trigger an refresh of orders and order states. Defaults to 10000ms (10s). + * expiryBufferSeconds: The number of seconds to add when calculating whether an order is expired or not. Defaults to 15s. + */ +export interface AssetBuyerOpts { + networkId: number; + orderRefreshIntervalMs: number; + expiryBufferSeconds: number; +} + +/** * Possible errors thrown by an AssetBuyer instance or associated static methods. */ export enum AssetBuyerError { |