Skip to content

Commit d9d80f6

Browse files
committed
Fix Xgram process errors and LetsExchange ambiguous network inference
Catch processXgramTx failures so already-collected txs are returned without advancing the watermark, matching fetch-failure behavior. Remove multi-chain tickers (ETH, AVAX, MATIC, FTM) from LetsExchange native-network fallbacks so omitted-network txs fail closed instead of being misattributed.
1 parent cad25fb commit d9d80f6

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/partners/letsexchange.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ const LETSEXCHANGE_NETWORK_TO_PLUGIN_ID: Record<string, string> = {
202202
}
203203

204204
// When the API omits network fields, infer native chain from currency code.
205-
// Only unambiguous 1:1 native-ticker cases (not USDT, USDC, BNB, etc.).
205+
// Only unambiguous 1:1 native-ticker cases (not USDT, USDC, BNB, ETH, AVAX,
206+
// MATIC, FTM, etc. — those are multi-chain or also exist as ERC-20 tokens).
206207
const LETSEXCHANGE_CURRENCY_TO_DEFAULT_NETWORK: Record<string, string> = {
207208
ADA: 'ADA',
208209
ALGO: 'ALGO',
209210
ARRR: 'ARRR',
210211
ATOM: 'ATOM',
211-
AVAX: 'AVAXC',
212212
BCH: 'BCH',
213213
BSV: 'BSV',
214214
BTC: 'BTC',
@@ -221,16 +221,13 @@ const LETSEXCHANGE_CURRENCY_TO_DEFAULT_NETWORK: Record<string, string> = {
221221
DOT: 'DOT',
222222
EOS: 'EOS',
223223
ETC: 'ETC',
224-
ETH: 'ETH',
225224
ETHW: 'ETHW',
226225
FIL: 'FIL',
227226
FIO: 'FIO',
228227
FIRO: 'FIRO',
229-
FTM: 'FTM',
230228
GRS: 'GRS',
231229
HBAR: 'HBAR',
232230
LTC: 'LTC',
233-
MATIC: 'MATIC',
234231
PIVX: 'PIVX',
235232
POL: 'POL',
236233
PLS: 'PLS',

src/partners/xgram.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,16 @@ export const queryXgram = async (
449449
}
450450
let oldestIsoDate = '999999999999999999999999999999999999'
451451
for (const rawTx of txs) {
452-
const standardTx = processXgramTx(rawTx, currencies)
452+
let standardTx: StandardTx
453+
try {
454+
standardTx = processXgramTx(rawTx, currencies)
455+
} catch (e) {
456+
log.error(String(e))
457+
// Process failure: stop without advancing the watermark, but keep
458+
// already-collected txs so they can still be persisted.
459+
done = true
460+
break
461+
}
453462
if (standardTx.isoDate < oldestIsoDate) {
454463
oldestIsoDate = standardTx.isoDate
455464
}

0 commit comments

Comments
 (0)