Skip to content

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

Merged
baktun14 merged 3 commits into
mainfrom
refactor/web-remove-fee-grant-ui
May 25, 2026
Merged

refactor(wallet): remove self-custodial fee-grant and allowance UI#3213
baktun14 merged 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, forms, and related auto top-up features; simplified Settings layout and removed the authorizations route.
    • Removed related background hooks, queries, services, utilities, types, and the custodial auto-topup feature flag.
    • Adjusted wallet signing flow to stop injecting a fee granter.
  • Tests
    • Removed many unit tests tied to the removed authorization and auto-top-up UI/components; added/updated small Settings and self-custody route tests.

Review Change Stack

@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: 6ddcbd05-5bdf-495d-afa9-382648ba38c1

📥 Commits

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

📒 Files selected for processing (39)
  • apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx
  • apps/deploy-web/src/components/authorizations/AllowanceIssuedRow/AllowanceIssuedRow.spec.tsx
  • apps/deploy-web/src/components/authorizations/AllowanceIssuedRow/AllowanceIssuedRow.tsx
  • apps/deploy-web/src/components/authorizations/AllowanceModal.tsx
  • apps/deploy-web/src/components/authorizations/Authorizations.tsx
  • apps/deploy-web/src/components/authorizations/DeploymentGrantTable/DeploymentGrantTable.spec.tsx
  • apps/deploy-web/src/components/authorizations/DeploymentGrantTable/DeploymentGrantTable.tsx
  • apps/deploy-web/src/components/authorizations/FeeGrantTable.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/GrantModal.spec.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/GrantModal.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/SpendLimitRow.spec.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/SpendLimitRow.tsx
  • apps/deploy-web/src/components/authorizations/GranteeRow/GranteeRow.spec.tsx
  • apps/deploy-web/src/components/authorizations/GranteeRow/GranteeRow.tsx
  • apps/deploy-web/src/components/onboarding/OnboardingContainer/OnboardingContainer.spec.tsx
  • apps/deploy-web/src/components/settings/AutoTopUpSetting/AutoTopUpSetting.tsx
  • apps/deploy-web/src/components/settings/AutoTopUpSetting/AutoTopUpSettingContainer.tsx
  • apps/deploy-web/src/components/settings/SettingsContainer.tsx
  • apps/deploy-web/src/components/settings/SettingsLayout.spec.tsx
  • apps/deploy-web/src/components/settings/SettingsLayout.tsx
  • apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx
  • apps/deploy-web/src/hooks/useAllowance.tsx
  • apps/deploy-web/src/hooks/useAutoTopUpLimits.tsx
  • apps/deploy-web/src/hooks/useAutoTopUpService.ts
  • apps/deploy-web/src/lib/nextjs/pageGuards/selfCustody.spec.ts
  • apps/deploy-web/src/lib/nextjs/pageGuards/selfCustody.ts
  • apps/deploy-web/src/pages/settings/authorizations/index.tsx
  • apps/deploy-web/src/queries/queryKeys.ts
  • apps/deploy-web/src/queries/useExactDeploymentGrantsQuery.ts
  • apps/deploy-web/src/queries/useExactFeeAllowanceQuery.ts
  • apps/deploy-web/src/queries/useGrantsQuery.spec.tsx
  • apps/deploy-web/src/queries/useGrantsQuery.ts
  • apps/deploy-web/src/services/auto-top-up-message/auto-top-up-message.service.ts
  • apps/deploy-web/src/types/feature-flags.ts
  • apps/deploy-web/src/types/grant.ts
  • apps/deploy-web/src/utils/TransactionMessageData.ts
  • apps/deploy-web/src/utils/address.ts
  • apps/deploy-web/src/utils/grants.ts
  • apps/deploy-web/src/utils/urlUtils.ts
