-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: link rewards to shield subscription #38489
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
base: main
Are you sure you want to change the base?
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| this.subscriptionService.updateSubscriptionCardPaymentMethod.bind( | ||
| this.subscriptionService, | ||
| ), | ||
| startSubscriptionWithCrypto: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing since, this API is not being used by JSON RPC Engine.
| }; | ||
| } | ||
|
|
||
| export function startSubscriptionWithCrypto(params: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing since, this action is not being used by frontend.
Builds ready [c67beb1]
UI Startup Metrics (1323 ± 121 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [0ee67f0]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| * | ||
| * @param transactionMeta - The transaction metadata. | ||
| */ | ||
| async _onShieldSubscriptionApprovalTransaction(transactionMeta) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this to SubscriptionService handleShieldSubscriptionApprovalTransaction
|
@metamaskbot update-policies |
Builds ready [1e7fcf1]
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
✨ Files requiring CODEOWNER review ✨🕵️ @MetaMask/extension-privacy-reviewers (1 files, +1 -0)
📜 @MetaMask/policy-reviewers (5 files, +385 -5)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. |
Builds ready [45fd45e]
UI Startup Metrics (1250 ± 130 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| "raw.githubusercontent.com", | ||
| "registry.npmjs.org", | ||
| "responsive-rpc.test", | ||
| "rewards.uat-api.cx.metamask.io", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With rewards being integrated to shield, we call rewards api to fetch rewards details (such as subscription_id, season status, etc) during the shield subscription e2e tests.
cc: @MetaMask/extension-privacy-reviewers @MetaMask/rewards
| "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-middleware": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-middleware": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-middleware": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "@metamask/eth-json-rpc-middleware>safe-stable-stringify": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-middleware": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/polling-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/polling-controller to do the subscription status polling.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "@metamask/controller-utils": true, | ||
| "@metamask/subscription-controller>@metamask/polling-controller": true, | ||
| "@metamask/transaction-controller": true, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "@metamask/controller-utils": true, | ||
| "@metamask/subscription-controller>@metamask/polling-controller": true, | ||
| "@metamask/transaction-controller": true, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "uuid": true | ||
| } | ||
| }, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
| "@metamask/controller-utils": true, | ||
| "@metamask/subscription-controller>@metamask/polling-controller": true, | ||
| "@metamask/transaction-controller": true, | ||
| "@metamask/subscription-controller>@metamask/transaction-controller": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metamask/subscription-controller uses @metamask/transaction-controller to reference/import the type-definitions required for the crypto subscriptions.
cc: @MetaMask/policy-reviewers
Builds ready [b174e08]
UI Startup Metrics (1259 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [c88a95d]
UI Startup Metrics (1253 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR allows rewards opted in users to claim points from shield subscription.
Changelog
CHANGELOG entry: link/claims rewards points from shield subscription
Related issues
Fixes: #38038
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Integrates rewards with Shield subscriptions (including linking and approval flows), moves post-transaction handling into
SubscriptionService, adds cohort tracking, and updates deps/policies.handlePostTransactionwith post-tx cohort assignment and metrics; moves Shield approval handling into#handleShieldSubscriptionApproveTransaction.#getRewardSubscriptionId,#getPrimaryCaipAccountId, andlinkRewardToExistingSubscription; passesrewardSubscriptionIdtostartShieldSubscriptionWithCardand crypto approval submit.RewardsController:getSeasonMetadata,RewardsController:getActualSubscriptionId) andAppStateController:setPendingShieldCohort.AppStateController: exposes/registerssetPendingShieldCohortaction.MetaMaskController: removes_onShieldSubscriptionApprovalTransaction; delegates post-tx handling tosubscriptionService.handlePostTransaction; removesCOHORT_NAMESimport and crypto start wiring.submitShieldSubscriptionCryptoApproval,linkRewards).startSubscriptionWithCryptoaction.linkRewardToShieldSubscriptionthunk.subscription-service.test.tsto cover reward ID inclusion, season checks, and linking behavior.@metamask/subscription-controllerand bumps@metamask/transaction-controller; updates LavaMoat policies accordingly.rewards.uat-api.cx.metamask.iotoprivacy-snapshot.json.Written by Cursor Bugbot for commit c88a95d. This will update automatically on new commits. Configure here.