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: Add firstTimeInteraction to transactionMeta #4895

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 5, 2024

Explanation

This PR adds firstTimeInteraction to transactionMeta by calling https://primitives.api.cx.metamask.io/ API
relationships endpoint.
For more information please see docs here: https://primitives.api.cx.metamask.io/docs#/Account%20%7C%20Relationships/IndexedChainDataAPIController_getAccountAddressRelationship

References

Related to: https://github.com/MetaMask/MetaMask-planning/issues/3040

Changelog

@metamask/transaction-controller

  • ADDED: Add firstTimeInteraction to transactionMeta
    • This field is getting filled by calling https://primitives.api.cx.metamask.io relationships endpoint.

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

@OGPoyraz
Copy link
Member Author

OGPoyraz commented Nov 5, 2024

@metamaskbot publish-preview

Copy link
Contributor

github-actions bot commented Nov 5, 2024

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": "18.2.3-preview-35c9c85",
  "@metamask-previews/address-book-controller": "6.0.1-preview-35c9c85",
  "@metamask-previews/announcement-controller": "7.0.1-preview-35c9c85",
  "@metamask-previews/approval-controller": "7.1.1-preview-35c9c85",
  "@metamask-previews/assets-controllers": "42.0.0-preview-35c9c85",
  "@metamask-previews/base-controller": "7.0.2-preview-35c9c85",
  "@metamask-previews/build-utils": "3.0.1-preview-35c9c85",
  "@metamask-previews/chain-controller": "0.1.3-preview-35c9c85",
  "@metamask-previews/composable-controller": "9.0.1-preview-35c9c85",
  "@metamask-previews/controller-utils": "11.4.2-preview-35c9c85",
  "@metamask-previews/ens-controller": "15.0.0-preview-35c9c85",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-35c9c85",
  "@metamask-previews/gas-fee-controller": "22.0.0-preview-35c9c85",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-35c9c85",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-35c9c85",
  "@metamask-previews/keyring-controller": "17.3.1-preview-35c9c85",
  "@metamask-previews/logging-controller": "6.0.1-preview-35c9c85",
  "@metamask-previews/message-manager": "11.0.1-preview-35c9c85",
  "@metamask-previews/multichain": "0.0.0-preview-35c9c85",
  "@metamask-previews/name-controller": "8.0.1-preview-35c9c85",
  "@metamask-previews/network-controller": "22.0.1-preview-35c9c85",
  "@metamask-previews/notification-controller": "7.0.0-preview-35c9c85",
  "@metamask-previews/notification-services-controller": "0.12.1-preview-35c9c85",
  "@metamask-previews/permission-controller": "11.0.3-preview-35c9c85",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-35c9c85",
  "@metamask-previews/phishing-controller": "12.3.0-preview-35c9c85",
  "@metamask-previews/polling-controller": "12.0.1-preview-35c9c85",
  "@metamask-previews/preferences-controller": "13.2.0-preview-35c9c85",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-35c9c85",
  "@metamask-previews/queued-request-controller": "7.0.0-preview-35c9c85",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-35c9c85",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-35c9c85",
  "@metamask-previews/signature-controller": "21.0.0-preview-35c9c85",
  "@metamask-previews/transaction-controller": "38.2.0-preview-35c9c85",
  "@metamask-previews/user-operation-controller": "17.0.0-preview-35c9c85"
}

