aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/exchange_transfer_simulator.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/order-utils/src/exchange_transfer_simulator.ts')
-rw-r--r--packages/order-utils/src/exchange_transfer_simulator.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/order-utils/src/exchange_transfer_simulator.ts b/packages/order-utils/src/exchange_transfer_simulator.ts
index c3a4f9c2a..81c849c64 100644
--- a/packages/order-utils/src/exchange_transfer_simulator.ts
+++ b/packages/order-utils/src/exchange_transfer_simulator.ts
@@ -33,6 +33,10 @@ const ERR_MSG_MAPPING = {
},
};
+/**
+ * An exchange transfer simulator which simulates asset transfers exactly how the
+ * 0x exchange contract would do them.
+ */
export class ExchangeTransferSimulator {
private readonly _store: AbstractBalanceAndProxyAllowanceLazyStore;
private static _throwValidationError(
@@ -43,6 +47,11 @@ export class ExchangeTransferSimulator {
const errMsg = ERR_MSG_MAPPING[failureReason][tradeSide][transferType];
throw new Error(errMsg);
}
+ /**
+ * Instantiate a ExchangeTransferSimulator
+ * @param store A class that implements AbstractBalanceAndProxyAllowanceLazyStore
+ * @return an instance of ExchangeTransferSimulator
+ */
constructor(store: AbstractBalanceAndProxyAllowanceLazyStore) {
this._store = store;
}