Move field declaration to the begining of the class
This commit is contained in:
parent
96092de5cb
commit
b46ad44856
@ -15,6 +15,14 @@ import {ContractResponse} from '../types';
|
||||
import {constants} from '../utils/constants';
|
||||
|
||||
export class ExchangeWrapper extends ContractWrapper {
|
||||
private exchangeContractErrToMsg = {
|
||||
[ExchangeContractErrs.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired',
|
||||
[ExchangeContractErrs.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired',
|
||||
[ExchangeContractErrs.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled',
|
||||
[ExchangeContractErrs.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled',
|
||||
[ExchangeContractErrs.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order',
|
||||
[ExchangeContractErrs.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance',
|
||||
};
|
||||
constructor(web3Wrapper: Web3Wrapper) {
|
||||
super(web3Wrapper);
|
||||
}
|
||||
@ -85,14 +93,6 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
private exchangeContractErrToMsg = {
|
||||
[ExchangeContractErrs.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired',
|
||||
[ExchangeContractErrs.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired',
|
||||
[ExchangeContractErrs.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled',
|
||||
[ExchangeContractErrs.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled',
|
||||
[ExchangeContractErrs.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order',
|
||||
[ExchangeContractErrs.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance',
|
||||
};
|
||||
private async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> {
|
||||
const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any));
|
||||
return contractInstance as ExchangeContract;
|
||||
|
Loading…
x
Reference in New Issue
Block a user