aboutsummaryrefslogtreecommitdiff
path: root/jb-ui/src/models/app.ts
blob: db54e0d9b924d9540e7055ba08a14e805c68525c (plain)
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
import {
  UserWalletBalance,
  TopNPlusBucket,
  TaskStatusResponse,
  UserLedgerTransactionTypesSummary,
  UserLedgerTransactionsResponseTransactionsInner,
  OfferwallReason,
  UserLedgerWallet,
  UserDisplayedWalletBalance,
} from "@/api_fsb";
import { PaginationState } from "@tanstack/react-table";

export interface App {
  // Global IDs needed by GRL + MTurk
  bpuid?: string;
  assignment_id?: string;
  turkSubmitTo?: string;

  // Global UI settings
  loi: number;
  availability_count?: number;
  attempted_live_eligible_count?: number;
  offerwall_reasons: OfferwallReason[];

  // The timestamp of when the currently requested bucket was requested. We want
  // to save this to prevent it from sitting for longer than 120 seconds.
  currentBucketRequested?: number; // Date.now() is a timestamp in ms
  currentBuckets?: TopNPlusBucket[];
  currentBucketEntered?: number; // Date.now() is a timestamp in ms
  taskStatus?: TaskStatusResponse;

  // Wallet stuff
  userWalletBalance?: UserWalletBalance;
  userLedgerSummary?: UserLedgerTransactionTypesSummary;
  userLedgerTxCount?: number;
  userLedgerTxs: UserLedgerTransactionsResponseTransactionsInner[];

  // --- new approach
  userDisplayedWalletBalance?: UserDisplayedWalletBalance;
  userWallet?: UserLedgerWallet;
  userAttemptCreditWallet?: UserLedgerWallet;
  // ---

  txPagination: PaginationState;
  txTotalItems?: number;
  txTotalPages?: number;
}