fix: remove unused getApprovedChainId and stale eslint-disable

This commit is contained in:
2026-02-24 22:24:44 +03:00
parent 240a05a999
commit 2f89afc051
2 changed files with 0 additions and 23 deletions
-1
View File
@@ -574,7 +574,6 @@ export const PezkuwiProvider: React.FC<PezkuwiProviderProps> = ({
window.addEventListener('walletconnect_disconnected', handleWcDisconnect);
return () => window.removeEventListener('walletconnect_disconnected', handleWcDisconnect);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [walletSource]);
const value: PezkuwiContextType = {
-22
View File
@@ -30,28 +30,6 @@ let initPromise: Promise<SignClient> | null = null;
let currentSession: SessionTypes.Struct | null = null;
let requestId = 0;
/**
* Get a chainId that is approved in the current WC session.
* The wallet determines actual signing chain from the payload's genesisHash,
* so the WC request chainId is only for WC protocol compliance.
*/
function getApprovedChainId(fallback: string): string {
if (!currentSession) return fallback;
const ns = currentSession.namespaces['polkadot'];
if (!ns) return fallback;
// Try chains array first
if (ns.chains && ns.chains.length > 0) return ns.chains[0];
// Derive from accounts (format: polkadot:<chain_id>:<address>)
if (ns.accounts && ns.accounts.length > 0) {
const parts = ns.accounts[0].split(':');
if (parts.length >= 2) return `${parts[0]}:${parts[1]}`;
}
return fallback;
}
/**
* Initialize the WalletConnect SignClient (singleton with race protection)
*/