blob: ad8794c9452785f6e1b8a10ccd2ed7f6ed914a49 (
plain) (
tree)
|
|
import { AssetProxyId, ObjectMap } from '@0x/types';
// Reusable
export enum AsyncProcessState {
NONE = 'None',
PENDING = 'Pending',
SUCCESS = 'Success',
FAILURE = 'Failure',
}
export enum OrderProcessState {
NONE = 'None',
AWAITING_SIGNATURE = 'Awaiting Signature',
PROCESSING = 'Processing',
SUCCESS = 'Success',
FAILURE = 'Failure',
}
interface RegularOrderState {
processState: OrderProcessState.NONE | OrderProcessState.AWAITING_SIGNATURE;
}
interface ProcessingOrderState {
processState: OrderProcessState.PROCESSING;
txHash: string;
}
interface SuccessfulOrderState {
processState: OrderProcessState.SUCCESS;
txHash: string;
}
interface FailureOrderState {
processState: OrderProcessState.FAILURE;
txHash: string;
}
export type OrderState = RegularOrderState | ProcessingOrderState | SuccessfulOrderState | FailureOrderState;
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;
}
export interface ERC721AssetMetaData {
assetProxyId: AssetProxyId.ERC721;
name: string;
representationUrl?: 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',
}
|