read tx history from db cache instead of alchemy api

This commit is contained in:
2026-05-21 17:18:45 +08:00
parent 1aa723db46
commit 8f3495ab40
6 changed files with 50 additions and 57 deletions
+7
View File
@@ -134,6 +134,13 @@ type RPC = {
}
response: TxEntry[]
}
fetchCachedTxHistory: {
params: {
address: string
chainid: string
}
response: TxEntry[]
}
fetchTokenBalances: {
params: {
address: string
@@ -313,11 +313,11 @@ export const EvmWallet = () => {
}
const fetchTxHistory = async () => {
if (!address || !apiKey) {
if (!address) {
transactions = []
return
}
const txs = await electrobun.rpc?.request.fetchTxHistory({
const txs = await electrobun.rpc?.request.fetchCachedTxHistory({
address, chainid: net().chainid,
})
transactions = txs ?? []