aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-11-21 14:34:57 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-11-21 14:38:49 +0800
commit351e0e6f5f2add25c4d779356a8cfd4aefb305cb (patch)
treef9feebf1fce79c1b76f10c2040551ed4a6052154 /packages/instant/src/util
parent15f05733be45e05974972c80c4fa8437a62633e2 (diff)
downloaddexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.gz
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.bz2
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.lz
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.xz
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.zst
dexon-sol-tools-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.zip
feat(instant): implement account related events
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r--packages/instant/src/util/analytics.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index 2ffaac1dd..d36bf8fc3 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -15,7 +15,11 @@ export const evaluateIfEnabled = (fnCall: () => void) => {
enum EventNames {
INSTANT_OPENED = 'Instant - Opened',
- WALLET_READY = 'Wallet - Ready',
+ ACCOUNT_LOCKED = 'Account - Locked',
+ ACCOUNT_READY = 'Account - Ready',
+ ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested',
+ ACCOUNT_UNLOCK_DENIED = 'Account - Unlock Denied',
+ ACCOUNT_ADDRESS_CHANGED = 'Account - Address Changed',
}
const track = (eventName: EventNames, eventData: ObjectMap<string | number> = {}): void => {
evaluateIfEnabled(() => {
@@ -59,6 +63,11 @@ export const analytics = {
heapUtil.evaluateHeapCall(heap => heap.addEventProperties(properties));
});
},
- trackWalletReady: trackingEventFnWithoutPayload(EventNames.WALLET_READY),
trackInstantOpened: trackingEventFnWithoutPayload(EventNames.INSTANT_OPENED),
+ trackAccountLocked: trackingEventFnWithoutPayload(EventNames.ACCOUNT_LOCKED),
+ trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.ACCOUNT_READY)({ address }),
+ trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_REQUESTED),
+ trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_DENIED),
+ trackAccountAddressChanged: (address: string) =>
+ trackingEventFnWithPayload(EventNames.ACCOUNT_ADDRESS_CHANGED)({ address }),
};