💤 Files with no reviewable changes (32)
  • apps/deploy-web/src/types/feature-flags.ts
  • apps/deploy-web/src/components/authorizations/FeeGrantTable.tsx
  • apps/deploy-web/src/utils/urlUtils.ts
  • apps/deploy-web/src/components/authorizations/AllowanceIssuedRow/AllowanceIssuedRow.spec.tsx
  • apps/deploy-web/src/types/grant.ts
  • apps/deploy-web/src/components/authorizations/DeploymentGrantTable/DeploymentGrantTable.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/SpendLimitRow.spec.tsx
  • apps/deploy-web/src/utils/grants.ts
  • apps/deploy-web/src/components/onboarding/OnboardingContainer/OnboardingContainer.spec.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/GrantModal.spec.tsx
  • apps/deploy-web/src/queries/useGrantsQuery.spec.tsx
  • apps/deploy-web/src/hooks/useAutoTopUpService.ts
  • apps/deploy-web/src/queries/useExactFeeAllowanceQuery.ts
  • apps/deploy-web/src/queries/useGrantsQuery.ts
  • apps/deploy-web/src/components/authorizations/AllowanceIssuedRow/AllowanceIssuedRow.tsx
  • apps/deploy-web/src/components/authorizations/GranteeRow/GranteeRow.spec.tsx
  • apps/deploy-web/src/services/auto-top-up-message/auto-top-up-message.service.ts
  • apps/deploy-web/src/pages/settings/authorizations/index.tsx
  • apps/deploy-web/src/components/authorizations/AllowanceModal.tsx
  • apps/deploy-web/src/components/authorizations/DeploymentGrantTable/DeploymentGrantTable.spec.tsx
  • apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx
  • apps/deploy-web/src/components/settings/AutoTopUpSetting/AutoTopUpSetting.tsx
  • apps/deploy-web/src/hooks/useAutoTopUpLimits.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/GrantModal.tsx
  • apps/deploy-web/src/hooks/useAllowance.tsx
  • apps/deploy-web/src/components/authorizations/GranteeRow/GranteeRow.tsx
  • apps/deploy-web/src/queries/queryKeys.ts
  • apps/deploy-web/src/queries/useExactDeploymentGrantsQuery.ts
  • apps/deploy-web/src/components/settings/AutoTopUpSetting/AutoTopUpSettingContainer.tsx
  • apps/deploy-web/src/components/authorizations/GrantModal/SpendLimitRow.tsx
  • apps/deploy-web/src/components/authorizations/Authorizations.tsx
  • apps/deploy-web/src/utils/address.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/deploy-web/src/components/settings/SettingsLayout.spec.tsx

📝 Walkthrough

Walkthrough

This PR removes custodial authorization and auto-top-up code: deletes related UI, hooks, services, query keys, types, utilities, and tests; 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 to a plain header wrapper (removed tabs and page prop); AutoTopUpSettingContainer and its conditional UI removed from SettingsContainer; added unit test for SettingsLayout.
Wallet provider fee-granter removal
apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx
Removed useAllowance usage and destructuring; custodial signing no longer augments fees with a granter field and calls userWallet.sign(msgs, estimatedFees) directly.
Self-custody route guard update
apps/deploy-web/src/lib/nextjs/pageGuards/selfCustody.ts, apps/deploy-web/src/lib/nextjs/pageGuards/selfCustody.spec.ts
Removed /settings/authorizations from SELF_CUSTODY_ROUTES; updated unit test to expect /settings?ref=foo behavior.
Query keys, feature-flag, TransactionMessageData, URL, and onboarding test changes
apps/deploy-web/src/queries/queryKeys.ts, apps/deploy-web/src/types/feature-flags.ts, apps/deploy-web/src/utils/TransactionMessageData.ts, apps/deploy-web/src/utils/urlUtils.ts, apps/deploy-web/src/components/onboarding/OnboardingContainer/OnboardingContainer.spec.tsx
Deleted QueryKeys getters for grants/allowances; removed custodial_auto_topup from FeatureFlag; truncated TransactionMessageData by removing grant/revoke/mint/provider-update helpers after getSendTokensMsg; removed UrlService.settingsAuthorizations; adjusted onboarding test mock ordering.

Deletions (summary): multiple authorization UI components/pages, auto-top-up components/containers, hooks and queries for grants/allowances, AutoTopUpMessageService, grant/allowance types and helpers, address utilities, and associated tests were removed across the codebase.


Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Possibly related PRs


Suggested reviewers

  • stalniy
  • ygrishajev
✨ 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.48%. Comparing base (1712386) to head (397c9f1).
✅ 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.81%   64.48%   -0.34%     
==========================================
  Files        1101      996     -105     
  Lines       26975    24317    -2658     
  Branches     6545     5950     -595     
==========================================
- Hits        17485    15680    -1805     
+ Misses       8311     7542     -769     
+ Partials     1179     1095      -84     
Flag Coverage Δ *Carryforward flag
api 84.72% <ø> (ø) Carriedforward from 1712386
deploy-web 49.65% <66.66%> (+0.95%) ⬆️
log-collector ?
notifications 91.06% <ø> (ø) Carriedforward from 1712386
provider-console 81.48% <ø> (ø) Carriedforward from 1712386
provider-inventory ?
provider-proxy 86.08% <ø> (ø) Carriedforward from 1712386
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 75.00% <ø> (+5.30%) ⬆️
apps/deploy-web/src/utils/urlUtils.ts 56.96% <ø> (+0.71%) ⬆️
...-web/src/context/WalletProvider/WalletProvider.tsx 6.43% <0.00%> (+0.03%) ⬆️

... and 89 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 3 commits May 25, 2026 16:26
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.
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.
@baktun14 baktun14 force-pushed the refactor/web-remove-fee-grant-ui branch from 958126d to 397c9f1 Compare May 25, 2026 21:31
@baktun14 baktun14 added this pull request to the merge queue May 25, 2026
Merged via the queue into main with commit 3209d41 May 25, 2026
55 of 56 checks passed
@baktun14 baktun14 deleted the refactor/web-remove-fee-grant-ui branch May 25, 2026 22:00
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.

2 participants