read tx history from db cache instead of alchemy api
This commit is contained in:
@@ -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 ?? []
|
||||
|
||||
Reference in New Issue
Block a user