@moneymq/react 0.2.0 → 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 MoneyMQ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -32,55 +32,286 @@ interface SandboxContextState {
32
32
  isSandboxMode: boolean;
33
33
  sandboxAccounts: SandboxAccount[];
34
34
  }
35
+ declare const MoneyMQContext: React.Context<MoneyMQClient | null>;
36
+ declare const SandboxContext: React.Context<SandboxContextState>;
35
37
  declare function useMoneyMQ(): MoneyMQClient;
36
38
  declare function useSandbox(): SandboxContextState;
37
39
  declare function MoneyMQProvider({ children, client, branding, }: MoneyMQProviderProps): react_jsx_runtime.JSX.Element | null;
38
40
 
41
+ /**
42
+ * Represents a completed payment transaction.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * const handleSuccess = (payment: Payment) => {
47
+ * console.log(`Payment ${payment.id} completed for ${payment.amount} ${payment.currency}`);
48
+ * console.log(`Transaction signature: ${payment.signature}`);
49
+ * };
50
+ * ```
51
+ */
39
52
  interface Payment$1 {
53
+ /** Unique payment identifier (e.g., "pay_1234567890") */
40
54
  id: string;
55
+ /** Payment amount in the currency's standard unit (e.g., 9.99 for $9.99) */
41
56
  amount: number;
57
+ /** Currency code (e.g., "USDC") */
42
58
  currency: string;
59
+ /** Current status of the payment */
43
60
  status: 'pending' | 'completed' | 'failed';
61
+ /** Blockchain transaction signature (available after completion) */
44
62
  signature?: string;
45
63
  }
64
+ /**
65
+ * Represents a price for a product.
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * const price: Price = {
70
+ * id: 'price_abc123',
71
+ * unit_amount: 999, // $9.99 in cents
72
+ * currency: 'USDC',
73
+ * product: 'prod_xyz789',
74
+ * };
75
+ * ```
76
+ */
46
77
  interface Price {
78
+ /** Unique price identifier from your catalog */
47
79
  id: string;
80
+ /** Price amount in cents (e.g., 999 for $9.99) */
48
81
  unit_amount: number;
82
+ /** Currency code (e.g., "USDC") */
49
83
  currency: string;
84
+ /** Associated product ID */
50
85
  product?: string;
51
86
  }
87
+ /**
88
+ * Represents a product in your catalog.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * const product: Product = {
93
+ * id: 'prod_xyz789',
94
+ * name: 'Pro Subscription',
95
+ * description: 'Monthly access to premium features',
96
+ * };
97
+ * ```
98
+ */
52
99
  interface Product {
100
+ /** Unique product identifier from your catalog */
53
101
  id: string;
102
+ /** Display name shown to the customer */
54
103
  name: string;
104
+ /** Optional description for additional context */
55
105
  description?: string;
56
106
  }
