@moonpay/platform-protocol 1.7.0 → 1.9.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.
@@ -357,6 +357,10 @@ type EnhancedDueDiligenceAnswers = {
357
357
  */
358
358
  netWorth: MonetaryAmount;
359
359
  };
360
+ /**
361
+ * Controls how MoonPay fees relate to `source.amount`. `inclusive`: fees are taken out of `source.amount` (the customer pays exactly `source.amount`). `exclusive`: `source.amount` is the amount to convert and fees are added on top (the customer pays `source.amount` plus fees). Only affects quotes priced by `source.amount`; ignored when quoting by `destination.amount`.
362
+ */
363
+ type FeeBehavior = 'inclusive' | 'exclusive';
360
364
  type Fees = {
361
365
  /**
362
366
  * Network fees (in fiat) for the transaction.
@@ -416,6 +420,10 @@ type GetQuoteBody = {
416
420
  * Payment method for the transaction. Required for the quote to be executable.
417
421
  */
418
422
  paymentMethod?: QuotePaymentMethod;
423
+ /**
424
+ * Whether MoonPay fees are included in `source.amount` (`inclusive`) or added on top of it (`exclusive`). Defaults to `inclusive`. Only applies when quoting by `source.amount`; ignored when `destination.amount` is provided.
425
+ */
426
+ feeBehavior?: FeeBehavior;
419
427
  };
420
428
  /**
421
429
  * Quote for a fiat-to-crypto buy. Contains locked rate, fees, expiry, and signature for payment execution.
@@ -456,6 +464,10 @@ type GetQuoteResponse = {
456
464
  * The payment method used for the quote.
457
465
  */
458
466
  paymentMethod: QuotePaymentMethod | null;
467
+ /**
468
+ * How MoonPay fees relate to `source.amount` in this quote. Echoes the requested `feeBehavior`; always `inclusive` when the quote was priced by `destination.amount`.
469
+ */
470
+ feeBehavior: FeeBehavior;
459
471
  limits: QuoteLimits | null;
