Track txnId and successful users
This commit is contained in:
parent
12aceef4ca
commit
76d234388b
|
@ -16,6 +16,8 @@ export type Manalink = {
|
||||||
// If set to Infinity, the link can be used infinitely
|
// If set to Infinity, the link can be used infinitely
|
||||||
maxUses: number
|
maxUses: number
|
||||||
|
|
||||||
|
// Used for simpler caching
|
||||||
|
successUserIds: string[]
|
||||||
// Successful redemptions of the link
|
// Successful redemptions of the link
|
||||||
successes: Claim[]
|
successes: Claim[]
|
||||||
// Failed redemptions of the link
|
// Failed redemptions of the link
|
||||||
|
@ -25,5 +27,8 @@ export type Manalink = {
|
||||||
type Claim = {
|
type Claim = {
|
||||||
toId: string
|
toId: string
|
||||||
|
|
||||||
|
// The ID of the successful txn that tracks the money moved
|
||||||
|
txnId: string
|
||||||
|
|
||||||
claimedTime: number
|
claimedTime: number
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ export async function createManalink(data: {
|
||||||
createdTime: Date.now(),
|
createdTime: Date.now(),
|
||||||
expiresTime,
|
expiresTime,
|
||||||
maxUses,
|
maxUses,
|
||||||
|
successUserIds: [],
|
||||||
successes: [],
|
successes: [],
|
||||||
failures: [],
|
failures: [],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user