8000 Auto suggestion for proxy based on transaction type by rajk93 · Pull Request #11579 · polkadot-js/apps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Auto suggestion for proxy based on transaction type #11579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

rajk93
Copy link
Contributor
@rajk93 rajk93 commented May 26, 2025

fixes #9201

Problem

Currently, when a user has a proxy account set up (e.g., a 'NonTransfer' proxy), the UI may auto-suggest this proxy for all transactions, even for actions the proxy isn’t allowed to do (e.g., suggesting a 'NonTransfer' proxy for a balance transfer).

Solution

This PR refines the proxy filtering logic in Address.tsx to enable more intelligent auto-suggestion of proxies:

  1. The global BYPASS_PROXY_CHECK constant has been removed.
  2. The filterProxies function now accepts an optional bypassProxyTypeCheck boolean parameter (defaulting to false).
  • When bypassProxyTypeCheck is false (the default), filterProxies will strictly filter proxies based on their type and the nature of the transaction. This is intended for use by the auto-suggestion logic.
  • When bypassProxyTypeCheck is true, the type-specific filtering is skipped, allowing a list of all structurally valid proxies to be returned (e.g., for a UI element where the user explicitly wants to see all proxies and make their own choice).

Testing Summary:

Tested with an account having two proxies: PROXY1 (NonTransfer type) and PROXY2 (Any type).

  • For balance transfers, PROXY2 (Any) was correctly auto-suggested, while PROXY1 (NonTransfer) was not.
  • For non-transfer operations (e.g. remarks), both proxies were identified as suitable, with the UI auto-suggesting one of them. The filterProxies logic behaved as expected in both scenarios.

Copy link
Member
@ap211unitech ap211unitech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ap211unitech ap211unitech requested a review from TarikGul May 28, 2025 06:32
Copy link
Member
@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ap211unitech ap211unitech merged commit 30b1a50 into polkadot-js:master May 28, 2025
5 checks passed
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inaccurate suggestion to use the proxy
4 participants
0