From 27f9dba4f5cf5a3293b7e4eb211bcd23ded65426 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Sat, 30 Apr 2022 13:12:40 -0400 Subject: [PATCH] Set up Firestore structure for mana bounty links --- common/manalink.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 common/manalink.ts diff --git a/common/manalink.ts b/common/manalink.ts new file mode 100644 index 00000000..3c4c9e60 --- /dev/null +++ b/common/manalink.ts @@ -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 +}