460
472
  /**
461
473
  * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the quote expires.
@@ -1251,4 +1263,4 @@ type AssetControllerListAssetsResponses = {
1251
1263
  };
1252
1264
  type AssetControllerListAssetsResponse = AssetControllerListAssetsResponses[keyof AssetControllerListAssetsResponses];
1253
1265
 
1254
- export type { MoonPayPaymentsStoredCardPaymentMethod as $, Asset as A, CreateSessionTokenRequestBody as B, CapabilityProduct as C, Customer, CustomerExportBasicDetails, CustomerExportFile, CustomerExportFileSide, CustomerExportFileType, CustomerExportIdentity, CustomerExportPhoneNumber, CustomerExportResidentialAddress, CustomerExportTaxIdentifier, CustomerExportTaxIdentifierType, CustomerKyc, CustomerKycStatus, CreateSessionTokenResponse as D, AssetControllerListAssetsResponse as E, Fees as F, GetQuoteBody as G, MonetaryFeeAmount as H, Identity as I, MoonPayCorePaginationInfo as J, MoonPayPaymentsPaymentMethodAvailability as K, LimitWithAsset as L, MoonPayPaymentsListPaymentMethodsResponse as M, MoonPayPaymentsPaymentMethodCapabilities as N, MoonPayPaymentsPaymentMethod as O, PaymentMethodType as P, PlatformAsset as Q, RequirementEntry as R, SubmitIdentityFilesRequestBody as S, GetQuoteResponse as T, UpdateIdentityRequestBody as U, QuoteLimitEntry as V, QuoteLimits as W, QuotePaymentMethod as X, Stage as Y, StageKind as Z, StageStatus as _, CreateIdentityRequestBody as a, MoonPayPaymentsStoredPaymentMethod as a0, Transaction as a1, TransactionCustomer as a2, TransactionPaymentMethod as a3, TransactionStatus as a4, TransactionWithStages as a5, Wallet as a6, CreateIdentityResidentialAddress as b, IdentityBasicDetailsSubmission as c, IdentityCapability as d, IdentityFileMimeType as e, IdentityFileSide as f, IdentityFileSubmission as g, IdentityFileType as h, IdentityFileUploadUrl as i, IdentityFileUploadUrlHeaders as j, IdentityFileUploadUrlRequestBody as k, IdentityPhoneNumberSubmission as l, IdentityQuestionnaireSubmission as m, IdentityResidentialAddressSubmission as n, IdentityStatus as o, IdentityTaxIdentifierGenericSubmission as p, IdentityTaxIdentifierSchemeSubmission as q, IdentityTaxIdentifierSubmission as r, IdentityVerificationChallenge as s, IdentityVerificationResponse as t, IdentityVerificationStatus as u, RequirementFieldName as v, RequirementItemStatus as w, Requirements as x, AssetBase as y, AssetStatus as z };
1266
+ export type { StageStatus as $, Asset as A, CreateSessionTokenRequestBody as B, CapabilityProduct as C, Customer, CustomerExportBasicDetails, CustomerExportFile, CustomerExportFileSide, CustomerExportFileType, CustomerExportIdentity, CustomerExportPhoneNumber, CustomerExportResidentialAddress, CustomerExportTaxIdentifier, CustomerExportTaxIdentifierType, CustomerKyc, CustomerKycStatus, CreateSessionTokenResponse as D, Fees as E, FeeBehavior as F, GetQuoteBody as G, AssetControllerListAssetsResponse as H, Identity as I, MonetaryFeeAmount as J, MoonPayCorePaginationInfo as K, LimitWithAsset as L, MoonPayPaymentsListPaymentMethodsResponse as M, MoonPayPaymentsPaymentMethodAvailability as N, MoonPayPaymentsPaymentMethodCapabilities as O, MoonPayPaymentsPaymentMethod as P, PaymentMethodType as Q, RequirementEntry as R, SubmitIdentityFilesRequestBody as S, PlatformAsset as T, UpdateIdentityRequestBody as U, GetQuoteResponse as V, QuoteLimitEntry as W, QuoteLimits as X, QuotePaymentMethod as Y, Stage as Z, StageKind as _, CreateIdentityRequestBody as a, MoonPayPaymentsStoredCardPaymentMethod as a0, MoonPayPaymentsStoredPaymentMethod as a1, Transaction as a2, TransactionCustomer as a3, TransactionPaymentMethod as a4, TransactionStatus as a5, TransactionWithStages as a6, Wallet as a7, CreateIdentityResidentialAddress as b, IdentityBasicDetailsSubmission as c, IdentityCapability as d, IdentityFileMimeType as e, IdentityFileSide as f, IdentityFileSubmission as g, IdentityFileType as h, IdentityFileUploadUrl as i, IdentityFileUploadUrlHeaders as j, IdentityFileUploadUrlRequestBody as k, IdentityPhoneNumberSubmission as l, IdentityQuestionnaireSubmission as m, IdentityResidentialAddressSubmission as n, IdentityStatus as o, IdentityTaxIdentifierGenericSubmission as p, IdentityTaxIdentifierSchemeSubmission as q, IdentityTaxIdentifierSubmission as r, IdentityVerificationChallenge as s, IdentityVerificationResponse as t, IdentityVerificationStatus as u, RequirementFieldName as v, RequirementItemStatus as w, Requirements as x, AssetBase as y, AssetStatus as z };
@@ -357,6 +357,10 @@ type EnhancedDueDiligenceAnswers = {
357
357
  */
358
358
  netWorth: MonetaryAmount;
359
359
  };
