fix(coinpay): map coin.chain field in coinToPaymentCurrency - #304
Conversation
CoinPay OAuth userinfo returns wallets as { address, chain: "BTC" } but coinToPaymentCurrency() only checks coin.symbol/code/currency/id — never coin.chain. This causes the symbol to be empty and the wallet to be dropped, resulting in workerWallets = [] and the 409 error when creating invoices.
Fix: include coin.chain in the symbol lookup so { chain: "BTC" } correctly maps to "btc".
Fixes profullstack#301
Greptile SummaryThis PR fixes a bug where
Confidence Score: 4/5Safe to merge — the change is a one-line, well-scoped addition to an existing fallback chain with no side effects on paths that already have a symbol/code/currency/id. The fix correctly addresses the described bug: BTC/ETH/SOL wallets returned with only a src/lib/coinpayportal.ts — specifically the USDT/USDC chain-disambiguation branches that follow the updated symbol lookup. Important Files Changed
|
|
@ralyodio this is blocking all workers from sending invoices on ugig.net right now. The Greptile review scores it 4/5 "Safe to merge" and Socket Security passed. One-line fix, no conflicts. Could you merge this urgently? Workers have completed gigs but cannot get paid due to this bug. |
|
what is coin.chain? |
CoinPay OAuth userinfo returns wallets as { address, chain: "BTC" } but coinToPaymentCurrency() only checks coin.symbol/code/currency/id — never coin.chain. This causes the symbol to be empty and the wallet to be dropped, resulting in workerWallets = [] and the 409 error when creating invoices.
Fix: include coin.chain in the symbol lookup so { chain: "BTC" } correctly maps to "btc".
Fixes #301