aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/abstract
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-04 03:27:01 +0800
committerFabio Berger <me@fabioberger.com>2018-08-04 03:27:01 +0800
commit343cd05363166a7a93fca361d5547b39f3e83d99 (patch)
treeae1eafee9070a4f712faa19e10f3ac5894f9d954 /packages/order-utils/src/abstract
parentd9f09b5e1e7ecc8dc56ac7184cfc0152b3c2ff32 (diff)
downloaddexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar.gz
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar.bz2
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar.lz
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar.xz
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.tar.zst
dexon-sol-tools-343cd05363166a7a93fca361d5547b39f3e83d99.zip
Add missing comments
Diffstat (limited to 'packages/order-utils/src/abstract')
-rw-r--r--packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts17
-rw-r--r--packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts15
2 files changed, 32 insertions, 0 deletions
diff --git a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
index b2760d98e..7cb859ca7 100644
--- a/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
+++ b/packages/order-utils/src/abstract/abstract_balance_and_proxy_allowance_fetcher.ts
@@ -1,6 +1,23 @@
import { BigNumber } from '@0xproject/utils';
+/**l
+ * An abstract class to be implemented in order to use OrderStateUtils. The class that
+ * implements this interface must be capable of fetching the balance and proxyAllowance
+ * for an Ethereum address and assetData
+ */
export abstract class AbstractBalanceAndProxyAllowanceFetcher {
+ /**
+ * Get balance of assetData for userAddress
+ * @param assetData AssetData for which to fetch the balance
+ * @param userAddress Ethereum address for which to fetch the balance
+ * @return Balance amount in base units
+ */
public abstract async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber>;
+ /**
+ * Get the 0x asset proxy allowance of assetData for userAddress
+ * @param assetData AssetData for which to fetch the allowance
+ * @param userAddress Ethereum address for which to fetch the allowance
+ * @return Allowance amount in base units
+ */
public abstract async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise<BigNumber>;
}
diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
index 865ea4e43..d2b01c359 100644
--- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
+++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts
@@ -1,7 +1,22 @@
import { BigNumber } from '@0xproject/utils';
+/**l
+ * An abstract class to be implemented in order to use OrderStateUtils. The class that
+ * implements this interface must be capable of fetching the amount filled of an order
+ * and whether it's been cancelled.
+ */
export abstract class AbstractOrderFilledCancelledFetcher {
+ /**
+ * Get the amount of the order's takerToken amount already filled
+ * @param orderHash OrderHash of order we are interested in
+ * @return FilledTakerAmount
+ */
public abstract async getFilledTakerAmountAsync(orderHash: string): Promise<BigNumber>;
+ /**
+ * Whether an order is cancelled
+ * @param orderHash OrderHash of order we are interested in
+ * @return Whether or not the order is cancelled
+ */
public abstract async isOrderCancelledAsync(orderHash: string): Promise<boolean>;
public abstract getZRXAssetData(): string;
}