Check for cosmos namespace while getting cosmos accounts
This commit is contained in:
parent
3363ad7a39
commit
f8a7f14077
@ -58,7 +58,7 @@ const signCosmosMessage = async (
|
||||
const networks = await retrieveNetworksData();
|
||||
|
||||
const currentNetwork = networks.filter(network => {
|
||||
return cosmosAddress.startsWith(network.addressPrefix ?? '')
|
||||
return network.namespace === COSMOS && cosmosAddress.startsWith(network.addressPrefix ?? '')
|
||||
});
|
||||
|
||||
const cosmosAccount = await getCosmosAccounts(mnemonic, path, currentNetwork[0].addressPrefix);
|
||||
|
||||
@ -19,6 +19,7 @@ import { Account } from '../../types';
|
||||
import { getMnemonic, getPathKey } from '../misc';
|
||||
import { getCosmosAccounts, retrieveNetworksData } from '../accounts';
|
||||
import { COSMOS_METHODS } from './COSMOSData';
|
||||
import { COSMOS } from '../constants';
|
||||
|
||||
interface EthSendTransaction {
|
||||
type: 'eth_sendTransaction';
|
||||
@ -83,10 +84,10 @@ export async function approveWalletConnectRequest(
|
||||
const networks = await retrieveNetworksData();
|
||||
|
||||
const currentNetwork = networks.filter(network => {
|
||||
return account.address.startsWith(network.addressPrefix ?? '')
|
||||
return network.namespace === COSMOS && account.address.startsWith(network.addressPrefix ?? '')
|
||||
});
|
||||
|
||||
const cosmosAccount = await getCosmosAccounts(mnemonic, path, currentNetwork[0].addressPrefix);
|
||||
const cosmosAccount = await getCosmosAccounts(mnemonic, path, currentNetwork[0]?.addressPrefix);
|
||||
const address = account.address;
|
||||
|
||||
switch (request.method) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user