fix(electron): use dynamic network config for balance queries
Previously Home.tsx hardcoded testnet RPC for balance queries. Now uses getCurrentRpcUrl() to respect user's network setting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c239ac65ee
commit
5f484f6579
|
|
@ -8,6 +8,7 @@ import {
|
||||||
isValidAddress,
|
isValidAddress,
|
||||||
isValidAmount,
|
isValidAmount,
|
||||||
getCurrentNetwork,
|
getCurrentNetwork,
|
||||||
|
getCurrentRpcUrl,
|
||||||
type PreparedTransaction,
|
type PreparedTransaction,
|
||||||
} from '../utils/transaction';
|
} from '../utils/transaction';
|
||||||
|
|
||||||
|
|
@ -29,9 +30,6 @@ interface ShareWithAddress extends ShareItem {
|
||||||
balanceLoading?: boolean;
|
balanceLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kava Testnet EVM RPC endpoint
|
|
||||||
const KAVA_TESTNET_RPC = 'https://evm.testnet.kava.io';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 KAVA 代币余额
|
* 获取 KAVA 代币余额
|
||||||
* @param address EVM 地址
|
* @param address EVM 地址
|
||||||
|
|
@ -39,7 +37,8 @@ const KAVA_TESTNET_RPC = 'https://evm.testnet.kava.io';
|
||||||
*/
|
*/
|
||||||
async function fetchKavaBalance(address: string): Promise<string> {
|
async function fetchKavaBalance(address: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(KAVA_TESTNET_RPC, {
|
const rpcUrl = getCurrentRpcUrl();
|
||||||
|
const response = await fetch(rpcUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue