Skip to content

fix: convert cash send amounts at API boundary#659

Closed
forge0x wants to merge 1 commit into
feat/fygarofrom
fix/bug-004-cash-usdt-send-units
Closed

fix: convert cash send amounts at API boundary#659
forge0x wants to merge 1 commit into
feat/fygarofrom
fix/bug-004-cash-usdt-send-units

Conversation

@forge0x

@forge0x forge0x commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fixes BUG-004 by treating backend cash wallet balances, fees, and payment mutation inputs as USD cents at GraphQL boundaries
  • keeps USDT wallet settlement amounts in micros inside the mobile send flow
  • converts backend cash fee responses back into the active wallet unit before display/balance validation

UAT

  • confirmed on MacMax physical-device UAT that SEND-01 and SEND-02 now pass
  • verified send methods that share this path no longer throw the false $1.23/$1.24 (amount+fee) balance error for $0.05 sends

Tests

  • yarn test __tests__/payment-details __tests__/payment-destination --runInBand
  • yarn tsc:check
  • yarn graphql-check
  • yarn check:codegen
  • git diff --check

Stacked against #621 (feat/fygaro).

@forge0x forge0x force-pushed the fix/bug-004-cash-usdt-send-units branch from a1f9ea5 to d669ae8 Compare June 30, 2026 01:45
Cleanup pass: dedupe the cash-wallet check into a shared
isCashWalletCurrency helper (was inlined identically in utils.ts and
send-bitcoin-confirmation-screen.tsx) and revert an unrelated import
reformat in intraledger.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@islandbitcoin islandbitcoin force-pushed the fix/bug-004-cash-usdt-send-units branch from d669ae8 to 49dc630 Compare June 30, 2026 01:57
@islandbitcoin

Copy link
Copy Markdown
Contributor

⚠️ Heads-up: 3 pre-existing eslint errors in send-bitcoin-confirmation-screen.tsx

Not introduced by this PR — I confirmed they're present on the untouched branch head too, and they're unrelated to the cash/USDT unit fix, so I left them alone rather than expand the diff. Flagging because a full-file eslint run will fail on them (a diff-/changed-lines-only lint won't):

Line Rule Issue
52:14 @typescript-eslint/ban-types Uses {} as a type (means "any non-nullish value" — likely wants object / Record<string, never>)
270:59 no-implicit-coercion !!paymentError-style coercion — use Boolean(paymentError)
281:33 @typescript-eslint/no-unused-vars colors defined but never used
✖ 5 problems (3 errors, 2 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

(#270 and #281 are auto-fixable via eslint --fix; the {} type at #52 needs a manual decision on the intended type.)

These would be a quick separate cleanup commit if you want the file to pass a whole-file lint — happy to take it on if useful, but kept it out of this PR to avoid unrelated churn.

@islandbitcoin islandbitcoin requested a review from Nodirbek75 June 30, 2026 20:04
@islandbitcoin

Copy link
Copy Markdown
Contributor

Closed by lnflash/flash#413 commit lnflash/flash@2a9e2ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants