Skip to content

refactor(wallet): remove self-custodial fee-grant and allowance UI#3213

Open
baktun14 wants to merge 3 commits into
mainfrom
refactor/web-remove-fee-grant-ui
Open

refactor(wallet): remove self-custodial fee-grant and allowance UI#3213
baktun14 wants to merge 3 commits into
mainfrom
refactor/web-remove-fee-grant-ui

Conversation

@baktun14
Copy link
Copy Markdown
Contributor

@baktun14 baktun14 commented May 24, 2026

Why

Closes CON-256

The fee-grant / deployment-grant management surface in deploy-web (the /settings/authorizations page, the useAllowance default-fee-granter picker, and the Auto Top Up Fieldset on /settings) only applies to the self-custodial Keplr / Leap signing path. As part of the migration to Auth0 / managed-wallet-only flows, this UI is being retired.

Managed-wallet fee grants are still issued server-side by apps/api's ManagedUserWalletService from a funding master wallet, and managed signing flows through txHttpService.signAndBroadcastTx unchanged. The shared @akashnetwork/http-sdk authz service is preserved for that backend path.

What

  • Delete /settings/authorizations page + components/authorizations/ (Authorizations, DeploymentGrantTable, FeeGrantTable, GrantModal, AllowanceModal, GranteeRow, AllowanceGrantedRow, AllowanceIssuedRow) and their specs.
  • Delete the AutoTopUp Fieldset on /settings (AutoTopUpSetting, AutoTopUpSettingContainer, useAutoTopUpLimits, useAutoTopUpService, auto-top-up-message.service).
  • Drop useAllowance and the granter: feeGranter field from the self-custodial userWallet.sign(...) call in WalletProvider.
  • Remove getGrantMsg, getRevokeDepositMsg, getGrantBasicAllowanceMsg, getRevokeAllowanceMsg from TransactionMessageData and their associated query hooks (useGrantsQuery, useExactDeploymentGrantsQuery, useExactFeeAllowanceQuery), types, utils, and query keys.
  • Drop the AUTHORIZATIONS tab + Tabs shell in SettingsLayout (single-tab UI now), the custodial_auto_topup feature flag entry, the settingsAuthorizations URL helper, and the /settings/authorizations entry from SELF_CUSTODY_ROUTES.

Net: 36 files changed, 9 insertions / 3,607 deletions.

Summary by CodeRabbit

  • Chores
    • Removed authorization/allowance management UI, pages, and related auto top-up features; simplified Settings layout and removed the authorizations route.
    • Removed related background hooks, services, utilities, and feature-flag for custodial auto-topup.
    • Adjusted wallet signing path to stop injecting a fee granter.
  • Tests
    • Removed multiple unit tests tied to the removed authorization and auto-top-up UI/components.

Review Change Stack

Closes CON-256

Removes the user-facing fee-grant / deployment-grant management surface
that only applied to the Keplr / Leap self-custodial signing path:

- /settings/authorizations page + Authorizations / Grant / Allowance
  components and their tests
- useAllowance default-fee-granter hook and the granter: feeGranter
  field passed to userWallet.sign(...) in WalletProvider
- Auto Top Up Fieldset on /settings (custodial_auto_topup flag),
  including useAutoTopUpLimits / useAutoTopUpService and the
  auto-top-up-message service that built MsgGrant / MsgGrantAllowance
  bundles for the user's wallet
- Underlying grant / allowance query hooks and TransactionMessageData
  helpers (getGrantMsg, getRevokeDepositMsg, getGrantBasicAllowanceMsg,
  getRevokeAllowanceMsg) plus their query keys and types
- AUTHORIZATIONS tab + Tabs shell in SettingsLayout, the
  custodial_auto_topup feature flag entry, the settingsAuthorizations
  URL helper, and the /settings/authorizations entry from
  SELF_CUSTODY_ROUTES

Managed-wallet fee grants are still issued server-side by apps/api's
ManagedUserWalletService from a funding master wallet, and managed
signing flows through txHttpService.signAndBroadcastTx unchanged. The
shared @akashnetwork/http-sdk authz service is preserved for that
backend path.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b546ebdf-5f2f-4c7b-8875-fde9db339ee2

📥 Commits

Reviewing files that changed from the base of the PR and between ded40bc and 958126d.

📒 Files selected for processing (1)
  • apps/deploy-web/src/components/settings/SettingsLayout.spec.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/deploy-web/src/components/settings/SettingsLayout.spec.tsx

📝 Walkthrough

Walkthrough