360
+ /**
361
+ * Controls how MoonPay fees relate to `source.amount`. `inclusive`: fees are taken out of `source.amount` (the customer pays exactly `source.amount`). `exclusive`: `source.amount` is the amount to convert and fees are added on top (the customer pays `source.amount` plus fees). Only affects quotes priced by `source.amount`; ignored when quoting by `destination.amount`.
362
+ */
363
+ type FeeBehavior = 'inclusive' | 'exclusive';
360
364
  type Fees = {
361
365
  /**
362
366
  * Network fees (in fiat) for the transaction.
@@ -416,6 +420,10 @@ type GetQuoteBody = {
416
420
  * Payment method for the transaction. Required for the quote to be executable.
417
421
  */
418
422
  paymentMethod?: QuotePaymentMethod;
423
+ /**
424
+ * Whether MoonPay fees are included in `source.amount` (`inclusive`) or added on top of it (`exclusive`). Defaults to `inclusive`. Only applies when quoting by `source.amount`; ignored when `destination.amount` is provided.
425
+ */
426
+ feeBehavior?: FeeBehavior;
419
427
  };
420
428
  /**
421
429
  * Quote for a fiat-to-crypto buy. Contains locked rate, fees, expiry, and signature for payment execution.
@@ -456,6 +464,10 @@ type GetQuoteResponse = {
456
464
  * The payment method used for the quote.
457
465
  */
458
466
  paymentMethod: QuotePaymentMethod | null;
467
+ /**
468
+ * How MoonPay fees relate to `source.amount` in this quote. Echoes the requested `feeBehavior`; always `inclusive` when the quote was priced by `destination.amount`.
469
+ */
470
+ feeBehavior: FeeBehavior;
459
471
  limits: QuoteLimits | null;
