@moonpay/platform-protocol 1.22.0 → 1.24.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.
- package/dist/api/errors.cjs +2 -1
- package/dist/api/errors.cjs.map +1 -1
- package/dist/api/errors.d.cts +1 -0
- package/dist/api/errors.d.ts +1 -0
- package/dist/api/errors.js +2 -1
- package/dist/api/errors.js.map +1 -1
- package/dist/frames/auth.cjs.map +1 -1
- package/dist/frames/auth.d.cts +2 -2
- package/dist/frames/auth.d.ts +2 -2
- package/dist/models/connection.cjs.map +1 -1
- package/dist/models/connection.d.cts +9 -0
- package/dist/models/connection.d.ts +9 -0
- package/dist/models/connection.js.map +1 -1
- package/package.json +1 -1
package/dist/api/errors.cjs
CHANGED
|
@@ -43,7 +43,8 @@ var DevPlatformApiErrorCodes = {
|
|
|
43
43
|
requirementsIncomplete: "requirements_incomplete",
|
|
44
44
|
verificationRejected: "verification_rejected",
|
|
45
45
|
countryMismatch: "country_mismatch",
|
|
46
|
-
unsupportedCountry: "unsupported_country"
|
|
46
|
+
unsupportedCountry: "unsupported_country",
|
|
47
|
+
assetNotAvailableInRegion: "asset_not_available_in_region"
|
|
47
48
|
};
|
|
48
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
49
50
|
0 && (module.exports = {
|
package/dist/api/errors.cjs.map
CHANGED
|
@@ -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 GetAssetsError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type SimulateBankTransferError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\n/** @deprecated Use the Customer API errors below instead. */\nexport type CreateIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerError} instead. */\nexport type GetIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerKycError} instead. */\nexport type UpdateIdentityError = DevPlatformApiError;\n/** @deprecated No longer needed — Customer API verification has no direct replacement call. */\nexport type VerifyIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerUploadUrlError} instead. */\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerFilesError} instead. */\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n\nexport type GetCustomerError = DevPlatformApiError;\nexport type SubmitCustomerKycError = DevPlatformApiError;\nexport type GetCustomerUploadUrlError = DevPlatformApiError;\nexport type SubmitCustomerFilesError = DevPlatformApiError;\nexport type ExportCustomerError = 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;
|
|
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 assetNotAvailableInRegion: 'asset_not_available_in_region',\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 SimulateBankTransferError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\n/** @deprecated Use the Customer API errors below instead. */\nexport type CreateIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerError} instead. */\nexport type GetIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerKycError} instead. */\nexport type UpdateIdentityError = DevPlatformApiError;\n/** @deprecated No longer needed — Customer API verification has no direct replacement call. */\nexport type VerifyIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerUploadUrlError} instead. */\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerFilesError} instead. */\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n\nexport type GetCustomerError = DevPlatformApiError;\nexport type SubmitCustomerKycError = DevPlatformApiError;\nexport type GetCustomerUploadUrlError = DevPlatformApiError;\nexport type SubmitCustomerFilesError = DevPlatformApiError;\nexport type ExportCustomerError = 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;AAAA,EACpB,2BAA2B;AAC7B;","names":[]}
|
package/dist/api/errors.d.cts
CHANGED
|
@@ -19,6 +19,7 @@ declare const DevPlatformApiErrorCodes: {
|
|
|
19
19
|
readonly verificationRejected: "verification_rejected";
|
|
20
20
|
readonly countryMismatch: "country_mismatch";
|
|
21
21
|
readonly unsupportedCountry: "unsupported_country";
|
|
22
|
+
readonly assetNotAvailableInRegion: "asset_not_available_in_region";
|
|
22
23
|
};
|
|
23
24
|
type DevPlatformApiErrorCode = (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];
|
|
24
25
|
interface DevPlatformApiErrorDetail {
|
package/dist/api/errors.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const DevPlatformApiErrorCodes: {
|
|
|
19
19
|
readonly verificationRejected: "verification_rejected";
|
|
20
20
|
readonly countryMismatch: "country_mismatch";
|
|
21
21
|
readonly unsupportedCountry: "unsupported_country";
|
|
22
|
+
readonly assetNotAvailableInRegion: "asset_not_available_in_region";
|
|
22
23
|
};
|
|
23
24
|
type DevPlatformApiErrorCode = (typeof DevPlatformApiErrorCodes)[keyof typeof DevPlatformApiErrorCodes];
|
|
24
25
|
interface DevPlatformApiErrorDetail {
|
package/dist/api/errors.js
CHANGED
|
@@ -19,7 +19,8 @@ var DevPlatformApiErrorCodes = {
|
|
|
19
19
|
requirementsIncomplete: "requirements_incomplete",
|
|
20
20
|
verificationRejected: "verification_rejected",
|
|
21
21
|
countryMismatch: "country_mismatch",
|
|
22
|
-
unsupportedCountry: "unsupported_country"
|
|
22
|
+
unsupportedCountry: "unsupported_country",
|
|
23
|
+
assetNotAvailableInRegion: "asset_not_available_in_region"
|
|
23
24
|
};
|
|
24
25
|
export {
|
|
25
26
|
DevPlatformApiErrorCodes
|
package/dist/api/errors.js.map
CHANGED
|
@@ -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 GetAssetsError = DevPlatformApiError;\nexport type GetPaymentMethodsError = DevPlatformApiError;\nexport type GetTransactionsError = DevPlatformApiError;\nexport type SimulateBankTransferError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\n/** @deprecated Use the Customer API errors below instead. */\nexport type CreateIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerError} instead. */\nexport type GetIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerKycError} instead. */\nexport type UpdateIdentityError = DevPlatformApiError;\n/** @deprecated No longer needed — Customer API verification has no direct replacement call. */\nexport type VerifyIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerUploadUrlError} instead. */\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerFilesError} instead. */\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n\nexport type GetCustomerError = DevPlatformApiError;\nexport type SubmitCustomerKycError = DevPlatformApiError;\nexport type GetCustomerUploadUrlError = DevPlatformApiError;\nexport type SubmitCustomerFilesError = DevPlatformApiError;\nexport type ExportCustomerError = 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;
|
|
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 assetNotAvailableInRegion: 'asset_not_available_in_region',\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 SimulateBankTransferError = DevPlatformApiError;\nexport type CreateSessionError = DevPlatformApiError;\nexport type RevokeSessionError = DevPlatformApiError;\n/** @deprecated Use the Customer API errors below instead. */\nexport type CreateIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerError} instead. */\nexport type GetIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerKycError} instead. */\nexport type UpdateIdentityError = DevPlatformApiError;\n/** @deprecated No longer needed — Customer API verification has no direct replacement call. */\nexport type VerifyIdentityError = DevPlatformApiError;\n/** @deprecated Use {@link GetCustomerUploadUrlError} instead. */\nexport type GetIdentityUploadUrlError = DevPlatformApiError;\n/** @deprecated Use {@link SubmitCustomerFilesError} instead. */\nexport type SubmitIdentityFilesError = DevPlatformApiError;\n\nexport type GetCustomerError = DevPlatformApiError;\nexport type SubmitCustomerKycError = DevPlatformApiError;\nexport type GetCustomerUploadUrlError = DevPlatformApiError;\nexport type SubmitCustomerFilesError = DevPlatformApiError;\nexport type ExportCustomerError = 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;AAAA,EACpB,2BAA2B;AAC7B;","names":[]}
|
package/dist/frames/auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/frames/auth.ts"],"sourcesContent":["import type {\n ActiveConnection,\n ConnectionError,\n TermsAcceptanceRequiredConnection,\n} from '../models/connection.js';\n\n/**\n * The auth frame is the lighter-weight counterpart to the connect frame:\n * partners (typically headless / Identity-API integrations) drive the\n * customer through email/OTP authentication only, then receive the\n * encrypted credentials.\n */\nexport interface MessageMap {\n ready: void;\n error: ConnectionError;\n complete: ActiveConnection | TermsAcceptanceRequiredConnection;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/frames/auth.ts"],"sourcesContent":["import type {\n ActiveConnection,\n ConnectionError,\n PendingConnection,\n TermsAcceptanceRequiredConnection,\n} from '../models/connection.js';\n\n/**\n * The auth frame is the lighter-weight counterpart to the connect frame:\n * partners (typically headless / Identity-API integrations) drive the\n * customer through email/OTP authentication only, then receive the\n * encrypted credentials.\n */\nexport interface MessageMap {\n ready: void;\n error: ConnectionError;\n complete: ActiveConnection | PendingConnection | TermsAcceptanceRequiredConnection;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/frames/auth.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionError, ActiveConnection, TermsAcceptanceRequiredConnection } from '../models/connection.cjs';
|
|
1
|
+
import { ConnectionError, ActiveConnection, PendingConnection, TermsAcceptanceRequiredConnection } from '../models/connection.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The auth frame is the lighter-weight counterpart to the connect frame:
|
|
@@ -9,7 +9,7 @@ import { ConnectionError, ActiveConnection, TermsAcceptanceRequiredConnection }
|
|
|
9
9
|
interface MessageMap {
|
|
10
10
|
ready: void;
|
|
11
11
|
error: ConnectionError;
|
|
12
|
-
complete: ActiveConnection | TermsAcceptanceRequiredConnection;
|
|
12
|
+
complete: ActiveConnection | PendingConnection | TermsAcceptanceRequiredConnection;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export type { MessageMap };
|
package/dist/frames/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionError, ActiveConnection, TermsAcceptanceRequiredConnection } from '../models/connection.js';
|
|
1
|
+
import { ConnectionError, ActiveConnection, PendingConnection, TermsAcceptanceRequiredConnection } from '../models/connection.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The auth frame is the lighter-weight counterpart to the connect frame:
|
|
@@ -9,7 +9,7 @@ import { ConnectionError, ActiveConnection, TermsAcceptanceRequiredConnection }
|
|
|
9
9
|
interface MessageMap {
|
|
10
10
|
ready: void;
|
|
11
11
|
error: ConnectionError;
|
|
12
|
-
complete: ActiveConnection | TermsAcceptanceRequiredConnection;
|
|
12
|
+
complete: ActiveConnection | PendingConnection | TermsAcceptanceRequiredConnection;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export type { MessageMap };
|
|
@@ -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 guest checkout is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n /**\n * Set when the session's email and phone number resolve to two different\n * MoonPay customers (a conflict). Partners should route the customer\n * through Connect proactively before rendering payment UI (e.g. Apple Pay or Google Pay).\n *\n * Note: the check-connection frame does not emit this field yet — treat\n * it as absent until frame support ships.\n */\n mismatch?: boolean;\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 or Google 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;
|
|
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 * Set when the session's email and phone number resolve to two different\n * MoonPay customers (a conflict). Partners should route the customer\n * through Connect proactively before rendering payment UI (e.g. Apple Pay or Google Pay).\n *\n * Note: the check-connection frame does not emit this field yet — treat\n * it as absent until frame support ships.\n */\n mismatch?: boolean;\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 or Google 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 /** The MoonPay customer. Use `customer.id` to poll `GET /platform/v1/customers/{id}` until KYC resolves. */\n customer?: ActiveConnection['customer'];\n /**\n * Encrypted credentials, same format as {@link ActiveConnection.credentials}.\n * They allow quotes and KYC status polling while the connection is pending.\n */\n credentials?: string;\n /** Capabilities for the customer; `ramps.status` is `pending`. */\n capabilities?: CustomerCapabilities;\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;AA8LL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
|
|
@@ -88,6 +88,15 @@ interface UnavailableConnection {
|
|
|
88
88
|
}
|
|
89
89
|
interface PendingConnection {
|
|
90
90
|
status: ConnectionStatus.pending;
|
|
91
|
+
/** The MoonPay customer. Use `customer.id` to poll `GET /platform/v1/customers/{id}` until KYC resolves. */
|
|
92
|
+
customer?: ActiveConnection['customer'];
|
|
93
|
+
/**
|
|
94
|
+
* Encrypted credentials, same format as {@link ActiveConnection.credentials}.
|
|
95
|
+
* They allow quotes and KYC status polling while the connection is pending.
|
|
96
|
+
*/
|
|
97
|
+
credentials?: string;
|
|
98
|
+
/** Capabilities for the customer; `ramps.status` is `pending`. */
|
|
99
|
+
capabilities?: CustomerCapabilities;
|
|
91
100
|
}
|
|
92
101
|
interface FailedConnection {
|
|
93
102
|
status: ConnectionStatus.failed;
|
|
@@ -88,6 +88,15 @@ interface UnavailableConnection {
|
|
|
88
88
|
}
|
|
89
89
|
interface PendingConnection {
|
|
90
90
|
status: ConnectionStatus.pending;
|
|
91
|
+
/** The MoonPay customer. Use `customer.id` to poll `GET /platform/v1/customers/{id}` until KYC resolves. */
|
|
92
|
+
customer?: ActiveConnection['customer'];
|
|
93
|
+
/**
|
|
94
|
+
* Encrypted credentials, same format as {@link ActiveConnection.credentials}.
|
|
95
|
+
* They allow quotes and KYC status polling while the connection is pending.
|
|
96
|
+
*/
|
|
97
|
+
credentials?: string;
|
|
98
|
+
/** Capabilities for the customer; `ramps.status` is `pending`. */
|
|
99
|
+
capabilities?: CustomerCapabilities;
|
|
91
100
|
}
|
|
92
101
|
interface FailedConnection {
|
|
93
102
|
status: ConnectionStatus.failed;
|
|
@@ -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 guest checkout is enabled for the partner.\n */\n capabilities?: CustomerCapabilities;\n /**\n * Set when the session's email and phone number resolve to two different\n * MoonPay customers (a conflict). Partners should route the customer\n * through Connect proactively before rendering payment UI (e.g. Apple Pay or Google Pay).\n *\n * Note: the check-connection frame does not emit this field yet — treat\n * it as absent until frame support ships.\n */\n mismatch?: boolean;\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 or Google 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;
|
|
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 * Set when the session's email and phone number resolve to two different\n * MoonPay customers (a conflict). Partners should route the customer\n * through Connect proactively before rendering payment UI (e.g. Apple Pay or Google Pay).\n *\n * Note: the check-connection frame does not emit this field yet — treat\n * it as absent until frame support ships.\n */\n mismatch?: boolean;\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 or Google 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 /** The MoonPay customer. Use `customer.id` to poll `GET /platform/v1/customers/{id}` until KYC resolves. */\n customer?: ActiveConnection['customer'];\n /**\n * Encrypted credentials, same format as {@link ActiveConnection.credentials}.\n * They allow quotes and KYC status polling while the connection is pending.\n */\n credentials?: string;\n /** Capabilities for the customer; `ramps.status` is `pending`. */\n capabilities?: CustomerCapabilities;\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;AA8LL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAHhB,SAAAA;AAAA,GAAA;","names":["ConnectionStatus","ConnectionErrorCode"]}
|