manifold/common/user.ts

77 lines
1.6 KiB
TypeScript
Raw Normal View History

export type User = {
2022-01-10 23:52:03 +00:00
id: string
createdTime: number
2022-01-10 23:52:03 +00:00
name: string
username: string
avatarUrl?: string
// For their user page
bio?: string
bannerUrl?: string
website?: string
twitterHandle?: string
discordHandle?: string
2022-01-10 23:52:03 +00:00
balance: number
totalDeposits: number
profitCached: {
daily: number
weekly: number
monthly: number
allTime: number
}
creatorVolumeCached: {
daily: number
weekly: number
monthly: number
allTime: number
}
nextLoanCached: number
followerCountCached: number
followedCategories?: string[]
referredByUserId?: string
referredByContractId?: string
2022-07-18 16:40:44 +00:00
referredByGroupId?: string
2022-07-15 14:45:52 +00:00
lastPingTime?: number
shouldShowWelcome?: boolean
lastBetTime?: number
currentBettingStreak?: number
2022-01-10 23:52:03 +00:00
}
export type PrivateUser = {
id: string // same as User.id
username: string // denormalized from User
email?: string
unsubscribedFromResolutionEmails?: boolean
unsubscribedFromCommentEmails?: boolean
unsubscribedFromAnswerEmails?: boolean
unsubscribedFromGenericEmails?: boolean
unsubscribedFromWeeklyTrendingEmails?: boolean
weeklyTrendingEmailSent?: boolean
manaBonusEmailSent?: boolean
initialDeviceToken?: string
initialIpAddress?: string
apiKey?: string
notificationPreferences?: notification_subscribe_types
}
export type notification_subscribe_types = 'all' | 'less' | 'none'
export type PortfolioMetrics = {
investmentValue: number
balance: number
totalDeposits: number
timestamp: number
userId: string
}
2022-07-15 17:53:30 +00:00
export const MANIFOLD_USERNAME = 'ManifoldMarkets'
export const MANIFOLD_AVATAR_URL = 'https://manifold.markets/logo-bg-white.png'