@moonpay/platform-protocol 1.13.1 → 1.15.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.
@@ -124,6 +124,20 @@ type CddEmploymentStatus = 'employedOrSelfEmployed' | 'retired' | 'student' | 'u
124
124
  * The customer's primary source of wealth.
125
125
  */
126
126
  type CddSourceOfWealth = 'salary' | 'savings' | 'investments' | 'cryptoTrading' | 'other';
127
+ /**
128
+ * A challenge that must be resolved by rendering a MoonPay-hosted frame.
129
+ */
130
+ type Challenge = {
131
+ /**
132
+ * The type of challenge resolution required.
133
+ */
134
+ kind: ChallengeKind;
135
+ /**
136
+ * Fully-formed challenge frame URL. Render directly without parsing.
137
+ */
138
+ url: string;
139
+ };
140
+ type ChallengeKind = 'frame';
127
141
  /**
128
142
  * Request body for creating an identity.
129
143
  */
@@ -542,6 +556,10 @@ type GetQuoteResponse = {
542
556
  * An opaque token representing the quote to initiate payment frames.
543
557
  */
544
558
  signature: string;
559
+ /**
560
+ * A challenge the partner must surface and the customer must complete before the quote can proceed — for example, verifying identity to raise guest-checkout limits. Present only when the quote requires one; omitted otherwise.
561
+ */
562
+ challenge?: Challenge;
545
563
  };
546
564
  type IPv4Address = string;
547
565
  type IPv6Address = string;
@@ -124,6 +124,20 @@ type CddEmploymentStatus = 'employedOrSelfEmployed' | 'retired' | 'student' | 'u
124
124
  * The customer's primary source of wealth.
125
125
  */
126
126
  type CddSourceOfWealth = 'salary' | 'savings' | 'investments' | 'cryptoTrading' | 'other';
127
+ /**
128
+ * A challenge that must be resolved by rendering a MoonPay-hosted frame.
129
+ */
130
+ type Challenge = {
131
+ /**
132
+ * The type of challenge resolution required.
133
+ */
134
+ kind: ChallengeKind;
135
+ /**
136
+ * Fully-formed challenge frame URL. Render directly without parsing.
137
+ */
138
+ url: string;
139
+ };
140
+ type ChallengeKind = 'frame';
127
141
  /**
128
142
  * Request body for creating an identity.
129
143
  */
@@ -542,6 +556,10 @@ type GetQuoteResponse = {
542
556
  * An opaque token representing the quote to initiate payment frames.
543
557
  */
544
558
  signature: string;
559
+ /**
560
+ * A challenge the partner must surface and the customer must complete before the quote can proceed — for example, verifying identity to raise guest-checkout limits. Present only when the quote requires one; omitted otherwise.
561
+ */
562
+ challenge?: Challenge;
545
563
  };
546
564
  type IPv4Address = string;
547
565
  type IPv6Address = string;
@@ -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\nexport type CompleteResult =\n | { flow: 'buy'; transaction: FrameTransaction }\n | { flow: 'identity'; identityId: string };\n\nexport type Cancellation =\n | { flow: 'buy'; transactionId?: string; challengeToken?: string }\n | { flow: 'identity' };\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\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,12 +1,21 @@
1
1
  import { FrameTransaction } from '../models/transaction.cjs';
2
2
  import { FrameError } from '../protocol.cjs';
3
3
 
4
+ /**
5
+ * Mirrors the MoonPay API's `GuestCheckoutLimitUpgradeStatus` — a durable,
6
+ * poll-any-time-later fact rather than a short-lived value: `upgraded` and
7
+ * `rejected` reflect a persisted review outcome, not a transient in-progress signal.
8
+ */
9
+ type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';
4
10
  type CompleteResult = {
5
11
  flow: 'buy';
6
12
  transaction: FrameTransaction;
7
13
  } | {
8
14
  flow: 'identity';
9
15
  identityId: string;
16
+ } | {
17
+ flow: 'guest_checkout_limit_upgrade';
18
+ status: GuestCheckoutLimitUpgradeStatus;
10
19
  };
11
20
  type Cancellation = {
12
21
  flow: 'buy';
@@ -14,6 +23,8 @@ type Cancellation = {
14
23
  challengeToken?: string;
15
24
  } | {
16
25
  flow: 'identity';
26
+ } | {
27
+ flow: 'guest_checkout_limit_upgrade';
17
28
  };
18
29
  /**
19
30
  * The challenge frame is fully self-contained — it is driven by the
@@ -27,4 +38,4 @@ interface MessageMap {
27
38
  error: FrameError;
28
39
  }
29
40
 
30
- export type { Cancellation, CompleteResult, MessageMap };
41
+ export type { Cancellation, CompleteResult, GuestCheckoutLimitUpgradeStatus, MessageMap };
@@ -1,12 +1,21 @@
1
1
  import { FrameTransaction } from '../models/transaction.js';
2
2
  import { FrameError } from '../protocol.js';
3
3
 
4
+ /**
5
+ * Mirrors the MoonPay API's `GuestCheckoutLimitUpgradeStatus` — a durable,
6
+ * poll-any-time-later fact rather than a short-lived value: `upgraded` and
7
+ * `rejected` reflect a persisted review outcome, not a transient in-progress signal.
8
+ */
9
+ type GuestCheckoutLimitUpgradeStatus = 'pending' | 'upgraded' | 'rejected';
4
10
  type CompleteResult = {
5
11
  flow: 'buy';
6
12
  transaction: FrameTransaction;
7
13
  } | {
8
14
  flow: 'identity';
9
15
  identityId: string;
16
+ } | {
17
+ flow: 'guest_checkout_limit_upgrade';
18
+ status: GuestCheckoutLimitUpgradeStatus;
10
19
  };
11
20
  type Cancellation = {
12
21
  flow: 'buy';
@@ -14,6 +23,8 @@ type Cancellation = {
14
23
  challengeToken?: string;
15
24
  } | {
16
25
  flow: 'identity';
26
+ } | {
27
+ flow: 'guest_checkout_limit_upgrade';
17
28
  };
18
29
  /**
19
30
  * The challenge frame is fully self-contained — it is driven by the
@@ -27,4 +38,4 @@ interface MessageMap {
27
38
  error: FrameError;
28
39
  }
29
40
 
30
- export type { Cancellation, CompleteResult, MessageMap };
41
+ export type { Cancellation, CompleteResult, GuestCheckoutLimitUpgradeStatus, MessageMap };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonpay/platform-protocol",
3
- "version": "1.13.1",
3
+ "version": "1.15.0",
4
4
  "description": "Shared protocol types for the MoonPay Developer Platform",
5
5
  "type": "module",
6
6
  "exports": {