aboutsummaryrefslogtreecommitdiffstats
path: root/src/types.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-03 01:14:20 +0800
committerFabio Berger <me@fabioberger.com>2017-06-03 01:14:20 +0800
commitae15425f0b2d3f79b6f6b47d351cf51f8f68d2c0 (patch)
tree975320862a2eb0e8f97091bce95b0d901a5c587b /src/types.ts
parent6f98d8328419962e257c570e3fcb5cb4246162a3 (diff)
parentc83587a16d016d1efafaf31abb9b39eb54128568 (diff)
downloaddexon-0x-contracts-ae15425f0b2d3f79b6f6b47d351cf51f8f68d2c0.tar.gz
dexon-0x-contracts-ae15425f0b2d3f79b6f6b47d351cf51f8f68d2c0.tar.zst
dexon-0x-contracts-ae15425f0b2d3f79b6f6b47d351cf51f8f68d2c0.zip
Merge branch 'master' into addEventSubscriptions
# Conflicts: # src/contract_wrappers/exchange_wrapper.ts # src/types.ts # test/exchange_wrapper_test.ts
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/types.ts b/src/types.ts
index c6ad68d3f..b5430a783 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -10,11 +10,12 @@ function strEnum(values: string[]): {[key: string]: string} {
}
export const ZeroExError = strEnum([
- 'CONTRACT_DOES_NOT_EXIST',
- 'UNHANDLED_ERROR',
- 'USER_HAS_NO_ASSOCIATED_ADDRESSES',
- 'INVALID_SIGNATURE',
- 'CONTRACT_NOT_DEPLOYED_ON_NETWORK',
+ 'CONTRACT_DOES_NOT_EXIST',
+ 'UNHANDLED_ERROR',
+ 'USER_HAS_NO_ASSOCIATED_ADDRESSES',
+ 'INVALID_SIGNATURE',
+ 'CONTRACT_NOT_DEPLOYED_ON_NETWORK',
+ 'ZRX_NOT_IN_TOKEN_REGISTRY',
]);
export type ZeroExError = keyof typeof ZeroExError;
@@ -37,6 +38,10 @@ export interface ExchangeContract {
getUnavailableValueT: {
call: (orderHash: string) => BigNumber.BigNumber;
};
+ isRoundingError: {
+ call: (takerTokenAmount: BigNumber.BigNumber, fillTakerAmount: BigNumber.BigNumber,
+ makerTokenAmount: BigNumber.BigNumber, txOpts: TxOpts) => Promise<boolean>;
+ };
fill: {
(orderAddresses: OrderAddresses, orderValues: OrderValues, fillAmount: BigNumber.BigNumber,
shouldCheckTransfer: boolean, v: number, r: string, s: string, txOpts: TxOpts): ContractResponse;
@@ -65,6 +70,9 @@ export interface ExchangeContract {
LogFill: CreateContractEvent;
LogCancel: CreateContractEvent;
LogError: CreateContractEvent;
+ ZRX: {
+ call: () => Promise<string>;
+ };
}
export interface TokenContract {
@@ -103,23 +111,22 @@ export enum ExchangeContractErrCodes {
}
export const ExchangeContractErrs = strEnum([
- 'ORDER_EXPIRED',
+ 'ORDER_FILL_EXPIRED',
'ORDER_REMAINING_FILL_AMOUNT_ZERO',
- 'ORDER_ROUNDING_ERROR',
- 'ORDER_BALANCE_ALLOWANCE_ERROR',
-]);
-export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;
+ 'ORDER_FILL_ROUNDING_ERROR',
+ 'FILL_BALANCE_ALLOWANCE_ERROR',
+ 'INSUFFICIENT_TAKER_BALANCE',
+ 'INSUFFICIENT_TAKER_ALLOWANCE',
+ 'INSUFFICIENT_MAKER_BALANCE',
+ 'INSUFFICIENT_MAKER_ALLOWANCE',
+ 'INSUFFICIENT_TAKER_FEE_BALANCE',
+ 'INSUFFICIENT_TAKER_FEE_ALLOWANCE',
+ 'INSUFFICIENT_MAKER_FEE_BALANCE',
+ 'INSUFFICIENT_MAKER_FEE_ALLOWANCE',
+ 'TRANSACTION_SENDER_IS_NOT_FILL_ORDER_TAKER',
-export const FillOrderValidationErrs = strEnum([
- 'FILL_AMOUNT_IS_ZERO',
- 'NOT_A_TAKER',
- 'EXPIRED',
- 'NOT_ENOUGH_TAKER_BALANCE',
- 'NOT_ENOUGH_TAKER_ALLOWANCE',
- 'NOT_ENOUGH_MAKER_BALANCE',
- 'NOT_ENOUGH_MAKER_ALLOWANCE',
]);
-export type FillOrderValidationErrs = keyof typeof FillOrderValidationErrs;
+export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;
export interface ContractResponse {
logs: ContractEvent[];