@moonpay/platform-protocol 1.4.2 → 1.5.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/api/errors.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// API errors\n// ---------------------------------------------------------------------------\n\nexport const DevPlatformApiErrorCodes = {\n unknownError: 'unknown_error',\n unauthorized: 'unauthorized',\n forbidden: 'forbidden',\n notFound: 'not_found',\n invalidRequest: 'invalid_request',\n notImplemented: 'not_implemented',\n tooManyRequests: 'too_many_requests',\n notAllowed: 'not_allowed',\n conflict: 'conflict',\n unprocessableEntity: 'unprocessable_entity',\n sseTimeout: 'sse_timeout',\n sseError: 'sse_error',\n connectionRequired: 'connection_required',\n connectionPending: 'connection_pending',\n connectionUnavailable: 'connection_unavailable',\n serviceUnavailable: 'service_unavailable',\n requirementsIncomplete: 'requirements_incomplete',\n verificationRejected: 'verification_rejected',\n countryMismatch: 'country_mismatch',\n unsupportedCountry: 'unsupported_country',\n} as const;\n\nexport type DevPlatformApiErrorCode =\n (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];\n\nexport interface DevPlatformApiErrorDetail {\n field?: string;\n message: string;\n}\n\n/** Shape returned by the MoonPay Platform API on error responses. */\nexport interface DevPlatformApiError {\n code: DevPlatformApiErrorCode;\n message: string;\n errors?: DevPlatformApiErrorDetail[];\n}\n\n// ---------------------------------------------------------------------------\n// API call result errors (all alias DevPlatformApiError)\n// ---------------------------------------------------------------------------\n\nexport type GetQuoteError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\nexport type CreateIdentityError = DevPlatformApiError;\nexport type GetIdentityError = DevPlatformApiError;\nexport type UpdateIdentityError = DevPlatformApiError;\nexport type VerifyIdentityError = DevPlatformApiError;\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,2BAA2B;AAAA,EACtC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;","names":[]}
1
+ {"version":3,"sources":["../../src/api/errors.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// API errors\n// ---------------------------------------------------------------------------\n\nexport const DevPlatformApiErrorCodes = {\n unknownError: 'unknown_error',\n unauthorized: 'unauthorized',\n forbidden: 'forbidden',\n notFound: 'not_found',\n invalidRequest: 'invalid_request',\n notImplemented: 'not_implemented',\n tooManyRequests: 'too_many_requests',\n notAllowed: 'not_allowed',\n conflict: 'conflict',\n unprocessableEntity: 'unprocessable_entity',\n sseTimeout: 'sse_timeout',\n sseError: 'sse_error',\n connectionRequired: 'connection_required',\n connectionPending: 'connection_pending',\n connectionUnavailable: 'connection_unavailable',\n serviceUnavailable: 'service_unavailable',\n requirementsIncomplete: 'requirements_incomplete',\n verificationRejected: 'verification_rejected',\n countryMismatch: 'country_mismatch',\n unsupportedCountry: 'unsupported_country',\n} as const;\n\nexport type DevPlatformApiErrorCode =\n (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];\n\nexport interface DevPlatformApiErrorDetail {\n field?: string;\n message: string;\n}\n\n/** Shape returned by the MoonPay Platform API on error responses. */\nexport interface DevPlatformApiError {\n code: DevPlatformApiErrorCode;\n message: string;\n errors?: DevPlatformApiErrorDetail[];\n}\n\n// ---------------------------------------------------------------------------\n// API call result errors (all alias DevPlatformApiError)\n// ---------------------------------------------------------------------------\n\nexport type GetQuoteError = DevPlatformApiError;\nexport type GetAssetsError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\nexport type CreateIdentityError = DevPlatformApiError;\nexport type GetIdentityError = DevPlatformApiError;\nexport type UpdateIdentityError = DevPlatformApiError;\nexport type VerifyIdentityError = DevPlatformApiError;\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,2BAA2B;AAAA,EACtC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;","names":[]}
@@ -32,6 +32,7 @@ interface DevPlatformApiError {
32
32
  errors?: DevPlatformApiErrorDetail[];
33
33
  }
34
34
  type GetQuoteError = DevPlatformApiError;
35
+ type GetAssetsError = DevPlatformApiError;
35
36
  type GetPaymentMethodsError = DevPlatformApiError;
36
37
  type GetTransactionsError = DevPlatformApiError;
37
38
  type CreateSessionError = DevPlatformApiError;
@@ -43,4 +44,4 @@ type VerifyIdentityError = DevPlatformApiError;
43
44
  type GetIdentityUploadUrlError = DevPlatformApiError;
44
45
  type SubmitIdentityFilesError = DevPlatformApiError;
45
46
 
46
- export { type CreateIdentityError, type CreateSessionError, type DevPlatformApiError, type DevPlatformApiErrorCode, DevPlatformApiErrorCodes, type DevPlatformApiErrorDetail, type GetIdentityError, type GetIdentityUploadUrlError, type GetPaymentMethodsError, type GetQuoteError, type GetTransactionsError, type RevokeSessionError, type SubmitIdentityFilesError, type UpdateIdentityError, type VerifyIdentityError };
47
+ export { type CreateIdentityError, type CreateSessionError, type DevPlatformApiError, type DevPlatformApiErrorCode, DevPlatformApiErrorCodes, type DevPlatformApiErrorDetail, type GetAssetsError, type GetIdentityError, type GetIdentityUploadUrlError, type GetPaymentMethodsError, type GetQuoteError, type GetTransactionsError, type RevokeSessionError, type SubmitIdentityFilesError, type UpdateIdentityError, type VerifyIdentityError };
@@ -32,6 +32,7 @@ interface DevPlatformApiError {
32
32
  errors?: DevPlatformApiErrorDetail[];
33
33
  }
34
34
  type GetQuoteError = DevPlatformApiError;
35
+ type GetAssetsError = DevPlatformApiError;
35
36
  type GetPaymentMethodsError = DevPlatformApiError;
36
37
  type GetTransactionsError = DevPlatformApiError;
37
38
  type CreateSessionError = DevPlatformApiError;
@@ -43,4 +44,4 @@ type VerifyIdentityError = DevPlatformApiError;
43
44
  type GetIdentityUploadUrlError = DevPlatformApiError;
44
45
  type SubmitIdentityFilesError = DevPlatformApiError;
45
46
 
46
- export { type CreateIdentityError, type CreateSessionError, type DevPlatformApiError, type DevPlatformApiErrorCode, DevPlatformApiErrorCodes, type DevPlatformApiErrorDetail, type GetIdentityError, type GetIdentityUploadUrlError, type GetPaymentMethodsError, type GetQuoteError, type GetTransactionsError, type RevokeSessionError, type SubmitIdentityFilesError, type UpdateIdentityError, type VerifyIdentityError };
47
+ export { type CreateIdentityError, type CreateSessionError, type DevPlatformApiError, type DevPlatformApiErrorCode, DevPlatformApiErrorCodes, type DevPlatformApiErrorDetail, type GetAssetsError, type GetIdentityError, type GetIdentityUploadUrlError, type GetPaymentMethodsError, type GetQuoteError, type GetTransactionsError, type RevokeSessionError, type SubmitIdentityFilesError, type UpdateIdentityError, type VerifyIdentityError };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/errors.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// API errors\n// ---------------------------------------------------------------------------\n\nexport const DevPlatformApiErrorCodes = {\n unknownError: 'unknown_error',\n unauthorized: 'unauthorized',\n forbidden: 'forbidden',\n notFound: 'not_found',\n invalidRequest: 'invalid_request',\n notImplemented: 'not_implemented',\n tooManyRequests: 'too_many_requests',\n notAllowed: 'not_allowed',\n conflict: 'conflict',\n unprocessableEntity: 'unprocessable_entity',\n sseTimeout: 'sse_timeout',\n sseError: 'sse_error',\n connectionRequired: 'connection_required',\n connectionPending: 'connection_pending',\n connectionUnavailable: 'connection_unavailable',\n serviceUnavailable: 'service_unavailable',\n requirementsIncomplete: 'requirements_incomplete',\n verificationRejected: 'verification_rejected',\n countryMismatch: 'country_mismatch',\n unsupportedCountry: 'unsupported_country',\n} as const;\n\nexport type DevPlatformApiErrorCode =\n (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];\n\nexport interface DevPlatformApiErrorDetail {\n field?: string;\n message: string;\n}\n\n/** Shape returned by the MoonPay Platform API on error responses. */\nexport interface DevPlatformApiError {\n code: DevPlatformApiErrorCode;\n message: string;\n errors?: DevPlatformApiErrorDetail[];\n}\n\n// ---------------------------------------------------------------------------\n// API call result errors (all alias DevPlatformApiError)\n// ---------------------------------------------------------------------------\n\nexport type GetQuoteError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\nexport type CreateIdentityError = DevPlatformApiError;\nexport type GetIdentityError = DevPlatformApiError;\nexport type UpdateIdentityError = DevPlatformApiError;\nexport type VerifyIdentityError = DevPlatformApiError;\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n"],"mappings":";AAIO,IAAM,2BAA2B;AAAA,EACtC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;","names":[]}
1
+ {"version":3,"sources":["../../src/api/errors.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// API errors\n// ---------------------------------------------------------------------------\n\nexport const DevPlatformApiErrorCodes = {\n unknownError: 'unknown_error',\n unauthorized: 'unauthorized',\n forbidden: 'forbidden',\n notFound: 'not_found',\n invalidRequest: 'invalid_request',\n notImplemented: 'not_implemented',\n tooManyRequests: 'too_many_requests',\n notAllowed: 'not_allowed',\n conflict: 'conflict',\n unprocessableEntity: 'unprocessable_entity',\n sseTimeout: 'sse_timeout',\n sseError: 'sse_error',\n connectionRequired: 'connection_required',\n connectionPending: 'connection_pending',\n connectionUnavailable: 'connection_unavailable',\n serviceUnavailable: 'service_unavailable',\n requirementsIncomplete: 'requirements_incomplete',\n verificationRejected: 'verification_rejected',\n countryMismatch: 'country_mismatch',\n unsupportedCountry: 'unsupported_country',\n} as const;\n\nexport type DevPlatformApiErrorCode =\n (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];\n\nexport interface DevPlatformApiErrorDetail {\n field?: string;\n message: string;\n}\n\n/** Shape returned by the MoonPay Platform API on error responses. */\nexport interface DevPlatformApiError {\n code: DevPlatformApiErrorCode;\n message: string;\n errors?: DevPlatformApiErrorDetail[];\n}\n\n// ---------------------------------------------------------------------------\n// API call result errors (all alias DevPlatformApiError)\n// ---------------------------------------------------------------------------\n\nexport type GetQuoteError = DevPlatformApiError;\nexport type GetAssetsError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\nexport type CreateIdentityError = DevPlatformApiError;\nexport type GetIdentityError = DevPlatformApiError;\nexport type UpdateIdentityError = DevPlatformApiError;\nexport type VerifyIdentityError = DevPlatformApiError;\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n"],"mappings":";AAIO,IAAM,2BAA2B;AAAA,EACtC,cAAc;AAAA,EACd,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,oBAAoB;AACtB;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/api/index.ts"],"sourcesContent":["/**\n * Partner-friendly type aliases re-exported from the generated OpenAPI types.\n * These drop namespace prefixes and provide consistent names across SDK versions.\n */\nexport type {\n // Assets\n Asset,\n AssetBase,\n // Session\n CreateSessionTokenRequestBody,\n CreateSessionTokenResponse as CreateSessionTokenReturnType,\n // Fees / wallet\n Fees,\n // Quotes\n GetQuoteBody as GetQuoteParams,\n GetQuoteResponse as Quote,\n LimitWithAsset,\n MonetaryFeeAmount,\n MoonPayCorePaginationInfo as PaginationInfo,\n // Payment methods — config catalog\n MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse,\n MoonPayPaymentsPaymentMethod as PaymentMethodConfig,\n MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability,\n MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities,\n MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod,\n // Payment methods — stored cards\n MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod,\n PaymentMethodType,\n QuoteLimitEntry,\n QuoteLimits,\n QuotePaymentMethod,\n // Stages\n Stage,\n StageKind,\n StageStatus,\n // Terms\n TermsAttestation,\n // Transactions\n Transaction,\n TransactionCustomer,\n TransactionPaymentMethod,\n TransactionStatus,\n TransactionWithStages,\n Wallet,\n} from './gen/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/api/index.ts"],"sourcesContent":["/**\n * Partner-friendly type aliases re-exported from the generated OpenAPI types.\n * These drop namespace prefixes and provide consistent names across SDK versions.\n */\nexport type {\n // Assets\n Asset,\n AssetBase,\n AssetControllerListAssetsResponse as ListAssetsResponse,\n AssetStatus,\n // Session\n CreateSessionTokenRequestBody,\n CreateSessionTokenResponse as CreateSessionTokenReturnType,\n // Fees / wallet\n Fees,\n // Quotes\n GetQuoteBody as GetQuoteParams,\n GetQuoteResponse as Quote,\n LimitWithAsset,\n MonetaryFeeAmount,\n MoonPayCorePaginationInfo as PaginationInfo,\n // Payment methods — config catalog\n MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse,\n MoonPayPaymentsPaymentMethod as PaymentMethodConfig,\n MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability,\n MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities,\n MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod,\n // Payment methods — stored cards\n MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod,\n PaymentMethodType,\n PlatformAsset,\n QuoteLimitEntry,\n QuoteLimits,\n QuotePaymentMethod,\n // Stages\n Stage,\n StageKind,\n StageStatus,\n // Transactions\n Transaction,\n TransactionCustomer,\n TransactionPaymentMethod,\n TransactionStatus,\n TransactionWithStages,\n Wallet,\n} from './gen/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -41,6 +41,36 @@ type AssetBase = {
41
41
  */
42
42
  code: string;
43
43
  };
44
+ /**
45
+ * Current status flags for an asset.
46
+ */
47
+ type AssetStatus = {
48
+ /**
49
+ * Reviewed and approved by MoonPay. DeFi tokens are returned with `verified: false`.
50
+ */
51
+ verified: boolean;
52
+ /**
53
+ * Temporarily unavailable for trading.
54
+ */
55
+ suspended: boolean;
56
+ /**
57
+ * Disabled for trading.
58
+ */
59
+ disabled: boolean;
60
+ };
61
+ /**
62
+ * Destination crypto asset. Identify it by `code` for CeFi assets, or by `caip19` (the CAIP-19 identifier from the assets listing) for DeFi tokens, whose `code` is not unique. Provide exactly one; `caip19` takes precedence if both are sent.
63
+ */
64
+ type BuyQuoteDestinationAsset = {
65
+ /**
66
+ * CeFi currency code, e.g. `BTC` or `ETH`. Use for centralised assets.
67
+ */
68
+ code?: string;
69
+ /**
70
+ * CAIP-19 asset identifier from the assets listing. Required for DeFi tokens.
71
+ */
72
+ caip19?: string;
73
+ };
44
74
  type CreateSessionTokenRequestBody = {
45
75
  /**
46
76
  * A unique identifier for the customer from your system.
@@ -51,13 +81,17 @@ type CreateSessionTokenRequestBody = {
51
81
  */
52
82
  deviceIp: IPv4Address | IPv6Address;
53
83
  /**
54
- * The customer's email address. Must be a valid email. If provided, `phoneNumber` must also be provided.
84
+ * The customer's email address. Must be a valid email. If provided, enables email OTP authentication.
55
85
  */
56
86
  email?: string;
57
87
  /**
58
- * The customer's phone number in E.164 format. If provided, `email` must also be provided.
88
+ * The customer's phone number in E.164 format. If both email and phone are provided, enables phone OTP authentication for returning customers.
59
89
  */
60
90
  phoneNumber?: string;
91
+ /**
92
+ * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the customer accepted MoonPay's Terms of Use. Send this when you capture Terms of Use acceptance in your own UI. The value can be at most 60 seconds ahead of server time, with no past limit. MoonPay records the terms version live at this timestamp and binds the acceptance to the customer when the session is authorized.
93
+ */
94
+ termsAcceptedAt?: string;
61
95
  };
62
96
  type CreateSessionTokenResponse = {
63
97
  /**
@@ -80,6 +114,10 @@ type Fees = {
80
114
  * Ecosystem fees (in fiat) for the transaction, if applicable.
81
115
  */
82
116
  ecosystem?: MonetaryFeeAmount;
117
+ /**
118
+ * DeFi swap fee (in fiat) for the transaction, converted to the quote's base currency like the other fees. Present only for DeFi swaps that carry an itemized swap fee; when the fee is taken on-chain it is reflected in `destination.amount` instead.
119
+ */
120
+ defi?: MonetaryFeeAmount;
83
121
  /**
84
122
  * Partner fees (in fiat) for the transaction, if applicable. Deprecated: use `fees.ecosystem` instead. This field will be removed in a future release.
85
123
  * @deprecated
@@ -101,10 +139,10 @@ type GetQuoteBody = {
101
139
  amount?: string;
102
140
  };
103
141
  /**
104
- * Destination asset in crypto. Amount can be set in `destination` or `source`.
142
+ * Destination asset in crypto. Amount can be set in `destination` or `source`. For DeFi tokens, identify the asset by `caip19` and set the amount on `source` only (quoting by destination token amount is not supported).
105
143
  */
106
144
  destination: {
107
- asset: AssetBase;
145
+ asset: BuyQuoteDestinationAsset;
108
146
  /**
109
147
  * The amount being received, if known
110
148
  */
@@ -144,7 +182,7 @@ type GetQuoteResponse = {
144
182
  * A stringified amount, which can include decimals.
145
183
  */
146
184
  amount: string;
147
- asset: Asset;
185
+ asset: QuoteDestinationAsset;
148
186
  };
149
187
  /**
150
188
  * Breakdown of network, MoonPay, and ecosystem fees.
@@ -168,9 +206,13 @@ type GetQuoteResponse = {
168
206
  */
169
207
  executable: boolean;
170
208
  /**
171
- * The rate used to convert fiat <-> crypto, expressed as the crypto value of one unit of fiat.
209
+ * The rate used to convert fiat <-> crypto, expressed as the fiat value of one unit of crypto (e.g. `1 SOL = {exchangeRate} USD`).
172
210
  */
173
211
  exchangeRate: string;
212
+ /**
213
+ * Slippage tolerance applied to the DeFi swap, in basis points (e.g. `50` = 0.5%). Only present when the destination is a DeFi token.
214
+ */
215
+ slippageBps?: number;
174
216
  /**
175
217
  * Disclosures the partner must render verbatim before the customer can complete the transaction. Empty when no disclosure is required for the customer's geography, payment method, and asset combination.
176
218
  */
@@ -307,6 +349,71 @@ type PaymentDisclosure = {
307
349
  version: string;
308
350
  };
309
351
  type PaymentMethodType = 'apple_pay' | 'card' | 'ach' | 'fps' | 'fps_open_banking' | 'google_pay' | 'sepa' | 'sepa_open_banking' | 'pix' | 'paypal' | 'venmo' | 'revolut_pay' | 'moonpay_balance' | 'interac';
352
+ /**
353
+ * A crypto asset available for purchase through MoonPay.
354
+ */
355
+ type PlatformAsset = {
356
+ /**
357
+ * The CAIP-19 asset identifier (encodes chain and contract). Use this value when creating quotes for unverified tokens.
358
+ */
359
+ caip19: string;
360
+ /**
361
+ * The asset code. Use this value when creating quotes for verified tokens.
362
+ */
363
+ code: string;
364
+ /**
365
+ * The human-readable name of the asset.
366
+ */
367
+ name: string;
368
+ /**
369
+ * The blockchain network code this asset belongs to.
370
+ */
371
+ network: string;
372
+ /**
373
+ * The on-chain contract address. Null for native gas tokens.
374
+ */
375
+ contractAddress: string | null;
376
+ /**
377
+ * The number of decimal places used on-chain, or null if unknown.
378
+ */
379
+ decimals: number | null;
380
+ /**
381
+ * The maximum decimal places MoonPay supports for trading this asset, or null if unknown.
382
+ */
383
+ precision: number | null;
384
+ status: AssetStatus;
385
+ };
386
+ /**
387
+ * Destination crypto asset returned on the quote. Adds the resolved network and, for DeFi tokens, the CAIP-19 identifier on top of the base asset fields.
388
+ */
389
+ type QuoteDestinationAsset = {
390
+ /**
391
+ * A fiat or crypto currency code.
392
+ *
393
+ * **Fiat**
394
+ * Fiat codes are represented as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes.
395
+ *
396
+ * Currently only `USD` is supported.
397
+ *
398
+ * **Crypto**
399
+ * For crypto currency codes, see [supported currencies](https://dev.moonpay.com/docs/list-of-supported-cryptocurrencies).
400
+ *
401
+ * Examples: `BTC` `SOL` `ETH` `USDC_BASE` `USDC_SOL`
402
+ */
403
+ code: string;
404
+ /**
405
+ * The human-readable name
406
+ */
407
+ name?: string;
408
+ /**
409
+ * The number of supported decimal places
410
+ */
411
+ precision?: number;
412
+ /**
413
+ * The CAIP-19 asset identifier (encodes chain and contract). Present for DeFi tokens.
414
+ */
415
+ caip19?: string;
416
+ };
310
417
  type QuoteLimitEntry = {
311
418
  /**
312
419
  * The maximum amount.
@@ -364,20 +471,6 @@ type StageKind = 'ordering' | 'waiting_payment' | 'waiting_authentication' | 've
364
471
  * The status of a transaction stage.
365
472
  */
366
473
  type StageStatus = 'not_started' | 'in_progress' | 'success' | 'failed';
367
- type TermsAttestation = {
368
- /**
369
- * The MoonPay ID of the terms attestation.
370
- */
371
- id: string;
372
- /**
373
- * Your identifier for the end customer who accepted MoonPay's terms.
374
- */
375
- externalCustomerId: string;
376
- /**
377
- * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string indicating when the attestation was recorded.
378
- */
379
- attestedAt: string;
380
- };
381
474
  type Transaction = {
382
475
  /**
383
476
  * The MoonPay ID of the transaction.
@@ -462,5 +555,15 @@ type Wallet = {
462
555
  */
463
556
  tag?: string;
464
557
  };
558
+ type AssetControllerListAssetsResponses = {
559
+ /**
560
+ * The request has succeeded.
561
+ */
562
+ 200: {
563
+ data: Array<PlatformAsset>;
564
+ pageInfo: MoonPayCorePaginationInfo;
565
+ };
566
+ };
567
+ type AssetControllerListAssetsResponse = AssetControllerListAssetsResponses[keyof AssetControllerListAssetsResponses];
465
568
 
466
- export type { Asset, AssetBase, CreateSessionTokenRequestBody, CreateSessionTokenResponse as CreateSessionTokenReturnType, Fees, GetQuoteBody as GetQuoteParams, LimitWithAsset, MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse, MonetaryFeeAmount, MoonPayCorePaginationInfo as PaginationInfo, MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability, MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities, MoonPayPaymentsPaymentMethod as PaymentMethodConfig, PaymentMethodType, GetQuoteResponse as Quote, QuoteLimitEntry, QuoteLimits, QuotePaymentMethod, Stage, StageKind, StageStatus, MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod, MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod, TermsAttestation, Transaction, TransactionCustomer, TransactionPaymentMethod, TransactionStatus, TransactionWithStages, Wallet };
569
+ export type { Asset, AssetBase, AssetStatus, CreateSessionTokenRequestBody, CreateSessionTokenResponse as CreateSessionTokenReturnType, Fees, GetQuoteBody as GetQuoteParams, LimitWithAsset, AssetControllerListAssetsResponse as ListAssetsResponse, MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse, MonetaryFeeAmount, MoonPayCorePaginationInfo as PaginationInfo, MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability, MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities, MoonPayPaymentsPaymentMethod as PaymentMethodConfig, PaymentMethodType, PlatformAsset, GetQuoteResponse as Quote, QuoteLimitEntry, QuoteLimits, QuotePaymentMethod, Stage, StageKind, StageStatus, MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod, MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod, Transaction, TransactionCustomer, TransactionPaymentMethod, TransactionStatus, TransactionWithStages, Wallet };
@@ -41,6 +41,36 @@ type AssetBase = {
41
41
  */
42
42
  code: string;
43
43
  };
44
+ /**
45
+ * Current status flags for an asset.
46
+ */
47
+ type AssetStatus = {
48
+ /**
49
+ * Reviewed and approved by MoonPay. DeFi tokens are returned with `verified: false`.
50
+ */
51
+ verified: boolean;
52
+ /**
53
+ * Temporarily unavailable for trading.
54
+ */
55
+ suspended: boolean;
56
+ /**
57
+ * Disabled for trading.
58
+ */
59
+ disabled: boolean;
60
+ };
61
+ /**
62
+ * Destination crypto asset. Identify it by `code` for CeFi assets, or by `caip19` (the CAIP-19 identifier from the assets listing) for DeFi tokens, whose `code` is not unique. Provide exactly one; `caip19` takes precedence if both are sent.
63
+ */
64
+ type BuyQuoteDestinationAsset = {
65
+ /**
66
+ * CeFi currency code, e.g. `BTC` or `ETH`. Use for centralised assets.
67
+ */
68
+ code?: string;
69
+ /**
70
+ * CAIP-19 asset identifier from the assets listing. Required for DeFi tokens.
71
+ */
72
+ caip19?: string;
73
+ };
44
74
  type CreateSessionTokenRequestBody = {
45
75
  /**
46
76
  * A unique identifier for the customer from your system.
@@ -51,13 +81,17 @@ type CreateSessionTokenRequestBody = {
51
81
  */
52
82
  deviceIp: IPv4Address | IPv6Address;
53
83
  /**
54
- * The customer's email address. Must be a valid email. If provided, `phoneNumber` must also be provided.
84
+ * The customer's email address. Must be a valid email. If provided, enables email OTP authentication.
55
85
  */
56
86
  email?: string;
57
87
  /**
58
- * The customer's phone number in E.164 format. If provided, `email` must also be provided.
88
+ * The customer's phone number in E.164 format. If both email and phone are provided, enables phone OTP authentication for returning customers.
59
89
  */
60
90
  phoneNumber?: string;
91
+ /**
92
+ * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the customer accepted MoonPay's Terms of Use. Send this when you capture Terms of Use acceptance in your own UI. The value can be at most 60 seconds ahead of server time, with no past limit. MoonPay records the terms version live at this timestamp and binds the acceptance to the customer when the session is authorized.
93
+ */
94
+ termsAcceptedAt?: string;
61
95
  };
62
96
  type CreateSessionTokenResponse = {
63
97
  /**
@@ -80,6 +114,10 @@ type Fees = {
80
114
  * Ecosystem fees (in fiat) for the transaction, if applicable.
81
115
  */
82
116
  ecosystem?: MonetaryFeeAmount;
117
+ /**
118
+ * DeFi swap fee (in fiat) for the transaction, converted to the quote's base currency like the other fees. Present only for DeFi swaps that carry an itemized swap fee; when the fee is taken on-chain it is reflected in `destination.amount` instead.
119
+ */
120
+ defi?: MonetaryFeeAmount;
83
121
  /**
84
122
  * Partner fees (in fiat) for the transaction, if applicable. Deprecated: use `fees.ecosystem` instead. This field will be removed in a future release.
85
123
  * @deprecated
@@ -101,10 +139,10 @@ type GetQuoteBody = {
101
139
  amount?: string;
102
140
  };
103
141
  /**
104
- * Destination asset in crypto. Amount can be set in `destination` or `source`.
142
+ * Destination asset in crypto. Amount can be set in `destination` or `source`. For DeFi tokens, identify the asset by `caip19` and set the amount on `source` only (quoting by destination token amount is not supported).
105
143
  */
106
144
  destination: {
107
- asset: AssetBase;
145
+ asset: BuyQuoteDestinationAsset;
108
146
  /**
109
147
  * The amount being received, if known
110
148
  */
@@ -144,7 +182,7 @@ type GetQuoteResponse = {
144
182
  * A stringified amount, which can include decimals.
145
183
  */
146
184
  amount: string;
147
- asset: Asset;
185
+ asset: QuoteDestinationAsset;
148
186
  };
149
187
  /**
150
188
  * Breakdown of network, MoonPay, and ecosystem fees.
@@ -168,9 +206,13 @@ type GetQuoteResponse = {
168
206
  */
169
207
  executable: boolean;
170
208
  /**
171
- * The rate used to convert fiat <-> crypto, expressed as the crypto value of one unit of fiat.
209
+ * The rate used to convert fiat <-> crypto, expressed as the fiat value of one unit of crypto (e.g. `1 SOL = {exchangeRate} USD`).
172
210
  */
173
211
  exchangeRate: string;
212
+ /**
213
+ * Slippage tolerance applied to the DeFi swap, in basis points (e.g. `50` = 0.5%). Only present when the destination is a DeFi token.
214
+ */
215
+ slippageBps?: number;
174
216
  /**
175
217
  * Disclosures the partner must render verbatim before the customer can complete the transaction. Empty when no disclosure is required for the customer's geography, payment method, and asset combination.
176
218
  */
@@ -307,6 +349,71 @@ type PaymentDisclosure = {
307
349
  version: string;
308
350
  };
309
351
  type PaymentMethodType = 'apple_pay' | 'card' | 'ach' | 'fps' | 'fps_open_banking' | 'google_pay' | 'sepa' | 'sepa_open_banking' | 'pix' | 'paypal' | 'venmo' | 'revolut_pay' | 'moonpay_balance' | 'interac';
352
+ /**
353
+ * A crypto asset available for purchase through MoonPay.
354
+ */
355
+ type PlatformAsset = {
356
+ /**
357
+ * The CAIP-19 asset identifier (encodes chain and contract). Use this value when creating quotes for unverified tokens.
358
+ */
359
+ caip19: string;
360
+ /**
361
+ * The asset code. Use this value when creating quotes for verified tokens.
362
+ */
363
+ code: string;
364
+ /**
365
+ * The human-readable name of the asset.
366
+ */
367
+ name: string;
368
+ /**
369
+ * The blockchain network code this asset belongs to.
370
+ */
371
+ network: string;
372
+ /**
373
+ * The on-chain contract address. Null for native gas tokens.
374
+ */
375
+ contractAddress: string | null;
376
+ /**
377
+ * The number of decimal places used on-chain, or null if unknown.
378
+ */
379
+ decimals: number | null;
380
+ /**
381
+ * The maximum decimal places MoonPay supports for trading this asset, or null if unknown.
382
+ */
383
+ precision: number | null;
384
+ status: AssetStatus;
385
+ };
386
+ /**
387
+ * Destination crypto asset returned on the quote. Adds the resolved network and, for DeFi tokens, the CAIP-19 identifier on top of the base asset fields.
388
+ */
389
+ type QuoteDestinationAsset = {
390
+ /**
391
+ * A fiat or crypto currency code.
392
+ *
393
+ * **Fiat**
394
+ * Fiat codes are represented as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes.
395
+ *
396
+ * Currently only `USD` is supported.
397
+ *
398
+ * **Crypto**
399
+ * For crypto currency codes, see [supported currencies](https://dev.moonpay.com/docs/list-of-supported-cryptocurrencies).
400
+ *
401
+ * Examples: `BTC` `SOL` `ETH` `USDC_BASE` `USDC_SOL`
402
+ */
403
+ code: string;
404
+ /**
405
+ * The human-readable name
406
+ */
407
+ name?: string;
408
+ /**
409
+ * The number of supported decimal places
410
+ */
411
+ precision?: number;
412
+ /**
413
+ * The CAIP-19 asset identifier (encodes chain and contract). Present for DeFi tokens.
414
+ */
415
+ caip19?: string;
416
+ };
310
417
  type QuoteLimitEntry = {
311
418
  /**
312
419
  * The maximum amount.
@@ -364,20 +471,6 @@ type StageKind = 'ordering' | 'waiting_payment' | 'waiting_authentication' | 've
364
471
  * The status of a transaction stage.
365
472
  */
366
473
  type StageStatus = 'not_started' | 'in_progress' | 'success' | 'failed';
367
- type TermsAttestation = {
368
- /**
369
- * The MoonPay ID of the terms attestation.
370
- */
371
- id: string;
372
- /**
373
- * Your identifier for the end customer who accepted MoonPay's terms.
374
- */
375
- externalCustomerId: string;
376
- /**
377
- * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string indicating when the attestation was recorded.
378
- */
379
- attestedAt: string;
380
- };
381
474
  type Transaction = {
382
475
  /**
383
476
  * The MoonPay ID of the transaction.
@@ -462,5 +555,15 @@ type Wallet = {
462
555
  */
463
556
  tag?: string;
464
557
  };
558
+ type AssetControllerListAssetsResponses = {
559
+ /**
560
+ * The request has succeeded.
561
+ */
562
+ 200: {
563
+ data: Array<PlatformAsset>;
564
+ pageInfo: MoonPayCorePaginationInfo;
565
+ };
566
+ };
567
+ type AssetControllerListAssetsResponse = AssetControllerListAssetsResponses[keyof AssetControllerListAssetsResponses];
465
568
 
466
- export type { Asset, AssetBase, CreateSessionTokenRequestBody, CreateSessionTokenResponse as CreateSessionTokenReturnType, Fees, GetQuoteBody as GetQuoteParams, LimitWithAsset, MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse, MonetaryFeeAmount, MoonPayCorePaginationInfo as PaginationInfo, MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability, MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities, MoonPayPaymentsPaymentMethod as PaymentMethodConfig, PaymentMethodType, GetQuoteResponse as Quote, QuoteLimitEntry, QuoteLimits, QuotePaymentMethod, Stage, StageKind, StageStatus, MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod, MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod, TermsAttestation, Transaction, TransactionCustomer, TransactionPaymentMethod, TransactionStatus, TransactionWithStages, Wallet };
569
+ export type { Asset, AssetBase, AssetStatus, CreateSessionTokenRequestBody, CreateSessionTokenResponse as CreateSessionTokenReturnType, Fees, GetQuoteBody as GetQuoteParams, LimitWithAsset, AssetControllerListAssetsResponse as ListAssetsResponse, MoonPayPaymentsListPaymentMethodsResponse as ListPaymentMethodsResponse, MonetaryFeeAmount, MoonPayCorePaginationInfo as PaginationInfo, MoonPayPaymentsPaymentMethodAvailability as PaymentMethodAvailability, MoonPayPaymentsPaymentMethodCapabilities as PaymentMethodCapabilities, MoonPayPaymentsPaymentMethod as PaymentMethodConfig, PaymentMethodType, PlatformAsset, GetQuoteResponse as Quote, QuoteLimitEntry, QuoteLimits, QuotePaymentMethod, Stage, StageKind, StageStatus, MoonPayPaymentsStoredCardPaymentMethod as StoredCardPaymentMethod, MoonPayPaymentsStoredPaymentMethod as StoredPaymentMethod, Transaction, TransactionCustomer, TransactionPaymentMethod, TransactionStatus, TransactionWithStages, Wallet };
@@ -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'\n | 'quoteExpired'\n | 'invalidQuote'\n | 'applePayUnavailable'\n | 'generic'\n | 'oneTapApplePaySecondFactorRequired'\n >;\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 /** 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":[]}
@@ -4,7 +4,7 @@ import { FrameError } from '../protocol.cjs';
4
4
 
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
- error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic' | 'oneTapApplePaySecondFactorRequired'>;
7
+ error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'>;
8
8
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
9
  challenge: ChallengeRequired;
10
10
  complete: {
@@ -4,7 +4,7 @@ import { FrameError } from '../protocol.js';
4
4
 
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
- error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic' | 'oneTapApplePaySecondFactorRequired'>;
7
+ error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'>;
8
8
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
9
  challenge: ChallengeRequired;
10
10
  complete: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/connection.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Connection statuses\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionStatus {\n /**\n * New or expired user — needs the full connect flow.\n */\n connectionRequired = 'connectionRequired',\n\n /**\n * Valid connection — encrypted credentials are included.\n */\n active = 'active',\n\n /**\n * Restricted location — connection cannot be used.\n */\n unavailable = 'unavailable',\n\n /**\n * KYC decision delayed — may resolve on a subsequent visit.\n */\n pending = 'pending',\n\n /**\n * Terminal failure — KYC fail, rejection, etc.\n */\n failed = 'failed',\n\n /**\n * Customer has no valid Terms of Use attestation on file (headless/Identity API partners).\n * Display Terms of Use in your own UI, capture acceptance, call\n * `POST /platform/v1/terms/attestations`, then retry the connection.\n */\n termsAcceptanceRequired = 'termsAcceptanceRequired',\n}\n\nexport interface ConnectionRequired {\n status: ConnectionStatus.connectionRequired;\n /**\n * Base64-encoded, X25519+AES-GCM encrypted anonymous token payload.\n * These are frame-internal tokens used by the connect frame — they cannot be\n * used to call MoonPay APIs directly. Decrypt via `decryptCredentials()` only\n * if you need the `clientToken` to bootstrap the connect frame manually.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements available before authentication, if any.\n * Present when Apple Pay 1TAP is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n}\n\nexport interface ActiveConnection {\n status: ConnectionStatus.active;\n /** The authenticated MoonPay customer. */\n customer: {\n /** The MoonPay customer ID. */\n id: string;\n /** ISO 3166-1 alpha-3 country code for the customer's jurisdiction. */\n country?: string;\n /** State or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). Present when the customer is in a regulated area. */\n area?: string;\n };\n /**\n * Base64-encoded, X25519+AES-GCM encrypted JSON containing:\n * ```json\n * {\n * \"accessToken\": \"<token>\",\n * \"clientToken\": \"<token>\",\n * \"expiresAt\": \"<iso8601>\"\n * }\n * ```\n *\n * - `accessToken`: A token that can be used to make API requests from the client.\n * - `clientToken`: A token that can be used to initialize sensitive frames such as Apple Pay.\n * - `expiresAt`: An ISO 8601 formatted string indicating when the tokens expire.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\n capabilities: CustomerCapabilities;\n}\n\nexport interface UnavailableConnection {\n status: ConnectionStatus.unavailable;\n}\n\nexport interface PendingConnection {\n status: ConnectionStatus.pending;\n}\n\nexport interface FailedConnection {\n status: ConnectionStatus.failed;\n reason: string;\n}\n\nexport interface TermsAcceptanceRequiredConnection {\n status: ConnectionStatus.termsAcceptanceRequired;\n}\n\n/** Discriminated union of all connection result statuses. */\nexport type Connection =\n | ConnectionRequired\n | ActiveConnection\n | UnavailableConnection\n | PendingConnection\n | FailedConnection\n | TermsAcceptanceRequiredConnection;\n\n// ---------------------------------------------------------------------------\n// Decrypted credentials (what the SDK exposes after decryption)\n// ---------------------------------------------------------------------------\n\nexport interface DecryptedCredentials {\n accessToken: string;\n clientToken: string;\n expiresAt: string;\n}\n\n// ---------------------------------------------------------------------------\n// Customer capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\nexport interface CustomerCapabilities {\n /** Capabilities for the ramps (buy and sell) product. */\n ramps?: RampsCapability;\n /** Capabilities for the Apple Pay 1TAP flow. Present when 1TAP is enabled for the partner and the customer matches. */\n oneTapApplePay?: RampsCapability;\n /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */\n guestCheckout?: RampsCapability;\n}\n\n/**\n * Capabilities and requirements for the ramps (buy and sell) product.\n */\nexport interface RampsCapability {\n /** Regulatory requirements for ramps operations in the customer's jurisdiction. */\n requirements: RampsRequirements;\n}\n\n/**\n * Regulatory requirements that apply to ramps operations for the customer.\n */\nexport interface RampsRequirements {\n /**\n * Present when the customer's jurisdiction requires payment disclosures\n * before a ramps transaction. Omitted when no disclosures are required.\n *\n * @deprecated Use `customer.country`, `customer.administrativeArea`, and `customer.area`\n * from the active connection instead. This field will be removed in a future release.\n */\n paymentDisclosures?: PaymentDisclosuresRequirement;\n}\n\n/**\n * A jurisdiction that requires payment disclosures before a ramps transaction.\n */\nexport interface PaymentDisclosuresRequirement {\n /** The ISO 3166-1 alpha-3 country code for the jurisdiction. */\n country: string;\n /** The state or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). */\n area?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Connection errors\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionErrorCode {\n validationError = 'validationError',\n /** Wire value is `'generic'`. */\n connectionFailedGeneric = 'generic',\n}\n\nexport interface ConfigValidationFieldError {\n code: 'invalidSessionToken' | 'invalidClientToken' | 'invalidPublicKey';\n message: string;\n}\n\nexport type ConnectionError =\n | {\n code: ConnectionErrorCode.validationError;\n errors: ConfigValidationFieldError[];\n }\n | {\n code: ConnectionErrorCode.connectionFailedGeneric;\n message?: string;\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAK,mBAAL,kBAAKA,sBAAL;AAIL,EAAAA,kBAAA,wBAAqB;AAKrB,EAAAA,kBAAA,YAAS;AAKT,EAAAA,kBAAA,iBAAc;AAKd,EAAAA,kBAAA,aAAU;AAKV,EAAAA,kBAAA,YAAS;AAOT,EAAAA,kBAAA,6BAA0B;AA/BhB,SAAAA;AAAA,GAAA;AA8KL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
1
+ {"version":3,"sources":["../../src/models/connection.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Connection statuses\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionStatus {\n /**\n * New or expired user — needs the full connect flow.\n */\n connectionRequired = 'connectionRequired',\n\n /**\n * Valid connection — encrypted credentials are included.\n */\n active = 'active',\n\n /**\n * Restricted location — connection cannot be used.\n */\n unavailable = 'unavailable',\n\n /**\n * KYC decision delayed — may resolve on a subsequent visit.\n */\n pending = 'pending',\n\n /**\n * Terminal failure — KYC fail, rejection, etc.\n */\n failed = 'failed',\n\n /**\n * Customer has no valid Terms of Use attestation on file (headless/Identity API partners).\n * Display Terms of Use in your own UI, capture acceptance, call\n * `POST /platform/v1/terms/attestations`, then retry the connection.\n */\n termsAcceptanceRequired = 'termsAcceptanceRequired',\n}\n\nexport interface ConnectionRequired {\n status: ConnectionStatus.connectionRequired;\n /**\n * Base64-encoded, X25519+AES-GCM encrypted anonymous token payload.\n * These are frame-internal tokens used by the connect frame — they cannot be\n * used to call MoonPay APIs directly. Decrypt via `decryptCredentials()` only\n * if you need the `clientToken` to bootstrap the connect frame manually.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements available before authentication, if any.\n * Present when guest checkout is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n}\n\nexport interface ActiveConnection {\n status: ConnectionStatus.active;\n /** The authenticated MoonPay customer. */\n customer: {\n /** The MoonPay customer ID. */\n id: string;\n /** ISO 3166-1 alpha-3 country code for the customer's jurisdiction. */\n country?: string;\n /** State or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). Present when the customer is in a regulated area. */\n area?: string;\n };\n /**\n * Base64-encoded, X25519+AES-GCM encrypted JSON containing:\n * ```json\n * {\n * \"accessToken\": \"<token>\",\n * \"clientToken\": \"<token>\",\n * \"expiresAt\": \"<iso8601>\"\n * }\n * ```\n *\n * - `accessToken`: A token that can be used to make API requests from the client.\n * - `clientToken`: A token that can be used to initialize sensitive frames such as Apple Pay.\n * - `expiresAt`: An ISO 8601 formatted string indicating when the tokens expire.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\n capabilities: CustomerCapabilities;\n}\n\nexport interface UnavailableConnection {\n status: ConnectionStatus.unavailable;\n}\n\nexport interface PendingConnection {\n status: ConnectionStatus.pending;\n}\n\nexport interface FailedConnection {\n status: ConnectionStatus.failed;\n reason: string;\n}\n\nexport interface TermsAcceptanceRequiredConnection {\n status: ConnectionStatus.termsAcceptanceRequired;\n}\n\n/** Discriminated union of all connection result statuses. */\nexport type Connection =\n | ConnectionRequired\n | ActiveConnection\n | UnavailableConnection\n | PendingConnection\n | FailedConnection\n | TermsAcceptanceRequiredConnection;\n\n// ---------------------------------------------------------------------------\n// Decrypted credentials (what the SDK exposes after decryption)\n// ---------------------------------------------------------------------------\n\nexport interface DecryptedCredentials {\n accessToken: string;\n clientToken: string;\n expiresAt: string;\n}\n\n// ---------------------------------------------------------------------------\n// Customer capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\nexport interface CustomerCapabilities {\n /** Capabilities for the ramps (buy and sell) product. */\n ramps?: RampsCapability;\n /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */\n guestCheckout?: RampsCapability;\n}\n\n/**\n * Capabilities and requirements for the ramps (buy and sell) product.\n */\nexport interface RampsCapability {\n /** Regulatory requirements for ramps operations in the customer's jurisdiction. */\n requirements: RampsRequirements;\n}\n\n/**\n * Regulatory requirements that apply to ramps operations for the customer.\n */\nexport interface RampsRequirements {\n /**\n * Present when the customer's jurisdiction requires payment disclosures\n * before a ramps transaction. Omitted when no disclosures are required.\n *\n * @deprecated Use `customer.country`, `customer.administrativeArea`, and `customer.area`\n * from the active connection instead. This field will be removed in a future release.\n */\n paymentDisclosures?: PaymentDisclosuresRequirement;\n}\n\n/**\n * A jurisdiction that requires payment disclosures before a ramps transaction.\n */\nexport interface PaymentDisclosuresRequirement {\n /** The ISO 3166-1 alpha-3 country code for the jurisdiction. */\n country: string;\n /** The state or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). */\n area?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Connection errors\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionErrorCode {\n validationError = 'validationError',\n /** Wire value is `'generic'`. */\n connectionFailedGeneric = 'generic',\n}\n\nexport interface ConfigValidationFieldError {\n code: 'invalidSessionToken' | 'invalidClientToken' | 'invalidPublicKey';\n message: string;\n}\n\nexport type ConnectionError =\n | {\n code: ConnectionErrorCode.validationError;\n errors: ConfigValidationFieldError[];\n }\n | {\n code: ConnectionErrorCode.connectionFailedGeneric;\n message?: string;\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAK,mBAAL,kBAAKA,sBAAL;AAIL,EAAAA,kBAAA,wBAAqB;AAKrB,EAAAA,kBAAA,YAAS;AAKT,EAAAA,kBAAA,iBAAc;AAKd,EAAAA,kBAAA,aAAU;AAKV,EAAAA,kBAAA,YAAS;AAOT,EAAAA,kBAAA,6BAA0B;AA/BhB,SAAAA;AAAA,GAAA;AA4KL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
@@ -37,7 +37,7 @@ interface ConnectionRequired {
37
37
  credentials: string;
38
38
  /**
39
39
  * Capabilities and regulatory requirements available before authentication, if any.
40
- * Present when Apple Pay 1TAP is enabled for the partner.
40
+ * Present when guest checkout is enabled for the partner.
41
41
  */
42
42
  capabilities?: CustomerCapabilities;
43
43
  }
@@ -100,8 +100,6 @@ interface DecryptedCredentials {
100
100
  interface CustomerCapabilities {
101
101
  /** Capabilities for the ramps (buy and sell) product. */
102
102
  ramps?: RampsCapability;
103
- /** Capabilities for the Apple Pay 1TAP flow. Present when 1TAP is enabled for the partner and the customer matches. */
104
- oneTapApplePay?: RampsCapability;
105
103
  /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */
106
104
  guestCheckout?: RampsCapability;
107
105
  }
@@ -37,7 +37,7 @@ interface ConnectionRequired {
37
37
  credentials: string;
38
38
  /**
39
39
  * Capabilities and regulatory requirements available before authentication, if any.
40
- * Present when Apple Pay 1TAP is enabled for the partner.
40
+ * Present when guest checkout is enabled for the partner.
41
41
  */
42
42
  capabilities?: CustomerCapabilities;
43
43
  }
@@ -100,8 +100,6 @@ interface DecryptedCredentials {
100
100
  interface CustomerCapabilities {
101
101
  /** Capabilities for the ramps (buy and sell) product. */
102
102
  ramps?: RampsCapability;
103
- /** Capabilities for the Apple Pay 1TAP flow. Present when 1TAP is enabled for the partner and the customer matches. */
104
- oneTapApplePay?: RampsCapability;
105
103
  /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */
106
104
  guestCheckout?: RampsCapability;
107
105
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/connection.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Connection statuses\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionStatus {\n /**\n * New or expired user — needs the full connect flow.\n */\n connectionRequired = 'connectionRequired',\n\n /**\n * Valid connection — encrypted credentials are included.\n */\n active = 'active',\n\n /**\n * Restricted location — connection cannot be used.\n */\n unavailable = 'unavailable',\n\n /**\n * KYC decision delayed — may resolve on a subsequent visit.\n */\n pending = 'pending',\n\n /**\n * Terminal failure — KYC fail, rejection, etc.\n */\n failed = 'failed',\n\n /**\n * Customer has no valid Terms of Use attestation on file (headless/Identity API partners).\n * Display Terms of Use in your own UI, capture acceptance, call\n * `POST /platform/v1/terms/attestations`, then retry the connection.\n */\n termsAcceptanceRequired = 'termsAcceptanceRequired',\n}\n\nexport interface ConnectionRequired {\n status: ConnectionStatus.connectionRequired;\n /**\n * Base64-encoded, X25519+AES-GCM encrypted anonymous token payload.\n * These are frame-internal tokens used by the connect frame — they cannot be\n * used to call MoonPay APIs directly. Decrypt via `decryptCredentials()` only\n * if you need the `clientToken` to bootstrap the connect frame manually.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements available before authentication, if any.\n * Present when Apple Pay 1TAP is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n}\n\nexport interface ActiveConnection {\n status: ConnectionStatus.active;\n /** The authenticated MoonPay customer. */\n customer: {\n /** The MoonPay customer ID. */\n id: string;\n /** ISO 3166-1 alpha-3 country code for the customer's jurisdiction. */\n country?: string;\n /** State or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). Present when the customer is in a regulated area. */\n area?: string;\n };\n /**\n * Base64-encoded, X25519+AES-GCM encrypted JSON containing:\n * ```json\n * {\n * \"accessToken\": \"<token>\",\n * \"clientToken\": \"<token>\",\n * \"expiresAt\": \"<iso8601>\"\n * }\n * ```\n *\n * - `accessToken`: A token that can be used to make API requests from the client.\n * - `clientToken`: A token that can be used to initialize sensitive frames such as Apple Pay.\n * - `expiresAt`: An ISO 8601 formatted string indicating when the tokens expire.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\n capabilities: CustomerCapabilities;\n}\n\nexport interface UnavailableConnection {\n status: ConnectionStatus.unavailable;\n}\n\nexport interface PendingConnection {\n status: ConnectionStatus.pending;\n}\n\nexport interface FailedConnection {\n status: ConnectionStatus.failed;\n reason: string;\n}\n\nexport interface TermsAcceptanceRequiredConnection {\n status: ConnectionStatus.termsAcceptanceRequired;\n}\n\n/** Discriminated union of all connection result statuses. */\nexport type Connection =\n | ConnectionRequired\n | ActiveConnection\n | UnavailableConnection\n | PendingConnection\n | FailedConnection\n | TermsAcceptanceRequiredConnection;\n\n// ---------------------------------------------------------------------------\n// Decrypted credentials (what the SDK exposes after decryption)\n// ---------------------------------------------------------------------------\n\nexport interface DecryptedCredentials {\n accessToken: string;\n clientToken: string;\n expiresAt: string;\n}\n\n// ---------------------------------------------------------------------------\n// Customer capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\nexport interface CustomerCapabilities {\n /** Capabilities for the ramps (buy and sell) product. */\n ramps?: RampsCapability;\n /** Capabilities for the Apple Pay 1TAP flow. Present when 1TAP is enabled for the partner and the customer matches. */\n oneTapApplePay?: RampsCapability;\n /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */\n guestCheckout?: RampsCapability;\n}\n\n/**\n * Capabilities and requirements for the ramps (buy and sell) product.\n */\nexport interface RampsCapability {\n /** Regulatory requirements for ramps operations in the customer's jurisdiction. */\n requirements: RampsRequirements;\n}\n\n/**\n * Regulatory requirements that apply to ramps operations for the customer.\n */\nexport interface RampsRequirements {\n /**\n * Present when the customer's jurisdiction requires payment disclosures\n * before a ramps transaction. Omitted when no disclosures are required.\n *\n * @deprecated Use `customer.country`, `customer.administrativeArea`, and `customer.area`\n * from the active connection instead. This field will be removed in a future release.\n */\n paymentDisclosures?: PaymentDisclosuresRequirement;\n}\n\n/**\n * A jurisdiction that requires payment disclosures before a ramps transaction.\n */\nexport interface PaymentDisclosuresRequirement {\n /** The ISO 3166-1 alpha-3 country code for the jurisdiction. */\n country: string;\n /** The state or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). */\n area?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Connection errors\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionErrorCode {\n validationError = 'validationError',\n /** Wire value is `'generic'`. */\n connectionFailedGeneric = 'generic',\n}\n\nexport interface ConfigValidationFieldError {\n code: 'invalidSessionToken' | 'invalidClientToken' | 'invalidPublicKey';\n message: string;\n}\n\nexport type ConnectionError =\n | {\n code: ConnectionErrorCode.validationError;\n errors: ConfigValidationFieldError[];\n }\n | {\n code: ConnectionErrorCode.connectionFailedGeneric;\n message?: string;\n };\n"],"mappings":";AAIO,IAAK,mBAAL,kBAAKA,sBAAL;AAIL,EAAAA,kBAAA,wBAAqB;AAKrB,EAAAA,kBAAA,YAAS;AAKT,EAAAA,kBAAA,iBAAc;AAKd,EAAAA,kBAAA,aAAU;AAKV,EAAAA,kBAAA,YAAS;AAOT,EAAAA,kBAAA,6BAA0B;AA/BhB,SAAAA;AAAA,GAAA;AA8KL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
1
+ {"version":3,"sources":["../../src/models/connection.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Connection statuses\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionStatus {\n /**\n * New or expired user — needs the full connect flow.\n */\n connectionRequired = 'connectionRequired',\n\n /**\n * Valid connection — encrypted credentials are included.\n */\n active = 'active',\n\n /**\n * Restricted location — connection cannot be used.\n */\n unavailable = 'unavailable',\n\n /**\n * KYC decision delayed — may resolve on a subsequent visit.\n */\n pending = 'pending',\n\n /**\n * Terminal failure — KYC fail, rejection, etc.\n */\n failed = 'failed',\n\n /**\n * Customer has no valid Terms of Use attestation on file (headless/Identity API partners).\n * Display Terms of Use in your own UI, capture acceptance, call\n * `POST /platform/v1/terms/attestations`, then retry the connection.\n */\n termsAcceptanceRequired = 'termsAcceptanceRequired',\n}\n\nexport interface ConnectionRequired {\n status: ConnectionStatus.connectionRequired;\n /**\n * Base64-encoded, X25519+AES-GCM encrypted anonymous token payload.\n * These are frame-internal tokens used by the connect frame — they cannot be\n * used to call MoonPay APIs directly. Decrypt via `decryptCredentials()` only\n * if you need the `clientToken` to bootstrap the connect frame manually.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements available before authentication, if any.\n * Present when guest checkout is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n}\n\nexport interface ActiveConnection {\n status: ConnectionStatus.active;\n /** The authenticated MoonPay customer. */\n customer: {\n /** The MoonPay customer ID. */\n id: string;\n /** ISO 3166-1 alpha-3 country code for the customer's jurisdiction. */\n country?: string;\n /** State or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). Present when the customer is in a regulated area. */\n area?: string;\n };\n /**\n * Base64-encoded, X25519+AES-GCM encrypted JSON containing:\n * ```json\n * {\n * \"accessToken\": \"<token>\",\n * \"clientToken\": \"<token>\",\n * \"expiresAt\": \"<iso8601>\"\n * }\n * ```\n *\n * - `accessToken`: A token that can be used to make API requests from the client.\n * - `clientToken`: A token that can be used to initialize sensitive frames such as Apple Pay.\n * - `expiresAt`: An ISO 8601 formatted string indicating when the tokens expire.\n */\n credentials: string;\n /**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\n capabilities: CustomerCapabilities;\n}\n\nexport interface UnavailableConnection {\n status: ConnectionStatus.unavailable;\n}\n\nexport interface PendingConnection {\n status: ConnectionStatus.pending;\n}\n\nexport interface FailedConnection {\n status: ConnectionStatus.failed;\n reason: string;\n}\n\nexport interface TermsAcceptanceRequiredConnection {\n status: ConnectionStatus.termsAcceptanceRequired;\n}\n\n/** Discriminated union of all connection result statuses. */\nexport type Connection =\n | ConnectionRequired\n | ActiveConnection\n | UnavailableConnection\n | PendingConnection\n | FailedConnection\n | TermsAcceptanceRequiredConnection;\n\n// ---------------------------------------------------------------------------\n// Decrypted credentials (what the SDK exposes after decryption)\n// ---------------------------------------------------------------------------\n\nexport interface DecryptedCredentials {\n accessToken: string;\n clientToken: string;\n expiresAt: string;\n}\n\n// ---------------------------------------------------------------------------\n// Customer capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Capabilities and regulatory requirements for the authenticated customer.\n */\nexport interface CustomerCapabilities {\n /** Capabilities for the ramps (buy and sell) product. */\n ramps?: RampsCapability;\n /** Capabilities for the guest checkout flow. Present when guest checkout is enabled for the partner and the session is a guest-checkout session. */\n guestCheckout?: RampsCapability;\n}\n\n/**\n * Capabilities and requirements for the ramps (buy and sell) product.\n */\nexport interface RampsCapability {\n /** Regulatory requirements for ramps operations in the customer's jurisdiction. */\n requirements: RampsRequirements;\n}\n\n/**\n * Regulatory requirements that apply to ramps operations for the customer.\n */\nexport interface RampsRequirements {\n /**\n * Present when the customer's jurisdiction requires payment disclosures\n * before a ramps transaction. Omitted when no disclosures are required.\n *\n * @deprecated Use `customer.country`, `customer.administrativeArea`, and `customer.area`\n * from the active connection instead. This field will be removed in a future release.\n */\n paymentDisclosures?: PaymentDisclosuresRequirement;\n}\n\n/**\n * A jurisdiction that requires payment disclosures before a ramps transaction.\n */\nexport interface PaymentDisclosuresRequirement {\n /** The ISO 3166-1 alpha-3 country code for the jurisdiction. */\n country: string;\n /** The state or province code within the country (e.g. `'NY'` for New York). Present for US customers only. */\n administrativeArea?: string;\n /** Supra-national regulatory area code (e.g. `'EEA'`, `'EFTA'`). */\n area?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Connection errors\n// ---------------------------------------------------------------------------\n\nexport enum ConnectionErrorCode {\n validationError = 'validationError',\n /** Wire value is `'generic'`. */\n connectionFailedGeneric = 'generic',\n}\n\nexport interface ConfigValidationFieldError {\n code: 'invalidSessionToken' | 'invalidClientToken' | 'invalidPublicKey';\n message: string;\n}\n\nexport type ConnectionError =\n | {\n code: ConnectionErrorCode.validationError;\n errors: ConfigValidationFieldError[];\n }\n | {\n code: ConnectionErrorCode.connectionFailedGeneric;\n message?: string;\n };\n"],"mappings":";AAIO,IAAK,mBAAL,kBAAKA,sBAAL;AAIL,EAAAA,kBAAA,wBAAqB;AAKrB,EAAAA,kBAAA,YAAS;AAKT,EAAAA,kBAAA,iBAAc;AAKd,EAAAA,kBAAA,aAAU;AAKV,EAAAA,kBAAA,YAAS;AAOT,EAAAA,kBAAA,6BAA0B;AA/BhB,SAAAA;AAAA,GAAA;AA4KL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
@@ -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:\n | 'configurationError'\n | 'invalidQuote'\n | 'quoteExpired'\n | 'oneTapApplePaySecondFactorRequired'\n | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\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: '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":[]}
@@ -4,7 +4,7 @@ import '../models/challenge.cjs';
4
4
  import '../protocol.cjs';
5
5
 
6
6
  type EventError = {
7
- kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'oneTapApplePaySecondFactorRequired' | 'genericError';
7
+ kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';
8
8
  message: string;
9
9
  };
10
10
  type Event = {
@@ -4,7 +4,7 @@ import '../models/challenge.js';
4
4
  import '../protocol.js';
5
5
 
6
6
  type EventError = {
7
- kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'oneTapApplePaySecondFactorRequired' | 'genericError';
7
+ kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';
8
8
  message: string;
9
9
  };
10
10
  type Event = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonpay/platform-protocol",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "Shared protocol types for the MoonPay Developer Platform",
5
5
  "type": "module",
6
6
  "exports": {