forked from Ding-Payments/ding-payments
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics-events.ts
More file actions
35 lines (31 loc) · 1.18 KB
/
Copy pathanalytics-events.ts
File metadata and controls
35 lines (31 loc) · 1.18 KB
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
export const AnalyticsEvents = {
APP_OPEN: 'app_open',
RECEIVE_OPENED: 'receive_opened',
SEND_OPENED: 'send_opened',
HISTORY_OPENED: 'history_opened',
SETTINGS_OPENED: 'settings_opened',
// Receive funnel (CLI-071) — see docs/receive-flow.md
RECEIVE_STARTED: 'receive_started',
RECEIVE_BROADCAST: 'receive_broadcast',
RECEIVE_WAITING: 'receive_waiting',
RECEIVE_COMPLETED: 'receive_completed',
RECEIVE_FAILED: 'receive_failed',
RECEIVE_CANCELLED: 'receive_cancelled',
NFC_READ_SUCCESS: 'nfc_read_success',
NFC_READ_FAILURE: 'nfc_read_failure',
NFC_WRITE_SUCCESS: 'nfc_write_success',
NFC_WRITE_FAILURE: 'nfc_write_failure',
} as const;
export type AnalyticsEventName = (typeof AnalyticsEvents)[keyof typeof AnalyticsEvents];
/**
* Amount bucket used in receive funnel events instead of raw amounts.
* Never log a raw amount, public key, or other PII in an analytics payload.
*/
export type AmountBucket = '<1' | '1-10' | '10-100' | '>100';
/** Allowed properties for receive funnel events. No pubkeys, no raw amounts, no PII. */
export interface ReceiveEventProperties {
amount_bucket: AmountBucket;
asset: string;
reason?: string;
duration_ms?: number;
}