57
- interface PayButtonProps {
58
- /** Price ID to fetch details from API */
59
- priceId?: string;
60
- /** Price object (alternative to priceId) */
61
- price?: Price;
62
- /** Product object */
63
- product?: Product;
107
+ /**
108
+ * Represents an item in the checkout basket.
109
+ *
110
+ * @example
111
+ * ```tsx
112
+ * const item: BasketItem = {
113
+ * product: { id: 'prod_123', name: 'Pro Plan' },
114
+ * price: { id: 'price_456', unit_amount: 999, currency: 'USDC' },
115
+ * quantity: 1,
116
+ * };
117
+ * ```
118
+ */
119
+ interface BasketItem {
120
+ /** Product details including id and name */
121
+ product: Product;
122
+ /** Price details including amount and currency */
123
+ price: Price;
124
+ /** Number of items (defaults to 1) */
125
+ quantity?: number;
126
+ }
127
+ /**
128
+ * Props for the CheckoutButton component.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * <CheckoutButton
133
+ * basket={[{ product, price }]}
134
+ * onSuccess={(payment) => console.log('Paid!', payment.id)}
135
+ * onError={(error) => console.error('Failed:', error)}
136
+ * variant="solid"
137
+ * >
138
+ * Pay Now
139
+ * </CheckoutButton>
140
+ * ```
141
+ */
142
+ interface CheckoutButtonProps {
143
+ /** Array of items to purchase. Each item includes product, price, and optional quantity. */
144
+ basket: BasketItem[];
145
+ /** Callback fired when payment completes successfully. Receives the Payment object with transaction details. */
64
146
  onSuccess?: (payment: Payment$1) => void;
147
+ /** Callback fired when payment fails. Receives the Error with failure details. */
65
148
  onError?: (error: Error) => void;
149
+ /** Button style variant. "solid" has a filled background, "outline" has a border only. @default "solid" */
66
150
  variant?: 'solid' | 'outline';
151
+ /** Custom button content. If not provided, displays "Pay". */
67
152
  children?: React.ReactNode;
153
+ /** Disable the button, preventing clicks. */
68
154
  disabled?: boolean;
155
+ /** Enable debug mode to show a debug panel with account balance in the checkout modal. @default false */
156
+ debug?: boolean;
69
157
  }
70
- declare const PayButton: React.ForwardRefExoticComponent<PayButtonProps & React.RefAttributes<HTMLButtonElement>>;
158
+ /**
159
+ * A button component that opens a checkout modal for processing payments.
160
+ *
161
+ * Must be used within a `MoneyMQProvider`. When clicked, displays a modal where
162
+ * users can select their wallet and complete the payment.
163
+ *
164
+ * @example
165
+ * ```tsx
166
+ * import { MoneyMQProvider, CheckoutButton } from '@moneymq/react';
167
+ *
168
+ * function App() {
169
+ * const product = { id: 'prod_123', name: 'Pro Plan' };
170
+ * const price = { id: 'price_456', unit_amount: 999, currency: 'USDC' };
171
+ *
172
+ * return (
173
+ * <MoneyMQProvider client={client}>
174
+ * <CheckoutButton
175
+ * basket={[{ product, price }]}
176
+ * onSuccess={(payment) => {
177
+ * console.log('Payment completed:', payment.signature);
178
+ * }}
179
+ * >
180
+ * Subscribe - $9.99
181
+ * </CheckoutButton>
182
+ * </MoneyMQProvider>
183
+ * );
184
+ * }
185
+ * ```
186
+ *
187
+ * @see {@link CheckoutButtonProps} for available props
188
+ * @see {@link CheckoutModal} for the modal component used internally
189
+ */
190
+ declare const CheckoutButton: React.ForwardRefExoticComponent<CheckoutButtonProps & React.RefAttributes<HTMLButtonElement>>;
71
191
 
72
- interface PaymentModalProps {
192
+ /**
193
+ * Represents a line item in the checkout, including product, price, quantity, and calculated subtotal.
194
+ *
195
+ * @example
196
+ * ```tsx
197
+ * const lineItem: LineItem = {
198
+ * product: { id: 'prod_123', name: 'Pro Plan' },
199
+ * price: { id: 'price_456', unit_amount: 999, currency: 'USDC' },
200
+ * quantity: 2,
201
+ * subtotal: 19.98,
202
+ * };
203
+ * ```
204
+ */
205
+ interface LineItem {
206
+ /** Product information */
207
+ product: {
208
+ /** Unique product identifier */
209
+ id: string;
210
+ /** Display name shown to the customer */
211
+ name: string;
212
+ /** Optional description */
213
+ description?: string;
214
+ };
215
+ /** Price information */
216
+ price: {
217
+ /** Unique price identifier */
218
+ id: string;
219
+ /** Price amount in cents (e.g., 999 for $9.99) */
220
+ unit_amount: number;
221
+ /** Currency code (e.g., "USDC") */
222
+ currency: string;
223
+ };
224
+ /** Quantity of this item */
225
+ quantity: number;
226
+ /** Calculated subtotal (unit_amount / 100 * quantity) */
227
+ subtotal: number;
228
+ }
229
+ /**
230
+ * Props for the CheckoutModal component.
231
+ *
232
+ * @example
233
+ * ```tsx
234
+ * <CheckoutModal
235
+ * visible={isOpen}
236
+ * onClose={() => setIsOpen(false)}
237
+ * amount={9.99}
238
+ * currency="USDC"
239
+ * recipient="7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
240
+ * onSuccess={(signature) => console.log('Paid:', signature)}
241
+ * />
242
+ * ```
243
+ */
244
+ interface CheckoutModalProps {
245
+ /** Whether the modal is visible */
73
246
  visible: boolean;
247
+ /** Callback to close the modal */
74
248
  onClose: () => void;
249
+ /** Total payment amount (e.g., 9.99 for $9.99) */
75
250
  amount: number;
251
+ /** Currency code (e.g., "USDC") */
76
252
  currency: string;
253
+ /** Recipient wallet address */
77
254
  recipient: string;
78
- productName?: string;
255
+ /** Optional line items to display in the checkout summary */
256
+ lineItems?: LineItem[];
257
+ /** Callback fired when payment completes. Receives the transaction signature. */
79
258
  onSuccess?: (signature: string) => void;
259
+ /** Callback fired when payment fails. Receives the Error with failure details. */
80
260
  onError?: (error: Error) => void;
261
+ /** Accent color for UI elements. @default "#ec4899" */
81
262
  accentColor?: string;
263
+ /** Enable debug mode to show account balance panel. @default false */
264
+ debug?: boolean;
82
265
  }
83
- declare function PaymentModal({ visible, onClose, amount, currency, recipient, productName, onSuccess, onError, accentColor, }: PaymentModalProps): react_jsx_runtime.JSX.Element | null;
266
+ /**
267
+ * A modal component for completing payments.
268
+ *
269
+ * Displays a payment interface where users can:
270
+ * - View the total amount and line items
271
+ * - Select a payment method (browser wallet or sandbox account)
272
+ * - Complete the payment transaction
273
+ *
274
+ * Must be used within a `MoneyMQProvider`. Usually used internally by `CheckoutButton`,
275
+ * but can be rendered directly for custom checkout flows.
276
+ *
277
+ * @example
278
+ * ```tsx
279
+ * import { MoneyMQProvider, CheckoutModal } from '@moneymq/react';
280
+ *
281
+ * function CustomCheckout() {
282
+ * const [isOpen, setIsOpen] = useState(false);
283
+ *
284
+ * return (
285
+ * <MoneyMQProvider client={client}>
286
+ * <button onClick={() => setIsOpen(true)}>Pay</button>
287
+ * <CheckoutModal
288
+ * visible={isOpen}
289
+ * onClose={() => setIsOpen(false)}
290
+ * amount={9.99}
291
+ * currency="USDC"
292
+ * recipient="7xKXtg..."
293
+ * lineItems={[
294
+ * {
295
+ * product: { id: 'prod_1', name: 'Pro Plan' },
296
+ * price: { id: 'price_1', unit_amount: 999, currency: 'USDC' },
297
+ * quantity: 1,
298
+ * subtotal: 9.99,
299
+ * },
300
+ * ]}
301
+ * onSuccess={(signature) => {
302
+ * console.log('Payment successful:', signature);
303
+ * setIsOpen(false);
304
+ * }}
305
+ * />
306
+ * </MoneyMQProvider>
307
+ * );
308
+ * }
309
+ * ```
310
+ *
311
+ * @see {@link CheckoutModalProps} for available props
312
+ * @see {@link CheckoutButton} for a simpler button-based checkout
313
+ */
314
+ declare function CheckoutModal({ visible, onClose, amount, currency, recipient, lineItems, onSuccess, onError, accentColor, debug, }: CheckoutModalProps): react_jsx_runtime.JSX.Element | null;
84
315
 
85
316
  interface Payment {
86
317
  id: string;
@@ -96,4 +327,4 @@ interface UsePaymentReturn {
96
327
  }
97
328
  declare function usePayment(): UsePaymentReturn;
98
329
 
99
- export { type Branding, type MoneyMQClient, MoneyMQProvider, type MoneyMQProviderProps, PayButton, type PayButtonProps, type Payment$1 as Payment, PaymentModal, type PaymentModalProps, type Price, type Product, type SandboxAccount, type UsePaymentReturn, useMoneyMQ, usePayment, useSandbox };
330
+ export { type BasketItem, type Branding, CheckoutButton, type CheckoutButtonProps, CheckoutModal, type CheckoutModalProps, type LineItem, type MoneyMQClient, MoneyMQContext, MoneyMQProvider, type MoneyMQProviderProps, type Payment$1 as Payment, type Price, type Product, type SandboxAccount, SandboxContext, type UsePaymentReturn, useMoneyMQ, usePayment, useSandbox };
package/dist/index.d.ts CHANGED
@@ -32,55 +32,286 @@ interface SandboxContextState {
32
32
  isSandboxMode: boolean;
33
33
  sandboxAccounts: SandboxAccount[];
34
34
  }
35
+ declare const MoneyMQContext: React.Context<MoneyMQClient | null>;
36
+ declare const SandboxContext: React.Context<SandboxContextState>;
35
37
  declare function useMoneyMQ(): MoneyMQClient;
36
38
  declare function useSandbox(): SandboxContextState;
37
39
  declare function MoneyMQProvider({ children, client, branding, }: MoneyMQProviderProps): react_jsx_runtime.JSX.Element | null;
38
40
 
41
+ /**
42
+ * Represents a completed payment transaction.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * const handleSuccess = (payment: Payment) => {
47
+ * console.log(`Payment ${payment.id} completed for ${payment.amount} ${payment.currency}`);
48
+ * console.log(`Transaction signature: ${payment.signature}`);
49
+ * };
50
+ * ```
51
+ */
39
52
  interface Payment$1 {
53
+ /** Unique payment identifier (e.g., "pay_1234567890") */
40
54
  id: string;
55
+ /** Payment amount in the currency's standard unit (e.g., 9.99 for $9.99) */
41
56
  amount: number;
57
+ /** Currency code (e.g., "USDC") */
42
58
  currency: string;
59
+ /** Current status of the payment */
43
60
  status: 'pending' | 'completed' | 'failed';
61
+ /** Blockchain transaction signature (available after completion) */
44
62
  signature?: string;
45
63
  }
64
+ /**
65
+ * Represents a price for a product.
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * const price: Price = {
70
+ * id: 'price_abc123',
71
+ * unit_amount: 999, // $9.99 in cents
72
+ * currency: 'USDC',
73
+ * product: 'prod_xyz789',
74
+ * };
75
+ * ```
76
+ */
46
77
  interface Price {
78
+ /** Unique price identifier from your catalog */
47
79
  id: string;
80
+ /** Price amount in cents (e.g., 999 for $9.99) */
48
81
  unit_amount: number;
82
+ /** Currency code (e.g., "USDC") */
49
83
  currency: string;
84
+ /** Associated product ID */
50
85
  product?: string;
51
86
  }
87
+ /**
88
+ * Represents a product in your catalog.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * const product: Product = {
93
+ * id: 'prod_xyz789',
94
+ * name: 'Pro Subscription',
95
+ * description: 'Monthly access to premium features',
96
+ * };
97
+ * ```
98
+ */
52
99
  interface Product {
100
+ /** Unique product identifier from your catalog */
53
101
  id: string;
102
+ /** Display name shown to the customer */
54
103
  name: string;
104
+ /** Optional description for additional context */
55
105
  description?: string;
56
106
  }
57
- interface PayButtonProps {
58
- /** Price ID to fetch details from API */
59
- priceId?: string;
60
- /** Price object (alternative to priceId) */
61
- price?: Price;
62
- /** Product object */
63
- product?: Product;
107
+ /**
108
+ * Represents an item in the checkout basket.
109
+ *
110
+ * @example
111
+ * ```tsx
112
+ * const item: BasketItem = {
113
+ * product: { id: 'prod_123', name: 'Pro Plan' },
114
+ * price: { id: 'price_456', unit_amount: 999, currency: 'USDC' },
115
+ * quantity: 1,
116
+ * };
117
+ * ```
118
+ */
119
+ interface BasketItem {
120
+ /** Product details including id and name */
121
+ product: Product;
122
+ /** Price details including amount and currency */
123
+ price: Price;
124
+ /** Number of items (defaults to 1) */
125
+ quantity?: number;
126
+ }
127
+ /**
128
+ * Props for the CheckoutButton component.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * <CheckoutButton
133
+ * basket={[{ product, price }]}
134
+ * onSuccess={(payment) => console.log('Paid!', payment.id)}
135
+ * onError={(error) => console.error('Failed:', error)}
136
+ * variant="solid"
137
+ * >
138
+ * Pay Now
139
+ * </CheckoutButton>
140
+ * ```
141
+ */
142
+ interface CheckoutButtonProps {
143
+ /** Array of items to purchase. Each item includes product, price, and optional quantity. */
144
+ basket: BasketItem[];
145
+ /** Callback fired when payment completes successfully. Receives the Payment object with transaction details. */
64
146
  onSuccess?: (payment: Payment$1) => void;
147
+ /** Callback fired when payment fails. Receives the Error with failure details. */
65
148
  onError?: (error: Error) => void;
149
+ /** Button style variant. "solid" has a filled background, "outline" has a border only. @default "solid" */
66
150
  variant?: 'solid' | 'outline';
151
+ /** Custom button content. If not provided, displays "Pay". */
67
152
  children?: React.ReactNode;
153
+ /** Disable the button, preventing clicks. */
68
154
  disabled?: boolean;
155
+ /** Enable debug mode to show a debug panel with account balance in the checkout modal. @default false */
156
+ debug?: boolean;
69
157
  }
70
- declare const PayButton: React.ForwardRefExoticComponent<PayButtonProps & React.RefAttributes<HTMLButtonElement>>;
158
+ /**
159
+ * A button component that opens a checkout modal for processing payments.
160
+ *
161
+ * Must be used within a `MoneyMQProvider`. When clicked, displays a modal where
162
+ * users can select their wallet and complete the payment.
163
+ *
164
+ * @example
165
+ * ```tsx
166
+ * import { MoneyMQProvider, CheckoutButton } from '@moneymq/react';
167
+ *
168
+ * function App() {
169
+ * const product = { id: 'prod_123', name: 'Pro Plan' };
170
+ * const price = { id: 'price_456', unit_amount: 999, currency: 'USDC' };
171
+ *
172
+ * return (
173
+ * <MoneyMQProvider client={client}>
174
+ * <CheckoutButton
175
+ * basket={[{ product, price }]}
176
+ * onSuccess={(payment) => {
177
+ * console.log('Payment completed:', payment.signature);
178
+ * }}
179
+ * >
180
+ * Subscribe - $9.99
181
+ * </CheckoutButton>
182
+ * </MoneyMQProvider>
183
+ * );
184
+ * }
185
+ * ```
186
+ *
187
+ * @see {@link CheckoutButtonProps} for available props
188
+ * @see {@link CheckoutModal} for the modal component used internally
189
+ */
190
+ declare const CheckoutButton: React.ForwardRefExoticComponent<CheckoutButtonProps & React.RefAttributes<HTMLButtonElement>>;
71
191
 
72
- interface PaymentModalProps {
192
+ /**
193
+ * Represents a line item in the checkout, including product, price, quantity, and calculated subtotal.
194
+ *
195
+ * @example
196
+ * ```tsx
197
+ * const lineItem: LineItem = {
198
+ * product: { id: 'prod_123', name: 'Pro Plan' },
199
+ * price: { id: 'price_456', unit_amount: 999, currency: 'USDC' },
200
+ * quantity: 2,
201
+ * subtotal: 19.98,
202
+ * };
203
+ * ```
204
+ */
205
+ interface LineItem {
206
+ /** Product information */
207
+ product: {
208
+ /** Unique product identifier */
209
+ id: string;
210
+ /** Display name shown to the customer */
211
+ name: string;
212
+ /** Optional description */
213
+ description?: string;
214
+ };
215
+ /** Price information */
216
+ price: {
217
+ /** Unique price identifier */
218
+ id: string;
219
+ /** Price amount in cents (e.g., 999 for $9.99) */
220
+ unit_amount: number;
221
+ /** Currency code (e.g., "USDC") */
222
+ currency: string;
223
+ };
224
+ /** Quantity of this item */
225
+ quantity: number;
226
+ /** Calculated subtotal (unit_amount / 100 * quantity) */
227
+ subtotal: number;
228
+ }
229
+ /**
230
+ * Props for the CheckoutModal component.
231
+ *
232
+ * @example
233
+ * ```tsx
234
+ * <CheckoutModal
235
+ * visible={isOpen}
236
+ * onClose={() => setIsOpen(false)}
237
+ * amount={9.99}
238
+ * currency="USDC"
239
+ * recipient="7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
240
+ * onSuccess={(signature) => console.log('Paid:', signature)}
241
+ * />
242
+ * ```
243
+ */
244
+ interface CheckoutModalProps {
245
+ /** Whether the modal is visible */
73
246
  visible: boolean;
247
+ /** Callback to close the modal */
74
248
  onClose: () => void;
249
+ /** Total payment amount (e.g., 9.99 for $9.99) */
75
250
  amount: number;
251
+ /** Currency code (e.g., "USDC") */
76
252
  currency: string;
253
+ /** Recipient wallet address */
77
254
  recipient: string;
78
- productName?: string;
255
+ /** Optional line items to display in the checkout summary */
256
+ lineItems?: LineItem[];
257
+ /** Callback fired when payment completes. Receives the transaction signature. */
79
258
  onSuccess?: (signature: string) => void;
259
+ /** Callback fired when payment fails. Receives the Error with failure details. */
80
260
  onError?: (error: Error) => void;
261
+ /** Accent color for UI elements. @default "#ec4899" */
81
262
  accentColor?: string;
263
+ /** Enable debug mode to show account balance panel. @default false */
264
+ debug?: boolean;
82
265
  }
83
- declare function PaymentModal({ visible, onClose, amount, currency, recipient, productName, onSuccess, onError, accentColor, }: PaymentModalProps): react_jsx_runtime.JSX.Element | null;
266
+ /**
267
+ * A modal component for completing payments.
268
+ *
269
+ * Displays a payment interface where users can:
270
+ * - View the total amount and line items
271
+ * - Select a payment method (browser wallet or sandbox account)
272
+ * - Complete the payment transaction
273
+ *
274
+ * Must be used within a `MoneyMQProvider`. Usually used internally by `CheckoutButton`,
275
+ * but can be rendered directly for custom checkout flows.
276
+ *
277
+ * @example
278
+ * ```tsx
279
+ * import { MoneyMQProvider, CheckoutModal } from '@moneymq/react';
280
+ *
281
+ * function CustomCheckout() {
282
+ * const [isOpen, setIsOpen] = useState(false);
283
+ *
284
+ * return (
285
+ * <MoneyMQProvider client={client}>
286
+ * <button onClick={() => setIsOpen(true)}>Pay</button>
287
+ * <CheckoutModal
288
+ * visible={isOpen}
289
+ * onClose={() => setIsOpen(false)}
290
+ * amount={9.99}
291
+ * currency="USDC"
292
+ * recipient="7xKXtg..."
293
+ * lineItems={[
294
+ * {
295
+ * product: { id: 'prod_1', name: 'Pro Plan' },
296
+ * price: { id: 'price_1', unit_amount: 999, currency: 'USDC' },
297
+ * quantity: 1,
298
+ * subtotal: 9.99,
299
+ * },
300
+ * ]}
301
+ * onSuccess={(signature) => {
302
+ * console.log('Payment successful:', signature);
303
+ * setIsOpen(false);
304
+ * }}
305
+ * />
306
+ * </MoneyMQProvider>
307
+ * );
308
+ * }
309
+ * ```
310
+ *
311
+ * @see {@link CheckoutModalProps} for available props
312
+ * @see {@link CheckoutButton} for a simpler button-based checkout
313
+ */
314
+ declare function CheckoutModal({ visible, onClose, amount, currency, recipient, lineItems, onSuccess, onError, accentColor, debug, }: CheckoutModalProps): react_jsx_runtime.JSX.Element | null;
84
315
 
85
316
  interface Payment {
86
317
  id: string;
@@ -96,4 +327,4 @@ interface UsePaymentReturn {
96
327
  }
97
328
  declare function usePayment(): UsePaymentReturn;
98
329
 
99
- export { type Branding, type MoneyMQClient, MoneyMQProvider, type MoneyMQProviderProps, PayButton, type PayButtonProps, type Payment$1 as Payment, PaymentModal, type PaymentModalProps, type Price, type Product, type SandboxAccount, type UsePaymentReturn, useMoneyMQ, usePayment, useSandbox };
330
+ export { type BasketItem, type Branding, CheckoutButton, type CheckoutButtonProps, CheckoutModal, type CheckoutModalProps, type LineItem, type MoneyMQClient, MoneyMQContext, MoneyMQProvider, type MoneyMQProviderProps, type Payment$1 as Payment, type Price, type Product, type SandboxAccount, SandboxContext, type UsePaymentReturn, useMoneyMQ, usePayment, useSandbox };