Skip to content
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

queueing #1719

Closed
wants to merge 5 commits into from
Closed

queueing #1719

wants to merge 5 commits into from

Conversation

BelfordZ
Copy link
Contributor

@BelfordZ BelfordZ commented Sep 26, 2023

Explanation

What is the current state of things and why does it need to change?

Currently, dapps must keep track of what metamasks selected network is, and switch the network appropriately. We recently added a selectedNetworkController that keeps track of what dapp has requested what network. This PR adds some middleware that will automatically prompt the user to switch metamasks network if the saved network for the dapp doesnt match. It also adds a queue, which will cause requests which require confirmations to be processed in a first-in-first-out manner.

The queued request controller provides this api mechanism and serves as a place to interate on the queueing implementation.

The selected network controller is updated to provide a proxy provider - that is, a provider that will be swapped out based on the dapps network selections.

References

needs these

Changelog

@metamask/queued-request-controller

  • ADDED: controller & middleware

@metamask/selected-network-controller

  • ADDED: A method to get a proxy provider for a given origin/domain.
  • CHANGED: No longer update selectedNetworkClientId when the networkcontroller provider changes.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@BelfordZ
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/address-book-controller": "3.1.1-preview.dbee2e4",
  "@metamask-previews/announcement-controller": "4.0.1-preview.dbee2e4",
  "@metamask-previews/approval-controller": "3.5.1-preview.dbee2e4",
  "@metamask-previews/assets-controllers": "11.1.0-preview.dbee2e4",
  "@metamask-previews/base-controller": "3.2.1-preview.dbee2e4",
  "@metamask-previews/composable-controller": "3.0.1-preview.dbee2e4",
  "@metamask-previews/controller-utils": "4.3.2-preview.dbee2e4",
  "@metamask-previews/ens-controller": "4.1.1-preview.dbee2e4",
  "@metamask-previews/gas-fee-controller": "6.1.2-preview.dbee2e4",
  "@metamask-previews/keyring-controller": "7.4.0-preview.dbee2e4",
  "@metamask-previews/logging-controller": "1.0.1-preview.dbee2e4",
  "@metamask-previews/message-manager": "7.3.1-preview.dbee2e4",
  "@metamask-previews/name-controller": "1.0.0-preview.dbee2e4",
  "@metamask-previews/network-controller": "12.1.2-preview.dbee2e4",
  "@metamask-previews/notification-controller": "3.1.1-preview.dbee2e4",
  "@metamask-previews/permission-controller": "4.1.1-preview.dbee2e4",
  "@metamask-previews/phishing-controller": "6.0.1-preview.dbee2e4",
  "@metamask-previews/preferences-controller": "4.4.0-preview.dbee2e4",
  "@metamask-previews/rate-limit-controller": "3.0.1-preview.dbee2e4",
  "@metamask-previews/selected-network-controller": "1.0.1-preview.dbee2e4",
  "@metamask-previews/signature-controller": "5.3.1-preview.dbee2e4",
  "@metamask-previews/transaction-controller": "10.0.0-preview.dbee2e4"
}

@socket-security
Copy link

socket-security bot commented Oct 10, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/selected-network-controller 2.0.1 None +1 245 kB metamaskbot
typedoc-plugin-missing-exports 0.22.6 None +36 447 MB gerrit0
typedoc 0.22.18 None +30 442 MB typedoc-bot
typescript 4.6.4 None +0 64.7 MB typescript-bot

@BelfordZ
Copy link
Contributor Author

@metamaskbot publish-preview

@BelfordZ BelfordZ closed this Oct 11, 2023
@BelfordZ BelfordZ reopened this Oct 11, 2023
@BelfordZ
Copy link
Contributor Author

replaced by #1806

@BelfordZ BelfordZ closed this Oct 11, 2023
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