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

feat: detect incoming transactions using accounts API #4927

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 14, 2024

Explanation

Poll for incoming transactions using the accounts API rather than Etherscan.

Specifically:

  • Remove polling on each new block via PollingBlockTracker.
    • Polling will occur every 30 seconds and support multiple chains simultaneously.
  • Remove etherscan util and EtherscanRemoteTransactionSource.
  • Create accounts-api util and AccountsApiRemoteTransactionSource.
  • Remove ETHERSCAN_SUPPORTED_NETWORKS constant.
  • Replace block number based query optimisation with cursors.
  • Use single instance of IncomingTransactionHelper.
    • Remove IncomingTransactionHelper instance creation from MultichainTrackingHelper.
  • Clear lastFetchedBlockNumbers when calling wipeTransactions.
  • Move caching logic inside RemoteTransactionSource via getCache and updateCache properties.

References

Changelog

See CHANGELOG.md.

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
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review November 21, 2024 13:53
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner November 21, 2024 13:53
@matthewwalsh0 matthewwalsh0 marked this pull request as draft November 21, 2024 17:02
Move cache logic into remote transaction source.
Support queryEntireHistory property.
Support updateTransactions property.
Support includeTokenTransfers property.
Ignore duplicate incoming transactions.
@matthewwalsh0
Copy link
Member Author

@metamaskbot publish-preview

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/accounts-controller": "19.0.0-preview-690da12e",
  "@metamask-previews/address-book-controller": "6.0.1-preview-690da12e",
  "@metamask-previews/announcement-controller": "7.0.1-preview-690da12e",
  "@metamask-previews/approval-controller": "7.1.1-preview-690da12e",
  "@metamask-previews/assets-controllers": "44.1.0-preview-690da12e",
  "@metamask-previews/base-controller": "7.0.2-preview-690da12e",
  "@metamask-previews/build-utils": "3.0.1-preview-690da12e",
  "@metamask-previews/chain-controller": "0.1.3-preview-690da12e",
  "@metamask-previews/composable-controller": "9.0.1-preview-690da12e",
  "@metamask-previews/controller-utils": "11.4.3-preview-690da12e",
  "@metamask-previews/ens-controller": "15.0.0-preview-690da12e",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-690da12e",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-690da12e",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-690da12e",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-690da12e",
  "@metamask-previews/keyring-controller": "18.0.0-preview-690da12e",
  "@metamask-previews/logging-controller": "6.0.2-preview-690da12e",
  "@metamask-previews/message-manager": "11.0.1-preview-690da12e",
  "@metamask-previews/multichain": "0.0.0-preview-690da12e",
  "@metamask-previews/name-controller": "8.0.1-preview-690da12e",
  "@metamask-previews/network-controller": "22.0.2-preview-690da12e",
  "@metamask-previews/notification-controller": "7.0.0-preview-690da12e",
  "@metamask-previews/notification-services-controller": "0.13.0-preview-690da12e",
  "@metamask-previews/permission-controller": "11.0.3-preview-690da12e",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-690da12e",
  "@metamask-previews/phishing-controller": "12.3.0-preview-690da12e",
  "@metamask-previews/polling-controller": "12.0.1-preview-690da12e",
  "@metamask-previews/preferences-controller": "14.0.0-preview-690da12e",
  "@metamask-previews/profile-sync-controller": "1.0.2-preview-690da12e",
  "@metamask-previews/queued-request-controller": "7.0.1-preview-690da12e",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-690da12e",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-690da12e",
  "@metamask-previews/signature-controller": "22.0.0-preview-690da12e",
  "@metamask-previews/transaction-controller": "39.1.0-preview-690da12e",
  "@metamask-previews/user-operation-controller": "18.0.0-preview-690da12e"
}

@MetaMask MetaMask deleted a comment from github-actions bot Nov 22, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Nov 22, 2024
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