@moonpay/platform-protocol 0.3.0 → 1.0.2

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.
Files changed (175) hide show
  1. package/README.md +45 -0
  2. package/dist/{index.cjs → api/errors.cjs} +7 -51
  3. package/dist/api/errors.cjs.map +1 -0
  4. package/dist/api/errors.d.cts +46 -0
  5. package/dist/api/errors.d.ts +46 -0
  6. package/dist/api/errors.js +27 -0
  7. package/dist/api/errors.js.map +1 -0
  8. package/dist/api/identity.cjs +19 -0
  9. package/dist/api/identity.cjs.map +1 -0
  10. package/dist/api/identity.d.cts +156 -0
  11. package/dist/api/identity.d.ts +156 -0
  12. package/dist/api/identity.js +1 -0
  13. package/dist/api/identity.js.map +1 -0
  14. package/dist/api/index.cjs +19 -0
  15. package/dist/api/index.cjs.map +1 -0
  16. package/dist/api/index.d.cts +466 -0
  17. package/dist/api/index.d.ts +466 -0
  18. package/dist/api/index.js +1 -0
  19. package/dist/api/index.js.map +1 -0
  20. package/dist/frames/add-card.cjs +19 -0
  21. package/dist/frames/add-card.cjs.map +1 -0
  22. package/dist/frames/add-card.d.cts +24 -0
  23. package/dist/frames/add-card.d.ts +24 -0
  24. package/dist/frames/add-card.js +1 -0
  25. package/dist/frames/add-card.js.map +1 -0
  26. package/dist/frames/apple-pay.cjs +19 -0
  27. package/dist/frames/apple-pay.cjs.map +1 -0
  28. package/dist/frames/apple-pay.d.cts +22 -0
  29. package/dist/frames/apple-pay.d.ts +22 -0
  30. package/dist/frames/apple-pay.js +1 -0
  31. package/dist/frames/apple-pay.js.map +1 -0
  32. package/dist/frames/auth.cjs +19 -0
  33. package/dist/frames/auth.cjs.map +1 -0
  34. package/dist/frames/auth.d.cts +15 -0
  35. package/dist/frames/auth.d.ts +15 -0
  36. package/dist/frames/auth.js +1 -0
  37. package/dist/frames/auth.js.map +1 -0
  38. package/dist/frames/buy-button.cjs +19 -0
  39. package/dist/frames/buy-button.cjs.map +1 -0
  40. package/dist/frames/buy-button.d.cts +21 -0
  41. package/dist/frames/buy-button.d.ts +21 -0
  42. package/dist/frames/buy-button.js +1 -0
  43. package/dist/frames/buy-button.js.map +1 -0
  44. package/dist/frames/buy.cjs +19 -0
  45. package/dist/frames/buy.cjs.map +1 -0
  46. package/dist/frames/buy.d.cts +22 -0
  47. package/dist/frames/buy.d.ts +22 -0
  48. package/dist/frames/buy.js +1 -0
  49. package/dist/frames/buy.js.map +1 -0
  50. package/dist/frames/challenge.cjs +19 -0
  51. package/dist/frames/challenge.cjs.map +1 -0
  52. package/dist/frames/challenge.d.cts +30 -0
  53. package/dist/frames/challenge.d.ts +30 -0
  54. package/dist/frames/challenge.js +1 -0
  55. package/dist/frames/challenge.js.map +1 -0
  56. package/dist/frames/connect.cjs +19 -0
  57. package/dist/frames/connect.cjs.map +1 -0
  58. package/dist/frames/connect.d.cts +9 -0
  59. package/dist/frames/connect.d.ts +9 -0
  60. package/dist/frames/connect.js +1 -0
  61. package/dist/frames/connect.js.map +1 -0
  62. package/dist/frames/google-pay.cjs +19 -0
  63. package/dist/frames/google-pay.cjs.map +1 -0
  64. package/dist/frames/google-pay.d.cts +22 -0
  65. package/dist/frames/google-pay.d.ts +22 -0
  66. package/dist/frames/google-pay.js +1 -0
  67. package/dist/frames/google-pay.js.map +1 -0
  68. package/dist/frames/reset.cjs +19 -0
  69. package/dist/frames/reset.cjs.map +1 -0
  70. package/dist/frames/reset.d.cts +12 -0
  71. package/dist/frames/reset.d.ts +12 -0
  72. package/dist/frames/reset.js +1 -0
  73. package/dist/frames/reset.js.map +1 -0
  74. package/dist/frames/widget.cjs +19 -0
  75. package/dist/frames/widget.cjs.map +1 -0
  76. package/dist/frames/widget.d.cts +19 -0
  77. package/dist/frames/widget.d.ts +19 -0
  78. package/dist/frames/widget.js +1 -0
  79. package/dist/frames/widget.js.map +1 -0
  80. package/dist/models/challenge.cjs +19 -0
  81. package/dist/models/challenge.cjs.map +1 -0
  82. package/dist/models/challenge.d.cts +12 -0
  83. package/dist/models/challenge.d.ts +12 -0
  84. package/dist/models/challenge.js +1 -0
  85. package/dist/models/challenge.js.map +1 -0
  86. package/dist/models/connection.cjs +46 -0
  87. package/dist/models/connection.cjs.map +1 -0
  88. package/dist/models/connection.d.cts +154 -0
  89. package/dist/models/connection.d.ts +154 -0
  90. package/dist/models/connection.js +20 -0
  91. package/dist/models/connection.js.map +1 -0
  92. package/dist/models/transaction.cjs +19 -0
  93. package/dist/models/transaction.cjs.map +1 -0
  94. package/dist/models/transaction.d.cts +15 -0
  95. package/dist/models/transaction.d.ts +15 -0
  96. package/dist/models/transaction.js +1 -0
  97. package/dist/models/transaction.js.map +1 -0
  98. package/dist/protocol.cjs +34 -0
  99. package/dist/protocol.cjs.map +1 -0
  100. package/dist/protocol.d.cts +30 -0
  101. package/dist/protocol.d.ts +30 -0
  102. package/dist/protocol.js +8 -0
  103. package/dist/protocol.js.map +1 -0
  104. package/dist/result.cjs +40 -0
  105. package/dist/result.cjs.map +1 -0
  106. package/dist/result.d.cts +30 -0
  107. package/dist/result.d.ts +30 -0
  108. package/dist/result.js +14 -0
  109. package/dist/result.js.map +1 -0
  110. package/dist/sdks/add-card.cjs +19 -0
  111. package/dist/sdks/add-card.cjs.map +1 -0
  112. package/dist/sdks/add-card.d.cts +20 -0
  113. package/dist/sdks/add-card.d.ts +20 -0
  114. package/dist/sdks/add-card.js +1 -0
  115. package/dist/sdks/add-card.js.map +1 -0
  116. package/dist/sdks/apple-pay.cjs +19 -0
  117. package/dist/sdks/apple-pay.cjs.map +1 -0
  118. package/dist/sdks/apple-pay.d.cts +36 -0
  119. package/dist/sdks/apple-pay.d.ts +36 -0
  120. package/dist/sdks/apple-pay.js +1 -0
  121. package/dist/sdks/apple-pay.js.map +1 -0
  122. package/dist/sdks/auth.cjs +19 -0
  123. package/dist/sdks/auth.cjs.map +1 -0
  124. package/dist/sdks/auth.d.cts +18 -0
  125. package/dist/sdks/auth.d.ts +18 -0
  126. package/dist/sdks/auth.js +1 -0
  127. package/dist/sdks/auth.js.map +1 -0
  128. package/dist/sdks/buy-button.cjs +19 -0
  129. package/dist/sdks/buy-button.cjs.map +1 -0
  130. package/dist/sdks/buy-button.d.cts +21 -0
  131. package/dist/sdks/buy-button.d.ts +21 -0
  132. package/dist/sdks/buy-button.js +1 -0
  133. package/dist/sdks/buy-button.js.map +1 -0
  134. package/dist/sdks/buy.cjs +19 -0
  135. package/dist/sdks/buy.cjs.map +1 -0
  136. package/dist/sdks/buy.d.cts +23 -0
  137. package/dist/sdks/buy.d.ts +23 -0
  138. package/dist/sdks/buy.js +1 -0
  139. package/dist/sdks/buy.js.map +1 -0
  140. package/dist/sdks/challenge.cjs +19 -0
  141. package/dist/sdks/challenge.cjs.map +1 -0
  142. package/dist/sdks/challenge.d.cts +22 -0
  143. package/dist/sdks/challenge.d.ts +22 -0
  144. package/dist/sdks/challenge.js +1 -0
  145. package/dist/sdks/challenge.js.map +1 -0
  146. package/dist/sdks/connect.cjs +19 -0
  147. package/dist/sdks/connect.cjs.map +1 -0
  148. package/dist/sdks/connect.d.cts +20 -0
  149. package/dist/sdks/connect.d.ts +20 -0
  150. package/dist/sdks/connect.js +1 -0
  151. package/dist/sdks/connect.js.map +1 -0
  152. package/dist/sdks/google-pay.cjs +19 -0
  153. package/dist/sdks/google-pay.cjs.map +1 -0
  154. package/dist/sdks/google-pay.d.cts +36 -0
  155. package/dist/sdks/google-pay.d.ts +36 -0
  156. package/dist/sdks/google-pay.js +1 -0
  157. package/dist/sdks/google-pay.js.map +1 -0
  158. package/dist/sdks/reset.cjs +19 -0
  159. package/dist/sdks/reset.cjs.map +1 -0
  160. package/dist/sdks/reset.d.cts +5 -0
  161. package/dist/sdks/reset.d.ts +5 -0
  162. package/dist/sdks/reset.js +1 -0
  163. package/dist/sdks/reset.js.map +1 -0
  164. package/dist/sdks/widget.cjs +19 -0
  165. package/dist/sdks/widget.cjs.map +1 -0
  166. package/dist/sdks/widget.d.cts +26 -0
  167. package/dist/sdks/widget.d.ts +26 -0
  168. package/dist/sdks/widget.js +1 -0
  169. package/dist/sdks/widget.js.map +1 -0
  170. package/package.json +278 -11
  171. package/dist/index.cjs.map +0 -1
  172. package/dist/index.d.cts +0 -1289
  173. package/dist/index.d.ts +0 -1289
  174. package/dist/index.js +0 -63
  175. package/dist/index.js.map +0 -1
