Track txnId and successful users

This commit is contained in:
Austin Chen 2022-05-04 12:09:54 -04:00
parent 12aceef4ca
commit 76d234388b
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,8 @@ export type Manalink = {
// If set to Infinity, the link can be used infinitely
maxUses: number
// Used for simpler caching
successUserIds: string[]
// Successful redemptions of the link
successes: Claim[]
// Failed redemptions of the link
@ -25,5 +27,8 @@ export type Manalink = {
type Claim = {
toId: string
// The ID of the successful txn that tracks the money moved
txnId: string
claimedTime: number
}

View File

@ -31,6 +31,7 @@ export async function createManalink(data: {
createdTime: Date.now(),
expiresTime,
maxUses,
successUserIds: [],
successes: [],
failures: [],
}