Rename methods

This commit is contained in:
Shreerang Kale 2025-06-05 13:51:48 +05:30
parent 5c335d39db
commit 75df51b780
4 changed files with 8 additions and 8 deletions

View File

@ -85,7 +85,7 @@ const Accounts = () => {
const addAccountHandler = async () => {
setIsAccountCreating(true);
const newAccount = await addAccount(selectedNetwork!);
const newAccount = await addAccount(selectedNetwork!.chainId);
setIsAccountCreating(false);
if (newAccount) {
updateAccounts(newAccount);

View File

@ -16,7 +16,7 @@ const useAddAccountEmbed = () => {
const { getAccountsData } = useAccountsData();
const addAccountHandler = useCallback(async (network: NetworksDataState) => {
const newAccount = await addAccount(network);
const newAccount = await addAccount(network.chainId);
if (newAccount) {
setAccounts(prev => [...prev, newAccount]);
setCurrentIndex(newAccount.index);

View File

@ -13,7 +13,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { StackParamsList } from "../types";
import { SelectNetworkType } from "../components/SelectNetworkType";
import { addAccountsForANetwork, getNextAccountId, storeNetworkData } from "../utils/accounts";
import { addAccountsForNetwork, getNextAccountId, storeNetworkData } from "../utils/accounts";
import { useNetworks } from "../context/NetworksContext";
import {
COSMOS,
@ -208,7 +208,7 @@ const AddNetwork = () => {
),
]);
await addAccountsForANetwork(selectedNetwork!, currentNumberOfAccounts - 1);
await addAccountsForNetwork(selectedNetwork!, currentNumberOfAccounts - 1);
navigation.navigate("Home");
},

View File

@ -87,7 +87,7 @@ const createWalletFromMnemonic = async (
};
const addAccount = async (
selectedNetwork: NetworksDataState,
chainId: string,
): Promise<Account | undefined> => {
try {
let selectedNetworkAccount
@ -101,7 +101,7 @@ const addAccount = async (
const account = await addAccountFromHDPath(hdPath, network);
await updateAccountCounter(namespaceChainId, id);
if (network.networkId === selectedNetwork.networkId) {
if (network.chainId === chainId) {
selectedNetworkAccount = account;
}
}
@ -112,7 +112,7 @@ const addAccount = async (
}
};
const addAccountsForANetwork = async (
const addAccountsForNetwork = async (
network: NetworksDataState,
numberOfAccounts: number,
): Promise<void> => {
@ -372,7 +372,7 @@ export {
createWallet,
addAccount,
addAccountFromHDPath,
addAccountsForANetwork,
addAccountsForNetwork,
storeNetworkData,
retrieveNetworksData,
retrieveAccounts,