@moneymq/react 0.1.1
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/index.d.mts +99 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +1567 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1525 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +58 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface Branding {
|
|
5
|
+
logo?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
accentColor?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface MoneyMQClient {
|
|
12
|
+
config: {
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface MoneyMQProviderProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
client: MoneyMQClient;
|
|
19
|
+
branding?: Branding;
|
|
20
|
+
}
|
|
21
|
+
interface SandboxAccount {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
address: string;
|
|
25
|
+
secretKeyHex?: string;
|
|
26
|
+
stablecoins?: {
|
|
27
|
+
usdc?: string;
|
|
28
|
+
};
|
|
29
|
+
usdcBalance?: number;
|
|
30
|
+
}
|
|
31
|
+
interface SandboxContextState {
|
|
32
|
+
isSandboxMode: boolean;
|
|
33
|
+
sandboxAccounts: SandboxAccount[];
|
|
34
|
+
}
|
|
35
|
+
declare function useMoneyMQ(): MoneyMQClient;
|
|
36
|
+
declare function useSandbox(): SandboxContextState;
|
|
37
|
+
declare function MoneyMQProvider({ children, client, branding, }: MoneyMQProviderProps): react_jsx_runtime.JSX.Element | null;
|
|
38
|
+
|
|
39
|
+
interface Payment$1 {
|
|
40
|
+
id: string;
|
|
41
|
+
amount: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
status: 'pending' | 'completed' | 'failed';
|
|
44
|
+
signature?: string;
|
|
45
|
+
}
|
|
46
|
+
interface Price {
|
|
47
|
+
id: string;
|
|
48
|
+
unit_amount: number;
|
|
49
|
+
currency: string;
|
|
50
|
+
product?: string;
|
|
51
|
+
}
|
|
52
|
+
interface Product {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
}
|
|
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;
|
|
64
|
+
onSuccess?: (payment: Payment$1) => void;
|
|
65
|
+
onError?: (error: Error) => void;
|
|
66
|
+
variant?: 'solid' | 'outline';
|
|
67
|
+
children?: React.ReactNode;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
}
|
|
70
|
+
declare const PayButton: React.ForwardRefExoticComponent<PayButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
|
|
72
|
+
interface PaymentModalProps {
|
|
73
|
+
visible: boolean;
|
|
74
|
+
onClose: () => void;
|
|
75
|
+
amount: number;
|
|
76
|
+
currency: string;
|
|
77
|
+
recipient: string;
|
|
78
|
+
productName?: string;
|
|
79
|
+
onSuccess?: (signature: string) => void;
|
|
80
|
+
onError?: (error: Error) => void;
|
|
81
|
+
accentColor?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function PaymentModal({ visible, onClose, amount, currency, recipient, productName, onSuccess, onError, accentColor, }: PaymentModalProps): react_jsx_runtime.JSX.Element | null;
|
|
84
|
+
|
|
85
|
+
interface Payment {
|
|
86
|
+
id: string;
|
|
87
|
+
amount: number;
|
|
88
|
+
currency: string;
|
|
89
|
+
status: 'pending' | 'completed' | 'failed';
|
|
90
|
+
signature?: string;
|
|
91
|
+
}
|
|
92
|
+
interface UsePaymentReturn {
|
|
93
|
+
pay: (priceId: string) => Promise<Payment | null>;
|
|
94
|
+
isPending: boolean;
|
|
95
|
+
lastPayment: Payment | null;
|
|
96
|
+
}
|
|
97
|
+
declare function usePayment(): UsePaymentReturn;
|
|
98
|
+
|
|
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 };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface Branding {
|
|
5
|
+
logo?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
accentColor?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface MoneyMQClient {
|
|
12
|
+
config: {
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface MoneyMQProviderProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
client: MoneyMQClient;
|
|
19
|
+
branding?: Branding;
|
|
20
|
+
}
|
|
21
|
+
interface SandboxAccount {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
address: string;
|
|
25
|
+
secretKeyHex?: string;
|
|
26
|
+
stablecoins?: {
|
|
27
|
+
usdc?: string;
|
|
28
|
+
};
|
|
29
|
+
usdcBalance?: number;
|
|
30
|
+
}
|
|
31
|
+
interface SandboxContextState {
|
|
32
|
+
isSandboxMode: boolean;
|
|
33
|
+
sandboxAccounts: SandboxAccount[];
|
|
34
|
+
}
|
|
35
|
+
declare function useMoneyMQ(): MoneyMQClient;
|
|
36
|
+
declare function useSandbox(): SandboxContextState;
|
|
37
|
+
declare function MoneyMQProvider({ children, client, branding, }: MoneyMQProviderProps): react_jsx_runtime.JSX.Element | null;
|
|
38
|
+
|
|
39
|
+
interface Payment$1 {
|
|
40
|
+
id: string;
|
|
41
|
+
amount: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
status: 'pending' | 'completed' | 'failed';
|
|
44
|
+
signature?: string;
|
|
45
|
+
}
|
|
46
|
+
interface Price {
|
|
47
|
+
id: string;
|
|
48
|
+
unit_amount: number;
|
|
49
|
+
currency: string;
|
|
50
|
+
product?: string;
|
|
51
|
+
}
|
|
52
|
+
interface Product {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
}
|
|
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;
|
|
64
|
+
onSuccess?: (payment: Payment$1) => void;
|
|
65
|
+
onError?: (error: Error) => void;
|
|
66
|
+
variant?: 'solid' | 'outline';
|
|
67
|
+
children?: React.ReactNode;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
}
|
|
70
|
+
declare const PayButton: React.ForwardRefExoticComponent<PayButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
|
|
72
|
+
interface PaymentModalProps {
|
|
73
|
+
visible: boolean;
|
|
74
|
+
onClose: () => void;
|
|
75
|
+
amount: number;
|
|
76
|
+
currency: string;
|
|
77
|
+
recipient: string;
|
|
78
|
+
productName?: string;
|
|
79
|
+
onSuccess?: (signature: string) => void;
|
|
80
|
+
onError?: (error: Error) => void;
|
|
81
|
+
accentColor?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function PaymentModal({ visible, onClose, amount, currency, recipient, productName, onSuccess, onError, accentColor, }: PaymentModalProps): react_jsx_runtime.JSX.Element | null;
|
|
84
|
+
|
|
85
|
+
interface Payment {
|
|
86
|
+
id: string;
|
|
87
|
+
amount: number;
|
|
88
|
+
currency: string;
|
|
89
|
+
status: 'pending' | 'completed' | 'failed';
|
|
90
|
+
signature?: string;
|
|
91
|
+
}
|
|
92
|
+
interface UsePaymentReturn {
|
|
93
|
+
pay: (priceId: string) => Promise<Payment | null>;
|
|
94
|
+
isPending: boolean;
|
|
95
|
+
lastPayment: Payment | null;
|
|
96
|
+
}
|
|
97
|
+
declare function usePayment(): UsePaymentReturn;
|
|
98
|
+
|
|
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 };
|