Skip to content

Use makeMaxSpend to build max-spend transactions#6059

Draft
j0ntz wants to merge 2 commits into
developfrom
jon/make-max-spend
Draft

Use makeMaxSpend to build max-spend transactions#6059
j0ntz wants to merge 2 commits into
developfrom
jon/make-max-spend

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

Depends on the new EdgeCurrencyWallet.makeMaxSpend API in edge-core-js (EdgeApp/edge-core-js#727). Draft until that core change is published and bumped here — CI will not pass against the currently-published edge-core-js because makeMaxSpend does not exist on the wallet type yet.

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Migrate the build-a-max-spend-transaction call sites from the getMaxSpendable + makeSpend pattern to the new atomic EdgeCurrencyWallet.makeMaxSpend API:

  • SendScene2 — the "Send Max" flow now calls makeMaxSpend and reads the resulting amount back from the transaction for the spending-limit / minimum checks and the flip-input display.
  • MigrateWalletCompletionScene — the token-migration path now builds the full-balance transfer via makeMaxSpend.

Display-only and reduced-amount call sites (amount quote plugin, ramp scene, FIO staking, and the mainnet-migration path that sends max − feeTotal) continue to use getMaxSpendable, since they need the amount value rather than a built transaction.

Also adds testIDs to the address "Enter" button and the flip-input "Max" button (separate commit) so the max-spend flow can be driven in automated UI tests.

Asana: https://app.asana.com/0/1215088146871429/1207967192999590

Testing

  • tsc --noEmit clean against the local (linked) edge-core-js build with makeMaxSpend.
  • Jest: SendScene2 UI snapshot tests pass.
  • Drove "Send Max" on an iOS simulator build (with the updated core baked into the WebView bundle): tapping Max invoked coreWallet.makeMaxSpend, which built the max-spend transaction (max amount = balance − network fee) and rendered it ready to send. Proof screenshots attached.

j0ntz added 2 commits June 24, 2026 16:57
Migrate the Send Max flow in SendScene2 and the token migration in
MigrateWalletCompletionScene to the new EdgeCurrencyWallet.makeMaxSpend
API, which builds the max-spend transaction atomically instead of
combining getMaxSpendable and makeSpend. Display-only and reduced-amount
call sites continue to use getMaxSpendable.
Add testID props to the address Enter button (AddressTile2) and the flip
input Max button (ExchangedFlipInput2) so the Send Max maestro flow can
drive them by id.
@j0ntz

j0ntz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence — Send Max via makeMaxSpend

agent proof 1207967192999590 01 send address set

agent proof 1207967192999590 01 send address set

agent proof 1207967192999590 02 makemaxspend amount

agent proof 1207967192999590 02 makemaxspend amount

Captured by the agent's in-app test run (build-and-test).

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.

1 participant