Skip to content

feat(wallet): domain model for sending to any destination - #1406

Open
romchornyi wants to merge 1 commit into
developfrom
feat/external-send-domain
Open

romchornyi wants to merge 1 commit into
developfrom
feat/external-send-domain

Conversation

@romchornyi

@romchornyi romchornyi commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

First part of the new external Send for MO-1121 (Android parity: dash-wallet#1680): pay from every balance (Core, Shielded, Platform, Identity) to every destination type (Core address, Shielded address, Platform address, Identity ID). This PR adds only the domain model, so it can be reviewed without any UI or money movement.

What was done?

  • Destination and DestinationParser: the destination type from typed, pasted, scanned or linked text (Core, Platform and Shielded addresses, Identity IDs, dash: links with an amount), network checks, and a length bound before Base58/Bech32m decoding.
  • SendPairPolicy: one pure rule set for every source × destination pair — the route, or the reason the pair is unavailable — plus the Confirm warnings. [ADR-0038] (added in feat(wallet): new Send screens and entry points #1409)
  • AmountRules: Max, the DashPay reserve on Identity, the balance check.
  • SendOutcome: every send ends as sent, not sent (with Retry) or in progress (no Retry); the mapping from the existing send errors. [ADR-0040] (added in feat(wallet): new Send screens and entry points #1409)
  • ScriptAddressCodec / PaymentNetworkResolver / DWParsedPaymentURI: the address decoding helpers the parser shares with the existing Send; SendScreen now takes its warning texts from the shared SendWarningText.
  • WalletSendService: ErrorCode and errorDomain readable outside the file so the outcome mapping can name existing send errors.

Nothing calls the new types from a screen yet; the services come in #1407 and the screens in #1409. Code comments cite ADRs whose public copies are added in #1409.

Stack

This replaces the single PR #1358 (+21k lines), split by layer so each part can be reviewed and merged on its own. Merge in order:

# PR What
0 #1405 chore(l10n): drop unused keys and sort the catalogs as BartyCrouch writes them (keeps the diffs below clean)
1 #1406 Domain: destinations, the parser, the pair policy, amount rules, send outcomes — pure logic, no UI
2 #1407 Services: the send executor over the existing spend seams, fee estimates, identity lookup, asset-lock recovery, BIP70 checks
3 #1408 DashSpend: a payment the merchant acknowledged before it failed is shown as in progress
4 #1409 The new Send screens and entry points
5 #1358 Routes that need the open dashpay/platform PRs (#5860, #5863, #5865) and the pin bump

How Has This Been Tested?

dashwallet-dashpay, Debug, iPhone 17 simulator (iOS 26.5): 2374 tests, 0 failures, 1 skipped.

  • DestinationParserTests, SendPairPolicyTests, AmountRulesTests, SendOutcomeMappingTests, the Bech32m URI case in PaymentProtocolTests
  • Test-target membership, scripts/a11y_audit.py --check, and a second build leaves the catalogs unchanged

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Expanded external-send support for Core, Platform, Shielded, and Identity destinations, including Dash payment links and payment requests.
    • Added clearer guidance for source and destination restrictions, balance requirements, and potential risks before confirming a payment.
    • Send results now distinguish confirmed failures from payments whose completion is uncertain.
  • Bug Fixes
    • Improved network-aware address recognition and validation for payment destinations and amounts.

Loading
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