2022-06-22 15:29:26 +08:00

53 lines
857 B
TypeScript

export interface IToken {
address: string
type: 'eth'|'erc20'
default: boolean
symbol?: string
balance?: string
decimal: number
image?: string
last?: number
}
export interface INFT {
address: string
index: number
tokenId?: string
image?: string
name?: string
desc?: string
last?: number
}
export function initNFT(address: string, index: number) {
return {
address,
index
}
}
export interface IAccount {
address: string
chain: number
nickname?: string
avatar?: string
tokens: IToken[]
heros: INFT[]
weapons: INFT[]
chips: INFT[]
}
export function initAccount(address: string, chain: number, nickname: string): IAccount {
let data: IAccount = {
address,
chain,
nickname,
tokens: [],
heros: [],
weapons: [],
chips: []
}
//TODO: add default tokens
return data
}