@metamask-previews/subscription-controller 8.0.1-preview-5bb6dba48 → 8.0.1-preview-efd9e28b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/SubscriptionController-method-action-types.cjs.map +1 -1
- package/dist/SubscriptionController-method-action-types.d.cts +12 -1
- package/dist/SubscriptionController-method-action-types.d.cts.map +1 -1
- package/dist/SubscriptionController-method-action-types.d.mts +12 -1
- package/dist/SubscriptionController-method-action-types.d.mts.map +1 -1
- package/dist/SubscriptionController-method-action-types.mjs.map +1 -1
- package/dist/SubscriptionController.cjs +136 -36
- package/dist/SubscriptionController.cjs.map +1 -1
- package/dist/SubscriptionController.d.cts +14 -4
- package/dist/SubscriptionController.d.cts.map +1 -1
- package/dist/SubscriptionController.d.mts +14 -4
- package/dist/SubscriptionController.d.mts.map +1 -1
- package/dist/SubscriptionController.mjs +140 -36
- package/dist/SubscriptionController.mjs.map +1 -1
- package/dist/SubscriptionService-method-action-types.cjs.map +1 -1
- package/dist/SubscriptionService-method-action-types.d.cts +10 -1
- package/dist/SubscriptionService-method-action-types.d.cts.map +1 -1
- package/dist/SubscriptionService-method-action-types.d.mts +10 -1
- package/dist/SubscriptionService-method-action-types.d.mts.map +1 -1
- package/dist/SubscriptionService-method-action-types.mjs.map +1 -1
- package/dist/SubscriptionService-structs.cjs +52 -1
- package/dist/SubscriptionService-structs.cjs.map +1 -1
- package/dist/SubscriptionService-structs.d.cts +175 -7
- package/dist/SubscriptionService-structs.d.cts.map +1 -1
- package/dist/SubscriptionService-structs.d.mts +175 -7
- package/dist/SubscriptionService-structs.d.mts.map +1 -1
- package/dist/SubscriptionService-structs.mjs +52 -1
- package/dist/SubscriptionService-structs.mjs.map +1 -1
- package/dist/SubscriptionService.cjs +20 -0
- package/dist/SubscriptionService.cjs.map +1 -1
- package/dist/SubscriptionService.d.cts +7 -1
- package/dist/SubscriptionService.d.cts.map +1 -1
- package/dist/SubscriptionService.d.mts +7 -1
- package/dist/SubscriptionService.d.mts.map +1 -1
- package/dist/SubscriptionService.mjs +21 -1
- package/dist/SubscriptionService.mjs.map +1 -1
- package/dist/constants.cjs +1 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +1 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +1 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.cjs +52 -0
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +38 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.mts +38 -0
- package/dist/selectors.d.mts.map +1 -0
- package/dist/selectors.mjs +46 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/types.cjs +11 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +71 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +71 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +10 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-method-action-types.cjs","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SubscriptionService } from './SubscriptionService.js';\n\n/**\n * Fetches the user's subscriptions.\n *\n * @returns The subscriptions response.\n */\nexport type SubscriptionServiceGetSubscriptionsAction = {\n type: `SubscriptionService:getSubscriptions`;\n handler: SubscriptionService['getSubscriptions'];\n};\n\n/**\n * Cancels a subscription.\n *\n * @param params - The cancel subscription request.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceCancelSubscriptionAction = {\n type: `SubscriptionService:cancelSubscription`;\n handler: SubscriptionService['cancelSubscription'];\n};\n\n/**\n * Reverses a pending subscription cancellation.\n *\n * @param params - The uncancel subscription request.\n * @param params.subscriptionId - The subscription ID to uncancel.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceUnCancelSubscriptionAction = {\n type: `SubscriptionService:unCancelSubscription`;\n handler: SubscriptionService['unCancelSubscription'];\n};\n\n/**\n * Starts a card-paid subscription checkout session for the requested products\n * (e.g. Shield or Money Account Plus).\n *\n * @param request - The start subscription request.\n * @returns The checkout session response.\n */\nexport type SubscriptionServiceStartSubscriptionWithCardAction = {\n type: `SubscriptionService:startSubscriptionWithCard`;\n handler: SubscriptionService['startSubscriptionWithCard'];\n};\n\n/**\n * Starts a subscription with a crypto payment method.\n *\n * @param request - The start crypto subscription request.\n * @returns The created subscription response.\n * @throws If `products` is empty.\n * @throws If the request does not use exactly one of `rawTransaction`\n * (ERC-20 approval) or `delegationHash` (delegation).\n */\nexport type SubscriptionServiceStartSubscriptionWithCryptoAction = {\n type: `SubscriptionService:startSubscriptionWithCrypto`;\n handler: SubscriptionService['startSubscriptionWithCrypto'];\n};\n\n/**\n * Updates a subscription's card payment method.\n *\n * @param request - The update payment method request.\n * @returns The redirect URL response.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCardAction = {\n type: `SubscriptionService:updatePaymentMethodCard`;\n handler: SubscriptionService['updatePaymentMethodCard'];\n};\n\n/**\n * Updates a subscription's crypto payment method.\n *\n * @param request - The update payment method request.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCryptoAction = {\n type: `SubscriptionService:updatePaymentMethodCrypto`;\n handler: SubscriptionService['updatePaymentMethodCrypto'];\n};\n\n/**\n * Get the eligibility for a shield subscription.\n *\n * @param request - Optional request object containing user balance category to check cohort eligibility\n * @returns The eligibility for a shield subscription\n */\nexport type SubscriptionServiceGetSubscriptionsEligibilitiesAction = {\n type: `SubscriptionService:getSubscriptionsEligibilities`;\n handler: SubscriptionService['getSubscriptionsEligibilities'];\n};\n\n/**\n * Submit a user event. (e.g. shield modal viewed)\n *\n * @param request - Request object containing the event to submit.\n * @example { event: SubscriptionUserEvent.ShieldEntryModalViewed, cohort: 'post_tx' }\n */\nexport type SubscriptionServiceSubmitUserEventAction = {\n type: `SubscriptionService:submitUserEvent`;\n handler: SubscriptionService['submitUserEvent'];\n};\n\n/**\n * Assign user to a cohort.\n *\n * @param request - Request object containing the cohort to assign the user to.\n * @example { cohort: 'post_tx' }\n */\nexport type SubscriptionServiceAssignUserToCohortAction = {\n type: `SubscriptionService:assignUserToCohort`;\n handler: SubscriptionService['assignUserToCohort'];\n};\n\n/**\n * Submit sponsorship intents to the Subscription Service backend.\n *\n * This is intended to be used together with the crypto subscription flow.\n * When the user has enabled the smart transaction feature, we will sponsor the gas fees for the subscription approval transaction.\n *\n * @param request - Request object containing the address and products.\n * @example { address: '0x1234567890123456789012345678901234567890', products: [ProductType.Shield] }\n */\nexport type SubscriptionServiceSubmitSponsorshipIntentsAction = {\n type: `SubscriptionService:submitSponsorshipIntents`;\n handler: SubscriptionService['submitSponsorshipIntents'];\n};\n\n/**\n * Link rewards to a subscription.\n *\n * @param request - Request object containing the reward account ID.\n * @example { rewardAccountId: 'eip155:1:0x1234567890123456789012345678901234567890' }\n * @returns The response from the API.\n */\nexport type SubscriptionServiceLinkRewardsAction = {\n type: `SubscriptionService:linkRewards`;\n handler: SubscriptionService['linkRewards'];\n};\n\n/**\n * Fetches subscription pricing information.\n *\n * @returns The pricing response.\n */\nexport type SubscriptionServiceGetPricingAction = {\n type: `SubscriptionService:getPricing`;\n handler: SubscriptionService['getPricing'];\n};\n\n/**\n * Fetches the billing portal URL.\n *\n * @returns The billing portal response.\n */\nexport type SubscriptionServiceGetBillingPortalUrlAction = {\n type: `SubscriptionService:getBillingPortalUrl`;\n handler: SubscriptionService['getBillingPortalUrl'];\n};\n\n/**\n * Union of all SubscriptionService action types.\n */\nexport type SubscriptionServiceMethodActions =\n | SubscriptionServiceGetSubscriptionsAction\n | SubscriptionServiceCancelSubscriptionAction\n | SubscriptionServiceUnCancelSubscriptionAction\n | SubscriptionServiceStartSubscriptionWithCardAction\n | SubscriptionServiceStartSubscriptionWithCryptoAction\n | SubscriptionServiceUpdatePaymentMethodCardAction\n | SubscriptionServiceUpdatePaymentMethodCryptoAction\n | SubscriptionServiceGetSubscriptionsEligibilitiesAction\n | SubscriptionServiceSubmitUserEventAction\n | SubscriptionServiceAssignUserToCohortAction\n | SubscriptionServiceSubmitSponsorshipIntentsAction\n | SubscriptionServiceLinkRewardsAction\n | SubscriptionServiceGetPricingAction\n | SubscriptionServiceGetBillingPortalUrlAction;\n"]}
|
|
1
|
+
{"version":3,"file":"SubscriptionService-method-action-types.cjs","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SubscriptionService } from './SubscriptionService.js';\n\n/**\n * Fetches the user's subscriptions.\n *\n * @returns The subscriptions response.\n */\nexport type SubscriptionServiceGetSubscriptionsAction = {\n type: `SubscriptionService:getSubscriptions`;\n handler: SubscriptionService['getSubscriptions'];\n};\n\n/**\n * Fetches the user's subscription benefits.\n *\n * @returns The benefits response.\n */\nexport type SubscriptionServiceGetBenefitsAction = {\n type: `SubscriptionService:getBenefits`;\n handler: SubscriptionService['getBenefits'];\n};\n\n/**\n * Cancels a subscription.\n *\n * @param params - The cancel subscription request.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceCancelSubscriptionAction = {\n type: `SubscriptionService:cancelSubscription`;\n handler: SubscriptionService['cancelSubscription'];\n};\n\n/**\n * Reverses a pending subscription cancellation.\n *\n * @param params - The uncancel subscription request.\n * @param params.subscriptionId - The subscription ID to uncancel.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceUnCancelSubscriptionAction = {\n type: `SubscriptionService:unCancelSubscription`;\n handler: SubscriptionService['unCancelSubscription'];\n};\n\n/**\n * Starts a card-paid subscription checkout session for the requested products\n * (e.g. Shield or Money Account Plus).\n *\n * @param request - The start subscription request.\n * @returns The checkout session response.\n */\nexport type SubscriptionServiceStartSubscriptionWithCardAction = {\n type: `SubscriptionService:startSubscriptionWithCard`;\n handler: SubscriptionService['startSubscriptionWithCard'];\n};\n\n/**\n * Starts a subscription with a crypto payment method.\n *\n * @param request - The start crypto subscription request.\n * @returns The created subscription response.\n * @throws If `products` is empty.\n * @throws If the request does not use exactly one of `rawTransaction`\n * (ERC-20 approval) or `delegationHash` (delegation).\n */\nexport type SubscriptionServiceStartSubscriptionWithCryptoAction = {\n type: `SubscriptionService:startSubscriptionWithCrypto`;\n handler: SubscriptionService['startSubscriptionWithCrypto'];\n};\n\n/**\n * Updates a subscription's card payment method.\n *\n * @param request - The update payment method request.\n * @returns The redirect URL response.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCardAction = {\n type: `SubscriptionService:updatePaymentMethodCard`;\n handler: SubscriptionService['updatePaymentMethodCard'];\n};\n\n/**\n * Updates a subscription's crypto payment method.\n *\n * @param request - The update payment method request.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCryptoAction = {\n type: `SubscriptionService:updatePaymentMethodCrypto`;\n handler: SubscriptionService['updatePaymentMethodCrypto'];\n};\n\n/**\n * Get the eligibility for a shield subscription.\n *\n * @param request - Optional request object containing user balance category to check cohort eligibility\n * @returns The eligibility for a shield subscription\n */\nexport type SubscriptionServiceGetSubscriptionsEligibilitiesAction = {\n type: `SubscriptionService:getSubscriptionsEligibilities`;\n handler: SubscriptionService['getSubscriptionsEligibilities'];\n};\n\n/**\n * Submit a user event. (e.g. shield modal viewed)\n *\n * @param request - Request object containing the event to submit.\n * @example { event: SubscriptionUserEvent.ShieldEntryModalViewed, cohort: 'post_tx' }\n */\nexport type SubscriptionServiceSubmitUserEventAction = {\n type: `SubscriptionService:submitUserEvent`;\n handler: SubscriptionService['submitUserEvent'];\n};\n\n/**\n * Assign user to a cohort.\n *\n * @param request - Request object containing the cohort to assign the user to.\n * @example { cohort: 'post_tx' }\n */\nexport type SubscriptionServiceAssignUserToCohortAction = {\n type: `SubscriptionService:assignUserToCohort`;\n handler: SubscriptionService['assignUserToCohort'];\n};\n\n/**\n * Submit sponsorship intents to the Subscription Service backend.\n *\n * This is intended to be used together with the crypto subscription flow.\n * When the user has enabled the smart transaction feature, we will sponsor the gas fees for the subscription approval transaction.\n *\n * @param request - Request object containing the address and products.\n * @example { address: '0x1234567890123456789012345678901234567890', products: [ProductType.Shield] }\n */\nexport type SubscriptionServiceSubmitSponsorshipIntentsAction = {\n type: `SubscriptionService:submitSponsorshipIntents`;\n handler: SubscriptionService['submitSponsorshipIntents'];\n};\n\n/**\n * Link rewards to a subscription.\n *\n * @param request - Request object containing the reward account ID.\n * @example { rewardAccountId: 'eip155:1:0x1234567890123456789012345678901234567890' }\n * @returns The response from the API.\n */\nexport type SubscriptionServiceLinkRewardsAction = {\n type: `SubscriptionService:linkRewards`;\n handler: SubscriptionService['linkRewards'];\n};\n\n/**\n * Fetches subscription pricing information.\n *\n * @returns The pricing response.\n */\nexport type SubscriptionServiceGetPricingAction = {\n type: `SubscriptionService:getPricing`;\n handler: SubscriptionService['getPricing'];\n};\n\n/**\n * Fetches the billing portal URL.\n *\n * @returns The billing portal response.\n */\nexport type SubscriptionServiceGetBillingPortalUrlAction = {\n type: `SubscriptionService:getBillingPortalUrl`;\n handler: SubscriptionService['getBillingPortalUrl'];\n};\n\n/**\n * Union of all SubscriptionService action types.\n */\nexport type SubscriptionServiceMethodActions =\n | SubscriptionServiceGetSubscriptionsAction\n | SubscriptionServiceGetBenefitsAction\n | SubscriptionServiceCancelSubscriptionAction\n | SubscriptionServiceUnCancelSubscriptionAction\n | SubscriptionServiceStartSubscriptionWithCardAction\n | SubscriptionServiceStartSubscriptionWithCryptoAction\n | SubscriptionServiceUpdatePaymentMethodCardAction\n | SubscriptionServiceUpdatePaymentMethodCryptoAction\n | SubscriptionServiceGetSubscriptionsEligibilitiesAction\n | SubscriptionServiceSubmitUserEventAction\n | SubscriptionServiceAssignUserToCohortAction\n | SubscriptionServiceSubmitSponsorshipIntentsAction\n | SubscriptionServiceLinkRewardsAction\n | SubscriptionServiceGetPricingAction\n | SubscriptionServiceGetBillingPortalUrlAction;\n"]}
|
|
@@ -12,6 +12,15 @@ export type SubscriptionServiceGetSubscriptionsAction = {
|
|
|
12
12
|
type: `SubscriptionService:getSubscriptions`;
|
|
13
13
|
handler: SubscriptionService['getSubscriptions'];
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the user's subscription benefits.
|
|
17
|
+
*
|
|
18
|
+
* @returns The benefits response.
|
|
19
|
+
*/
|
|
20
|
+
export type SubscriptionServiceGetBenefitsAction = {
|
|
21
|
+
type: `SubscriptionService:getBenefits`;
|
|
22
|
+
handler: SubscriptionService['getBenefits'];
|
|
23
|
+
};
|
|
15
24
|
/**
|
|
16
25
|
* Cancels a subscription.
|
|
17
26
|
*
|
|
@@ -151,5 +160,5 @@ export type SubscriptionServiceGetBillingPortalUrlAction = {
|
|
|
151
160
|
/**
|
|
152
161
|
* Union of all SubscriptionService action types.
|
|
153
162
|
*/
|
|
154
|
-
export type SubscriptionServiceMethodActions = SubscriptionServiceGetSubscriptionsAction | SubscriptionServiceCancelSubscriptionAction | SubscriptionServiceUnCancelSubscriptionAction | SubscriptionServiceStartSubscriptionWithCardAction | SubscriptionServiceStartSubscriptionWithCryptoAction | SubscriptionServiceUpdatePaymentMethodCardAction | SubscriptionServiceUpdatePaymentMethodCryptoAction | SubscriptionServiceGetSubscriptionsEligibilitiesAction | SubscriptionServiceSubmitUserEventAction | SubscriptionServiceAssignUserToCohortAction | SubscriptionServiceSubmitSponsorshipIntentsAction | SubscriptionServiceLinkRewardsAction | SubscriptionServiceGetPricingAction | SubscriptionServiceGetBillingPortalUrlAction;
|
|
163
|
+
export type SubscriptionServiceMethodActions = SubscriptionServiceGetSubscriptionsAction | SubscriptionServiceGetBenefitsAction | SubscriptionServiceCancelSubscriptionAction | SubscriptionServiceUnCancelSubscriptionAction | SubscriptionServiceStartSubscriptionWithCardAction | SubscriptionServiceStartSubscriptionWithCryptoAction | SubscriptionServiceUpdatePaymentMethodCardAction | SubscriptionServiceUpdatePaymentMethodCryptoAction | SubscriptionServiceGetSubscriptionsEligibilitiesAction | SubscriptionServiceSubmitUserEventAction | SubscriptionServiceAssignUserToCohortAction | SubscriptionServiceSubmitSponsorshipIntentsAction | SubscriptionServiceLinkRewardsAction | SubscriptionServiceGetPricingAction | SubscriptionServiceGetBillingPortalUrlAction;
|
|
155
164
|
//# sourceMappingURL=SubscriptionService-method-action-types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-method-action-types.d.cts","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,mBAAmB,CAAC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;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,yCAAyC,GACzC,2CAA2C,GAC3C,6CAA6C,GAC7C,kDAAkD,GAClD,oDAAoD,GACpD,gDAAgD,GAChD,kDAAkD,GAClD,sDAAsD,GACtD,wCAAwC,GACxC,2CAA2C,GAC3C,iDAAiD,GACjD,oCAAoC,GACpC,mCAAmC,GACnC,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"SubscriptionService-method-action-types.d.cts","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,mBAAm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;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,yCAAyC,GACzC,oCAAoC,GACpC,2CAA2C,GAC3C,6CAA6C,GAC7C,kDAAkD,GAClD,oDAAoD,GACpD,gDAAgD,GAChD,kDAAkD,GAClD,sDAAsD,GACtD,wCAAwC,GACxC,2CAA2C,GAC3C,iDAAiD,GACjD,oCAAoC,GACpC,mCAAmC,GACnC,4CAA4C,CAAC"}
|
|
@@ -12,6 +12,15 @@ export type SubscriptionServiceGetSubscriptionsAction = {
|
|
|
12
12
|
type: `SubscriptionService:getSubscriptions`;
|
|
13
13
|
handler: SubscriptionService['getSubscriptions'];
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Fetches the user's subscription benefits.
|
|
17
|
+
*
|
|
18
|
+
* @returns The benefits response.
|
|
19
|
+
*/
|
|
20
|
+
export type SubscriptionServiceGetBenefitsAction = {
|
|
21
|
+
type: `SubscriptionService:getBenefits`;
|
|
22
|
+
handler: SubscriptionService['getBenefits'];
|
|
23
|
+
};
|
|
15
24
|
/**
|
|
16
25
|
* Cancels a subscription.
|
|
17
26
|
*
|
|
@@ -151,5 +160,5 @@ export type SubscriptionServiceGetBillingPortalUrlAction = {
|
|
|
151
160
|
/**
|
|
152
161
|
* Union of all SubscriptionService action types.
|
|
153
162
|
*/
|
|
154
|
-
export type SubscriptionServiceMethodActions = SubscriptionServiceGetSubscriptionsAction | SubscriptionServiceCancelSubscriptionAction | SubscriptionServiceUnCancelSubscriptionAction | SubscriptionServiceStartSubscriptionWithCardAction | SubscriptionServiceStartSubscriptionWithCryptoAction | SubscriptionServiceUpdatePaymentMethodCardAction | SubscriptionServiceUpdatePaymentMethodCryptoAction | SubscriptionServiceGetSubscriptionsEligibilitiesAction | SubscriptionServiceSubmitUserEventAction | SubscriptionServiceAssignUserToCohortAction | SubscriptionServiceSubmitSponsorshipIntentsAction | SubscriptionServiceLinkRewardsAction | SubscriptionServiceGetPricingAction | SubscriptionServiceGetBillingPortalUrlAction;
|
|
163
|
+
export type SubscriptionServiceMethodActions = SubscriptionServiceGetSubscriptionsAction | SubscriptionServiceGetBenefitsAction | SubscriptionServiceCancelSubscriptionAction | SubscriptionServiceUnCancelSubscriptionAction | SubscriptionServiceStartSubscriptionWithCardAction | SubscriptionServiceStartSubscriptionWithCryptoAction | SubscriptionServiceUpdatePaymentMethodCardAction | SubscriptionServiceUpdatePaymentMethodCryptoAction | SubscriptionServiceGetSubscriptionsEligibilitiesAction | SubscriptionServiceSubmitUserEventAction | SubscriptionServiceAssignUserToCohortAction | SubscriptionServiceSubmitSponsorshipIntentsAction | SubscriptionServiceLinkRewardsAction | SubscriptionServiceGetPricingAction | SubscriptionServiceGetBillingPortalUrlAction;
|
|
155
164
|
//# sourceMappingURL=SubscriptionService-method-action-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-method-action-types.d.mts","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,mBAAmB,CAAC,kBAAkB,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M,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,yCAAyC,GACzC,2CAA2C,GAC3C,6CAA6C,GAC7C,kDAAkD,GAClD,oDAAoD,GACpD,gDAAgD,GAChD,kDAAkD,GAClD,sDAAsD,GACtD,wCAAwC,GACxC,2CAA2C,GAC3C,iDAAiD,GACjD,oCAAoC,GACpC,mCAAmC,GACnC,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"SubscriptionService-method-action-types.d.mts","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,mBAAmB,CA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AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,yCAAyC,GACzC,oCAAoC,GACpC,2CAA2C,GAC3C,6CAA6C,GAC7C,kDAAkD,GAClD,oDAAoD,GACpD,gDAAgD,GAChD,kDAAkD,GAClD,sDAAsD,GACtD,wCAAwC,GACxC,2CAA2C,GAC3C,iDAAiD,GACjD,oCAAoC,GACpC,mCAAmC,GACnC,4CAA4C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-method-action-types.mjs","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SubscriptionService } from './SubscriptionService.js';\n\n/**\n * Fetches the user's subscriptions.\n *\n * @returns The subscriptions response.\n */\nexport type SubscriptionServiceGetSubscriptionsAction = {\n type: `SubscriptionService:getSubscriptions`;\n handler: SubscriptionService['getSubscriptions'];\n};\n\n/**\n * Cancels a subscription.\n *\n * @param params - The cancel subscription request.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceCancelSubscriptionAction = {\n type: `SubscriptionService:cancelSubscription`;\n handler: SubscriptionService['cancelSubscription'];\n};\n\n/**\n * Reverses a pending subscription cancellation.\n *\n * @param params - The uncancel subscription request.\n * @param params.subscriptionId - The subscription ID to uncancel.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceUnCancelSubscriptionAction = {\n type: `SubscriptionService:unCancelSubscription`;\n handler: SubscriptionService['unCancelSubscription'];\n};\n\n/**\n * Starts a card-paid subscription checkout session for the requested products\n * (e.g. Shield or Money Account Plus).\n *\n * @param request - The start subscription request.\n * @returns The checkout session response.\n */\nexport type SubscriptionServiceStartSubscriptionWithCardAction = {\n type: `SubscriptionService:startSubscriptionWithCard`;\n handler: SubscriptionService['startSubscriptionWithCard'];\n};\n\n/**\n * Starts a subscription with a crypto payment method.\n *\n * @param request - The start crypto subscription request.\n * @returns The created subscription response.\n * @throws If `products` is empty.\n * @throws If the request does not use exactly one of `rawTransaction`\n * (ERC-20 approval) or `delegationHash` (delegation).\n */\nexport type SubscriptionServiceStartSubscriptionWithCryptoAction = {\n type: `SubscriptionService:startSubscriptionWithCrypto`;\n handler: SubscriptionService['startSubscriptionWithCrypto'];\n};\n\n/**\n * Updates a subscription's card payment method.\n *\n * @param request - The update payment method request.\n * @returns The redirect URL response.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCardAction = {\n type: `SubscriptionService:updatePaymentMethodCard`;\n handler: SubscriptionService['updatePaymentMethodCard'];\n};\n\n/**\n * Updates a subscription's crypto payment method.\n *\n * @param request - The update payment method request.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCryptoAction = {\n type: `SubscriptionService:updatePaymentMethodCrypto`;\n handler: SubscriptionService['updatePaymentMethodCrypto'];\n};\n\n/**\n * Get the eligibility for a shield subscription.\n *\n * @param request - Optional request object containing user balance category to check cohort eligibility\n * @returns The eligibility for a shield subscription\n */\nexport type SubscriptionServiceGetSubscriptionsEligibilitiesAction = {\n type: `SubscriptionService:getSubscriptionsEligibilities`;\n handler: SubscriptionService['getSubscriptionsEligibilities'];\n};\n\n/**\n * Submit a user event. (e.g. shield modal viewed)\n *\n * @param request - Request object containing the event to submit.\n * @example { event: SubscriptionUserEvent.ShieldEntryModalViewed, cohort: 'post_tx' }\n */\nexport type SubscriptionServiceSubmitUserEventAction = {\n type: `SubscriptionService:submitUserEvent`;\n handler: SubscriptionService['submitUserEvent'];\n};\n\n/**\n * Assign user to a cohort.\n *\n * @param request - Request object containing the cohort to assign the user to.\n * @example { cohort: 'post_tx' }\n */\nexport type SubscriptionServiceAssignUserToCohortAction = {\n type: `SubscriptionService:assignUserToCohort`;\n handler: SubscriptionService['assignUserToCohort'];\n};\n\n/**\n * Submit sponsorship intents to the Subscription Service backend.\n *\n * This is intended to be used together with the crypto subscription flow.\n * When the user has enabled the smart transaction feature, we will sponsor the gas fees for the subscription approval transaction.\n *\n * @param request - Request object containing the address and products.\n * @example { address: '0x1234567890123456789012345678901234567890', products: [ProductType.Shield] }\n */\nexport type SubscriptionServiceSubmitSponsorshipIntentsAction = {\n type: `SubscriptionService:submitSponsorshipIntents`;\n handler: SubscriptionService['submitSponsorshipIntents'];\n};\n\n/**\n * Link rewards to a subscription.\n *\n * @param request - Request object containing the reward account ID.\n * @example { rewardAccountId: 'eip155:1:0x1234567890123456789012345678901234567890' }\n * @returns The response from the API.\n */\nexport type SubscriptionServiceLinkRewardsAction = {\n type: `SubscriptionService:linkRewards`;\n handler: SubscriptionService['linkRewards'];\n};\n\n/**\n * Fetches subscription pricing information.\n *\n * @returns The pricing response.\n */\nexport type SubscriptionServiceGetPricingAction = {\n type: `SubscriptionService:getPricing`;\n handler: SubscriptionService['getPricing'];\n};\n\n/**\n * Fetches the billing portal URL.\n *\n * @returns The billing portal response.\n */\nexport type SubscriptionServiceGetBillingPortalUrlAction = {\n type: `SubscriptionService:getBillingPortalUrl`;\n handler: SubscriptionService['getBillingPortalUrl'];\n};\n\n/**\n * Union of all SubscriptionService action types.\n */\nexport type SubscriptionServiceMethodActions =\n | SubscriptionServiceGetSubscriptionsAction\n | SubscriptionServiceCancelSubscriptionAction\n | SubscriptionServiceUnCancelSubscriptionAction\n | SubscriptionServiceStartSubscriptionWithCardAction\n | SubscriptionServiceStartSubscriptionWithCryptoAction\n | SubscriptionServiceUpdatePaymentMethodCardAction\n | SubscriptionServiceUpdatePaymentMethodCryptoAction\n | SubscriptionServiceGetSubscriptionsEligibilitiesAction\n | SubscriptionServiceSubmitUserEventAction\n | SubscriptionServiceAssignUserToCohortAction\n | SubscriptionServiceSubmitSponsorshipIntentsAction\n | SubscriptionServiceLinkRewardsAction\n | SubscriptionServiceGetPricingAction\n | SubscriptionServiceGetBillingPortalUrlAction;\n"]}
|
|
1
|
+
{"version":3,"file":"SubscriptionService-method-action-types.mjs","sourceRoot":"","sources":["../src/SubscriptionService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SubscriptionService } from './SubscriptionService.js';\n\n/**\n * Fetches the user's subscriptions.\n *\n * @returns The subscriptions response.\n */\nexport type SubscriptionServiceGetSubscriptionsAction = {\n type: `SubscriptionService:getSubscriptions`;\n handler: SubscriptionService['getSubscriptions'];\n};\n\n/**\n * Fetches the user's subscription benefits.\n *\n * @returns The benefits response.\n */\nexport type SubscriptionServiceGetBenefitsAction = {\n type: `SubscriptionService:getBenefits`;\n handler: SubscriptionService['getBenefits'];\n};\n\n/**\n * Cancels a subscription.\n *\n * @param params - The cancel subscription request.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceCancelSubscriptionAction = {\n type: `SubscriptionService:cancelSubscription`;\n handler: SubscriptionService['cancelSubscription'];\n};\n\n/**\n * Reverses a pending subscription cancellation.\n *\n * @param params - The uncancel subscription request.\n * @param params.subscriptionId - The subscription ID to uncancel.\n * @returns The updated subscription.\n */\nexport type SubscriptionServiceUnCancelSubscriptionAction = {\n type: `SubscriptionService:unCancelSubscription`;\n handler: SubscriptionService['unCancelSubscription'];\n};\n\n/**\n * Starts a card-paid subscription checkout session for the requested products\n * (e.g. Shield or Money Account Plus).\n *\n * @param request - The start subscription request.\n * @returns The checkout session response.\n */\nexport type SubscriptionServiceStartSubscriptionWithCardAction = {\n type: `SubscriptionService:startSubscriptionWithCard`;\n handler: SubscriptionService['startSubscriptionWithCard'];\n};\n\n/**\n * Starts a subscription with a crypto payment method.\n *\n * @param request - The start crypto subscription request.\n * @returns The created subscription response.\n * @throws If `products` is empty.\n * @throws If the request does not use exactly one of `rawTransaction`\n * (ERC-20 approval) or `delegationHash` (delegation).\n */\nexport type SubscriptionServiceStartSubscriptionWithCryptoAction = {\n type: `SubscriptionService:startSubscriptionWithCrypto`;\n handler: SubscriptionService['startSubscriptionWithCrypto'];\n};\n\n/**\n * Updates a subscription's card payment method.\n *\n * @param request - The update payment method request.\n * @returns The redirect URL response.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCardAction = {\n type: `SubscriptionService:updatePaymentMethodCard`;\n handler: SubscriptionService['updatePaymentMethodCard'];\n};\n\n/**\n * Updates a subscription's crypto payment method.\n *\n * @param request - The update payment method request.\n */\nexport type SubscriptionServiceUpdatePaymentMethodCryptoAction = {\n type: `SubscriptionService:updatePaymentMethodCrypto`;\n handler: SubscriptionService['updatePaymentMethodCrypto'];\n};\n\n/**\n * Get the eligibility for a shield subscription.\n *\n * @param request - Optional request object containing user balance category to check cohort eligibility\n * @returns The eligibility for a shield subscription\n */\nexport type SubscriptionServiceGetSubscriptionsEligibilitiesAction = {\n type: `SubscriptionService:getSubscriptionsEligibilities`;\n handler: SubscriptionService['getSubscriptionsEligibilities'];\n};\n\n/**\n * Submit a user event. (e.g. shield modal viewed)\n *\n * @param request - Request object containing the event to submit.\n * @example { event: SubscriptionUserEvent.ShieldEntryModalViewed, cohort: 'post_tx' }\n */\nexport type SubscriptionServiceSubmitUserEventAction = {\n type: `SubscriptionService:submitUserEvent`;\n handler: SubscriptionService['submitUserEvent'];\n};\n\n/**\n * Assign user to a cohort.\n *\n * @param request - Request object containing the cohort to assign the user to.\n * @example { cohort: 'post_tx' }\n */\nexport type SubscriptionServiceAssignUserToCohortAction = {\n type: `SubscriptionService:assignUserToCohort`;\n handler: SubscriptionService['assignUserToCohort'];\n};\n\n/**\n * Submit sponsorship intents to the Subscription Service backend.\n *\n * This is intended to be used together with the crypto subscription flow.\n * When the user has enabled the smart transaction feature, we will sponsor the gas fees for the subscription approval transaction.\n *\n * @param request - Request object containing the address and products.\n * @example { address: '0x1234567890123456789012345678901234567890', products: [ProductType.Shield] }\n */\nexport type SubscriptionServiceSubmitSponsorshipIntentsAction = {\n type: `SubscriptionService:submitSponsorshipIntents`;\n handler: SubscriptionService['submitSponsorshipIntents'];\n};\n\n/**\n * Link rewards to a subscription.\n *\n * @param request - Request object containing the reward account ID.\n * @example { rewardAccountId: 'eip155:1:0x1234567890123456789012345678901234567890' }\n * @returns The response from the API.\n */\nexport type SubscriptionServiceLinkRewardsAction = {\n type: `SubscriptionService:linkRewards`;\n handler: SubscriptionService['linkRewards'];\n};\n\n/**\n * Fetches subscription pricing information.\n *\n * @returns The pricing response.\n */\nexport type SubscriptionServiceGetPricingAction = {\n type: `SubscriptionService:getPricing`;\n handler: SubscriptionService['getPricing'];\n};\n\n/**\n * Fetches the billing portal URL.\n *\n * @returns The billing portal response.\n */\nexport type SubscriptionServiceGetBillingPortalUrlAction = {\n type: `SubscriptionService:getBillingPortalUrl`;\n handler: SubscriptionService['getBillingPortalUrl'];\n};\n\n/**\n * Union of all SubscriptionService action types.\n */\nexport type SubscriptionServiceMethodActions =\n | SubscriptionServiceGetSubscriptionsAction\n | SubscriptionServiceGetBenefitsAction\n | SubscriptionServiceCancelSubscriptionAction\n | SubscriptionServiceUnCancelSubscriptionAction\n | SubscriptionServiceStartSubscriptionWithCardAction\n | SubscriptionServiceStartSubscriptionWithCryptoAction\n | SubscriptionServiceUpdatePaymentMethodCardAction\n | SubscriptionServiceUpdatePaymentMethodCryptoAction\n | SubscriptionServiceGetSubscriptionsEligibilitiesAction\n | SubscriptionServiceSubmitUserEventAction\n | SubscriptionServiceAssignUserToCohortAction\n | SubscriptionServiceSubmitSponsorshipIntentsAction\n | SubscriptionServiceLinkRewardsAction\n | SubscriptionServiceGetPricingAction\n | SubscriptionServiceGetBillingPortalUrlAction;\n"]}
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionEligibilityArrayStruct = exports.SubscriptionEligibilityStruct = exports.PricingResponseStruct = exports.SubscriptionApiGeneralResponseStruct = exports.BillingPortalResponseStruct = exports.UpdatePaymentMethodCardResponseStruct = exports.StartCryptoSubscriptionResponseStruct = exports.StartSubscriptionResponseStruct = exports.GetSubscriptionsResponseStruct = exports.SubscriptionStruct = void 0;
|
|
3
|
+
exports.SubscriptionEligibilityArrayStruct = exports.SubscriptionEligibilityStruct = exports.PricingResponseStruct = exports.SubscriptionApiGeneralResponseStruct = exports.BillingPortalResponseStruct = exports.UpdatePaymentMethodCardResponseStruct = exports.StartCryptoSubscriptionResponseStruct = exports.StartSubscriptionResponseStruct = exports.SubscriptionBenefitsResponseStruct = exports.GetSubscriptionsResponseStruct = exports.SubscriptionStruct = void 0;
|
|
4
4
|
const superstruct_1 = require("@metamask/superstruct");
|
|
5
5
|
const utils_1 = require("@metamask/utils");
|
|
6
6
|
const types_js_1 = require("./types.cjs");
|
|
7
7
|
const ProductTypeStruct = (0, superstruct_1.enums)(Object.values(types_js_1.PRODUCT_TYPES));
|
|
8
8
|
const CryptoAuthMethodStruct = (0, superstruct_1.enums)(Object.values(types_js_1.CRYPTO_AUTH_METHODS));
|
|
9
|
+
const ShieldEntitlementsStruct = (0, superstruct_1.type)({
|
|
10
|
+
[types_js_1.ShieldFeature.ShieldClaim]: (0, superstruct_1.boolean)(),
|
|
11
|
+
[types_js_1.ShieldFeature.PrioritySupport]: (0, superstruct_1.boolean)(),
|
|
12
|
+
});
|
|
13
|
+
const MoneyAccountEntitlementsStruct = (0, superstruct_1.type)({
|
|
14
|
+
[types_js_1.MoneyAccountFeature.SwapFeeWaiver]: (0, superstruct_1.boolean)(),
|
|
15
|
+
[types_js_1.MoneyAccountFeature.PerpsFeeWaiver]: (0, superstruct_1.boolean)(),
|
|
16
|
+
[types_js_1.MoneyAccountFeature.PredictFreeTx]: (0, superstruct_1.boolean)(),
|
|
17
|
+
[types_js_1.MoneyAccountFeature.PremiumApy]: (0, superstruct_1.boolean)(),
|
|
18
|
+
});
|
|
19
|
+
const ProductEntitlementsStruct = (0, superstruct_1.type)({
|
|
20
|
+
[types_js_1.PRODUCT_TYPES.SHIELD]: (0, superstruct_1.optional)((0, superstruct_1.type)({
|
|
21
|
+
entitlements: ShieldEntitlementsStruct,
|
|
22
|
+
})),
|
|
23
|
+
[types_js_1.PRODUCT_TYPES.MONEY_ACCOUNT_PLUS]: (0, superstruct_1.optional)((0, superstruct_1.type)({
|
|
24
|
+
plan: (0, superstruct_1.string)(),
|
|
25
|
+
entitlements: MoneyAccountEntitlementsStruct,
|
|
26
|
+
})),
|
|
27
|
+
});
|
|
9
28
|
const RecurringIntervalStruct = (0, superstruct_1.enums)(Object.values(types_js_1.RECURRING_INTERVALS));
|
|
10
29
|
const SubscriptionStatusStruct = (0, superstruct_1.enums)(Object.values(types_js_1.SUBSCRIPTION_STATUSES));
|
|
11
30
|
const CancelTypeStruct = (0, superstruct_1.enums)(Object.values(types_js_1.CANCEL_TYPES));
|
|
@@ -60,9 +79,41 @@ exports.GetSubscriptionsResponseStruct = (0, superstruct_1.type)({
|
|
|
60
79
|
customerId: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
61
80
|
subscriptions: (0, superstruct_1.array)(exports.SubscriptionStruct),
|
|
62
81
|
trialedProducts: (0, superstruct_1.array)(ProductTypeStruct),
|
|
82
|
+
productEntitlements: (0, superstruct_1.optional)(ProductEntitlementsStruct),
|
|
63
83
|
lastSubscription: (0, superstruct_1.optional)(exports.SubscriptionStruct),
|
|
64
84
|
rewardAccountId: (0, superstruct_1.optional)(utils_1.CaipAccountIdStruct),
|
|
65
85
|
});
|
|
86
|
+
const SwapsBenefitUsageStruct = (0, superstruct_1.type)({
|
|
87
|
+
feeBips: (0, superstruct_1.nullable)((0, superstruct_1.string)()),
|
|
88
|
+
capMicroUsd: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
89
|
+
consumedMicroUsd: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
90
|
+
remainingMicroUsd: (0, superstruct_1.nullable)((0, superstruct_1.number)()),
|
|
91
|
+
exhausted: (0, superstruct_1.boolean)(),
|
|
92
|
+
});
|
|
93
|
+
const PerpsBenefitUsageStruct = (0, superstruct_1.type)({
|
|
94
|
+
builderFeeBips: (0, superstruct_1.nullable)((0, superstruct_1.string)()),
|
|
95
|
+
builderCode: (0, superstruct_1.nullable)((0, superstruct_1.string)()),
|
|
96
|
+
capMicroUsd: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
97
|
+
consumedMicroUsd: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
98
|
+
remainingMicroUsd: (0, superstruct_1.nullable)((0, superstruct_1.number)()),
|
|
99
|
+
exhausted: (0, superstruct_1.boolean)(),
|
|
100
|
+
});
|
|
101
|
+
const PredictBenefitUsageStruct = (0, superstruct_1.type)({
|
|
102
|
+
builderCode: (0, superstruct_1.nullable)((0, superstruct_1.string)()),
|
|
103
|
+
capTxCount: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
104
|
+
consumedTxCount: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
105
|
+
remainingTxCount: (0, superstruct_1.nullable)((0, superstruct_1.number)()),
|
|
106
|
+
exhausted: (0, superstruct_1.boolean)(),
|
|
107
|
+
});
|
|
108
|
+
exports.SubscriptionBenefitsResponseStruct = (0, superstruct_1.type)({
|
|
109
|
+
eligible: (0, superstruct_1.boolean)(),
|
|
110
|
+
billingPeriodId: (0, superstruct_1.nullable)((0, superstruct_1.string)()),
|
|
111
|
+
products: (0, superstruct_1.type)({
|
|
112
|
+
swaps: SwapsBenefitUsageStruct,
|
|
113
|
+
perps: PerpsBenefitUsageStruct,
|
|
114
|
+
predict: PredictBenefitUsageStruct,
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
66
117
|
exports.StartSubscriptionResponseStruct = (0, superstruct_1.type)({
|
|
67
118
|
checkoutSessionUrl: (0, superstruct_1.string)(),
|
|
68
119
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-structs.cjs","sourceRoot":"","sources":["../src/SubscriptionService-structs.ts"],"names":[],"mappings":";;;AAAA,uDAa+B;AAE/B,2CAAuE;AAEvE,0CAQoB;AAGpB,MAAM,iBAAiB,GAAG,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,wBAAa,CAAC,CAAC,CAAC;AAC9D,MAAM,sBAAsB,GAAG,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,8BAAmB,CAAC,CAAC,CAAC;AACzE,MAAM,uBAAuB,GAAG,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,8BAAmB,CAAC,CAAC,CAAC;AAC1E,MAAM,wBAAwB,GAAG,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,gCAAqB,CAAC,CAAC,CAAC;AAC7E,MAAM,gBAAgB,GAAG,IAAA,mBAAK,EAAC,M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qBAAO,GAAE,CAAC;CAC9C,CAAC,CAAC;AAEU,QAAA,kCAAkC,GAAG,IAAA,mBAAK,EACrD,qCAA6B,CAC9B,CAAC","sourcesContent":["import {\n array,\n boolean,\n enums,\n lazy,\n literal,\n nullable,\n number,\n object,\n optional,\n string,\n type,\n union,\n} from '@metamask/superstruct';\nimport type { Struct } from '@metamask/superstruct';\nimport { StrictHexStruct, CaipAccountIdStruct } from '@metamask/utils';\n\nimport {\n CANCEL_TYPES,\n CRYPTO_AUTH_METHODS,\n CRYPTO_PAYMENT_METHOD_ERRORS,\n PAYMENT_TYPES,\n PRODUCT_TYPES,\n RECURRING_INTERVALS,\n SUBSCRIPTION_STATUSES,\n} from './types.js';\nimport type { TokenPaymentInfo } from './types.js';\n\nconst ProductTypeStruct = enums(Object.values(PRODUCT_TYPES));\nconst CryptoAuthMethodStruct = enums(Object.values(CRYPTO_AUTH_METHODS));\nconst RecurringIntervalStruct = enums(Object.values(RECURRING_INTERVALS));\nconst SubscriptionStatusStruct = enums(Object.values(SUBSCRIPTION_STATUSES));\nconst CancelTypeStruct = enums(Object.values(CANCEL_TYPES));\nconst CryptoPaymentMethodErrorStruct = enums(\n Object.values(CRYPTO_PAYMENT_METHOD_ERRORS),\n);\n\nconst ProductStruct = type({\n name: ProductTypeStruct,\n currency: enums(['usd']),\n unitAmount: number(),\n unitDecimals: number(),\n});\n\nconst SubscriptionCardPaymentMethodStruct = type({\n type: enums([PAYMENT_TYPES.byCard]),\n card: type({\n brand: string(),\n displayBrand: string(),\n last4: string(),\n }),\n});\n\nconst SubscriptionCryptoPaymentMethodStruct = type({\n type: enums([PAYMENT_TYPES.byCrypto]),\n crypto: type({\n payerAddress: StrictHexStruct,\n chainId: StrictHexStruct,\n tokenSymbol: string(),\n error: optional(CryptoPaymentMethodErrorStruct),\n }),\n});\n\nconst SubscriptionPaymentMethodStruct = union([\n SubscriptionCardPaymentMethodStruct,\n SubscriptionCryptoPaymentMethodStruct,\n]);\n\nexport const SubscriptionStruct = type({\n id: string(),\n products: array(ProductStruct),\n currentPeriodStart: string(),\n currentPeriodEnd: string(),\n cancelAtPeriodEnd: optional(boolean()),\n status: SubscriptionStatusStruct,\n interval: RecurringIntervalStruct,\n paymentMethod: SubscriptionPaymentMethodStruct,\n trialPeriodDays: optional(number()),\n trialStart: optional(string()),\n trialEnd: optional(string()),\n endDate: optional(string()),\n canceledAt: optional(string()),\n cancelType: CancelTypeStruct,\n inactiveAt: optional(string()),\n isEligibleForSupport: boolean(),\n billingCycles: optional(number()),\n});\n\nexport const GetSubscriptionsResponseStruct = type({\n customerId: optional(string()),\n subscriptions: array(SubscriptionStruct),\n trialedProducts: array(ProductTypeStruct),\n lastSubscription: optional(SubscriptionStruct),\n rewardAccountId: optional(CaipAccountIdStruct),\n});\n\nexport const StartSubscriptionResponseStruct = type({\n checkoutSessionUrl: string(),\n});\n\nexport const StartCryptoSubscriptionResponseStruct = type({\n subscriptionId: string(),\n status: SubscriptionStatusStruct,\n});\n\nexport const UpdatePaymentMethodCardResponseStruct = type({\n redirectUrl: string(),\n});\n\nexport const BillingPortalResponseStruct = type({\n url: string(),\n});\n\nexport const SubscriptionApiGeneralResponseStruct = type({\n success: boolean(),\n message: optional(string()),\n});\n\nconst ProductPriceStruct = type({\n interval: RecurringIntervalStruct,\n unitAmount: number(),\n unitDecimals: number(),\n currency: enums(['usd']),\n trialPeriodDays: number(),\n minBillingCycles: number(),\n minBillingCyclesForBalance: number(),\n});\n\nconst ProductPricingStruct = type({\n name: ProductTypeStruct,\n prices: array(ProductPriceStruct),\n});\n\nconst TokenPaymentInfoConversionRateStruct = type({\n usd: string(),\n});\n\nconst TokenPaymentInfoStruct: Struct<TokenPaymentInfo> = lazy(() =>\n union([\n object({\n symbol: string(),\n address: StrictHexStruct,\n decimals: number(),\n conversionRate: optional(TokenPaymentInfoConversionRateStruct),\n isVaultShare: literal(true),\n accountantAddress: StrictHexStruct,\n sources: optional(array(TokenPaymentInfoStruct)),\n }),\n object({\n symbol: string(),\n address: StrictHexStruct,\n decimals: number(),\n conversionRate: optional(TokenPaymentInfoConversionRateStruct),\n isVaultShare: optional(literal(false)),\n sources: optional(array(TokenPaymentInfoStruct)),\n }),\n ]),\n) as Struct<TokenPaymentInfo>;\n\nconst ChainPaymentInfoStruct = type({\n chainId: StrictHexStruct,\n paymentAddress: StrictHexStruct,\n delegateAddress: optional(StrictHexStruct),\n tokens: array(TokenPaymentInfoStruct),\n isSponsorshipSupported: optional(boolean()),\n});\n\nconst PricingPaymentMethodStruct = union([\n object({\n type: enums([PAYMENT_TYPES.byCard]),\n products: optional(array(ProductTypeStruct)),\n }),\n object({\n type: enums([PAYMENT_TYPES.byCrypto]),\n cryptoAuthMethod: optional(CryptoAuthMethodStruct),\n products: optional(array(ProductTypeStruct)),\n chains: optional(array(ChainPaymentInfoStruct)),\n }),\n]);\n\nexport const PricingResponseStruct = type({\n products: array(ProductPricingStruct),\n paymentMethods: array(PricingPaymentMethodStruct),\n});\n\nconst CohortStruct = type({\n cohort: string(),\n eligibilityRate: number(),\n priority: number(),\n eligible: boolean(),\n});\n\nexport const SubscriptionEligibilityStruct = type({\n product: ProductTypeStruct,\n canSubscribe: optional(boolean()),\n canViewEntryModal: optional(boolean()),\n modalType: optional(enums(['A', 'B'])),\n cohorts: optional(array(CohortStruct)),\n assignedCohort: optional(nullable(string())),\n assignedAt: optional(string()),\n hasAssignedCohortExpired: optional(boolean()),\n});\n\nexport const SubscriptionEligibilityArrayStruct = array(\n SubscriptionEligibilityStruct,\n);\n"]}
|
|
1
|
+
{"version":3,"file":"SubscriptionService-structs.cjs","sourceRoot":"","sources":["../src/SubscriptionService-structs.ts"],"names":[],"mappings":";;;AAAA,uDAa+B;AAE/B,2CAAuE;AAEvE,0CAUoB;AAGpB,MAAM,iBAAiB,GAAG,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,wBAAa,CAAC,CAAC,CAAC;AAC9D,MAAM,sBAAsB,GAAG,IAAA,mBAAK,EAAC,MAAM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EAAE,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,CAAC;IAC5C,UAAU,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC9B,wBAAwB,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;CAC9C,CAAC,CAAC;AAEU,QAAA,kCAAkC,GAAG,IAAA,mBAAK,EACrD,qCAA6B,CAC9B,CAAC","sourcesContent":["import {\n array,\n boolean,\n enums,\n lazy,\n literal,\n nullable,\n number,\n object,\n optional,\n string,\n type,\n union,\n} from '@metamask/superstruct';\nimport type { Struct } from '@metamask/superstruct';\nimport { StrictHexStruct, CaipAccountIdStruct } from '@metamask/utils';\n\nimport {\n CANCEL_TYPES,\n CRYPTO_AUTH_METHODS,\n CRYPTO_PAYMENT_METHOD_ERRORS,\n PAYMENT_TYPES,\n PRODUCT_TYPES,\n RECURRING_INTERVALS,\n MoneyAccountFeature,\n ShieldFeature,\n SUBSCRIPTION_STATUSES,\n} from './types.js';\nimport type { TokenPaymentInfo } from './types.js';\n\nconst ProductTypeStruct = enums(Object.values(PRODUCT_TYPES));\nconst CryptoAuthMethodStruct = enums(Object.values(CRYPTO_AUTH_METHODS));\nconst ShieldEntitlementsStruct = type({\n [ShieldFeature.ShieldClaim]: boolean(),\n [ShieldFeature.PrioritySupport]: boolean(),\n});\nconst MoneyAccountEntitlementsStruct = type({\n [MoneyAccountFeature.SwapFeeWaiver]: boolean(),\n [MoneyAccountFeature.PerpsFeeWaiver]: boolean(),\n [MoneyAccountFeature.PredictFreeTx]: boolean(),\n [MoneyAccountFeature.PremiumApy]: boolean(),\n});\nconst ProductEntitlementsStruct = type({\n [PRODUCT_TYPES.SHIELD]: optional(\n type({\n entitlements: ShieldEntitlementsStruct,\n }),\n ),\n [PRODUCT_TYPES.MONEY_ACCOUNT_PLUS]: optional(\n type({\n plan: string(),\n entitlements: MoneyAccountEntitlementsStruct,\n }),\n ),\n});\nconst RecurringIntervalStruct = enums(Object.values(RECURRING_INTERVALS));\nconst SubscriptionStatusStruct = enums(Object.values(SUBSCRIPTION_STATUSES));\nconst CancelTypeStruct = enums(Object.values(CANCEL_TYPES));\nconst CryptoPaymentMethodErrorStruct = enums(\n Object.values(CRYPTO_PAYMENT_METHOD_ERRORS),\n);\n\nconst ProductStruct = type({\n name: ProductTypeStruct,\n currency: enums(['usd']),\n unitAmount: number(),\n unitDecimals: number(),\n});\n\nconst SubscriptionCardPaymentMethodStruct = type({\n type: enums([PAYMENT_TYPES.byCard]),\n card: type({\n brand: string(),\n displayBrand: string(),\n last4: string(),\n }),\n});\n\nconst SubscriptionCryptoPaymentMethodStruct = type({\n type: enums([PAYMENT_TYPES.byCrypto]),\n crypto: type({\n payerAddress: StrictHexStruct,\n chainId: StrictHexStruct,\n tokenSymbol: string(),\n error: optional(CryptoPaymentMethodErrorStruct),\n }),\n});\n\nconst SubscriptionPaymentMethodStruct = union([\n SubscriptionCardPaymentMethodStruct,\n SubscriptionCryptoPaymentMethodStruct,\n]);\n\nexport const SubscriptionStruct = type({\n id: string(),\n products: array(ProductStruct),\n currentPeriodStart: string(),\n currentPeriodEnd: string(),\n cancelAtPeriodEnd: optional(boolean()),\n status: SubscriptionStatusStruct,\n interval: RecurringIntervalStruct,\n paymentMethod: SubscriptionPaymentMethodStruct,\n trialPeriodDays: optional(number()),\n trialStart: optional(string()),\n trialEnd: optional(string()),\n endDate: optional(string()),\n canceledAt: optional(string()),\n cancelType: CancelTypeStruct,\n inactiveAt: optional(string()),\n isEligibleForSupport: boolean(),\n billingCycles: optional(number()),\n});\n\nexport const GetSubscriptionsResponseStruct = type({\n customerId: optional(string()),\n subscriptions: array(SubscriptionStruct),\n trialedProducts: array(ProductTypeStruct),\n productEntitlements: optional(ProductEntitlementsStruct),\n lastSubscription: optional(SubscriptionStruct),\n rewardAccountId: optional(CaipAccountIdStruct),\n});\n\nconst SwapsBenefitUsageStruct = type({\n feeBips: nullable(string()),\n capMicroUsd: optional(number()),\n consumedMicroUsd: optional(number()),\n remainingMicroUsd: nullable(number()),\n exhausted: boolean(),\n});\n\nconst PerpsBenefitUsageStruct = type({\n builderFeeBips: nullable(string()),\n builderCode: nullable(string()),\n capMicroUsd: optional(number()),\n consumedMicroUsd: optional(number()),\n remainingMicroUsd: nullable(number()),\n exhausted: boolean(),\n});\n\nconst PredictBenefitUsageStruct = type({\n builderCode: nullable(string()),\n capTxCount: optional(number()),\n consumedTxCount: optional(number()),\n remainingTxCount: nullable(number()),\n exhausted: boolean(),\n});\n\nexport const SubscriptionBenefitsResponseStruct = type({\n eligible: boolean(),\n billingPeriodId: nullable(string()),\n products: type({\n swaps: SwapsBenefitUsageStruct,\n perps: PerpsBenefitUsageStruct,\n predict: PredictBenefitUsageStruct,\n }),\n});\n\nexport const StartSubscriptionResponseStruct = type({\n checkoutSessionUrl: string(),\n});\n\nexport const StartCryptoSubscriptionResponseStruct = type({\n subscriptionId: string(),\n status: SubscriptionStatusStruct,\n});\n\nexport const UpdatePaymentMethodCardResponseStruct = type({\n redirectUrl: string(),\n});\n\nexport const BillingPortalResponseStruct = type({\n url: string(),\n});\n\nexport const SubscriptionApiGeneralResponseStruct = type({\n success: boolean(),\n message: optional(string()),\n});\n\nconst ProductPriceStruct = type({\n interval: RecurringIntervalStruct,\n unitAmount: number(),\n unitDecimals: number(),\n currency: enums(['usd']),\n trialPeriodDays: number(),\n minBillingCycles: number(),\n minBillingCyclesForBalance: number(),\n});\n\nconst ProductPricingStruct = type({\n name: ProductTypeStruct,\n prices: array(ProductPriceStruct),\n});\n\nconst TokenPaymentInfoConversionRateStruct = type({\n usd: string(),\n});\n\nconst TokenPaymentInfoStruct: Struct<TokenPaymentInfo> = lazy(() =>\n union([\n object({\n symbol: string(),\n address: StrictHexStruct,\n decimals: number(),\n conversionRate: optional(TokenPaymentInfoConversionRateStruct),\n isVaultShare: literal(true),\n accountantAddress: StrictHexStruct,\n sources: optional(array(TokenPaymentInfoStruct)),\n }),\n object({\n symbol: string(),\n address: StrictHexStruct,\n decimals: number(),\n conversionRate: optional(TokenPaymentInfoConversionRateStruct),\n isVaultShare: optional(literal(false)),\n sources: optional(array(TokenPaymentInfoStruct)),\n }),\n ]),\n) as Struct<TokenPaymentInfo>;\n\nconst ChainPaymentInfoStruct = type({\n chainId: StrictHexStruct,\n paymentAddress: StrictHexStruct,\n delegateAddress: optional(StrictHexStruct),\n tokens: array(TokenPaymentInfoStruct),\n isSponsorshipSupported: optional(boolean()),\n});\n\nconst PricingPaymentMethodStruct = union([\n object({\n type: enums([PAYMENT_TYPES.byCard]),\n products: optional(array(ProductTypeStruct)),\n }),\n object({\n type: enums([PAYMENT_TYPES.byCrypto]),\n cryptoAuthMethod: optional(CryptoAuthMethodStruct),\n products: optional(array(ProductTypeStruct)),\n chains: optional(array(ChainPaymentInfoStruct)),\n }),\n]);\n\nexport const PricingResponseStruct = type({\n products: array(ProductPricingStruct),\n paymentMethods: array(PricingPaymentMethodStruct),\n});\n\nconst CohortStruct = type({\n cohort: string(),\n eligibilityRate: number(),\n priority: number(),\n eligible: boolean(),\n});\n\nexport const SubscriptionEligibilityStruct = type({\n product: ProductTypeStruct,\n canSubscribe: optional(boolean()),\n canViewEntryModal: optional(boolean()),\n modalType: optional(enums(['A', 'B'])),\n cohorts: optional(array(CohortStruct)),\n assignedCohort: optional(nullable(string())),\n assignedAt: optional(string()),\n hasAssignedCohortExpired: optional(boolean()),\n});\n\nexport const SubscriptionEligibilityArrayStruct = array(\n SubscriptionEligibilityStruct,\n);\n"]}
|
|
@@ -152,6 +152,23 @@ export declare const GetSubscriptionsResponseStruct: Struct<{
|
|
|
152
152
|
}[];
|
|
153
153
|
trialedProducts: ("shield" | "money_account_plus")[];
|
|
154
154
|
customerId?: string | undefined;
|
|
155
|
+
productEntitlements?: {
|
|
156
|
+
shield?: {
|
|
157
|
+
entitlements: {
|
|
158
|
+
shieldClaim: boolean;
|
|
159
|
+
prioritySupport: boolean;
|
|
160
|
+
};
|
|
161
|
+
} | undefined;
|
|
162
|
+
money_account_plus?: {
|
|
163
|
+
entitlements: {
|
|
164
|
+
swapFeeWaiver: boolean;
|
|
165
|
+
perpsFeeWaiver: boolean;
|
|
166
|
+
predictFreeTx: boolean;
|
|
167
|
+
premiumApy: boolean;
|
|
168
|
+
};
|
|
169
|
+
plan: string;
|
|
170
|
+
} | undefined;
|
|
171
|
+
} | undefined;
|
|
155
172
|
lastSubscription?: {
|
|
156
173
|
id: string;
|
|
157
174
|
products: {
|
|
@@ -346,6 +363,60 @@ export declare const GetSubscriptionsResponseStruct: Struct<{
|
|
|
346
363
|
shield: "shield";
|
|
347
364
|
money_account_plus: "money_account_plus";
|
|
348
365
|
}>>;
|
|
366
|
+
productEntitlements: Struct<{
|
|
367
|
+
shield?: {
|
|
368
|
+
entitlements: {
|
|
369
|
+
shieldClaim: boolean;
|
|
370
|
+
prioritySupport: boolean;
|
|
371
|
+
};
|
|
372
|
+
} | undefined;
|
|
373
|
+
money_account_plus?: {
|
|
374
|
+
entitlements: {
|
|
375
|
+
swapFeeWaiver: boolean;
|
|
376
|
+
perpsFeeWaiver: boolean;
|
|
377
|
+
predictFreeTx: boolean;
|
|
378
|
+
premiumApy: boolean;
|
|
379
|
+
};
|
|
380
|
+
plan: string;
|
|
381
|
+
} | undefined;
|
|
382
|
+
} | undefined, {
|
|
383
|
+
shield: Struct<{
|
|
384
|
+
entitlements: {
|
|
385
|
+
shieldClaim: boolean;
|
|
386
|
+
prioritySupport: boolean;
|
|
387
|
+
};
|
|
388
|
+
} | undefined, {
|
|
389
|
+
entitlements: Struct<{
|
|
390
|
+
shieldClaim: boolean;
|
|
391
|
+
prioritySupport: boolean;
|
|
392
|
+
}, {
|
|
393
|
+
shieldClaim: Struct<boolean, null>;
|
|
394
|
+
prioritySupport: Struct<boolean, null>;
|
|
395
|
+
}>;
|
|
396
|
+
}>;
|
|
397
|
+
money_account_plus: Struct<{
|
|
398
|
+
entitlements: {
|
|
399
|
+
swapFeeWaiver: boolean;
|
|
400
|
+
perpsFeeWaiver: boolean;
|
|
401
|
+
predictFreeTx: boolean;
|
|
402
|
+
premiumApy: boolean;
|
|
403
|
+
};
|
|
404
|
+
plan: string;
|
|
405
|
+
} | undefined, {
|
|
406
|
+
plan: Struct<string, null>;
|
|
407
|
+
entitlements: Struct<{
|
|
408
|
+
swapFeeWaiver: boolean;
|
|
409
|
+
perpsFeeWaiver: boolean;
|
|
410
|
+
predictFreeTx: boolean;
|
|
411
|
+
premiumApy: boolean;
|
|
412
|
+
}, {
|
|
413
|
+
swapFeeWaiver: Struct<boolean, null>;
|
|
414
|
+
perpsFeeWaiver: Struct<boolean, null>;
|
|
415
|
+
predictFreeTx: Struct<boolean, null>;
|
|
416
|
+
premiumApy: Struct<boolean, null>;
|
|
417
|
+
}>;
|
|
418
|
+
}>;
|
|
419
|
+
}>;
|
|
349
420
|
lastSubscription: Struct<{
|
|
350
421
|
id: string;
|
|
351
422
|
products: {
|
|
@@ -458,6 +529,103 @@ export declare const GetSubscriptionsResponseStruct: Struct<{
|
|
|
458
529
|
}>;
|
|
459
530
|
rewardAccountId: Struct<`${string}:${string}:${string}` | undefined, null>;
|
|
460
531
|
}>;
|
|
532
|
+
export declare const SubscriptionBenefitsResponseStruct: Struct<{
|
|
533
|
+
products: {
|
|
534
|
+
swaps: {
|
|
535
|
+
feeBips: string | null;
|
|
536
|
+
remainingMicroUsd: number | null;
|
|
537
|
+
exhausted: boolean;
|
|
538
|
+
capMicroUsd?: number | undefined;
|
|
539
|
+
consumedMicroUsd?: number | undefined;
|
|
540
|
+
};
|
|
541
|
+
perps: {
|
|
542
|
+
remainingMicroUsd: number | null;
|
|
543
|
+
exhausted: boolean;
|
|
544
|
+
builderFeeBips: string | null;
|
|
545
|
+
builderCode: string | null;
|
|
546
|
+
capMicroUsd?: number | undefined;
|
|
547
|
+
consumedMicroUsd?: number | undefined;
|
|
548
|
+
};
|
|
549
|
+
predict: {
|
|
550
|
+
exhausted: boolean;
|
|
551
|
+
builderCode: string | null;
|
|
552
|
+
remainingTxCount: number | null;
|
|
553
|
+
capTxCount?: number | undefined;
|
|
554
|
+
consumedTxCount?: number | undefined;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
eligible: boolean;
|
|
558
|
+
billingPeriodId: string | null;
|
|
559
|
+
}, {
|
|
560
|
+
eligible: Struct<boolean, null>;
|
|
561
|
+
billingPeriodId: Struct<string | null, null>;
|
|
562
|
+
products: Struct<{
|
|
563
|
+
swaps: {
|
|
564
|
+
feeBips: string | null;
|
|
565
|
+
remainingMicroUsd: number | null;
|
|
566
|
+
exhausted: boolean;
|
|
567
|
+
capMicroUsd?: number | undefined;
|
|
568
|
+
consumedMicroUsd?: number | undefined;
|
|
569
|
+
};
|
|
570
|
+
perps: {
|
|
571
|
+
remainingMicroUsd: number | null;
|
|
572
|
+
exhausted: boolean;
|
|
573
|
+
builderFeeBips: string | null;
|
|
574
|
+
builderCode: string | null;
|
|
575
|
+
capMicroUsd?: number | undefined;
|
|
576
|
+
consumedMicroUsd?: number | undefined;
|
|
577
|
+
};
|
|
578
|
+
predict: {
|
|
579
|
+
exhausted: boolean;
|
|
580
|
+
builderCode: string | null;
|
|
581
|
+
remainingTxCount: number | null;
|
|
582
|
+
capTxCount?: number | undefined;
|
|
583
|
+
consumedTxCount?: number | undefined;
|
|
584
|
+
};
|
|
585
|
+
}, {
|
|
586
|
+
swaps: Struct<{
|
|
587
|
+
feeBips: string | null;
|
|
588
|
+
remainingMicroUsd: number | null;
|
|
589
|
+
exhausted: boolean;
|
|
590
|
+
capMicroUsd?: number | undefined;
|
|
591
|
+
consumedMicroUsd?: number | undefined;
|
|
592
|
+
}, {
|
|
593
|
+
feeBips: Struct<string | null, null>;
|
|
594
|
+
capMicroUsd: Struct<number | undefined, null>;
|
|
595
|
+
consumedMicroUsd: Struct<number | undefined, null>;
|
|
596
|
+
remainingMicroUsd: Struct<number | null, null>;
|
|
597
|
+
exhausted: Struct<boolean, null>;
|
|
598
|
+
}>;
|
|
599
|
+
perps: Struct<{
|
|
600
|
+
remainingMicroUsd: number | null;
|
|
601
|
+
exhausted: boolean;
|
|
602
|
+
builderFeeBips: string | null;
|
|
603
|
+
builderCode: string | null;
|
|
604
|
+
capMicroUsd?: number | undefined;
|
|
605
|
+
consumedMicroUsd?: number | undefined;
|
|
606
|
+
}, {
|
|
607
|
+
builderFeeBips: Struct<string | null, null>;
|
|
608
|
+
builderCode: Struct<string | null, null>;
|
|
609
|
+
capMicroUsd: Struct<number | undefined, null>;
|
|
610
|
+
consumedMicroUsd: Struct<number | undefined, null>;
|
|
611
|
+
remainingMicroUsd: Struct<number | null, null>;
|
|
612
|
+
exhausted: Struct<boolean, null>;
|
|
613
|
+
}>;
|
|
614
|
+
predict: Struct<{
|
|
615
|
+
exhausted: boolean;
|
|
616
|
+
builderCode: string | null;
|
|
617
|
+
remainingTxCount: number | null;
|
|
618
|
+
capTxCount?: number | undefined;
|
|
619
|
+
consumedTxCount?: number | undefined;
|
|
620
|
+
}, {
|
|
621
|
+
builderCode: Struct<string | null, null>;
|
|
622
|
+
capTxCount: Struct<number | undefined, null>;
|
|
623
|
+
consumedTxCount: Struct<number | undefined, null>;
|
|
624
|
+
remainingTxCount: Struct<number | null, null>;
|
|
625
|
+
exhausted: Struct<boolean, null>;
|
|
626
|
+
}>;
|
|
627
|
+
}>;
|
|
628
|
+
}>;
|
|
461
629
|
export declare const StartSubscriptionResponseStruct: Struct<{
|
|
462
630
|
checkoutSessionUrl: string;
|
|
463
631
|
}, {
|
|
@@ -620,10 +788,10 @@ export declare const SubscriptionEligibilityStruct: Struct<{
|
|
|
620
788
|
canViewEntryModal?: boolean | undefined;
|
|
621
789
|
modalType?: "A" | "B" | undefined;
|
|
622
790
|
cohorts?: {
|
|
791
|
+
eligible: boolean;
|
|
623
792
|
cohort: string;
|
|
624
793
|
eligibilityRate: number;
|
|
625
794
|
priority: number;
|
|
626
|
-
eligible: boolean;
|
|
627
795
|
}[] | undefined;
|
|
628
796
|
assignedCohort?: string | null | undefined;
|
|
629
797
|
assignedAt?: string | undefined;
|
|
@@ -640,15 +808,15 @@ export declare const SubscriptionEligibilityStruct: Struct<{
|
|
|
640
808
|
B: "B";
|
|
641
809
|
}>;
|
|
642
810
|
cohorts: Struct<{
|
|
811
|
+
eligible: boolean;
|
|
643
812
|
cohort: string;
|
|
644
813
|
eligibilityRate: number;
|
|
645
814
|
priority: number;
|
|
646
|
-
eligible: boolean;
|
|
647
815
|
}[] | undefined, Struct<{
|
|
816
|
+
eligible: boolean;
|
|
648
817
|
cohort: string;
|
|
649
818
|
eligibilityRate: number;
|
|
650
819
|
priority: number;
|
|
651
|
-
eligible: boolean;
|
|
652
820
|
}, {
|
|
653
821
|
cohort: Struct<string, null>;
|
|
654
822
|
eligibilityRate: Struct<number, null>;
|
|
@@ -665,10 +833,10 @@ export declare const SubscriptionEligibilityArrayStruct: Struct<{
|
|
|
665
833
|
canViewEntryModal?: boolean | undefined;
|
|
666
834
|
modalType?: "A" | "B" | undefined;
|
|
667
835
|
cohorts?: {
|
|
836
|
+
eligible: boolean;
|
|
668
837
|
cohort: string;
|
|
669
838
|
eligibilityRate: number;
|
|
670
839
|
priority: number;
|
|
671
|
-
eligible: boolean;
|
|
672
840
|
}[] | undefined;
|
|
673
841
|
assignedCohort?: string | null | undefined;
|
|
674
842
|
assignedAt?: string | undefined;
|
|
@@ -679,10 +847,10 @@ export declare const SubscriptionEligibilityArrayStruct: Struct<{
|
|
|
679
847
|
canViewEntryModal?: boolean | undefined;
|
|
680
848
|
modalType?: "A" | "B" | undefined;
|
|
681
849
|
cohorts?: {
|
|
850
|
+
eligible: boolean;
|
|
682
851
|
cohort: string;
|
|
683
852
|
eligibilityRate: number;
|
|
684
853
|
priority: number;
|
|
685
|
-
eligible: boolean;
|
|
686
854
|
}[] | undefined;
|
|
687
855
|
assignedCohort?: string | null | undefined;
|
|
688
856
|
assignedAt?: string | undefined;
|
|
@@ -699,15 +867,15 @@ export declare const SubscriptionEligibilityArrayStruct: Struct<{
|
|
|
699
867
|
B: "B";
|
|
700
868
|
}>;
|
|
701
869
|
cohorts: Struct<{
|
|
870
|
+
eligible: boolean;
|
|
702
871
|
cohort: string;
|
|
703
872
|
eligibilityRate: number;
|
|
704
873
|
priority: number;
|
|
705
|
-
eligible: boolean;
|
|
706
874
|
}[] | undefined, Struct<{
|
|
875
|
+
eligible: boolean;
|
|
707
876
|
cohort: string;
|
|
708
877
|
eligibilityRate: number;
|
|
709
878
|
priority: number;
|
|
710
|
-
eligible: boolean;
|
|
711
879
|
}, {
|
|
712
880
|
cohort: Struct<string, null>;
|
|
713
881
|
eligibilityRate: Struct<number, null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionService-structs.d.cts","sourceRoot":"","sources":["../src/SubscriptionService-structs.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"SubscriptionService-structs.d.cts","sourceRoot":"","sources":["../src/SubscriptionService-structs.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAcpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAmB;AAiEnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB7B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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