Skip to content

Conversation

@tuna1207
Copy link
Member

@tuna1207 tuna1207 commented Oct 27, 2025

Explanation

Subscription controller listening for transaction event to handle subscription crypto approval to start shield subscription

References

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 communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Adds submitShieldSubscriptionCryptoApproval to process shield approval transactions and start crypto subscriptions, with tests and transaction-controller integration.

  • Subscription Controller
    • New method: submitShieldSubscriptionCryptoApproval(txMeta, isSponsored?) to handle TransactionType.shieldSubscriptionApprove and start crypto subscription, then refresh subscriptions.
    • Messaging: Registers ${controllerName}:submitShieldSubscriptionCryptoApproval action.
    • Validation: Errors for missing pricing, lastSelectedPaymentMethod, chainId/rawTx, non-crypto method, and missing product price.
  • Types
    • Update StartCryptoSubscriptionRequest: remove smartTransactionId field.
  • Tests
    • Add comprehensive tests for approval handling scenarios in src/SubscriptionController.test.ts.
    • Add tests/utils.ts with generateMockTxMeta helper.
  • Build/Deps
    • Add dependency @metamask/transaction-controller and TS project references.
  • Docs
    • Update CHANGELOG.md to document new public method.

Written by Cursor Bugbot for commit 55ca951. This will update automatically on new commits. Configure here.

@tuna1207 tuna1207 added team-web3auth area-shield Transaction Shield labels Oct 27, 2025
@tuna1207 tuna1207 marked this pull request as ready for review October 27, 2025 05:01
@tuna1207 tuna1207 requested a review from a team as a code owner October 27, 2025 05:01
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@tuna1207 tuna1207 requested a review from a team as a code owner October 29, 2025 04:03
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@lwin-kyaw lwin-kyaw left a comment

Choose a reason for hiding this comment

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

Some minor changes.

@tuna1207 tuna1207 requested a review from lwin-kyaw October 29, 2025 05:08
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

chaitanyapotti
chaitanyapotti previously approved these changes Oct 29, 2025
@tuna1207 tuna1207 merged commit 662b8bf into main Oct 29, 2025
255 checks passed
@tuna1207 tuna1207 deleted the feat/shield-subscription-crypto-approval branch October 29, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants