aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/0x.js.ts3
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts10
-rw-r--r--src/types.ts6
3 files changed, 9 insertions, 10 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 679d748e7..7cf313666 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -116,7 +116,6 @@ export class ZeroEx {
this.tokenRegistry.invalidateContractInstance();
this.token.invalidateContractInstances();
}
-
/**
* Sets default account for sending transactions.
*/
@@ -131,7 +130,7 @@ export class ZeroEx {
return senderAccountIfExists;
}
/**
- * Computes the orderHash given the order parameters and returns it as a hex encoded string.
+ * Computes the orderHash for a given order and returns it as a hex encoded string.
*/
public async getOrderHashHexAsync(order: Order): Promise<string> {
const exchangeContractAddr = await this.getExchangeAddressAsync();
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index fa5c16485..93e49cf33 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -10,6 +10,7 @@ import {
OrderAddresses,
SignedOrder,
ContractEvent,
+ ContractResponse,
} from '../types';
import {assert} from '../utils/assert';
import {ContractWrapper} from './contract_wrapper';
@@ -17,18 +18,17 @@ import * as ExchangeArtifacts from '../artifacts/Exchange.json';
import {ecSignatureSchema} from '../schemas/ec_signature_schema';
import {signedOrderSchema} from '../schemas/order_schemas';
import {SchemaValidator} from '../utils/schema_validator';
-import {ContractResponse} from '../types';
import {constants} from '../utils/constants';
import {TokenWrapper} from './token_wrapper';
export class ExchangeWrapper extends ContractWrapper {
private exchangeContractErrCodesToMsg = {
- [ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: ExchangeContractErrs.ORDER_EXPIRED,
- [ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: ExchangeContractErrs.ORDER_EXPIRED,
+ [ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: ExchangeContractErrs.ORDER_FILL_EXPIRED,
+ [ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: ExchangeContractErrs.ORDER_FILL_EXPIRED,
[ExchangeContractErrCodes.ERROR_FILL_NO_VALUE]: ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO,
[ExchangeContractErrCodes.ERROR_CANCEL_NO_VALUE]: ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO,
- [ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.ORDER_ROUNDING_ERROR,
- [ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.ORDER_BALANCE_ALLOWANCE_ERROR,
+ [ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.ORDER_FILL_ROUNDING_ERROR,
+ [ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.FILL_BALANCE_ALLOWANCE_ERROR,
};
private exchangeContractIfExists?: ExchangeContract;
private tokenWrapper: TokenWrapper;
diff --git a/src/types.ts b/src/types.ts
index 4819b13ac..b39484f8a 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -85,10 +85,10 @@ export enum ExchangeContractErrCodes {
}
export const ExchangeContractErrs = strEnum([
- 'ORDER_EXPIRED',
+ 'ORDER_FILL_EXPIRED',
'ORDER_REMAINING_FILL_AMOUNT_ZERO',
- 'ORDER_ROUNDING_ERROR',
- 'ORDER_BALANCE_ALLOWANCE_ERROR',
+ 'ORDER_FILL_ROUNDING_ERROR',
+ 'FILL_BALANCE_ALLOWANCE_ERROR',
]);
export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;