Rename methods
This commit is contained in:
parent
5c335d39db
commit
75df51b780
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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");
|
||||
},
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user