Set up Firestore structure for mana bounty links

This commit is contained in:
Austin Chen 2022-04-30 13:12:40 -04:00
parent ab4dbc798c
commit 27f9dba4f5

27
common/manalink.ts Normal file
View File

@ -0,0 +1,27 @@
export type Manalink = {
// The link to send: https://manifold.markets/send/{slug}
// Also functions as the unique identifier for the link.
slug: string
// Note: we assume both fromId and toId are of SourceType 'USER'
fromId: string
// How much to send with the link
amount: number
token: 'M$' // TODO: could send eg YES shares too??
createdTime: number
// If not set, the link is valid forever
expiresTime?: number
// If not set, the link can be used infinitely
maxUses?: number
// All past usages of this link
claims: Claim[]
}
type Claim = {
toId: string
claimedTime: number
}