124 lines
2.3 KiB
TypeScript
124 lines
2.3 KiB
TypeScript
import { DefaultSession } from 'next-auth'
|
|
|
|
declare module 'next-auth' {
|
|
interface Session {
|
|
user: {
|
|
id: string
|
|
discordId: string
|
|
balance: number
|
|
verified?: boolean
|
|
isAdmin?: boolean
|
|
isBetaTester?: boolean
|
|
isBugHunter?: boolean
|
|
chatBannedUntil?: Date | null
|
|
isOnboarding?: boolean
|
|
} & DefaultSession['user']
|
|
}
|
|
}
|
|
|
|
export interface Coin {
|
|
_id: string
|
|
name: string
|
|
ticker: string
|
|
description: string
|
|
image: string
|
|
creatorId: string
|
|
creatorName: string
|
|
creatorVerified?: boolean
|
|
creatorIsAdmin?: boolean
|
|
creatorIsBetaTester?: boolean
|
|
creatorIsBugHunter?: boolean
|
|
verified?: boolean
|
|
boosted?: Date | null
|
|
createdAt: Date
|
|
marketCap: number
|
|
price: number
|
|
priceHistory: PricePoint[]
|
|
volume24h: number
|
|
holders: number
|
|
supply: number
|
|
// maxSupply: number
|
|
// minerRatePerSecond: number
|
|
circulating?: number
|
|
liquidity: number
|
|
virtualSolReserves: number
|
|
virtualTokenReserves: number
|
|
twitter?: string
|
|
telegram?: string
|
|
website?: string
|
|
error?: string
|
|
graduated?: boolean
|
|
graduatedAt?: Date
|
|
}
|
|
|
|
export interface PricePoint {
|
|
timestamp: Date
|
|
price: number
|
|
volume: number
|
|
}
|
|
|
|
export interface Trade {
|
|
_id: string
|
|
userId: string
|
|
username: string
|
|
userImage: string
|
|
userVerified?: boolean
|
|
userIsAdmin?: boolean
|
|
userIsBetaTester?: boolean
|
|
userIsBugHunter?: boolean
|
|
coinId: string
|
|
type: 'buy' | 'sell' | 'mined'
|
|
amount: number
|
|
price: number
|
|
total: number
|
|
timestamp: Date
|
|
}
|
|
|
|
export interface User {
|
|
_id: string
|
|
discordId: string
|
|
name: string
|
|
email: string
|
|
image: string
|
|
balance: number
|
|
verified?: boolean
|
|
isAdmin?: boolean
|
|
isBetaTester?: boolean
|
|
isBugHunter?: boolean
|
|
chatBannedUntil?: Date | null
|
|
createdAt: Date
|
|
portfolio: PortfolioItem[]
|
|
miners?: Miner[]
|
|
}
|
|
|
|
export interface Miner {
|
|
_id: string
|
|
userId: string
|
|
coinId: string
|
|
purchasedAt: Date
|
|
lastCollectedAt: Date
|
|
isActive: boolean
|
|
}
|
|
|
|
export interface PortfolioItem {
|
|
coinId: string
|
|
amount: number
|
|
avgBuyPrice: number
|
|
}
|
|
|
|
export interface Trade {
|
|
_id: string
|
|
userId: string
|
|
coinId: string
|
|
type: 'buy' | 'sell' | 'mined'
|
|
amount: number
|
|
price: number
|
|
total: number
|
|
timestamp: Date
|
|
}
|
|
|
|
export interface SolPrice {
|
|
price: number
|
|
change24h: number
|
|
lastUpdated: Date
|
|
}
|