Skip to content

Commit 5e27b11

Browse files
committed
fix: raw sql transaction query number conversion overflows, change to bigint
1 parent c55daf1 commit 5e27b11

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

packages/fasset-indexer-api/src/analytics/utils/raw-sql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const explorerQueryTransactions = new Map([
125125
FROM self_mint sm`
126126
],
127127
[TransactionType.Withdrawal, `
128-
SELECT w.evm_log_id, w.agent_vault_address_id, wc.spend_uba::integer as value_uba, NULL::integer as user_id, w.resolution, w.payment_reference
128+
SELECT w.evm_log_id, w.agent_vault_address_id, wc.spend_uba::bigint as value_uba, NULL::integer as user_id, w.resolution, w.payment_reference
129129
FROM underlying_withdrawal_announced w
130130
FULL JOIN underlying_withdrawal_confirmed wc
131131
ON w.evm_log_id = wc.underlying_withdrawal_announced_evm_log_id`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Context, ConfigLoader } from "fasset-indexer-core"
2+
import { ExplorerAnalytics } from "./analytics/explorer"
3+
4+
5+
async function main() {
6+
const config = new ConfigLoader()
7+
const context = await Context.create(config)
8+
const explorer = new ExplorerAnalytics(context.orm, config.chain, config.addressesJson)
9+
console.log(await explorer.transactions(10, 0))
10+
/* const r = await explorer.underlyingWithdrawalTransactionDetails('0xe94aaf7381c6af867aa8d0f00e73a59854af825bd11e625319ce4103b811b69e')
11+
console.log(r.flows[0].underlyingTransaction) */
12+
await context.orm.close()
13+
}
14+
15+
main()

0 commit comments

Comments
 (0)