All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump
@metamask/messengerfrom^1.0.0to^1.2.0(#8364, #8373, #8632) - Bump
@metamask/transaction-controllerfrom^64.0.0to^65.2.0(#8432, #8447, #8482, #8585, #8613, #8691, #8722) - Bump
@metamask/base-controllerfrom^9.0.1to^9.1.0(#8457)
- Bump
@metamask/transaction-controllerfrom^63.3.1to^64.0.0(#8359) - Bump
@metamask/profile-sync-controllerfrom^28.0.1to^28.0.2(#8325) - Bump
@metamask/controller-utilsfrom^11.19.0to^11.20.0(#8344)
- Bump
@metamask/base-controllerfrom^9.0.0to^9.0.1(#8317) - Bump
@metamask/messengerfrom^0.3.0to^1.0.0(#8317) - Bump
@metamask/polling-controllerfrom^16.0.3to^16.0.4(#8317) - Bump
@metamask/profile-sync-controllerfrom^28.0.0to^28.0.1(#8317) - Bump
@metamask/transaction-controllerfrom^63.2.0to^63.3.1(#8313, #8317)
- Expose all public
SubscriptionControllermethods through its messenger (#8219)SubscriptionController:getSubscriptionsEligibilitiesSubscriptionController:unCancelSubscriptionSubscriptionController:submitUserEventSubscriptionController:assignUserToCohortSubscriptionController:getTokenApproveAmountSubscriptionController:getTokenMinimumBalanceAmountSubscriptionController:clearStateSubscriptionController:triggerAccessTokenRefresh- Corresponding action types are now exported (e.g.
SubscriptionControllerGetPricingAction)
- Normalized payment token addresses before the comparison in
getCryptoApproveTransactionParamsmethod. (#8297) - Bump
@metamask/transaction-controllerfrom^63.0.0to^63.2.0(#8272, #8301)
- Bump
@metamask/transaction-controllerfrom^62.16.0to^62.21.0(#7897, #7996, #8005, #8031, #8104, #8140) - Bump
@metamask/polling-controllerfrom^16.0.2to^16.0.3(#7996) - Bump
@metamask/controller-utilsfrom^11.18.0to^11.19.0(#7995) - Bump
@metamask/profile-sync-controllerfrom^27.1.0to^28.0.0(#8162)
- BREAKING: Added two new params,
captureExceptionandfetchFunctiontoSubscriptionServiceconstructor args. (#7835)fetchFunctionis to use the client providedFetchAPI.captureExceptionis to capture the error thrown and report to Sentry.
- Updated
SubscriptionServiceErrorto include more information for Sentry reporting. (#7835) - Bump
@metamask/profile-sync-controllerfrom^27.0.0to^27.1.0(#7849) - Bump
@metamask/transaction-controllerfrom^62.12.0to^62.16.0(#7802, #7832, #7854, #7872)
- Added new public method
clearStateto clear/reset the subscription controller state. (#7780) - Added SubscriptionController
clearLastSelectedPaymentMethodmethod (#7768)
- Added
CancelTypetoSubscriptionandCancelSubscriptionRequestforcancelSubscriptionmethod (#7720) - Added
cancelUrlproperty toStartSubscriptionRequestandUpdatePaymentMethodCardRequest(#7719)
- Bump
@metamask/polling-controllerfrom^16.0.0to^16.0.2(#7604, #7642) - Bump
@metamask/transaction-controllerfrom^62.4.0to^62.9.2(#7325, #7430, #7494, #7596, #7602, #7604, #7642) - Bump
@metamask/utilsfrom^11.8.1to^11.9.0(#7511) - Bump
@metamask/controller-utilsfrom^11.16.0to^11.18.0(#7534, #7583)
- Updated
GetSubscriptionsResponseand controller state to includerewardAccountIdproperty (#7319)
- Renamed parameters related to rewards linking with shield. (#7311)
- Renamed from
rewardSubscriptionIdtorewardAccountId.
- Renamed from
- Added new method,
linkRewardsto link rewards to the existing subscription. (#7283) - Added an optional param,
rewardSubscriptionIdto start subscription requests to opt in to rewards together with the main subscription. (#7283) - Added an option param,
rewardSubscriptionIdinsubmitShieldSubscriptionCryptoApprovalto support rewards with crypto subscriptions. (#7298) - Added
SubscriptionControllerSubmitShieldSubscriptionCryptoApprovalActionandSubscriptionControllerLinkRewardsActionto exports. (#7298)
- Bump
@metamask/transaction-controllerfrom^62.3.1to^62.4.0(#7289)
- Added
minBillingCyclesForBalanceproperty toProductPricetype (#7269) - Added
getTokenMinimumBalanceAmountmethod toSubscriptonController(#7269)
- Bump
@metamask/transaction-controllerfrom^62.3.0to^62.3.1(#7257)
- Removed
minBalanceUSDfield from theSubscriptionEligibilitytype. (#7248) - Updated
submitShieldSubscriptionCryptoApprovalto handle change payment method transaction if subscription already existed (#7231) - Bump
@metamask/transaction-controllerfrom^62.0.0to^62.3.0(#7215, #7220, #7236) - Move peer dependencies for controller and service packages to direct dependencies (#7209)
- The dependencies moved are:
@metamask/profile-sync-controller(^27.0.0)
- In clients, it is now possible for multiple versions of these packages to exist in the dependency tree.
- For example, this scenario would be valid: a client relies on
@metamask/controller-a1.0.0 and@metamask/controller-b1.0.0, and@metamask/controller-bdepends on@metamask/controller-a1.1.0.
- For example, this scenario would be valid: a client relies on
- Note, however, that the versions specified in the client's
package.jsonalways "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
- The dependencies moved are:
- Bump
@metamask/polling-controllerfrom^15.0.0to^16.0.0(#7202) - Bump
@metamask/controller-utilsfrom^11.15.0to^11.16.0(#7202) - BREAKING: Bump
@metamask/profile-sync-controllerfrom^26.0.0to^27.0.0(#7202) - Bump
@metamask/transaction-controllerfrom^61.3.0to^62.0.0(#7153, #7202)
- Trigger
triggerAccessTokenRefresheverytime subscription state change instead of only when polling (#7149) - Remove
triggerAccessTokenRefreshafterstartShieldSubscriptionWithCard(#7149)
- Add missing start crypto
useTestClockparam fromlastSelectedPaymentMethodinsubmitShieldSubscriptionCryptoApproval(#7131)
- added
useTestClockparam toStartSubscriptionRequest,StartCryptoSubscriptionRequest,CachedLastSelectedPaymentMethod(#7129)
- Bump
@metamask/transaction-controllerfrom^61.1.0to^61.2.0(#7126)
- Added
modalTypefield and constant toSubscriptionEligibility(#7124)
- Added
lastSubscriptionin state returned fromgetSubscriptionsmethod (#7110) - Add
assignUserToCohortmethod to assign users to cohorts via backend API (#7099) - Add cohort-related types:
Cohort,CohortName,BalanceCategory,AssignCohortRequest,GetSubscriptionsEligibilitiesRequest(#7099) - Add cohort-related constants:
COHORT_NAMES,BALANCE_CATEGORIES,SubscriptionUserEvent(#7099) - Add cohort fields to
SubscriptionEligibilitytype:cohorts,assignedCohort,hasAssignedCohortExpired(#7099) - Add
ShieldCohortAssignedevent toSubscriptionUserEvent(#7099) - Add optional
balanceCategoryparameter togetSubscriptionsEligibilitiesfor privacy-preserving balance evaluation (#7099) - Add optional
cohortfield toSubmitUserEventRequestfor event tracking (#7099)
- Refactor
SubscriptionService.makeRequestto accept query parameters for cleaner URL construction (#7099)
- fix:
getTokenApproveAmountprecision by using bignumber.js (#7070)
- Added new property,
isSponsorshipSupportedto the ControllerState,pricing.paymentMethods.chains. (#7035) - Added
SubscriptionControllerSubmitSponsorshipIntentsActionin the controller exports. (#7037)
- Bump
@metamask/controller-utilsfrom^11.14.1to^11.15.0. (#7003) - Bump
@metamask/transaction-controllerfrom^61.0.0to^61.1.0(#7007) - Updated
submitSponsorshipIntentsmethod with chain validation. (#7035)
- Added new public method
submitShieldSubscriptionCryptoApproval, to submit shield crypto approval transaction (#6945) - Added the new controller state,
lastSelectedPaymentMethod. (#6946)- We will use this in the UI state persistence between navigation.
- We will use this to query user subscription plan details in subscribe methods internally.
- Added new public method,
submitSponsorshipIntents, to submit sponsorship intents for the new subscription with crypto. (#6898)
- BREAKING: Use new
Messengerfrom@metamask/messenger(#6444)- Previously,
SubscriptionControlleraccepted aRestrictedMessengerinstance from@metamask/base-controller.
- Previously,
- BREAKING: Bump
@metamask/profile-sync-controllerfrom^25.0.0to^26.0.0(#6962) - Bump
@metamask/base-controllerfrom^8.4.2to^9.0.0(#6962) - Bump
@metamask/polling-controllerfrom^14.0.1to^15.0.0(#6940, #6962)
- Make
getCryptoApproveTransactionParamssynchronous (#6930) - Bump
@metamask/base-controllerfrom^8.4.1to^8.4.2(#6917)
- BREAKING: Added two new public methods,
getSubscriptionsEligibilitiesandsubmitUserEventtoSubscriptionServiceandISubscriptionServiceinterface. (#6826)getSubscriptionsEligibilities(get user eligibilities for subscriptions).submitUserEvent(submit user UI events, e.g. EntryModalViewed).
- Added two new public methods,
getSubscriptionsEligibilitiesandsubmitUserEventto controller. (#6826) - Exported
SubscriptionUserEventfrom the Controller. (#6826)
1.1.0 [DEPRECATED]
- BREAKING: Added two new public methods,
getSubscriptionsEligibilitiesandsubmitUserEventtoSubscriptionServiceandISubscriptionServiceinterface. (#6826)getSubscriptionsEligibilities(get user eligibilities for subscriptions).submitUserEvent(submit user UI events, e.g. EntryModalViewed).
- Added two new public methods,
getSubscriptionsEligibilitiesandsubmitUserEventto controller. (#6826) - Exported
SubscriptionUserEventfrom the Controller. (#6826)
- Bump
@metamask/base-controllerfrom^8.4.0to^8.4.1(#6807) - Bump
@metamask/controller-utilsfrom^11.14.0to^11.14.1(#6807) - Bump
@metamask/polling-controllerfrom^14.0.0to^14.0.1(#6807)
- Added new public method,
getSubscriptionByProductwhich acceptsproductname as parameter and return the relevant subscription. (#6770)
- Updated controller exports. (#6785)
- PaymentMethod types (
CryptoPaymentMethodError,UpdatePaymentMethodCryptoRequest,UpdatePaymentMethodCardRequest,UpdatePaymentMethodCardResponse). - PaymentMethod error constants,
CRYPTO_PAYMENT_METHOD_ERRORS.
- PaymentMethod types (
- BREAKING: The
SubscriptionControllernow extendsStaticIntervalPollingController, and the new polling APIstartPollingmust be used to initiate polling (startPolling,stopPollingByPollingToken). (#6770) - BREAKING: The
SubscriptionControllernow accepts an optionalpollingIntervalproperty in the constructor argument, to enable the configurable polling interval. (#6770) - Prevent unnecessary state updates to avoid emitting
:stateChangeingetSubscriptionsmethod. (#6770)
- Get pricing from state instead of fetching pricing from server in
getCryptoApproveTransactionParams(#6735) - Bump
@metamask/utilsfrom^11.8.0to^11.8.1(#6708)
updatePaymentMethodreturnredirectUrlfor card payment (#6726)
- Add
CryptoPaymentMethodErrorerror response toSubscriptionCryptoPaymentMethod(#6720)
- Make
rawTransactioninUpdatePaymentMethodCryptoRequestoptional for top up case (#6720)
- Added
displayBrandin card payment type (#6669) - Added optional
successUrlparam in start subscription with card (#6669) - Bump
@metamask/base-controllerfrom^8.3.0to^8.4.0(#6632)
- Initial release of the subscription controller (#6233)
getSubscription: Retrieve current user subscription info if exist.cancelSubscription: Cancel user active subscription.
startShieldSubscriptionWithCard: start shield subscription via card (with trial option) (#6300)- Add
getPricingmethod (#6356) - Add methods
startSubscriptionWithCryptoandgetCryptoApproveTransactionParamsmethod (#6456) - Added
triggerAccessTokenRefreshto trigger an access token refresh (#6374) - Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#6504) - Added
updatePaymentMethodCardandupdatePaymentMethodCryptomethods (#6539) - Added
getBillingPortalUrlmethod (#6580) - Added
unCancelSubscriptionmethod (#6596)