Skip to content

feat(disburse-maturity): allow disbursing to an address book entry#395

Draft
yhabib wants to merge 1 commit into
mainfrom
feat/disburse-maturity-address-book
Draft

feat(disburse-maturity): allow disbursing to an address book entry#395
yhabib wants to merge 1 commit into
mainfrom
feat/disburse-maturity-address-book

Conversation

@yhabib

@yhabib yhabib commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Disburse maturity today only targets the user's own accounts or subaccounts. The address book is already wired into the Send ICP flow, so reusing it here lets users disburse to any saved destination without retyping addresses.

Changes

  • Widened the useDisburseMaturity hook to accept either an ICP account identifier or an ICRC-1 account (principal + optional subaccount) as the destination.
  • Routed ICP entries through toAccountIdentifier and ICRC-1 entries through the structured toAccount param on the governance canister call.
  • Added an "Use address book" toggle to the disburse-maturity modal, mirroring the Send ICP UX, with auto-on when entries exist and a settings link when the address book is empty.
  • Decoded ICRC-1 address-book entries on confirm using decodeIcrcAccount.
  • Derived the destination account identifier for balance invalidation so the query cache stays in sync for both address types.
  • Added a noDestination error string for when the toggle is on but no entry is picked.

@zeropath-ai

zeropath-ai Bot commented May 28, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 1fb0432.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► src/governance-app-frontend/src/features/stakes/components/DisburseMaturityModal.tsx
    Add Address Book integration for destination selection.
    Implement switch to toggle between AccountSelect and AddressBookSelect.
    Update mutation logic to handle different destination types.
► src/governance-app-frontend/src/features/stakes/hooks/useDisburseMaturity.ts
    Add type for disburse maturity destination (ICP and ICRC1).
    Update mutation parameters to accept a destination object.
    Implement logic to resolve destination account identifier for both ICP and ICRC1.
    Modify governance canister call to support ICRC1 destination.
► src/governance-app-frontend/src/i18n/en/modals/neuronDetail.json
    Add translation for "noDestination" error message.
Refactor ► src/governance-app-frontend/src/features/stakes/components/DisburseMaturityModal.tsx
    Consolidate destination selection logic.
    Simplify state management for destination selection.

@yhabib yhabib changed the title feat(disburse-maturity): allow disbursing to an address book entry DRAFT: \feat(disburse-maturity): allow disbursing to an address book entry May 28, 2026
@yhabib yhabib changed the title DRAFT: \feat(disburse-maturity): allow disbursing to an address book entry feat(disburse-maturity): allow disbursing to an address book entry Jun 9, 2026
Lets a neuron's available maturity be disbursed to any saved address
in the user's address book, in addition to the existing "my accounts"
flow. ICP entries pass through `toAccountIdentifier`; ICRC-1 entries
are decoded and passed through `toAccount` (principal + subaccount).

UX mirrors the Send ICP toggle: when the address book has entries,
the modal defaults to the address-book picker; users can flip back
to their own subaccounts at any time.
@yhabib yhabib force-pushed the feat/disburse-maturity-address-book branch from 1fb0432 to fd10a25 Compare June 9, 2026 12:20
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

📊 Build Bundle Stats

The latest build generated the following assets:

