Compare commits

..

5 Commits

Author SHA1 Message Date
d8d165a5da Test lint CI
All checks were successful
Lint and Build / Run lint and build checks (push) Successful in 3m49s
2025-12-29 14:35:20 +05:30
7bcd6fa1a0 Update lint and build workflow
All checks were successful
Lint and Build / Run lint and build checks (pull_request) Successful in 3m45s
2025-12-29 14:01:28 +05:30
40118f53f6 Revert "Add lint and build github workflow"
All checks were successful
/ Run lint and build checks (pull_request) Successful in 3m37s
This reverts commit c4aa6a8494.
2025-12-26 10:26:52 +05:30
a612d43f97 Update gitea lint CI to trigger on push to main branch
All checks were successful
/ Run lint and build checks (pull_request) Successful in 3m49s
2025-12-23 16:58:09 +05:30
AdityaSalunkhe21
c4aa6a8494 Add lint and build github workflow 2025-12-23 16:58:09 +05:30
5 changed files with 10 additions and 57 deletions

View File

@ -4,7 +4,7 @@ on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
# branches: [ main ]
jobs:
lint-and-build:

View File

@ -1,6 +1,6 @@
{
"name": "web-wallet",
"version": "0.1.7-zenith-0.2.5",
"version": "0.1.7-zenith-0.2.3",
"private": true,
"dependencies": {
"@laconic-network/cosmjs-util": "^0.1.0",

View File

@ -1,6 +1,6 @@
import { useEffect, useCallback } from "react";
import { addNewNetwork, createWallet, checkNetworkForChainID, isWalletCreated, updateNetworkRpcUrl } from "../utils/accounts";
import { addNewNetwork, createWallet, checkNetworkForChainID, isWalletCreated } from "../utils/accounts";
import { useNetworks } from "../context/NetworksContext";
import { NETWORK_ADDED_RESPONSE, NETWORK_ADD_FAILED_RESPONSE, NETWORK_ALREADY_EXISTS_RESPONSE, REQUEST_ADD_NETWORK } from "../utils/constants";
import { NetworksFormData } from "../types";
@ -52,11 +52,6 @@ const useCreateNetwork = () => {
chainId
}, sourceOrigin);
} else {
console.log("Network already exists. Updating RPC URL");
const retrievedNetworksData = await updateNetworkRpcUrl(chainId, networkData.rpcUrl);
setNetworksData(retrievedNetworksData);
sendMessage(window.parent, NETWORK_ALREADY_EXISTS_RESPONSE, {
type: NETWORK_ALREADY_EXISTS_RESPONSE,
chainId

View File

@ -1,10 +1,12 @@
import { useEffect } from 'react';
import { retrieveNetworksData, retrieveAccounts } from '../utils/accounts';
import { useAccounts } from '../context/AccountsContext';
import { getPathKey, sendMessage } from '../utils/misc';
import { ACCOUNT_PK_RESPONSE, REQUEST_ACCOUNT_PK } from '../utils/constants';
const useExportPKEmbed = () => {
const { accounts } = useAccounts();
useEffect(() => {
const handleMessage = async (event: MessageEvent) => {
const { type, chainId, address } = event.data;
@ -12,23 +14,9 @@ const useExportPKEmbed = () => {
if (type !== REQUEST_ACCOUNT_PK) return;
try {
// Look up the network and accounts directly from storage
// rather than relying on the accounts context, which can be
// overwritten by HomeScreen's fetchAccounts for a different network.
const networksData = await retrieveNetworksData();
const targetNetwork = networksData.find(
net => `${net.namespace}:${net.chainId}` === chainId,
);
if (!targetNetwork) {
throw new Error("Network not found");
}
const networkAccounts = await retrieveAccounts(targetNetwork);
const selectedAccount = networkAccounts?.find(account => account.address === address);
const selectedAccount = accounts.find(account => account.address === address);
if (!selectedAccount) {
throw new Error("Account not found");
throw new Error("Account not found")
}
const pathKey = await getPathKey(chainId, selectedAccount.index);
@ -49,7 +37,7 @@ const useExportPKEmbed = () => {
return () => {
window.removeEventListener('message', handleMessage);
};
}, []);
}, [accounts]);
};
export default useExportPKEmbed;

View File

@ -459,35 +459,6 @@ const checkNetworkForChainID = async (
return networksData.some((network) => network.chainId === chainId);
}
const updateNetworkRpcUrl = async (
chainId: string,
rpcUrl: string,
): Promise<NetworksDataState[]> => {
const networks = await getInternetCredentials('networks');
if (!networks) {
throw new Error('Networks not found');
}
const networksData: NetworksDataState[] = JSON.parse(networks);
const networkIndex = networksData.findIndex((network) => network.chainId === chainId);
if (networkIndex === -1) {
throw new Error('Network not found');
}
networksData[networkIndex].rpcUrl = rpcUrl;
await setInternetCredentials(
'networks',
'_',
JSON.stringify(networksData),
);
return networksData;
}
const isWalletCreated = async (
): Promise<boolean> => {
const mnemonicServer = await getInternetCredentials("mnemonicServer");
@ -512,6 +483,5 @@ export {
getCosmosAccountByHDPath,
addNewNetwork,
checkNetworkForChainID,
isWalletCreated,
updateNetworkRpcUrl
isWalletCreated
};