1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
import { AssetProxyId, ObjectMap } from '@0x/types';
// Reusable
export type Maybe<T> = T | undefined;
export enum AsyncProcessState {
None = 'NONE',
Pending = 'PENDING',
Success = 'SUCCESS',
Failure = 'FAILURE',
}
export enum OrderProcessState {
None = 'NONE',
Validating = 'VALIDATING',
Processing = 'PROCESSING',
Success = 'SUCCESS',
Failure = 'FAILURE',
}
export interface SimulatedProgress {
startTimeUnix: number;
expectedEndTimeUnix: number;
}
interface OrderStatePreTx {
processState: OrderProcessState.None | OrderProcessState.Validating;
}
interface OrderStatePostTx {
processState: OrderProcessState.Processing | OrderProcessState.Success | OrderProcessState.Failure;
txHash: string;
progress: SimulatedProgress;
}
export type OrderState = OrderStatePreTx | OrderStatePostTx;
export enum DisplayStatus {
Present,
Hidden,
}
export type FunctionType = (...args: any[]) => any;
export type ActionCreatorsMapObject = ObjectMap<FunctionType>;
export type ActionsUnion<A extends ActionCreatorsMapObject> = ReturnType<A[keyof A]>;
export interface ERC20AssetMetaData {
assetProxyId: AssetProxyId.ERC20;
decimals: number;
primaryColor?: string;
symbol: string;
name: string;
}
export interface ERC721AssetMetaData {
assetProxyId: AssetProxyId.ERC721;
name: string;
imageUrl?: string;
primaryColor?: string;
}
export type AssetMetaData = ERC20AssetMetaData | ERC721AssetMetaData;
export interface ERC20Asset {
assetData: string;
metaData: ERC20AssetMetaData;
}
export interface ERC721Asset {
assetData: string;
metaData: ERC721AssetMetaData;
}
export interface Asset {
assetData: string;
metaData: AssetMetaData;
}
export enum Network {
Kovan = 42,
Mainnet = 1,
}
export enum ZeroExInstantError {
AssetMetaDataNotAvailable = 'ASSET_META_DATA_NOT_AVAILABLE',
InsufficientETH = 'INSUFFICIENT_ETH',
}
export type SimpleHandler = () => void;
export interface AffiliateInfo {
feeRecipient: string;
feePercentage: number;
}
|