2022-09-14 23:17:32 +00:00
|
|
|
import { notification_preferences } from './user-notification-preferences'
|
2022-10-10 20:32:29 +00:00
|
|
|
import { ENV_CONFIG } from './envs/constants'
|
|
|
|
import { MarketCreatorBadge, ProvenCorrectBadge, StreakerBadge } from './badge'
|
2022-09-12 16:34:56 +00:00
|
|
|
|
2022-01-10 21:07:57 +00:00
|
|
|
export type User = {
|
2022-01-10 23:52:03 +00:00
|
|
|
id: string
|
2022-01-18 07:18:38 +00:00
|
|
|
createdTime: number
|
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
name: string
|
|
|
|
username: string
|
2022-05-06 18:29:15 +00:00
|
|
|
avatarUrl?: string
|
2022-01-18 07:18:38 +00:00
|
|
|
|
2022-02-18 01:16:58 +00:00
|
|
|
// For their user page
|
|
|
|
bio?: string
|
|
|
|
website?: string
|
|
|
|
twitterHandle?: string
|
|
|
|
discordHandle?: string
|
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
balance: number
|
2022-01-19 03:36:46 +00:00
|
|
|
totalDeposits: number
|
2022-06-22 20:29:40 +00:00
|
|
|
|
|
|
|
profitCached: {
|
|
|
|
daily: number
|
|
|
|
weekly: number
|
|
|
|
monthly: number
|
|
|
|
allTime: number
|
|
|
|
}
|
|
|
|
|
|
|
|
creatorVolumeCached: {
|
|
|
|
daily: number
|
|
|
|
weekly: number
|
|
|
|
monthly: number
|
|
|
|
allTime: number
|
|
|
|
}
|
2022-05-12 15:07:10 +00:00
|
|
|
|
2022-10-03 09:49:19 +00:00
|
|
|
fractionResolvedCorrectly: number
|
|
|
|
|
2022-08-22 05:22:49 +00:00
|
|
|
nextLoanCached: number
|
2022-06-22 16:05:54 +00:00
|
|
|
followerCountCached: number
|
|
|
|
|
2022-05-12 15:07:10 +00:00
|
|
|
followedCategories?: string[]
|
2022-09-12 05:39:04 +00:00
|
|
|
homeSections?: string[]
|
2022-07-01 13:47:19 +00:00
|
|
|
|
|
|
|
referredByUserId?: string
|
|
|
|
referredByContractId?: string
|
2022-07-18 16:40:44 +00:00
|
|
|
referredByGroupId?: string
|
2022-07-15 14:45:52 +00:00
|
|
|
lastPingTime?: number
|
2022-07-30 07:50:03 +00:00
|
|
|
shouldShowWelcome?: boolean
|
2022-08-19 17:10:32 +00:00
|
|
|
lastBetTime?: number
|
|
|
|
currentBettingStreak?: number
|
2022-08-24 16:49:53 +00:00
|
|
|
hasSeenContractFollowModal?: boolean
|
2022-08-25 11:51:56 +00:00
|
|
|
freeMarketsCreated?: number
|
2022-08-28 05:23:25 +00:00
|
|
|
isBannedFromPosting?: boolean
|
2022-10-10 20:32:29 +00:00
|
|
|
|
|
|
|
achievements: {
|
|
|
|
provenCorrect?: {
|
|
|
|
badges: ProvenCorrectBadge[]
|
|
|
|
}
|
|
|
|
marketCreator?: {
|
|
|
|
badges: MarketCreatorBadge[]
|
|
|
|
}
|
|
|
|
streaker?: {
|
|
|
|
badges: StreakerBadge[]
|
|
|
|
}
|
|
|
|
}
|
2022-01-10 23:52:03 +00:00
|
|
|
}
|
2022-01-18 07:18:38 +00:00
|
|
|
|
2022-01-19 03:36:46 +00:00
|
|
|
export type PrivateUser = {
|
|
|
|
id: string // same as User.id
|
|
|
|
username: string // denormalized from User
|
|
|
|
|
|
|
|
email?: string
|
2022-08-22 22:36:39 +00:00
|
|
|
weeklyTrendingEmailSent?: boolean
|
2022-09-26 21:49:06 +00:00
|
|
|
weeklyPortfolioUpdateEmailSent?: boolean
|
2022-08-04 18:03:02 +00:00
|
|
|
manaBonusEmailSent?: boolean
|
2022-01-19 03:36:46 +00:00
|
|
|
initialDeviceToken?: string
|
|
|
|
initialIpAddress?: string
|
2022-05-16 03:41:07 +00:00
|
|
|
apiKey?: string
|
2022-09-14 23:17:32 +00:00
|
|
|
notificationPreferences: notification_preferences
|
2022-09-14 08:52:31 +00:00
|
|
|
twitchInfo?: {
|
|
|
|
twitchName: string
|
|
|
|
controlToken: string
|
|
|
|
botEnabled?: boolean
|
2022-09-16 15:43:49 +00:00
|
|
|
needsRelinking?: boolean
|
2022-09-14 08:52:31 +00:00
|
|
|
}
|
2022-01-19 03:36:46 +00:00
|
|
|
}
|
2022-06-06 17:36:59 +00:00
|
|
|
|
2022-06-22 20:29:40 +00:00
|
|
|
export type PortfolioMetrics = {
|
|
|
|
investmentValue: number
|
|
|
|
balance: number
|
|
|
|
totalDeposits: number
|
|
|
|
timestamp: number
|
|
|
|
userId: string
|
|
|
|
}
|
2022-07-15 17:53:30 +00:00
|
|
|
|
2022-10-10 20:32:29 +00:00
|
|
|
export const MANIFOLD_USER_USERNAME = 'ManifoldMarkets'
|
|
|
|
export const MANIFOLD_USER_NAME = 'ManifoldMarkets'
|
2022-07-15 17:53:30 +00:00
|
|
|
export const MANIFOLD_AVATAR_URL = 'https://manifold.markets/logo-bg-white.png'
|
2022-09-15 15:12:56 +00:00
|
|
|
|
2022-09-18 00:10:34 +00:00
|
|
|
// TODO: remove. Hardcoding the strings would be better.
|
|
|
|
// Different views require different language.
|
2022-09-19 19:03:45 +00:00
|
|
|
export const BETTOR = ENV_CONFIG.bettor ?? 'trader'
|
|
|
|
export const BETTORS = ENV_CONFIG.bettor + 's' ?? 'traders'
|
|
|
|
export const PRESENT_BET = ENV_CONFIG.presentBet ?? 'trade'
|
|
|
|
export const PRESENT_BETS = ENV_CONFIG.presentBet + 's' ?? 'trades'
|
|
|
|
export const PAST_BET = ENV_CONFIG.pastBet ?? 'trade'
|
|
|
|
export const PAST_BETS = ENV_CONFIG.pastBet + 's' ?? 'trades'
|