-
Notifications
You must be signed in to change notification settings - Fork 0
/
boxes.ts
58 lines (51 loc) · 1.12 KB
/
boxes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// === Boxes ===
import { Duration, ProductType, DiscountType } from "./enums";
/**
* Interface for the application specification.
*/
export interface ApplicationSpec {
approval: Uint8Array;
clear: Uint8Array;
globalNumUint: number;
globalNumByteSlice: number;
localNumUint: number;
localNumByteSlice: number;
}
/**
* Interface for the subscription record.
*/
export interface SubscriptionRecord {
createdAt: number;
expiresAt: number | null;
duration: Duration;
subscriptionID: number;
productType: ProductType;
}
/**
* Interface for the subscriber record.
*/
export interface SubscriberRecord {
address: string;
subscription: SubscriptionRecord;
}
/**
* Interface for the base discount record.
*/
export interface BaseDiscountRecord {
discountType: DiscountType;
discountValue: number;
}
/**
* Interface for the discount record.
*/
export interface DiscountRecord extends BaseDiscountRecord {
createdAt: number;
expiresAt: number | null;
totalClaims: number;
}
/**
* Interface for the discount metadata.
*/
export interface DiscountMetadata extends BaseDiscountRecord {
expiresIn?: number;
}