460
472
  /**
461
473
  * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the quote expires.
@@ -1251,4 +1263,4 @@ type AssetControllerListAssetsResponses = {
1251
1263
  };
1252
1264
  type AssetControllerListAssetsResponse = AssetControllerListAssetsResponses[keyof AssetControllerListAssetsResponses];
1253
1265
 
1254
- export type { MoonPayPaymentsStoredCardPaymentMethod as $, Asset as A, CreateSessionTokenRequestBody as B, CapabilityProduct as C, Customer, CustomerExportBasicDetails, CustomerExportFile, CustomerExportFileSide, CustomerExportFileType, CustomerExportIdentity, CustomerExportPhoneNumber, CustomerExportResidentialAddress, CustomerExportTaxIdentifier, CustomerExportTaxIdentifierType, CustomerKyc, CustomerKycStatus, CreateSessionTokenResponse as D, AssetControllerListAssetsResponse as E, Fees as F, GetQuoteBody as G, MonetaryFeeAmount as H, Identity as I, MoonPayCorePaginationInfo as J, MoonPayPaymentsPaymentMethodAvailability as K, LimitWithAsset as L, MoonPayPaymentsListPaymentMethodsResponse as M, MoonPayPaymentsPaymentMethodCapabilities as N, MoonPayPaymentsPaymentMethod as O, PaymentMethodType as P, PlatformAsset as Q, RequirementEntry as R, SubmitIdentityFilesRequestBody as S, GetQuoteResponse as T, UpdateIdentityRequestBody as U, QuoteLimitEntry as V, QuoteLimits as W, QuotePaymentMethod as X, Stage as Y, StageKind as Z, StageStatus as _, CreateIdentityRequestBody as a, MoonPayPaymentsStoredPaymentMethod as a0, Transaction as a1, TransactionCustomer as a2, TransactionPaymentMethod as a3, TransactionStatus as a4, TransactionWithStages as a5, Wallet as a6, CreateIdentityResidentialAddress as b, IdentityBasicDetailsSubmission as c, IdentityCapability as d, IdentityFileMimeType as e, IdentityFileSide as f, IdentityFileSubmission as g, IdentityFileType as h, IdentityFileUploadUrl as i, IdentityFileUploadUrlHeaders as j, IdentityFileUploadUrlRequestBody as k, IdentityPhoneNumberSubmission as l, IdentityQuestionnaireSubmission as m, IdentityResidentialAddressSubmission as n, IdentityStatus as o, IdentityTaxIdentifierGenericSubmission as p, IdentityTaxIdentifierSchemeSubmission as q, IdentityTaxIdentifierSubmission as r, IdentityVerificationChallenge as s, IdentityVerificationResponse as t, IdentityVerificationStatus as u, RequirementFieldName as v, RequirementItemStatus as w, Requirements as x, AssetBase as y, AssetStatus as z };
1266
+ export type { StageStatus as $, Asset as A, CreateSessionTokenRequestBody as B, CapabilityProduct as C, Customer, CustomerExportBasicDetails, CustomerExportFile, CustomerExportFileSide, CustomerExportFileType, CustomerExportIdentity, CustomerExportPhoneNumber, CustomerExportResidentialAddress, CustomerExportTaxIdentifier, CustomerExportTaxIdentifierType, CustomerKyc, CustomerKycStatus, CreateSessionTokenResponse as D, Fees as E, FeeBehavior as F, GetQuoteBody as G, AssetControllerListAssetsResponse as H, Identity as I, MonetaryFeeAmount as J, MoonPayCorePaginationInfo as K, LimitWithAsset as L, MoonPayPaymentsListPaymentMethodsResponse as M, MoonPayPaymentsPaymentMethodAvailability as N, MoonPayPaymentsPaymentMethodCapabilities as O, MoonPayPaymentsPaymentMethod as P, PaymentMethodType as Q, RequirementEntry as R, SubmitIdentityFilesRequestBody as S, PlatformAsset as T, UpdateIdentityRequestBody as U, GetQuoteResponse as V, QuoteLimitEntry as W, QuoteLimits as X, QuotePaymentMethod as Y, Stage as Z, StageKind as _, CreateIdentityRequestBody as a, MoonPayPaymentsStoredCardPaymentMethod as a0, MoonPayPaymentsStoredPaymentMethod as a1, Transaction as a2, TransactionCustomer as a3, TransactionPaymentMethod as a4, TransactionStatus as a5, TransactionWithStages as a6, Wallet as a7, CreateIdentityResidentialAddress as b, IdentityBasicDetailsSubmission as c, IdentityCapability as d, IdentityFileMimeType as e, IdentityFileSide as f, IdentityFileSubmission as g, IdentityFileType as h, IdentityFileUploadUrl as i, IdentityFileUploadUrlHeaders as j, IdentityFileUploadUrlRequestBody as k, IdentityPhoneNumberSubmission as l, IdentityQuestionnaireSubmission as m, IdentityResidentialAddressSubmission as n, IdentityStatus as o, IdentityTaxIdentifierGenericSubmission as p, IdentityTaxIdentifierSchemeSubmission as q, IdentityTaxIdentifierSubmission as r, IdentityVerificationChallenge as s, IdentityVerificationResponse as t, IdentityVerificationStatus as u, RequirementFieldName as v, RequirementItemStatus as w, Requirements as x, AssetBase as y, AssetStatus as z };
@@ -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 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":[]}
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 FeeBehavior,\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":[]}
@@ -1 +1 @@
1
- export { A as Asset, y as AssetBase, z as AssetStatus, B as CreateSessionTokenRequestBody, D as CreateSessionTokenReturnType, F as Fees, G as GetQuoteParams, L as LimitWithAsset, E as ListAssetsResponse, M as ListPaymentMethodsResponse, H as MonetaryFeeAmount, J as PaginationInfo, K as PaymentMethodAvailability, N as PaymentMethodCapabilities, O as PaymentMethodConfig, P as PaymentMethodType, Q as PlatformAsset, T as Quote, V as QuoteLimitEntry, W as QuoteLimits, X as QuotePaymentMethod, Y as Stage, Z as StageKind, _ as StageStatus, $ as StoredCardPaymentMethod, a0 as StoredPaymentMethod, a1 as Transaction, a2 as TransactionCustomer, a3 as TransactionPaymentMethod, a4 as TransactionStatus, a5 as TransactionWithStages, a6 as Wallet } from './customer.cjs';
1
+ export { A as Asset, y as AssetBase, z as AssetStatus, B as CreateSessionTokenRequestBody, D as CreateSessionTokenReturnType, F as FeeBehavior, E as Fees, G as GetQuoteParams, L as LimitWithAsset, H as ListAssetsResponse, M as ListPaymentMethodsResponse, J as MonetaryFeeAmount, K as PaginationInfo, N as PaymentMethodAvailability, O as PaymentMethodCapabilities, P as PaymentMethodConfig, Q as PaymentMethodType, T as PlatformAsset, V as Quote, W as QuoteLimitEntry, X as QuoteLimits, Y as QuotePaymentMethod, Z as Stage, _ as StageKind, $ as StageStatus, a0 as StoredCardPaymentMethod, a1 as StoredPaymentMethod, a2 as Transaction, a3 as TransactionCustomer, a4 as TransactionPaymentMethod, a5 as TransactionStatus, a6 as TransactionWithStages, a7 as Wallet } from './customer.cjs';
@@ -1 +1 @@
1
- export { A as Asset, y as AssetBase, z as AssetStatus, B as CreateSessionTokenRequestBody, D as CreateSessionTokenReturnType, F as Fees, G as GetQuoteParams, L as LimitWithAsset, E as ListAssetsResponse, M as ListPaymentMethodsResponse, H as MonetaryFeeAmount, J as PaginationInfo, K as PaymentMethodAvailability, N as PaymentMethodCapabilities, O as PaymentMethodConfig, P as PaymentMethodType, Q as PlatformAsset, T as Quote, V as QuoteLimitEntry, W as QuoteLimits, X as QuotePaymentMethod, Y as Stage, Z as StageKind, _ as StageStatus, $ as StoredCardPaymentMethod, a0 as StoredPaymentMethod, a1 as Transaction, a2 as TransactionCustomer, a3 as TransactionPaymentMethod, a4 as TransactionStatus, a5 as TransactionWithStages, a6 as Wallet } from './customer.js';
1
+ export { A as Asset, y as AssetBase, z as AssetStatus, B as CreateSessionTokenRequestBody, D as CreateSessionTokenReturnType, F as FeeBehavior, E as Fees, G as GetQuoteParams, L as LimitWithAsset, H as ListAssetsResponse, M as ListPaymentMethodsResponse, J as MonetaryFeeAmount, K as PaginationInfo, N as PaymentMethodAvailability, O as PaymentMethodCapabilities, P as PaymentMethodConfig, Q as PaymentMethodType, T as PlatformAsset, V as Quote, W as QuoteLimitEntry, X as QuoteLimits, Y as QuotePaymentMethod, Z as Stage, _ as StageKind, $ as StageStatus, a0 as StoredCardPaymentMethod, a1 as StoredPaymentMethod, a2 as Transaction, a3 as TransactionCustomer, a4 as TransactionPaymentMethod, a5 as TransactionStatus, a6 as TransactionWithStages, a7 as Wallet } from './customer.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/apple-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'\n >;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/apple-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Apple Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -5,6 +5,13 @@ import { FrameError } from '../protocol.cjs';
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
7
  error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'>;
8
+ /**
9
+ * Fired the instant the user taps the native Apple Pay button, BEFORE the OS
10
+ * payment sheet is presented. This is an intent-to-buy / tap signal, distinct
11
+ * from `complete` (the purchase outcome). It fires unconditionally on tap,
12
+ * even if the user later cancels the sheet.
13
+ */
14
+ buttonPressed: void;
8
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
16
  challenge: ChallengeRequired;
