Skip to content

Commit

Permalink
Merge pull request #449 from enkryptcom/devop/ff-pp-changes
Browse files Browse the repository at this point in the history
devop: FF-PP-Changes
  • Loading branch information
kvhnuke authored May 28, 2024
2 parents 80edfcd + e303699 commit d46b380
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 74 deletions.
4 changes: 2 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.40.0",
"version": "1.40.1",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand All @@ -21,7 +21,7 @@
"watch-vue-firefox": "cross-env BROWSER='firefox' vue-cli-service build --watch --no-clean"
},
"dependencies": {
"@amplitude/analytics-browser": "2.5.3",
"@amplitude/analytics-browser": "^2.8.0",
"@babel/runtime": "^7.24.5",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/libs/market-data/ethvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface getCoinGeckoTokenInfoAllType {
}[];
};
}
const ETHVM_BASE = `https://api-v2.ethvm.dev/`;
const ETHVM_BASE = `https://api-v3.ethvm.dev`;

const ethvmPost = (requestData: string): Promise<any> => {
return cacheFetch(
Expand Down
46 changes: 24 additions & 22 deletions packages/extension/src/libs/metrics/amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,30 @@ class Metrics {
const settingsState = new SettingsState();
settingsState.getEnkryptSettings().then((set) => {
this.installedTime = set.installedTimestamp;
init("apikey", {
instanceName: process.env.IS_DEV
? "enkrypt-extension-dev"
: "enkrypt-extension",
optOut: !set.isMetricsEnabled,
serverUrl: process.env.IS_DEV
? "https://analytics-enkrypt-dev.mewwallet.dev/record"
: "https://analytics-enkrypt.mewwallet.dev/record",
appVersion: process.env.PACKAGE_VERSION as string,
trackingOptions: {
ipAddress: false,
},
userId: set.randomUserID,
useBatch: true,
identityStorage: "none",
logLevel: Types.LogLevel.None,
defaultTracking: {
formInteractions: false,
pageViews: false,
sessions: false,
},
});
if (typeof window !== "undefined") {
init("apikey", {
instanceName: process.env.IS_DEV
? "enkrypt-extension-dev"
: "enkrypt-extension",
optOut: !set.isMetricsEnabled,
serverUrl: process.env.IS_DEV
? "https://analytics-enkrypt-dev.mewwallet.dev/record"
: "https://analytics-enkrypt.mewwallet.dev/record",
appVersion: process.env.PACKAGE_VERSION as string,
trackingOptions: {
ipAddress: false,
},
userId: set.randomUserID,
useBatch: true,
identityStorage: "none",
sessionTimeout: 15 * 60 * 1000, // 15 mins
logLevel: Types.LogLevel.None,
defaultTracking: {
formInteractions: false,
pageViews: false,
},
});
}
});
}
track(event: string, options: Record<string, unknown>) {
Expand Down
3 changes: 2 additions & 1 deletion packages/extension/src/manifest/manifest-firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"gecko": {
"strict_min_version": "100.0"
}
}
},
"content_security_policy": "script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'"
}
1 change: 1 addition & 0 deletions packages/extension/src/ui/onboard/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const isShowBackButton = () => {
return (
route.name &&
route.name != "new-wallet" &&
route.name != "user-analytics" &&
route.name != "create-wallet-wallet-ready" &&
route.name != "restore-wallet-wallet-ready" &&
!(route.name as string).includes("hardware-wallet")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const nextAction = () => {
isInitializing.value = true;
onboardInitializeWallets(phrase, password).then(() => {
isInitializing.value = false;
router.push({ name: routes.walletReady.name });
if (process.env.IS_FIREFOX) {
router.push({ name: routes.userAnalytics.name });
} else {
router.push({ name: routes.walletReady.name });
}
});
};
</script>
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/src/ui/onboard/create-wallet/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TypePassword from "./type-password.vue";
import RecoveryPhrase from "./recovery-phrase.vue";
import CheckPhrase from "./double-check-phrase.vue";
import WalletReady from "./wallet-ready.vue";
import UserAnalytics from "../user-analytics.vue";
import { RouteRecordRaw } from "vue-router";
export const routes = {
pickPassword: {
Expand All @@ -25,6 +26,11 @@ export const routes = {
name: "check-phrase",
component: CheckPhrase,
},
userAnalytics: {
path: "user-analytics",
name: "user-analytics",
component: UserAnalytics,
},
walletReady: {
path: "wallet-ready",
name: "wallet-ready",
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/src/ui/onboard/restore-wallet/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import EnterRecoveryPhrase from "./enter-recovery-phrase.vue";
import PickPassword from "./pick-password.vue";
import TypePassword from "./type-password.vue";
import WalletReady from "../create-wallet/wallet-ready.vue";
import UserAnalytics from "../user-analytics.vue";
import { RouteRecordRaw } from "vue-router";
export const routes = {
start: {
Expand Down Expand Up @@ -31,6 +32,11 @@ export const routes = {
name: "type-password",
component: TypePassword,
},
userAnalytics: {
path: "user-analytics",
name: "user-analytics",
component: UserAnalytics,
},
walletReady: {
path: "wallet-ready",
name: "wallet-ready",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ const nextAction = () => {
isInitializing.value = true;
onboardInitializeWallets(store.mnemonic, store.password).then(() => {
isInitializing.value = false;
router.push({
name: routes.walletReady.name,
});
if (process.env.IS_FIREFOX) {
router.push({ name: routes.userAnalytics.name });
} else {
router.push({
name: routes.walletReady.name,
});
}
});
}
};
Expand Down
2 changes: 2 additions & 0 deletions packages/extension/src/ui/onboard/routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { RouteRecordRaw } from "vue-router";
import NewWallet from "./new-wallet.vue";
import UserAnalytics from "./user-analytics.vue";
import CreateWalletUI from "./create-wallet/routes";
import RestoreWalletUI from "./restore-wallet/routes";
import HardwareWalletUI from "./hardware-wallet/routes";
Expand All @@ -9,6 +10,7 @@ uiRoutes = uiRoutes.concat(RestoreWalletUI());
uiRoutes = uiRoutes.concat(HardwareWalletUI());
const routes = [
{ path: "/", component: NewWallet, name: "new-wallet" },
{ path: "/user-analytics", component: UserAnalytics, name: "user-analytics" },
...uiRoutes,
];
export default routes;
98 changes: 98 additions & 0 deletions packages/extension/src/ui/onboard/user-analytics.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<template>
<div class="new-wallet">
<logo-big class="new-wallet__logo" />
<h3>
Privacy and<br />
Data collection.
</h3>
<p>We collect the following anonymous data about your use of Enkrypt:</p>
<p>
Blockchain, browser, operating system, session time, actions and page
views per visit, which we collect to enhance user experience with our
Services, and support our operations:
</p>
<p>
Choosing to decline anonymous data collection will have no impact on your
experience using the Enkrypt browser extension. Full details about the
anonymous data we collect and what we do with it are provided in our
<a href="https://www.myetherwallet.com/privacy-policy" target="_blank"
>Privacy Policy</a
>.
</p>

<div class="new-wallet__buttons">
<base-button title="Agree to anonymous data collection" :click="agree" />
<base-button
title="Deny anonymous data collection"
:no-background="true"
:click="deny"
/>
</div>
</div>
</template>
<script setup lang="ts">
import LogoBig from "@action/icons/common/logo-big.vue";
import BaseButton from "@action/components/base-button/index.vue";
import SettingsState from "@/libs/settings-state";
import { optOutofMetrics } from "@/libs/metrics";
import { routes as cwalletRoutes } from "./create-wallet/routes";
import { useRouter } from "vue-router";
const router = useRouter();
const settingsState = new SettingsState();
const agree = async () => {
const enkryptSettings = await settingsState.getEnkryptSettings();
enkryptSettings.isMetricsEnabled = true;
await settingsState.setEnkryptSettings(enkryptSettings);
optOutofMetrics(false);
router.push({ name: cwalletRoutes.walletReady.name });
};
const deny = async () => {
const enkryptSettings = await settingsState.getEnkryptSettings();
enkryptSettings.isMetricsEnabled = false;
await settingsState.setEnkryptSettings(enkryptSettings);
optOutofMetrics(true);
router.push({ name: cwalletRoutes.walletReady.name });
};
</script>

<style lang="less">
@import "~@action/styles/theme.less";
.new-wallet {
&__logo {
margin-bottom: 24px;
}
h3 {
font-style: normal;
font-weight: 700;
font-size: 34px;
line-height: 40px;
letter-spacing: 0.25px;
color: @primaryLabel;
margin: 0 0 16px 0;
}
p {
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.25px;
margin: 0 0 16px 0;
color: @primaryLabel;
}
&__buttons {
text-align: center;
a {
margin-top: 8px;
}
}
}
</style>
75 changes: 31 additions & 44 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,28 @@ __metadata:
languageName: node
linkType: hard

"@amplitude/analytics-browser@npm:2.5.3":
version: 2.5.3
resolution: "@amplitude/analytics-browser@npm:2.5.3"
dependencies:
"@amplitude/analytics-client-common": ^2.1.1
"@amplitude/analytics-core": ^2.2.2
"@amplitude/analytics-types": ^2.5.0
"@amplitude/plugin-page-view-tracking-browser": ^2.2.3
"@amplitude/plugin-web-attribution-browser": ^2.1.4
"@amplitude/analytics-browser@npm:^2.8.0":
version: 2.8.1
resolution: "@amplitude/analytics-browser@npm:2.8.1"
dependencies:
"@amplitude/analytics-client-common": ^2.2.1
"@amplitude/analytics-core": ^2.2.8
"@amplitude/analytics-types": ^2.5.1
"@amplitude/plugin-page-view-tracking-browser": ^2.2.13
tslib: ^2.4.1
checksum: 9d67fa579bbe06d7b1f4c5df152f9dd669716c4ef79f97f3ee9ed5c74b27b3092752434eca0beb5b557473d8cbfcc1c93cbf336e87039ae31197df8f73f1bbf4
checksum: cff108e1e7d231108579082fd577fe2170a8261442c3cb9c4aca8730a3285fd2db8e3ca49db1e1de9e9ef769dfcdb9654ee4f665b78805524cb9f0cad04bddc9
languageName: node
linkType: hard

"@amplitude/analytics-client-common@npm:^2.1.1, @amplitude/analytics-client-common@npm:^2.1.5":
version: 2.1.5
resolution: "@amplitude/analytics-client-common@npm:2.1.5"
"@amplitude/analytics-client-common@npm:^2.2.1":
version: 2.2.1
resolution: "@amplitude/analytics-client-common@npm:2.2.1"
dependencies:
"@amplitude/analytics-connector": ^1.4.8
"@amplitude/analytics-core": ^2.2.6
"@amplitude/analytics-types": ^2.5.0
"@amplitude/analytics-core": ^2.2.8
"@amplitude/analytics-types": ^2.5.1
tslib: ^2.4.1
checksum: 1443f3c5bed5c18ebe88c9e4583ed4f8f75625c4eb3726c1f55f3f45910bc36df70ccef6e8606395c1550e4e05c8f845f1904ec220652e31cbff06b38a098c57
checksum: 5959bec05000aa42e2f8ae9494b766998222e3b090f37bab359d41fb7f40835f49af6e5ac5fc49faa563e4ae56bda7cdcd689923fcb9f990cd7ec2cd8163f47e
languageName: node
linkType: hard

Expand All @@ -63,43 +62,31 @@ __metadata:
languageName: node
linkType: hard

"@amplitude/analytics-core@npm:^2.2.2, @amplitude/analytics-core@npm:^2.2.6":
version: 2.2.6
resolution: "@amplitude/analytics-core@npm:2.2.6"
"@amplitude/analytics-core@npm:^2.2.8":
version: 2.2.8
resolution: "@amplitude/analytics-core@npm:2.2.8"
dependencies:
"@amplitude/analytics-types": ^2.5.0
"@amplitude/analytics-types": ^2.5.1
tslib: ^2.4.1
checksum: 6579044b7efdfb232320b5dd7ab1c43be7c29fba90a3978242ce8467e7437b6756a1298c7d8813bedabc55a00a1c1abeb2f952c56779f554544f6610ef5307b5
checksum: a7a70b1124bf25bfb4fee74ec2d9124fce05bd31147a61ecf6dcfa307ba150e4114cd68fba336ddeb8d6b53ee6c2f4ed561fdc329dd652955daea848887baafc
languageName: node
linkType: hard

"@amplitude/analytics-types@npm:^2.5.0":
version: 2.5.0
resolution: "@amplitude/analytics-types@npm:2.5.0"
checksum: c2f0d4514d4d1772794dd6209df2311368076aaa2555b03763a9fcc21d4d861996fd1c13cd1c29a8d9f801470b20e56b2d47c3c4f35e76a3f8ab9ce2de3efcd9
languageName: node
linkType: hard

"@amplitude/plugin-page-view-tracking-browser@npm:^2.2.3":
version: 2.2.8
resolution: "@amplitude/plugin-page-view-tracking-browser@npm:2.2.8"
dependencies:
"@amplitude/analytics-client-common": ^2.1.5
"@amplitude/analytics-types": ^2.5.0
tslib: ^2.4.1
checksum: d6759f2df86765ca9488548bb80bf46b719c4a8a36ebd95ccc403ec70211a4e177df163e0765895a64314e8dafe1b69727a64924eb83f47e4c4eae478806257a
"@amplitude/analytics-types@npm:^2.5.1":
version: 2.5.1
resolution: "@amplitude/analytics-types@npm:2.5.1"
checksum: 7b46ed1fbe856990ac71ee3d9a9185f16f286a17f5bbd93560d03b608a6696deeb6c7cf42b9937889b38266f97e8b22a59f132177cdfd682da4b30accb3ae1b4
languageName: node
linkType: hard

"@amplitude/plugin-web-attribution-browser@npm:^2.1.4":
version: 2.1.9
resolution: "@amplitude/plugin-web-attribution-browser@npm:2.1.9"
"@amplitude/plugin-page-view-tracking-browser@npm:^2.2.13":
version: 2.2.13
resolution: "@amplitude/plugin-page-view-tracking-browser@npm:2.2.13"
dependencies:
"@amplitude/analytics-client-common": ^2.1.5
"@amplitude/analytics-core": ^2.2.6
"@amplitude/analytics-types": ^2.5.0
"@amplitude/analytics-client-common": ^2.2.1
"@amplitude/analytics-types": ^2.5.1
tslib: ^2.4.1
checksum: 7b49abaaa479f2114f4dd8100e4c99fb0e84be338a80d07f614814396825064144ede2fea57789e0d8f0abcde21597b23851d7efc99a602df8633db0ff4970b7
checksum: cecc82e7c0bbe03ac3c1d8b9f31f762d5c221a2c491a688b885cf8db498e075952a82f40e34cf8c36ea0a6160b7500722c01566397ece3bc23209fc76c7723aa
languageName: node
linkType: hard

Expand Down Expand Up @@ -2559,7 +2546,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@enkryptcom/extension@workspace:packages/extension"
dependencies:
"@amplitude/analytics-browser": 2.5.3
"@amplitude/analytics-browser": ^2.8.0
"@babel/plugin-transform-class-static-block": ^7.24.4
"@babel/runtime": ^7.24.5
"@enkryptcom/extension-bridge": "workspace:^"
Expand Down

1 comment on commit d46b380

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.