move tx detail caching into sync engine, cache during history sync
- new sync-tx-details.ts: extracts tx+receipt caching from get-details.ts - sync-tx-history: calls syncTxDetails per transfer hash during sync - get-details: remove on-the-fly viem fetch + DB write (now handled by sync); returns null placeholder - index: import syncTxDetails; simplify getTransactionDetails handler
This commit is contained in:
@@ -39,6 +39,7 @@ import {
|
||||
txHistory,
|
||||
evmWallets,
|
||||
} from './lib/db/schema'
|
||||
import { syncTxDetails } from './lib/sync/sync-tx-details'
|
||||
|
||||
const env = getENV()
|
||||
|
||||
@@ -647,12 +648,7 @@ const rpc = BrowserView.defineRPC<RPC>({
|
||||
})
|
||||
if (!key) return null
|
||||
try {
|
||||
const client = getClient(chainid, key)
|
||||
const details = await getTransactionDetails(
|
||||
client,
|
||||
hash,
|
||||
chainid,
|
||||
)
|
||||
const details = await getTransactionDetails(hash, chainid)
|
||||
return details
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
||||
Reference in New Issue
Block a user