import { Action, Store } from '@reduxjs/toolkit' import { Task } from 'redux-saga' import { ThunkAction } from 'redux-thunk' import { store } from '.' import { GlobalState } from './global/types' import { MetaDataState } from './metaData/types' import { ProfileState } from './profile/types' import { StakingPoolState } from './stakingPool/types' import { UserState } from './user/types' export type AppDispatch = typeof store.dispatch export type RootState = ReturnType export type AppThunk = ThunkAction> export interface SagaStore extends Store { sagaTask?: Task } export interface BigNumberToJson { type: 'BigNumber' hex: string } // Global state export interface State { user?: UserState profile?: ProfileState metaData?: MetaDataState global: GlobalState stakingPool?: StakingPoolState } export interface HorseParameter { attack: number attackSpd: number critDMG: number critRate: number hp: number movSpd: number } // Global props // export interface IHorseData extends HorseMarketplaceProps { export interface IHorseData { // rank?: number // star?: number // exp?: number // id?: string // nftId?: string // isSelling?: boolean name?: string imageName?: string imageCharacter?: string imageStar?: string imageRank?: string className?: string info?: string passSkill?: string[] rankData?: any price?: number parameter?: HorseParameter } export enum GET_TRANSACTION_HISTORY_ACTION_TYPES { LOAD_MORE = 'LOAD_MORE', LOAD_NEW = 'LOAD_NEW', } export enum TRANSACTION_ACTION_TYPES { BUY = 'BUY', SELL = 'SELL', CANCEL = 'CANCEL', } export enum META_DATA_TYPES { CHARACTER = 1, DICE = 2, BOX = 3, } export enum BLOCKCHAIN_EXPLORE_LINK_TYPES { TRANSACTION = 'transaction', TOKEN = 'token', ADDRESS = 'address', BLOCK = 'block', COUNTDOWN = 'countdown', } export interface TransactionHistoryProps { buyer: string action: TRANSACTION_ACTION_TYPES nftId: number type: number seller: string price: number hashTransaction: string createdAt: string id: string } export interface GetTransactionHistoryListProps { nftId: number | string type?: number | string limit?: number page?: number skip?: number actionType: GET_TRANSACTION_HISTORY_ACTION_TYPES } export interface GetTransactionHistoryListResp { data: { items: TransactionHistoryProps[] total: number page: number limit: number skip: number } actionType: GET_TRANSACTION_HISTORY_ACTION_TYPES } export interface syncMainNftDataProps { nftIds: number[] | string[] callback?: any isNewest?: boolean }