This PR removes custodial fee-grant and auto-top-up features: deletes related UI, hooks, services, query keys, types, and utilities; removes fee-granter injection from custodial wallet signing; simplifies settings layout and route guards.

Changes

Custodial Authorization Feature Removal

Layer / File(s) Summary
Settings layout simplification and auto-top-up UI removal
apps/deploy-web/src/components/settings/SettingsLayout.tsx, apps/deploy-web/src/components/settings/SettingsContainer.tsx, apps/deploy-web/src/components/settings/SettingsLayout.spec.tsx
SettingsLayout converted from tab-driven routing to a plain wrapper; Props type simplified (removed page: SettingsTabs); AutoTopUpSettingContainer and conditional auto-top-up fieldset removed from SettingsContainer; a unit test for SettingsLayout was added.
Query keys, feature flag, and type definitions cleanup
apps/deploy-web/src/queries/queryKeys.ts, apps/deploy-web/src/types/feature-flags.ts
Removed QueryKeys grant/allowance methods (getGranterGrants, getGranteeGrants, getAllowancesIssued, getAllowancesGranted, getDeploymentGrantsKey, getFeeAllowancesKey); removed custodial_auto_topup feature flag literal from FeatureFlag union.
Wallet provider fee-granter removal
apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx
Removed useAllowance import and its destructuring; custodial signing now calls userWallet.sign(msgs, estimatedFees) directly instead of augmenting fees with a granter field.
TransactionMessageData and utility cleanup
apps/deploy-web/src/utils/TransactionMessageData.ts, apps/deploy-web/src/utils/urlUtils.ts, apps/deploy-web/src/components/onboarding/OnboardingContainer/OnboardingContainer.spec.tsx
Truncated TransactionMessageData after getSendTokensMsg (removed static helpers for grant/allowance/revoke/mint/burn/provider-update); removed UrlService.settingsAuthorizations() route helper; updated onboarding test mock to match simplified TransactionMessageData interface.
Self-custody route guard update
apps/deploy-web/src/lib/nextjs/pageGuards/selfCustody.ts
Removed /settings/authorizations from SELF_CUSTODY_ROUTES allowlist, narrowing self-custody protected routes to wallet, mint-burn, and general settings.

Deletions: All authorization UI components and pages, auto-top-up components and container, data hooks and query implementations for grants/allowances, AutoTopUpMessageService, grant/allowance types and utility helpers, address utils, and associated test suites were removed across the codebase as part of this change set.


Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Suggested reviewers

  • ygrishajev
  • stalniy
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/web-remove-fee-grant-ui

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.24%. Comparing base (b93c2af) to head (958126d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...-web/src/context/WalletProvider/WalletProvider.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3213      +/-   ##
==========================================
- Coverage   64.61%   64.24%   -0.37%     
==========================================
  Files        1106     1001     -105     
  Lines       27260    24602    -2658     
  Branches     6636     6047     -589     
==========================================
- Hits        17613    15806    -1807     
+ Misses       8445     7678     -767     
+ Partials     1202     1118      -84     
Flag Coverage Δ *Carryforward flag
api 84.69% <ø> (ø) Carriedforward from ded40bc
deploy-web 49.56% <66.66%> (+0.92%) ⬆️
log-collector ?
notifications 91.06% <ø> (ø) Carriedforward from ded40bc
provider-console 81.48% <ø> (ø) Carriedforward from ded40bc
provider-inventory ?
provider-proxy 86.08% <ø> (ø) Carriedforward from ded40bc
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...-web/src/components/settings/SettingsContainer.tsx 0.00% <ø> (ø)
...loy-web/src/components/settings/SettingsLayout.tsx 100.00% <100.00%> (+100.00%) ⬆️
...eploy-web/src/lib/nextjs/pageGuards/selfCustody.ts 100.00% <100.00%> (ø)
apps/deploy-web/src/queries/queryKeys.ts 100.00% <ø> (ø)
...pps/deploy-web/src/utils/TransactionMessageData.ts 77.27% <ø> (+5.84%) ⬆️
apps/deploy-web/src/utils/urlUtils.ts 58.75% <ø> (+0.72%) ⬆️
...-web/src/context/WalletProvider/WalletProvider.tsx 6.43% <0.00%> (+0.03%) ⬆️

... and 88 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

baktun14 added 2 commits May 24, 2026 01:22
Knip flagged apps/deploy-web/src/utils/address.ts as unused after the
authorizations UI removal — the only consumer was Authorizations.tsx.
Covers the simplified single-tab layout to keep patch coverage above
the deploy-web 50% bar after the authorizations tab removal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant