1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Create shared TRAITS constant (#14069)

* Create shared `TRAITS` constant

Create a new constant in shared/constants/metametrics.js called TRAITS.
Using the other issues in this epic as guidance, populate the constant with traits.
Add Documentation to this constant about what each trait is.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* use field names as the constants
only interested in 4 traits now for the MVP

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* cut down comments length for readability.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* 80 chars comments length

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
This commit is contained in:
Olusegun Akintayo 2022-03-25 00:23:21 +04:00 committed by GitHub
parent 2419162562
commit edb5ecc38c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,6 +154,30 @@
* the page view
*/
/**
* @typedef {Object} Traits
* @property {string} [LEDGER_CONNECTION_TYPE] - when ledger live connnection
* type is changed we identify the ledger_connection_type trait
* @property {string} [NETWORKS_ADDED] - when user modifies networks we
* identify the networks_added trait
* @property {string} [NUMBER_OF_ACCOUNTS] - when identities change, we
* identify the new number_of_accounts trait
* @property {string} [THREE_BOX_ENABLED] - when 3box feature is toggled we
* identify the 3box_enabled trait
*/
/**
*
* @type {Traits}
*/
export const TRAITS = {
LEDGER_CONNECTION_TYPE: 'ledger_connection_type',
THREE_BOX_ENABLED: 'three_box_enabled',
NUMBER_OF_ACCOUNTS: 'number_of_accounts',
NETWORKS_ADDED: 'networks_added',
};
// Mixpanel converts the zero address value to a truly anonymous event, which
// speeds up reporting
export const METAMETRICS_ANONYMOUS_ID = '0x0000000000000000';