dist/index.html                                           1.92 kB │ gzip:   0.69 kB
dist/assets/index-DxfLsNC8.css                          132.17 kB │ gzip:  20.82 kB
dist/assets/address-CJcwPeS9.js                           0.21 kB │ gzip:   0.15 kB
dist/assets/externalServices-B9hWFV-7.js                  0.21 kB │ gzip:   0.17 kB
dist/assets/Spinner-sJ_PVxTl.js                           0.58 kB │ gzip:   0.40 kB
dist/assets/useTvlValue-CUId4iu7.js                       0.58 kB │ gzip:   0.39 kB
dist/assets/service-BrOp379Q.js                           0.60 kB │ gzip:   0.39 kB
dist/assets/numbers-BTuhCMPM.js                           0.61 kB │ gzip:   0.37 kB
dist/assets/PageHeader-Cr3cEbbs.js                        0.75 kB │ gzip:   0.44 kB
dist/assets/Separator-CxCnXUfr.js                         0.77 kB │ gzip:   0.46 kB
dist/assets/CertifiedBadge-zCxoVYq4.js                    0.80 kB │ gzip:   0.47 kB
dist/assets/useIcpIndex-DdlfLzZa.js                       1.08 kB │ gzip:   0.64 kB
dist/assets/addressBook-CRZ-2gZt.js                       1.61 kB │ gzip:   0.95 kB
dist/assets/useCommandPaletteSettings-DLg50_CA.js         1.64 kB │ gzip:   0.80 kB
dist/assets/AnimatedNumber-CdoZDP2J.js                    1.86 kB │ gzip:   1.04 kB
dist/assets/useGovernanceAppCanister-DHEaw9rG.js          1.92 kB │ gzip:   0.97 kB
dist/assets/useInfiniteQueryThenUpdateCall-BEQeXm5e.js    1.93 kB │ gzip:   0.96 kB
dist/assets/ToggleGroup-C8hj8snL.js                       3.05 kB │ gzip:   1.33 kB
dist/assets/Switch-DG5x6UwL.js                            3.16 kB │ gzip:   1.42 kB
dist/assets/useTickerPrices-Bb-3XNZo.js                   3.17 kB │ gzip:   1.51 kB
dist/assets/useSpamFilterCanister-Df-Ajp-J.js             7.20 kB │ gzip:   3.25 kB
dist/assets/AmountInput-BvT4nnIB.js                       7.22 kB │ gzip:   3.20 kB
dist/assets/QueryStates-DIyyBuUS.js                       7.95 kB │ gzip:   2.27 kB
dist/assets/index-Ds_yBNGF.js                             8.78 kB │ gzip:   3.41 kB
dist/assets/Input-BwZzyVCY.js                             9.40 kB │ gzip:   3.35 kB
dist/assets/types-Bmxe6PU_.js                             9.96 kB │ gzip:   4.32 kB
dist/assets/TopicFollowingAccordion-B4pJ-ziK.js          10.15 kB │ gzip:   4.05 kB
dist/assets/index-D72Hrmhs.js                            14.67 kB │ gzip:   4.69 kB
dist/assets/_auth-BCpddyce.js                            17.06 kB │ gzip:   6.48 kB
dist/assets/index-DuSIhHzo.js                            23.43 kB │ gzip:   8.04 kB
dist/assets/DepositICPModal-B6uULDud.js                  38.81 kB │ gzip:  13.61 kB
dist/assets/index-BplVFarH.js                            41.78 kB │ gzip:  11.84 kB
dist/assets/index-D27NX5re.js                            49.72 kB │ gzip:  14.98 kB
dist/assets/index-juzykN0b.js                            67.21 kB │ gzip:  20.67 kB
dist/assets/vendor-md-B8WLdoye.js                        89.32 kB │ gzip:  25.51 kB
dist/assets/index-Bq1kyBQv.js                           123.97 kB │ gzip:  40.26 kB
dist/assets/index-Uvitn_hX.js                           125.38 kB │ gzip:  35.71 kB
dist/assets/vendor-tanstack-DAv2tfy1.js                 126.65 kB │ gzip:  39.34 kB
dist/assets/vendor-core-react-By6K7kM9.js               193.24 kB │ gzip:  60.69 kB
dist/assets/vendor-recharts-C250mpky.js                 228.10 kB │ gzip:  65.92 kB
dist/assets/vendor-icp-BrFTl7XZ.js                      404.22 kB │ gzip: 100.22 kB
dist/assets/vendor-libs-DQtUaWf_.js                     553.84 kB │ gzip: 183.40 kB

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