diff --git a/src/app/core/constants/account.constant.ts b/src/app/core/constants/account.constant.ts index 9ef806a06..b65cc13b2 100644 --- a/src/app/core/constants/account.constant.ts +++ b/src/app/core/constants/account.constant.ts @@ -32,6 +32,6 @@ export const TABS_TITLE_ACCOUNT = [ { label: TabsAccount.NftTxs, value: TabsAccountLink.NftTxs }, ]; -export const COSMOS_ACCOUNT_MESSAGE_TYPE = "/cosmos.auth.v1beta1.BaseAccount"; +export const EVM_ACCOUNT_MESSAGE_TYPE = "'/ethermint.types.v1.EthAccount'"; export const COSMOS_WARNING_MESSAGE = "An account created by a EVM wallet (such as Metamask, Rabby, etc.) cannot be used to sign Cosmos transactions." export const EVM_WARNING_MESSAGE = "An account created by a Cosmos wallet (such as Keplr, Leap,...) cannot be used to sign EVM transactions." \ No newline at end of file diff --git a/src/app/pages/account/account-detail/account-detail.component.ts b/src/app/pages/account/account-detail/account-detail.component.ts index 1d5896ec7..09f2a6c4b 100644 --- a/src/app/pages/account/account-detail/account-detail.component.ts +++ b/src/app/pages/account/account-detail/account-detail.component.ts @@ -16,7 +16,7 @@ import { WalletService } from 'src/app/core/services/wallet.service'; import { transferAddress } from 'src/app/core/utils/common/address-converter'; import local from 'src/app/core/utils/storage/local'; import { EnvironmentService } from '../../../../app/core/data-services/environment.service'; -import { COSMOS_ACCOUNT_MESSAGE_TYPE, ACCOUNT_WALLET_COLOR, COSMOS_WARNING_MESSAGE, EVM_WARNING_MESSAGE } from '../../../core/constants/account.constant'; +import { ACCOUNT_WALLET_COLOR, COSMOS_WARNING_MESSAGE, EVM_WARNING_MESSAGE, EVM_ACCOUNT_MESSAGE_TYPE } from '../../../core/constants/account.constant'; import { ACCOUNT_WALLET_COLOR_ENUM, ENameTag, WalletAcount } from '../../../core/constants/account.enum'; import { DATE_TIME_WITH_MILLISECOND, STORAGE_KEYS } from '../../../core/constants/common.constant'; import { AccountService } from '../../../core/services/account.service'; @@ -143,16 +143,22 @@ export class AccountDetailComponent implements OnInit, OnDestroy { address: accountAddress, }; this.userService.getAccountInfoOfAddress(payload).subscribe({ - next: (data: { account?: {type?: string; sequence?: number; pubkey?: object}[] } = {}) => { + next: (data: { account?: {type?: any; sequence?: number; pubkey?: object}[] } = {}) => { const { account } = data; if(!account?.length) return; const { type, sequence, pubkey = {} } = account[0] || {}; - if (type !== COSMOS_ACCOUNT_MESSAGE_TYPE || !sequence) return; - - if(!Object.keys(pubkey)?.length){ + if (!type && !sequence) return; + console.log( type, sequence, pubkey); + + if (type === EVM_ACCOUNT_MESSAGE_TYPE) { + this.accountType = 'evm'; + this.tooltipCosmosText = COSMOS_WARNING_MESSAGE; + return; + } + if(!Object.keys(pubkey)?.length) { this.accountType = 'evm'; this.tooltipCosmosText = COSMOS_WARNING_MESSAGE; return; diff --git a/src/app/shared/components/wallet-connect/wallet-connect.component.html b/src/app/shared/components/wallet-connect/wallet-connect.component.html index 7725a6115..15bc1d7a2 100644 --- a/src/app/shared/components/wallet-connect/wallet-connect.component.html +++ b/src/app/shared/components/wallet-connect/wallet-connect.component.html @@ -36,7 +36,7 @@
warning - {{ng.wallet?.cosmosAccount ? "Aura Cosmos connected!." : ng.wallet?.evmAccount ? "Aura EVM connected!" : + {{ng.wallet?.cosmosAccount ? "Aura Cosmos connected!" : ng.wallet?.evmAccount ? "Aura EVM connected!" : ""}}