diff --git a/src/antelope/wallets/ual/MetakeepUAL.ts b/src/antelope/wallets/ual/MetakeepUAL.ts index b37c8bb9..fd0638e0 100644 --- a/src/antelope/wallets/ual/MetakeepUAL.ts +++ b/src/antelope/wallets/ual/MetakeepUAL.ts @@ -21,6 +21,7 @@ export interface MetakeepUALOptions { reasonCallback?: (transaction: any) => string; } let metakeep: MetaKeep | null = null; +const metakeep_name = 'metakeep.ual'; // This interface is used to store the data in the local cache export interface MetakeepData { @@ -92,7 +93,7 @@ export class MetakeepAuthenticator extends Authenticator { } getName() { - return 'metakeep.ual'; + return metakeep_name; } /** @@ -125,7 +126,7 @@ export class MetakeepAuthenticator extends Authenticator { // An icon displayed to app users when selecting their authentication method icon: 'no-icon', // Name displayed to app users - text: 'metakeep', + text: metakeep_name, // Background color displayed to app users who select your authenticator background: '#030238', // Color of text used on top the `backgound` property above diff --git a/src/antelope/wallets/ual/utils/metakeep-cache.ts b/src/antelope/wallets/ual/utils/metakeep-cache.ts index 3b39b1c7..d3b7bf2d 100644 --- a/src/antelope/wallets/ual/utils/metakeep-cache.ts +++ b/src/antelope/wallets/ual/utils/metakeep-cache.ts @@ -73,6 +73,10 @@ class MetakeepCache { } } + public getMails(): string[] { + return Object.keys(this.cache); + } + public getEosAddress(email: string): string { this.assertCache(email); return this.cache[email]?.wallet?.eosAddress ?? ''; diff --git a/src/i18n/en-us/index.js b/src/i18n/en-us/index.js index 330bd044..fa486ba9 100644 --- a/src/i18n/en-us/index.js +++ b/src/i18n/en-us/index.js @@ -618,5 +618,17 @@ export default { telos_cloud_discontinued_title: 'Important', telos_cloud_discontinued_message_title: 'Attention Users: Telos Cloud Wallet account option will be discontinued.', telos_cloud_discontinued_message_body:'The Telos Cloud Wallet (ORE ID via Google) account option to connect and sign transactions will be discontinued after December 31st. If you use the Telos Cloud Wallet to access your account, please transfer your assets to another wallet before this deadline. This change does not impact users accessing their accounts via Metamask, WalletConnect, Anchor, or other sign-in methods.', + welcome_new_telos_cloud_title_part_1: 'New Telos Cloud Wallet', + welcome_new_telos_cloud_title_part_2: 'Welcome back', + welcome_new_telos_cloud: 'If you are new to Telos Cloud Wallet, please sign in with your Google account to create a new Telos account.', + warn_old_telos_cloud_users_title: 'Attention Old Users', + warn_old_telos_cloud_users_part_1: 'If you are an old Telos Cloud Wallet user, you need to log in with the Google above first, button to create your brand-new account. Then log out and come back here to start the migration.', + warn_old_telos_cloud_users_part_2: 'If you are an old Telos Cloud Wallet user, now you can start migrating all your assets to your new account. Please click the button below to start the migration.', + + you_need_to_migrate_title: 'You need to migrate your assets', + you_need_to_migrate_sub_title: 'The access to this account will be discontinued, therefore you need to migrate your assets to a new account.', + you_need_to_migrate_nfts_first: 'You should start transfer all your collectibles to your new account first, and then continue with your tokens.', + you_need_to_migrate_all_tokens: 'You should start transfer all your tokens to your new account. Leave the TLOS tokens for the end.', + }, }; diff --git a/src/pages/evm/wallet/WalletPage.vue b/src/pages/evm/wallet/WalletPage.vue index e2a7a297..91f61031 100644 --- a/src/pages/evm/wallet/WalletPage.vue +++ b/src/pages/evm/wallet/WalletPage.vue @@ -7,9 +7,11 @@ import WalletPageHeader from 'pages/evm/wallet/WalletPageHeader.vue'; import WalletBalanceRow from 'pages/evm/wallet/WalletBalanceRow.vue'; import { CURRENT_CONTEXT, useAccountStore, useBalancesStore, useFeedbackStore, useHistoryStore } from 'src/antelope'; import WalletTransactionsTab from 'pages/evm/wallet/WalletTransactionsTab.vue'; +// import { metakeepCache } from 'src/antelope/wallets/ual/utils/metakeep-cache'; +import { useI18n } from 'vue-i18n'; const route = useRoute(); - +const { t: $t } = useI18n(); const historyStore = useHistoryStore(); const accountStore = useAccountStore(); const feedback = useFeedbackStore(); @@ -51,6 +53,45 @@ watch(accountStore, (newAccountStoreState) => { }, { immediate: true }); +// -------- migration functions ------------ +/* +const metakeepAlreadyCreated = computed(() => { + const emails = metakeepCache.getMails(); + if (emails.length > 0) { + const ethPubKey = metakeepCache.getEthAddress(emails[0]); + if (ethPubKey) { + return ethPubKey; + } + } + return ''; +}); + +const nftsStore = useNftsStore(); +const balanceStore = useBalancesStore(); +const nfts = computed(() => nftsStore.loggedInventory); +const balances = computed(() => balanceStore.loggedBalances); +const authenticator = useAccountStore().getAccount(CURRENT_CONTEXT).authenticator; +console.log('authenticator', authenticator); +const currentAuthName = authenticator?.getName() || ''; +if (currentAuthName === 'metakeep' && metakeepAlreadyCreated.value !== '') { + // we need to notify the user that he needs to migrate his assets + getAntelope().config.notifyRememberInfoHandler( + $t('temporal.you_need_to_migrate_title'), + [{ + tag: 'p', + class: 'c-notify__message--subtitle', + text: $t('temporal.you_need_to_migrate_sub_title'), + }, { + tag: 'p', + class: '', + text: nfts.value.length > 0 ? $t('temporal.you_need_to_migrate_nfts_first') : $t('temporal.you_need_to_migrate_all_tokens'), + }], + '', + 'telos-cloud-discontinued', + ); +} +*/ +