From abb3208825b910522b6233733187b1a7c09213f3 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 10:57:02 +0200 Subject: [PATCH 01/14] add fix for special tokens, update sort --- .../ChartDetails/MarketPriceOverview.tsx | 20 ++++++++++++------- .../TokenDetails/HeaderDetails/Header.tsx | 2 +- .../OverviewPerformanceDetails/Overview.tsx | 4 ++++ .../useCases/TokensTable/useProcentage.tsx | 8 +++++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx index 5601e79fd2..cee9d07a3e 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx @@ -27,7 +27,7 @@ export const TokenMarketPriceOverview = ({ chartData, detailInfo, tokenInfo, isD // Fetch data based on the selected interval const ptActivity = useCurrencyPairing().ptActivity; - const { changeValue, changePercent } = priceChange(ptActivity.open, ptActivity.close); + const { changeValue, changePercent } = priceChange(ptActivity.open, ptActivity?.close); const { tokenActivity: { data24h }, @@ -36,12 +36,12 @@ export const TokenMarketPriceOverview = ({ chartData, detailInfo, tokenInfo, isD const deltaPriceChange = !isPrimaryToken && !isEmpty(data24h) && - data24h[tokenInfo?.info?.id][1].price.close - data24h[tokenInfo?.info?.id][1].price.open; + data24h[tokenInfo?.info?.id][1].price?.close - data24h[tokenInfo?.info?.id][1].price?.open; const priceChangeProcent = isPrimaryToken ? detailInfo?.changePercent || changePercent : !isEmpty(data24h) && deltaPriceChange; const priceChangeValue = isPrimaryToken ? detailInfo?.changeValue || changeValue - : !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price.close; + : !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price?.close; return ( { - const tokenPrice = isPrimaryToken ? ptActivity.close : secondaryTokenActivity && secondaryTokenActivity[1].price.close; + const tokenPrice = isPrimaryToken ? ptActivity.close : secondaryTokenActivity && secondaryTokenActivity[1].price?.close; - const sPrice = secondaryTokenActivity && secondaryTokenActivity[1].price.close; + const sPrice = secondaryTokenActivity && secondaryTokenActivity[1].price?.close; const ptPrice = isDragging ? detailInfo.value : ptActivity.close; const ptUnitPrice = sPrice * ptPrice; + if (!isPrimaryToken && isNaN(ptUnitPrice)) { + return -; + } + if (tokenPrice == null) return ; return ( @@ -102,6 +106,8 @@ const TokenPrice = ({ isPrimaryToken, unitOfAccount, secondaryTokenActivity, ptA const PriceChangeChip = ({ value }: { value: number }) => { const theme: any = useTheme(); + const valueToDisplay = value >= 0 ? formatNumber(value) : formatNumber(-1 * value); + return ( <> { ) : null} {/* @ts-ignore */} - {value >= 0 ? formatNumber(value) : formatNumber(-1 * value)}% + {valueToDisplay === 'NaN' ? '-' : valueToDisplay}% } /> @@ -129,7 +135,7 @@ const PriceValueChip = ({ value, unitOfAccount }: { value: number; unitOfAccount label={ {value > 0 && '+'} - {formatNumber(value)} {unitOfAccount} + {formatNumber(value) === 'NaN' ? '-' : formatNumber(value)} {unitOfAccount} } /> diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx index 6cc7e50a8c..7bc3d929e0 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx @@ -35,7 +35,7 @@ const HeaderSection = ({ tokenInfo }: Props): JSX.Element => { const totaPriceCalc = React.useMemo(() => { if (!isPrimaryToken && !isEmpty(data24h)) { - const tokenPrice = data24h && data24h[tokenInfo.info.id][1]?.price.close; + const tokenPrice = data24h && data24h[tokenInfo.info.id][1]?.price?.close; const tokenQuantityAsBigInt = bigNumberToBigInt(new BigNumber(tokenInfo.quantity)); const tokenDecimals = !isPrimaryToken && tokenInfo.info.numberOfDecimals; diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/OverviewPerformanceDetails/Overview.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/OverviewPerformanceDetails/Overview.tsx index e9d263aae4..aef4202a32 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/OverviewPerformanceDetails/Overview.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/OverviewPerformanceDetails/Overview.tsx @@ -28,6 +28,10 @@ const Overview = ({ tokenInfo }: Props): JSX.Element => { }} component="img" src={tokenInfo.info.image || tokenPng} + onError={e => { + // @ts-ignore + e.target.src = tokenPng; + }} > diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx index d95563a97b..ea0f56a158 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx @@ -81,9 +81,15 @@ export const useProcessedTokenData = ({ data, ptActivity, data24h, data7d, data3 '24h': changePercent24, '1W': isPrimaryToken ? ptTokenDataInterval7d?.[167]?.changePercent : changePercent7d, '1M': isPrimaryToken ? ptTokenDataInterval1M?.[179]?.changePercent : changePercent30d, + isSpecialName: /^[^a-zA-Z]/.test(token.info.name), // Flag for names starting with numbers or weird characters }; }) - .sort((a, b) => b.percentage - a.percentage); + .sort((a, b) => { + // Move tokens with special names to the end + if (a.isSpecialName && !b.isSpecialName) return 1; + if (!a.isSpecialName && b.isSpecialName) return -1; + return b.percentage - a.percentage; + }); }, [data, ptActivity, data24h, data7d, data30d, primaryTokenInfo, ptTokenDataInterval7d, ptTokenDataInterval1M]); return processedData; From 1ae421fe9cd335363a0e1fdb6d38911fb81998da Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 14:42:07 +0200 Subject: [PATCH 02/14] Update market price calculation --- .../TokenDetails/ChartDetails/MarketPriceOverview.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx index cee9d07a3e..e798c56f71 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/ChartDetails/MarketPriceOverview.tsx @@ -33,15 +33,12 @@ export const TokenMarketPriceOverview = ({ chartData, detailInfo, tokenInfo, isD tokenActivity: { data24h }, } = usePortfolioTokenActivity(); - const deltaPriceChange = - !isPrimaryToken && - !isEmpty(data24h) && - data24h[tokenInfo?.info?.id][1].price?.close - data24h[tokenInfo?.info?.id][1].price?.open; + const deltaPriceChange = !isPrimaryToken && !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price?.change; const priceChangeProcent = isPrimaryToken ? detailInfo?.changePercent || changePercent : !isEmpty(data24h) && deltaPriceChange; const priceChangeValue = isPrimaryToken ? detailInfo?.changeValue || changeValue - : !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price?.close; + : !isEmpty(data24h) && data24h[tokenInfo?.info?.id][1].price?.close - data24h[tokenInfo?.info?.id][1].price?.open; return ( Date: Tue, 17 Dec 2024 16:18:18 +0200 Subject: [PATCH 03/14] add analytics --- packages/yoroi-extension/ampli/README.md | 52 - packages/yoroi-extension/ampli/index.js | 1524 ------------ .../ampli/{index.js.flow => index.ts} | 2074 +++++++++++------ .../module/PortfolioContextProvider.tsx | 14 + .../useCases/TokenDetails/TokenDetails.tsx | 8 +- .../useCases/Wallet/PortfolioWallet.tsx | 12 +- 6 files changed, 1454 insertions(+), 2230 deletions(-) delete mode 100644 packages/yoroi-extension/ampli/README.md delete mode 100644 packages/yoroi-extension/ampli/index.js rename packages/yoroi-extension/ampli/{index.js.flow => index.ts} (50%) diff --git a/packages/yoroi-extension/ampli/README.md b/packages/yoroi-extension/ampli/README.md deleted file mode 100644 index 6a32082fb5..0000000000 --- a/packages/yoroi-extension/ampli/README.md +++ /dev/null @@ -1,52 +0,0 @@ -The coerce the TypeScript Amplitude wrapper to work with flow, do these: - -``` -npm run metrics:pull -``` - -``` -cd ampli -``` - - -``` -npx -p typescript tsc index.ts --outDir . -d -m es6 -``` - -``` -npx flowgen --interface-records --no-inexact --add-flow-header -o index.js.flow index.d.ts -``` - -``` -rm *.ts -``` - -#### Next - -Linux: -``` -sed -i 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow -sed -i '/export type BaseEvent/d' index.js.flow - -``` - -Mac: -``` -sed -i'.bak' 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow -sed -i'.bak' '/export type BaseEvent/d' index.js.flow -rm *.bak -``` - -Edit `index.js.flow` to add the line `class BaseEvent {}`. - -Then we have flow-typed ampli library where all event trigger functions are strongly typed. -To use this libray, import like this from source code: -``` -import type { LoadOptionsWithEnvironment } from '../../../ampli/index'; -``` -instead of -``` -import type { LoadOptionsWithEnvironment } from '../../../ampli'; -``` -Due to perhaps a bug in flow, the later short-circuits type checking. - diff --git a/packages/yoroi-extension/ampli/index.js b/packages/yoroi-extension/ampli/index.js deleted file mode 100644 index 397079a676..0000000000 --- a/packages/yoroi-extension/ampli/index.js +++ /dev/null @@ -1,1524 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck -/** - * Ampli - A strong typed wrapper for your Analytics - * - * This file is generated by Amplitude. - * To update run 'ampli pull extension' - * - * Required dependencies: @amplitude/analytics-browser@^1.3.0 - * Tracking Plan Version: 7 - * Build: 1.0.0 - * Runtime: browser:typescript-ampli-v2 - * - * [View Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest) - * - * [Full Setup Instructions](https://data.amplitude.com/emurgo/Yoroi/implementation/extension) - */ -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -import * as amplitude from '@amplitude/analytics-browser'; -export var ApiKey = { - production: 'd44950b777177c2ebee5f21f194c1231', - development: '52a980fd5fb8da5fc680687d7e991e18' -}; -/** - * Default Amplitude configuration options. Contains tracking plan information. - */ -export var DefaultConfiguration = __assign({ plan: { - version: '7', - branch: 'main', - source: 'extension', - versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067' - } }, { - ingestionMetadata: { - sourceName: 'browser-typescript-ampli', - sourceVersion: '2.0.0' - } -}); -var AllWalletsPageViewed = /** @class */ (function () { - function AllWalletsPageViewed() { - this.event_type = 'All Wallets Page Viewed'; - } - return AllWalletsPageViewed; -}()); -export { AllWalletsPageViewed }; -var AssetsPageViewed = /** @class */ (function () { - function AssetsPageViewed() { - this.event_type = 'Assets Page Viewed'; - } - return AssetsPageViewed; -}()); -export { AssetsPageViewed }; -var ClaimAdaPageViewed = /** @class */ (function () { - function ClaimAdaPageViewed() { - this.event_type = 'Claim ADA Page Viewed'; - } - return ClaimAdaPageViewed; -}()); -export { ClaimAdaPageViewed }; -var ConnectorPageViewed = /** @class */ (function () { - function ConnectorPageViewed() { - this.event_type = 'Connector Page Viewed'; - } - return ConnectorPageViewed; -}()); -export { ConnectorPageViewed }; -var CreateWalletDetailsSettled = /** @class */ (function () { - function CreateWalletDetailsSettled() { - this.event_type = 'Create Wallet Details Settled'; - } - return CreateWalletDetailsSettled; -}()); -export { CreateWalletDetailsSettled }; -var CreateWalletDetailsStepViewed = /** @class */ (function () { - function CreateWalletDetailsStepViewed() { - this.event_type = 'Create Wallet Details Step Viewed'; - } - return CreateWalletDetailsStepViewed; -}()); -export { CreateWalletDetailsStepViewed }; -var CreateWalletDetailsSubmitted = /** @class */ (function () { - function CreateWalletDetailsSubmitted() { - this.event_type = 'Create Wallet Details Submitted'; - } - return CreateWalletDetailsSubmitted; -}()); -export { CreateWalletDetailsSubmitted }; -var CreateWalletLanguagePageViewed = /** @class */ (function () { - function CreateWalletLanguagePageViewed() { - this.event_type = 'Create Wallet Language Page Viewed'; - } - return CreateWalletLanguagePageViewed; -}()); -export { CreateWalletLanguagePageViewed }; -var CreateWalletLearnPhraseStepViewed = /** @class */ (function () { - function CreateWalletLearnPhraseStepViewed() { - this.event_type = 'Create Wallet Learn Phrase Step Viewed'; - } - return CreateWalletLearnPhraseStepViewed; -}()); -export { CreateWalletLearnPhraseStepViewed }; -var CreateWalletSavePhraseStepViewed = /** @class */ (function () { - function CreateWalletSavePhraseStepViewed() { - this.event_type = 'Create Wallet Save Phrase Step Viewed'; - } - return CreateWalletSavePhraseStepViewed; -}()); -export { CreateWalletSavePhraseStepViewed }; -var CreateWalletSelectMethodPageViewed = /** @class */ (function () { - function CreateWalletSelectMethodPageViewed() { - this.event_type = 'Create Wallet Select Method Page Viewed'; - } - return CreateWalletSelectMethodPageViewed; -}()); -export { CreateWalletSelectMethodPageViewed }; -var CreateWalletTermsPageViewed = /** @class */ (function () { - function CreateWalletTermsPageViewed() { - this.event_type = 'Create Wallet Terms Page Viewed'; - } - return CreateWalletTermsPageViewed; -}()); -export { CreateWalletTermsPageViewed }; -var CreateWalletVerifyPhraseStepViewed = /** @class */ (function () { - function CreateWalletVerifyPhraseStepViewed() { - this.event_type = 'Create Wallet Verify Phrase Step Viewed'; - } - return CreateWalletVerifyPhraseStepViewed; -}()); -export { CreateWalletVerifyPhraseStepViewed }; -var CreateWalletVerifyPhraseWordSelected = /** @class */ (function () { - function CreateWalletVerifyPhraseWordSelected(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Create Wallet Verify Phrase Word Selected'; - this.event_properties = event_properties; - } - return CreateWalletVerifyPhraseWordSelected; -}()); -export { CreateWalletVerifyPhraseWordSelected }; -var DappPopupAddCollateralPageViewed = /** @class */ (function () { - function DappPopupAddCollateralPageViewed() { - this.event_type = 'Dapp Popup Add Collateral Page Viewed'; - } - return DappPopupAddCollateralPageViewed; -}()); -export { DappPopupAddCollateralPageViewed }; -var DappPopupConnectWalletPageViewed = /** @class */ (function () { - function DappPopupConnectWalletPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Dapp Popup Connect Wallet Page Viewed'; - this.event_properties = event_properties; - } - return DappPopupConnectWalletPageViewed; -}()); -export { DappPopupConnectWalletPageViewed }; -var DappPopupConnectWalletPasswordPageViewed = /** @class */ (function () { - function DappPopupConnectWalletPasswordPageViewed() { - this.event_type = 'Dapp Popup Connect Wallet Password Page Viewed'; - } - return DappPopupConnectWalletPasswordPageViewed; -}()); -export { DappPopupConnectWalletPasswordPageViewed }; -var DappPopupSignTransactionPageViewed = /** @class */ (function () { - function DappPopupSignTransactionPageViewed() { - this.event_type = 'Dapp Popup Sign Transaction Page Viewed'; - } - return DappPopupSignTransactionPageViewed; -}()); -export { DappPopupSignTransactionPageViewed }; -var DappPopupSignTransactionSubmitted = /** @class */ (function () { - function DappPopupSignTransactionSubmitted() { - this.event_type = 'Dapp Popup Sign Transaction Submitted'; - } - return DappPopupSignTransactionSubmitted; -}()); -export { DappPopupSignTransactionSubmitted }; -var GovernanceChooseDrepPageViewed = /** @class */ (function () { - function GovernanceChooseDrepPageViewed() { - this.event_type = 'Governance Choose Drep Page Viewed'; - } - return GovernanceChooseDrepPageViewed; -}()); -export { GovernanceChooseDrepPageViewed }; -var GovernanceConfirmTransactionPageViewed = /** @class */ (function () { - function GovernanceConfirmTransactionPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Governance Confirm Transaction Page Viewed'; - this.event_properties = event_properties; - } - return GovernanceConfirmTransactionPageViewed; -}()); -export { GovernanceConfirmTransactionPageViewed }; -var GovernanceDashboardPageViewed = /** @class */ (function () { - function GovernanceDashboardPageViewed() { - this.event_type = 'Governance Dashboard Page Viewed'; - } - return GovernanceDashboardPageViewed; -}()); -export { GovernanceDashboardPageViewed }; -var GovernanceTransactionSuccessPageViewed = /** @class */ (function () { - function GovernanceTransactionSuccessPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Governance Transaction Success Page Viewed'; - this.event_properties = event_properties; - } - return GovernanceTransactionSuccessPageViewed; -}()); -export { GovernanceTransactionSuccessPageViewed }; -var NetworkSelected = /** @class */ (function () { - function NetworkSelected(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Network Selected'; - this.event_properties = event_properties; - } - return NetworkSelected; -}()); -export { NetworkSelected }; -var NftGalleryDetailsImageViewed = /** @class */ (function () { - function NftGalleryDetailsImageViewed() { - this.event_type = 'NFT Gallery Details Image Viewed'; - } - return NftGalleryDetailsImageViewed; -}()); -export { NftGalleryDetailsImageViewed }; -var NftGalleryDetailsNavigation = /** @class */ (function () { - function NftGalleryDetailsNavigation(event_properties) { - this.event_properties = event_properties; - this.event_type = 'NFT Gallery Details Navigation'; - this.event_properties = event_properties; - } - return NftGalleryDetailsNavigation; -}()); -export { NftGalleryDetailsNavigation }; -var NftGalleryDetailsPageViewed = /** @class */ (function () { - function NftGalleryDetailsPageViewed() { - this.event_type = 'NFT Gallery Details Page Viewed'; - } - return NftGalleryDetailsPageViewed; -}()); -export { NftGalleryDetailsPageViewed }; -var NftGalleryDetailsTab = /** @class */ (function () { - function NftGalleryDetailsTab(event_properties) { - this.event_properties = event_properties; - this.event_type = 'NFT Gallery Details Tab'; - this.event_properties = event_properties; - } - return NftGalleryDetailsTab; -}()); -export { NftGalleryDetailsTab }; -var NftGalleryGridViewSelected = /** @class */ (function () { - function NftGalleryGridViewSelected(event_properties) { - this.event_properties = event_properties; - this.event_type = 'NFT Gallery Grid View Selected'; - this.event_properties = event_properties; - } - return NftGalleryGridViewSelected; -}()); -export { NftGalleryGridViewSelected }; -var NftGalleryPageViewed = /** @class */ (function () { - function NftGalleryPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'NFT Gallery Page Viewed'; - this.event_properties = event_properties; - } - return NftGalleryPageViewed; -}()); -export { NftGalleryPageViewed }; -var NftGallerySearchActivated = /** @class */ (function () { - function NftGallerySearchActivated(event_properties) { - this.event_properties = event_properties; - this.event_type = 'NFT Gallery Search Activated'; - this.event_properties = event_properties; - } - return NftGallerySearchActivated; -}()); -export { NftGallerySearchActivated }; -var PortfolioTokenDetails = /** @class */ (function () { - function PortfolioTokenDetails(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Portfolio Token Details'; - this.event_properties = event_properties; - } - return PortfolioTokenDetails; -}()); -export { PortfolioTokenDetails }; -var PortfolioTokensListPageViewed = /** @class */ (function () { - function PortfolioTokensListPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Portfolio Tokens List Page Viewed'; - this.event_properties = event_properties; - } - return PortfolioTokensListPageViewed; -}()); -export { PortfolioTokensListPageViewed }; -var PortfolioTokensListSearchActivated = /** @class */ (function () { - function PortfolioTokensListSearchActivated(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Portfolio Tokens List Search Activated'; - this.event_properties = event_properties; - } - return PortfolioTokensListSearchActivated; -}()); -export { PortfolioTokensListSearchActivated }; -var ReceiveAmountGeneratedPageViewed = /** @class */ (function () { - function ReceiveAmountGeneratedPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Receive Amount Generated Page Viewed'; - this.event_properties = event_properties; - } - return ReceiveAmountGeneratedPageViewed; -}()); -export { ReceiveAmountGeneratedPageViewed }; -var ReceiveAmountPageViewed = /** @class */ (function () { - function ReceiveAmountPageViewed() { - this.event_type = 'Receive Amount Page Viewed'; - } - return ReceiveAmountPageViewed; -}()); -export { ReceiveAmountPageViewed }; -var ReceiveCopyAddressClicked = /** @class */ (function () { - function ReceiveCopyAddressClicked(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Receive Copy Address Clicked'; - this.event_properties = event_properties; - } - return ReceiveCopyAddressClicked; -}()); -export { ReceiveCopyAddressClicked }; -var ReceiveGenerateNewAddressClicked = /** @class */ (function () { - function ReceiveGenerateNewAddressClicked() { - this.event_type = 'Receive Generate New Address Clicked'; - } - return ReceiveGenerateNewAddressClicked; -}()); -export { ReceiveGenerateNewAddressClicked }; -var ReceivePageListViewed = /** @class */ (function () { - function ReceivePageListViewed() { - this.event_type = 'Receive Page List Viewed'; - } - return ReceivePageListViewed; -}()); -export { ReceivePageListViewed }; -var ReceivePageViewed = /** @class */ (function () { - function ReceivePageViewed() { - this.event_type = 'Receive Page Viewed'; - } - return ReceivePageViewed; -}()); -export { ReceivePageViewed }; -var ReceiveShareAddressClicked = /** @class */ (function () { - function ReceiveShareAddressClicked() { - this.event_type = 'Receive Share Address Clicked'; - } - return ReceiveShareAddressClicked; -}()); -export { ReceiveShareAddressClicked }; -var RestoreWalletDetailsSettled = /** @class */ (function () { - function RestoreWalletDetailsSettled() { - this.event_type = 'Restore Wallet Details Settled'; - } - return RestoreWalletDetailsSettled; -}()); -export { RestoreWalletDetailsSettled }; -var RestoreWalletDetailsStepViewed = /** @class */ (function () { - function RestoreWalletDetailsStepViewed() { - this.event_type = 'Restore Wallet Details Step Viewed'; - } - return RestoreWalletDetailsStepViewed; -}()); -export { RestoreWalletDetailsStepViewed }; -var RestoreWalletEnterPhraseStepStatus = /** @class */ (function () { - function RestoreWalletEnterPhraseStepStatus(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Restore Wallet Enter Phrase Step Status'; - this.event_properties = event_properties; - } - return RestoreWalletEnterPhraseStepStatus; -}()); -export { RestoreWalletEnterPhraseStepStatus }; -var RestoreWalletEnterPhraseStepViewed = /** @class */ (function () { - function RestoreWalletEnterPhraseStepViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Restore Wallet Enter Phrase Step Viewed'; - this.event_properties = event_properties; - } - return RestoreWalletEnterPhraseStepViewed; -}()); -export { RestoreWalletEnterPhraseStepViewed }; -var RestoreWalletTypeStepViewed = /** @class */ (function () { - function RestoreWalletTypeStepViewed() { - this.event_type = 'Restore Wallet Type Step Viewed'; - } - return RestoreWalletTypeStepViewed; -}()); -export { RestoreWalletTypeStepViewed }; -var SendInitiated = /** @class */ (function () { - function SendInitiated() { - this.event_type = 'Send Initiated'; - } - return SendInitiated; -}()); -export { SendInitiated }; -var SendSelectAssetPageViewed = /** @class */ (function () { - function SendSelectAssetPageViewed() { - this.event_type = 'Send Select Asset Page Viewed'; - } - return SendSelectAssetPageViewed; -}()); -export { SendSelectAssetPageViewed }; -var SendSelectAssetSelected = /** @class */ (function () { - function SendSelectAssetSelected(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Send Select Asset Selected'; - this.event_properties = event_properties; - } - return SendSelectAssetSelected; -}()); -export { SendSelectAssetSelected }; -var SendSelectAssetUpdated = /** @class */ (function () { - function SendSelectAssetUpdated(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Send Select Asset Updated'; - this.event_properties = event_properties; - } - return SendSelectAssetUpdated; -}()); -export { SendSelectAssetUpdated }; -var SendSummaryPageViewed = /** @class */ (function () { - function SendSummaryPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Send Summary Page Viewed'; - this.event_properties = event_properties; - } - return SendSummaryPageViewed; -}()); -export { SendSummaryPageViewed }; -var SendSummarySubmitted = /** @class */ (function () { - function SendSummarySubmitted(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Send Summary Submitted'; - this.event_properties = event_properties; - } - return SendSummarySubmitted; -}()); -export { SendSummarySubmitted }; -var SettingsPageViewed = /** @class */ (function () { - function SettingsPageViewed() { - this.event_type = 'Settings Page Viewed'; - } - return SettingsPageViewed; -}()); -export { SettingsPageViewed }; -var StakingCenterPageViewed = /** @class */ (function () { - function StakingCenterPageViewed() { - this.event_type = 'Staking Center Page Viewed'; - } - return StakingCenterPageViewed; -}()); -export { StakingCenterPageViewed }; -var SwapAssetFromChanged = /** @class */ (function () { - function SwapAssetFromChanged(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Asset From Changed'; - this.event_properties = event_properties; - } - return SwapAssetFromChanged; -}()); -export { SwapAssetFromChanged }; -var SwapAssetToChanged = /** @class */ (function () { - function SwapAssetToChanged(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Asset To Changed'; - this.event_properties = event_properties; - } - return SwapAssetToChanged; -}()); -export { SwapAssetToChanged }; -var SwapCancelationSubmitted = /** @class */ (function () { - function SwapCancelationSubmitted(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Cancelation Submitted'; - this.event_properties = event_properties; - } - return SwapCancelationSubmitted; -}()); -export { SwapCancelationSubmitted }; -var SwapConfirmedPageViewed = /** @class */ (function () { - function SwapConfirmedPageViewed(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Confirmed Page Viewed'; - this.event_properties = event_properties; - } - return SwapConfirmedPageViewed; -}()); -export { SwapConfirmedPageViewed }; -var SwapInitiated = /** @class */ (function () { - function SwapInitiated(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Initiated'; - this.event_properties = event_properties; - } - return SwapInitiated; -}()); -export { SwapInitiated }; -var SwapOrderSelected = /** @class */ (function () { - function SwapOrderSelected(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Order Selected'; - this.event_properties = event_properties; - } - return SwapOrderSelected; -}()); -export { SwapOrderSelected }; -var SwapOrderSubmitted = /** @class */ (function () { - function SwapOrderSubmitted(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Order Submitted'; - this.event_properties = event_properties; - } - return SwapOrderSubmitted; -}()); -export { SwapOrderSubmitted }; -var SwapPoolChanged = /** @class */ (function () { - function SwapPoolChanged() { - this.event_type = 'Swap Pool Changed'; - } - return SwapPoolChanged; -}()); -export { SwapPoolChanged }; -var SwapSlippageChanged = /** @class */ (function () { - function SwapSlippageChanged(event_properties) { - this.event_properties = event_properties; - this.event_type = 'Swap Slippage Changed'; - this.event_properties = event_properties; - } - return SwapSlippageChanged; -}()); -export { SwapSlippageChanged }; -var TransactionsPageViewed = /** @class */ (function () { - function TransactionsPageViewed() { - this.event_type = 'Transactions Page Viewed'; - } - return TransactionsPageViewed; -}()); -export { TransactionsPageViewed }; -var VotingPageViewed = /** @class */ (function () { - function VotingPageViewed() { - this.event_type = 'Voting Page Viewed'; - } - return VotingPageViewed; -}()); -export { VotingPageViewed }; -var WalletPageViewed = /** @class */ (function () { - function WalletPageViewed() { - this.event_type = 'Wallet Page Viewed'; - } - return WalletPageViewed; -}()); -export { WalletPageViewed }; -var getVoidPromiseResult = function () { return ({ promise: Promise.resolve() }); }; -// prettier-ignore -var Ampli = /** @class */ (function () { - function Ampli() { - this.disabled = false; - } - Object.defineProperty(Ampli.prototype, "client", { - get: function () { - this.isInitializedAndEnabled(); - return this.amplitude; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Ampli.prototype, "isLoaded", { - get: function () { - return this.amplitude != null; - }, - enumerable: false, - configurable: true - }); - Ampli.prototype.isInitializedAndEnabled = function () { - if (!this.amplitude) { - console.error('ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?'); - return false; - } - return !this.disabled; - }; - /** - * Initialize the Ampli SDK. Call once when your application starts. - * - * @param options Configuration options to initialize the Ampli SDK with. - */ - Ampli.prototype.load = function (options) { - var _a; - this.disabled = (_a = options.disabled) !== null && _a !== void 0 ? _a : false; - if (this.amplitude) { - console.warn('WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup.'); - return getVoidPromiseResult(); - } - var apiKey = null; - if (options.client && 'apiKey' in options.client) { - apiKey = options.client.apiKey; - } - else if ('environment' in options) { - apiKey = ApiKey[options.environment]; - } - if (options.client && 'instance' in options.client) { - this.amplitude = options.client.instance; - } - else if (apiKey) { - this.amplitude = amplitude.createInstance(); - var configuration = (options.client && 'configuration' in options.client) ? options.client.configuration : {}; - return this.amplitude.init(apiKey, undefined, __assign(__assign({}, DefaultConfiguration), configuration)); - } - else { - console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'"); - } - return getVoidPromiseResult(); - }; - /** - * Identify a user and set user properties. - * - * @param userId The user's id. - * @param options Optional event options. - */ - Ampli.prototype.identify = function (userId, options) { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - if (userId) { - options = __assign(__assign({}, options), { user_id: userId }); - } - var amplitudeIdentify = new amplitude.Identify(); - return this.amplitude.identify(amplitudeIdentify, options); - }; - /** - * Flush the event. - */ - Ampli.prototype.flush = function () { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - return this.amplitude.flush(); - }; - /** - * Track event - * - * @param event The event to track. - * @param options Optional event options. - */ - Ampli.prototype.track = function (event, options) { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - return this.amplitude.track(event, undefined, options); - }; - /** - * All Wallets Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/All%20Wallets%20Page%20Viewed) - * - * This event tracks when a user views the All Wallets page on Menu. Note: only available on Yoroi Mobile. - * - * @param options Amplitude event options. - */ - Ampli.prototype.allWalletsPageViewed = function (options) { - return this.track(new AllWalletsPageViewed(), options); - }; - /** - * Assets Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Assets%20Page%20Viewed) - * - * This event tracks when a user views the Assets page. - * On mobile is available on the wallet page (First item from main menu) in the assets tab. - * - * @param options Amplitude event options. - */ - Ampli.prototype.assetsPageViewed = function (options) { - return this.track(new AssetsPageViewed(), options); - }; - /** - * Claim ADA Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20ADA%20Page%20Viewed) - * - * This event tracks when a user views the page to claim Claim /Transfer ADA page in Extension. - * - * You can find that page under Staking section. - * - * @param options Amplitude event options. - */ - Ampli.prototype.claimAdaPageViewed = function (options) { - return this.track(new ClaimAdaPageViewed(), options); - }; - /** - * Connector Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connector%20Page%20Viewed) - * - * This event tracks when a user views the dApp Connector page. - * - * @param options Amplitude event options. - */ - Ampli.prototype.connectorPageViewed = function (options) { - return this.track(new ConnectorPageViewed(), options); - }; - /** - * Create Wallet Details Settled - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Settled) - * - * When the wallet is created correctly. This event signifies the completion of the process of setting up wallet details during the creation of a new wallet - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletDetailsSettled = function (options) { - return this.track(new CreateWalletDetailsSettled(), options); - }; - /** - * Create Wallet Details Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Step%20Viewed) - * - * This event tracks when a user views the details \*\*step 4\*\* while creating a wallet. User will introduce: \* Wallet Name \* Password \* Repeat Password - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletDetailsStepViewed = function (options) { - return this.track(new CreateWalletDetailsStepViewed(), options); - }; - /** - * Create Wallet Details Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Submitted) - * - * This event captures the submission of the wallet creation on the last step of the flow (\*\*step 4\*\*). - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletDetailsSubmitted = function (options) { - return this.track(new CreateWalletDetailsSubmitted(), options); - }; - /** - * Create Wallet Language Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Language%20Page%20Viewed) - * - * This event tracks when a user views the page for selecting the language during the wallet creation process on the first time he launch Yoroi. - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletLanguagePageViewed = function (options) { - return this.track(new CreateWalletLanguagePageViewed(), options); - }; - /** - * Create Wallet Learn Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Learn%20Phrase%20Step%20Viewed) - * - * This event tracks when a user view the \*\*first step\*\* of learn about recovery prhase - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletLearnPhraseStepViewed = function (options) { - return this.track(new CreateWalletLearnPhraseStepViewed(), options); - }; - /** - * Create Wallet Save Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Save%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the \*\*second step\*\* to save their wallet recovery phrase during the wallet creation process - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletSavePhraseStepViewed = function (options) { - return this.track(new CreateWalletSavePhraseStepViewed(), options); - }; - /** - * Create Wallet Select Method Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Select%20Method%20Page%20Viewed) - * - * This event tracks when a user views the page where they can select the method to create a wallet: - * - * \* Create new wallet - * - * \* Restore existing wallet - * - * This event tracks when a user views the page where they can select the method to create a wallet\* Connect hardware wallet - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletSelectMethodPageViewed = function (options) { - return this.track(new CreateWalletSelectMethodPageViewed(), options); - }; - /** - * Create Wallet Terms Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Terms%20Page%20Viewed) - * - * This event tracks when a user views the terms of service agreement page on the creation wallet flow - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletTermsPageViewed = function (options) { - return this.track(new CreateWalletTermsPageViewed(), options); - }; - /** - * Create Wallet Verify Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the verification phrase step while creating a wallet - * - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletVerifyPhraseStepViewed = function (options) { - return this.track(new CreateWalletVerifyPhraseStepViewed(), options); - }; - /** - * Create Wallet Verify Phrase Word Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Word%20Selected) - * - * This event tracks the selection of a specific word during the process of verifying the recovery phrase when creating a wallet - * - * @param properties The event's properties (e.g. recovery_word_order) - * @param options Amplitude event options. - */ - Ampli.prototype.createWalletVerifyPhraseWordSelected = function (properties, options) { - return this.track(new CreateWalletVerifyPhraseWordSelected(properties), options); - }; - /** - * Dapp Popup Add Collateral Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Add%20Collateral%20Page%20Viewed) - * - * This event tracks when a user views the "Add Collateral" page in the Dapp Connector Popup - * - * @param options Amplitude event options. - */ - Ampli.prototype.dappPopupAddCollateralPageViewed = function (options) { - return this.track(new DappPopupAddCollateralPageViewed(), options); - }; - /** - * Dapp Popup Connect Wallet Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Page%20Viewed) - * - * This event is triggered when the dapp connector popup is triggered and the user select the wallet that wants to connect. - * - * @param properties The event's properties (e.g. wallet_count) - * @param options Amplitude event options. - */ - Ampli.prototype.dappPopupConnectWalletPageViewed = function (properties, options) { - return this.track(new DappPopupConnectWalletPageViewed(properties), options); - }; - /** - * Dapp Popup Connect Wallet Password Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Password%20Page%20Viewed) - * - * This event tracks when a user attempts to connect their wallet by entering their password in the Dapp Connector popup - * - * @param options Amplitude event options. - */ - Ampli.prototype.dappPopupConnectWalletPasswordPageViewed = function (options) { - return this.track(new DappPopupConnectWalletPasswordPageViewed(), options); - }; - /** - * Dapp Popup Sign Transaction Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Page%20Viewed) - * - * This event tracks when a user loads a sign transaction screen on the dapp connector. Valid for extension and mobile. - * - * @param options Amplitude event options. - */ - Ampli.prototype.dappPopupSignTransactionPageViewed = function (options) { - return this.track(new DappPopupSignTransactionPageViewed(), options); - }; - /** - * Dapp Popup Sign Transaction Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Submitted) - * - * This event tracks the submission of a sign transaction request within the Dapp Connector screen. It's a Popup on extension and a full screen in Mobile. - * - * @param options Amplitude event options. - */ - Ampli.prototype.dappPopupSignTransactionSubmitted = function (options) { - return this.track(new DappPopupSignTransactionSubmitted(), options); - }; - /** - * Governance Choose Drep Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Choose%20Drep%20Page%20Viewed) - * - * This event tracks when user loads the bottom sheet on mobile or the popup on extension to introduce the Drep ID. To arrive to this page the user has to click on “Delegate to a Drep” section. - * - * @param options Amplitude event options. - */ - Ampli.prototype.governanceChooseDrepPageViewed = function (options) { - return this.track(new GovernanceChooseDrepPageViewed(), options); - }; - /** - * Governance Confirm Transaction Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Confirm%20Transaction%20Page%20Viewed) - * - * This event tracks when a user loads the confirm transaction page on the Governance flow. On Extension user would insert the password in that page. On extension user would do it in a bottom sheet afterwards. - * - * @param properties The event's properties (e.g. governance_selection) - * @param options Amplitude event options. - */ - Ampli.prototype.governanceConfirmTransactionPageViewed = function (properties, options) { - return this.track(new GovernanceConfirmTransactionPageViewed(properties), options); - }; - /** - * Governance Dashboard Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Dashboard%20Page%20Viewed) - * - * This event tracks when a user loads the Governance Dashboard Page. The page is reached via the main navigation menu in extension and in the bottom menu icon on Extension. - * - * @param options Amplitude event options. - */ - Ampli.prototype.governanceDashboardPageViewed = function (options) { - return this.track(new GovernanceDashboardPageViewed(), options); - }; - /** - * Governance Transaction Success Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Transaction%20Success%20Page%20Viewed) - * - * This event tracks when a user loads the success page at the end of the governance flow. - * - * @param properties The event's properties (e.g. governance_selection) - * @param options Amplitude event options. - */ - Ampli.prototype.governanceTransactionSuccessPageViewed = function (properties, options) { - return this.track(new GovernanceTransactionSuccessPageViewed(properties), options); - }; - /** - * Network Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Network%20Selected) - * - * Event to track when a user selects a network - * - * @param properties The event's properties (e.g. from_network) - * @param options Amplitude event options. - */ - Ampli.prototype.networkSelected = function (properties, options) { - return this.track(new NetworkSelected(properties), options); - }; - /** - * NFT Gallery Details Image Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Image%20Viewed) - * - * This event tracks when a user views the NFT image at full screen - * - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryDetailsImageViewed = function (options) { - return this.track(new NftGalleryDetailsImageViewed(), options); - }; - /** - * NFT Gallery Details Navigation - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Navigation) - * - * This event tracks when a use next and previous buttons to navigate across their NFTs. Note: available only on Extension. - * - * @param properties The event's properties (e.g. nft_navigation) - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryDetailsNavigation = function (properties, options) { - return this.track(new NftGalleryDetailsNavigation(properties), options); - }; - /** - * NFT Gallery Details Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Page%20Viewed) - * - * This event tracks when a user views the details page of an NFT item. - * - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryDetailsPageViewed = function (options) { - return this.track(new NftGalleryDetailsPageViewed(), options); - }; - /** - * NFT Gallery Details Tab - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Tab) - * - * This event tracks user interactions with the tab in the NFT Gallery details page. It provides insights into how users engage with specific details of NFTs, such as descriptions, attributes, or additional information - * - * @param properties The event's properties (e.g. nft_tab) - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryDetailsTab = function (properties, options) { - return this.track(new NftGalleryDetailsTab(properties), options); - }; - /** - * NFT Gallery Grid View Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Grid%20View%20Selected) - * - * This event is triggered when a user selects the grid view option in the NFT gallery - * - * @param properties The event's properties (e.g. nft_grid_view) - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryGridViewSelected = function (properties, options) { - return this.track(new NftGalleryGridViewSelected(properties), options); - }; - /** - * NFT Gallery Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Page%20Viewed) - * - * This event tracks when the NFT gallery it has loaded all nfts metadata - * - * @param properties The event's properties (e.g. nft_count) - * @param options Amplitude event options. - */ - Ampli.prototype.nftGalleryPageViewed = function (properties, options) { - return this.track(new NftGalleryPageViewed(properties), options); - }; - /** - * NFT Gallery Search Activated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Search%20Activated) - * - * User activates and starts a search in the NFT gallery. Delay of 0.5 seconds. - * - * @param properties The event's properties (e.g. nft_count) - * @param options Amplitude event options. - */ - Ampli.prototype.nftGallerySearchActivated = function (properties, options) { - return this.track(new NftGallerySearchActivated(properties), options); - }; - /** - * Portfolio Token Details - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Token%20Details) - * - * When user visit the detailed information about a specific token within a user's portfolio. In mobile there's 3 tabs that would be implemented in different iterations. - * - * @param properties The event's properties (e.g. token_details_tab) - * @param options Amplitude event options. - */ - Ampli.prototype.portfolioTokenDetails = function (properties, options) { - return this.track(new PortfolioTokenDetails(properties), options); - }; - /** - * Portfolio Tokens List Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Page%20Viewed) - * - * Event to track when a user views the list of tokens in their portfolio. - * - * @param properties The event's properties (e.g. tokens_tab) - * @param options Amplitude event options. - */ - Ampli.prototype.portfolioTokensListPageViewed = function (properties, options) { - return this.track(new PortfolioTokensListPageViewed(properties), options); - }; - /** - * Portfolio Tokens List Search Activated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Search%20Activated) - * - * This event tracks when a user activates and starts a search in the Tokens list page. Delay of 0.5 seconds. - * - * @param properties The event's properties (e.g. search_term) - * @param options Amplitude event options. - */ - Ampli.prototype.portfolioTokensListSearchActivated = function (properties, options) { - return this.track(new PortfolioTokensListSearchActivated(properties), options); - }; - /** - * Receive Amount Generated Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Generated%20Page%20Viewed) - * - * When the bottom sheet or popup with a generated address with an specific amount is loaded - * - * @param properties The event's properties (e.g. ada_amount) - * @param options Amplitude event options. - */ - Ampli.prototype.receiveAmountGeneratedPageViewed = function (properties, options) { - return this.track(new ReceiveAmountGeneratedPageViewed(properties), options); - }; - /** - * Receive Amount Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Page%20Viewed) - * - * When a user visit the page to insert specific amount of ADA that would be needed to generate a wallet address with that specific details. - * - * @param options Amplitude event options. - */ - Ampli.prototype.receiveAmountPageViewed = function (options) { - return this.track(new ReceiveAmountPageViewed(), options); - }; - /** - * Receive Copy Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Copy%20Address%20Clicked) - * - * When a user click on the any CTA to copy their address - * - * @param properties The event's properties (e.g. copy_address_location) - * @param options Amplitude event options. - */ - Ampli.prototype.receiveCopyAddressClicked = function (properties, options) { - return this.track(new ReceiveCopyAddressClicked(properties), options); - }; - /** - * Receive Generate New Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Generate%20New%20Address%20Clicked) - * - * When a user click on the Generate new address button on the main receive page on the multiple address flow. - * - * @param options Amplitude event options. - */ - Ampli.prototype.receiveGenerateNewAddressClicked = function (options) { - return this.track(new ReceiveGenerateNewAddressClicked(), options); - }; - /** - * Receive Page List Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20List%20Viewed) - * - * When user has enabled multiple addresses and goes to the page where he can see the list of generated wallet addresses - * - * @param options Amplitude event options. - */ - Ampli.prototype.receivePageListViewed = function (options) { - return this.track(new ReceivePageListViewed(), options); - }; - /** - * Receive Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20Viewed) - * - * When user loads the Receive funds screen, where user can see their wallet address with a QR Code - * - * @param options Amplitude event options. - */ - Ampli.prototype.receivePageViewed = function (options) { - return this.track(new ReceivePageViewed(), options); - }; - /** - * Receive Share Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Share%20Address%20Clicked) - * - * When a user click on the link to share the address - * - * @param options Amplitude event options. - */ - Ampli.prototype.receiveShareAddressClicked = function (options) { - return this.track(new ReceiveShareAddressClicked(), options); - }; - /** - * Restore Wallet Details Settled - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Settled) - * - * This event captures the details of a wallet restoration process that has been successfully completed - * - * @param options Amplitude event options. - */ - Ampli.prototype.restoreWalletDetailsSettled = function (options) { - return this.track(new RestoreWalletDetailsSettled(), options); - }; - /** - * Restore Wallet Details Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Step%20Viewed) - * - * Track when user loads the page where user inserts wallet name and password - * - * @param options Amplitude event options. - */ - Ampli.prototype.restoreWalletDetailsStepViewed = function (options) { - return this.track(new RestoreWalletDetailsStepViewed(), options); - }; - /** - * Restore Wallet Enter Phrase Step Status - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Status) - * - * This events tracks the validation of the recovery phrase is verified, once the user insert the latest word. The output can be positive or negative and we do save that in he property: recovery*prhase*status - * - * @param properties The event's properties (e.g. recovery_prhase_status) - * @param options Amplitude event options. - */ - Ampli.prototype.restoreWalletEnterPhraseStepStatus = function (properties, options) { - return this.track(new RestoreWalletEnterPhraseStepStatus(properties), options); - }; - /** - * Restore Wallet Enter Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the step to enter the recovery phrase while restoring a wallet (**Step 2**). - * - * @param properties The event's properties (e.g. recovery_phrase_lenght) - * @param options Amplitude event options. - */ - Ampli.prototype.restoreWalletEnterPhraseStepViewed = function (properties, options) { - return this.track(new RestoreWalletEnterPhraseStepViewed(properties), options); - }; - /** - * Restore Wallet Type Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Type%20Step%20Viewed) - * - * This event tracks when a user views the **first step after** selecting restore wallet, were they have to choose between: - * - * * 15-word recovery phrase - * - * * 24-word recovery phrase - * - * @param options Amplitude event options. - */ - Ampli.prototype.restoreWalletTypeStepViewed = function (options) { - return this.track(new RestoreWalletTypeStepViewed(), options); - }; - /** - * Send Initiated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Initiated) - * - * This event tracks when a user loads the default state of the first step of the multiasset transaction flow. That screen shows receiver address and optional memo - * - * @param options Amplitude event options. - */ - Ampli.prototype.sendInitiated = function (options) { - return this.track(new SendInitiated(), options); - }; - /** - * Send Select Asset Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Page%20Viewed) - * - * This event tracks when a user views the "Amount" page in the send flow. - * - * @param options Amplitude event options. - */ - Ampli.prototype.sendSelectAssetPageViewed = function (options) { - return this.track(new SendSelectAssetPageViewed(), options); - }; - /** - * Send Select Asset Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Selected) - * - * When a user click "next" on the send flow: "Amount" step on extension / "Assets added" in mobile - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - Ampli.prototype.sendSelectAssetSelected = function (properties, options) { - return this.track(new SendSelectAssetSelected(properties), options); - }; - /** - * Send Select Asset Updated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Updated) - * - * When an user update the tokens selection on "amount" step: - * \- Add - * \- Remove - * \- Updated - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - Ampli.prototype.sendSelectAssetUpdated = function (properties, options) { - return this.track(new SendSelectAssetUpdated(properties), options); - }; - /** - * Send Summary Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Page%20Viewed) - * - * When a user loads the Preview page (Could be called comfirmation too) on the send flow. - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - Ampli.prototype.sendSummaryPageViewed = function (properties, options) { - return this.track(new SendSummaryPageViewed(properties), options); - }; - /** - * Send Summary Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Submitted) - * - * When a user click "send" on the "Preview" step on the send flow. - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - Ampli.prototype.sendSummarySubmitted = function (properties, options) { - return this.track(new SendSummarySubmitted(properties), options); - }; - /** - * Settings Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Settings%20Page%20Viewed) - * - * This event tracks when a user views the settings page within the application. - * - * @param options Amplitude event options. - */ - Ampli.prototype.settingsPageViewed = function (options) { - return this.track(new SettingsPageViewed(), options); - }; - /** - * Staking Center Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Page%20Viewed) - * - * This event tracks when a user views the Staking Center page on Staking menu. - * - * @param options Amplitude event options. - */ - Ampli.prototype.stakingCenterPageViewed = function (options) { - return this.track(new StakingCenterPageViewed(), options); - }; - /** - * Swap Asset From Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20From%20Changed) - * - * When user changed the selected asset on "From" section - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_asset) - * @param options Amplitude event options. - */ - Ampli.prototype.swapAssetFromChanged = function (properties, options) { - return this.track(new SwapAssetFromChanged(properties), options); - }; - /** - * Swap Asset To Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20To%20Changed) - * - * When user changed the selected asset on "To" section - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. to_asset) - * @param options Amplitude event options. - */ - Ampli.prototype.swapAssetToChanged = function (properties, options) { - return this.track(new SwapAssetToChanged(properties), options); - }; - /** - * Swap Cancelation Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Cancelation%20Submitted) - * - * When user sign a transaction to cancel the swap order - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - Ampli.prototype.swapCancelationSubmitted = function (properties, options) { - return this.track(new SwapCancelationSubmitted(properties), options); - }; - /** - * Swap Confirmed Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Confirmed%20%20Page%20Viewed) - * - * When the user opens Completed Order page - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. swap_tab) - * @param options Amplitude event options. - */ - Ampli.prototype.swapConfirmedPageViewed = function (properties, options) { - return this.track(new SwapConfirmedPageViewed(properties), options); - }; - /** - * Swap Initiated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Initiated) - * - * When user clicks on the swap feature and sees the default state of the swap. - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_asset) - * @param options Amplitude event options. - */ - Ampli.prototype.swapInitiated = function (properties, options) { - return this.track(new SwapInitiated(properties), options); - }; - /** - * Swap Order Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Selected) - * - * When user click on "swap" button after selecting asset from, entering the amount of asset form, selecting asset to, entering amount of asset to, and choosing a pool - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - Ampli.prototype.swapOrderSelected = function (properties, options) { - return this.track(new SwapOrderSelected(properties), options); - }; - /** - * Swap Order Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Submitted) - * - * When user click confirm on the check out page, after entering their spending password - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - Ampli.prototype.swapOrderSubmitted = function (properties, options) { - return this.track(new SwapOrderSubmitted(properties), options); - }; - /** - * Swap Pool Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Pool%20Changed) - * - * When user clicked a different pool on the "Select Pool" page - * - * Owner: Sergio SF - * - * @param options Amplitude event options. - */ - Ampli.prototype.swapPoolChanged = function (options) { - return this.track(new SwapPoolChanged(), options); - }; - /** - * Swap Slippage Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Slippage%20Changed) - * - * When user click apply on the swap setting page - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. slippage_tolerance) - * @param options Amplitude event options. - */ - Ampli.prototype.swapSlippageChanged = function (properties, options) { - return this.track(new SwapSlippageChanged(properties), options); - }; - /** - * Transactions Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Transactions%20Page%20Viewed) - * - * This event tracks when a user views the transactions page within the wallet. On mobile is available on the wallet page (First item from main navigation item) in the transactions tab. - * - * @param options Amplitude event options. - */ - Ampli.prototype.transactionsPageViewed = function (options) { - return this.track(new TransactionsPageViewed(), options); - }; - /** - * Voting Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Voting%20Page%20Viewed) - * - * This event tracks when a user views the Catalyst Voting page. - * - * @param options Amplitude event options. - */ - Ampli.prototype.votingPageViewed = function (options) { - return this.track(new VotingPageViewed(), options); - }; - /** - * Wallet Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Wallet%20Page%20Viewed) - * - * Wallet page is the default page when the user logs into the app and selects the wallet that is going to be using (Once the initial setup is done) - * - * @param options Amplitude event options. - */ - Ampli.prototype.walletPageViewed = function (options) { - return this.track(new WalletPageViewed(), options); - }; - return Ampli; -}()); -export { Ampli }; -export var ampli = new Ampli(); diff --git a/packages/yoroi-extension/ampli/index.js.flow b/packages/yoroi-extension/ampli/index.ts similarity index 50% rename from packages/yoroi-extension/ampli/index.js.flow rename to packages/yoroi-extension/ampli/index.ts index b61142f11e..a8d20c5046 100644 --- a/packages/yoroi-extension/ampli/index.js.flow +++ b/packages/yoroi-extension/ampli/index.ts @@ -1,55 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck /** - * Flowtype definitions for index - * Generated by Flowgen from a Typescript Definition - * Flowgen v1.21.0 - * @flow + * Ampli - A strong typed wrapper for your Analytics + * + * This file is generated by Amplitude. + * To update run 'ampli pull extension' + * + * Required dependencies: @amplitude/analytics-browser@^1.3.0 + * Tracking Plan Version: 7 + * Build: 1.0.0 + * Runtime: browser:typescript-ampli-v2 + * + * [View Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest) + * + * [Full Setup Instructions](https://data.amplitude.com/emurgo/Yoroi/implementation/extension) */ -class BaseEvent {} -import * as amplitude from "@amplitude/analytics-browser"; -export type Environment = "production" | "development"; -declare export var ApiKey: { [key: Environment]: string }; +import * as amplitude from '@amplitude/analytics-browser'; + +export type Environment = 'production' | 'development'; + +export const ApiKey: Record = { + production: 'd44950b777177c2ebee5f21f194c1231', + development: '52a980fd5fb8da5fc680687d7e991e18', +}; + /** * Default Amplitude configuration options. Contains tracking plan information. */ -declare export var DefaultConfiguration: BrowserOptions; -export type LoadOptionsBase = {| - disabled?: boolean, -|}; -export type LoadOptionsWithEnvironment = {| - ...LoadOptionsBase, - ...{| - environment: Environment, - client?: {| - configuration?: BrowserOptions, - |}, - |}, -|}; -export type LoadOptionsWithApiKey = {| - ...LoadOptionsBase, - ...{| - client: {| - apiKey: string, - configuration?: BrowserOptions, - |}, - |}, -|}; -export type LoadOptionsWithClientInstance = {| - ...LoadOptionsBase, - ...{| - client: {| - instance: BrowserClient, - |}, - |}, -|}; -export type LoadOptions = - | LoadOptionsWithEnvironment - | LoadOptionsWithApiKey - | LoadOptionsWithClientInstance; -export type CreateWalletVerifyPhraseWordSelectedProperties = {| - recovery_word_order?: any, -|}; -export type DappPopupConnectWalletPageViewedProperties = {| +export const DefaultConfiguration: BrowserOptions = { + plan: { + version: '7', + branch: 'main', + source: 'extension', + versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067', + }, + ...{ + ingestionMetadata: { + sourceName: 'browser-typescript-ampli', + sourceVersion: '2.0.0', + }, + }, +}; + +export interface LoadOptionsBase { + disabled?: boolean; +} + +export type LoadOptionsWithEnvironment = LoadOptionsBase & { + environment: Environment; + client?: { configuration?: BrowserOptions }; +}; +export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: BrowserOptions } }; +export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: BrowserClient } }; + +export type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance; + +export interface ClaimAdaTransactionSettledProperties { + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + reward_amount: number; +} + +export interface ClaimAdaTransactionSubmittedProperties { + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + reward_amount: number; +} + +export interface ConnectWalletDetailsSubmittedProperties { + /** + * The name of the hardware wallet. + * + * | Rule | Value | + * |---|---| + * | Enum Values | Ledger, Trezor | + */ + hardware_wallet: 'Ledger' | 'Trezor'; +} + +export interface CreateWalletVerifyPhraseWordSelectedProperties { + recovery_word_order?: any; +} + +export interface DappPopupConnectWalletPageViewedProperties { /** * The total number of wallets that a user have. * In case of not having any wallet, save 0 as the value. @@ -58,25 +99,28 @@ export type DappPopupConnectWalletPageViewedProperties = {| * |---|---| * | Type | number | */ - wallet_count: number, -|}; -export type GovernanceConfirmTransactionPageViewedProperties = {| + wallet_count: number; +} + +export interface GovernanceConfirmTransactionPageViewedProperties { /** * | Rule | Value | * |---|---| * | Enum Values | Delegate, Abstain, No Confidence | */ - governance_selection: "Delegate" | "Abstain" | "No Confidence", -|}; -export type GovernanceTransactionSuccessPageViewedProperties = {| + governance_selection: 'Delegate' | 'Abstain' | 'No Confidence'; +} + +export interface GovernanceTransactionSuccessPageViewedProperties { /** * | Rule | Value | * |---|---| * | Enum Values | Delegate, Abstain, No Confidence | */ - governance_selection: "Delegate" | "Abstain" | "No Confidence", -|}; -export type NetworkSelectedProperties = {| + governance_selection: 'Delegate' | 'Abstain' | 'No Confidence'; +} + +export interface NetworkSelectedProperties { /** * Current network * @@ -84,8 +128,7 @@ export type NetworkSelectedProperties = {| * |---|---| * | Enum Values | preprod, preview, mainnet, sancho | */ - from_network: "preprod" | "preview" | "mainnet" | "sancho", - + from_network: 'preprod' | 'preview' | 'mainnet' | 'sancho'; /** * Network selected * @@ -93,9 +136,10 @@ export type NetworkSelectedProperties = {| * |---|---| * | Enum Values | preprod, preview, mainnet, sancho | */ - to_network: "preprod" | "preview" | "mainnet" | "sancho", -|}; -export type NftGalleryDetailsNavigationProperties = {| + to_network: 'preprod' | 'preview' | 'mainnet' | 'sancho'; +} + +export interface NftGalleryDetailsNavigationProperties { /** * Describe the navigation buttons on the NFT details view * @@ -103,17 +147,19 @@ export type NftGalleryDetailsNavigationProperties = {| * |---|---| * | Enum Values | Next, Previous | */ - nft_navigation: "Next" | "Previous", -|}; -export type NftGalleryDetailsTabProperties = {| + nft_navigation: 'Next' | 'Previous'; +} + +export interface NftGalleryDetailsTabProperties { /** * | Rule | Value | * |---|---| * | Enum Values | Overview, Metadata | */ - nft_tab: "Overview" | "Metadata", -|}; -export type NftGalleryGridViewSelectedProperties = {| + nft_tab: 'Overview' | 'Metadata'; +} + +export interface NftGalleryGridViewSelectedProperties { /** * Describe what type of grid is using the NFT gallery * @@ -121,9 +167,10 @@ export type NftGalleryGridViewSelectedProperties = {| * |---|---| * | Enum Values | 4_rows, 6_rows | */ - nft_grid_view?: "4_rows" | "6_rows", -|}; -export type NftGalleryPageViewedProperties = {| + nft_grid_view?: '4_rows' | '6_rows'; +} + +export interface NftGalleryPageViewedProperties { /** * The total number of NFT's that an user have * @@ -131,9 +178,10 @@ export type NftGalleryPageViewedProperties = {| * |---|---| * | Type | integer | */ - nft_count: number, -|}; -export type NftGallerySearchActivatedProperties = {| + nft_count: number; +} + +export interface NftGallerySearchActivatedProperties { /** * The total number of NFT's that an user have * @@ -141,14 +189,14 @@ export type NftGallerySearchActivatedProperties = {| * |---|---| * | Type | integer | */ - nft_count: number, - + nft_count: number; /** * What user is looking to search on NFT gallery page */ - nft_search_term: string, -|}; -export type PortfolioTokenDetailsProperties = {| + nft_search_term: string; +} + +export interface PortfolioTokenDetailsProperties { /** * It show what tab from the Token details the user is. * @@ -156,9 +204,10 @@ export type PortfolioTokenDetailsProperties = {| * |---|---| * | Enum Values | Performance, Overview, Transactions | */ - token_details_tab: "Performance" | "Overview" | "Transactions", -|}; -export type PortfolioTokensListPageViewedProperties = {| + token_details_tab: 'Performance' | 'Overview' | 'Transactions'; +} + +export interface PortfolioTokensListPageViewedProperties { /** * It shows in what tab are we in the movile version of the Token list * @@ -166,15 +215,17 @@ export type PortfolioTokensListPageViewedProperties = {| * |---|---| * | Enum Values | Wallet Token, Dapps Token | */ - tokens_tab: "Wallet Token" | "Dapps Token", -|}; -export type PortfolioTokensListSearchActivatedProperties = {| + tokens_tab: 'Wallet Token' | 'Dapps Token'; +} + +export interface PortfolioTokensListSearchActivatedProperties { /** * What a user is looking to search. */ - search_term: string, -|}; -export type ReceiveAmountGeneratedPageViewedProperties = {| + search_term: string; +} + +export interface ReceiveAmountGeneratedPageViewedProperties { /** * The amount of ADA that the user will be exchanging. * @@ -182,9 +233,10 @@ export type ReceiveAmountGeneratedPageViewedProperties = {| * |---|---| * | Type | number | */ - ada_amount: number, -|}; -export type ReceiveCopyAddressClickedProperties = {| + ada_amount: number; +} + +export interface ReceiveCopyAddressClickedProperties { /** * Indicates the location of cop CTA * @@ -192,23 +244,23 @@ export type ReceiveCopyAddressClickedProperties = {| * |---|---| * | Enum Values | CTA Copy Address, Tap Address Details, Long Press wallet Address | */ - copy_address_location: - | "CTA Copy Address" - | "Tap Address Details" - | "Long Press wallet Address", -|}; -export type RestoreWalletEnterPhraseStepStatusProperties = {| - recovery_prhase_status: boolean, -|}; -export type RestoreWalletEnterPhraseStepViewedProperties = {| + copy_address_location: 'CTA Copy Address' | 'Tap Address Details' | 'Long Press wallet Address'; +} + +export interface RestoreWalletEnterPhraseStepStatusProperties { + recovery_prhase_status: boolean; +} + +export interface RestoreWalletEnterPhraseStepViewedProperties { /** * | Rule | Value | * |---|---| * | Enum Values | 15, 24 | */ - recovery_phrase_lenght: "15" | "24", -|}; -export type SendSelectAssetSelectedProperties = {| + recovery_phrase_lenght: '15' | '24'; +} + +export interface SendSelectAssetSelectedProperties { /** * Total numbers of assets to be send * @@ -216,8 +268,7 @@ export type SendSelectAssetSelectedProperties = {| * |---|---| * | Type | number | */ - asset_count: number, - + asset_count: number; /** * ``` * nfts: [ @@ -231,8 +282,7 @@ export type SendSelectAssetSelectedProperties = {| * ] * ``` */ - nfts?: any[], - + nfts?: any[]; /** * ``` * Tokens: [ @@ -247,16 +297,16 @@ export type SendSelectAssetSelectedProperties = {| * ] * ``` */ - tokens?: any[], -|}; -export type SendSelectAssetUpdatedProperties = {| + tokens?: any[]; +} + +export interface SendSelectAssetUpdatedProperties { /** * | Rule | Value | * |---|---| * | Type | number | */ - asset_count: number, - + asset_count: number; /** * ``` * nfts: [ @@ -270,8 +320,7 @@ export type SendSelectAssetUpdatedProperties = {| * ] * ``` */ - nfts?: any[], - + nfts?: any[]; /** * ``` * Tokens: [ @@ -286,16 +335,16 @@ export type SendSelectAssetUpdatedProperties = {| * ] * ``` */ - tokens?: any[], -|}; -export type SendSummaryPageViewedProperties = {| + tokens?: any[]; +} + +export interface SendSummaryPageViewedProperties { /** * | Rule | Value | * |---|---| * | Type | number | */ - asset_count: number, - + asset_count: number; /** * ``` * nfts: [ @@ -309,8 +358,7 @@ export type SendSummaryPageViewedProperties = {| * ] * ``` */ - nfts?: any[], - + nfts?: any[]; /** * ``` * Tokens: [ @@ -325,16 +373,31 @@ export type SendSummaryPageViewedProperties = {| * ] * ``` */ - tokens?: any[], -|}; -export type SendSummarySubmittedProperties = {| + tokens?: any[]; +} + +export interface SendSummarySubmittedProperties { /** + * The amount of ADA that the user will be exchanging. + * * | Rule | Value | * |---|---| * | Type | number | */ - asset_count: number, - + ada_amount: number; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + nft_amount: number; + nft_name: string; /** * ``` * nfts: [ @@ -348,8 +411,14 @@ export type SendSummarySubmittedProperties = {| * ] * ``` */ - nfts?: any[], - + nfts?: any[]; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + token_amount: number; + token_name: string; /** * ``` * Tokens: [ @@ -364,9 +433,10 @@ export type SendSummarySubmittedProperties = {| * ] * ``` */ - tokens?: any[], -|}; -export type SwapAssetFromChangedProperties = {| + tokens?: any[]; +} + +export interface SwapAssetFromChangedProperties { /** * Displaying the asset that the user chose to trade with. * @@ -379,9 +449,10 @@ export type SwapAssetFromChangedProperties = {| * }, * \] */ - from_asset: any[], -|}; -export type SwapAssetToChangedProperties = {| + from_asset: any[]; +} + +export interface SwapAssetToChangedProperties { /** * Displaying the asset that the user chose to trade to * @@ -389,9 +460,10 @@ export type SwapAssetToChangedProperties = {| * Asset Ticker * Policy ID */ - to_asset: any[], -|}; -export type SwapCancelationSubmittedProperties = {| + to_asset: any[]; +} + +export interface SwapCancelationSubmittedProperties { /** * The amount of asset that the user is swapping from * @@ -399,8 +471,7 @@ export type SwapCancelationSubmittedProperties = {| * |---|---| * | Type | number | */ - from_amount: number, - + from_amount: number; /** * Displaying the asset that the user chose to trade with. * @@ -417,13 +488,11 @@ export type SwapCancelationSubmittedProperties = {| * |---|---| * | Unique Items | null | */ - from_asset: any[], - + from_asset: any[]; /** * The name of liquidity pool used for this swap transaction */ - pool_source: string, - + pool_source: string; /** * The amount of asset that the user is swapping to * @@ -431,8 +500,7 @@ export type SwapCancelationSubmittedProperties = {| * |---|---| * | Type | number | */ - to_amount: number, - + to_amount: number; /** * Displaying the asset that the user chose to trade to * @@ -444,9 +512,10 @@ export type SwapCancelationSubmittedProperties = {| * |---|---| * | Unique Items | null | */ - to_asset: any[], -|}; -export type SwapConfirmedPageViewedProperties = {| + to_asset: any[]; +} + +export interface SwapConfirmedPageViewedProperties { /** * Define the tab that is active in the selected page * @@ -454,9 +523,10 @@ export type SwapConfirmedPageViewedProperties = {| * |---|---| * | Enum Values | Open Orders, Completed Orders | */ - swap_tab: "Open Orders" | "Completed Orders", -|}; -export type SwapInitiatedProperties = {| + swap_tab: 'Open Orders' | 'Completed Orders'; +} + +export interface SwapInitiatedProperties { /** * Displaying the asset that the user chose to trade with. * @@ -473,8 +543,7 @@ export type SwapInitiatedProperties = {| * |---|---| * | Unique Items | null | */ - from_asset: any[], - + from_asset: any[]; /** * The type of order selected on a given transaction * @@ -482,8 +551,7 @@ export type SwapInitiatedProperties = {| * |---|---| * | Enum Values | limit, market | */ - order_type: "limit" | "market", - + order_type: 'limit' | 'market'; /** * The default slippage tolerance is 1%, but users are free to change the slippage. * @@ -491,8 +559,7 @@ export type SwapInitiatedProperties = {| * |---|---| * | Type | number | */ - slippage_tolerance: number, - + slippage_tolerance: number; /** * Displaying the asset that the user chose to trade to * @@ -504,14 +571,14 @@ export type SwapInitiatedProperties = {| * |---|---| * | Unique Items | null | */ - to_asset: any[], -|}; -export type SwapOrderSelectedProperties = {| + to_asset: any[]; +} + +export interface SwapOrderSelectedProperties { /** * The amount of asset that the user is swapping from */ - from_amount: string, - + from_amount: string; /** * Displaying the asset that the user chose to trade with. * @@ -524,8 +591,13 @@ export type SwapOrderSelectedProperties = {| * }, * \] */ - from_asset: any[], - + from_asset: any[]; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + from_asset_fiat_value: number; /** * The type of order selected on a given transaction * @@ -533,13 +605,11 @@ export type SwapOrderSelectedProperties = {| * |---|---| * | Enum Values | limit, market | */ - order_type?: "limit" | "market", - + order_type?: 'limit' | 'market'; /** * The name of liquidity pool used for this swap transaction */ - pool_source: string, - + pool_source: string; /** * The default slippage tolerance is 1%, but users are free to change the slippage. * @@ -547,8 +617,7 @@ export type SwapOrderSelectedProperties = {| * |---|---| * | Type | number | */ - slippage_tolerance?: number, - + slippage_tolerance?: number; /** * The amount of fees charged on the transaction. The value is in ADA. * @@ -556,13 +625,15 @@ export type SwapOrderSelectedProperties = {| * |---|---| * | Type | number | */ - swap_fees?: number, - + swap_fees?: number; + /** + * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). + */ + swap_pair?: string; /** * The amount of asset that the user is swapping to */ - to_amount: string, - + to_amount: string; /** * Displaying the asset that the user chose to trade to * @@ -570,14 +641,20 @@ export type SwapOrderSelectedProperties = {| * Asset Ticker * Policy ID */ - to_asset: any[], -|}; -export type SwapOrderSubmittedProperties = {| + to_asset: any[]; /** - * The amount of asset that the user is swapping from + * | Rule | Value | + * |---|---| + * | Type | number | */ - from_amount: string, + to_asset_fiat_value: number; +} +export interface SwapOrderSubmittedProperties { + /** + * The amount of asset that the user is swapping from + */ + from_amount: string; /** * Displaying the asset that the user chose to trade with. * @@ -590,8 +667,13 @@ export type SwapOrderSubmittedProperties = {| * }, * \] */ - from_asset: any[], - + from_asset: any[]; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + from_asset_fiat_value: number; /** * The type of order selected on a given transaction * @@ -599,13 +681,11 @@ export type SwapOrderSubmittedProperties = {| * |---|---| * | Enum Values | limit, market | */ - order_type?: "limit" | "market", - + order_type?: 'limit' | 'market'; /** * The name of liquidity pool used for this swap transaction */ - pool_source: string, - + pool_source: string; /** * The default slippage tolerance is 1%, but users are free to change the slippage. * @@ -613,8 +693,7 @@ export type SwapOrderSubmittedProperties = {| * |---|---| * | Type | number | */ - slippage_tolerance?: number, - + slippage_tolerance?: number; /** * The amount of fees charged on the transaction. The value is in ADA. * @@ -622,13 +701,15 @@ export type SwapOrderSubmittedProperties = {| * |---|---| * | Type | number | */ - swap_fees?: number, - + swap_fees?: number; + /** + * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). + */ + swap_pair?: string; /** * The amount of asset that the user is swapping to */ - to_amount: string, - + to_amount: string; /** * Displaying the asset that the user chose to trade to * @@ -636,9 +717,16 @@ export type SwapOrderSubmittedProperties = {| * Asset Ticker * Policy ID */ - to_asset: any[], -|}; -export type SwapSlippageChangedProperties = {| + to_asset: any[]; + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + to_asset_fiat_value: number; +} + +export interface SwapSlippageChangedProperties { /** * The default slippage tolerance is 1%, but users are free to change the slippage. * @@ -646,9 +734,21 @@ export type SwapSlippageChangedProperties = {| * |---|---| * | Type | number | */ - slippage_tolerance: number, -|}; -export type SendProperties = {| + slippage_tolerance: number; +} + +export interface ThemeSelectedProperties { + /** + * The theme that is selected. + * + * | Rule | Value | + * |---|---| + * | Enum Values | auto, light, dark | + */ + theme: 'auto' | 'light' | 'dark'; +} + +export interface SendProperties { /** * Total numbers of assets to be send * @@ -656,8 +756,7 @@ export type SendProperties = {| * |---|---| * | Type | number | */ - asset_count: number, - + asset_count: number; /** * ``` * nfts: [ @@ -671,8 +770,7 @@ export type SendProperties = {| * ] * ``` */ - nfts?: any[], - + nfts?: any[]; /** * ``` * Tokens: [ @@ -687,14 +785,14 @@ export type SendProperties = {| * ] * ``` */ - tokens?: any[], -|}; -export type SwapProperties = {| + tokens?: any[]; +} + +export interface SwapProperties { /** * The amount of asset that the user is swapping from */ - from_amount: string, - + from_amount: string; /** * Displaying the asset that the user chose to trade with. * @@ -707,8 +805,7 @@ export type SwapProperties = {| * }, * \] */ - from_asset: any[], - + from_asset: any[]; /** * The type of order selected on a given transaction * @@ -716,351 +813,616 @@ export type SwapProperties = {| * |---|---| * | Enum Values | limit, market | */ - order_type?: "limit" | "market", + order_type?: 'limit' | 'market'; + /** + * The name of liquidity pool used for this swap transaction + */ + pool_source: string; + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance?: number; + /** + * The amount of fees charged on the transaction. The value is in ADA. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + swap_fees?: number; + /** + * The amount of asset that the user is swapping to + */ + to_amount: string; + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + */ + to_asset: any[]; +} + +export class ToDeleteGovernanceAbstainPageViewed implements BaseEvent { + event_type = '(to delete)Governance Abstain Page Viewed'; +} + +export class AllWalletsPageViewed implements BaseEvent { + event_type = 'All Wallets Page Viewed'; +} + +export class AssetsPageViewed implements BaseEvent { + event_type = 'Assets Page Viewed'; +} + +export class BuyAdaInputAmount implements BaseEvent { + event_type = 'Buy Ada Input Amount'; +} + +export class BuyAdaSuccessRedirect implements BaseEvent { + event_type = 'Buy Ada Success Redirect'; +} + +export class ClaimAdaPageViewed implements BaseEvent { + event_type = 'Claim ADA Page Viewed'; +} + +export class ClaimAdaTransactionSettled implements BaseEvent { + event_type = 'Claim Ada Transaction Settled'; + + constructor(public event_properties: ClaimAdaTransactionSettledProperties) { + this.event_properties = event_properties; + } +} + +export class ClaimAdaTransactionSubmitted implements BaseEvent { + event_type = 'Claim Ada Transaction Submitted'; + + constructor(public event_properties: ClaimAdaTransactionSubmittedProperties) { + this.event_properties = event_properties; + } +} + +export class ConnectWalletCheckPageViewed implements BaseEvent { + event_type = 'Connect Wallet Check Page Viewed'; +} + +export class ConnectWalletConnectPageViewed implements BaseEvent { + event_type = 'Connect Wallet Connect Page Viewed'; +} + +export class ConnectWalletDetailsPageViewed implements BaseEvent { + event_type = 'Connect Wallet Details Page Viewed'; +} + +export class ConnectWalletDetailsSubmitted implements BaseEvent { + event_type = 'Connect Wallet Details Submitted'; + + constructor(public event_properties: ConnectWalletDetailsSubmittedProperties) { + this.event_properties = event_properties; + } +} + +export class ConnectorPageViewed implements BaseEvent { + event_type = 'Connector Page Viewed'; +} + +export class CreateWalletDetailsSettled implements BaseEvent { + event_type = 'Create Wallet Details Settled'; +} + +export class CreateWalletDetailsStepViewed implements BaseEvent { + event_type = 'Create Wallet Details Step Viewed'; +} + +export class CreateWalletDetailsSubmitted implements BaseEvent { + event_type = 'Create Wallet Details Submitted'; +} + +export class CreateWalletLanguagePageViewed implements BaseEvent { + event_type = 'Create Wallet Language Page Viewed'; +} + +export class CreateWalletLearnPhraseStepViewed implements BaseEvent { + event_type = 'Create Wallet Learn Phrase Step Viewed'; +} + +export class CreateWalletSavePhraseStepViewed implements BaseEvent { + event_type = 'Create Wallet Save Phrase Step Viewed'; +} + +export class CreateWalletSelectMethodPageViewed implements BaseEvent { + event_type = 'Create Wallet Select Method Page Viewed'; +} + +export class CreateWalletTermsPageViewed implements BaseEvent { + event_type = 'Create Wallet Terms Page Viewed'; +} + +export class CreateWalletVerifyPhraseStepViewed implements BaseEvent { + event_type = 'Create Wallet Verify Phrase Step Viewed'; +} + +export class CreateWalletVerifyPhraseWordSelected implements BaseEvent { + event_type = 'Create Wallet Verify Phrase Word Selected'; + + constructor(public event_properties?: CreateWalletVerifyPhraseWordSelectedProperties) { + this.event_properties = event_properties; + } +} + +export class DappPopupAddCollateralPageViewed implements BaseEvent { + event_type = 'Dapp Popup Add Collateral Page Viewed'; +} + +export class DappPopupConnectWalletPageViewed implements BaseEvent { + event_type = 'Dapp Popup Connect Wallet Page Viewed'; + + constructor(public event_properties: DappPopupConnectWalletPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class DappPopupConnectWalletPasswordPageViewed implements BaseEvent { + event_type = 'Dapp Popup Connect Wallet Password Page Viewed'; +} + +export class DappPopupSignTransactionPageViewed implements BaseEvent { + event_type = 'Dapp Popup Sign Transaction Page Viewed'; +} + +export class DappPopupSignTransactionSubmitted implements BaseEvent { + event_type = 'Dapp Popup Sign Transaction Submitted'; +} + +export class GovernanceChooseDrepPageViewed implements BaseEvent { + event_type = 'Governance Choose Drep Page Viewed'; +} + +export class GovernanceConfirmTransactionPageViewed implements BaseEvent { + event_type = 'Governance Confirm Transaction Page Viewed'; + + constructor(public event_properties: GovernanceConfirmTransactionPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class GovernanceDashboardPageViewed implements BaseEvent { + event_type = 'Governance Dashboard Page Viewed'; +} + +export class GovernanceTransactionSuccessPageViewed implements BaseEvent { + event_type = 'Governance Transaction Success Page Viewed'; + + constructor(public event_properties: GovernanceTransactionSuccessPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class NetworkSelected implements BaseEvent { + event_type = 'Network Selected'; + + constructor(public event_properties: NetworkSelectedProperties) { + this.event_properties = event_properties; + } +} + +export class NftGalleryDetailsImageViewed implements BaseEvent { + event_type = 'NFT Gallery Details Image Viewed'; +} + +export class NftGalleryDetailsNavigation implements BaseEvent { + event_type = 'NFT Gallery Details Navigation'; + + constructor(public event_properties: NftGalleryDetailsNavigationProperties) { + this.event_properties = event_properties; + } +} + +export class NftGalleryDetailsPageViewed implements BaseEvent { + event_type = 'NFT Gallery Details Page Viewed'; +} + +export class NftGalleryDetailsTab implements BaseEvent { + event_type = 'NFT Gallery Details Tab'; + + constructor(public event_properties: NftGalleryDetailsTabProperties) { + this.event_properties = event_properties; + } +} + +export class NftGalleryGridViewSelected implements BaseEvent { + event_type = 'NFT Gallery Grid View Selected'; + + constructor(public event_properties?: NftGalleryGridViewSelectedProperties) { + this.event_properties = event_properties; + } +} + +export class NftGalleryPageViewed implements BaseEvent { + event_type = 'NFT Gallery Page Viewed'; + + constructor(public event_properties: NftGalleryPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class NftGallerySearchActivated implements BaseEvent { + event_type = 'NFT Gallery Search Activated'; + + constructor(public event_properties: NftGallerySearchActivatedProperties) { + this.event_properties = event_properties; + } +} + +export class OnboardingAnalyticsPageViewed implements BaseEvent { + event_type = 'Onboarding Analytics Page Viewed'; +} + +export class PortfolioTokenDetails implements BaseEvent { + event_type = 'Portfolio Token Details'; + + constructor(public event_properties: PortfolioTokenDetailsProperties) { + this.event_properties = event_properties; + } +} + +export class PortfolioTokensListPageViewed implements BaseEvent { + event_type = 'Portfolio Tokens List Page Viewed'; + + constructor(public event_properties: PortfolioTokensListPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class PortfolioTokensListSearchActivated implements BaseEvent { + event_type = 'Portfolio Tokens List Search Activated'; + + constructor(public event_properties: PortfolioTokensListSearchActivatedProperties) { + this.event_properties = event_properties; + } +} + +export class ReceiveAmountGeneratedPageViewed implements BaseEvent { + event_type = 'Receive Amount Generated Page Viewed'; + + constructor(public event_properties: ReceiveAmountGeneratedPageViewedProperties) { + this.event_properties = event_properties; + } +} + +export class ReceiveAmountPageViewed implements BaseEvent { + event_type = 'Receive Amount Page Viewed'; +} + +export class ReceiveCopyAddressClicked implements BaseEvent { + event_type = 'Receive Copy Address Clicked'; + + constructor(public event_properties: ReceiveCopyAddressClickedProperties) { + this.event_properties = event_properties; + } +} + +export class ReceiveGenerateNewAddressClicked implements BaseEvent { + event_type = 'Receive Generate New Address Clicked'; +} + +export class ReceivePageListViewed implements BaseEvent { + event_type = 'Receive Page List Viewed'; +} + +export class ReceivePageViewed implements BaseEvent { + event_type = 'Receive Page Viewed'; +} + +export class ReceiveShareAddressClicked implements BaseEvent { + event_type = 'Receive Share Address Clicked'; +} + +export class RestoreWalletDetailsSettled implements BaseEvent { + event_type = 'Restore Wallet Details Settled'; +} - /** - * The name of liquidity pool used for this swap transaction - */ - pool_source: string, +export class RestoreWalletDetailsStepViewed implements BaseEvent { + event_type = 'Restore Wallet Details Step Viewed'; +} - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance?: number, +export class RestoreWalletEnterPhraseStepStatus implements BaseEvent { + event_type = 'Restore Wallet Enter Phrase Step Status'; - /** - * The amount of fees charged on the transaction. The value is in ADA. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - swap_fees?: number, + constructor(public event_properties: RestoreWalletEnterPhraseStepStatusProperties) { + this.event_properties = event_properties; + } +} - /** - * The amount of asset that the user is swapping to - */ - to_amount: string, +export class RestoreWalletEnterPhraseStepViewed implements BaseEvent { + event_type = 'Restore Wallet Enter Phrase Step Viewed'; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - */ - to_asset: any[], -|}; -declare export class AllWalletsPageViewed mixins BaseEvent { - event_type: string; + constructor(public event_properties: RestoreWalletEnterPhraseStepViewedProperties) { + this.event_properties = event_properties; + } +} + +export class RestoreWalletTypeStepViewed implements BaseEvent { + event_type = 'Restore Wallet Type Step Viewed'; +} + +export class SellAdaInputAmount implements BaseEvent { + event_type = 'Sell Ada Input Amount'; } -declare export class AssetsPageViewed mixins BaseEvent { - event_type: string; + +export class SellAdaSuccessRedirect implements BaseEvent { + event_type = 'Sell Ada Success Redirect'; } -declare export class ClaimAdaPageViewed mixins BaseEvent { - event_type: string; + +export class SendInitiated implements BaseEvent { + event_type = 'Send Initiated'; } -declare export class ConnectorPageViewed mixins BaseEvent { - event_type: string; + +export class SendSelectAssetPageViewed implements BaseEvent { + event_type = 'Send Select Asset Page Viewed'; } -declare export class CreateWalletDetailsSettled mixins BaseEvent { - event_type: string; + +export class SendSelectAssetSelected implements BaseEvent { + event_type = 'Send Select Asset Selected'; + + constructor(public event_properties: SendSelectAssetSelectedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletDetailsStepViewed mixins BaseEvent { - event_type: string; + +export class SendSelectAssetUpdated implements BaseEvent { + event_type = 'Send Select Asset Updated'; + + constructor(public event_properties: SendSelectAssetUpdatedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletDetailsSubmitted mixins BaseEvent { - event_type: string; + +export class SendSummaryPageViewed implements BaseEvent { + event_type = 'Send Summary Page Viewed'; + + constructor(public event_properties: SendSummaryPageViewedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletLanguagePageViewed mixins BaseEvent { - event_type: string; + +export class SendSummarySubmitted implements BaseEvent { + event_type = 'Send Summary Submitted'; + + constructor(public event_properties: SendSummarySubmittedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletLearnPhraseStepViewed mixins BaseEvent { - event_type: string; + +export class SettingsPageViewed implements BaseEvent { + event_type = 'Settings Page Viewed'; } -declare export class CreateWalletSavePhraseStepViewed mixins BaseEvent { - event_type: string; + +export class StakingCenterDelegationInitiated implements BaseEvent { + event_type = 'Staking Center Delegation Initiated'; } -declare export class CreateWalletSelectMethodPageViewed mixins BaseEvent { - event_type: string; + +export class StakingCenterPageViewed implements BaseEvent { + event_type = 'Staking Center Page Viewed'; } -declare export class CreateWalletTermsPageViewed mixins BaseEvent { - event_type: string; + +export class SwapAssetFromChanged implements BaseEvent { + event_type = 'Swap Asset From Changed'; + + constructor(public event_properties: SwapAssetFromChangedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletVerifyPhraseStepViewed mixins BaseEvent { - event_type: string; + +export class SwapAssetToChanged implements BaseEvent { + event_type = 'Swap Asset To Changed'; + + constructor(public event_properties: SwapAssetToChangedProperties) { + this.event_properties = event_properties; + } } -declare export class CreateWalletVerifyPhraseWordSelected mixins BaseEvent { - event_properties?: CreateWalletVerifyPhraseWordSelectedProperties; - event_type: string; - constructor( - event_properties?: CreateWalletVerifyPhraseWordSelectedProperties - ): this; -} -declare export class DappPopupAddCollateralPageViewed mixins BaseEvent { - event_type: string; -} -declare export class DappPopupConnectWalletPageViewed mixins BaseEvent { - event_properties: DappPopupConnectWalletPageViewedProperties; - event_type: string; - constructor( - event_properties: DappPopupConnectWalletPageViewedProperties - ): this; + +export class SwapCancelationSubmitted implements BaseEvent { + event_type = 'Swap Cancelation Submitted'; + + constructor(public event_properties: SwapCancelationSubmittedProperties) { + this.event_properties = event_properties; + } } -declare export class DappPopupConnectWalletPasswordPageViewed mixins BaseEvent { - event_type: string; + +export class SwapConfirmedPageViewed implements BaseEvent { + event_type = 'Swap Confirmed Page Viewed'; + + constructor(public event_properties: SwapConfirmedPageViewedProperties) { + this.event_properties = event_properties; + } } -declare export class DappPopupSignTransactionPageViewed mixins BaseEvent { - event_type: string; + +export class SwapInitiated implements BaseEvent { + event_type = 'Swap Initiated'; + + constructor(public event_properties: SwapInitiatedProperties) { + this.event_properties = event_properties; + } } -declare export class DappPopupSignTransactionSubmitted mixins BaseEvent { - event_type: string; + +export class SwapOrderSelected implements BaseEvent { + event_type = 'Swap Order Selected'; + + constructor(public event_properties: SwapOrderSelectedProperties) { + this.event_properties = event_properties; + } } -declare export class GovernanceChooseDrepPageViewed mixins BaseEvent { - event_type: string; + +export class SwapOrderSubmitted implements BaseEvent { + event_type = 'Swap Order Submitted'; + + constructor(public event_properties: SwapOrderSubmittedProperties) { + this.event_properties = event_properties; + } } -declare export class GovernanceConfirmTransactionPageViewed mixins BaseEvent { - event_properties: GovernanceConfirmTransactionPageViewedProperties; - event_type: string; - constructor( - event_properties: GovernanceConfirmTransactionPageViewedProperties - ): this; + +export class SwapPoolChanged implements BaseEvent { + event_type = 'Swap Pool Changed'; } -declare export class GovernanceDashboardPageViewed mixins BaseEvent { - event_type: string; + +export class SwapSlippageChanged implements BaseEvent { + event_type = 'Swap Slippage Changed'; + + constructor(public event_properties: SwapSlippageChangedProperties) { + this.event_properties = event_properties; + } } -declare export class GovernanceTransactionSuccessPageViewed mixins BaseEvent { - event_properties: GovernanceTransactionSuccessPageViewedProperties; - event_type: string; - constructor( - event_properties: GovernanceTransactionSuccessPageViewedProperties - ): this; -} -declare export class NetworkSelected mixins BaseEvent { - event_properties: NetworkSelectedProperties; - event_type: string; - constructor(event_properties: NetworkSelectedProperties): this; -} -declare export class NftGalleryDetailsImageViewed mixins BaseEvent { - event_type: string; -} -declare export class NftGalleryDetailsNavigation mixins BaseEvent { - event_properties: NftGalleryDetailsNavigationProperties; - event_type: string; - constructor(event_properties: NftGalleryDetailsNavigationProperties): this; -} -declare export class NftGalleryDetailsPageViewed mixins BaseEvent { - event_type: string; -} -declare export class NftGalleryDetailsTab mixins BaseEvent { - event_properties: NftGalleryDetailsTabProperties; - event_type: string; - constructor(event_properties: NftGalleryDetailsTabProperties): this; -} -declare export class NftGalleryGridViewSelected mixins BaseEvent { - event_properties?: NftGalleryGridViewSelectedProperties; - event_type: string; - constructor(event_properties?: NftGalleryGridViewSelectedProperties): this; -} -declare export class NftGalleryPageViewed mixins BaseEvent { - event_properties: NftGalleryPageViewedProperties; - event_type: string; - constructor(event_properties: NftGalleryPageViewedProperties): this; -} -declare export class NftGallerySearchActivated mixins BaseEvent { - event_properties: NftGallerySearchActivatedProperties; - event_type: string; - constructor(event_properties: NftGallerySearchActivatedProperties): this; -} -declare export class PortfolioTokenDetails mixins BaseEvent { - event_properties: PortfolioTokenDetailsProperties; - event_type: string; - constructor(event_properties: PortfolioTokenDetailsProperties): this; -} -declare export class PortfolioTokensListPageViewed mixins BaseEvent { - event_properties: PortfolioTokensListPageViewedProperties; - event_type: string; - constructor(event_properties: PortfolioTokensListPageViewedProperties): this; -} -declare export class PortfolioTokensListSearchActivated mixins BaseEvent { - event_properties: PortfolioTokensListSearchActivatedProperties; - event_type: string; - constructor( - event_properties: PortfolioTokensListSearchActivatedProperties - ): this; -} -declare export class ReceiveAmountGeneratedPageViewed mixins BaseEvent { - event_properties: ReceiveAmountGeneratedPageViewedProperties; - event_type: string; - constructor( - event_properties: ReceiveAmountGeneratedPageViewedProperties - ): this; -} -declare export class ReceiveAmountPageViewed mixins BaseEvent { - event_type: string; -} -declare export class ReceiveCopyAddressClicked mixins BaseEvent { - event_properties: ReceiveCopyAddressClickedProperties; - event_type: string; - constructor(event_properties: ReceiveCopyAddressClickedProperties): this; -} -declare export class ReceiveGenerateNewAddressClicked mixins BaseEvent { - event_type: string; -} -declare export class ReceivePageListViewed mixins BaseEvent { - event_type: string; -} -declare export class ReceivePageViewed mixins BaseEvent { - event_type: string; -} -declare export class ReceiveShareAddressClicked mixins BaseEvent { - event_type: string; -} -declare export class RestoreWalletDetailsSettled mixins BaseEvent { - event_type: string; -} -declare export class RestoreWalletDetailsStepViewed mixins BaseEvent { - event_type: string; -} -declare export class RestoreWalletEnterPhraseStepStatus mixins BaseEvent { - event_properties: RestoreWalletEnterPhraseStepStatusProperties; - event_type: string; - constructor( - event_properties: RestoreWalletEnterPhraseStepStatusProperties - ): this; -} -declare export class RestoreWalletEnterPhraseStepViewed mixins BaseEvent { - event_properties: RestoreWalletEnterPhraseStepViewedProperties; - event_type: string; - constructor( - event_properties: RestoreWalletEnterPhraseStepViewedProperties - ): this; -} -declare export class RestoreWalletTypeStepViewed mixins BaseEvent { - event_type: string; -} -declare export class SendInitiated mixins BaseEvent { - event_type: string; -} -declare export class SendSelectAssetPageViewed mixins BaseEvent { - event_type: string; -} -declare export class SendSelectAssetSelected mixins BaseEvent { - event_properties: SendSelectAssetSelectedProperties; - event_type: string; - constructor(event_properties: SendSelectAssetSelectedProperties): this; -} -declare export class SendSelectAssetUpdated mixins BaseEvent { - event_properties: SendSelectAssetUpdatedProperties; - event_type: string; - constructor(event_properties: SendSelectAssetUpdatedProperties): this; -} -declare export class SendSummaryPageViewed mixins BaseEvent { - event_properties: SendSummaryPageViewedProperties; - event_type: string; - constructor(event_properties: SendSummaryPageViewedProperties): this; -} -declare export class SendSummarySubmitted mixins BaseEvent { - event_properties: SendSummarySubmittedProperties; - event_type: string; - constructor(event_properties: SendSummarySubmittedProperties): this; -} -declare export class SettingsPageViewed mixins BaseEvent { - event_type: string; -} -declare export class StakingCenterPageViewed mixins BaseEvent { - event_type: string; -} -declare export class SwapAssetFromChanged mixins BaseEvent { - event_properties: SwapAssetFromChangedProperties; - event_type: string; - constructor(event_properties: SwapAssetFromChangedProperties): this; -} -declare export class SwapAssetToChanged mixins BaseEvent { - event_properties: SwapAssetToChangedProperties; - event_type: string; - constructor(event_properties: SwapAssetToChangedProperties): this; -} -declare export class SwapCancelationSubmitted mixins BaseEvent { - event_properties: SwapCancelationSubmittedProperties; - event_type: string; - constructor(event_properties: SwapCancelationSubmittedProperties): this; -} -declare export class SwapConfirmedPageViewed mixins BaseEvent { - event_properties: SwapConfirmedPageViewedProperties; - event_type: string; - constructor(event_properties: SwapConfirmedPageViewedProperties): this; -} -declare export class SwapInitiated mixins BaseEvent { - event_properties: SwapInitiatedProperties; - event_type: string; - constructor(event_properties: SwapInitiatedProperties): this; + +export class ThemeSelected implements BaseEvent { + event_type = 'Theme Selected'; + + constructor(public event_properties: ThemeSelectedProperties) { + this.event_properties = event_properties; + } } -declare export class SwapOrderSelected mixins BaseEvent { - event_properties: SwapOrderSelectedProperties; - event_type: string; - constructor(event_properties: SwapOrderSelectedProperties): this; + +export class TransactionsPageViewed implements BaseEvent { + event_type = 'Transactions Page Viewed'; } -declare export class SwapOrderSubmitted mixins BaseEvent { - event_properties: SwapOrderSubmittedProperties; - event_type: string; - constructor(event_properties: SwapOrderSubmittedProperties): this; + +export class VotingPageViewed implements BaseEvent { + event_type = 'Voting Page Viewed'; } -declare export class SwapPoolChanged mixins BaseEvent { - event_type: string; + +export class WalletPageViewed implements BaseEvent { + event_type = 'Wallet Page Viewed'; } -declare export class SwapSlippageChanged mixins BaseEvent { - event_properties: SwapSlippageChangedProperties; - event_type: string; - constructor(event_properties: SwapSlippageChangedProperties): this; -} -declare export class TransactionsPageViewed mixins BaseEvent { - event_type: string; -} -declare export class VotingPageViewed mixins BaseEvent { - event_type: string; -} -declare export class WalletPageViewed mixins BaseEvent { - event_type: string; -} -export type PromiseResult = {| - promise: Promise, -|}; -declare export class Ampli { - client: BrowserClient; - isLoaded: boolean; + +export type PromiseResult = { promise: Promise }; + +const getVoidPromiseResult = () => ({ promise: Promise.resolve() }); + +// prettier-ignore +export class Ampli { + private disabled: boolean = false; + private amplitude?: BrowserClient; + + get client(): BrowserClient { + this.isInitializedAndEnabled(); + return this.amplitude!; + } + + get isLoaded(): boolean { + return this.amplitude != null; + } + + private isInitializedAndEnabled(): boolean { + if (!this.amplitude) { + console.error('ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?'); + return false; + } + return !this.disabled; + } /** * Initialize the Ampli SDK. Call once when your application starts. + * * @param options Configuration options to initialize the Ampli SDK with. */ - load(options: LoadOptions): PromiseResult; + load(options: LoadOptions): PromiseResult { + this.disabled = options.disabled ?? false; + + if (this.amplitude) { + console.warn('WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup.'); + return getVoidPromiseResult(); + } + + let apiKey: string | null = null; + if (options.client && 'apiKey' in options.client) { + apiKey = options.client.apiKey; + } else if ('environment' in options) { + apiKey = ApiKey[options.environment]; + } + + if (options.client && 'instance' in options.client) { + this.amplitude = options.client.instance; + } else if (apiKey) { + this.amplitude = amplitude.createInstance(); + const configuration = (options.client && 'configuration' in options.client) ? options.client.configuration : {}; + return this.amplitude.init(apiKey, undefined, { ...DefaultConfiguration, ...configuration }); + } else { + console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'"); + } + + return getVoidPromiseResult(); + } /** * Identify a user and set user properties. + * * @param userId The user's id. * @param options Optional event options. */ identify( - userId: string | void, - options?: EventOptions - ): PromiseResult; - - /** - * Flush the event. - */ - flush(): PromiseResult; + userId: string | undefined, + options?: EventOptions, + ): PromiseResult { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + + if (userId) { + options = {...options, user_id: userId}; + } + + const amplitudeIdentify = new amplitude.Identify(); + return this.amplitude!.identify( + amplitudeIdentify, + options, + ); + } + + /** + * Flush the event. + */ + flush() : PromiseResult { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + + return this.amplitude!.flush(); + } /** * Track event + * * @param event The event to track. * @param options Optional event options. */ - track(event: Event, options?: EventOptions): PromiseResult; + track(event: Event, options?: EventOptions): PromiseResult { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + + return this.amplitude!.track(event, undefined, options); + } + + /** + * (to delete)Governance Abstain Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/(to%20delete)Governance%20Abstain%20Page%20Viewed) + * + * This event tracks when a user selects abstain governance status and the confirm transaction page is displayed + * + * @param options Amplitude event options. + */ + toDeleteGovernanceAbstainPageViewed( + options?: EventOptions, + ) { + return this.track(new ToDeleteGovernanceAbstainPageViewed(), options); + } /** * All Wallets Page Viewed @@ -1068,24 +1430,60 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/All%20Wallets%20Page%20Viewed) * * This event tracks when a user views the All Wallets page on Menu. Note: only available on Yoroi Mobile. + * * @param options Amplitude event options. */ allWalletsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new AllWalletsPageViewed(), options); + } /** * Assets Page Viewed * * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Assets%20Page%20Viewed) * - * This event tracks when a user views the Assets page. + * This event tracks when a user views the Assets page. * On mobile is available on the wallet page (First item from main menu) in the assets tab. + * * @param options Amplitude event options. */ assetsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new AssetsPageViewed(), options); + } + + /** + * Buy Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Input%20Amount) + * + * Event to track when a user starts the buy flow and must input amount of ADA to buy + * + * @param options Amplitude event options. + */ + buyAdaInputAmount( + options?: EventOptions, + ) { + return this.track(new BuyAdaInputAmount(), options); + } + + /** + * Buy Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully buying ADA + * + * @param options Amplitude event options. + */ + buyAdaSuccessRedirect( + options?: EventOptions, + ) { + return this.track(new BuyAdaSuccessRedirect(), options); + } /** * Claim ADA Page Viewed @@ -1095,11 +1493,110 @@ declare export class Ampli { * This event tracks when a user views the page to claim Claim /Transfer ADA page in Extension. * * You can find that page under Staking section. + * * @param options Amplitude event options. */ claimAdaPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ClaimAdaPageViewed(), options); + } + + /** + * Claim Ada Transaction Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Settled) + * + * Event to track when a user successfully claims ADA and transaction is settled on chain + * + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + claimAdaTransactionSettled( + properties: ClaimAdaTransactionSettledProperties, + options?: EventOptions, + ) { + return this.track(new ClaimAdaTransactionSettled(properties), options); + } + + /** + * Claim Ada Transaction Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Submitted) + * + * This Event to track when a user submits a transaction to claim ADA. + * + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + claimAdaTransactionSubmitted( + properties: ClaimAdaTransactionSubmittedProperties, + options?: EventOptions, + ) { + return this.track(new ClaimAdaTransactionSubmitted(properties), options); + } + + /** + * Connect Wallet Check Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Check%20Page%20Viewed) + * + * This event tracks when user chooses the connect hardware wallet option. This is the 1st step of the connect hardware wallet flow. In this page, the information about connecting a harware wallet is displayed to the user. + * + * @param options Amplitude event options. + */ + connectWalletCheckPageViewed( + options?: EventOptions, + ) { + return this.track(new ConnectWalletCheckPageViewed(), options); + } + + /** + * Connect Wallet Connect Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Connect%20Page%20Viewed) + * + * This event tracks when user connects the device and instructions are displayed. This is the 2nd step of the flow. + * + * @param options Amplitude event options. + */ + connectWalletConnectPageViewed( + options?: EventOptions, + ) { + return this.track(new ConnectWalletConnectPageViewed(), options); + } + + /** + * Connect Wallet Details Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Page%20Viewed) + * + * This event tracks when user accesses the enter wallet name page. This is the 3rd and final step of the flow + * + * @param options Amplitude event options. + */ + connectWalletDetailsPageViewed( + options?: EventOptions, + ) { + return this.track(new ConnectWalletDetailsPageViewed(), options); + } + + /** + * Connect Wallet Details Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Submitted) + * + * This event captures the submission of the wallet name on the last step of the connecting a hardware wallet flow. + * + * @param properties The event's properties (e.g. hardware_wallet) + * @param options Amplitude event options. + */ + connectWalletDetailsSubmitted( + properties: ConnectWalletDetailsSubmittedProperties, + options?: EventOptions, + ) { + return this.track(new ConnectWalletDetailsSubmitted(properties), options); + } /** * Connector Page Viewed @@ -1107,11 +1604,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connector%20Page%20Viewed) * * This event tracks when a user views the dApp Connector page. + * * @param options Amplitude event options. */ connectorPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ConnectorPageViewed(), options); + } /** * Create Wallet Details Settled @@ -1119,11 +1619,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Settled) * * When the wallet is created correctly. This event signifies the completion of the process of setting up wallet details during the creation of a new wallet + * * @param options Amplitude event options. */ createWalletDetailsSettled( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletDetailsSettled(), options); + } /** * Create Wallet Details Step Viewed @@ -1131,11 +1634,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Step%20Viewed) * * This event tracks when a user views the details \*\*step 4\*\* while creating a wallet. User will introduce: \* Wallet Name \* Password \* Repeat Password + * * @param options Amplitude event options. */ createWalletDetailsStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletDetailsStepViewed(), options); + } /** * Create Wallet Details Submitted @@ -1143,11 +1649,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Submitted) * * This event captures the submission of the wallet creation on the last step of the flow (\*\*step 4\*\*). + * * @param options Amplitude event options. */ createWalletDetailsSubmitted( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletDetailsSubmitted(), options); + } /** * Create Wallet Language Page Viewed @@ -1155,11 +1664,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Language%20Page%20Viewed) * * This event tracks when a user views the page for selecting the language during the wallet creation process on the first time he launch Yoroi. + * * @param options Amplitude event options. */ createWalletLanguagePageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletLanguagePageViewed(), options); + } /** * Create Wallet Learn Phrase Step Viewed @@ -1167,11 +1679,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Learn%20Phrase%20Step%20Viewed) * * This event tracks when a user view the \*\*first step\*\* of learn about recovery prhase + * * @param options Amplitude event options. */ createWalletLearnPhraseStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletLearnPhraseStepViewed(), options); + } /** * Create Wallet Save Phrase Step Viewed @@ -1179,29 +1694,35 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Save%20Phrase%20Step%20Viewed) * * This event tracks when a user views the \*\*second step\*\* to save their wallet recovery phrase during the wallet creation process + * * @param options Amplitude event options. */ createWalletSavePhraseStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletSavePhraseStepViewed(), options); + } /** * Create Wallet Select Method Page Viewed * * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Select%20Method%20Page%20Viewed) * - * This event tracks when a user views the page where they can select the method to create a wallet: + * This event tracks when a user views the page where they can select the method to create a wallet: * - * \* Create new wallet + * \* Create new wallet * - * \* Restore existing wallet + * \* Restore existing wallet * * This event tracks when a user views the page where they can select the method to create a wallet\* Connect hardware wallet + * * @param options Amplitude event options. */ createWalletSelectMethodPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletSelectMethodPageViewed(), options); + } /** * Create Wallet Terms Page Viewed @@ -1209,11 +1730,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Terms%20Page%20Viewed) * * This event tracks when a user views the terms of service agreement page on the creation wallet flow + * * @param options Amplitude event options. */ createWalletTermsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletTermsPageViewed(), options); + } /** * Create Wallet Verify Phrase Step Viewed @@ -1221,11 +1745,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Step%20Viewed) * * This event tracks when a user views the verification phrase step while creating a wallet + * * @param options Amplitude event options. */ createWalletVerifyPhraseStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletVerifyPhraseStepViewed(), options); + } /** * Create Wallet Verify Phrase Word Selected @@ -1233,13 +1760,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Word%20Selected) * * This event tracks the selection of a specific word during the process of verifying the recovery phrase when creating a wallet + * * @param properties The event's properties (e.g. recovery_word_order) * @param options Amplitude event options. */ createWalletVerifyPhraseWordSelected( properties?: CreateWalletVerifyPhraseWordSelectedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new CreateWalletVerifyPhraseWordSelected(properties), options); + } /** * Dapp Popup Add Collateral Page Viewed @@ -1247,11 +1777,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Add%20Collateral%20Page%20Viewed) * * This event tracks when a user views the "Add Collateral" page in the Dapp Connector Popup + * * @param options Amplitude event options. */ dappPopupAddCollateralPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new DappPopupAddCollateralPageViewed(), options); + } /** * Dapp Popup Connect Wallet Page Viewed @@ -1259,13 +1792,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Page%20Viewed) * * This event is triggered when the dapp connector popup is triggered and the user select the wallet that wants to connect. + * * @param properties The event's properties (e.g. wallet_count) * @param options Amplitude event options. */ dappPopupConnectWalletPageViewed( properties: DappPopupConnectWalletPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new DappPopupConnectWalletPageViewed(properties), options); + } /** * Dapp Popup Connect Wallet Password Page Viewed @@ -1273,11 +1809,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Password%20Page%20Viewed) * * This event tracks when a user attempts to connect their wallet by entering their password in the Dapp Connector popup + * * @param options Amplitude event options. */ dappPopupConnectWalletPasswordPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new DappPopupConnectWalletPasswordPageViewed(), options); + } /** * Dapp Popup Sign Transaction Page Viewed @@ -1285,11 +1824,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Page%20Viewed) * * This event tracks when a user loads a sign transaction screen on the dapp connector. Valid for extension and mobile. + * * @param options Amplitude event options. */ dappPopupSignTransactionPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new DappPopupSignTransactionPageViewed(), options); + } /** * Dapp Popup Sign Transaction Submitted @@ -1297,11 +1839,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Submitted) * * This event tracks the submission of a sign transaction request within the Dapp Connector screen. It's a Popup on extension and a full screen in Mobile. + * * @param options Amplitude event options. */ dappPopupSignTransactionSubmitted( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new DappPopupSignTransactionSubmitted(), options); + } /** * Governance Choose Drep Page Viewed @@ -1309,11 +1854,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Choose%20Drep%20Page%20Viewed) * * This event tracks when user loads the bottom sheet on mobile or the popup on extension to introduce the Drep ID. To arrive to this page the user has to click on “Delegate to a Drep” section. + * * @param options Amplitude event options. */ governanceChooseDrepPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new GovernanceChooseDrepPageViewed(), options); + } /** * Governance Confirm Transaction Page Viewed @@ -1321,13 +1869,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Confirm%20Transaction%20Page%20Viewed) * * This event tracks when a user loads the confirm transaction page on the Governance flow. On Extension user would insert the password in that page. On extension user would do it in a bottom sheet afterwards. + * * @param properties The event's properties (e.g. governance_selection) * @param options Amplitude event options. */ governanceConfirmTransactionPageViewed( properties: GovernanceConfirmTransactionPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new GovernanceConfirmTransactionPageViewed(properties), options); + } /** * Governance Dashboard Page Viewed @@ -1335,11 +1886,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Dashboard%20Page%20Viewed) * * This event tracks when a user loads the Governance Dashboard Page. The page is reached via the main navigation menu in extension and in the bottom menu icon on Extension. + * * @param options Amplitude event options. */ governanceDashboardPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new GovernanceDashboardPageViewed(), options); + } /** * Governance Transaction Success Page Viewed @@ -1347,13 +1901,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Transaction%20Success%20Page%20Viewed) * * This event tracks when a user loads the success page at the end of the governance flow. + * * @param properties The event's properties (e.g. governance_selection) * @param options Amplitude event options. */ governanceTransactionSuccessPageViewed( properties: GovernanceTransactionSuccessPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new GovernanceTransactionSuccessPageViewed(properties), options); + } /** * Network Selected @@ -1361,13 +1918,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Network%20Selected) * * Event to track when a user selects a network + * * @param properties The event's properties (e.g. from_network) * @param options Amplitude event options. */ networkSelected( properties: NetworkSelectedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NetworkSelected(properties), options); + } /** * NFT Gallery Details Image Viewed @@ -1375,11 +1935,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Image%20Viewed) * * This event tracks when a user views the NFT image at full screen + * * @param options Amplitude event options. */ nftGalleryDetailsImageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryDetailsImageViewed(), options); + } /** * NFT Gallery Details Navigation @@ -1387,13 +1950,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Navigation) * * This event tracks when a use next and previous buttons to navigate across their NFTs. Note: available only on Extension. + * * @param properties The event's properties (e.g. nft_navigation) * @param options Amplitude event options. */ nftGalleryDetailsNavigation( properties: NftGalleryDetailsNavigationProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryDetailsNavigation(properties), options); + } /** * NFT Gallery Details Page Viewed @@ -1401,11 +1967,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Page%20Viewed) * * This event tracks when a user views the details page of an NFT item. + * * @param options Amplitude event options. */ nftGalleryDetailsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryDetailsPageViewed(), options); + } /** * NFT Gallery Details Tab @@ -1413,13 +1982,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Tab) * * This event tracks user interactions with the tab in the NFT Gallery details page. It provides insights into how users engage with specific details of NFTs, such as descriptions, attributes, or additional information + * * @param properties The event's properties (e.g. nft_tab) * @param options Amplitude event options. */ nftGalleryDetailsTab( properties: NftGalleryDetailsTabProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryDetailsTab(properties), options); + } /** * NFT Gallery Grid View Selected @@ -1427,13 +1999,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Grid%20View%20Selected) * * This event is triggered when a user selects the grid view option in the NFT gallery + * * @param properties The event's properties (e.g. nft_grid_view) * @param options Amplitude event options. */ nftGalleryGridViewSelected( properties?: NftGalleryGridViewSelectedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryGridViewSelected(properties), options); + } /** * NFT Gallery Page Viewed @@ -1441,13 +2016,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Page%20Viewed) * * This event tracks when the NFT gallery it has loaded all nfts metadata + * * @param properties The event's properties (e.g. nft_count) * @param options Amplitude event options. */ nftGalleryPageViewed( properties: NftGalleryPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGalleryPageViewed(properties), options); + } /** * NFT Gallery Search Activated @@ -1455,13 +2033,31 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Search%20Activated) * * User activates and starts a search in the NFT gallery. Delay of 0.5 seconds. + * * @param properties The event's properties (e.g. nft_count) * @param options Amplitude event options. */ nftGallerySearchActivated( properties: NftGallerySearchActivatedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new NftGallerySearchActivated(properties), options); + } + + /** + * Onboarding Analytics Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Onboarding%20Analytics%20Page%20Viewed) + * + * Event to track when a user views the onboarding analytics page. + * + * @param options Amplitude event options. + */ + onboardingAnalyticsPageViewed( + options?: EventOptions, + ) { + return this.track(new OnboardingAnalyticsPageViewed(), options); + } /** * Portfolio Token Details @@ -1469,13 +2065,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Token%20Details) * * When user visit the detailed information about a specific token within a user's portfolio. In mobile there's 3 tabs that would be implemented in different iterations. + * * @param properties The event's properties (e.g. token_details_tab) * @param options Amplitude event options. */ portfolioTokenDetails( properties: PortfolioTokenDetailsProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new PortfolioTokenDetails(properties), options); + } /** * Portfolio Tokens List Page Viewed @@ -1483,13 +2082,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Page%20Viewed) * * Event to track when a user views the list of tokens in their portfolio. + * * @param properties The event's properties (e.g. tokens_tab) * @param options Amplitude event options. */ portfolioTokensListPageViewed( properties: PortfolioTokensListPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new PortfolioTokensListPageViewed(properties), options); + } /** * Portfolio Tokens List Search Activated @@ -1497,13 +2099,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Search%20Activated) * * This event tracks when a user activates and starts a search in the Tokens list page. Delay of 0.5 seconds. + * * @param properties The event's properties (e.g. search_term) * @param options Amplitude event options. */ portfolioTokensListSearchActivated( properties: PortfolioTokensListSearchActivatedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new PortfolioTokensListSearchActivated(properties), options); + } /** * Receive Amount Generated Page Viewed @@ -1511,13 +2116,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Generated%20Page%20Viewed) * * When the bottom sheet or popup with a generated address with an specific amount is loaded + * * @param properties The event's properties (e.g. ada_amount) * @param options Amplitude event options. */ receiveAmountGeneratedPageViewed( properties: ReceiveAmountGeneratedPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceiveAmountGeneratedPageViewed(properties), options); + } /** * Receive Amount Page Viewed @@ -1525,11 +2133,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Page%20Viewed) * * When a user visit the page to insert specific amount of ADA that would be needed to generate a wallet address with that specific details. + * * @param options Amplitude event options. */ receiveAmountPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceiveAmountPageViewed(), options); + } /** * Receive Copy Address Clicked @@ -1537,13 +2148,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Copy%20Address%20Clicked) * * When a user click on the any CTA to copy their address + * * @param properties The event's properties (e.g. copy_address_location) * @param options Amplitude event options. */ receiveCopyAddressClicked( properties: ReceiveCopyAddressClickedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceiveCopyAddressClicked(properties), options); + } /** * Receive Generate New Address Clicked @@ -1551,11 +2165,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Generate%20New%20Address%20Clicked) * * When a user click on the Generate new address button on the main receive page on the multiple address flow. + * * @param options Amplitude event options. */ receiveGenerateNewAddressClicked( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceiveGenerateNewAddressClicked(), options); + } /** * Receive Page List Viewed @@ -1563,11 +2180,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20List%20Viewed) * * When user has enabled multiple addresses and goes to the page where he can see the list of generated wallet addresses + * * @param options Amplitude event options. */ receivePageListViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceivePageListViewed(), options); + } /** * Receive Page Viewed @@ -1575,11 +2195,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20Viewed) * * When user loads the Receive funds screen, where user can see their wallet address with a QR Code + * * @param options Amplitude event options. */ receivePageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceivePageViewed(), options); + } /** * Receive Share Address Clicked @@ -1587,11 +2210,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Share%20Address%20Clicked) * * When a user click on the link to share the address + * * @param options Amplitude event options. */ receiveShareAddressClicked( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new ReceiveShareAddressClicked(), options); + } /** * Restore Wallet Details Settled @@ -1599,11 +2225,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Settled) * * This event captures the details of a wallet restoration process that has been successfully completed + * * @param options Amplitude event options. */ restoreWalletDetailsSettled( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new RestoreWalletDetailsSettled(), options); + } /** * Restore Wallet Details Step Viewed @@ -1611,11 +2240,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Step%20Viewed) * * Track when user loads the page where user inserts wallet name and password + * * @param options Amplitude event options. */ restoreWalletDetailsStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new RestoreWalletDetailsStepViewed(), options); + } /** * Restore Wallet Enter Phrase Step Status @@ -1623,13 +2255,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Status) * * This events tracks the validation of the recovery phrase is verified, once the user insert the latest word. The output can be positive or negative and we do save that in he property: recovery*prhase*status + * * @param properties The event's properties (e.g. recovery_prhase_status) * @param options Amplitude event options. */ restoreWalletEnterPhraseStepStatus( properties: RestoreWalletEnterPhraseStepStatusProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new RestoreWalletEnterPhraseStepStatus(properties), options); + } /** * Restore Wallet Enter Phrase Step Viewed @@ -1637,13 +2272,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Viewed) * * This event tracks when a user views the step to enter the recovery phrase while restoring a wallet (**Step 2**). + * * @param properties The event's properties (e.g. recovery_phrase_lenght) * @param options Amplitude event options. */ restoreWalletEnterPhraseStepViewed( properties: RestoreWalletEnterPhraseStepViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new RestoreWalletEnterPhraseStepViewed(properties), options); + } /** * Restore Wallet Type Step Viewed @@ -1655,11 +2293,44 @@ declare export class Ampli { * * 15-word recovery phrase * * * 24-word recovery phrase + * * @param options Amplitude event options. */ restoreWalletTypeStepViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new RestoreWalletTypeStepViewed(), options); + } + + /** + * Sell Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Input%20Amount) + * + * Event to track when user starts the Sell ada flow so after selecting the sell option and having to input amount of ADA to sell + * + * @param options Amplitude event options. + */ + sellAdaInputAmount( + options?: EventOptions, + ) { + return this.track(new SellAdaInputAmount(), options); + } + + /** + * Sell Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully selling ADA + * + * @param options Amplitude event options. + */ + sellAdaSuccessRedirect( + options?: EventOptions, + ) { + return this.track(new SellAdaSuccessRedirect(), options); + } /** * Send Initiated @@ -1667,9 +2338,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Initiated) * * This event tracks when a user loads the default state of the first step of the multiasset transaction flow. That screen shows receiver address and optional memo + * * @param options Amplitude event options. */ - sendInitiated(options?: EventOptions): PromiseResult; + sendInitiated( + options?: EventOptions, + ) { + return this.track(new SendInitiated(), options); + } /** * Send Select Asset Page Viewed @@ -1677,11 +2353,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Page%20Viewed) * * This event tracks when a user views the "Amount" page in the send flow. + * * @param options Amplitude event options. */ sendSelectAssetPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SendSelectAssetPageViewed(), options); + } /** * Send Select Asset Selected @@ -1689,30 +2368,36 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Selected) * * When a user click "next" on the send flow: "Amount" step on extension / "Assets added" in mobile + * * @param properties The event's properties (e.g. asset_count) * @param options Amplitude event options. */ sendSelectAssetSelected( properties: SendSelectAssetSelectedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SendSelectAssetSelected(properties), options); + } /** * Send Select Asset Updated * * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Updated) * - * When an user update the tokens selection on "amount" step: - * \- Add - * \- Remove + * When an user update the tokens selection on "amount" step: + * \- Add + * \- Remove * \- Updated + * * @param properties The event's properties (e.g. asset_count) * @param options Amplitude event options. */ sendSelectAssetUpdated( properties: SendSelectAssetUpdatedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SendSelectAssetUpdated(properties), options); + } /** * Send Summary Page Viewed @@ -1720,13 +2405,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Page%20Viewed) * * When a user loads the Preview page (Could be called comfirmation too) on the send flow. + * * @param properties The event's properties (e.g. asset_count) * @param options Amplitude event options. */ sendSummaryPageViewed( properties: SendSummaryPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SendSummaryPageViewed(properties), options); + } /** * Send Summary Submitted @@ -1734,13 +2422,16 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Submitted) * * When a user click "send" on the "Preview" step on the send flow. - * @param properties The event's properties (e.g. asset_count) + * + * @param properties The event's properties (e.g. ada_amount) * @param options Amplitude event options. */ sendSummarySubmitted( properties: SendSummarySubmittedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SendSummarySubmitted(properties), options); + } /** * Settings Page Viewed @@ -1748,11 +2439,29 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Settings%20Page%20Viewed) * * This event tracks when a user views the settings page within the application. + * * @param options Amplitude event options. */ settingsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SettingsPageViewed(), options); + } + + /** + * Staking Center Delegation Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Delegation%20Initiated) + * + * Event to track when a user initiates the delegation process in the Staking Center, accessing the delegate modal after selecting a pool + * + * @param options Amplitude event options. + */ + stakingCenterDelegationInitiated( + options?: EventOptions, + ) { + return this.track(new StakingCenterDelegationInitiated(), options); + } /** * Staking Center Page Viewed @@ -1760,11 +2469,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Page%20Viewed) * * This event tracks when a user views the Staking Center page on Staking menu. + * * @param options Amplitude event options. */ stakingCenterPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new StakingCenterPageViewed(), options); + } /** * Swap Asset From Changed @@ -1774,13 +2486,16 @@ declare export class Ampli { * When user changed the selected asset on "From" section * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. from_asset) * @param options Amplitude event options. */ swapAssetFromChanged( properties: SwapAssetFromChangedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapAssetFromChanged(properties), options); + } /** * Swap Asset To Changed @@ -1790,13 +2505,16 @@ declare export class Ampli { * When user changed the selected asset on "To" section * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. to_asset) * @param options Amplitude event options. */ swapAssetToChanged( properties: SwapAssetToChangedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapAssetToChanged(properties), options); + } /** * Swap Cancelation Submitted @@ -1806,13 +2524,16 @@ declare export class Ampli { * When user sign a transaction to cancel the swap order * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. from_amount) * @param options Amplitude event options. */ swapCancelationSubmitted( properties: SwapCancelationSubmittedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapCancelationSubmitted(properties), options); + } /** * Swap Confirmed Page Viewed @@ -1822,13 +2543,16 @@ declare export class Ampli { * When the user opens Completed Order page * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. swap_tab) * @param options Amplitude event options. */ swapConfirmedPageViewed( properties: SwapConfirmedPageViewedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapConfirmedPageViewed(properties), options); + } /** * Swap Initiated @@ -1838,13 +2562,16 @@ declare export class Ampli { * When user clicks on the swap feature and sees the default state of the swap. * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. from_asset) * @param options Amplitude event options. */ swapInitiated( properties: SwapInitiatedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapInitiated(properties), options); + } /** * Swap Order Selected @@ -1854,13 +2581,16 @@ declare export class Ampli { * When user click on "swap" button after selecting asset from, entering the amount of asset form, selecting asset to, entering amount of asset to, and choosing a pool * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. from_amount) * @param options Amplitude event options. */ swapOrderSelected( properties: SwapOrderSelectedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapOrderSelected(properties), options); + } /** * Swap Order Submitted @@ -1870,13 +2600,16 @@ declare export class Ampli { * When user click confirm on the check out page, after entering their spending password * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. from_amount) * @param options Amplitude event options. */ swapOrderSubmitted( properties: SwapOrderSubmittedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapOrderSubmitted(properties), options); + } /** * Swap Pool Changed @@ -1886,11 +2619,14 @@ declare export class Ampli { * When user clicked a different pool on the "Select Pool" page * * Owner: Sergio SF + * * @param options Amplitude event options. */ swapPoolChanged( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapPoolChanged(), options); + } /** * Swap Slippage Changed @@ -1900,13 +2636,33 @@ declare export class Ampli { * When user click apply on the swap setting page * * Owner: Omar Rozak + * * @param properties The event's properties (e.g. slippage_tolerance) * @param options Amplitude event options. */ swapSlippageChanged( properties: SwapSlippageChangedProperties, - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new SwapSlippageChanged(properties), options); + } + + /** + * Theme Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Theme%20Selected) + * + * This event is triggrered when a user had selected a theme. + * + * @param properties The event's properties (e.g. theme) + * @param options Amplitude event options. + */ + themeSelected( + properties: ThemeSelectedProperties, + options?: EventOptions, + ) { + return this.track(new ThemeSelected(properties), options); + } /** * Transactions Page Viewed @@ -1914,11 +2670,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Transactions%20Page%20Viewed) * * This event tracks when a user views the transactions page within the wallet. On mobile is available on the wallet page (First item from main navigation item) in the transactions tab. + * * @param options Amplitude event options. */ transactionsPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new TransactionsPageViewed(), options); + } /** * Voting Page Viewed @@ -1926,11 +2685,14 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Voting%20Page%20Viewed) * * This event tracks when a user views the Catalyst Voting page. + * * @param options Amplitude event options. */ votingPageViewed( - options?: EventOptions - ): PromiseResult; + options?: EventOptions, + ) { + return this.track(new VotingPageViewed(), options); + } /** * Wallet Page Viewed @@ -1938,17 +2700,25 @@ declare export class Ampli { * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Wallet%20Page%20Viewed) * * Wallet page is the default page when the user logs into the app and selects the wallet that is going to be using (Once the initial setup is done) + * * @param options Amplitude event options. */ walletPageViewed( - options?: EventOptions - ): PromiseResult; -} -declare export var ampli: Ampli; -declare type BrowserOptions = any; -export type BrowserClient = any; -export type IdentifyEvent = any; -export type GroupEvent = any; -export type Event = any; -export type EventOptions = any; -export type Result = any; + options?: EventOptions, + ) { + return this.track(new WalletPageViewed(), options); + } +} + +export const ampli = new Ampli(); + +// BASE TYPES +type BrowserOptions = amplitude.Types.BrowserOptions; + +export type BrowserClient = amplitude.Types.BrowserClient; +export type BaseEvent = amplitude.Types.BaseEvent; +export type IdentifyEvent = amplitude.Types.IdentifyEvent; +export type GroupEvent = amplitude.Types.GroupIdentifyEvent; +export type Event = amplitude.Types.Event; +export type EventOptions = amplitude.Types.EventOptions; +export type Result = amplitude.Types.Result; diff --git a/packages/yoroi-extension/app/UI/features/portfolio/module/PortfolioContextProvider.tsx b/packages/yoroi-extension/app/UI/features/portfolio/module/PortfolioContextProvider.tsx index dbd61d0056..d61f020aa9 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/module/PortfolioContextProvider.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/module/PortfolioContextProvider.tsx @@ -10,6 +10,20 @@ import { defaultPortfolioState, } from './state'; +export const PortfolioDetailsTab = { + Performance: 'Performance', + Overview: 'Overview', + Transactions: 'Transactions', +} as const; +export type PortfolioDetailsTab = typeof PortfolioDetailsTab[keyof typeof PortfolioDetailsTab]; + +export const PortfolioListTab = { + Wallet: 'Wallet', + Dapps: 'Dapps', +} as const; + +export type PortfolioListTab = typeof PortfolioListTab[keyof typeof PortfolioListTab]; + import BuySellDialog from '../../../../components/buySell/BuySellDialog'; import { DEFAULT_FIAT_PAIR } from '../common/helpers/constants'; diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/TokenDetails.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/TokenDetails.tsx index b5da8d1ba5..28987f4a37 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/TokenDetails.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/TokenDetails.tsx @@ -1,10 +1,12 @@ import { Box, Divider, Stack } from '@mui/material'; import { styled, useTheme } from '@mui/material/styles'; -import React from 'react'; +import React, { useEffect } from 'react'; +import { ampli } from '../../../../../../ampli'; import { BackButton, Card } from '../../../../components'; import NavigationButton from '../../common/components/NavigationButton'; import { useNavigateTo } from '../../common/hooks/useNavigateTo'; import { useStrings } from '../../common/hooks/useStrings'; +import { PortfolioDetailsTab } from '../../module/PortfolioContextProvider'; import { TokenChartInterval } from './ChartDetails/TokenChartInterval'; import HeaderSection from './HeaderDetails/Header'; import OverviewPerformance from './OverviewPerformanceDetails/OverviewPerformance'; @@ -28,6 +30,10 @@ const TokenDetails = ({ tokenInfo }: Props): JSX.Element => { const strings = useStrings(); const isPrimaryToken: boolean = tokenInfo.id === '-'; + useEffect(() => { + ampli.portfolioTokenDetails({ token_details_tab: PortfolioDetailsTab.Overview }); + }, []); + return (
diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx index eddb007961..4e365c0442 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx @@ -1,12 +1,18 @@ import { Stack, Typography } from '@mui/material'; import { useTheme } from '@mui/material/styles'; import React, { useEffect, useState } from 'react'; +import { ampli } from '../../../../../../ampli/index'; import PortfolioHeader from '../../common/components/PortfolioHeader'; import WelcomeBanner from '../../common/components/WelcomeBanner'; import { useStrings } from '../../common/hooks/useStrings'; -import { usePortfolio } from '../../module/PortfolioContextProvider'; +import { PortfolioListTab, usePortfolio } from '../../module/PortfolioContextProvider'; import StatsTable from '../TokensTable/StatsTable'; +const tabs = { + [PortfolioListTab.Wallet]: 'Wallet Token', + [PortfolioListTab.Dapps]: 'Dapps Token', +} as const; + const PortfolioWallet = (): JSX.Element => { const theme = useTheme(); const strings = useStrings(); @@ -16,6 +22,10 @@ const PortfolioWallet = (): JSX.Element => { const [isLoading, _] = useState(false); const [tokenList, setTokenList] = useState(ftAssetList); + useEffect(() => { + ampli.portfolioTokensListPageViewed({ tokens_tab: tabs[PortfolioListTab.Wallet] }); + }, []); + useEffect(() => { if (!keyword || showWelcomeBanner) { setTokenList(ftAssetList); From 9a306149b617a0ad7aa8bb5d3371e3ea5c25c919 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 16:49:09 +0200 Subject: [PATCH 04/14] fix procetage --- .../portfolio/useCases/TokensTable/TableColumnsChip.tsx | 3 ++- .../features/portfolio/useCases/TokensTable/useProcentage.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx index 95a653e237..4422cc7639 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx @@ -179,7 +179,8 @@ export const TokenPriceTotal = ({ token, secondaryToken24Activity }) => { .toFormat(decimals); const totalTicker = isPrimary && showingAda ? accountPair?.to.name : accountPair?.from.name; - const totalTokenPrice = isPrimary && showingAda ? '' : `${totaPrice} ${totalTicker || DEFAULT_FIAT_PAIR}`; + const totalTokenPrice = + isPrimary && showingAda ? '' : `${tokenPrice !== undefined ? totaPrice : '-'} ${totalTicker || DEFAULT_FIAT_PAIR}`; return ( diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx index ea0f56a158..892d006d68 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/useProcentage.tsx @@ -36,7 +36,8 @@ export const useProcessedTokenData = ({ data, ptActivity, data24h, data7d, data3 const unitPrice = parseFloat((tokenPrice * ptActivity?.close || 1).toFixed(4)); const primaryTokenFiatTotalAmount = formatValue(primaryTokenInfo.quantity.multipliedBy(String(ptActivity?.close))); - return { totalValue: isPrimaryToken ? primaryTokenFiatTotalAmount : totalValue, unitPrice }; + const tokenValueDisplay = secondaryToken24Activity && secondaryToken24Activity[0] === 500 ? 0 : totalValue; + return { totalValue: isPrimaryToken ? primaryTokenFiatTotalAmount : tokenValueDisplay, unitPrice }; }; const getTokenActivityChange = (tokenId, activityData, isPrimaryToken) => { From a95c973b711189476bf7712ca032b1f1779152ea Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 17:07:21 +0200 Subject: [PATCH 05/14] fix primary token total --- .../portfolio/useCases/TokensTable/TableColumnsChip.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx index 4422cc7639..e5e8e4dc26 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokensTable/TableColumnsChip.tsx @@ -180,7 +180,9 @@ export const TokenPriceTotal = ({ token, secondaryToken24Activity }) => { const totalTicker = isPrimary && showingAda ? accountPair?.to.name : accountPair?.from.name; const totalTokenPrice = - isPrimary && showingAda ? '' : `${tokenPrice !== undefined ? totaPrice : '-'} ${totalTicker || DEFAULT_FIAT_PAIR}`; + isPrimary && showingAda + ? '' + : `${isPrimary ? totaPrice : tokenPrice !== undefined ? totaPrice : '-'} ${totalTicker || DEFAULT_FIAT_PAIR}`; return ( From 75735e9491a386570f1d32a97b7c5bef23c1c470 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 18:54:34 +0200 Subject: [PATCH 06/14] add missing case --- .../portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx index 7bc3d929e0..236a2d6f48 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/TokenDetails/HeaderDetails/Header.tsx @@ -39,6 +39,10 @@ const HeaderSection = ({ tokenInfo }: Props): JSX.Element => { const tokenQuantityAsBigInt = bigNumberToBigInt(new BigNumber(tokenInfo.quantity)); const tokenDecimals = !isPrimaryToken && tokenInfo.info.numberOfDecimals; + if (tokenPrice === undefined && !isPrimaryToken) { + return '-'; + } + const totaPrice = atomicBreakdown(tokenQuantityAsBigInt, tokenDecimals) .bn.times(tokenPrice ?? 1) .times(String(ptPrice)) From c6c025e918cdc73021f0ab05468a96e0a45c992e Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 19:39:35 +0200 Subject: [PATCH 07/14] add script --- packages/yoroi-extension/ampli/index.ts | 191 ++++++++++++++++-------- 1 file changed, 126 insertions(+), 65 deletions(-) diff --git a/packages/yoroi-extension/ampli/index.ts b/packages/yoroi-extension/ampli/index.ts index a8d20c5046..4836cdff00 100644 --- a/packages/yoroi-extension/ampli/index.ts +++ b/packages/yoroi-extension/ampli/index.ts @@ -23,7 +23,7 @@ export type Environment = 'production' | 'development'; export const ApiKey: Record = { production: 'd44950b777177c2ebee5f21f194c1231', - development: '52a980fd5fb8da5fc680687d7e991e18', + development: '52a980fd5fb8da5fc680687d7e991e18' }; /** @@ -34,26 +34,21 @@ export const DefaultConfiguration: BrowserOptions = { version: '7', branch: 'main', source: 'extension', - versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067', + versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067' }, ...{ ingestionMetadata: { sourceName: 'browser-typescript-ampli', - sourceVersion: '2.0.0', - }, - }, + sourceVersion: '2.0.0' + } + } }; -export interface LoadOptionsBase { - disabled?: boolean; -} +export interface LoadOptionsBase { disabled?: boolean } -export type LoadOptionsWithEnvironment = LoadOptionsBase & { - environment: Environment; - client?: { configuration?: BrowserOptions }; -}; -export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: BrowserOptions } }; -export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: BrowserClient } }; +export type LoadOptionsWithEnvironment = LoadOptionsBase & { environment: Environment; client?: { configuration?: BrowserOptions; }; }; +export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: BrowserOptions; } }; +export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: BrowserClient; } }; export type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance; @@ -83,7 +78,7 @@ export interface ConnectWalletDetailsSubmittedProperties { * |---|---| * | Enum Values | Ledger, Trezor | */ - hardware_wallet: 'Ledger' | 'Trezor'; + hardware_wallet: "Ledger" | "Trezor"; } export interface CreateWalletVerifyPhraseWordSelectedProperties { @@ -108,7 +103,7 @@ export interface GovernanceConfirmTransactionPageViewedProperties { * |---|---| * | Enum Values | Delegate, Abstain, No Confidence | */ - governance_selection: 'Delegate' | 'Abstain' | 'No Confidence'; + governance_selection: "Delegate" | "Abstain" | "No Confidence"; } export interface GovernanceTransactionSuccessPageViewedProperties { @@ -117,7 +112,7 @@ export interface GovernanceTransactionSuccessPageViewedProperties { * |---|---| * | Enum Values | Delegate, Abstain, No Confidence | */ - governance_selection: 'Delegate' | 'Abstain' | 'No Confidence'; + governance_selection: "Delegate" | "Abstain" | "No Confidence"; } export interface NetworkSelectedProperties { @@ -128,7 +123,7 @@ export interface NetworkSelectedProperties { * |---|---| * | Enum Values | preprod, preview, mainnet, sancho | */ - from_network: 'preprod' | 'preview' | 'mainnet' | 'sancho'; + from_network: "preprod" | "preview" | "mainnet" | "sancho"; /** * Network selected * @@ -136,7 +131,7 @@ export interface NetworkSelectedProperties { * |---|---| * | Enum Values | preprod, preview, mainnet, sancho | */ - to_network: 'preprod' | 'preview' | 'mainnet' | 'sancho'; + to_network: "preprod" | "preview" | "mainnet" | "sancho"; } export interface NftGalleryDetailsNavigationProperties { @@ -147,7 +142,7 @@ export interface NftGalleryDetailsNavigationProperties { * |---|---| * | Enum Values | Next, Previous | */ - nft_navigation: 'Next' | 'Previous'; + nft_navigation: "Next" | "Previous"; } export interface NftGalleryDetailsTabProperties { @@ -156,7 +151,7 @@ export interface NftGalleryDetailsTabProperties { * |---|---| * | Enum Values | Overview, Metadata | */ - nft_tab: 'Overview' | 'Metadata'; + nft_tab: "Overview" | "Metadata"; } export interface NftGalleryGridViewSelectedProperties { @@ -167,7 +162,7 @@ export interface NftGalleryGridViewSelectedProperties { * |---|---| * | Enum Values | 4_rows, 6_rows | */ - nft_grid_view?: '4_rows' | '6_rows'; + nft_grid_view?: "4_rows" | "6_rows"; } export interface NftGalleryPageViewedProperties { @@ -204,7 +199,7 @@ export interface PortfolioTokenDetailsProperties { * |---|---| * | Enum Values | Performance, Overview, Transactions | */ - token_details_tab: 'Performance' | 'Overview' | 'Transactions'; + token_details_tab: "Performance" | "Overview" | "Transactions"; } export interface PortfolioTokensListPageViewedProperties { @@ -215,7 +210,7 @@ export interface PortfolioTokensListPageViewedProperties { * |---|---| * | Enum Values | Wallet Token, Dapps Token | */ - tokens_tab: 'Wallet Token' | 'Dapps Token'; + tokens_tab: "Wallet Token" | "Dapps Token"; } export interface PortfolioTokensListSearchActivatedProperties { @@ -244,7 +239,7 @@ export interface ReceiveCopyAddressClickedProperties { * |---|---| * | Enum Values | CTA Copy Address, Tap Address Details, Long Press wallet Address | */ - copy_address_location: 'CTA Copy Address' | 'Tap Address Details' | 'Long Press wallet Address'; + copy_address_location: "CTA Copy Address" | "Tap Address Details" | "Long Press wallet Address"; } export interface RestoreWalletEnterPhraseStepStatusProperties { @@ -257,7 +252,7 @@ export interface RestoreWalletEnterPhraseStepViewedProperties { * |---|---| * | Enum Values | 15, 24 | */ - recovery_phrase_lenght: '15' | '24'; + recovery_phrase_lenght: "15" | "24"; } export interface SendSelectAssetSelectedProperties { @@ -523,7 +518,7 @@ export interface SwapConfirmedPageViewedProperties { * |---|---| * | Enum Values | Open Orders, Completed Orders | */ - swap_tab: 'Open Orders' | 'Completed Orders'; + swap_tab: "Open Orders" | "Completed Orders"; } export interface SwapInitiatedProperties { @@ -551,7 +546,7 @@ export interface SwapInitiatedProperties { * |---|---| * | Enum Values | limit, market | */ - order_type: 'limit' | 'market'; + order_type: "limit" | "market"; /** * The default slippage tolerance is 1%, but users are free to change the slippage. * @@ -605,7 +600,7 @@ export interface SwapOrderSelectedProperties { * |---|---| * | Enum Values | limit, market | */ - order_type?: 'limit' | 'market'; + order_type?: "limit" | "market"; /** * The name of liquidity pool used for this swap transaction */ @@ -681,7 +676,7 @@ export interface SwapOrderSubmittedProperties { * |---|---| * | Enum Values | limit, market | */ - order_type?: 'limit' | 'market'; + order_type?: "limit" | "market"; /** * The name of liquidity pool used for this swap transaction */ @@ -745,7 +740,7 @@ export interface ThemeSelectedProperties { * |---|---| * | Enum Values | auto, light, dark | */ - theme: 'auto' | 'light' | 'dark'; + theme: "auto" | "light" | "dark"; } export interface SendProperties { @@ -813,7 +808,7 @@ export interface SwapProperties { * |---|---| * | Enum Values | limit, market | */ - order_type?: 'limit' | 'market'; + order_type?: "limit" | "market"; /** * The name of liquidity pool used for this swap transaction */ @@ -875,7 +870,9 @@ export class ClaimAdaPageViewed implements BaseEvent { export class ClaimAdaTransactionSettled implements BaseEvent { event_type = 'Claim Ada Transaction Settled'; - constructor(public event_properties: ClaimAdaTransactionSettledProperties) { + constructor( + public event_properties: ClaimAdaTransactionSettledProperties, + ) { this.event_properties = event_properties; } } @@ -883,7 +880,9 @@ export class ClaimAdaTransactionSettled implements BaseEvent { export class ClaimAdaTransactionSubmitted implements BaseEvent { event_type = 'Claim Ada Transaction Submitted'; - constructor(public event_properties: ClaimAdaTransactionSubmittedProperties) { + constructor( + public event_properties: ClaimAdaTransactionSubmittedProperties, + ) { this.event_properties = event_properties; } } @@ -903,7 +902,9 @@ export class ConnectWalletDetailsPageViewed implements BaseEvent { export class ConnectWalletDetailsSubmitted implements BaseEvent { event_type = 'Connect Wallet Details Submitted'; - constructor(public event_properties: ConnectWalletDetailsSubmittedProperties) { + constructor( + public event_properties: ConnectWalletDetailsSubmittedProperties, + ) { this.event_properties = event_properties; } } @@ -951,7 +952,9 @@ export class CreateWalletVerifyPhraseStepViewed implements BaseEvent { export class CreateWalletVerifyPhraseWordSelected implements BaseEvent { event_type = 'Create Wallet Verify Phrase Word Selected'; - constructor(public event_properties?: CreateWalletVerifyPhraseWordSelectedProperties) { + constructor( + public event_properties?: CreateWalletVerifyPhraseWordSelectedProperties, + ) { this.event_properties = event_properties; } } @@ -963,7 +966,9 @@ export class DappPopupAddCollateralPageViewed implements BaseEvent { export class DappPopupConnectWalletPageViewed implements BaseEvent { event_type = 'Dapp Popup Connect Wallet Page Viewed'; - constructor(public event_properties: DappPopupConnectWalletPageViewedProperties) { + constructor( + public event_properties: DappPopupConnectWalletPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -987,7 +992,9 @@ export class GovernanceChooseDrepPageViewed implements BaseEvent { export class GovernanceConfirmTransactionPageViewed implements BaseEvent { event_type = 'Governance Confirm Transaction Page Viewed'; - constructor(public event_properties: GovernanceConfirmTransactionPageViewedProperties) { + constructor( + public event_properties: GovernanceConfirmTransactionPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -999,7 +1006,9 @@ export class GovernanceDashboardPageViewed implements BaseEvent { export class GovernanceTransactionSuccessPageViewed implements BaseEvent { event_type = 'Governance Transaction Success Page Viewed'; - constructor(public event_properties: GovernanceTransactionSuccessPageViewedProperties) { + constructor( + public event_properties: GovernanceTransactionSuccessPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1007,7 +1016,9 @@ export class GovernanceTransactionSuccessPageViewed implements BaseEvent { export class NetworkSelected implements BaseEvent { event_type = 'Network Selected'; - constructor(public event_properties: NetworkSelectedProperties) { + constructor( + public event_properties: NetworkSelectedProperties, + ) { this.event_properties = event_properties; } } @@ -1019,7 +1030,9 @@ export class NftGalleryDetailsImageViewed implements BaseEvent { export class NftGalleryDetailsNavigation implements BaseEvent { event_type = 'NFT Gallery Details Navigation'; - constructor(public event_properties: NftGalleryDetailsNavigationProperties) { + constructor( + public event_properties: NftGalleryDetailsNavigationProperties, + ) { this.event_properties = event_properties; } } @@ -1031,7 +1044,9 @@ export class NftGalleryDetailsPageViewed implements BaseEvent { export class NftGalleryDetailsTab implements BaseEvent { event_type = 'NFT Gallery Details Tab'; - constructor(public event_properties: NftGalleryDetailsTabProperties) { + constructor( + public event_properties: NftGalleryDetailsTabProperties, + ) { this.event_properties = event_properties; } } @@ -1039,7 +1054,9 @@ export class NftGalleryDetailsTab implements BaseEvent { export class NftGalleryGridViewSelected implements BaseEvent { event_type = 'NFT Gallery Grid View Selected'; - constructor(public event_properties?: NftGalleryGridViewSelectedProperties) { + constructor( + public event_properties?: NftGalleryGridViewSelectedProperties, + ) { this.event_properties = event_properties; } } @@ -1047,7 +1064,9 @@ export class NftGalleryGridViewSelected implements BaseEvent { export class NftGalleryPageViewed implements BaseEvent { event_type = 'NFT Gallery Page Viewed'; - constructor(public event_properties: NftGalleryPageViewedProperties) { + constructor( + public event_properties: NftGalleryPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1055,7 +1074,9 @@ export class NftGalleryPageViewed implements BaseEvent { export class NftGallerySearchActivated implements BaseEvent { event_type = 'NFT Gallery Search Activated'; - constructor(public event_properties: NftGallerySearchActivatedProperties) { + constructor( + public event_properties: NftGallerySearchActivatedProperties, + ) { this.event_properties = event_properties; } } @@ -1067,7 +1088,9 @@ export class OnboardingAnalyticsPageViewed implements BaseEvent { export class PortfolioTokenDetails implements BaseEvent { event_type = 'Portfolio Token Details'; - constructor(public event_properties: PortfolioTokenDetailsProperties) { + constructor( + public event_properties: PortfolioTokenDetailsProperties, + ) { this.event_properties = event_properties; } } @@ -1075,7 +1098,9 @@ export class PortfolioTokenDetails implements BaseEvent { export class PortfolioTokensListPageViewed implements BaseEvent { event_type = 'Portfolio Tokens List Page Viewed'; - constructor(public event_properties: PortfolioTokensListPageViewedProperties) { + constructor( + public event_properties: PortfolioTokensListPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1083,7 +1108,9 @@ export class PortfolioTokensListPageViewed implements BaseEvent { export class PortfolioTokensListSearchActivated implements BaseEvent { event_type = 'Portfolio Tokens List Search Activated'; - constructor(public event_properties: PortfolioTokensListSearchActivatedProperties) { + constructor( + public event_properties: PortfolioTokensListSearchActivatedProperties, + ) { this.event_properties = event_properties; } } @@ -1091,7 +1118,9 @@ export class PortfolioTokensListSearchActivated implements BaseEvent { export class ReceiveAmountGeneratedPageViewed implements BaseEvent { event_type = 'Receive Amount Generated Page Viewed'; - constructor(public event_properties: ReceiveAmountGeneratedPageViewedProperties) { + constructor( + public event_properties: ReceiveAmountGeneratedPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1103,7 +1132,9 @@ export class ReceiveAmountPageViewed implements BaseEvent { export class ReceiveCopyAddressClicked implements BaseEvent { event_type = 'Receive Copy Address Clicked'; - constructor(public event_properties: ReceiveCopyAddressClickedProperties) { + constructor( + public event_properties: ReceiveCopyAddressClickedProperties, + ) { this.event_properties = event_properties; } } @@ -1135,7 +1166,9 @@ export class RestoreWalletDetailsStepViewed implements BaseEvent { export class RestoreWalletEnterPhraseStepStatus implements BaseEvent { event_type = 'Restore Wallet Enter Phrase Step Status'; - constructor(public event_properties: RestoreWalletEnterPhraseStepStatusProperties) { + constructor( + public event_properties: RestoreWalletEnterPhraseStepStatusProperties, + ) { this.event_properties = event_properties; } } @@ -1143,7 +1176,9 @@ export class RestoreWalletEnterPhraseStepStatus implements BaseEvent { export class RestoreWalletEnterPhraseStepViewed implements BaseEvent { event_type = 'Restore Wallet Enter Phrase Step Viewed'; - constructor(public event_properties: RestoreWalletEnterPhraseStepViewedProperties) { + constructor( + public event_properties: RestoreWalletEnterPhraseStepViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1171,7 +1206,9 @@ export class SendSelectAssetPageViewed implements BaseEvent { export class SendSelectAssetSelected implements BaseEvent { event_type = 'Send Select Asset Selected'; - constructor(public event_properties: SendSelectAssetSelectedProperties) { + constructor( + public event_properties: SendSelectAssetSelectedProperties, + ) { this.event_properties = event_properties; } } @@ -1179,7 +1216,9 @@ export class SendSelectAssetSelected implements BaseEvent { export class SendSelectAssetUpdated implements BaseEvent { event_type = 'Send Select Asset Updated'; - constructor(public event_properties: SendSelectAssetUpdatedProperties) { + constructor( + public event_properties: SendSelectAssetUpdatedProperties, + ) { this.event_properties = event_properties; } } @@ -1187,7 +1226,9 @@ export class SendSelectAssetUpdated implements BaseEvent { export class SendSummaryPageViewed implements BaseEvent { event_type = 'Send Summary Page Viewed'; - constructor(public event_properties: SendSummaryPageViewedProperties) { + constructor( + public event_properties: SendSummaryPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1195,7 +1236,9 @@ export class SendSummaryPageViewed implements BaseEvent { export class SendSummarySubmitted implements BaseEvent { event_type = 'Send Summary Submitted'; - constructor(public event_properties: SendSummarySubmittedProperties) { + constructor( + public event_properties: SendSummarySubmittedProperties, + ) { this.event_properties = event_properties; } } @@ -1215,7 +1258,9 @@ export class StakingCenterPageViewed implements BaseEvent { export class SwapAssetFromChanged implements BaseEvent { event_type = 'Swap Asset From Changed'; - constructor(public event_properties: SwapAssetFromChangedProperties) { + constructor( + public event_properties: SwapAssetFromChangedProperties, + ) { this.event_properties = event_properties; } } @@ -1223,7 +1268,9 @@ export class SwapAssetFromChanged implements BaseEvent { export class SwapAssetToChanged implements BaseEvent { event_type = 'Swap Asset To Changed'; - constructor(public event_properties: SwapAssetToChangedProperties) { + constructor( + public event_properties: SwapAssetToChangedProperties, + ) { this.event_properties = event_properties; } } @@ -1231,7 +1278,9 @@ export class SwapAssetToChanged implements BaseEvent { export class SwapCancelationSubmitted implements BaseEvent { event_type = 'Swap Cancelation Submitted'; - constructor(public event_properties: SwapCancelationSubmittedProperties) { + constructor( + public event_properties: SwapCancelationSubmittedProperties, + ) { this.event_properties = event_properties; } } @@ -1239,7 +1288,9 @@ export class SwapCancelationSubmitted implements BaseEvent { export class SwapConfirmedPageViewed implements BaseEvent { event_type = 'Swap Confirmed Page Viewed'; - constructor(public event_properties: SwapConfirmedPageViewedProperties) { + constructor( + public event_properties: SwapConfirmedPageViewedProperties, + ) { this.event_properties = event_properties; } } @@ -1247,7 +1298,9 @@ export class SwapConfirmedPageViewed implements BaseEvent { export class SwapInitiated implements BaseEvent { event_type = 'Swap Initiated'; - constructor(public event_properties: SwapInitiatedProperties) { + constructor( + public event_properties: SwapInitiatedProperties, + ) { this.event_properties = event_properties; } } @@ -1255,7 +1308,9 @@ export class SwapInitiated implements BaseEvent { export class SwapOrderSelected implements BaseEvent { event_type = 'Swap Order Selected'; - constructor(public event_properties: SwapOrderSelectedProperties) { + constructor( + public event_properties: SwapOrderSelectedProperties, + ) { this.event_properties = event_properties; } } @@ -1263,7 +1318,9 @@ export class SwapOrderSelected implements BaseEvent { export class SwapOrderSubmitted implements BaseEvent { event_type = 'Swap Order Submitted'; - constructor(public event_properties: SwapOrderSubmittedProperties) { + constructor( + public event_properties: SwapOrderSubmittedProperties, + ) { this.event_properties = event_properties; } } @@ -1275,7 +1332,9 @@ export class SwapPoolChanged implements BaseEvent { export class SwapSlippageChanged implements BaseEvent { event_type = 'Swap Slippage Changed'; - constructor(public event_properties: SwapSlippageChangedProperties) { + constructor( + public event_properties: SwapSlippageChangedProperties, + ) { this.event_properties = event_properties; } } @@ -1283,7 +1342,9 @@ export class SwapSlippageChanged implements BaseEvent { export class ThemeSelected implements BaseEvent { event_type = 'Theme Selected'; - constructor(public event_properties: ThemeSelectedProperties) { + constructor( + public event_properties: ThemeSelectedProperties, + ) { this.event_properties = event_properties; } } From eae427748ff5692781cbf855039e932de61a9a71 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 19:55:22 +0200 Subject: [PATCH 08/14] generate index --- packages/yoroi-extension/ampli/README.md | 51 +++++++++++++++++++ .../ampli/{index.ts => index.js} | 0 2 files changed, 51 insertions(+) create mode 100644 packages/yoroi-extension/ampli/README.md rename packages/yoroi-extension/ampli/{index.ts => index.js} (100%) diff --git a/packages/yoroi-extension/ampli/README.md b/packages/yoroi-extension/ampli/README.md new file mode 100644 index 0000000000..f93fc26613 --- /dev/null +++ b/packages/yoroi-extension/ampli/README.md @@ -0,0 +1,51 @@ +The coerce the TypeScript Amplitude wrapper to work with flow, do these: + +``` +npm run metrics:pull +``` + +``` +cd ampli +``` + + +``` +npx -p typescript tsc index.ts --outDir . -d -m es6 +``` + +``` +npx flowgen --interface-records --no-inexact --add-flow-header -o index.js.flow index.d.ts +``` + +``` +rm *.ts +``` + +#### Next + +Linux: +``` +sed -i 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow +sed -i '/export type BaseEvent/d' index.js.flow + +``` + +Mac: +``` +sed -i'.bak' 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow +sed -i'.bak' '/export type BaseEvent/d' index.js.flow +rm *.bak +``` + +Edit `index.js.flow` to add the line `class BaseEvent {}`. + +Then we have flow-typed ampli library where all event trigger functions are strongly typed. +To use this libray, import like this from source code: +``` +import type { LoadOptionsWithEnvironment } from '../../../ampli/index'; +``` +instead of +``` +import type { LoadOptionsWithEnvironment } from '../../../ampli'; +``` +Due to perhaps a bug in flow, the later short-circuits type checking. diff --git a/packages/yoroi-extension/ampli/index.ts b/packages/yoroi-extension/ampli/index.js similarity index 100% rename from packages/yoroi-extension/ampli/index.ts rename to packages/yoroi-extension/ampli/index.js From 871b42ec9df6167577b3b21243c2cdb0eb43a780 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Tue, 17 Dec 2024 20:00:00 +0200 Subject: [PATCH 09/14] update index.js --- packages/yoroi-extension/ampli/README.md | 51 - packages/yoroi-extension/ampli/index.js | 4535 +++++++----------- packages/yoroi-extension/ampli/index.js.flow | 2279 +++++++++ 3 files changed, 4055 insertions(+), 2810 deletions(-) delete mode 100644 packages/yoroi-extension/ampli/README.md create mode 100644 packages/yoroi-extension/ampli/index.js.flow diff --git a/packages/yoroi-extension/ampli/README.md b/packages/yoroi-extension/ampli/README.md deleted file mode 100644 index f93fc26613..0000000000 --- a/packages/yoroi-extension/ampli/README.md +++ /dev/null @@ -1,51 +0,0 @@ -The coerce the TypeScript Amplitude wrapper to work with flow, do these: - -``` -npm run metrics:pull -``` - -``` -cd ampli -``` - - -``` -npx -p typescript tsc index.ts --outDir . -d -m es6 -``` - -``` -npx flowgen --interface-records --no-inexact --add-flow-header -o index.js.flow index.d.ts -``` - -``` -rm *.ts -``` - -#### Next - -Linux: -``` -sed -i 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow -sed -i '/export type BaseEvent/d' index.js.flow - -``` - -Mac: -``` -sed -i'.bak' 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow -sed -i'.bak' '/export type BaseEvent/d' index.js.flow -rm *.bak -``` - -Edit `index.js.flow` to add the line `class BaseEvent {}`. - -Then we have flow-typed ampli library where all event trigger functions are strongly typed. -To use this libray, import like this from source code: -``` -import type { LoadOptionsWithEnvironment } from '../../../ampli/index'; -``` -instead of -``` -import type { LoadOptionsWithEnvironment } from '../../../ampli'; -``` -Due to perhaps a bug in flow, the later short-circuits type checking. diff --git a/packages/yoroi-extension/ampli/index.js b/packages/yoroi-extension/ampli/index.js index 4836cdff00..eb54dba3f3 100644 --- a/packages/yoroi-extension/ampli/index.js +++ b/packages/yoroi-extension/ampli/index.js @@ -16,2770 +16,1787 @@ * * [Full Setup Instructions](https://data.amplitude.com/emurgo/Yoroi/implementation/extension) */ - +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; import * as amplitude from '@amplitude/analytics-browser'; - -export type Environment = 'production' | 'development'; - -export const ApiKey: Record = { - production: 'd44950b777177c2ebee5f21f194c1231', - development: '52a980fd5fb8da5fc680687d7e991e18' +export var ApiKey = { + production: 'd44950b777177c2ebee5f21f194c1231', + development: '52a980fd5fb8da5fc680687d7e991e18' }; - /** * Default Amplitude configuration options. Contains tracking plan information. */ -export const DefaultConfiguration: BrowserOptions = { - plan: { - version: '7', - branch: 'main', - source: 'extension', - versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067' - }, - ...{ +export var DefaultConfiguration = __assign({ plan: { + version: '7', + branch: 'main', + source: 'extension', + versionId: 'a0985241-d0c0-4bda-bc6d-271830af0067' + } }, { ingestionMetadata: { - sourceName: 'browser-typescript-ampli', - sourceVersion: '2.0.0' + sourceName: 'browser-typescript-ampli', + sourceVersion: '2.0.0' } - } -}; - -export interface LoadOptionsBase { disabled?: boolean } - -export type LoadOptionsWithEnvironment = LoadOptionsBase & { environment: Environment; client?: { configuration?: BrowserOptions; }; }; -export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: BrowserOptions; } }; -export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: BrowserClient; } }; - -export type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance; - -export interface ClaimAdaTransactionSettledProperties { - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - reward_amount: number; -} - -export interface ClaimAdaTransactionSubmittedProperties { - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - reward_amount: number; -} - -export interface ConnectWalletDetailsSubmittedProperties { - /** - * The name of the hardware wallet. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Ledger, Trezor | - */ - hardware_wallet: "Ledger" | "Trezor"; -} - -export interface CreateWalletVerifyPhraseWordSelectedProperties { - recovery_word_order?: any; -} - -export interface DappPopupConnectWalletPageViewedProperties { - /** - * The total number of wallets that a user have. - * In case of not having any wallet, save 0 as the value. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - wallet_count: number; -} - -export interface GovernanceConfirmTransactionPageViewedProperties { - /** - * | Rule | Value | - * |---|---| - * | Enum Values | Delegate, Abstain, No Confidence | - */ - governance_selection: "Delegate" | "Abstain" | "No Confidence"; -} - -export interface GovernanceTransactionSuccessPageViewedProperties { - /** - * | Rule | Value | - * |---|---| - * | Enum Values | Delegate, Abstain, No Confidence | - */ - governance_selection: "Delegate" | "Abstain" | "No Confidence"; -} - -export interface NetworkSelectedProperties { - /** - * Current network - * - * | Rule | Value | - * |---|---| - * | Enum Values | preprod, preview, mainnet, sancho | - */ - from_network: "preprod" | "preview" | "mainnet" | "sancho"; - /** - * Network selected - * - * | Rule | Value | - * |---|---| - * | Enum Values | preprod, preview, mainnet, sancho | - */ - to_network: "preprod" | "preview" | "mainnet" | "sancho"; -} - -export interface NftGalleryDetailsNavigationProperties { - /** - * Describe the navigation buttons on the NFT details view - * - * | Rule | Value | - * |---|---| - * | Enum Values | Next, Previous | - */ - nft_navigation: "Next" | "Previous"; -} - -export interface NftGalleryDetailsTabProperties { - /** - * | Rule | Value | - * |---|---| - * | Enum Values | Overview, Metadata | - */ - nft_tab: "Overview" | "Metadata"; -} - -export interface NftGalleryGridViewSelectedProperties { - /** - * Describe what type of grid is using the NFT gallery - * - * | Rule | Value | - * |---|---| - * | Enum Values | 4_rows, 6_rows | - */ - nft_grid_view?: "4_rows" | "6_rows"; -} - -export interface NftGalleryPageViewedProperties { - /** - * The total number of NFT's that an user have - * - * | Rule | Value | - * |---|---| - * | Type | integer | - */ - nft_count: number; -} - -export interface NftGallerySearchActivatedProperties { - /** - * The total number of NFT's that an user have - * - * | Rule | Value | - * |---|---| - * | Type | integer | - */ - nft_count: number; - /** - * What user is looking to search on NFT gallery page - */ - nft_search_term: string; -} - -export interface PortfolioTokenDetailsProperties { - /** - * It show what tab from the Token details the user is. - * - * | Rule | Value | - * |---|---| - * | Enum Values | Performance, Overview, Transactions | - */ - token_details_tab: "Performance" | "Overview" | "Transactions"; -} - -export interface PortfolioTokensListPageViewedProperties { - /** - * It shows in what tab are we in the movile version of the Token list - * - * | Rule | Value | - * |---|---| - * | Enum Values | Wallet Token, Dapps Token | - */ - tokens_tab: "Wallet Token" | "Dapps Token"; -} - -export interface PortfolioTokensListSearchActivatedProperties { - /** - * What a user is looking to search. - */ - search_term: string; -} - -export interface ReceiveAmountGeneratedPageViewedProperties { - /** - * The amount of ADA that the user will be exchanging. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - ada_amount: number; -} - -export interface ReceiveCopyAddressClickedProperties { - /** - * Indicates the location of cop CTA - * - * | Rule | Value | - * |---|---| - * | Enum Values | CTA Copy Address, Tap Address Details, Long Press wallet Address | - */ - copy_address_location: "CTA Copy Address" | "Tap Address Details" | "Long Press wallet Address"; -} - -export interface RestoreWalletEnterPhraseStepStatusProperties { - recovery_prhase_status: boolean; -} - -export interface RestoreWalletEnterPhraseStepViewedProperties { - /** - * | Rule | Value | - * |---|---| - * | Enum Values | 15, 24 | - */ - recovery_phrase_lenght: "15" | "24"; -} - -export interface SendSelectAssetSelectedProperties { - /** - * Total numbers of assets to be send - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - asset_count: number; - /** - * ``` - * nfts: [ - * { - * nft_name: Bored Ape, - * - * }, - * { - * nft_name: Crypto Cats, - * } - * ] - * ``` - */ - nfts?: any[]; - /** - * ``` - * Tokens: [ - * { - * token_name: Ado, - * token_amount: '133', - * }, - * { - * token_name: Ada, - * token_amount: '5', - * } - * ] - * ``` - */ - tokens?: any[]; -} - -export interface SendSelectAssetUpdatedProperties { - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - asset_count: number; - /** - * ``` - * nfts: [ - * { - * nft_name: Bored Ape, - * - * }, - * { - * nft_name: Crypto Cats, - * } - * ] - * ``` - */ - nfts?: any[]; - /** - * ``` - * Tokens: [ - * { - * token_name: Ado, - * token_amount: '133', - * }, - * { - * token_name: Ada, - * token_amount: '5', - * } - * ] - * ``` - */ - tokens?: any[]; -} - -export interface SendSummaryPageViewedProperties { - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - asset_count: number; - /** - * ``` - * nfts: [ - * { - * nft_name: Bored Ape, - * - * }, - * { - * nft_name: Crypto Cats, - * } - * ] - * ``` - */ - nfts?: any[]; - /** - * ``` - * Tokens: [ - * { - * token_name: Ado, - * token_amount: '133', - * }, - * { - * token_name: Ada, - * token_amount: '5', - * } - * ] - * ``` - */ - tokens?: any[]; -} - -export interface SendSummarySubmittedProperties { - /** - * The amount of ADA that the user will be exchanging. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - ada_amount: number; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - asset_count: number; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - nft_amount: number; - nft_name: string; - /** - * ``` - * nfts: [ - * { - * nft_name: Bored Ape, - * - * }, - * { - * nft_name: Crypto Cats, - * } - * ] - * ``` - */ - nfts?: any[]; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - token_amount: number; - token_name: string; - /** - * ``` - * Tokens: [ - * { - * token_name: Ado, - * token_amount: '133', - * }, - * { - * token_name: Ada, - * token_amount: '5', - * } - * ] - * ``` - */ - tokens?: any[]; -} - -export interface SwapAssetFromChangedProperties { - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - */ - from_asset: any[]; -} - -export interface SwapAssetToChangedProperties { - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - */ - to_asset: any[]; -} - -export interface SwapCancelationSubmittedProperties { - /** - * The amount of asset that the user is swapping from - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - from_amount: number; - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - * - * | Rule | Value | - * |---|---| - * | Unique Items | null | - */ - from_asset: any[]; - /** - * The name of liquidity pool used for this swap transaction - */ - pool_source: string; - /** - * The amount of asset that the user is swapping to - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - to_amount: number; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - * - * | Rule | Value | - * |---|---| - * | Unique Items | null | - */ - to_asset: any[]; -} - -export interface SwapConfirmedPageViewedProperties { - /** - * Define the tab that is active in the selected page - * - * | Rule | Value | - * |---|---| - * | Enum Values | Open Orders, Completed Orders | - */ - swap_tab: "Open Orders" | "Completed Orders"; -} - -export interface SwapInitiatedProperties { - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - * - * | Rule | Value | - * |---|---| - * | Unique Items | null | - */ - from_asset: any[]; - /** - * The type of order selected on a given transaction - * - * | Rule | Value | - * |---|---| - * | Enum Values | limit, market | - */ - order_type: "limit" | "market"; - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance: number; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - * - * | Rule | Value | - * |---|---| - * | Unique Items | null | - */ - to_asset: any[]; -} - -export interface SwapOrderSelectedProperties { - /** - * The amount of asset that the user is swapping from - */ - from_amount: string; - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - */ - from_asset: any[]; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - from_asset_fiat_value: number; - /** - * The type of order selected on a given transaction - * - * | Rule | Value | - * |---|---| - * | Enum Values | limit, market | - */ - order_type?: "limit" | "market"; - /** - * The name of liquidity pool used for this swap transaction - */ - pool_source: string; - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance?: number; - /** - * The amount of fees charged on the transaction. The value is in ADA. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - swap_fees?: number; - /** - * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). - */ - swap_pair?: string; - /** - * The amount of asset that the user is swapping to - */ - to_amount: string; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - */ - to_asset: any[]; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - to_asset_fiat_value: number; -} - -export interface SwapOrderSubmittedProperties { - /** - * The amount of asset that the user is swapping from - */ - from_amount: string; - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - */ - from_asset: any[]; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - from_asset_fiat_value: number; - /** - * The type of order selected on a given transaction - * - * | Rule | Value | - * |---|---| - * | Enum Values | limit, market | - */ - order_type?: "limit" | "market"; - /** - * The name of liquidity pool used for this swap transaction - */ - pool_source: string; - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance?: number; - /** - * The amount of fees charged on the transaction. The value is in ADA. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - swap_fees?: number; - /** - * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). - */ - swap_pair?: string; - /** - * The amount of asset that the user is swapping to - */ - to_amount: string; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - */ - to_asset: any[]; - /** - * | Rule | Value | - * |---|---| - * | Type | number | - */ - to_asset_fiat_value: number; -} - -export interface SwapSlippageChangedProperties { - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance: number; -} - -export interface ThemeSelectedProperties { - /** - * The theme that is selected. - * - * | Rule | Value | - * |---|---| - * | Enum Values | auto, light, dark | - */ - theme: "auto" | "light" | "dark"; -} - -export interface SendProperties { - /** - * Total numbers of assets to be send - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - asset_count: number; - /** - * ``` - * nfts: [ - * { - * nft_name: Bored Ape, - * - * }, - * { - * nft_name: Crypto Cats, - * } - * ] - * ``` - */ - nfts?: any[]; - /** - * ``` - * Tokens: [ - * { - * token_name: Ado, - * token_amount: '133', - * }, - * { - * token_name: Ada, - * token_amount: '5', - * } - * ] - * ``` - */ - tokens?: any[]; -} - -export interface SwapProperties { - /** - * The amount of asset that the user is swapping from - */ - from_amount: string; - /** - * Displaying the asset that the user chose to trade with. - * - * Asset Name Asset Ticker Policy ID - * \[ - * { - * asset_name: 'ADA', - * asset_ticker: 'ADA', - * policy_id: '123456789' - * }, - * \] - */ - from_asset: any[]; - /** - * The type of order selected on a given transaction - * - * | Rule | Value | - * |---|---| - * | Enum Values | limit, market | - */ - order_type?: "limit" | "market"; - /** - * The name of liquidity pool used for this swap transaction - */ - pool_source: string; - /** - * The default slippage tolerance is 1%, but users are free to change the slippage. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - slippage_tolerance?: number; - /** - * The amount of fees charged on the transaction. The value is in ADA. - * - * | Rule | Value | - * |---|---| - * | Type | number | - */ - swap_fees?: number; - /** - * The amount of asset that the user is swapping to - */ - to_amount: string; - /** - * Displaying the asset that the user chose to trade to - * - * Asset Name - * Asset Ticker - * Policy ID - */ - to_asset: any[]; -} - -export class ToDeleteGovernanceAbstainPageViewed implements BaseEvent { - event_type = '(to delete)Governance Abstain Page Viewed'; -} - -export class AllWalletsPageViewed implements BaseEvent { - event_type = 'All Wallets Page Viewed'; -} - -export class AssetsPageViewed implements BaseEvent { - event_type = 'Assets Page Viewed'; -} - -export class BuyAdaInputAmount implements BaseEvent { - event_type = 'Buy Ada Input Amount'; -} - -export class BuyAdaSuccessRedirect implements BaseEvent { - event_type = 'Buy Ada Success Redirect'; -} - -export class ClaimAdaPageViewed implements BaseEvent { - event_type = 'Claim ADA Page Viewed'; -} - -export class ClaimAdaTransactionSettled implements BaseEvent { - event_type = 'Claim Ada Transaction Settled'; - - constructor( - public event_properties: ClaimAdaTransactionSettledProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ClaimAdaTransactionSubmitted implements BaseEvent { - event_type = 'Claim Ada Transaction Submitted'; - - constructor( - public event_properties: ClaimAdaTransactionSubmittedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ConnectWalletCheckPageViewed implements BaseEvent { - event_type = 'Connect Wallet Check Page Viewed'; -} - -export class ConnectWalletConnectPageViewed implements BaseEvent { - event_type = 'Connect Wallet Connect Page Viewed'; -} - -export class ConnectWalletDetailsPageViewed implements BaseEvent { - event_type = 'Connect Wallet Details Page Viewed'; -} - -export class ConnectWalletDetailsSubmitted implements BaseEvent { - event_type = 'Connect Wallet Details Submitted'; - - constructor( - public event_properties: ConnectWalletDetailsSubmittedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ConnectorPageViewed implements BaseEvent { - event_type = 'Connector Page Viewed'; -} - -export class CreateWalletDetailsSettled implements BaseEvent { - event_type = 'Create Wallet Details Settled'; -} - -export class CreateWalletDetailsStepViewed implements BaseEvent { - event_type = 'Create Wallet Details Step Viewed'; -} - -export class CreateWalletDetailsSubmitted implements BaseEvent { - event_type = 'Create Wallet Details Submitted'; -} - -export class CreateWalletLanguagePageViewed implements BaseEvent { - event_type = 'Create Wallet Language Page Viewed'; -} - -export class CreateWalletLearnPhraseStepViewed implements BaseEvent { - event_type = 'Create Wallet Learn Phrase Step Viewed'; -} - -export class CreateWalletSavePhraseStepViewed implements BaseEvent { - event_type = 'Create Wallet Save Phrase Step Viewed'; -} - -export class CreateWalletSelectMethodPageViewed implements BaseEvent { - event_type = 'Create Wallet Select Method Page Viewed'; -} - -export class CreateWalletTermsPageViewed implements BaseEvent { - event_type = 'Create Wallet Terms Page Viewed'; -} - -export class CreateWalletVerifyPhraseStepViewed implements BaseEvent { - event_type = 'Create Wallet Verify Phrase Step Viewed'; -} - -export class CreateWalletVerifyPhraseWordSelected implements BaseEvent { - event_type = 'Create Wallet Verify Phrase Word Selected'; - - constructor( - public event_properties?: CreateWalletVerifyPhraseWordSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class DappPopupAddCollateralPageViewed implements BaseEvent { - event_type = 'Dapp Popup Add Collateral Page Viewed'; -} - -export class DappPopupConnectWalletPageViewed implements BaseEvent { - event_type = 'Dapp Popup Connect Wallet Page Viewed'; - - constructor( - public event_properties: DappPopupConnectWalletPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class DappPopupConnectWalletPasswordPageViewed implements BaseEvent { - event_type = 'Dapp Popup Connect Wallet Password Page Viewed'; -} - -export class DappPopupSignTransactionPageViewed implements BaseEvent { - event_type = 'Dapp Popup Sign Transaction Page Viewed'; -} - -export class DappPopupSignTransactionSubmitted implements BaseEvent { - event_type = 'Dapp Popup Sign Transaction Submitted'; -} - -export class GovernanceChooseDrepPageViewed implements BaseEvent { - event_type = 'Governance Choose Drep Page Viewed'; -} - -export class GovernanceConfirmTransactionPageViewed implements BaseEvent { - event_type = 'Governance Confirm Transaction Page Viewed'; - - constructor( - public event_properties: GovernanceConfirmTransactionPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class GovernanceDashboardPageViewed implements BaseEvent { - event_type = 'Governance Dashboard Page Viewed'; -} - -export class GovernanceTransactionSuccessPageViewed implements BaseEvent { - event_type = 'Governance Transaction Success Page Viewed'; - - constructor( - public event_properties: GovernanceTransactionSuccessPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NetworkSelected implements BaseEvent { - event_type = 'Network Selected'; - - constructor( - public event_properties: NetworkSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NftGalleryDetailsImageViewed implements BaseEvent { - event_type = 'NFT Gallery Details Image Viewed'; -} - -export class NftGalleryDetailsNavigation implements BaseEvent { - event_type = 'NFT Gallery Details Navigation'; - - constructor( - public event_properties: NftGalleryDetailsNavigationProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NftGalleryDetailsPageViewed implements BaseEvent { - event_type = 'NFT Gallery Details Page Viewed'; -} - -export class NftGalleryDetailsTab implements BaseEvent { - event_type = 'NFT Gallery Details Tab'; - - constructor( - public event_properties: NftGalleryDetailsTabProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NftGalleryGridViewSelected implements BaseEvent { - event_type = 'NFT Gallery Grid View Selected'; - - constructor( - public event_properties?: NftGalleryGridViewSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NftGalleryPageViewed implements BaseEvent { - event_type = 'NFT Gallery Page Viewed'; - - constructor( - public event_properties: NftGalleryPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class NftGallerySearchActivated implements BaseEvent { - event_type = 'NFT Gallery Search Activated'; - - constructor( - public event_properties: NftGallerySearchActivatedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class OnboardingAnalyticsPageViewed implements BaseEvent { - event_type = 'Onboarding Analytics Page Viewed'; -} - -export class PortfolioTokenDetails implements BaseEvent { - event_type = 'Portfolio Token Details'; - - constructor( - public event_properties: PortfolioTokenDetailsProperties, - ) { - this.event_properties = event_properties; - } -} - -export class PortfolioTokensListPageViewed implements BaseEvent { - event_type = 'Portfolio Tokens List Page Viewed'; - - constructor( - public event_properties: PortfolioTokensListPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class PortfolioTokensListSearchActivated implements BaseEvent { - event_type = 'Portfolio Tokens List Search Activated'; - - constructor( - public event_properties: PortfolioTokensListSearchActivatedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ReceiveAmountGeneratedPageViewed implements BaseEvent { - event_type = 'Receive Amount Generated Page Viewed'; - - constructor( - public event_properties: ReceiveAmountGeneratedPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ReceiveAmountPageViewed implements BaseEvent { - event_type = 'Receive Amount Page Viewed'; -} - -export class ReceiveCopyAddressClicked implements BaseEvent { - event_type = 'Receive Copy Address Clicked'; - - constructor( - public event_properties: ReceiveCopyAddressClickedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ReceiveGenerateNewAddressClicked implements BaseEvent { - event_type = 'Receive Generate New Address Clicked'; -} - -export class ReceivePageListViewed implements BaseEvent { - event_type = 'Receive Page List Viewed'; -} - -export class ReceivePageViewed implements BaseEvent { - event_type = 'Receive Page Viewed'; -} - -export class ReceiveShareAddressClicked implements BaseEvent { - event_type = 'Receive Share Address Clicked'; -} - -export class RestoreWalletDetailsSettled implements BaseEvent { - event_type = 'Restore Wallet Details Settled'; -} - -export class RestoreWalletDetailsStepViewed implements BaseEvent { - event_type = 'Restore Wallet Details Step Viewed'; -} - -export class RestoreWalletEnterPhraseStepStatus implements BaseEvent { - event_type = 'Restore Wallet Enter Phrase Step Status'; - - constructor( - public event_properties: RestoreWalletEnterPhraseStepStatusProperties, - ) { - this.event_properties = event_properties; - } -} - -export class RestoreWalletEnterPhraseStepViewed implements BaseEvent { - event_type = 'Restore Wallet Enter Phrase Step Viewed'; - - constructor( - public event_properties: RestoreWalletEnterPhraseStepViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class RestoreWalletTypeStepViewed implements BaseEvent { - event_type = 'Restore Wallet Type Step Viewed'; -} - -export class SellAdaInputAmount implements BaseEvent { - event_type = 'Sell Ada Input Amount'; -} - -export class SellAdaSuccessRedirect implements BaseEvent { - event_type = 'Sell Ada Success Redirect'; -} - -export class SendInitiated implements BaseEvent { - event_type = 'Send Initiated'; -} - -export class SendSelectAssetPageViewed implements BaseEvent { - event_type = 'Send Select Asset Page Viewed'; -} - -export class SendSelectAssetSelected implements BaseEvent { - event_type = 'Send Select Asset Selected'; - - constructor( - public event_properties: SendSelectAssetSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SendSelectAssetUpdated implements BaseEvent { - event_type = 'Send Select Asset Updated'; - - constructor( - public event_properties: SendSelectAssetUpdatedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SendSummaryPageViewed implements BaseEvent { - event_type = 'Send Summary Page Viewed'; - - constructor( - public event_properties: SendSummaryPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SendSummarySubmitted implements BaseEvent { - event_type = 'Send Summary Submitted'; - - constructor( - public event_properties: SendSummarySubmittedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SettingsPageViewed implements BaseEvent { - event_type = 'Settings Page Viewed'; -} - -export class StakingCenterDelegationInitiated implements BaseEvent { - event_type = 'Staking Center Delegation Initiated'; -} - -export class StakingCenterPageViewed implements BaseEvent { - event_type = 'Staking Center Page Viewed'; -} - -export class SwapAssetFromChanged implements BaseEvent { - event_type = 'Swap Asset From Changed'; - - constructor( - public event_properties: SwapAssetFromChangedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapAssetToChanged implements BaseEvent { - event_type = 'Swap Asset To Changed'; - - constructor( - public event_properties: SwapAssetToChangedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapCancelationSubmitted implements BaseEvent { - event_type = 'Swap Cancelation Submitted'; - - constructor( - public event_properties: SwapCancelationSubmittedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapConfirmedPageViewed implements BaseEvent { - event_type = 'Swap Confirmed Page Viewed'; - - constructor( - public event_properties: SwapConfirmedPageViewedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapInitiated implements BaseEvent { - event_type = 'Swap Initiated'; - - constructor( - public event_properties: SwapInitiatedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapOrderSelected implements BaseEvent { - event_type = 'Swap Order Selected'; - - constructor( - public event_properties: SwapOrderSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapOrderSubmitted implements BaseEvent { - event_type = 'Swap Order Submitted'; - - constructor( - public event_properties: SwapOrderSubmittedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class SwapPoolChanged implements BaseEvent { - event_type = 'Swap Pool Changed'; -} - -export class SwapSlippageChanged implements BaseEvent { - event_type = 'Swap Slippage Changed'; - - constructor( - public event_properties: SwapSlippageChangedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class ThemeSelected implements BaseEvent { - event_type = 'Theme Selected'; - - constructor( - public event_properties: ThemeSelectedProperties, - ) { - this.event_properties = event_properties; - } -} - -export class TransactionsPageViewed implements BaseEvent { - event_type = 'Transactions Page Viewed'; -} - -export class VotingPageViewed implements BaseEvent { - event_type = 'Voting Page Viewed'; -} - -export class WalletPageViewed implements BaseEvent { - event_type = 'Wallet Page Viewed'; -} - -export type PromiseResult = { promise: Promise }; - -const getVoidPromiseResult = () => ({ promise: Promise.resolve() }); - +}); +var ToDeleteGovernanceAbstainPageViewed = /** @class */ (function () { + function ToDeleteGovernanceAbstainPageViewed() { + this.event_type = '(to delete)Governance Abstain Page Viewed'; + } + return ToDeleteGovernanceAbstainPageViewed; +}()); +export { ToDeleteGovernanceAbstainPageViewed }; +var AllWalletsPageViewed = /** @class */ (function () { + function AllWalletsPageViewed() { + this.event_type = 'All Wallets Page Viewed'; + } + return AllWalletsPageViewed; +}()); +export { AllWalletsPageViewed }; +var AssetsPageViewed = /** @class */ (function () { + function AssetsPageViewed() { + this.event_type = 'Assets Page Viewed'; + } + return AssetsPageViewed; +}()); +export { AssetsPageViewed }; +var BuyAdaInputAmount = /** @class */ (function () { + function BuyAdaInputAmount() { + this.event_type = 'Buy Ada Input Amount'; + } + return BuyAdaInputAmount; +}()); +export { BuyAdaInputAmount }; +var BuyAdaSuccessRedirect = /** @class */ (function () { + function BuyAdaSuccessRedirect() { + this.event_type = 'Buy Ada Success Redirect'; + } + return BuyAdaSuccessRedirect; +}()); +export { BuyAdaSuccessRedirect }; +var ClaimAdaPageViewed = /** @class */ (function () { + function ClaimAdaPageViewed() { + this.event_type = 'Claim ADA Page Viewed'; + } + return ClaimAdaPageViewed; +}()); +export { ClaimAdaPageViewed }; +var ClaimAdaTransactionSettled = /** @class */ (function () { + function ClaimAdaTransactionSettled(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Claim Ada Transaction Settled'; + this.event_properties = event_properties; + } + return ClaimAdaTransactionSettled; +}()); +export { ClaimAdaTransactionSettled }; +var ClaimAdaTransactionSubmitted = /** @class */ (function () { + function ClaimAdaTransactionSubmitted(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Claim Ada Transaction Submitted'; + this.event_properties = event_properties; + } + return ClaimAdaTransactionSubmitted; +}()); +export { ClaimAdaTransactionSubmitted }; +var ConnectWalletCheckPageViewed = /** @class */ (function () { + function ConnectWalletCheckPageViewed() { + this.event_type = 'Connect Wallet Check Page Viewed'; + } + return ConnectWalletCheckPageViewed; +}()); +export { ConnectWalletCheckPageViewed }; +var ConnectWalletConnectPageViewed = /** @class */ (function () { + function ConnectWalletConnectPageViewed() { + this.event_type = 'Connect Wallet Connect Page Viewed'; + } + return ConnectWalletConnectPageViewed; +}()); +export { ConnectWalletConnectPageViewed }; +var ConnectWalletDetailsPageViewed = /** @class */ (function () { + function ConnectWalletDetailsPageViewed() { + this.event_type = 'Connect Wallet Details Page Viewed'; + } + return ConnectWalletDetailsPageViewed; +}()); +export { ConnectWalletDetailsPageViewed }; +var ConnectWalletDetailsSubmitted = /** @class */ (function () { + function ConnectWalletDetailsSubmitted(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Connect Wallet Details Submitted'; + this.event_properties = event_properties; + } + return ConnectWalletDetailsSubmitted; +}()); +export { ConnectWalletDetailsSubmitted }; +var ConnectorPageViewed = /** @class */ (function () { + function ConnectorPageViewed() { + this.event_type = 'Connector Page Viewed'; + } + return ConnectorPageViewed; +}()); +export { ConnectorPageViewed }; +var CreateWalletDetailsSettled = /** @class */ (function () { + function CreateWalletDetailsSettled() { + this.event_type = 'Create Wallet Details Settled'; + } + return CreateWalletDetailsSettled; +}()); +export { CreateWalletDetailsSettled }; +var CreateWalletDetailsStepViewed = /** @class */ (function () { + function CreateWalletDetailsStepViewed() { + this.event_type = 'Create Wallet Details Step Viewed'; + } + return CreateWalletDetailsStepViewed; +}()); +export { CreateWalletDetailsStepViewed }; +var CreateWalletDetailsSubmitted = /** @class */ (function () { + function CreateWalletDetailsSubmitted() { + this.event_type = 'Create Wallet Details Submitted'; + } + return CreateWalletDetailsSubmitted; +}()); +export { CreateWalletDetailsSubmitted }; +var CreateWalletLanguagePageViewed = /** @class */ (function () { + function CreateWalletLanguagePageViewed() { + this.event_type = 'Create Wallet Language Page Viewed'; + } + return CreateWalletLanguagePageViewed; +}()); +export { CreateWalletLanguagePageViewed }; +var CreateWalletLearnPhraseStepViewed = /** @class */ (function () { + function CreateWalletLearnPhraseStepViewed() { + this.event_type = 'Create Wallet Learn Phrase Step Viewed'; + } + return CreateWalletLearnPhraseStepViewed; +}()); +export { CreateWalletLearnPhraseStepViewed }; +var CreateWalletSavePhraseStepViewed = /** @class */ (function () { + function CreateWalletSavePhraseStepViewed() { + this.event_type = 'Create Wallet Save Phrase Step Viewed'; + } + return CreateWalletSavePhraseStepViewed; +}()); +export { CreateWalletSavePhraseStepViewed }; +var CreateWalletSelectMethodPageViewed = /** @class */ (function () { + function CreateWalletSelectMethodPageViewed() { + this.event_type = 'Create Wallet Select Method Page Viewed'; + } + return CreateWalletSelectMethodPageViewed; +}()); +export { CreateWalletSelectMethodPageViewed }; +var CreateWalletTermsPageViewed = /** @class */ (function () { + function CreateWalletTermsPageViewed() { + this.event_type = 'Create Wallet Terms Page Viewed'; + } + return CreateWalletTermsPageViewed; +}()); +export { CreateWalletTermsPageViewed }; +var CreateWalletVerifyPhraseStepViewed = /** @class */ (function () { + function CreateWalletVerifyPhraseStepViewed() { + this.event_type = 'Create Wallet Verify Phrase Step Viewed'; + } + return CreateWalletVerifyPhraseStepViewed; +}()); +export { CreateWalletVerifyPhraseStepViewed }; +var CreateWalletVerifyPhraseWordSelected = /** @class */ (function () { + function CreateWalletVerifyPhraseWordSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Create Wallet Verify Phrase Word Selected'; + this.event_properties = event_properties; + } + return CreateWalletVerifyPhraseWordSelected; +}()); +export { CreateWalletVerifyPhraseWordSelected }; +var DappPopupAddCollateralPageViewed = /** @class */ (function () { + function DappPopupAddCollateralPageViewed() { + this.event_type = 'Dapp Popup Add Collateral Page Viewed'; + } + return DappPopupAddCollateralPageViewed; +}()); +export { DappPopupAddCollateralPageViewed }; +var DappPopupConnectWalletPageViewed = /** @class */ (function () { + function DappPopupConnectWalletPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Dapp Popup Connect Wallet Page Viewed'; + this.event_properties = event_properties; + } + return DappPopupConnectWalletPageViewed; +}()); +export { DappPopupConnectWalletPageViewed }; +var DappPopupConnectWalletPasswordPageViewed = /** @class */ (function () { + function DappPopupConnectWalletPasswordPageViewed() { + this.event_type = 'Dapp Popup Connect Wallet Password Page Viewed'; + } + return DappPopupConnectWalletPasswordPageViewed; +}()); +export { DappPopupConnectWalletPasswordPageViewed }; +var DappPopupSignTransactionPageViewed = /** @class */ (function () { + function DappPopupSignTransactionPageViewed() { + this.event_type = 'Dapp Popup Sign Transaction Page Viewed'; + } + return DappPopupSignTransactionPageViewed; +}()); +export { DappPopupSignTransactionPageViewed }; +var DappPopupSignTransactionSubmitted = /** @class */ (function () { + function DappPopupSignTransactionSubmitted() { + this.event_type = 'Dapp Popup Sign Transaction Submitted'; + } + return DappPopupSignTransactionSubmitted; +}()); +export { DappPopupSignTransactionSubmitted }; +var GovernanceChooseDrepPageViewed = /** @class */ (function () { + function GovernanceChooseDrepPageViewed() { + this.event_type = 'Governance Choose Drep Page Viewed'; + } + return GovernanceChooseDrepPageViewed; +}()); +export { GovernanceChooseDrepPageViewed }; +var GovernanceConfirmTransactionPageViewed = /** @class */ (function () { + function GovernanceConfirmTransactionPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Governance Confirm Transaction Page Viewed'; + this.event_properties = event_properties; + } + return GovernanceConfirmTransactionPageViewed; +}()); +export { GovernanceConfirmTransactionPageViewed }; +var GovernanceDashboardPageViewed = /** @class */ (function () { + function GovernanceDashboardPageViewed() { + this.event_type = 'Governance Dashboard Page Viewed'; + } + return GovernanceDashboardPageViewed; +}()); +export { GovernanceDashboardPageViewed }; +var GovernanceTransactionSuccessPageViewed = /** @class */ (function () { + function GovernanceTransactionSuccessPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Governance Transaction Success Page Viewed'; + this.event_properties = event_properties; + } + return GovernanceTransactionSuccessPageViewed; +}()); +export { GovernanceTransactionSuccessPageViewed }; +var NetworkSelected = /** @class */ (function () { + function NetworkSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Network Selected'; + this.event_properties = event_properties; + } + return NetworkSelected; +}()); +export { NetworkSelected }; +var NftGalleryDetailsImageViewed = /** @class */ (function () { + function NftGalleryDetailsImageViewed() { + this.event_type = 'NFT Gallery Details Image Viewed'; + } + return NftGalleryDetailsImageViewed; +}()); +export { NftGalleryDetailsImageViewed }; +var NftGalleryDetailsNavigation = /** @class */ (function () { + function NftGalleryDetailsNavigation(event_properties) { + this.event_properties = event_properties; + this.event_type = 'NFT Gallery Details Navigation'; + this.event_properties = event_properties; + } + return NftGalleryDetailsNavigation; +}()); +export { NftGalleryDetailsNavigation }; +var NftGalleryDetailsPageViewed = /** @class */ (function () { + function NftGalleryDetailsPageViewed() { + this.event_type = 'NFT Gallery Details Page Viewed'; + } + return NftGalleryDetailsPageViewed; +}()); +export { NftGalleryDetailsPageViewed }; +var NftGalleryDetailsTab = /** @class */ (function () { + function NftGalleryDetailsTab(event_properties) { + this.event_properties = event_properties; + this.event_type = 'NFT Gallery Details Tab'; + this.event_properties = event_properties; + } + return NftGalleryDetailsTab; +}()); +export { NftGalleryDetailsTab }; +var NftGalleryGridViewSelected = /** @class */ (function () { + function NftGalleryGridViewSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'NFT Gallery Grid View Selected'; + this.event_properties = event_properties; + } + return NftGalleryGridViewSelected; +}()); +export { NftGalleryGridViewSelected }; +var NftGalleryPageViewed = /** @class */ (function () { + function NftGalleryPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'NFT Gallery Page Viewed'; + this.event_properties = event_properties; + } + return NftGalleryPageViewed; +}()); +export { NftGalleryPageViewed }; +var NftGallerySearchActivated = /** @class */ (function () { + function NftGallerySearchActivated(event_properties) { + this.event_properties = event_properties; + this.event_type = 'NFT Gallery Search Activated'; + this.event_properties = event_properties; + } + return NftGallerySearchActivated; +}()); +export { NftGallerySearchActivated }; +var OnboardingAnalyticsPageViewed = /** @class */ (function () { + function OnboardingAnalyticsPageViewed() { + this.event_type = 'Onboarding Analytics Page Viewed'; + } + return OnboardingAnalyticsPageViewed; +}()); +export { OnboardingAnalyticsPageViewed }; +var PortfolioTokenDetails = /** @class */ (function () { + function PortfolioTokenDetails(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Portfolio Token Details'; + this.event_properties = event_properties; + } + return PortfolioTokenDetails; +}()); +export { PortfolioTokenDetails }; +var PortfolioTokensListPageViewed = /** @class */ (function () { + function PortfolioTokensListPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Portfolio Tokens List Page Viewed'; + this.event_properties = event_properties; + } + return PortfolioTokensListPageViewed; +}()); +export { PortfolioTokensListPageViewed }; +var PortfolioTokensListSearchActivated = /** @class */ (function () { + function PortfolioTokensListSearchActivated(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Portfolio Tokens List Search Activated'; + this.event_properties = event_properties; + } + return PortfolioTokensListSearchActivated; +}()); +export { PortfolioTokensListSearchActivated }; +var ReceiveAmountGeneratedPageViewed = /** @class */ (function () { + function ReceiveAmountGeneratedPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Receive Amount Generated Page Viewed'; + this.event_properties = event_properties; + } + return ReceiveAmountGeneratedPageViewed; +}()); +export { ReceiveAmountGeneratedPageViewed }; +var ReceiveAmountPageViewed = /** @class */ (function () { + function ReceiveAmountPageViewed() { + this.event_type = 'Receive Amount Page Viewed'; + } + return ReceiveAmountPageViewed; +}()); +export { ReceiveAmountPageViewed }; +var ReceiveCopyAddressClicked = /** @class */ (function () { + function ReceiveCopyAddressClicked(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Receive Copy Address Clicked'; + this.event_properties = event_properties; + } + return ReceiveCopyAddressClicked; +}()); +export { ReceiveCopyAddressClicked }; +var ReceiveGenerateNewAddressClicked = /** @class */ (function () { + function ReceiveGenerateNewAddressClicked() { + this.event_type = 'Receive Generate New Address Clicked'; + } + return ReceiveGenerateNewAddressClicked; +}()); +export { ReceiveGenerateNewAddressClicked }; +var ReceivePageListViewed = /** @class */ (function () { + function ReceivePageListViewed() { + this.event_type = 'Receive Page List Viewed'; + } + return ReceivePageListViewed; +}()); +export { ReceivePageListViewed }; +var ReceivePageViewed = /** @class */ (function () { + function ReceivePageViewed() { + this.event_type = 'Receive Page Viewed'; + } + return ReceivePageViewed; +}()); +export { ReceivePageViewed }; +var ReceiveShareAddressClicked = /** @class */ (function () { + function ReceiveShareAddressClicked() { + this.event_type = 'Receive Share Address Clicked'; + } + return ReceiveShareAddressClicked; +}()); +export { ReceiveShareAddressClicked }; +var RestoreWalletDetailsSettled = /** @class */ (function () { + function RestoreWalletDetailsSettled() { + this.event_type = 'Restore Wallet Details Settled'; + } + return RestoreWalletDetailsSettled; +}()); +export { RestoreWalletDetailsSettled }; +var RestoreWalletDetailsStepViewed = /** @class */ (function () { + function RestoreWalletDetailsStepViewed() { + this.event_type = 'Restore Wallet Details Step Viewed'; + } + return RestoreWalletDetailsStepViewed; +}()); +export { RestoreWalletDetailsStepViewed }; +var RestoreWalletEnterPhraseStepStatus = /** @class */ (function () { + function RestoreWalletEnterPhraseStepStatus(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Restore Wallet Enter Phrase Step Status'; + this.event_properties = event_properties; + } + return RestoreWalletEnterPhraseStepStatus; +}()); +export { RestoreWalletEnterPhraseStepStatus }; +var RestoreWalletEnterPhraseStepViewed = /** @class */ (function () { + function RestoreWalletEnterPhraseStepViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Restore Wallet Enter Phrase Step Viewed'; + this.event_properties = event_properties; + } + return RestoreWalletEnterPhraseStepViewed; +}()); +export { RestoreWalletEnterPhraseStepViewed }; +var RestoreWalletTypeStepViewed = /** @class */ (function () { + function RestoreWalletTypeStepViewed() { + this.event_type = 'Restore Wallet Type Step Viewed'; + } + return RestoreWalletTypeStepViewed; +}()); +export { RestoreWalletTypeStepViewed }; +var SellAdaInputAmount = /** @class */ (function () { + function SellAdaInputAmount() { + this.event_type = 'Sell Ada Input Amount'; + } + return SellAdaInputAmount; +}()); +export { SellAdaInputAmount }; +var SellAdaSuccessRedirect = /** @class */ (function () { + function SellAdaSuccessRedirect() { + this.event_type = 'Sell Ada Success Redirect'; + } + return SellAdaSuccessRedirect; +}()); +export { SellAdaSuccessRedirect }; +var SendInitiated = /** @class */ (function () { + function SendInitiated() { + this.event_type = 'Send Initiated'; + } + return SendInitiated; +}()); +export { SendInitiated }; +var SendSelectAssetPageViewed = /** @class */ (function () { + function SendSelectAssetPageViewed() { + this.event_type = 'Send Select Asset Page Viewed'; + } + return SendSelectAssetPageViewed; +}()); +export { SendSelectAssetPageViewed }; +var SendSelectAssetSelected = /** @class */ (function () { + function SendSelectAssetSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Send Select Asset Selected'; + this.event_properties = event_properties; + } + return SendSelectAssetSelected; +}()); +export { SendSelectAssetSelected }; +var SendSelectAssetUpdated = /** @class */ (function () { + function SendSelectAssetUpdated(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Send Select Asset Updated'; + this.event_properties = event_properties; + } + return SendSelectAssetUpdated; +}()); +export { SendSelectAssetUpdated }; +var SendSummaryPageViewed = /** @class */ (function () { + function SendSummaryPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Send Summary Page Viewed'; + this.event_properties = event_properties; + } + return SendSummaryPageViewed; +}()); +export { SendSummaryPageViewed }; +var SendSummarySubmitted = /** @class */ (function () { + function SendSummarySubmitted(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Send Summary Submitted'; + this.event_properties = event_properties; + } + return SendSummarySubmitted; +}()); +export { SendSummarySubmitted }; +var SettingsPageViewed = /** @class */ (function () { + function SettingsPageViewed() { + this.event_type = 'Settings Page Viewed'; + } + return SettingsPageViewed; +}()); +export { SettingsPageViewed }; +var StakingCenterDelegationInitiated = /** @class */ (function () { + function StakingCenterDelegationInitiated() { + this.event_type = 'Staking Center Delegation Initiated'; + } + return StakingCenterDelegationInitiated; +}()); +export { StakingCenterDelegationInitiated }; +var StakingCenterPageViewed = /** @class */ (function () { + function StakingCenterPageViewed() { + this.event_type = 'Staking Center Page Viewed'; + } + return StakingCenterPageViewed; +}()); +export { StakingCenterPageViewed }; +var SwapAssetFromChanged = /** @class */ (function () { + function SwapAssetFromChanged(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Asset From Changed'; + this.event_properties = event_properties; + } + return SwapAssetFromChanged; +}()); +export { SwapAssetFromChanged }; +var SwapAssetToChanged = /** @class */ (function () { + function SwapAssetToChanged(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Asset To Changed'; + this.event_properties = event_properties; + } + return SwapAssetToChanged; +}()); +export { SwapAssetToChanged }; +var SwapCancelationSubmitted = /** @class */ (function () { + function SwapCancelationSubmitted(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Cancelation Submitted'; + this.event_properties = event_properties; + } + return SwapCancelationSubmitted; +}()); +export { SwapCancelationSubmitted }; +var SwapConfirmedPageViewed = /** @class */ (function () { + function SwapConfirmedPageViewed(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Confirmed Page Viewed'; + this.event_properties = event_properties; + } + return SwapConfirmedPageViewed; +}()); +export { SwapConfirmedPageViewed }; +var SwapInitiated = /** @class */ (function () { + function SwapInitiated(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Initiated'; + this.event_properties = event_properties; + } + return SwapInitiated; +}()); +export { SwapInitiated }; +var SwapOrderSelected = /** @class */ (function () { + function SwapOrderSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Order Selected'; + this.event_properties = event_properties; + } + return SwapOrderSelected; +}()); +export { SwapOrderSelected }; +var SwapOrderSubmitted = /** @class */ (function () { + function SwapOrderSubmitted(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Order Submitted'; + this.event_properties = event_properties; + } + return SwapOrderSubmitted; +}()); +export { SwapOrderSubmitted }; +var SwapPoolChanged = /** @class */ (function () { + function SwapPoolChanged() { + this.event_type = 'Swap Pool Changed'; + } + return SwapPoolChanged; +}()); +export { SwapPoolChanged }; +var SwapSlippageChanged = /** @class */ (function () { + function SwapSlippageChanged(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Swap Slippage Changed'; + this.event_properties = event_properties; + } + return SwapSlippageChanged; +}()); +export { SwapSlippageChanged }; +var ThemeSelected = /** @class */ (function () { + function ThemeSelected(event_properties) { + this.event_properties = event_properties; + this.event_type = 'Theme Selected'; + this.event_properties = event_properties; + } + return ThemeSelected; +}()); +export { ThemeSelected }; +var TransactionsPageViewed = /** @class */ (function () { + function TransactionsPageViewed() { + this.event_type = 'Transactions Page Viewed'; + } + return TransactionsPageViewed; +}()); +export { TransactionsPageViewed }; +var VotingPageViewed = /** @class */ (function () { + function VotingPageViewed() { + this.event_type = 'Voting Page Viewed'; + } + return VotingPageViewed; +}()); +export { VotingPageViewed }; +var WalletPageViewed = /** @class */ (function () { + function WalletPageViewed() { + this.event_type = 'Wallet Page Viewed'; + } + return WalletPageViewed; +}()); +export { WalletPageViewed }; +var getVoidPromiseResult = function () { return ({ promise: Promise.resolve() }); }; // prettier-ignore -export class Ampli { - private disabled: boolean = false; - private amplitude?: BrowserClient; - - get client(): BrowserClient { - this.isInitializedAndEnabled(); - return this.amplitude!; - } - - get isLoaded(): boolean { - return this.amplitude != null; - } - - private isInitializedAndEnabled(): boolean { - if (!this.amplitude) { - console.error('ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?'); - return false; - } - return !this.disabled; - } - - /** - * Initialize the Ampli SDK. Call once when your application starts. - * - * @param options Configuration options to initialize the Ampli SDK with. - */ - load(options: LoadOptions): PromiseResult { - this.disabled = options.disabled ?? false; - - if (this.amplitude) { - console.warn('WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup.'); - return getVoidPromiseResult(); - } - - let apiKey: string | null = null; - if (options.client && 'apiKey' in options.client) { - apiKey = options.client.apiKey; - } else if ('environment' in options) { - apiKey = ApiKey[options.environment]; - } - - if (options.client && 'instance' in options.client) { - this.amplitude = options.client.instance; - } else if (apiKey) { - this.amplitude = amplitude.createInstance(); - const configuration = (options.client && 'configuration' in options.client) ? options.client.configuration : {}; - return this.amplitude.init(apiKey, undefined, { ...DefaultConfiguration, ...configuration }); - } else { - console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'"); - } - - return getVoidPromiseResult(); - } - - /** - * Identify a user and set user properties. - * - * @param userId The user's id. - * @param options Optional event options. - */ - identify( - userId: string | undefined, - options?: EventOptions, - ): PromiseResult { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - - if (userId) { - options = {...options, user_id: userId}; - } - - const amplitudeIdentify = new amplitude.Identify(); - return this.amplitude!.identify( - amplitudeIdentify, - options, - ); - } - - /** - * Flush the event. - */ - flush() : PromiseResult { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - - return this.amplitude!.flush(); - } - - /** - * Track event - * - * @param event The event to track. - * @param options Optional event options. - */ - track(event: Event, options?: EventOptions): PromiseResult { - if (!this.isInitializedAndEnabled()) { - return getVoidPromiseResult(); - } - - return this.amplitude!.track(event, undefined, options); - } - - /** - * (to delete)Governance Abstain Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/(to%20delete)Governance%20Abstain%20Page%20Viewed) - * - * This event tracks when a user selects abstain governance status and the confirm transaction page is displayed - * - * @param options Amplitude event options. - */ - toDeleteGovernanceAbstainPageViewed( - options?: EventOptions, - ) { - return this.track(new ToDeleteGovernanceAbstainPageViewed(), options); - } - - /** - * All Wallets Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/All%20Wallets%20Page%20Viewed) - * - * This event tracks when a user views the All Wallets page on Menu. Note: only available on Yoroi Mobile. - * - * @param options Amplitude event options. - */ - allWalletsPageViewed( - options?: EventOptions, - ) { - return this.track(new AllWalletsPageViewed(), options); - } - - /** - * Assets Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Assets%20Page%20Viewed) - * - * This event tracks when a user views the Assets page. - * On mobile is available on the wallet page (First item from main menu) in the assets tab. - * - * @param options Amplitude event options. - */ - assetsPageViewed( - options?: EventOptions, - ) { - return this.track(new AssetsPageViewed(), options); - } - - /** - * Buy Ada Input Amount - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Input%20Amount) - * - * Event to track when a user starts the buy flow and must input amount of ADA to buy - * - * @param options Amplitude event options. - */ - buyAdaInputAmount( - options?: EventOptions, - ) { - return this.track(new BuyAdaInputAmount(), options); - } - - /** - * Buy Ada Success Redirect - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Success%20Redirect) - * - * This event tracks when a user is redirected to Yoroi after successfully buying ADA - * - * @param options Amplitude event options. - */ - buyAdaSuccessRedirect( - options?: EventOptions, - ) { - return this.track(new BuyAdaSuccessRedirect(), options); - } - - /** - * Claim ADA Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20ADA%20Page%20Viewed) - * - * This event tracks when a user views the page to claim Claim /Transfer ADA page in Extension. - * - * You can find that page under Staking section. - * - * @param options Amplitude event options. - */ - claimAdaPageViewed( - options?: EventOptions, - ) { - return this.track(new ClaimAdaPageViewed(), options); - } - - /** - * Claim Ada Transaction Settled - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Settled) - * - * Event to track when a user successfully claims ADA and transaction is settled on chain - * - * @param properties The event's properties (e.g. reward_amount) - * @param options Amplitude event options. - */ - claimAdaTransactionSettled( - properties: ClaimAdaTransactionSettledProperties, - options?: EventOptions, - ) { - return this.track(new ClaimAdaTransactionSettled(properties), options); - } - - /** - * Claim Ada Transaction Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Submitted) - * - * This Event to track when a user submits a transaction to claim ADA. - * - * @param properties The event's properties (e.g. reward_amount) - * @param options Amplitude event options. - */ - claimAdaTransactionSubmitted( - properties: ClaimAdaTransactionSubmittedProperties, - options?: EventOptions, - ) { - return this.track(new ClaimAdaTransactionSubmitted(properties), options); - } - - /** - * Connect Wallet Check Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Check%20Page%20Viewed) - * - * This event tracks when user chooses the connect hardware wallet option. This is the 1st step of the connect hardware wallet flow. In this page, the information about connecting a harware wallet is displayed to the user. - * - * @param options Amplitude event options. - */ - connectWalletCheckPageViewed( - options?: EventOptions, - ) { - return this.track(new ConnectWalletCheckPageViewed(), options); - } - - /** - * Connect Wallet Connect Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Connect%20Page%20Viewed) - * - * This event tracks when user connects the device and instructions are displayed. This is the 2nd step of the flow. - * - * @param options Amplitude event options. - */ - connectWalletConnectPageViewed( - options?: EventOptions, - ) { - return this.track(new ConnectWalletConnectPageViewed(), options); - } - - /** - * Connect Wallet Details Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Page%20Viewed) - * - * This event tracks when user accesses the enter wallet name page. This is the 3rd and final step of the flow - * - * @param options Amplitude event options. - */ - connectWalletDetailsPageViewed( - options?: EventOptions, - ) { - return this.track(new ConnectWalletDetailsPageViewed(), options); - } - - /** - * Connect Wallet Details Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Submitted) - * - * This event captures the submission of the wallet name on the last step of the connecting a hardware wallet flow. - * - * @param properties The event's properties (e.g. hardware_wallet) - * @param options Amplitude event options. - */ - connectWalletDetailsSubmitted( - properties: ConnectWalletDetailsSubmittedProperties, - options?: EventOptions, - ) { - return this.track(new ConnectWalletDetailsSubmitted(properties), options); - } - - /** - * Connector Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connector%20Page%20Viewed) - * - * This event tracks when a user views the dApp Connector page. - * - * @param options Amplitude event options. - */ - connectorPageViewed( - options?: EventOptions, - ) { - return this.track(new ConnectorPageViewed(), options); - } - - /** - * Create Wallet Details Settled - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Settled) - * - * When the wallet is created correctly. This event signifies the completion of the process of setting up wallet details during the creation of a new wallet - * - * @param options Amplitude event options. - */ - createWalletDetailsSettled( - options?: EventOptions, - ) { - return this.track(new CreateWalletDetailsSettled(), options); - } - - /** - * Create Wallet Details Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Step%20Viewed) - * - * This event tracks when a user views the details \*\*step 4\*\* while creating a wallet. User will introduce: \* Wallet Name \* Password \* Repeat Password - * - * @param options Amplitude event options. - */ - createWalletDetailsStepViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletDetailsStepViewed(), options); - } - - /** - * Create Wallet Details Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Submitted) - * - * This event captures the submission of the wallet creation on the last step of the flow (\*\*step 4\*\*). - * - * @param options Amplitude event options. - */ - createWalletDetailsSubmitted( - options?: EventOptions, - ) { - return this.track(new CreateWalletDetailsSubmitted(), options); - } - - /** - * Create Wallet Language Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Language%20Page%20Viewed) - * - * This event tracks when a user views the page for selecting the language during the wallet creation process on the first time he launch Yoroi. - * - * @param options Amplitude event options. - */ - createWalletLanguagePageViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletLanguagePageViewed(), options); - } - - /** - * Create Wallet Learn Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Learn%20Phrase%20Step%20Viewed) - * - * This event tracks when a user view the \*\*first step\*\* of learn about recovery prhase - * - * @param options Amplitude event options. - */ - createWalletLearnPhraseStepViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletLearnPhraseStepViewed(), options); - } - - /** - * Create Wallet Save Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Save%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the \*\*second step\*\* to save their wallet recovery phrase during the wallet creation process - * - * @param options Amplitude event options. - */ - createWalletSavePhraseStepViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletSavePhraseStepViewed(), options); - } - - /** - * Create Wallet Select Method Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Select%20Method%20Page%20Viewed) - * - * This event tracks when a user views the page where they can select the method to create a wallet: - * - * \* Create new wallet - * - * \* Restore existing wallet - * - * This event tracks when a user views the page where they can select the method to create a wallet\* Connect hardware wallet - * - * @param options Amplitude event options. - */ - createWalletSelectMethodPageViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletSelectMethodPageViewed(), options); - } - - /** - * Create Wallet Terms Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Terms%20Page%20Viewed) - * - * This event tracks when a user views the terms of service agreement page on the creation wallet flow - * - * @param options Amplitude event options. - */ - createWalletTermsPageViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletTermsPageViewed(), options); - } - - /** - * Create Wallet Verify Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the verification phrase step while creating a wallet - * - * @param options Amplitude event options. - */ - createWalletVerifyPhraseStepViewed( - options?: EventOptions, - ) { - return this.track(new CreateWalletVerifyPhraseStepViewed(), options); - } - - /** - * Create Wallet Verify Phrase Word Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Word%20Selected) - * - * This event tracks the selection of a specific word during the process of verifying the recovery phrase when creating a wallet - * - * @param properties The event's properties (e.g. recovery_word_order) - * @param options Amplitude event options. - */ - createWalletVerifyPhraseWordSelected( - properties?: CreateWalletVerifyPhraseWordSelectedProperties, - options?: EventOptions, - ) { - return this.track(new CreateWalletVerifyPhraseWordSelected(properties), options); - } - - /** - * Dapp Popup Add Collateral Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Add%20Collateral%20Page%20Viewed) - * - * This event tracks when a user views the "Add Collateral" page in the Dapp Connector Popup - * - * @param options Amplitude event options. - */ - dappPopupAddCollateralPageViewed( - options?: EventOptions, - ) { - return this.track(new DappPopupAddCollateralPageViewed(), options); - } - - /** - * Dapp Popup Connect Wallet Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Page%20Viewed) - * - * This event is triggered when the dapp connector popup is triggered and the user select the wallet that wants to connect. - * - * @param properties The event's properties (e.g. wallet_count) - * @param options Amplitude event options. - */ - dappPopupConnectWalletPageViewed( - properties: DappPopupConnectWalletPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new DappPopupConnectWalletPageViewed(properties), options); - } - - /** - * Dapp Popup Connect Wallet Password Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Password%20Page%20Viewed) - * - * This event tracks when a user attempts to connect their wallet by entering their password in the Dapp Connector popup - * - * @param options Amplitude event options. - */ - dappPopupConnectWalletPasswordPageViewed( - options?: EventOptions, - ) { - return this.track(new DappPopupConnectWalletPasswordPageViewed(), options); - } - - /** - * Dapp Popup Sign Transaction Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Page%20Viewed) - * - * This event tracks when a user loads a sign transaction screen on the dapp connector. Valid for extension and mobile. - * - * @param options Amplitude event options. - */ - dappPopupSignTransactionPageViewed( - options?: EventOptions, - ) { - return this.track(new DappPopupSignTransactionPageViewed(), options); - } - - /** - * Dapp Popup Sign Transaction Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Submitted) - * - * This event tracks the submission of a sign transaction request within the Dapp Connector screen. It's a Popup on extension and a full screen in Mobile. - * - * @param options Amplitude event options. - */ - dappPopupSignTransactionSubmitted( - options?: EventOptions, - ) { - return this.track(new DappPopupSignTransactionSubmitted(), options); - } - - /** - * Governance Choose Drep Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Choose%20Drep%20Page%20Viewed) - * - * This event tracks when user loads the bottom sheet on mobile or the popup on extension to introduce the Drep ID. To arrive to this page the user has to click on “Delegate to a Drep” section. - * - * @param options Amplitude event options. - */ - governanceChooseDrepPageViewed( - options?: EventOptions, - ) { - return this.track(new GovernanceChooseDrepPageViewed(), options); - } - - /** - * Governance Confirm Transaction Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Confirm%20Transaction%20Page%20Viewed) - * - * This event tracks when a user loads the confirm transaction page on the Governance flow. On Extension user would insert the password in that page. On extension user would do it in a bottom sheet afterwards. - * - * @param properties The event's properties (e.g. governance_selection) - * @param options Amplitude event options. - */ - governanceConfirmTransactionPageViewed( - properties: GovernanceConfirmTransactionPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new GovernanceConfirmTransactionPageViewed(properties), options); - } - - /** - * Governance Dashboard Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Dashboard%20Page%20Viewed) - * - * This event tracks when a user loads the Governance Dashboard Page. The page is reached via the main navigation menu in extension and in the bottom menu icon on Extension. - * - * @param options Amplitude event options. - */ - governanceDashboardPageViewed( - options?: EventOptions, - ) { - return this.track(new GovernanceDashboardPageViewed(), options); - } - - /** - * Governance Transaction Success Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Transaction%20Success%20Page%20Viewed) - * - * This event tracks when a user loads the success page at the end of the governance flow. - * - * @param properties The event's properties (e.g. governance_selection) - * @param options Amplitude event options. - */ - governanceTransactionSuccessPageViewed( - properties: GovernanceTransactionSuccessPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new GovernanceTransactionSuccessPageViewed(properties), options); - } - - /** - * Network Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Network%20Selected) - * - * Event to track when a user selects a network - * - * @param properties The event's properties (e.g. from_network) - * @param options Amplitude event options. - */ - networkSelected( - properties: NetworkSelectedProperties, - options?: EventOptions, - ) { - return this.track(new NetworkSelected(properties), options); - } - - /** - * NFT Gallery Details Image Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Image%20Viewed) - * - * This event tracks when a user views the NFT image at full screen - * - * @param options Amplitude event options. - */ - nftGalleryDetailsImageViewed( - options?: EventOptions, - ) { - return this.track(new NftGalleryDetailsImageViewed(), options); - } - - /** - * NFT Gallery Details Navigation - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Navigation) - * - * This event tracks when a use next and previous buttons to navigate across their NFTs. Note: available only on Extension. - * - * @param properties The event's properties (e.g. nft_navigation) - * @param options Amplitude event options. - */ - nftGalleryDetailsNavigation( - properties: NftGalleryDetailsNavigationProperties, - options?: EventOptions, - ) { - return this.track(new NftGalleryDetailsNavigation(properties), options); - } - - /** - * NFT Gallery Details Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Page%20Viewed) - * - * This event tracks when a user views the details page of an NFT item. - * - * @param options Amplitude event options. - */ - nftGalleryDetailsPageViewed( - options?: EventOptions, - ) { - return this.track(new NftGalleryDetailsPageViewed(), options); - } - - /** - * NFT Gallery Details Tab - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Tab) - * - * This event tracks user interactions with the tab in the NFT Gallery details page. It provides insights into how users engage with specific details of NFTs, such as descriptions, attributes, or additional information - * - * @param properties The event's properties (e.g. nft_tab) - * @param options Amplitude event options. - */ - nftGalleryDetailsTab( - properties: NftGalleryDetailsTabProperties, - options?: EventOptions, - ) { - return this.track(new NftGalleryDetailsTab(properties), options); - } - - /** - * NFT Gallery Grid View Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Grid%20View%20Selected) - * - * This event is triggered when a user selects the grid view option in the NFT gallery - * - * @param properties The event's properties (e.g. nft_grid_view) - * @param options Amplitude event options. - */ - nftGalleryGridViewSelected( - properties?: NftGalleryGridViewSelectedProperties, - options?: EventOptions, - ) { - return this.track(new NftGalleryGridViewSelected(properties), options); - } - - /** - * NFT Gallery Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Page%20Viewed) - * - * This event tracks when the NFT gallery it has loaded all nfts metadata - * - * @param properties The event's properties (e.g. nft_count) - * @param options Amplitude event options. - */ - nftGalleryPageViewed( - properties: NftGalleryPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new NftGalleryPageViewed(properties), options); - } - - /** - * NFT Gallery Search Activated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Search%20Activated) - * - * User activates and starts a search in the NFT gallery. Delay of 0.5 seconds. - * - * @param properties The event's properties (e.g. nft_count) - * @param options Amplitude event options. - */ - nftGallerySearchActivated( - properties: NftGallerySearchActivatedProperties, - options?: EventOptions, - ) { - return this.track(new NftGallerySearchActivated(properties), options); - } - - /** - * Onboarding Analytics Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Onboarding%20Analytics%20Page%20Viewed) - * - * Event to track when a user views the onboarding analytics page. - * - * @param options Amplitude event options. - */ - onboardingAnalyticsPageViewed( - options?: EventOptions, - ) { - return this.track(new OnboardingAnalyticsPageViewed(), options); - } - - /** - * Portfolio Token Details - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Token%20Details) - * - * When user visit the detailed information about a specific token within a user's portfolio. In mobile there's 3 tabs that would be implemented in different iterations. - * - * @param properties The event's properties (e.g. token_details_tab) - * @param options Amplitude event options. - */ - portfolioTokenDetails( - properties: PortfolioTokenDetailsProperties, - options?: EventOptions, - ) { - return this.track(new PortfolioTokenDetails(properties), options); - } - - /** - * Portfolio Tokens List Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Page%20Viewed) - * - * Event to track when a user views the list of tokens in their portfolio. - * - * @param properties The event's properties (e.g. tokens_tab) - * @param options Amplitude event options. - */ - portfolioTokensListPageViewed( - properties: PortfolioTokensListPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new PortfolioTokensListPageViewed(properties), options); - } - - /** - * Portfolio Tokens List Search Activated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Search%20Activated) - * - * This event tracks when a user activates and starts a search in the Tokens list page. Delay of 0.5 seconds. - * - * @param properties The event's properties (e.g. search_term) - * @param options Amplitude event options. - */ - portfolioTokensListSearchActivated( - properties: PortfolioTokensListSearchActivatedProperties, - options?: EventOptions, - ) { - return this.track(new PortfolioTokensListSearchActivated(properties), options); - } - - /** - * Receive Amount Generated Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Generated%20Page%20Viewed) - * - * When the bottom sheet or popup with a generated address with an specific amount is loaded - * - * @param properties The event's properties (e.g. ada_amount) - * @param options Amplitude event options. - */ - receiveAmountGeneratedPageViewed( - properties: ReceiveAmountGeneratedPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new ReceiveAmountGeneratedPageViewed(properties), options); - } - - /** - * Receive Amount Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Page%20Viewed) - * - * When a user visit the page to insert specific amount of ADA that would be needed to generate a wallet address with that specific details. - * - * @param options Amplitude event options. - */ - receiveAmountPageViewed( - options?: EventOptions, - ) { - return this.track(new ReceiveAmountPageViewed(), options); - } - - /** - * Receive Copy Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Copy%20Address%20Clicked) - * - * When a user click on the any CTA to copy their address - * - * @param properties The event's properties (e.g. copy_address_location) - * @param options Amplitude event options. - */ - receiveCopyAddressClicked( - properties: ReceiveCopyAddressClickedProperties, - options?: EventOptions, - ) { - return this.track(new ReceiveCopyAddressClicked(properties), options); - } - - /** - * Receive Generate New Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Generate%20New%20Address%20Clicked) - * - * When a user click on the Generate new address button on the main receive page on the multiple address flow. - * - * @param options Amplitude event options. - */ - receiveGenerateNewAddressClicked( - options?: EventOptions, - ) { - return this.track(new ReceiveGenerateNewAddressClicked(), options); - } - - /** - * Receive Page List Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20List%20Viewed) - * - * When user has enabled multiple addresses and goes to the page where he can see the list of generated wallet addresses - * - * @param options Amplitude event options. - */ - receivePageListViewed( - options?: EventOptions, - ) { - return this.track(new ReceivePageListViewed(), options); - } - - /** - * Receive Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20Viewed) - * - * When user loads the Receive funds screen, where user can see their wallet address with a QR Code - * - * @param options Amplitude event options. - */ - receivePageViewed( - options?: EventOptions, - ) { - return this.track(new ReceivePageViewed(), options); - } - - /** - * Receive Share Address Clicked - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Share%20Address%20Clicked) - * - * When a user click on the link to share the address - * - * @param options Amplitude event options. - */ - receiveShareAddressClicked( - options?: EventOptions, - ) { - return this.track(new ReceiveShareAddressClicked(), options); - } - - /** - * Restore Wallet Details Settled - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Settled) - * - * This event captures the details of a wallet restoration process that has been successfully completed - * - * @param options Amplitude event options. - */ - restoreWalletDetailsSettled( - options?: EventOptions, - ) { - return this.track(new RestoreWalletDetailsSettled(), options); - } - - /** - * Restore Wallet Details Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Step%20Viewed) - * - * Track when user loads the page where user inserts wallet name and password - * - * @param options Amplitude event options. - */ - restoreWalletDetailsStepViewed( - options?: EventOptions, - ) { - return this.track(new RestoreWalletDetailsStepViewed(), options); - } - - /** - * Restore Wallet Enter Phrase Step Status - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Status) - * - * This events tracks the validation of the recovery phrase is verified, once the user insert the latest word. The output can be positive or negative and we do save that in he property: recovery*prhase*status - * - * @param properties The event's properties (e.g. recovery_prhase_status) - * @param options Amplitude event options. - */ - restoreWalletEnterPhraseStepStatus( - properties: RestoreWalletEnterPhraseStepStatusProperties, - options?: EventOptions, - ) { - return this.track(new RestoreWalletEnterPhraseStepStatus(properties), options); - } - - /** - * Restore Wallet Enter Phrase Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Viewed) - * - * This event tracks when a user views the step to enter the recovery phrase while restoring a wallet (**Step 2**). - * - * @param properties The event's properties (e.g. recovery_phrase_lenght) - * @param options Amplitude event options. - */ - restoreWalletEnterPhraseStepViewed( - properties: RestoreWalletEnterPhraseStepViewedProperties, - options?: EventOptions, - ) { - return this.track(new RestoreWalletEnterPhraseStepViewed(properties), options); - } - - /** - * Restore Wallet Type Step Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Type%20Step%20Viewed) - * - * This event tracks when a user views the **first step after** selecting restore wallet, were they have to choose between: - * - * * 15-word recovery phrase - * - * * 24-word recovery phrase - * - * @param options Amplitude event options. - */ - restoreWalletTypeStepViewed( - options?: EventOptions, - ) { - return this.track(new RestoreWalletTypeStepViewed(), options); - } - - /** - * Sell Ada Input Amount - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Input%20Amount) - * - * Event to track when user starts the Sell ada flow so after selecting the sell option and having to input amount of ADA to sell - * - * @param options Amplitude event options. - */ - sellAdaInputAmount( - options?: EventOptions, - ) { - return this.track(new SellAdaInputAmount(), options); - } - - /** - * Sell Ada Success Redirect - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Success%20Redirect) - * - * This event tracks when a user is redirected to Yoroi after successfully selling ADA - * - * @param options Amplitude event options. - */ - sellAdaSuccessRedirect( - options?: EventOptions, - ) { - return this.track(new SellAdaSuccessRedirect(), options); - } - - /** - * Send Initiated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Initiated) - * - * This event tracks when a user loads the default state of the first step of the multiasset transaction flow. That screen shows receiver address and optional memo - * - * @param options Amplitude event options. - */ - sendInitiated( - options?: EventOptions, - ) { - return this.track(new SendInitiated(), options); - } - - /** - * Send Select Asset Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Page%20Viewed) - * - * This event tracks when a user views the "Amount" page in the send flow. - * - * @param options Amplitude event options. - */ - sendSelectAssetPageViewed( - options?: EventOptions, - ) { - return this.track(new SendSelectAssetPageViewed(), options); - } - - /** - * Send Select Asset Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Selected) - * - * When a user click "next" on the send flow: "Amount" step on extension / "Assets added" in mobile - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - sendSelectAssetSelected( - properties: SendSelectAssetSelectedProperties, - options?: EventOptions, - ) { - return this.track(new SendSelectAssetSelected(properties), options); - } - - /** - * Send Select Asset Updated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Updated) - * - * When an user update the tokens selection on "amount" step: - * \- Add - * \- Remove - * \- Updated - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - sendSelectAssetUpdated( - properties: SendSelectAssetUpdatedProperties, - options?: EventOptions, - ) { - return this.track(new SendSelectAssetUpdated(properties), options); - } - - /** - * Send Summary Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Page%20Viewed) - * - * When a user loads the Preview page (Could be called comfirmation too) on the send flow. - * - * @param properties The event's properties (e.g. asset_count) - * @param options Amplitude event options. - */ - sendSummaryPageViewed( - properties: SendSummaryPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new SendSummaryPageViewed(properties), options); - } - - /** - * Send Summary Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Submitted) - * - * When a user click "send" on the "Preview" step on the send flow. - * - * @param properties The event's properties (e.g. ada_amount) - * @param options Amplitude event options. - */ - sendSummarySubmitted( - properties: SendSummarySubmittedProperties, - options?: EventOptions, - ) { - return this.track(new SendSummarySubmitted(properties), options); - } - - /** - * Settings Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Settings%20Page%20Viewed) - * - * This event tracks when a user views the settings page within the application. - * - * @param options Amplitude event options. - */ - settingsPageViewed( - options?: EventOptions, - ) { - return this.track(new SettingsPageViewed(), options); - } - - /** - * Staking Center Delegation Initiated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Delegation%20Initiated) - * - * Event to track when a user initiates the delegation process in the Staking Center, accessing the delegate modal after selecting a pool - * - * @param options Amplitude event options. - */ - stakingCenterDelegationInitiated( - options?: EventOptions, - ) { - return this.track(new StakingCenterDelegationInitiated(), options); - } - - /** - * Staking Center Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Page%20Viewed) - * - * This event tracks when a user views the Staking Center page on Staking menu. - * - * @param options Amplitude event options. - */ - stakingCenterPageViewed( - options?: EventOptions, - ) { - return this.track(new StakingCenterPageViewed(), options); - } - - /** - * Swap Asset From Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20From%20Changed) - * - * When user changed the selected asset on "From" section - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_asset) - * @param options Amplitude event options. - */ - swapAssetFromChanged( - properties: SwapAssetFromChangedProperties, - options?: EventOptions, - ) { - return this.track(new SwapAssetFromChanged(properties), options); - } - - /** - * Swap Asset To Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20To%20Changed) - * - * When user changed the selected asset on "To" section - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. to_asset) - * @param options Amplitude event options. - */ - swapAssetToChanged( - properties: SwapAssetToChangedProperties, - options?: EventOptions, - ) { - return this.track(new SwapAssetToChanged(properties), options); - } - - /** - * Swap Cancelation Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Cancelation%20Submitted) - * - * When user sign a transaction to cancel the swap order - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - swapCancelationSubmitted( - properties: SwapCancelationSubmittedProperties, - options?: EventOptions, - ) { - return this.track(new SwapCancelationSubmitted(properties), options); - } - - /** - * Swap Confirmed Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Confirmed%20%20Page%20Viewed) - * - * When the user opens Completed Order page - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. swap_tab) - * @param options Amplitude event options. - */ - swapConfirmedPageViewed( - properties: SwapConfirmedPageViewedProperties, - options?: EventOptions, - ) { - return this.track(new SwapConfirmedPageViewed(properties), options); - } - - /** - * Swap Initiated - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Initiated) - * - * When user clicks on the swap feature and sees the default state of the swap. - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_asset) - * @param options Amplitude event options. - */ - swapInitiated( - properties: SwapInitiatedProperties, - options?: EventOptions, - ) { - return this.track(new SwapInitiated(properties), options); - } - - /** - * Swap Order Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Selected) - * - * When user click on "swap" button after selecting asset from, entering the amount of asset form, selecting asset to, entering amount of asset to, and choosing a pool - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - swapOrderSelected( - properties: SwapOrderSelectedProperties, - options?: EventOptions, - ) { - return this.track(new SwapOrderSelected(properties), options); - } - - /** - * Swap Order Submitted - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Submitted) - * - * When user click confirm on the check out page, after entering their spending password - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. from_amount) - * @param options Amplitude event options. - */ - swapOrderSubmitted( - properties: SwapOrderSubmittedProperties, - options?: EventOptions, - ) { - return this.track(new SwapOrderSubmitted(properties), options); - } - - /** - * Swap Pool Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Pool%20Changed) - * - * When user clicked a different pool on the "Select Pool" page - * - * Owner: Sergio SF - * - * @param options Amplitude event options. - */ - swapPoolChanged( - options?: EventOptions, - ) { - return this.track(new SwapPoolChanged(), options); - } - - /** - * Swap Slippage Changed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Slippage%20Changed) - * - * When user click apply on the swap setting page - * - * Owner: Omar Rozak - * - * @param properties The event's properties (e.g. slippage_tolerance) - * @param options Amplitude event options. - */ - swapSlippageChanged( - properties: SwapSlippageChangedProperties, - options?: EventOptions, - ) { - return this.track(new SwapSlippageChanged(properties), options); - } - - /** - * Theme Selected - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Theme%20Selected) - * - * This event is triggrered when a user had selected a theme. - * - * @param properties The event's properties (e.g. theme) - * @param options Amplitude event options. - */ - themeSelected( - properties: ThemeSelectedProperties, - options?: EventOptions, - ) { - return this.track(new ThemeSelected(properties), options); - } - - /** - * Transactions Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Transactions%20Page%20Viewed) - * - * This event tracks when a user views the transactions page within the wallet. On mobile is available on the wallet page (First item from main navigation item) in the transactions tab. - * - * @param options Amplitude event options. - */ - transactionsPageViewed( - options?: EventOptions, - ) { - return this.track(new TransactionsPageViewed(), options); - } - - /** - * Voting Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Voting%20Page%20Viewed) - * - * This event tracks when a user views the Catalyst Voting page. - * - * @param options Amplitude event options. - */ - votingPageViewed( - options?: EventOptions, - ) { - return this.track(new VotingPageViewed(), options); - } - - /** - * Wallet Page Viewed - * - * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Wallet%20Page%20Viewed) - * - * Wallet page is the default page when the user logs into the app and selects the wallet that is going to be using (Once the initial setup is done) - * - * @param options Amplitude event options. - */ - walletPageViewed( - options?: EventOptions, - ) { - return this.track(new WalletPageViewed(), options); - } -} - -export const ampli = new Ampli(); - -// BASE TYPES -type BrowserOptions = amplitude.Types.BrowserOptions; - -export type BrowserClient = amplitude.Types.BrowserClient; -export type BaseEvent = amplitude.Types.BaseEvent; -export type IdentifyEvent = amplitude.Types.IdentifyEvent; -export type GroupEvent = amplitude.Types.GroupIdentifyEvent; -export type Event = amplitude.Types.Event; -export type EventOptions = amplitude.Types.EventOptions; -export type Result = amplitude.Types.Result; +var Ampli = /** @class */ (function () { + function Ampli() { + this.disabled = false; + } + Object.defineProperty(Ampli.prototype, "client", { + get: function () { + this.isInitializedAndEnabled(); + return this.amplitude; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Ampli.prototype, "isLoaded", { + get: function () { + return this.amplitude != null; + }, + enumerable: false, + configurable: true + }); + Ampli.prototype.isInitializedAndEnabled = function () { + if (!this.amplitude) { + console.error('ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?'); + return false; + } + return !this.disabled; + }; + /** + * Initialize the Ampli SDK. Call once when your application starts. + * + * @param options Configuration options to initialize the Ampli SDK with. + */ + Ampli.prototype.load = function (options) { + var _a; + this.disabled = (_a = options.disabled) !== null && _a !== void 0 ? _a : false; + if (this.amplitude) { + console.warn('WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup.'); + return getVoidPromiseResult(); + } + var apiKey = null; + if (options.client && 'apiKey' in options.client) { + apiKey = options.client.apiKey; + } + else if ('environment' in options) { + apiKey = ApiKey[options.environment]; + } + if (options.client && 'instance' in options.client) { + this.amplitude = options.client.instance; + } + else if (apiKey) { + this.amplitude = amplitude.createInstance(); + var configuration = (options.client && 'configuration' in options.client) ? options.client.configuration : {}; + return this.amplitude.init(apiKey, undefined, __assign(__assign({}, DefaultConfiguration), configuration)); + } + else { + console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'"); + } + return getVoidPromiseResult(); + }; + /** + * Identify a user and set user properties. + * + * @param userId The user's id. + * @param options Optional event options. + */ + Ampli.prototype.identify = function (userId, options) { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + if (userId) { + options = __assign(__assign({}, options), { user_id: userId }); + } + var amplitudeIdentify = new amplitude.Identify(); + return this.amplitude.identify(amplitudeIdentify, options); + }; + /** + * Flush the event. + */ + Ampli.prototype.flush = function () { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + return this.amplitude.flush(); + }; + /** + * Track event + * + * @param event The event to track. + * @param options Optional event options. + */ + Ampli.prototype.track = function (event, options) { + if (!this.isInitializedAndEnabled()) { + return getVoidPromiseResult(); + } + return this.amplitude.track(event, undefined, options); + }; + /** + * (to delete)Governance Abstain Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/(to%20delete)Governance%20Abstain%20Page%20Viewed) + * + * This event tracks when a user selects abstain governance status and the confirm transaction page is displayed + * + * @param options Amplitude event options. + */ + Ampli.prototype.toDeleteGovernanceAbstainPageViewed = function (options) { + return this.track(new ToDeleteGovernanceAbstainPageViewed(), options); + }; + /** + * All Wallets Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/All%20Wallets%20Page%20Viewed) + * + * This event tracks when a user views the All Wallets page on Menu. Note: only available on Yoroi Mobile. + * + * @param options Amplitude event options. + */ + Ampli.prototype.allWalletsPageViewed = function (options) { + return this.track(new AllWalletsPageViewed(), options); + }; + /** + * Assets Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Assets%20Page%20Viewed) + * + * This event tracks when a user views the Assets page. + * On mobile is available on the wallet page (First item from main menu) in the assets tab. + * + * @param options Amplitude event options. + */ + Ampli.prototype.assetsPageViewed = function (options) { + return this.track(new AssetsPageViewed(), options); + }; + /** + * Buy Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Input%20Amount) + * + * Event to track when a user starts the buy flow and must input amount of ADA to buy + * + * @param options Amplitude event options. + */ + Ampli.prototype.buyAdaInputAmount = function (options) { + return this.track(new BuyAdaInputAmount(), options); + }; + /** + * Buy Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully buying ADA + * + * @param options Amplitude event options. + */ + Ampli.prototype.buyAdaSuccessRedirect = function (options) { + return this.track(new BuyAdaSuccessRedirect(), options); + }; + /** + * Claim ADA Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20ADA%20Page%20Viewed) + * + * This event tracks when a user views the page to claim Claim /Transfer ADA page in Extension. + * + * You can find that page under Staking section. + * + * @param options Amplitude event options. + */ + Ampli.prototype.claimAdaPageViewed = function (options) { + return this.track(new ClaimAdaPageViewed(), options); + }; + /** + * Claim Ada Transaction Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Settled) + * + * Event to track when a user successfully claims ADA and transaction is settled on chain + * + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.claimAdaTransactionSettled = function (properties, options) { + return this.track(new ClaimAdaTransactionSettled(properties), options); + }; + /** + * Claim Ada Transaction Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Submitted) + * + * This Event to track when a user submits a transaction to claim ADA. + * + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.claimAdaTransactionSubmitted = function (properties, options) { + return this.track(new ClaimAdaTransactionSubmitted(properties), options); + }; + /** + * Connect Wallet Check Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Check%20Page%20Viewed) + * + * This event tracks when user chooses the connect hardware wallet option. This is the 1st step of the connect hardware wallet flow. In this page, the information about connecting a harware wallet is displayed to the user. + * + * @param options Amplitude event options. + */ + Ampli.prototype.connectWalletCheckPageViewed = function (options) { + return this.track(new ConnectWalletCheckPageViewed(), options); + }; + /** + * Connect Wallet Connect Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Connect%20Page%20Viewed) + * + * This event tracks when user connects the device and instructions are displayed. This is the 2nd step of the flow. + * + * @param options Amplitude event options. + */ + Ampli.prototype.connectWalletConnectPageViewed = function (options) { + return this.track(new ConnectWalletConnectPageViewed(), options); + }; + /** + * Connect Wallet Details Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Page%20Viewed) + * + * This event tracks when user accesses the enter wallet name page. This is the 3rd and final step of the flow + * + * @param options Amplitude event options. + */ + Ampli.prototype.connectWalletDetailsPageViewed = function (options) { + return this.track(new ConnectWalletDetailsPageViewed(), options); + }; + /** + * Connect Wallet Details Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Submitted) + * + * This event captures the submission of the wallet name on the last step of the connecting a hardware wallet flow. + * + * @param properties The event's properties (e.g. hardware_wallet) + * @param options Amplitude event options. + */ + Ampli.prototype.connectWalletDetailsSubmitted = function (properties, options) { + return this.track(new ConnectWalletDetailsSubmitted(properties), options); + }; + /** + * Connector Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connector%20Page%20Viewed) + * + * This event tracks when a user views the dApp Connector page. + * + * @param options Amplitude event options. + */ + Ampli.prototype.connectorPageViewed = function (options) { + return this.track(new ConnectorPageViewed(), options); + }; + /** + * Create Wallet Details Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Settled) + * + * When the wallet is created correctly. This event signifies the completion of the process of setting up wallet details during the creation of a new wallet + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletDetailsSettled = function (options) { + return this.track(new CreateWalletDetailsSettled(), options); + }; + /** + * Create Wallet Details Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Step%20Viewed) + * + * This event tracks when a user views the details \*\*step 4\*\* while creating a wallet. User will introduce: \* Wallet Name \* Password \* Repeat Password + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletDetailsStepViewed = function (options) { + return this.track(new CreateWalletDetailsStepViewed(), options); + }; + /** + * Create Wallet Details Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Submitted) + * + * This event captures the submission of the wallet creation on the last step of the flow (\*\*step 4\*\*). + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletDetailsSubmitted = function (options) { + return this.track(new CreateWalletDetailsSubmitted(), options); + }; + /** + * Create Wallet Language Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Language%20Page%20Viewed) + * + * This event tracks when a user views the page for selecting the language during the wallet creation process on the first time he launch Yoroi. + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletLanguagePageViewed = function (options) { + return this.track(new CreateWalletLanguagePageViewed(), options); + }; + /** + * Create Wallet Learn Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Learn%20Phrase%20Step%20Viewed) + * + * This event tracks when a user view the \*\*first step\*\* of learn about recovery prhase + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletLearnPhraseStepViewed = function (options) { + return this.track(new CreateWalletLearnPhraseStepViewed(), options); + }; + /** + * Create Wallet Save Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Save%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the \*\*second step\*\* to save their wallet recovery phrase during the wallet creation process + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletSavePhraseStepViewed = function (options) { + return this.track(new CreateWalletSavePhraseStepViewed(), options); + }; + /** + * Create Wallet Select Method Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Select%20Method%20Page%20Viewed) + * + * This event tracks when a user views the page where they can select the method to create a wallet: + * + * \* Create new wallet + * + * \* Restore existing wallet + * + * This event tracks when a user views the page where they can select the method to create a wallet\* Connect hardware wallet + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletSelectMethodPageViewed = function (options) { + return this.track(new CreateWalletSelectMethodPageViewed(), options); + }; + /** + * Create Wallet Terms Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Terms%20Page%20Viewed) + * + * This event tracks when a user views the terms of service agreement page on the creation wallet flow + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletTermsPageViewed = function (options) { + return this.track(new CreateWalletTermsPageViewed(), options); + }; + /** + * Create Wallet Verify Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the verification phrase step while creating a wallet + * + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletVerifyPhraseStepViewed = function (options) { + return this.track(new CreateWalletVerifyPhraseStepViewed(), options); + }; + /** + * Create Wallet Verify Phrase Word Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Word%20Selected) + * + * This event tracks the selection of a specific word during the process of verifying the recovery phrase when creating a wallet + * + * @param properties The event's properties (e.g. recovery_word_order) + * @param options Amplitude event options. + */ + Ampli.prototype.createWalletVerifyPhraseWordSelected = function (properties, options) { + return this.track(new CreateWalletVerifyPhraseWordSelected(properties), options); + }; + /** + * Dapp Popup Add Collateral Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Add%20Collateral%20Page%20Viewed) + * + * This event tracks when a user views the "Add Collateral" page in the Dapp Connector Popup + * + * @param options Amplitude event options. + */ + Ampli.prototype.dappPopupAddCollateralPageViewed = function (options) { + return this.track(new DappPopupAddCollateralPageViewed(), options); + }; + /** + * Dapp Popup Connect Wallet Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Page%20Viewed) + * + * This event is triggered when the dapp connector popup is triggered and the user select the wallet that wants to connect. + * + * @param properties The event's properties (e.g. wallet_count) + * @param options Amplitude event options. + */ + Ampli.prototype.dappPopupConnectWalletPageViewed = function (properties, options) { + return this.track(new DappPopupConnectWalletPageViewed(properties), options); + }; + /** + * Dapp Popup Connect Wallet Password Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Password%20Page%20Viewed) + * + * This event tracks when a user attempts to connect their wallet by entering their password in the Dapp Connector popup + * + * @param options Amplitude event options. + */ + Ampli.prototype.dappPopupConnectWalletPasswordPageViewed = function (options) { + return this.track(new DappPopupConnectWalletPasswordPageViewed(), options); + }; + /** + * Dapp Popup Sign Transaction Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Page%20Viewed) + * + * This event tracks when a user loads a sign transaction screen on the dapp connector. Valid for extension and mobile. + * + * @param options Amplitude event options. + */ + Ampli.prototype.dappPopupSignTransactionPageViewed = function (options) { + return this.track(new DappPopupSignTransactionPageViewed(), options); + }; + /** + * Dapp Popup Sign Transaction Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Submitted) + * + * This event tracks the submission of a sign transaction request within the Dapp Connector screen. It's a Popup on extension and a full screen in Mobile. + * + * @param options Amplitude event options. + */ + Ampli.prototype.dappPopupSignTransactionSubmitted = function (options) { + return this.track(new DappPopupSignTransactionSubmitted(), options); + }; + /** + * Governance Choose Drep Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Choose%20Drep%20Page%20Viewed) + * + * This event tracks when user loads the bottom sheet on mobile or the popup on extension to introduce the Drep ID. To arrive to this page the user has to click on “Delegate to a Drep” section. + * + * @param options Amplitude event options. + */ + Ampli.prototype.governanceChooseDrepPageViewed = function (options) { + return this.track(new GovernanceChooseDrepPageViewed(), options); + }; + /** + * Governance Confirm Transaction Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Confirm%20Transaction%20Page%20Viewed) + * + * This event tracks when a user loads the confirm transaction page on the Governance flow. On Extension user would insert the password in that page. On extension user would do it in a bottom sheet afterwards. + * + * @param properties The event's properties (e.g. governance_selection) + * @param options Amplitude event options. + */ + Ampli.prototype.governanceConfirmTransactionPageViewed = function (properties, options) { + return this.track(new GovernanceConfirmTransactionPageViewed(properties), options); + }; + /** + * Governance Dashboard Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Dashboard%20Page%20Viewed) + * + * This event tracks when a user loads the Governance Dashboard Page. The page is reached via the main navigation menu in extension and in the bottom menu icon on Extension. + * + * @param options Amplitude event options. + */ + Ampli.prototype.governanceDashboardPageViewed = function (options) { + return this.track(new GovernanceDashboardPageViewed(), options); + }; + /** + * Governance Transaction Success Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Transaction%20Success%20Page%20Viewed) + * + * This event tracks when a user loads the success page at the end of the governance flow. + * + * @param properties The event's properties (e.g. governance_selection) + * @param options Amplitude event options. + */ + Ampli.prototype.governanceTransactionSuccessPageViewed = function (properties, options) { + return this.track(new GovernanceTransactionSuccessPageViewed(properties), options); + }; + /** + * Network Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Network%20Selected) + * + * Event to track when a user selects a network + * + * @param properties The event's properties (e.g. from_network) + * @param options Amplitude event options. + */ + Ampli.prototype.networkSelected = function (properties, options) { + return this.track(new NetworkSelected(properties), options); + }; + /** + * NFT Gallery Details Image Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Image%20Viewed) + * + * This event tracks when a user views the NFT image at full screen + * + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryDetailsImageViewed = function (options) { + return this.track(new NftGalleryDetailsImageViewed(), options); + }; + /** + * NFT Gallery Details Navigation + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Navigation) + * + * This event tracks when a use next and previous buttons to navigate across their NFTs. Note: available only on Extension. + * + * @param properties The event's properties (e.g. nft_navigation) + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryDetailsNavigation = function (properties, options) { + return this.track(new NftGalleryDetailsNavigation(properties), options); + }; + /** + * NFT Gallery Details Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Page%20Viewed) + * + * This event tracks when a user views the details page of an NFT item. + * + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryDetailsPageViewed = function (options) { + return this.track(new NftGalleryDetailsPageViewed(), options); + }; + /** + * NFT Gallery Details Tab + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Tab) + * + * This event tracks user interactions with the tab in the NFT Gallery details page. It provides insights into how users engage with specific details of NFTs, such as descriptions, attributes, or additional information + * + * @param properties The event's properties (e.g. nft_tab) + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryDetailsTab = function (properties, options) { + return this.track(new NftGalleryDetailsTab(properties), options); + }; + /** + * NFT Gallery Grid View Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Grid%20View%20Selected) + * + * This event is triggered when a user selects the grid view option in the NFT gallery + * + * @param properties The event's properties (e.g. nft_grid_view) + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryGridViewSelected = function (properties, options) { + return this.track(new NftGalleryGridViewSelected(properties), options); + }; + /** + * NFT Gallery Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Page%20Viewed) + * + * This event tracks when the NFT gallery it has loaded all nfts metadata + * + * @param properties The event's properties (e.g. nft_count) + * @param options Amplitude event options. + */ + Ampli.prototype.nftGalleryPageViewed = function (properties, options) { + return this.track(new NftGalleryPageViewed(properties), options); + }; + /** + * NFT Gallery Search Activated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Search%20Activated) + * + * User activates and starts a search in the NFT gallery. Delay of 0.5 seconds. + * + * @param properties The event's properties (e.g. nft_count) + * @param options Amplitude event options. + */ + Ampli.prototype.nftGallerySearchActivated = function (properties, options) { + return this.track(new NftGallerySearchActivated(properties), options); + }; + /** + * Onboarding Analytics Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Onboarding%20Analytics%20Page%20Viewed) + * + * Event to track when a user views the onboarding analytics page. + * + * @param options Amplitude event options. + */ + Ampli.prototype.onboardingAnalyticsPageViewed = function (options) { + return this.track(new OnboardingAnalyticsPageViewed(), options); + }; + /** + * Portfolio Token Details + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Token%20Details) + * + * When user visit the detailed information about a specific token within a user's portfolio. In mobile there's 3 tabs that would be implemented in different iterations. + * + * @param properties The event's properties (e.g. token_details_tab) + * @param options Amplitude event options. + */ + Ampli.prototype.portfolioTokenDetails = function (properties, options) { + return this.track(new PortfolioTokenDetails(properties), options); + }; + /** + * Portfolio Tokens List Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Page%20Viewed) + * + * Event to track when a user views the list of tokens in their portfolio. + * + * @param properties The event's properties (e.g. tokens_tab) + * @param options Amplitude event options. + */ + Ampli.prototype.portfolioTokensListPageViewed = function (properties, options) { + return this.track(new PortfolioTokensListPageViewed(properties), options); + }; + /** + * Portfolio Tokens List Search Activated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Search%20Activated) + * + * This event tracks when a user activates and starts a search in the Tokens list page. Delay of 0.5 seconds. + * + * @param properties The event's properties (e.g. search_term) + * @param options Amplitude event options. + */ + Ampli.prototype.portfolioTokensListSearchActivated = function (properties, options) { + return this.track(new PortfolioTokensListSearchActivated(properties), options); + }; + /** + * Receive Amount Generated Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Generated%20Page%20Viewed) + * + * When the bottom sheet or popup with a generated address with an specific amount is loaded + * + * @param properties The event's properties (e.g. ada_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.receiveAmountGeneratedPageViewed = function (properties, options) { + return this.track(new ReceiveAmountGeneratedPageViewed(properties), options); + }; + /** + * Receive Amount Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Page%20Viewed) + * + * When a user visit the page to insert specific amount of ADA that would be needed to generate a wallet address with that specific details. + * + * @param options Amplitude event options. + */ + Ampli.prototype.receiveAmountPageViewed = function (options) { + return this.track(new ReceiveAmountPageViewed(), options); + }; + /** + * Receive Copy Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Copy%20Address%20Clicked) + * + * When a user click on the any CTA to copy their address + * + * @param properties The event's properties (e.g. copy_address_location) + * @param options Amplitude event options. + */ + Ampli.prototype.receiveCopyAddressClicked = function (properties, options) { + return this.track(new ReceiveCopyAddressClicked(properties), options); + }; + /** + * Receive Generate New Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Generate%20New%20Address%20Clicked) + * + * When a user click on the Generate new address button on the main receive page on the multiple address flow. + * + * @param options Amplitude event options. + */ + Ampli.prototype.receiveGenerateNewAddressClicked = function (options) { + return this.track(new ReceiveGenerateNewAddressClicked(), options); + }; + /** + * Receive Page List Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20List%20Viewed) + * + * When user has enabled multiple addresses and goes to the page where he can see the list of generated wallet addresses + * + * @param options Amplitude event options. + */ + Ampli.prototype.receivePageListViewed = function (options) { + return this.track(new ReceivePageListViewed(), options); + }; + /** + * Receive Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20Viewed) + * + * When user loads the Receive funds screen, where user can see their wallet address with a QR Code + * + * @param options Amplitude event options. + */ + Ampli.prototype.receivePageViewed = function (options) { + return this.track(new ReceivePageViewed(), options); + }; + /** + * Receive Share Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Share%20Address%20Clicked) + * + * When a user click on the link to share the address + * + * @param options Amplitude event options. + */ + Ampli.prototype.receiveShareAddressClicked = function (options) { + return this.track(new ReceiveShareAddressClicked(), options); + }; + /** + * Restore Wallet Details Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Settled) + * + * This event captures the details of a wallet restoration process that has been successfully completed + * + * @param options Amplitude event options. + */ + Ampli.prototype.restoreWalletDetailsSettled = function (options) { + return this.track(new RestoreWalletDetailsSettled(), options); + }; + /** + * Restore Wallet Details Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Step%20Viewed) + * + * Track when user loads the page where user inserts wallet name and password + * + * @param options Amplitude event options. + */ + Ampli.prototype.restoreWalletDetailsStepViewed = function (options) { + return this.track(new RestoreWalletDetailsStepViewed(), options); + }; + /** + * Restore Wallet Enter Phrase Step Status + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Status) + * + * This events tracks the validation of the recovery phrase is verified, once the user insert the latest word. The output can be positive or negative and we do save that in he property: recovery*prhase*status + * + * @param properties The event's properties (e.g. recovery_prhase_status) + * @param options Amplitude event options. + */ + Ampli.prototype.restoreWalletEnterPhraseStepStatus = function (properties, options) { + return this.track(new RestoreWalletEnterPhraseStepStatus(properties), options); + }; + /** + * Restore Wallet Enter Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the step to enter the recovery phrase while restoring a wallet (**Step 2**). + * + * @param properties The event's properties (e.g. recovery_phrase_lenght) + * @param options Amplitude event options. + */ + Ampli.prototype.restoreWalletEnterPhraseStepViewed = function (properties, options) { + return this.track(new RestoreWalletEnterPhraseStepViewed(properties), options); + }; + /** + * Restore Wallet Type Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Type%20Step%20Viewed) + * + * This event tracks when a user views the **first step after** selecting restore wallet, were they have to choose between: + * + * * 15-word recovery phrase + * + * * 24-word recovery phrase + * + * @param options Amplitude event options. + */ + Ampli.prototype.restoreWalletTypeStepViewed = function (options) { + return this.track(new RestoreWalletTypeStepViewed(), options); + }; + /** + * Sell Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Input%20Amount) + * + * Event to track when user starts the Sell ada flow so after selecting the sell option and having to input amount of ADA to sell + * + * @param options Amplitude event options. + */ + Ampli.prototype.sellAdaInputAmount = function (options) { + return this.track(new SellAdaInputAmount(), options); + }; + /** + * Sell Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully selling ADA + * + * @param options Amplitude event options. + */ + Ampli.prototype.sellAdaSuccessRedirect = function (options) { + return this.track(new SellAdaSuccessRedirect(), options); + }; + /** + * Send Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Initiated) + * + * This event tracks when a user loads the default state of the first step of the multiasset transaction flow. That screen shows receiver address and optional memo + * + * @param options Amplitude event options. + */ + Ampli.prototype.sendInitiated = function (options) { + return this.track(new SendInitiated(), options); + }; + /** + * Send Select Asset Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Page%20Viewed) + * + * This event tracks when a user views the "Amount" page in the send flow. + * + * @param options Amplitude event options. + */ + Ampli.prototype.sendSelectAssetPageViewed = function (options) { + return this.track(new SendSelectAssetPageViewed(), options); + }; + /** + * Send Select Asset Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Selected) + * + * When a user click "next" on the send flow: "Amount" step on extension / "Assets added" in mobile + * + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + Ampli.prototype.sendSelectAssetSelected = function (properties, options) { + return this.track(new SendSelectAssetSelected(properties), options); + }; + /** + * Send Select Asset Updated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Updated) + * + * When an user update the tokens selection on "amount" step: + * \- Add + * \- Remove + * \- Updated + * + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + Ampli.prototype.sendSelectAssetUpdated = function (properties, options) { + return this.track(new SendSelectAssetUpdated(properties), options); + }; + /** + * Send Summary Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Page%20Viewed) + * + * When a user loads the Preview page (Could be called comfirmation too) on the send flow. + * + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + Ampli.prototype.sendSummaryPageViewed = function (properties, options) { + return this.track(new SendSummaryPageViewed(properties), options); + }; + /** + * Send Summary Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Submitted) + * + * When a user click "send" on the "Preview" step on the send flow. + * + * @param properties The event's properties (e.g. ada_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.sendSummarySubmitted = function (properties, options) { + return this.track(new SendSummarySubmitted(properties), options); + }; + /** + * Settings Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Settings%20Page%20Viewed) + * + * This event tracks when a user views the settings page within the application. + * + * @param options Amplitude event options. + */ + Ampli.prototype.settingsPageViewed = function (options) { + return this.track(new SettingsPageViewed(), options); + }; + /** + * Staking Center Delegation Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Delegation%20Initiated) + * + * Event to track when a user initiates the delegation process in the Staking Center, accessing the delegate modal after selecting a pool + * + * @param options Amplitude event options. + */ + Ampli.prototype.stakingCenterDelegationInitiated = function (options) { + return this.track(new StakingCenterDelegationInitiated(), options); + }; + /** + * Staking Center Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Page%20Viewed) + * + * This event tracks when a user views the Staking Center page on Staking menu. + * + * @param options Amplitude event options. + */ + Ampli.prototype.stakingCenterPageViewed = function (options) { + return this.track(new StakingCenterPageViewed(), options); + }; + /** + * Swap Asset From Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20From%20Changed) + * + * When user changed the selected asset on "From" section + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. from_asset) + * @param options Amplitude event options. + */ + Ampli.prototype.swapAssetFromChanged = function (properties, options) { + return this.track(new SwapAssetFromChanged(properties), options); + }; + /** + * Swap Asset To Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20To%20Changed) + * + * When user changed the selected asset on "To" section + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. to_asset) + * @param options Amplitude event options. + */ + Ampli.prototype.swapAssetToChanged = function (properties, options) { + return this.track(new SwapAssetToChanged(properties), options); + }; + /** + * Swap Cancelation Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Cancelation%20Submitted) + * + * When user sign a transaction to cancel the swap order + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.swapCancelationSubmitted = function (properties, options) { + return this.track(new SwapCancelationSubmitted(properties), options); + }; + /** + * Swap Confirmed Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Confirmed%20%20Page%20Viewed) + * + * When the user opens Completed Order page + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. swap_tab) + * @param options Amplitude event options. + */ + Ampli.prototype.swapConfirmedPageViewed = function (properties, options) { + return this.track(new SwapConfirmedPageViewed(properties), options); + }; + /** + * Swap Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Initiated) + * + * When user clicks on the swap feature and sees the default state of the swap. + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. from_asset) + * @param options Amplitude event options. + */ + Ampli.prototype.swapInitiated = function (properties, options) { + return this.track(new SwapInitiated(properties), options); + }; + /** + * Swap Order Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Selected) + * + * When user click on "swap" button after selecting asset from, entering the amount of asset form, selecting asset to, entering amount of asset to, and choosing a pool + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.swapOrderSelected = function (properties, options) { + return this.track(new SwapOrderSelected(properties), options); + }; + /** + * Swap Order Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Submitted) + * + * When user click confirm on the check out page, after entering their spending password + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + Ampli.prototype.swapOrderSubmitted = function (properties, options) { + return this.track(new SwapOrderSubmitted(properties), options); + }; + /** + * Swap Pool Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Pool%20Changed) + * + * When user clicked a different pool on the "Select Pool" page + * + * Owner: Sergio SF + * + * @param options Amplitude event options. + */ + Ampli.prototype.swapPoolChanged = function (options) { + return this.track(new SwapPoolChanged(), options); + }; + /** + * Swap Slippage Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Slippage%20Changed) + * + * When user click apply on the swap setting page + * + * Owner: Omar Rozak + * + * @param properties The event's properties (e.g. slippage_tolerance) + * @param options Amplitude event options. + */ + Ampli.prototype.swapSlippageChanged = function (properties, options) { + return this.track(new SwapSlippageChanged(properties), options); + }; + /** + * Theme Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Theme%20Selected) + * + * This event is triggrered when a user had selected a theme. + * + * @param properties The event's properties (e.g. theme) + * @param options Amplitude event options. + */ + Ampli.prototype.themeSelected = function (properties, options) { + return this.track(new ThemeSelected(properties), options); + }; + /** + * Transactions Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Transactions%20Page%20Viewed) + * + * This event tracks when a user views the transactions page within the wallet. On mobile is available on the wallet page (First item from main navigation item) in the transactions tab. + * + * @param options Amplitude event options. + */ + Ampli.prototype.transactionsPageViewed = function (options) { + return this.track(new TransactionsPageViewed(), options); + }; + /** + * Voting Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Voting%20Page%20Viewed) + * + * This event tracks when a user views the Catalyst Voting page. + * + * @param options Amplitude event options. + */ + Ampli.prototype.votingPageViewed = function (options) { + return this.track(new VotingPageViewed(), options); + }; + /** + * Wallet Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Wallet%20Page%20Viewed) + * + * Wallet page is the default page when the user logs into the app and selects the wallet that is going to be using (Once the initial setup is done) + * + * @param options Amplitude event options. + */ + Ampli.prototype.walletPageViewed = function (options) { + return this.track(new WalletPageViewed(), options); + }; + return Ampli; +}()); +export { Ampli }; +export var ampli = new Ampli(); diff --git a/packages/yoroi-extension/ampli/index.js.flow b/packages/yoroi-extension/ampli/index.js.flow new file mode 100644 index 0000000000..2dc58cf5f0 --- /dev/null +++ b/packages/yoroi-extension/ampli/index.js.flow @@ -0,0 +1,2279 @@ +/** + * Flowtype definitions for index + * Generated by Flowgen from a Typescript Definition + * Flowgen v1.21.0 + * @flow + */ + +import * as amplitude from "@amplitude/analytics-browser"; +export type Environment = "production" | "development"; +declare export var ApiKey: { [key: Environment]: string }; +/** + * Default Amplitude configuration options. Contains tracking plan information. + */ +declare export var DefaultConfiguration: BrowserOptions; +export type LoadOptionsBase = {| + disabled?: boolean, +|}; +export type LoadOptionsWithEnvironment = {| + ...LoadOptionsBase, + ...{| + environment: Environment, + client?: {| + configuration?: BrowserOptions, + |}, + |}, +|}; +export type LoadOptionsWithApiKey = {| + ...LoadOptionsBase, + ...{| + client: {| + apiKey: string, + configuration?: BrowserOptions, + |}, + |}, +|}; +export type LoadOptionsWithClientInstance = {| + ...LoadOptionsBase, + ...{| + client: {| + instance: BrowserClient, + |}, + |}, +|}; +export type LoadOptions = + | LoadOptionsWithEnvironment + | LoadOptionsWithApiKey + | LoadOptionsWithClientInstance; +export type ClaimAdaTransactionSettledProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + reward_amount: number, +|}; +export type ClaimAdaTransactionSubmittedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + reward_amount: number, +|}; +export type ConnectWalletDetailsSubmittedProperties = {| + /** + * The name of the hardware wallet. + * + * | Rule | Value | + * |---|---| + * | Enum Values | Ledger, Trezor | + */ + hardware_wallet: "Ledger" | "Trezor", +|}; +export type CreateWalletVerifyPhraseWordSelectedProperties = {| + recovery_word_order?: any, +|}; +export type DappPopupConnectWalletPageViewedProperties = {| + /** + * The total number of wallets that a user have. + * In case of not having any wallet, save 0 as the value. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + wallet_count: number, +|}; +export type GovernanceConfirmTransactionPageViewedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Enum Values | Delegate, Abstain, No Confidence | + */ + governance_selection: "Delegate" | "Abstain" | "No Confidence", +|}; +export type GovernanceTransactionSuccessPageViewedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Enum Values | Delegate, Abstain, No Confidence | + */ + governance_selection: "Delegate" | "Abstain" | "No Confidence", +|}; +export type NetworkSelectedProperties = {| + /** + * Current network + * + * | Rule | Value | + * |---|---| + * | Enum Values | preprod, preview, mainnet, sancho | + */ + from_network: "preprod" | "preview" | "mainnet" | "sancho", + + /** + * Network selected + * + * | Rule | Value | + * |---|---| + * | Enum Values | preprod, preview, mainnet, sancho | + */ + to_network: "preprod" | "preview" | "mainnet" | "sancho", +|}; +export type NftGalleryDetailsNavigationProperties = {| + /** + * Describe the navigation buttons on the NFT details view + * + * | Rule | Value | + * |---|---| + * | Enum Values | Next, Previous | + */ + nft_navigation: "Next" | "Previous", +|}; +export type NftGalleryDetailsTabProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Enum Values | Overview, Metadata | + */ + nft_tab: "Overview" | "Metadata", +|}; +export type NftGalleryGridViewSelectedProperties = {| + /** + * Describe what type of grid is using the NFT gallery + * + * | Rule | Value | + * |---|---| + * | Enum Values | 4_rows, 6_rows | + */ + nft_grid_view?: "4_rows" | "6_rows", +|}; +export type NftGalleryPageViewedProperties = {| + /** + * The total number of NFT's that an user have + * + * | Rule | Value | + * |---|---| + * | Type | integer | + */ + nft_count: number, +|}; +export type NftGallerySearchActivatedProperties = {| + /** + * The total number of NFT's that an user have + * + * | Rule | Value | + * |---|---| + * | Type | integer | + */ + nft_count: number, + + /** + * What user is looking to search on NFT gallery page + */ + nft_search_term: string, +|}; +export type PortfolioTokenDetailsProperties = {| + /** + * It show what tab from the Token details the user is. + * + * | Rule | Value | + * |---|---| + * | Enum Values | Performance, Overview, Transactions | + */ + token_details_tab: "Performance" | "Overview" | "Transactions", +|}; +export type PortfolioTokensListPageViewedProperties = {| + /** + * It shows in what tab are we in the movile version of the Token list + * + * | Rule | Value | + * |---|---| + * | Enum Values | Wallet Token, Dapps Token | + */ + tokens_tab: "Wallet Token" | "Dapps Token", +|}; +export type PortfolioTokensListSearchActivatedProperties = {| + /** + * What a user is looking to search. + */ + search_term: string, +|}; +export type ReceiveAmountGeneratedPageViewedProperties = {| + /** + * The amount of ADA that the user will be exchanging. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + ada_amount: number, +|}; +export type ReceiveCopyAddressClickedProperties = {| + /** + * Indicates the location of cop CTA + * + * | Rule | Value | + * |---|---| + * | Enum Values | CTA Copy Address, Tap Address Details, Long Press wallet Address | + */ + copy_address_location: + | "CTA Copy Address" + | "Tap Address Details" + | "Long Press wallet Address", +|}; +export type RestoreWalletEnterPhraseStepStatusProperties = {| + recovery_prhase_status: boolean, +|}; +export type RestoreWalletEnterPhraseStepViewedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Enum Values | 15, 24 | + */ + recovery_phrase_lenght: "15" | "24", +|}; +export type SendSelectAssetSelectedProperties = {| + /** + * Total numbers of assets to be send + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number, + + /** + * ``` + * nfts: [ + * { + * nft_name: Bored Ape, + * + * }, + * { + * nft_name: Crypto Cats, + * } + * ] + * ``` + */ + nfts?: any[], + + /** + * ``` + * Tokens: [ + * { + * token_name: Ado, + * token_amount: '133', + * }, + * { + * token_name: Ada, + * token_amount: '5', + * } + * ] + * ``` + */ + tokens?: any[], +|}; +export type SendSelectAssetUpdatedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number, + + /** + * ``` + * nfts: [ + * { + * nft_name: Bored Ape, + * + * }, + * { + * nft_name: Crypto Cats, + * } + * ] + * ``` + */ + nfts?: any[], + + /** + * ``` + * Tokens: [ + * { + * token_name: Ado, + * token_amount: '133', + * }, + * { + * token_name: Ada, + * token_amount: '5', + * } + * ] + * ``` + */ + tokens?: any[], +|}; +export type SendSummaryPageViewedProperties = {| + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number, + + /** + * ``` + * nfts: [ + * { + * nft_name: Bored Ape, + * + * }, + * { + * nft_name: Crypto Cats, + * } + * ] + * ``` + */ + nfts?: any[], + + /** + * ``` + * Tokens: [ + * { + * token_name: Ado, + * token_amount: '133', + * }, + * { + * token_name: Ada, + * token_amount: '5', + * } + * ] + * ``` + */ + tokens?: any[], +|}; +export type SendSummarySubmittedProperties = {| + /** + * The amount of ADA that the user will be exchanging. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + ada_amount: number, + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number, + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + nft_amount: number, + nft_name: string, + + /** + * ``` + * nfts: [ + * { + * nft_name: Bored Ape, + * + * }, + * { + * nft_name: Crypto Cats, + * } + * ] + * ``` + */ + nfts?: any[], + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + token_amount: number, + token_name: string, + + /** + * ``` + * Tokens: [ + * { + * token_name: Ado, + * token_amount: '133', + * }, + * { + * token_name: Ada, + * token_amount: '5', + * } + * ] + * ``` + */ + tokens?: any[], +|}; +export type SwapAssetFromChangedProperties = {| + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + */ + from_asset: any[], +|}; +export type SwapAssetToChangedProperties = {| + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + */ + to_asset: any[], +|}; +export type SwapCancelationSubmittedProperties = {| + /** + * The amount of asset that the user is swapping from + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + from_amount: number, + + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + * + * | Rule | Value | + * |---|---| + * | Unique Items | null | + */ + from_asset: any[], + + /** + * The name of liquidity pool used for this swap transaction + */ + pool_source: string, + + /** + * The amount of asset that the user is swapping to + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + to_amount: number, + + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + * + * | Rule | Value | + * |---|---| + * | Unique Items | null | + */ + to_asset: any[], +|}; +export type SwapConfirmedPageViewedProperties = {| + /** + * Define the tab that is active in the selected page + * + * | Rule | Value | + * |---|---| + * | Enum Values | Open Orders, Completed Orders | + */ + swap_tab: "Open Orders" | "Completed Orders", +|}; +export type SwapInitiatedProperties = {| + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + * + * | Rule | Value | + * |---|---| + * | Unique Items | null | + */ + from_asset: any[], + + /** + * The type of order selected on a given transaction + * + * | Rule | Value | + * |---|---| + * | Enum Values | limit, market | + */ + order_type: "limit" | "market", + + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance: number, + + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + * + * | Rule | Value | + * |---|---| + * | Unique Items | null | + */ + to_asset: any[], +|}; +export type SwapOrderSelectedProperties = {| + /** + * The amount of asset that the user is swapping from + */ + from_amount: string, + + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + */ + from_asset: any[], + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + from_asset_fiat_value: number, + + /** + * The type of order selected on a given transaction + * + * | Rule | Value | + * |---|---| + * | Enum Values | limit, market | + */ + order_type?: "limit" | "market", + + /** + * The name of liquidity pool used for this swap transaction + */ + pool_source: string, + + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance?: number, + + /** + * The amount of fees charged on the transaction. The value is in ADA. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + swap_fees?: number, + + /** + * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). + */ + swap_pair?: string, + + /** + * The amount of asset that the user is swapping to + */ + to_amount: string, + + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + */ + to_asset: any[], + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + to_asset_fiat_value: number, +|}; +export type SwapOrderSubmittedProperties = {| + /** + * The amount of asset that the user is swapping from + */ + from_amount: string, + + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + */ + from_asset: any[], + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + from_asset_fiat_value: number, + + /** + * The type of order selected on a given transaction + * + * | Rule | Value | + * |---|---| + * | Enum Values | limit, market | + */ + order_type?: "limit" | "market", + + /** + * The name of liquidity pool used for this swap transaction + */ + pool_source: string, + + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance?: number, + + /** + * The amount of fees charged on the transaction. The value is in ADA. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + swap_fees?: number, + + /** + * Cryptocurrency pairs being swapped (e.g., ADA to SNEK {ADA/SNEK}). + */ + swap_pair?: string, + + /** + * The amount of asset that the user is swapping to + */ + to_amount: string, + + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + */ + to_asset: any[], + + /** + * | Rule | Value | + * |---|---| + * | Type | number | + */ + to_asset_fiat_value: number, +|}; +export type SwapSlippageChangedProperties = {| + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance: number, +|}; +export type ThemeSelectedProperties = {| + /** + * The theme that is selected. + * + * | Rule | Value | + * |---|---| + * | Enum Values | auto, light, dark | + */ + theme: "auto" | "light" | "dark", +|}; +export type SendProperties = {| + /** + * Total numbers of assets to be send + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + asset_count: number, + + /** + * ``` + * nfts: [ + * { + * nft_name: Bored Ape, + * + * }, + * { + * nft_name: Crypto Cats, + * } + * ] + * ``` + */ + nfts?: any[], + + /** + * ``` + * Tokens: [ + * { + * token_name: Ado, + * token_amount: '133', + * }, + * { + * token_name: Ada, + * token_amount: '5', + * } + * ] + * ``` + */ + tokens?: any[], +|}; +export type SwapProperties = {| + /** + * The amount of asset that the user is swapping from + */ + from_amount: string, + + /** + * Displaying the asset that the user chose to trade with. + * + * Asset Name Asset Ticker Policy ID + * \[ + * { + * asset_name: 'ADA', + * asset_ticker: 'ADA', + * policy_id: '123456789' + * }, + * \] + */ + from_asset: any[], + + /** + * The type of order selected on a given transaction + * + * | Rule | Value | + * |---|---| + * | Enum Values | limit, market | + */ + order_type?: "limit" | "market", + + /** + * The name of liquidity pool used for this swap transaction + */ + pool_source: string, + + /** + * The default slippage tolerance is 1%, but users are free to change the slippage. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + slippage_tolerance?: number, + + /** + * The amount of fees charged on the transaction. The value is in ADA. + * + * | Rule | Value | + * |---|---| + * | Type | number | + */ + swap_fees?: number, + + /** + * The amount of asset that the user is swapping to + */ + to_amount: string, + + /** + * Displaying the asset that the user chose to trade to + * + * Asset Name + * Asset Ticker + * Policy ID + */ + to_asset: any[], +|}; +declare export class ToDeleteGovernanceAbstainPageViewed mixins BaseEvent { + event_type: string; +} +declare export class AllWalletsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class AssetsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class BuyAdaInputAmount mixins BaseEvent { + event_type: string; +} +declare export class BuyAdaSuccessRedirect mixins BaseEvent { + event_type: string; +} +declare export class ClaimAdaPageViewed mixins BaseEvent { + event_type: string; +} +declare export class ClaimAdaTransactionSettled mixins BaseEvent { + event_properties: ClaimAdaTransactionSettledProperties; + event_type: string; + constructor(event_properties: ClaimAdaTransactionSettledProperties): this; +} +declare export class ClaimAdaTransactionSubmitted mixins BaseEvent { + event_properties: ClaimAdaTransactionSubmittedProperties; + event_type: string; + constructor(event_properties: ClaimAdaTransactionSubmittedProperties): this; +} +declare export class ConnectWalletCheckPageViewed mixins BaseEvent { + event_type: string; +} +declare export class ConnectWalletConnectPageViewed mixins BaseEvent { + event_type: string; +} +declare export class ConnectWalletDetailsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class ConnectWalletDetailsSubmitted mixins BaseEvent { + event_properties: ConnectWalletDetailsSubmittedProperties; + event_type: string; + constructor(event_properties: ConnectWalletDetailsSubmittedProperties): this; +} +declare export class ConnectorPageViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletDetailsSettled mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletDetailsStepViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletDetailsSubmitted mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletLanguagePageViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletLearnPhraseStepViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletSavePhraseStepViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletSelectMethodPageViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletTermsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletVerifyPhraseStepViewed mixins BaseEvent { + event_type: string; +} +declare export class CreateWalletVerifyPhraseWordSelected mixins BaseEvent { + event_properties?: CreateWalletVerifyPhraseWordSelectedProperties; + event_type: string; + constructor( + event_properties?: CreateWalletVerifyPhraseWordSelectedProperties + ): this; +} +declare export class DappPopupAddCollateralPageViewed mixins BaseEvent { + event_type: string; +} +declare export class DappPopupConnectWalletPageViewed mixins BaseEvent { + event_properties: DappPopupConnectWalletPageViewedProperties; + event_type: string; + constructor( + event_properties: DappPopupConnectWalletPageViewedProperties + ): this; +} +declare export class DappPopupConnectWalletPasswordPageViewed mixins BaseEvent { + event_type: string; +} +declare export class DappPopupSignTransactionPageViewed mixins BaseEvent { + event_type: string; +} +declare export class DappPopupSignTransactionSubmitted mixins BaseEvent { + event_type: string; +} +declare export class GovernanceChooseDrepPageViewed mixins BaseEvent { + event_type: string; +} +declare export class GovernanceConfirmTransactionPageViewed mixins BaseEvent { + event_properties: GovernanceConfirmTransactionPageViewedProperties; + event_type: string; + constructor( + event_properties: GovernanceConfirmTransactionPageViewedProperties + ): this; +} +declare export class GovernanceDashboardPageViewed mixins BaseEvent { + event_type: string; +} +declare export class GovernanceTransactionSuccessPageViewed mixins BaseEvent { + event_properties: GovernanceTransactionSuccessPageViewedProperties; + event_type: string; + constructor( + event_properties: GovernanceTransactionSuccessPageViewedProperties + ): this; +} +declare export class NetworkSelected mixins BaseEvent { + event_properties: NetworkSelectedProperties; + event_type: string; + constructor(event_properties: NetworkSelectedProperties): this; +} +declare export class NftGalleryDetailsImageViewed mixins BaseEvent { + event_type: string; +} +declare export class NftGalleryDetailsNavigation mixins BaseEvent { + event_properties: NftGalleryDetailsNavigationProperties; + event_type: string; + constructor(event_properties: NftGalleryDetailsNavigationProperties): this; +} +declare export class NftGalleryDetailsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class NftGalleryDetailsTab mixins BaseEvent { + event_properties: NftGalleryDetailsTabProperties; + event_type: string; + constructor(event_properties: NftGalleryDetailsTabProperties): this; +} +declare export class NftGalleryGridViewSelected mixins BaseEvent { + event_properties?: NftGalleryGridViewSelectedProperties; + event_type: string; + constructor(event_properties?: NftGalleryGridViewSelectedProperties): this; +} +declare export class NftGalleryPageViewed mixins BaseEvent { + event_properties: NftGalleryPageViewedProperties; + event_type: string; + constructor(event_properties: NftGalleryPageViewedProperties): this; +} +declare export class NftGallerySearchActivated mixins BaseEvent { + event_properties: NftGallerySearchActivatedProperties; + event_type: string; + constructor(event_properties: NftGallerySearchActivatedProperties): this; +} +declare export class OnboardingAnalyticsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class PortfolioTokenDetails mixins BaseEvent { + event_properties: PortfolioTokenDetailsProperties; + event_type: string; + constructor(event_properties: PortfolioTokenDetailsProperties): this; +} +declare export class PortfolioTokensListPageViewed mixins BaseEvent { + event_properties: PortfolioTokensListPageViewedProperties; + event_type: string; + constructor(event_properties: PortfolioTokensListPageViewedProperties): this; +} +declare export class PortfolioTokensListSearchActivated mixins BaseEvent { + event_properties: PortfolioTokensListSearchActivatedProperties; + event_type: string; + constructor( + event_properties: PortfolioTokensListSearchActivatedProperties + ): this; +} +declare export class ReceiveAmountGeneratedPageViewed mixins BaseEvent { + event_properties: ReceiveAmountGeneratedPageViewedProperties; + event_type: string; + constructor( + event_properties: ReceiveAmountGeneratedPageViewedProperties + ): this; +} +declare export class ReceiveAmountPageViewed mixins BaseEvent { + event_type: string; +} +declare export class ReceiveCopyAddressClicked mixins BaseEvent { + event_properties: ReceiveCopyAddressClickedProperties; + event_type: string; + constructor(event_properties: ReceiveCopyAddressClickedProperties): this; +} +declare export class ReceiveGenerateNewAddressClicked mixins BaseEvent { + event_type: string; +} +declare export class ReceivePageListViewed mixins BaseEvent { + event_type: string; +} +declare export class ReceivePageViewed mixins BaseEvent { + event_type: string; +} +declare export class ReceiveShareAddressClicked mixins BaseEvent { + event_type: string; +} +declare export class RestoreWalletDetailsSettled mixins BaseEvent { + event_type: string; +} +declare export class RestoreWalletDetailsStepViewed mixins BaseEvent { + event_type: string; +} +declare export class RestoreWalletEnterPhraseStepStatus mixins BaseEvent { + event_properties: RestoreWalletEnterPhraseStepStatusProperties; + event_type: string; + constructor( + event_properties: RestoreWalletEnterPhraseStepStatusProperties + ): this; +} +declare export class RestoreWalletEnterPhraseStepViewed mixins BaseEvent { + event_properties: RestoreWalletEnterPhraseStepViewedProperties; + event_type: string; + constructor( + event_properties: RestoreWalletEnterPhraseStepViewedProperties + ): this; +} +declare export class RestoreWalletTypeStepViewed mixins BaseEvent { + event_type: string; +} +declare export class SellAdaInputAmount mixins BaseEvent { + event_type: string; +} +declare export class SellAdaSuccessRedirect mixins BaseEvent { + event_type: string; +} +declare export class SendInitiated mixins BaseEvent { + event_type: string; +} +declare export class SendSelectAssetPageViewed mixins BaseEvent { + event_type: string; +} +declare export class SendSelectAssetSelected mixins BaseEvent { + event_properties: SendSelectAssetSelectedProperties; + event_type: string; + constructor(event_properties: SendSelectAssetSelectedProperties): this; +} +declare export class SendSelectAssetUpdated mixins BaseEvent { + event_properties: SendSelectAssetUpdatedProperties; + event_type: string; + constructor(event_properties: SendSelectAssetUpdatedProperties): this; +} +declare export class SendSummaryPageViewed mixins BaseEvent { + event_properties: SendSummaryPageViewedProperties; + event_type: string; + constructor(event_properties: SendSummaryPageViewedProperties): this; +} +declare export class SendSummarySubmitted mixins BaseEvent { + event_properties: SendSummarySubmittedProperties; + event_type: string; + constructor(event_properties: SendSummarySubmittedProperties): this; +} +declare export class SettingsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class StakingCenterDelegationInitiated mixins BaseEvent { + event_type: string; +} +declare export class StakingCenterPageViewed mixins BaseEvent { + event_type: string; +} +declare export class SwapAssetFromChanged mixins BaseEvent { + event_properties: SwapAssetFromChangedProperties; + event_type: string; + constructor(event_properties: SwapAssetFromChangedProperties): this; +} +declare export class SwapAssetToChanged mixins BaseEvent { + event_properties: SwapAssetToChangedProperties; + event_type: string; + constructor(event_properties: SwapAssetToChangedProperties): this; +} +declare export class SwapCancelationSubmitted mixins BaseEvent { + event_properties: SwapCancelationSubmittedProperties; + event_type: string; + constructor(event_properties: SwapCancelationSubmittedProperties): this; +} +declare export class SwapConfirmedPageViewed mixins BaseEvent { + event_properties: SwapConfirmedPageViewedProperties; + event_type: string; + constructor(event_properties: SwapConfirmedPageViewedProperties): this; +} +declare export class SwapInitiated mixins BaseEvent { + event_properties: SwapInitiatedProperties; + event_type: string; + constructor(event_properties: SwapInitiatedProperties): this; +} +declare export class SwapOrderSelected mixins BaseEvent { + event_properties: SwapOrderSelectedProperties; + event_type: string; + constructor(event_properties: SwapOrderSelectedProperties): this; +} +declare export class SwapOrderSubmitted mixins BaseEvent { + event_properties: SwapOrderSubmittedProperties; + event_type: string; + constructor(event_properties: SwapOrderSubmittedProperties): this; +} +declare export class SwapPoolChanged mixins BaseEvent { + event_type: string; +} +declare export class SwapSlippageChanged mixins BaseEvent { + event_properties: SwapSlippageChangedProperties; + event_type: string; + constructor(event_properties: SwapSlippageChangedProperties): this; +} +declare export class ThemeSelected mixins BaseEvent { + event_properties: ThemeSelectedProperties; + event_type: string; + constructor(event_properties: ThemeSelectedProperties): this; +} +declare export class TransactionsPageViewed mixins BaseEvent { + event_type: string; +} +declare export class VotingPageViewed mixins BaseEvent { + event_type: string; +} +declare export class WalletPageViewed mixins BaseEvent { + event_type: string; +} +export type PromiseResult = {| + promise: Promise, +|}; +declare export class Ampli { + client: BrowserClient; + isLoaded: boolean; + + /** + * Initialize the Ampli SDK. Call once when your application starts. + * @param options Configuration options to initialize the Ampli SDK with. + */ + load(options: LoadOptions): PromiseResult; + + /** + * Identify a user and set user properties. + * @param userId The user's id. + * @param options Optional event options. + */ + identify( + userId: string | void, + options?: EventOptions + ): PromiseResult; + + /** + * Flush the event. + */ + flush(): PromiseResult; + + /** + * Track event + * @param event The event to track. + * @param options Optional event options. + */ + track(event: Event, options?: EventOptions): PromiseResult; + + /** + * (to delete)Governance Abstain Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/(to%20delete)Governance%20Abstain%20Page%20Viewed) + * + * This event tracks when a user selects abstain governance status and the confirm transaction page is displayed + * @param options Amplitude event options. + */ + toDeleteGovernanceAbstainPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * All Wallets Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/All%20Wallets%20Page%20Viewed) + * + * This event tracks when a user views the All Wallets page on Menu. Note: only available on Yoroi Mobile. + * @param options Amplitude event options. + */ + allWalletsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Assets Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Assets%20Page%20Viewed) + * + * This event tracks when a user views the Assets page. + * On mobile is available on the wallet page (First item from main menu) in the assets tab. + * @param options Amplitude event options. + */ + assetsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Buy Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Input%20Amount) + * + * Event to track when a user starts the buy flow and must input amount of ADA to buy + * @param options Amplitude event options. + */ + buyAdaInputAmount( + options?: EventOptions + ): PromiseResult; + + /** + * Buy Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Buy%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully buying ADA + * @param options Amplitude event options. + */ + buyAdaSuccessRedirect( + options?: EventOptions + ): PromiseResult; + + /** + * Claim ADA Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20ADA%20Page%20Viewed) + * + * This event tracks when a user views the page to claim Claim /Transfer ADA page in Extension. + * + * You can find that page under Staking section. + * @param options Amplitude event options. + */ + claimAdaPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Claim Ada Transaction Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Settled) + * + * Event to track when a user successfully claims ADA and transaction is settled on chain + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + claimAdaTransactionSettled( + properties: ClaimAdaTransactionSettledProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Claim Ada Transaction Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Claim%20Ada%20Transaction%20Submitted) + * + * This Event to track when a user submits a transaction to claim ADA. + * @param properties The event's properties (e.g. reward_amount) + * @param options Amplitude event options. + */ + claimAdaTransactionSubmitted( + properties: ClaimAdaTransactionSubmittedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Connect Wallet Check Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Check%20Page%20Viewed) + * + * This event tracks when user chooses the connect hardware wallet option. This is the 1st step of the connect hardware wallet flow. In this page, the information about connecting a harware wallet is displayed to the user. + * @param options Amplitude event options. + */ + connectWalletCheckPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Connect Wallet Connect Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Connect%20Page%20Viewed) + * + * This event tracks when user connects the device and instructions are displayed. This is the 2nd step of the flow. + * @param options Amplitude event options. + */ + connectWalletConnectPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Connect Wallet Details Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Page%20Viewed) + * + * This event tracks when user accesses the enter wallet name page. This is the 3rd and final step of the flow + * @param options Amplitude event options. + */ + connectWalletDetailsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Connect Wallet Details Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connect%20Wallet%20Details%20Submitted) + * + * This event captures the submission of the wallet name on the last step of the connecting a hardware wallet flow. + * @param properties The event's properties (e.g. hardware_wallet) + * @param options Amplitude event options. + */ + connectWalletDetailsSubmitted( + properties: ConnectWalletDetailsSubmittedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Connector Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Connector%20Page%20Viewed) + * + * This event tracks when a user views the dApp Connector page. + * @param options Amplitude event options. + */ + connectorPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Details Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Settled) + * + * When the wallet is created correctly. This event signifies the completion of the process of setting up wallet details during the creation of a new wallet + * @param options Amplitude event options. + */ + createWalletDetailsSettled( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Details Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Step%20Viewed) + * + * This event tracks when a user views the details \*\*step 4\*\* while creating a wallet. User will introduce: \* Wallet Name \* Password \* Repeat Password + * @param options Amplitude event options. + */ + createWalletDetailsStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Details Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Details%20Submitted) + * + * This event captures the submission of the wallet creation on the last step of the flow (\*\*step 4\*\*). + * @param options Amplitude event options. + */ + createWalletDetailsSubmitted( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Language Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Language%20Page%20Viewed) + * + * This event tracks when a user views the page for selecting the language during the wallet creation process on the first time he launch Yoroi. + * @param options Amplitude event options. + */ + createWalletLanguagePageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Learn Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Learn%20Phrase%20Step%20Viewed) + * + * This event tracks when a user view the \*\*first step\*\* of learn about recovery prhase + * @param options Amplitude event options. + */ + createWalletLearnPhraseStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Save Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Save%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the \*\*second step\*\* to save their wallet recovery phrase during the wallet creation process + * @param options Amplitude event options. + */ + createWalletSavePhraseStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Select Method Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Select%20Method%20Page%20Viewed) + * + * This event tracks when a user views the page where they can select the method to create a wallet: + * + * \* Create new wallet + * + * \* Restore existing wallet + * + * This event tracks when a user views the page where they can select the method to create a wallet\* Connect hardware wallet + * @param options Amplitude event options. + */ + createWalletSelectMethodPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Terms Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Terms%20Page%20Viewed) + * + * This event tracks when a user views the terms of service agreement page on the creation wallet flow + * @param options Amplitude event options. + */ + createWalletTermsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Verify Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the verification phrase step while creating a wallet + * @param options Amplitude event options. + */ + createWalletVerifyPhraseStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Create Wallet Verify Phrase Word Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Create%20Wallet%20Verify%20Phrase%20Word%20Selected) + * + * This event tracks the selection of a specific word during the process of verifying the recovery phrase when creating a wallet + * @param properties The event's properties (e.g. recovery_word_order) + * @param options Amplitude event options. + */ + createWalletVerifyPhraseWordSelected( + properties?: CreateWalletVerifyPhraseWordSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Dapp Popup Add Collateral Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Add%20Collateral%20Page%20Viewed) + * + * This event tracks when a user views the "Add Collateral" page in the Dapp Connector Popup + * @param options Amplitude event options. + */ + dappPopupAddCollateralPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Dapp Popup Connect Wallet Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Page%20Viewed) + * + * This event is triggered when the dapp connector popup is triggered and the user select the wallet that wants to connect. + * @param properties The event's properties (e.g. wallet_count) + * @param options Amplitude event options. + */ + dappPopupConnectWalletPageViewed( + properties: DappPopupConnectWalletPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Dapp Popup Connect Wallet Password Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Connect%20Wallet%20Password%20Page%20Viewed) + * + * This event tracks when a user attempts to connect their wallet by entering their password in the Dapp Connector popup + * @param options Amplitude event options. + */ + dappPopupConnectWalletPasswordPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Dapp Popup Sign Transaction Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Page%20Viewed) + * + * This event tracks when a user loads a sign transaction screen on the dapp connector. Valid for extension and mobile. + * @param options Amplitude event options. + */ + dappPopupSignTransactionPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Dapp Popup Sign Transaction Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Dapp%20Popup%20Sign%20Transaction%20Submitted) + * + * This event tracks the submission of a sign transaction request within the Dapp Connector screen. It's a Popup on extension and a full screen in Mobile. + * @param options Amplitude event options. + */ + dappPopupSignTransactionSubmitted( + options?: EventOptions + ): PromiseResult; + + /** + * Governance Choose Drep Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Choose%20Drep%20Page%20Viewed) + * + * This event tracks when user loads the bottom sheet on mobile or the popup on extension to introduce the Drep ID. To arrive to this page the user has to click on “Delegate to a Drep” section. + * @param options Amplitude event options. + */ + governanceChooseDrepPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Governance Confirm Transaction Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Confirm%20Transaction%20Page%20Viewed) + * + * This event tracks when a user loads the confirm transaction page on the Governance flow. On Extension user would insert the password in that page. On extension user would do it in a bottom sheet afterwards. + * @param properties The event's properties (e.g. governance_selection) + * @param options Amplitude event options. + */ + governanceConfirmTransactionPageViewed( + properties: GovernanceConfirmTransactionPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Governance Dashboard Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Dashboard%20Page%20Viewed) + * + * This event tracks when a user loads the Governance Dashboard Page. The page is reached via the main navigation menu in extension and in the bottom menu icon on Extension. + * @param options Amplitude event options. + */ + governanceDashboardPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Governance Transaction Success Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Governance%20Transaction%20Success%20Page%20Viewed) + * + * This event tracks when a user loads the success page at the end of the governance flow. + * @param properties The event's properties (e.g. governance_selection) + * @param options Amplitude event options. + */ + governanceTransactionSuccessPageViewed( + properties: GovernanceTransactionSuccessPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Network Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Network%20Selected) + * + * Event to track when a user selects a network + * @param properties The event's properties (e.g. from_network) + * @param options Amplitude event options. + */ + networkSelected( + properties: NetworkSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Details Image Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Image%20Viewed) + * + * This event tracks when a user views the NFT image at full screen + * @param options Amplitude event options. + */ + nftGalleryDetailsImageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Details Navigation + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Navigation) + * + * This event tracks when a use next and previous buttons to navigate across their NFTs. Note: available only on Extension. + * @param properties The event's properties (e.g. nft_navigation) + * @param options Amplitude event options. + */ + nftGalleryDetailsNavigation( + properties: NftGalleryDetailsNavigationProperties, + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Details Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Page%20Viewed) + * + * This event tracks when a user views the details page of an NFT item. + * @param options Amplitude event options. + */ + nftGalleryDetailsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Details Tab + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Details%20Tab) + * + * This event tracks user interactions with the tab in the NFT Gallery details page. It provides insights into how users engage with specific details of NFTs, such as descriptions, attributes, or additional information + * @param properties The event's properties (e.g. nft_tab) + * @param options Amplitude event options. + */ + nftGalleryDetailsTab( + properties: NftGalleryDetailsTabProperties, + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Grid View Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Grid%20View%20Selected) + * + * This event is triggered when a user selects the grid view option in the NFT gallery + * @param properties The event's properties (e.g. nft_grid_view) + * @param options Amplitude event options. + */ + nftGalleryGridViewSelected( + properties?: NftGalleryGridViewSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Page%20Viewed) + * + * This event tracks when the NFT gallery it has loaded all nfts metadata + * @param properties The event's properties (e.g. nft_count) + * @param options Amplitude event options. + */ + nftGalleryPageViewed( + properties: NftGalleryPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * NFT Gallery Search Activated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/NFT%20Gallery%20Search%20Activated) + * + * User activates and starts a search in the NFT gallery. Delay of 0.5 seconds. + * @param properties The event's properties (e.g. nft_count) + * @param options Amplitude event options. + */ + nftGallerySearchActivated( + properties: NftGallerySearchActivatedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Onboarding Analytics Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Onboarding%20Analytics%20Page%20Viewed) + * + * Event to track when a user views the onboarding analytics page. + * @param options Amplitude event options. + */ + onboardingAnalyticsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Portfolio Token Details + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Token%20Details) + * + * When user visit the detailed information about a specific token within a user's portfolio. In mobile there's 3 tabs that would be implemented in different iterations. + * @param properties The event's properties (e.g. token_details_tab) + * @param options Amplitude event options. + */ + portfolioTokenDetails( + properties: PortfolioTokenDetailsProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Portfolio Tokens List Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Page%20Viewed) + * + * Event to track when a user views the list of tokens in their portfolio. + * @param properties The event's properties (e.g. tokens_tab) + * @param options Amplitude event options. + */ + portfolioTokensListPageViewed( + properties: PortfolioTokensListPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Portfolio Tokens List Search Activated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Portfolio%20Tokens%20List%20Search%20Activated) + * + * This event tracks when a user activates and starts a search in the Tokens list page. Delay of 0.5 seconds. + * @param properties The event's properties (e.g. search_term) + * @param options Amplitude event options. + */ + portfolioTokensListSearchActivated( + properties: PortfolioTokensListSearchActivatedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Receive Amount Generated Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Generated%20Page%20Viewed) + * + * When the bottom sheet or popup with a generated address with an specific amount is loaded + * @param properties The event's properties (e.g. ada_amount) + * @param options Amplitude event options. + */ + receiveAmountGeneratedPageViewed( + properties: ReceiveAmountGeneratedPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Receive Amount Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Amount%20Page%20Viewed) + * + * When a user visit the page to insert specific amount of ADA that would be needed to generate a wallet address with that specific details. + * @param options Amplitude event options. + */ + receiveAmountPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Receive Copy Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Copy%20Address%20Clicked) + * + * When a user click on the any CTA to copy their address + * @param properties The event's properties (e.g. copy_address_location) + * @param options Amplitude event options. + */ + receiveCopyAddressClicked( + properties: ReceiveCopyAddressClickedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Receive Generate New Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Generate%20New%20Address%20Clicked) + * + * When a user click on the Generate new address button on the main receive page on the multiple address flow. + * @param options Amplitude event options. + */ + receiveGenerateNewAddressClicked( + options?: EventOptions + ): PromiseResult; + + /** + * Receive Page List Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20List%20Viewed) + * + * When user has enabled multiple addresses and goes to the page where he can see the list of generated wallet addresses + * @param options Amplitude event options. + */ + receivePageListViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Receive Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Page%20Viewed) + * + * When user loads the Receive funds screen, where user can see their wallet address with a QR Code + * @param options Amplitude event options. + */ + receivePageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Receive Share Address Clicked + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Receive%20Share%20Address%20Clicked) + * + * When a user click on the link to share the address + * @param options Amplitude event options. + */ + receiveShareAddressClicked( + options?: EventOptions + ): PromiseResult; + + /** + * Restore Wallet Details Settled + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Settled) + * + * This event captures the details of a wallet restoration process that has been successfully completed + * @param options Amplitude event options. + */ + restoreWalletDetailsSettled( + options?: EventOptions + ): PromiseResult; + + /** + * Restore Wallet Details Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Details%20Step%20Viewed) + * + * Track when user loads the page where user inserts wallet name and password + * @param options Amplitude event options. + */ + restoreWalletDetailsStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Restore Wallet Enter Phrase Step Status + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Status) + * + * This events tracks the validation of the recovery phrase is verified, once the user insert the latest word. The output can be positive or negative and we do save that in he property: recovery*prhase*status + * @param properties The event's properties (e.g. recovery_prhase_status) + * @param options Amplitude event options. + */ + restoreWalletEnterPhraseStepStatus( + properties: RestoreWalletEnterPhraseStepStatusProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Restore Wallet Enter Phrase Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Enter%20Phrase%20Step%20Viewed) + * + * This event tracks when a user views the step to enter the recovery phrase while restoring a wallet (**Step 2**). + * @param properties The event's properties (e.g. recovery_phrase_lenght) + * @param options Amplitude event options. + */ + restoreWalletEnterPhraseStepViewed( + properties: RestoreWalletEnterPhraseStepViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Restore Wallet Type Step Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Restore%20Wallet%20Type%20Step%20Viewed) + * + * This event tracks when a user views the **first step after** selecting restore wallet, were they have to choose between: + * + * * 15-word recovery phrase + * + * * 24-word recovery phrase + * @param options Amplitude event options. + */ + restoreWalletTypeStepViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Sell Ada Input Amount + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Input%20Amount) + * + * Event to track when user starts the Sell ada flow so after selecting the sell option and having to input amount of ADA to sell + * @param options Amplitude event options. + */ + sellAdaInputAmount( + options?: EventOptions + ): PromiseResult; + + /** + * Sell Ada Success Redirect + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Sell%20Ada%20Success%20Redirect) + * + * This event tracks when a user is redirected to Yoroi after successfully selling ADA + * @param options Amplitude event options. + */ + sellAdaSuccessRedirect( + options?: EventOptions + ): PromiseResult; + + /** + * Send Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Initiated) + * + * This event tracks when a user loads the default state of the first step of the multiasset transaction flow. That screen shows receiver address and optional memo + * @param options Amplitude event options. + */ + sendInitiated(options?: EventOptions): PromiseResult; + + /** + * Send Select Asset Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Page%20Viewed) + * + * This event tracks when a user views the "Amount" page in the send flow. + * @param options Amplitude event options. + */ + sendSelectAssetPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Send Select Asset Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Selected) + * + * When a user click "next" on the send flow: "Amount" step on extension / "Assets added" in mobile + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + sendSelectAssetSelected( + properties: SendSelectAssetSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Send Select Asset Updated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Select%20Asset%20Updated) + * + * When an user update the tokens selection on "amount" step: + * \- Add + * \- Remove + * \- Updated + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + sendSelectAssetUpdated( + properties: SendSelectAssetUpdatedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Send Summary Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Page%20Viewed) + * + * When a user loads the Preview page (Could be called comfirmation too) on the send flow. + * @param properties The event's properties (e.g. asset_count) + * @param options Amplitude event options. + */ + sendSummaryPageViewed( + properties: SendSummaryPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Send Summary Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Send%20Summary%20Submitted) + * + * When a user click "send" on the "Preview" step on the send flow. + * @param properties The event's properties (e.g. ada_amount) + * @param options Amplitude event options. + */ + sendSummarySubmitted( + properties: SendSummarySubmittedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Settings Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Settings%20Page%20Viewed) + * + * This event tracks when a user views the settings page within the application. + * @param options Amplitude event options. + */ + settingsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Staking Center Delegation Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Delegation%20Initiated) + * + * Event to track when a user initiates the delegation process in the Staking Center, accessing the delegate modal after selecting a pool + * @param options Amplitude event options. + */ + stakingCenterDelegationInitiated( + options?: EventOptions + ): PromiseResult; + + /** + * Staking Center Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Staking%20Center%20Page%20Viewed) + * + * This event tracks when a user views the Staking Center page on Staking menu. + * @param options Amplitude event options. + */ + stakingCenterPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Swap Asset From Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20From%20Changed) + * + * When user changed the selected asset on "From" section + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. from_asset) + * @param options Amplitude event options. + */ + swapAssetFromChanged( + properties: SwapAssetFromChangedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Asset To Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Asset%20To%20Changed) + * + * When user changed the selected asset on "To" section + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. to_asset) + * @param options Amplitude event options. + */ + swapAssetToChanged( + properties: SwapAssetToChangedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Cancelation Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Cancelation%20Submitted) + * + * When user sign a transaction to cancel the swap order + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + swapCancelationSubmitted( + properties: SwapCancelationSubmittedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Confirmed Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Confirmed%20%20Page%20Viewed) + * + * When the user opens Completed Order page + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. swap_tab) + * @param options Amplitude event options. + */ + swapConfirmedPageViewed( + properties: SwapConfirmedPageViewedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Initiated + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Initiated) + * + * When user clicks on the swap feature and sees the default state of the swap. + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. from_asset) + * @param options Amplitude event options. + */ + swapInitiated( + properties: SwapInitiatedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Order Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Selected) + * + * When user click on "swap" button after selecting asset from, entering the amount of asset form, selecting asset to, entering amount of asset to, and choosing a pool + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + swapOrderSelected( + properties: SwapOrderSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Order Submitted + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Order%20Submitted) + * + * When user click confirm on the check out page, after entering their spending password + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. from_amount) + * @param options Amplitude event options. + */ + swapOrderSubmitted( + properties: SwapOrderSubmittedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Swap Pool Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Pool%20Changed) + * + * When user clicked a different pool on the "Select Pool" page + * + * Owner: Sergio SF + * @param options Amplitude event options. + */ + swapPoolChanged( + options?: EventOptions + ): PromiseResult; + + /** + * Swap Slippage Changed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Swap%20Slippage%20Changed) + * + * When user click apply on the swap setting page + * + * Owner: Omar Rozak + * @param properties The event's properties (e.g. slippage_tolerance) + * @param options Amplitude event options. + */ + swapSlippageChanged( + properties: SwapSlippageChangedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Theme Selected + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Theme%20Selected) + * + * This event is triggrered when a user had selected a theme. + * @param properties The event's properties (e.g. theme) + * @param options Amplitude event options. + */ + themeSelected( + properties: ThemeSelectedProperties, + options?: EventOptions + ): PromiseResult; + + /** + * Transactions Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Transactions%20Page%20Viewed) + * + * This event tracks when a user views the transactions page within the wallet. On mobile is available on the wallet page (First item from main navigation item) in the transactions tab. + * @param options Amplitude event options. + */ + transactionsPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Voting Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Voting%20Page%20Viewed) + * + * This event tracks when a user views the Catalyst Voting page. + * @param options Amplitude event options. + */ + votingPageViewed( + options?: EventOptions + ): PromiseResult; + + /** + * Wallet Page Viewed + * + * [View in Tracking Plan](https://data.amplitude.com/emurgo/Yoroi/events/main/latest/Wallet%20Page%20Viewed) + * + * Wallet page is the default page when the user logs into the app and selects the wallet that is going to be using (Once the initial setup is done) + * @param options Amplitude event options. + */ + walletPageViewed( + options?: EventOptions + ): PromiseResult; +} +declare export var ampli: Ampli; +declare type BrowserOptions = amplitude.Types.BrowserOptions; +export type BrowserClient = amplitude.Types.BrowserClient; +export type BaseEvent = amplitude.Types.BaseEvent; +export type IdentifyEvent = amplitude.Types.IdentifyEvent; +export type GroupEvent = amplitude.Types.GroupIdentifyEvent; +export type Event = amplitude.Types.Event; +export type EventOptions = amplitude.Types.EventOptions; +export type Result = amplitude.Types.Result; From ae797c256282cc68ce828c5a2828777ce899b511 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Wed, 18 Dec 2024 11:43:32 +0200 Subject: [PATCH 10/14] add analytics on search --- .../portfolio/useCases/Wallet/PortfolioWallet.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx b/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx index 4e365c0442..e652cb8602 100644 --- a/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx +++ b/packages/yoroi-extension/app/UI/features/portfolio/useCases/Wallet/PortfolioWallet.tsx @@ -45,6 +45,18 @@ const PortfolioWallet = (): JSX.Element => { } else { setTokenList([]); } + + let timeout: ReturnType | undefined; + const sendMetrics = () => { + clearTimeout(timeout); + timeout = setTimeout(() => { + ampli.portfolioTokensListSearchActivated({ search_term: lowercaseKeyword }); + }, 500); // 0.5s requirement + }; + + if (lowercaseKeyword.length > 0) sendMetrics(); + + return () => clearTimeout(timeout); }, [keyword]); return ( From a78693f4c31ac29bfb734242be79a86231be4989 Mon Sep 17 00:00:00 2001 From: Sorin Chis Date: Wed, 18 Dec 2024 14:04:53 +0200 Subject: [PATCH 11/14] uodate theme when connect hardware wallet --- .../wallet/hwConnect/trezor/CheckDialog.js | 103 ++++++++++-------- .../wallet/hwConnect/trezor/ConnectDialog.js | 65 +++++------ .../wallet/hwConnect/trezor/HelpLinkBlock.js | 18 ++- 3 files changed, 92 insertions(+), 94 deletions(-) diff --git a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js index 00c102205a..3057880c55 100644 --- a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js +++ b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js @@ -16,14 +16,15 @@ import ProgressStepBlock from '../common/ProgressStepBlock'; import HelpLinkBlock from './HelpLinkBlock'; import HWErrorBlock from '../common/HWErrorBlock'; -import { ReactComponent as ExternalLinkSVG } from '../../../../assets/images/link-external.inline.svg'; -import { ReactComponent as AboutPrerequisiteIconSVG } from '../../../../assets/images/hardware-wallet/check-prerequisite-header-icon.inline.svg'; -import { ReactComponent as AboutPrerequisiteTrezorSVG } from '../../../../assets/images/hardware-wallet/trezor/check.inline.svg'; -import { ReactComponent as AboutTrezorSvg } from '../../../../assets/images/hardware-wallet/trezor/check-modern.inline.svg'; +import { ReactComponent as ExternalLinkSVG } from '../../../../assets/images/link-external.inline.svg'; +import { ReactComponent as AboutPrerequisiteIconSVG } from '../../../../assets/images/hardware-wallet/check-prerequisite-header-icon.inline.svg'; +import { ReactComponent as AboutPrerequisiteTrezorSVG } from '../../../../assets/images/hardware-wallet/trezor/check.inline.svg'; +import { ReactComponent as AboutTrezorSvg } from '../../../../assets/images/hardware-wallet/trezor/check-modern.inline.svg'; import { ProgressInfo } from '../../../../types/HWConnectStoreTypes'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import styles from '../common/CheckDialog.scss'; +import { Link, Box, styled, Stack, List, ListItem, Typography } from '@mui/material'; const messages = defineMessages({ aboutPrerequisite1Part1Text: { @@ -63,52 +64,56 @@ type Props = {| +classicTheme: boolean, |}; +const IconWrapper = styled(Box)(({ theme }) => ({ + '& svg': { + '& path': { + fill: theme.palette.ds.el_gray_medium, + }, + }, +})); + @observer export default class CheckDialog extends Component { - - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { - intl: intlShape.isRequired + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { + intl: intlShape.isRequired, }; render(): Node { const { intl } = this.context; - const { - progressInfo, - isActionProcessing, - error, - onExternalLinkClick, - submit, - cancel, - classicTheme, - } = this.props; + const { progressInfo, isActionProcessing, error, onExternalLinkClick, submit, cancel, classicTheme } = this.props; const middleBlock = (
{!classicTheme && }
-
- - + + + + + {intl.formatMessage(globalMessages.hwConnectDialogAboutPrerequisiteHeader)} - -
- + + + + + + • {intl.formatMessage(messages.aboutPrerequisite1Part1Text) + ' '} + + onExternalLinkClick(event)}> + + + + + {intl.formatMessage(messages.aboutPrerequisite1Part2)} + + • {intl.formatMessage(messages.aboutPrerequisite2)} + • {intl.formatMessage(messages.aboutPrerequisite3)} + + • {intl.formatMessage(globalMessages.hwConnectDialogAboutPrerequisite4)} + + • {intl.formatMessage(messages.aboutPrerequisite5)} +
{classicTheme && ( @@ -116,14 +121,17 @@ export default class CheckDialog extends Component {
)} - ); + + ); - const dailogActions = [{ - label: intl.formatMessage(globalMessages.nextButtonLabel), - primary: true, - onClick: submit, - isSubmitting: isActionProcessing, - }]; + const dailogActions = [ + { + label: intl.formatMessage(globalMessages.nextButtonLabel), + primary: true, + onClick: submit, + isSubmitting: isActionProcessing, + }, + ]; return ( { > {middleBlock} - {error && - - } + {error && } - ); + + ); } } diff --git a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/ConnectDialog.js b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/ConnectDialog.js index 3d396b6c95..66da73effb 100644 --- a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/ConnectDialog.js +++ b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/ConnectDialog.js @@ -17,10 +17,10 @@ import HelpLinkBlock from './HelpLinkBlock'; import HWErrorBlock from '../common/HWErrorBlock'; import connectLoadImage from '../../../../assets/images/hardware-wallet/trezor/connect-load-modern.inline.gif'; -import { ReactComponent as ConnectErrorImage } from '../../../../assets/images/hardware-wallet/trezor/connect-error-modern.inline.svg'; +import { ReactComponent as ConnectErrorImage } from '../../../../assets/images/hardware-wallet/trezor/connect-error-modern.inline.svg'; import connectLoadGIF from '../../../../assets/images/hardware-wallet/trezor/connect-load.gif'; -import { ReactComponent as ConnectErrorSVG } from '../../../../assets/images/hardware-wallet/trezor/connect-error.inline.svg'; +import { ReactComponent as ConnectErrorSVG } from '../../../../assets/images/hardware-wallet/trezor/connect-error.inline.svg'; import { ProgressInfo } from '../../../../types/HWConnectStoreTypes'; import { StepState } from '../../../widgets/ProgressSteps'; @@ -30,6 +30,7 @@ import { Logger } from '../../../../utils/logging'; import styles from '../common/ConnectDialog.scss'; import headerMixin from '../../../mixins/HeaderBlock.scss'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; +import { Typography } from '@mui/material'; const connectStartGIF = connectLoadGIF; @@ -52,27 +53,18 @@ type Props = {| +goBack: void => void, +submit: void => PossiblyAsync, +cancel: void => void, - +classicTheme: boolean + +classicTheme: boolean, |}; @observer export default class ConnectDialog extends Component { - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { - intl: intlShape.isRequired + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { + intl: intlShape.isRequired, }; render(): Node { const { intl } = this.context; - const { - progressInfo, - isActionProcessing, - error, - onExternalLinkClick, - goBack, - submit, - cancel, - classicTheme - } = this.props; + const { progressInfo, isActionProcessing, error, onExternalLinkClick, goBack, submit, cancel, classicTheme } = this.props; const introBlock = classicTheme ? (
@@ -85,11 +77,11 @@ export default class ConnectDialog extends Component {
) : (
- + {intl.formatMessage(messages.connectIntroTextLine1) + ' '} {intl.formatMessage(messages.connectIntroTextLine2) + ' '} {intl.formatMessage(globalMessages.hwConnectDialogConnectIntroTextLine3)} - +
); @@ -98,40 +90,42 @@ export default class ConnectDialog extends Component { switch (progressInfo.stepState) { case StepState.LOAD: - backButton = (); + backButton = ; middleBlock = (
-
); + + ); break; case StepState.PROCESS: backButton = null; middleBlock = (
-
); + + ); break; case StepState.ERROR: - backButton = (); + backButton = ; middleBlock = (
- {classicTheme - ? - : - } -
); + {classicTheme ? : } + + ); break; default: Logger.error('trezorConnect::ConnectDialog::render: something unexpected happened'); break; } - const dailogActions = [{ - label: intl.formatMessage(globalMessages.connectLabel), - primary: true, - isSubmitting: isActionProcessing, - onClick: submit - }]; + const dailogActions = [ + { + label: intl.formatMessage(globalMessages.connectLabel), + primary: true, + isSubmitting: isActionProcessing, + onClick: submit, + }, + ]; return ( { {introBlock} {middleBlock} - {error && - - } + {error && } - ); + + ); } } diff --git a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/HelpLinkBlock.js b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/HelpLinkBlock.js index bb17699a4b..807686978b 100644 --- a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/HelpLinkBlock.js +++ b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/HelpLinkBlock.js @@ -4,9 +4,10 @@ import type { Node } from 'react'; import { observer } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; -import { ReactComponent as ExternalLinkSVG } from '../../../../assets/images/link-external.inline.svg'; +import { ReactComponent as ExternalLinkSVG } from '../../../../assets/images/link-external.inline.svg'; import styles from '../common/HelpLinkBlock.scss'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; +import { Link } from '@mui/material'; const messages = defineMessages({ helpLinkYoroiWithTrezor: { @@ -25,9 +26,8 @@ type Props = {| @observer export default class HelpLinkBlock extends Component { - - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { - intl: intlShape.isRequired + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { + intl: intlShape.isRequired, }; render(): Node { @@ -36,13 +36,11 @@ export default class HelpLinkBlock extends Component { return ( ); + + + ); } } From 681bdfebfaadfe94391cbebad8a7f68ccb8a9c91 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Wed, 18 Dec 2024 22:09:22 +0300 Subject: [PATCH 12/14] undeleting ampli readme --- packages/yoroi-extension/ampli/README.md | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 packages/yoroi-extension/ampli/README.md diff --git a/packages/yoroi-extension/ampli/README.md b/packages/yoroi-extension/ampli/README.md new file mode 100644 index 0000000000..6a32082fb5 --- /dev/null +++ b/packages/yoroi-extension/ampli/README.md @@ -0,0 +1,52 @@ +The coerce the TypeScript Amplitude wrapper to work with flow, do these: + +``` +npm run metrics:pull +``` + +``` +cd ampli +``` + + +``` +npx -p typescript tsc index.ts --outDir . -d -m es6 +``` + +``` +npx flowgen --interface-records --no-inexact --add-flow-header -o index.js.flow index.d.ts +``` + +``` +rm *.ts +``` + +#### Next + +Linux: +``` +sed -i 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow +sed -i '/export type BaseEvent/d' index.js.flow + +``` + +Mac: +``` +sed -i'.bak' 's/amplitude\.Types\.[a-zA-Z0-9_]*/any/' index.js.flow +sed -i'.bak' '/export type BaseEvent/d' index.js.flow +rm *.bak +``` + +Edit `index.js.flow` to add the line `class BaseEvent {}`. + +Then we have flow-typed ampli library where all event trigger functions are strongly typed. +To use this libray, import like this from source code: +``` +import type { LoadOptionsWithEnvironment } from '../../../ampli/index'; +``` +instead of +``` +import type { LoadOptionsWithEnvironment } from '../../../ampli'; +``` +Due to perhaps a bug in flow, the later short-circuits type checking. + From 732177e60233cf425e8394fae814ac3eab092e02 Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Thu, 19 Dec 2024 11:04:42 +0300 Subject: [PATCH 13/14] lint fix --- .../app/components/wallet/hwConnect/trezor/CheckDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js index 3057880c55..6235ba4141 100644 --- a/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js +++ b/packages/yoroi-extension/app/components/wallet/hwConnect/trezor/CheckDialog.js @@ -24,7 +24,7 @@ import { ReactComponent as AboutTrezorSvg } from '../../../../assets/images/hard import { ProgressInfo } from '../../../../types/HWConnectStoreTypes'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import styles from '../common/CheckDialog.scss'; -import { Link, Box, styled, Stack, List, ListItem, Typography } from '@mui/material'; +import { Link, Box, styled, Stack, Typography } from '@mui/material'; const messages = defineMessages({ aboutPrerequisite1Part1Text: { From 00ec2e1d0995f32c4a1cfa08550a868506243010 Mon Sep 17 00:00:00 2001 From: Denis Nebytov Date: Fri, 20 Dec 2024 17:19:00 +0300 Subject: [PATCH 14/14] fixed remarks --- .../app/components/transfer/BaseTransferPage.js | 1 - .../app/components/transfer/cards/TransferTypeSelect.js | 6 +++++- packages/yoroi-extension/app/i18n/locales/en-US.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/yoroi-extension/app/components/transfer/BaseTransferPage.js b/packages/yoroi-extension/app/components/transfer/BaseTransferPage.js index c3b8e00794..c87f7f6aa7 100644 --- a/packages/yoroi-extension/app/components/transfer/BaseTransferPage.js +++ b/packages/yoroi-extension/app/components/transfer/BaseTransferPage.js @@ -55,7 +55,6 @@ export default class BaseTransferPage extends Component { actions={actions} closeOnOverlayClick={false} onClose={onBack} - className={undefined} backButton={} > diff --git a/packages/yoroi-extension/app/components/transfer/cards/TransferTypeSelect.js b/packages/yoroi-extension/app/components/transfer/cards/TransferTypeSelect.js index 170048e229..7813c07f4d 100644 --- a/packages/yoroi-extension/app/components/transfer/cards/TransferTypeSelect.js +++ b/packages/yoroi-extension/app/components/transfer/cards/TransferTypeSelect.js @@ -23,6 +23,10 @@ const messages = defineMessages({ id: 'wallet.transfer.subInstruction', defaultMessage: '!!!Learn more about Byron and Shelley eras and how to claim ADA on our', }, + faqAbbreviation: { + id: 'settings.support.faq.abbreviation', + defaultMessage: '!!!FAQ', + } }); @observer @@ -39,7 +43,7 @@ export default class TransferTypeSelect extends Component { onClick={event => handleExternalLinkClick(event)} id="settings:support-faq-link" > - FAQ + {intl.formatMessage(messages.faqAbbreviation)} ); diff --git a/packages/yoroi-extension/app/i18n/locales/en-US.json b/packages/yoroi-extension/app/i18n/locales/en-US.json index 501e9d078f..adfa645487 100644 --- a/packages/yoroi-extension/app/i18n/locales/en-US.json +++ b/packages/yoroi-extension/app/i18n/locales/en-US.json @@ -319,6 +319,7 @@ "settings.support.faq.faqLink": "FAQ on Yoroi website", "settings.support.faq.faqLinkURL": "https://yoroi-wallet.com/faq/", "settings.support.faq.title": "Frequently asked questions", + "settings.support.faq.abbreviation": "FAQ", "settings.support.logs.content": "If you want to inspect logs, you can {downloadLogsLink}. Logs do not contain sensitive information, and it would be helpful to attach them to problem reports to help the team investigate the issue you are experiencing.", "settings.support.logs.downloadLogsButtonLabel": "Download Logs", "settings.support.logs.downloadLogsLink": "download them here",