From fc027bdb607325e8255fd1f4003431b4d6ffea55 Mon Sep 17 00:00:00 2001 From: emil07770 Date: Wed, 27 May 2026 13:36:27 +0000 Subject: [PATCH] fix: skip 400 responses in getCoinpayGlobalWalletTokens to allow fallback URLs The getCoinpayGlobalWalletTokens function tries 3 CoinPay API endpoints in order but throws on HTTP 400 instead of continuing to the next URL. Adding 400 to the skip list allows fallback to /api/wallets and /api/businesses/{id} when /api/get-tokens returns 400. --- src/lib/coinpayportal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/coinpayportal.ts b/src/lib/coinpayportal.ts index 1c07415a..a9a22b44 100644 --- a/src/lib/coinpayportal.ts +++ b/src/lib/coinpayportal.ts @@ -561,7 +561,7 @@ export async function getCoinpayGlobalWalletTokens( if (!response.ok) { const text = await response.text().catch(() => ""); errors.push(`${url.pathname}: ${response.status}${text ? ` ${text.slice(0, 120)}` : ""}`); - if ([401, 403, 404].includes(response.status)) continue; + if ([400, 401, 403, 404].includes(response.status)) continue; throw new Error(`CoinPay get-tokens failed: ${response.status}`); }