-
-
Notifications
You must be signed in to change notification settings - Fork 252
feat: subscription sponsorship intents #6898
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
Conversation
|
@metamaskbot publish-preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
…onsorship-intents
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Explanation
Added new method,
submitSponsorshipIntents, which submits the user's sponsorship intents for new subscription with crypto.References
Checklist
Note
Introduces submitSponsorshipIntents flow for crypto subscriptions, adds/validates cached crypto payment method data (including token symbol), and updates approve amount/pricing handling with new helpers and errors.
src/SubscriptionController.ts)submitSponsorshipIntents(registered via messenger) to submit gas-sponsorship intents using cached crypto payment method and pricing-derivedbillingCycles/recurringInterval.#assertIsPaymentMethodCrypto,#getProductPriceByProductAndPlan, and refine#assertIsUserNotSubscribedusingACTIVE_SUBSCRIPTION_STATUSES.cacheLastSelectedPaymentMethodnow requirespaymentTokenSymbolfor crypto; persistslastSelectedPaymentMethodper product.getTokenApproveAmountuses priceminBillingCycles, affectingapproveAmount.src/SubscriptionService.ts)submitSponsorshipIntentsPOST totransaction-sponsorship/intents.src/types.ts,src/constants.ts,src/index.ts)SubmitSponsorshipIntentsRequest/SubmitSponsorshipIntentsMethodParams.CachedLastSelectedPaymentMethod(includes optionalpaymentTokenSymbol).PaymentTokenAddressAndSymbolRequiredForCrypto,PaymentMethodNotCrypto,ProductPriceNotFound; exportACTIVE_SUBSCRIPTION_STATUSES.StartCryptoSubscriptionRequestwith optionalisSponsored,smartTransactionId.minBillingCyclesand yearly price; adjust expectedapproveAmount.submitSponsorshipIntentsmethod.Written by Cursor Bugbot for commit 3387604. This will update automatically on new commits. Configure here.