@OGPoyraz
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": "18.2.3-preview-3f52b814",
  "@metamask-previews/address-book-controller": "6.0.1-preview-3f52b814",
  "@metamask-previews/announcement-controller": "7.0.1-preview-3f52b814",
  "@metamask-previews/approval-controller": "7.1.1-preview-3f52b814",
  "@metamask-previews/assets-controllers": "42.0.0-preview-3f52b814",
  "@metamask-previews/base-controller": "7.0.2-preview-3f52b814",
  "@metamask-previews/build-utils": "3.0.1-preview-3f52b814",
  "@metamask-previews/chain-controller": "0.1.3-preview-3f52b814",
  "@metamask-previews/composable-controller": "9.0.1-preview-3f52b814",
  "@metamask-previews/controller-utils": "11.4.2-preview-3f52b814",
  "@metamask-previews/ens-controller": "15.0.0-preview-3f52b814",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-3f52b814",
  "@metamask-previews/gas-fee-controller": "22.0.0-preview-3f52b814",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-3f52b814",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-3f52b814",
  "@metamask-previews/keyring-controller": "17.3.1-preview-3f52b814",
  "@metamask-previews/logging-controller": "6.0.1-preview-3f52b814",
  "@metamask-previews/message-manager": "11.0.1-preview-3f52b814",
  "@metamask-previews/multichain": "0.0.0-preview-3f52b814",
  "@metamask-previews/name-controller": "8.0.1-preview-3f52b814",
  "@metamask-previews/network-controller": "22.0.1-preview-3f52b814",
  "@metamask-previews/notification-controller": "7.0.0-preview-3f52b814",
  "@metamask-previews/notification-services-controller": "0.12.1-preview-3f52b814",
  "@metamask-previews/permission-controller": "11.0.3-preview-3f52b814",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-3f52b814",
  "@metamask-previews/phishing-controller": "12.3.0-preview-3f52b814",
  "@metamask-previews/polling-controller": "12.0.1-preview-3f52b814",
  "@metamask-previews/preferences-controller": "13.2.0-preview-3f52b814",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-3f52b814",
  "@metamask-previews/queued-request-controller": "7.0.0-preview-3f52b814",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-3f52b814",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-3f52b814",
  "@metamask-previews/signature-controller": "21.0.0-preview-3f52b814",
  "@metamask-previews/transaction-controller": "38.2.0-preview-3f52b814",
  "@metamask-previews/user-operation-controller": "17.0.0-preview-3f52b814"
}

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

@OGPoyraz OGPoyraz marked this pull request as ready for review November 13, 2024 11:19
@OGPoyraz OGPoyraz requested a review from a team as a code owner November 13, 2024 11:19
@OGPoyraz OGPoyraz force-pushed the 3040-alert-for-when-interacting-with-an-address-for-the-first-time branch from fefbd32 to 1045211 Compare November 14, 2024 12:04
@OGPoyraz
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-af392506",
  "@metamask-previews/address-book-controller": "6.0.1-preview-af392506",
  "@metamask-previews/announcement-controller": "7.0.1-preview-af392506",
  "@metamask-previews/approval-controller": "7.1.1-preview-af392506",
  "@metamask-previews/assets-controllers": "44.0.0-preview-af392506",
  "@metamask-previews/base-controller": "7.0.2-preview-af392506",
  "@metamask-previews/build-utils": "3.0.1-preview-af392506",
  "@metamask-previews/chain-controller": "0.1.3-preview-af392506",
  "@metamask-previews/composable-controller": "9.0.1-preview-af392506",
  "@metamask-previews/controller-utils": "11.4.3-preview-af392506",
  "@metamask-previews/ens-controller": "15.0.0-preview-af392506",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-af392506",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-af392506",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-af392506",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-af392506",
  "@metamask-previews/keyring-controller": "18.0.0-preview-af392506",
  "@metamask-previews/logging-controller": "6.0.2-preview-af392506",
  "@metamask-previews/message-manager": "11.0.1-preview-af392506",
  "@metamask-previews/multichain": "0.0.0-preview-af392506",
  "@metamask-previews/name-controller": "8.0.1-preview-af392506",
  "@metamask-previews/network-controller": "22.0.2-preview-af392506",
  "@metamask-previews/notification-controller": "7.0.0-preview-af392506",
  "@metamask-previews/notification-services-controller": "0.13.0-preview-af392506",
  "@metamask-previews/permission-controller": "11.0.3-preview-af392506",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-af392506",
  "@metamask-previews/phishing-controller": "12.3.0-preview-af392506",
  "@metamask-previews/polling-controller": "12.0.1-preview-af392506",
  "@metamask-previews/preferences-controller": "14.0.0-preview-af392506",
  "@metamask-previews/profile-sync-controller": "1.0.1-preview-af392506",
  "@metamask-previews/queued-request-controller": "7.0.1-preview-af392506",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-af392506",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-af392506",
  "@metamask-previews/signature-controller": "22.0.0-preview-af392506",
  "@metamask-previews/transaction-controller": "39.0.0-preview-af392506",
  "@metamask-previews/user-operation-controller": "18.0.0-preview-af392506"
}

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

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

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

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.

2 participants