10
17
  complete: {
@@ -5,6 +5,13 @@ import { FrameError } from '../protocol.js';
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
7
  error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'applePayUnavailable' | 'generic'>;
8
+ /**
9
+ * Fired the instant the user taps the native Apple Pay button, BEFORE the OS
10
+ * payment sheet is presented. This is an intent-to-buy / tap signal, distinct
11
+ * from `complete` (the purchase outcome). It fires unconditionally on tap,
12
+ * even if the user later cancels the sheet.
13
+ */
14
+ buttonPressed: void;
8
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
16
  challenge: ChallengeRequired;
10
17
  complete: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/buy-button.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 MessageMap {\n /** Frame's UI is rendered and ready to be shown. */\n ready: void;\n complete: { transaction: FrameTransaction };\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n error: FrameError;\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/buy-button.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 MessageMap {\n /** Frame's UI is rendered and ready to be shown. */\n ready: void;\n /**\n * Fired the instant the user taps the native wallet-pay button (Apple Pay /\n * Google Pay) rendered by the buy button frame, BEFORE the OS payment sheet is\n * presented. This is an intent-to-buy / tap signal, distinct from `complete`\n * (the purchase outcome). It fires unconditionally on tap, even if the user\n * later cancels the sheet.\n */\n buttonPressed: void;\n complete: { transaction: FrameTransaction };\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n error: FrameError;\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -5,6 +5,14 @@ import { FrameError } from '../protocol.cjs';
5
5
  interface MessageMap {
6
6
  /** Frame's UI is rendered and ready to be shown. */
7
7
  ready: void;
8
+ /**
9
+ * Fired the instant the user taps the native wallet-pay button (Apple Pay /
10
+ * Google Pay) rendered by the buy button frame, BEFORE the OS payment sheet is
11
+ * presented. This is an intent-to-buy / tap signal, distinct from `complete`
12
+ * (the purchase outcome). It fires unconditionally on tap, even if the user
13
+ * later cancels the sheet.
14
+ */
15
+ buttonPressed: void;
8
16
  complete: {
9
17
  transaction: FrameTransaction;
10
18
  };
@@ -5,6 +5,14 @@ import { FrameError } from '../protocol.js';
5
5
  interface MessageMap {
6
6
  /** Frame's UI is rendered and ready to be shown. */
7
7
  ready: void;
8
+ /**
9
+ * Fired the instant the user taps the native wallet-pay button (Apple Pay /
10
+ * Google Pay) rendered by the buy button frame, BEFORE the OS payment sheet is
11
+ * presented. This is an intent-to-buy / tap signal, distinct from `complete`
12
+ * (the purchase outcome). It fires unconditionally on tap, even if the user
13
+ * later cancels the sheet.
14
+ */
15
+ buttonPressed: void;
8
16
  complete: {
9
17
  transaction: FrameTransaction;
10
18
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/frames/google-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'\n >;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/frames/google-pay.ts"],"sourcesContent":["import type { ChallengeRequired } from '../models/challenge.js';\nimport type { FrameTransaction } from '../models/transaction.js';\nimport type { FrameError } from '../protocol.js';\n\nexport interface InboundMessageMap {\n ready: void;\n error: FrameError<\n 'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'\n >;\n /**\n * Fired the instant the user taps the native Google Pay button, BEFORE the OS\n * payment sheet is presented. This is an intent-to-buy / tap signal, distinct\n * from `complete` (the purchase outcome). It fires unconditionally on tap,\n * even if the user later cancels the sheet.\n */\n buttonPressed: void;\n /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */\n challenge: ChallengeRequired;\n complete: { transaction: FrameTransaction };\n}\n\nexport interface OutboundMessageMap {\n setQuote: { quote: { signature: string } };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -5,6 +5,13 @@ import { FrameError } from '../protocol.cjs';
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
7
  error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'>;
8
+ /**
9
+ * Fired the instant the user taps the native Google Pay button, BEFORE the OS
10
+ * payment sheet is presented. This is an intent-to-buy / tap signal, distinct
11
+ * from `complete` (the purchase outcome). It fires unconditionally on tap,
12
+ * even if the user later cancels the sheet.
13
+ */
14
+ buttonPressed: void;
8
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
16
  challenge: ChallengeRequired;
10
17
  complete: {
@@ -5,6 +5,13 @@ import { FrameError } from '../protocol.js';
5
5
  interface InboundMessageMap {
6
6
  ready: void;
7
7
  error: FrameError<'configurationError' | 'quoteExpired' | 'invalidQuote' | 'googlePayUnavailable' | 'generic'>;
8
+ /**
9
+ * Fired the instant the user taps the native Google Pay button, BEFORE the OS
10
+ * payment sheet is presented. This is an intent-to-buy / tap signal, distinct
11
+ * from `complete` (the purchase outcome). It fires unconditionally on tap,
12
+ * even if the user later cancels the sheet.
13
+ */
14
+ buttonPressed: void;
8
15
  /** Signals that the pipeline requires a challenge step. Load `url` in a challenge frame. */
9
16
  challenge: ChallengeRequired;
10
17
  complete: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdks/apple-pay.ts"],"sourcesContent":["import type * as ApplePayFrame from '../frames/apple-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: ApplePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/sdks/apple-pay.ts"],"sourcesContent":["import type * as ApplePayFrame from '../frames/apple-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: ApplePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -9,6 +9,8 @@ type EventError = {
9
9
  };
10
10
  type Event = {
11
11
  kind: 'ready';
12
+ } | {
13
+ kind: 'buttonPressed';
12
14
  } | {
13
15
  kind: 'complete';
14
16
  payload: {
@@ -9,6 +9,8 @@ type EventError = {
9
9
  };
10
10
  type Event = {
11
11
  kind: 'ready';
12
+ } | {
13
+ kind: 'buttonPressed';
12
14
  } | {
13
15
  kind: 'complete';
14
16
  payload: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdks/buy-button.ts"],"sourcesContent":["import type * as BuyButtonFrame from '../frames/buy-button.js';\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'complete'; payload: BuyButtonFrame.MessageMap['complete'] }\n | { kind: 'challenge'; payload: BuyButtonFrame.MessageMap['challenge'] }\n | { kind: 'error'; payload: BuyButtonFrame.MessageMap['error'] };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/sdks/buy-button.ts"],"sourcesContent":["import type * as BuyButtonFrame from '../frames/buy-button.js';\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: BuyButtonFrame.MessageMap['complete'] }\n | { kind: 'challenge'; payload: BuyButtonFrame.MessageMap['challenge'] }\n | { kind: 'error'; payload: BuyButtonFrame.MessageMap['error'] };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -5,6 +5,8 @@ import '../protocol.cjs';
5
5
 
6
6
  type Event = {
7
7
  kind: 'ready';
8
+ } | {
9
+ kind: 'buttonPressed';
8
10
  } | {
9
11
  kind: 'complete';
10
12
  payload: MessageMap['complete'];
@@ -5,6 +5,8 @@ import '../protocol.js';
5
5
 
6
6
  type Event = {
7
7
  kind: 'ready';
8
+ } | {
9
+ kind: 'buttonPressed';
8
10
  } | {
9
11
  kind: 'complete';
10
12
  payload: MessageMap['complete'];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/sdks/google-pay.ts"],"sourcesContent":["import type * as GooglePayFrame from '../frames/google-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: GooglePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/sdks/google-pay.ts"],"sourcesContent":["import type * as GooglePayFrame from '../frames/google-pay.js';\nimport type { FrameTransaction } from '../models/transaction.js';\n\nexport type EventError = {\n kind: 'configurationError' | 'invalidQuote' | 'quoteExpired' | 'genericError';\n message: string;\n};\n\nexport type Event =\n | { kind: 'ready' }\n | { kind: 'buttonPressed' }\n | { kind: 'complete'; payload: { transaction: FrameTransaction } }\n | { kind: 'challenge'; payload: GooglePayFrame.InboundMessageMap['challenge'] }\n | { kind: 'quoteExpired'; payload: { setQuote: (signature: string) => void } }\n | { kind: 'error'; payload: EventError }\n | { kind: 'unsupported' };\n\nexport interface SetupError {\n kind: 'configurationError' | 'genericError';\n message: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -9,6 +9,8 @@ type EventError = {
9
9
  };
10
10
  type Event = {
11
11
  kind: 'ready';
12
+ } | {
13
+ kind: 'buttonPressed';
12
14
  } | {
13
15
  kind: 'complete';
14
16
  payload: {
@@ -9,6 +9,8 @@ type EventError = {
9
9
  };
10
10
  type Event = {
11
11
  kind: 'ready';
12
+ } | {
13
+ kind: 'buttonPressed';
12
14
  } | {
13
15
  kind: 'complete';
14
16
  payload: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonpay/platform-protocol",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Shared protocol types for the MoonPay Developer Platform",
5
5
  "type": "module",
6
6
  "exports": {