@moonpay/platform-protocol 1.15.0 → 1.19.0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/apple-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Apple Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/apple-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Apple Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n /**\n * Fired when the user dismisses the native Apple Pay payment sheet without\n * completing the purchase. This is an explicit cancellation signal, distinct\n * from `error` (a failure) — the flow can simply be re-initiated.\n */\n cancelled: FrameError<'payment_sheet_dismissed'>;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -14,6 +14,12 @@ interface InboundMessageMap {
14
14
  buttonPressed: void;
15
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
16
16
  challenge: ChallengeRequired;
17
+ /**
18
+ * Fired when the user dismisses the native Apple Pay payment sheet without
19
+ * completing the purchase. This is an explicit cancellation signal, distinct
20
+ * from `error` (a failure) — the flow can simply be re-initiated.
21
+ */
22
+ cancelled: FrameError<'payment_sheet_dismissed'>;
17
23
  complete: {
18
24
  transaction: FrameTransaction;
19
25
  };
@@ -14,6 +14,12 @@ interface InboundMessageMap {
14
14
  buttonPressed: void;
15
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
16
16
  challenge: ChallengeRequired;
17
+ /**
18
+ * Fired when the user dismisses the native Apple Pay payment sheet without
19
+ * completing the purchase. This is an explicit cancellation signal, distinct
20
+ * from `error` (a failure) — the flow can simply be re-initiated.
21
+ */
22
+ cancelled: FrameError<'payment_sheet_dismissed'>;
17
23
  complete: {
18
24
  transaction: FrameTransaction;
19
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/challenge.ts"],"sourcesContent":["import type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\n/**\n * Mirrors the MoonPay API's `GuestCheckoutLimitUpgradeStatus` — a durable,\n * poll-any-time-later fact rather than a short-lived value: `upgraded` and\n * `rejected` reflect a persisted review outcome, not a transient in-progress signal.\n */\nexport type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';\n\nexport type CompleteResult =\n | { flow: 'buy'; transaction: FrameTransaction }\n | { flow: 'identity'; identityId: string }\n | { flow: 'guest_checkout_limit_upgrade'; status: GuestCheckoutLimitUpgradeStatus };\n\nexport type Cancellation =\n | { flow: 'buy'; transactionId?: string; challengeToken?: string }\n | { flow: 'identity' }\n | { flow: 'guest_checkout_limit_upgrade' };\n\n/**\n * The challenge frame is fully self-contained — it is driven by the\n * `challengeToken` URL param. There is no parent → child message map.\n */\nexport interface MessageMap {\n ready: void;\n complete: CompleteResult;\n /** User dismissed the challenge. Carry `transactionId` / `challengeToken` to resume. */\n cancelled: Cancellation;\n error: FrameError;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/challenge.ts"],"sourcesContent":["import type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\n/**\n * Mirrors the MoonPay API's `GuestCheckoutLimitUpgradeStatus` — a durable,\n * poll-any-time-later fact rather than a short-lived value: `upgraded` and\n * `rejected` reflect a persisted review outcome, not a transient in-progress signal.\n */\nexport type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';\n\nexport type CompleteResult = (\n | { flow: 'buy'; transaction: FrameTransaction }\n | { flow: 'identity'; identityId: string }\n | { flow: 'guest_checkout_limit_upgrade'; status: GuestCheckoutLimitUpgradeStatus }\n) & {\n sessionUpgraded?: true;\n};\n\nexport type Cancellation =\n | { flow: 'buy'; transactionId?: string; challengeToken?: string }\n | { flow: 'identity' }\n | { flow: 'guest_checkout_limit_upgrade' };\n\n/**\n * The challenge frame is fully self-contained — it is driven by the\n * `challengeToken` URL param. There is no parent → child message map.\n */\nexport interface MessageMap {\n ready: void;\n complete: CompleteResult;\n /** User dismissed the challenge. Carry `transactionId` / `challengeToken` to resume. */\n cancelled: Cancellation;\n error: FrameError;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -7,7 +7,7 @@ import { FrameError } from '../protocol.cjs';
7
7
  * `rejected` reflect a persisted review outcome, not a transient in-progress signal.
8
8
  */
9
9
  type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';
10
- type CompleteResult = {
10
+ type CompleteResult = ({
11
11
  flow: 'buy';
12
12
  transaction: FrameTransaction;
13
13
  } | {
@@ -16,6 +16,8 @@ type CompleteResult = {
16
16
  } | {
17
17
  flow: 'guest_checkout_limit_upgrade';
18
18
  status: GuestCheckoutLimitUpgradeStatus;
19
+ }) & {
20
+ sessionUpgraded?: true;
19
21
  };
20
22
  type Cancellation = {
21
23
  flow: 'buy';
@@ -7,7 +7,7 @@ import { FrameError } from '../protocol.js';
7
7
  * `rejected` reflect a persisted review outcome, not a transient in-progress signal.
8
8
  */
9
9
  type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';
10
- type CompleteResult = {
10
+ type CompleteResult = ({
11
11
  flow: 'buy';
12
12
  transaction: FrameTransaction;
13
13
  } | {
@@ -16,6 +16,8 @@ type CompleteResult = {
16
16
  } | {
17
17
  flow: 'guest_checkout_limit_upgrade';
18
18
  status: GuestCheckoutLimitUpgradeStatus;
19
+ }) & {
20
+ sessionUpgraded?: true;
19
21
  };
20
22
  type Cancellation = {
21
23
  flow: 'buy';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/google-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Google Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/google-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Google Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n /**\n * Fired when the user dismisses the native Google Pay payment sheet without\n * completing the purchase. This is an explicit cancellation signal, distinct\n * from `error` (a failure) — the flow can simply be re-initiated.\n */\n cancelled: FrameError<'payment_sheet_dismissed'>;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -14,6 +14,12 @@ interface InboundMessageMap {
14
14
  buttonPressed: void;
15
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
16
16
  challenge: ChallengeRequired;
17
+ /**
18
+ * Fired when the user dismisses the native Google Pay payment sheet without
19
+ * completing the purchase. This is an explicit cancellation signal, distinct
20
+ * from `error` (a failure) — the flow can simply be re-initiated.
21
+ */
22
+ cancelled: FrameError<'payment_sheet_dismissed'>;
17
23
  complete: {
18
24
  transaction: FrameTransaction;
19
25
  };
@@ -14,6 +14,12 @@ interface InboundMessageMap {
14
14
  buttonPressed: void;
15
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
16
16
  challenge: ChallengeRequired;
17
+ /**
18
+ * Fired when the user dismisses the native Google Pay payment sheet without
19
+ * completing the purchase. This is an explicit cancellation signal, distinct
20
+ * from `error` (a failure) — the flow can simply be re-initiated.
21
+ */
22
+ cancelled: FrameError<'payment_sheet_dismissed'>;
17
23
  complete: {
18
24
  transaction: FrameTransaction;
19
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdks/apple-pay.ts"],"sourcesContent":["import type * as ApplePayFrame from '../frames/apple-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: ApplePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/sdks/apple-pay.ts"],"sourcesContent":["import type * as ApplePayFrame from '../frames/apple-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: ApplePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'cancelled'; payload: ApplePayFrame.InboundMessageMap['cancelled'] }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -24,6 +24,9 @@ type Event = {
24
24
  payload: {
25
25
  setQuote: (signature: string) => void;
26
26
  };
27
+ } | {
28
+ kind: 'cancelled';
29
+ payload: InboundMessageMap['cancelled'];
27
30
  } | {
28
31
  kind: 'error';
29
32
  payload: EventError;
@@ -24,6 +24,9 @@ type Event = {
24
24
  payload: {
25
25
  setQuote: (signature: string) => void;
26
26
  };
27
+ } | {
28
+ kind: 'cancelled';
29
+ payload: InboundMessageMap['cancelled'];
27
30
  } | {
28
31
  kind: 'error';
29
32
  payload: EventError;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdks/google-pay.ts"],"sourcesContent":["import type * as GooglePayFrame from '../frames/google-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: GooglePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/sdks/google-pay.ts"],"sourcesContent":["import type * as GooglePayFrame from '../frames/google-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: GooglePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'cancelled'; payload: GooglePayFrame.InboundMessageMap['cancelled'] }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -24,6 +24,9 @@ type Event = {
24
24
  payload: {
25
25
  setQuote: (signature: string) => void;
26
26
  };
27
+ } | {
28
+ kind: 'cancelled';
29
+ payload: InboundMessageMap['cancelled'];
27
30
  } | {
28
31
  kind: 'error';
29
32
  payload: EventError;
@@ -24,6 +24,9 @@ type Event = {
24
24
  payload: {
25
25
  setQuote: (signature: string) => void;
26
26
  };
27
+ } | {
28
+ kind: 'cancelled';
29
+ payload: InboundMessageMap['cancelled'];
27
30
  } | {
28
31
  kind: 'error';
29
32
  payload: EventError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonpay/platform-protocol",
3
- "version": "1.15.0",
3
+ "version": "1.19.0",
4
4
  "description": "Shared protocol types for the MoonPay Developer Platform",
5
5
  "type": "module",
6
6
  "exports": {