You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
402 middleware should accept chain-specific balances #203
Same issue as #201 but for the 402 paywall middleware. When --pay-chains is enabled, the 402 handler only checks generic sat balance, so users with only chain-specific deposits (e.g. tbtc4) get blocked even though they have funds.
Steps to reproduce
Start JSS with --pay --pay-chains tbtc3,tbtc4
Deposit a tbtc4 TXO → tbtc4: 2083219, sat: 0
GET /pay/secret.json with NIP-98 auth → 402 Payment Required (balance: 0)
Expected
The 402 middleware should fall back to chain-specific balances if generic sat is insufficient. Either:
Accept a X-Pay-Currency: tbtc4 header to specify which balance to use
Automatically try chain balances when sat balance is 0
Return available balances in the 402 response so the client can retry with a currency header
Activity
402 middleware: fall back to chain-specific balances