@@ -0,0 +1,466 @@
1
+ /**
2
+ * A fiat currency or crypto token
3
+ */
4
+ type Asset = {
5
+ /**
6
+ * A fiat or crypto currency code.
7
+ *
8
+ * **Fiat**
9
+ * Fiat codes are represented as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes.
10
+ *
11
+ * Currently only `USD` is supported.
12
+ *
13
+ * **Crypto**
14
+ * For crypto currency codes, see [supported currencies](https://dev.moonpay.com/docs/list-of-supported-cryptocurrencies).
15
+ *
16
+ * Examples: `BTC` `SOL` `ETH` `USDC_BASE` `USDC_SOL`
17
+ */
18
+ code: string;
19
+ /**
20
+ * The human-readable name
21
+ */
22
+ name?: string;
23
+ /**
24
+ * The number of supported decimal places
25
+ */
26
+ precision?: number;
27
+ };
28
+ type AssetBase = {
29
+ /**
30
+ * A fiat or crypto currency code.
31
+ *
32
+ * **Fiat**
33
+ * Fiat codes are represented as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes.
34
+ *
35
+ * Currently only `USD` is supported.
36
+ *
37
+ * **Crypto**
38
+ * For crypto currency codes, see [supported currencies](https://dev.moonpay.com/docs/list-of-supported-cryptocurrencies).
39
+ *
40
+ * Examples: `BTC` `SOL` `ETH` `USDC_BASE` `USDC_SOL`
41
+ */
42
+ code: string;
43
+ };
44
+ type CreateSessionTokenRequestBody = {
45
+ /**
46
+ * A unique identifier for the customer from your system.
47
+ */
48
+ externalCustomerId?: string;
49
+ /**
50
+ * The IP address of the user's device to ensure the integrity of the session. Both IPv4 and IPv6 values are supported.
51
+ */
52
+ deviceIp: IPv4Address | IPv6Address;
53
+ /**
54
+ * The customer's email address. Must be a valid email. If provided, `phoneNumber` must also be provided.
55
+ */
56
+ email?: string;
57
+ /**
58
+ * The customer's phone number in E.164 format. If provided, `email` must also be provided.
59
+ */
60
+ phoneNumber?: string;
61
+ };
62
+ type CreateSessionTokenResponse = {
63
+ /**
64
+ * An opaque session token used to set up a connection on your frontend. This token is single-use and must be generated each time the customer visits your app.
65
+ *
66
+ * Token expires 24 hours after issuance.
67
+ */
68
+ sessionToken: string;
69
+ };
70
+ type Fees = {
71
+ /**
72
+ * Network fees (in fiat) for the transaction.
73
+ */
74
+ network?: MonetaryFeeAmount;
75
+ /**
76
+ * MoonPay fees (in fiat) for the transaction.
77
+ */
78
+ moonpay?: MonetaryFeeAmount;
79
+ /**
80
+ * Ecosystem fees (in fiat) for the transaction, if applicable.
81
+ */
82
+ ecosystem?: MonetaryFeeAmount;
83
+ /**
84
+ * Partner fees (in fiat) for the transaction, if applicable. Deprecated: use `fees.ecosystem` instead. This field will be removed in a future release.
85
+ * @deprecated
86
+ */
87
+ partner?: MonetaryFeeAmount;
88
+ };
89
+ type GetQuoteBody = {
90
+ /**
91
+ * Source asset in fiat. Amount can be set in `source` or `destination`.
92
+ */
93
+ source: {
94
+ /**
95
+ * The currency or token being spent
96
+ */
97
+ asset: AssetBase;
98
+ /**
99
+ * A stringified amount, which can include decimals.
100
+ */
101
+ amount?: string;
102
+ };
103
+ /**
104
+ * Destination asset in crypto. Amount can be set in `destination` or `source`.
105
+ */
106
+ destination: {
107
+ asset: AssetBase;
108
+ /**
109
+ * The amount being received, if known
110
+ */
111
+ amount?: string;
112
+ };
113
+ /**
114
+ * Wallet address and optional tag where the crypto will be sent. Required for the quote to be executable.
115
+ */
116
+ wallet?: Wallet;
117
+ /**
118
+ * Payment method for the transaction. Required for the quote to be executable.
119
+ */
120
+ paymentMethod?: QuotePaymentMethod;
121
+ };
122
+ /**
123
+ * Quote for a fiat-to-crypto buy. Contains locked rate, fees, expiry, and signature for payment execution.
124
+ */
125
+ type GetQuoteResponse = {
126
+ /**
127
+ * Source side of the quote: amount and asset (fiat currency) you send.
128
+ */
129
+ source: {
130
+ /**
131
+ * A stringified amount, which can include decimals.
132
+ */
133
+ amount: string;
134
+ /**
135
+ * The currency or token being spent
136
+ */
137
+ asset: Asset;
138
+ };
139
+ /**
140
+ * Destination side of the quote: amount and asset (cryptocurrency) the customer receives.
141
+ */
142
+ destination: {
143
+ /**
144
+ * A stringified amount, which can include decimals.
145
+ */
146
+ amount: string;
147
+ asset: Asset;
148
+ };
149
+ /**
150
+ * Breakdown of network, MoonPay, and ecosystem fees.
151
+ */
152
+ fees: Fees;
153
+ /**
154
+ * Wallet address and optional tag where the crypto will be sent. Null when not provided.
155
+ */
156
+ wallet: Wallet | null;
157
+ /**
158
+ * The payment method used for the quote.
159
+ */
160
+ paymentMethod: QuotePaymentMethod | null;
161
+ limits: QuoteLimits | null;
162
+ /**
163
+ * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the quote expires.
164
+ */
165
+ expiresAt: string;
166
+ /**
167
+ * Whether the quote can be executed. Only `executable` quotes can be used to initiate payment frames.
168
+ */
169
+ executable: boolean;
170
+ /**
171
+ * The rate used to convert fiat <-> crypto, expressed as the crypto value of one unit of fiat.
172
+ */
173
+ exchangeRate: string;
174
+ /**
175
+ * 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
+ */
177
+ paymentDisclosures: Array<PaymentDisclosure>;
178
+ /**
179
+ * An opaque token representing the quote to initiate payment frames.
180
+ */
181
+ signature: string;
182
+ };
183
+ type IPv4Address = string;
184
+ type IPv6Address = string;
185
+ type LimitWithAsset = {
186
+ /**
187
+ * A stringified amount, which can include decimals.
188
+ */
189
+ amount: string;
190
+ asset: AssetBase;
191
+ };
192
+ type MonetaryFeeAmount = {
193
+ /**
194
+ * The amount of fees in fiat.
195
+ */
196
+ amount: string;
197
+ /**
198
+ * The fiat currency used to pay the fees.
199
+ */
200
+ asset: AssetBase;
201
+ };
202
+ type MoonPayCorePaginationInfo = {
203
+ /**
204
+ * The cursor to use as the starting point for the next page of results.
205
+ */
206
+ nextCursor: string | null;
207
+ };
208
+ /**
209
+ * The card network brand.
210
+ */
211
+ type MoonPayPaymentsCardBrand = 'visa' | 'mastercard' | 'maestro' | 'american_express' | 'other';
212
+ /**
213
+ * The type of card: credit, debit, or unknown.
214
+ */
215
+ type MoonPayPaymentsCardType = 'credit' | 'debit' | 'unknown';
216
+ type MoonPayPaymentsListPaymentMethodsResponse = {
217
+ /**
218
+ * List of available payment method configurations
219
+ */
220
+ paymentMethodConfigs?: Array<MoonPayPaymentsPaymentMethod>;
221
+ /**
222
+ * List of stored payment methods available for the customer
223
+ */
224
+ paymentMethods?: Array<MoonPayPaymentsStoredPaymentMethod>;
225
+ };
226
+ type MoonPayPaymentsPaymentMethod = {
227
+ type: PaymentMethodType;
228
+ /**
229
+ * Details of how the payment method can be used.
230
+ */
231
+ capabilities: MoonPayPaymentsPaymentMethodCapabilities;
232
+ availability: MoonPayPaymentsPaymentMethodAvailability;
233
+ };
234
+ type MoonPayPaymentsPaymentMethodAvailability = {
235
+ /**
236
+ * Whether the payment method is available
237
+ */
238
+ active: boolean;
239
+ /**
240
+ * If the payment method is not available, reasons explaining why.
241
+ */
242
+ reasons?: Array<string>;
243
+ };
244
+ type MoonPayPaymentsPaymentMethodCapabilities = {
245
+ /**
246
+ * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes of fiat currencies supported by this payment method.
247
+ */
248
+ supportedCurrencies: Array<string>;
249
+ /**
250
+ * Transaction types supported by this payment method.
251
+ */
252
+ supportedTransactionTypes: Array<string>;
253
+ /**
254
+ * Whether this payment method can be deleted.
255
+ */
256
+ allowsDeletion: boolean;
257
+ /**
258
+ * Whether this payment method requires the MoonPay widget to complete the payment flow.
259
+ */
260
+ requiresWidget: boolean;
261
+ };
262
+ type MoonPayPaymentsStoredCardPaymentMethod = MoonPayPaymentsStoredPaymentMethodBase & {
263
+ cardType: MoonPayPaymentsCardType;
264
+ /**
265
+ * The card network brand
266
+ */
267
+ brand: MoonPayPaymentsCardBrand;
268
+ /**
269
+ * Last 4 digits of the card number
270
+ */
271
+ last4: string;
272
+ /**
273
+ * Expiration month as 2-digit string
274
+ */
275
+ expirationMonth: string;
276
+ /**
277
+ * Expiration year as 4-digit string
278
+ */
279
+ expirationYear: string;
280
+ /**
281
+ * Current availability of this stored card
282
+ */
283
+ availability: MoonPayPaymentsPaymentMethodAvailability;
284
+ };
285
+ /**
286
+ * A stored payment method.
287
+ */
288
+ type MoonPayPaymentsStoredPaymentMethod = MoonPayPaymentsStoredPaymentMethodBase | MoonPayPaymentsStoredCardPaymentMethod;
289
+ type MoonPayPaymentsStoredPaymentMethodBase = {
290
+ /**
291
+ * Unique identifier for the stored payment method
292
+ */
293
+ id: string;
294
+ type: PaymentMethodType;
295
+ };
296
+ /**
297
+ * A payment disclosure that the partner must render verbatim before the customer can complete the transaction.
298
+ */
299
+ type PaymentDisclosure = {
300
+ /**
301
+ * Stable identifier of the disclosure. Each id maps to one specific piece of text. The full list of ids and their canonical text is published in the developer documentation.
302
+ */
303
+ id: string;
304
+ /**
305
+ * Version of the disclosure text. Bumped whenever the canonical wording for this `id` changes. Partners that receive an unknown `(id, version)` pair should fall back to a conservative disclosure and alert their integration team.
306
+ */
307
+ version: string;
308
+ };
309
+ type PaymentMethodType = 'apple_pay' | 'card' | 'ach' | 'fps' | 'fps_open_banking' | 'google_pay' | 'sepa' | 'sepa_open_banking' | 'pix' | 'paypal' | 'venmo' | 'revolut_pay' | 'moonpay_balance' | 'interac';
310
+ type QuoteLimitEntry = {
311
+ /**
312
+ * The maximum amount.
313
+ */
314
+ limit: LimitWithAsset;
315
+ /**
316
+ * The remaining amount.
317
+ */
318
+ remaining: LimitWithAsset;
319
+ };
320
+ /**
321
+ * Limits applicable to the quote.
322
+ */
323
+ type QuoteLimits = {
324
+ /**
325
+ * The daily limit.
326
+ */
327
+ daily?: QuoteLimitEntry;
328
+ /**
329
+ * The monthly limit.
330
+ */
331
+ monthly?: QuoteLimitEntry;
332
+ /**
333
+ * The yearly limit.
334
+ */
335
+ yearly?: QuoteLimitEntry;
336
+ };
337
+ type QuotePaymentMethod = {
338
+ type: PaymentMethodType;
339
+ /**
340
+ * Unique identifier of the payment method. Used to identify the specific card when type is card.
341
+ */
342
+ id?: string;
343
+ };
344
+ /**
345
+ * A stage in the transaction lifecycle
346
+ */
347
+ type Stage = {
348
+ kind?: StageKind;
349
+ /**
350
+ * The human-readable name of the stage.
351
+ */
352
+ name?: string;
353
+ status?: StageStatus;
354
+ /**
355
+ * A developer-friendly message if the status is `failed`
356
+ */
357
+ failureReason?: string | null;
358
+ };
359
+ /**
360
+ * The stages in a transaction lifecycle.
361
+ */
362
+ type StageKind = 'ordering' | 'waiting_payment' | 'waiting_authentication' | 'verification' | 'processing' | 'delivery' | 'crypto_hold';
363
+ /**
364
+ * The status of a transaction stage.
365
+ */
366
+ 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
+ type Transaction = {
382
+ /**
383
+ * The MoonPay ID of the transaction.
384
+ */
385
+ id: string;
386
+ /**
387
+ * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the transaction was created.
388
+ */
389
+ createdAt: string;
390
+ /**
391
+ * An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of when the transaction was last updated.
392
+ */
393
+ updatedAt: string;
394
+ status: TransactionStatus;
395
+ /**
396
+ * Source amount and asset (fiat currency) the customer paid.
397
+ */
398
+ source: {
399
+ /**
400
+ * A stringified amount, which can include decimals.
401
+ */
402
+ amount: string;
403
+ /**
404
+ * The currency or token being spent
405
+ */
406
+ asset: AssetBase;
407
+ };
408
+ /**
409
+ * Destination amount and asset (cryptocurrency) the customer receives.
410
+ */
411
+ destination: {
412
+ /**
413
+ * A stringified amount, which can include decimals.
414
+ */
415
+ amount: string;
416
+ asset: AssetBase;
417
+ };
418
+ /**
419
+ * Details of fees for the transaction.
420
+ */
421
+ fees: Fees;
422
+ /**
423
+ * The wallet used for the transaction.
424
+ */
425
+ wallet: Wallet;
426
+ customer: TransactionCustomer;
427
+ paymentMethod?: TransactionPaymentMethod;
428
+ };
429
+ type TransactionCustomer = {
430
+ /**
431
+ * The MoonPay ID of the customer associated with the transaction.
432
+ */
433
+ id: string;
434
+ };
435
+ type TransactionPaymentMethod = {
436
+ type: PaymentMethodType;
437
+ };
438
+ /**
439
+ * The status of a transaction.
440
+ *
441
+ * - `completed`: The transaction is finalized and assets were delivered.
442
+ * - `failed`: The transaction failed. No payment was executed and funds were not transferred.
443
+ * - `pending`: The transaction was created and payment is accepted. The transfer is in progress.
444
+ */
445
+ type TransactionStatus = 'completed' | 'failed' | 'pending';
446
+ /**
447
+ * Transaction with lifecycle stages showing step-by-step progress.
448
+ */
449
+ type TransactionWithStages = Transaction & {
450
+ /**
451
+ * Details of the stages in the transaction lifecycle.
452
+ */
453
+ stages?: Array<Stage>;
454
+ };
455
+ type Wallet = {
456
+ /**
457
+ * The wallet address used for the transaction.
458
+ */
459
+ address: string;
460
+ /**
461
+ * An optional memo or destination tag (used by some blockchains such as XRP or XLM).
462
+ */
463
+ tag?: string;
464
+ };
465
+
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 };