@djangocfg/ext-payments 1.0.21 → 1.0.23

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.
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Payments Extension I18n Types
3
+ */
4
+ /**
5
+ * Helper type to get dot-notation paths from nested object
6
+ */
7
+ type PathKeys<T, Prefix extends string = ''> = T extends object ? {
8
+ [K in keyof T]: K extends string ? T[K] extends object ? PathKeys<T[K], `${Prefix}${K}.`> : `${Prefix}${K}` : never;
9
+ }[keyof T] : never;
10
+ /**
11
+ * Keys for payments translations
12
+ */
13
+ type PaymentsLocalKeys = PathKeys<PaymentsTranslations>;
14
+ interface PaymentsTranslations {
15
+ /** Balance section */
16
+ balance: {
17
+ available: string;
18
+ totalDeposited: string;
19
+ totalWithdrawn: string;
20
+ };
21
+ /** Action buttons */
22
+ actions: {
23
+ addFunds: string;
24
+ withdraw: string;
25
+ continue: string;
26
+ requestWithdrawal: string;
27
+ cancel: string;
28
+ close: string;
29
+ copyAddress: string;
30
+ copied: string;
31
+ viewAll: string;
32
+ tryAgain: string;
33
+ refreshStatus: string;
34
+ createNewPayment: string;
35
+ openInPaymentProvider: string;
36
+ };
37
+ /** Payment status labels */
38
+ paymentStatus: {
39
+ waiting: string;
40
+ confirming: string;
41
+ completed: string;
42
+ failed: string;
43
+ expired: string;
44
+ paymentExpired: string;
45
+ };
46
+ /** Withdrawal status labels */
47
+ withdrawalStatus: {
48
+ pending: string;
49
+ approved: string;
50
+ processing: string;
51
+ completed: string;
52
+ rejected: string;
53
+ cancelled: string;
54
+ };
55
+ /** Payment descriptions */
56
+ paymentDescriptions: {
57
+ sendCrypto: string;
58
+ expired: string;
59
+ completed: string;
60
+ failed: string;
61
+ confirming: string;
62
+ createNew: string;
63
+ };
64
+ /** Withdrawal descriptions */
65
+ withdrawalDescriptions: {
66
+ pendingApproval: string;
67
+ processing: string;
68
+ completed: string;
69
+ rejected: string;
70
+ cancelled: string;
71
+ };
72
+ /** Form labels */
73
+ form: {
74
+ amount: string;
75
+ amountUsd: string;
76
+ currency: string;
77
+ walletAddress: string;
78
+ selectCurrency: string;
79
+ enterWalletAddress: string;
80
+ search: string;
81
+ payWith: string;
82
+ withdrawAs: string;
83
+ amountToSend: string;
84
+ equivalent: string;
85
+ network: string;
86
+ paymentAddress: string;
87
+ transactionHash: string;
88
+ paymentId: string;
89
+ orderId: string;
90
+ created: string;
91
+ };
92
+ /** Validation messages */
93
+ validation: {
94
+ minimumDeposit: string;
95
+ minimumWithdrawal: string;
96
+ selectCurrency: string;
97
+ invalidWalletAddress: string;
98
+ };
99
+ /** Success/Error messages */
100
+ messages: {
101
+ paymentCreated: string;
102
+ paymentFailed: string;
103
+ withdrawalCreated: string;
104
+ withdrawalFailed: string;
105
+ withdrawalCancelled: string;
106
+ addressCopied: string;
107
+ failedToLoadPayment: string;
108
+ failedToCreateWithdrawal: string;
109
+ };
110
+ /** Sheet titles */
111
+ sheets: {
112
+ addFundsTitle: string;
113
+ addFundsDescription: string;
114
+ withdrawTitle: string;
115
+ withdrawDescription: string;
116
+ paymentTitle: string;
117
+ withdrawalTitle: string;
118
+ };
119
+ /** Activity list */
120
+ activity: {
121
+ title: string;
122
+ noActivity: string;
123
+ deposit: string;
124
+ withdrawal: string;
125
+ payment: string;
126
+ transactionsWillAppear: string;
127
+ };
128
+ /** Estimate & fees */
129
+ estimate: {
130
+ gettingRate: string;
131
+ calculating: string;
132
+ enterAmountToSee: string;
133
+ youWillSend: string;
134
+ youWillReceive: string;
135
+ serviceFee: string;
136
+ networkFee: string;
137
+ rate: string;
138
+ minimumAmount: string;
139
+ };
140
+ /** Withdrawal specific */
141
+ withdraw: {
142
+ insufficientBalance: string;
143
+ approvalWarning: string;
144
+ submitting: string;
145
+ creating: string;
146
+ expiresIn: string;
147
+ };
148
+ }
149
+
150
+ /**
151
+ * Self-contained translation hook for payments extension
152
+ *
153
+ * Uses built-in translations based on current locale from next-intl.
154
+ * No need to add translations to app's i18n config.
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * function BalanceCard() {
159
+ * const t = usePaymentsT();
160
+ * return <span>{t('balance.available')}</span>;
161
+ * }
162
+ * ```
163
+ */
164
+ declare function usePaymentsT(): (key: PaymentsLocalKeys) => string;
165
+
166
+ declare const en: PaymentsTranslations;
167
+
168
+ declare const ru: PaymentsTranslations;
169
+
170
+ declare const ko: PaymentsTranslations;
171
+
172
+ export { type PaymentsLocalKeys, type PaymentsTranslations, en, ko, ru, usePaymentsT };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Payments Extension I18n Types
3
+ */
4
+ /**
5
+ * Helper type to get dot-notation paths from nested object
6
+ */
7
+ type PathKeys<T, Prefix extends string = ''> = T extends object ? {
8
+ [K in keyof T]: K extends string ? T[K] extends object ? PathKeys<T[K], `${Prefix}${K}.`> : `${Prefix}${K}` : never;
9
+ }[keyof T] : never;
10
+ /**
11
+ * Keys for payments translations
12
+ */
13
+ type PaymentsLocalKeys = PathKeys<PaymentsTranslations>;
14
+ interface PaymentsTranslations {
15
+ /** Balance section */
16
+ balance: {
17
+ available: string;
18
+ totalDeposited: string;
19
+ totalWithdrawn: string;
20
+ };
21
+ /** Action buttons */
22
+ actions: {
23
+ addFunds: string;
24
+ withdraw: string;
25
+ continue: string;
26
+ requestWithdrawal: string;
27
+ cancel: string;
28
+ close: string;
29
+ copyAddress: string;
30
+ copied: string;
31
+ viewAll: string;
32
+ tryAgain: string;
33
+ refreshStatus: string;
34
+ createNewPayment: string;
35
+ openInPaymentProvider: string;
36
+ };
37
+ /** Payment status labels */
38
+ paymentStatus: {
39
+ waiting: string;
40
+ confirming: string;
41
+ completed: string;
42
+ failed: string;
43
+ expired: string;
44
+ paymentExpired: string;
45
+ };
46
+ /** Withdrawal status labels */
47
+ withdrawalStatus: {
48
+ pending: string;
49
+ approved: string;
50
+ processing: string;
51
+ completed: string;
52
+ rejected: string;
53
+ cancelled: string;
54
+ };
55
+ /** Payment descriptions */
56
+ paymentDescriptions: {
57
+ sendCrypto: string;
58
+ expired: string;
59
+ completed: string;
60
+ failed: string;
61
+ confirming: string;
62
+ createNew: string;
63
+ };
64
+ /** Withdrawal descriptions */
65
+ withdrawalDescriptions: {
66
+ pendingApproval: string;
67
+ processing: string;
68
+ completed: string;
69
+ rejected: string;
70
+ cancelled: string;
71
+ };
72
+ /** Form labels */
73
+ form: {
74
+ amount: string;
75
+ amountUsd: string;
76
+ currency: string;
77
+ walletAddress: string;
78
+ selectCurrency: string;
79
+ enterWalletAddress: string;
80
+ search: string;
81
+ payWith: string;
82
+ withdrawAs: string;
83
+ amountToSend: string;
84
+ equivalent: string;
85
+ network: string;
86
+ paymentAddress: string;
87
+ transactionHash: string;
88
+ paymentId: string;
89
+ orderId: string;
90
+ created: string;
91
+ };
92
+ /** Validation messages */
93
+ validation: {
94
+ minimumDeposit: string;
95
+ minimumWithdrawal: string;
96
+ selectCurrency: string;
97
+ invalidWalletAddress: string;
98
+ };
99
+ /** Success/Error messages */
100
+ messages: {
101
+ paymentCreated: string;
102
+ paymentFailed: string;
103
+ withdrawalCreated: string;
104
+ withdrawalFailed: string;
105
+ withdrawalCancelled: string;
106
+ addressCopied: string;
107
+ failedToLoadPayment: string;
108
+ failedToCreateWithdrawal: string;
109
+ };
110
+ /** Sheet titles */
111
+ sheets: {
112
+ addFundsTitle: string;
113
+ addFundsDescription: string;
114
+ withdrawTitle: string;
115
+ withdrawDescription: string;
116
+ paymentTitle: string;
117
+ withdrawalTitle: string;
118
+ };
119
+ /** Activity list */
120
+ activity: {
121
+ title: string;
122
+ noActivity: string;
123
+ deposit: string;
124
+ withdrawal: string;
125
+ payment: string;
126
+ transactionsWillAppear: string;
127
+ };
128
+ /** Estimate & fees */
129
+ estimate: {
130
+ gettingRate: string;
131
+ calculating: string;
132
+ enterAmountToSee: string;
133
+ youWillSend: string;
134
+ youWillReceive: string;
135
+ serviceFee: string;
136
+ networkFee: string;
137
+ rate: string;
138
+ minimumAmount: string;
139
+ };
140
+ /** Withdrawal specific */
141
+ withdraw: {
142
+ insufficientBalance: string;
143
+ approvalWarning: string;
144
+ submitting: string;
145
+ creating: string;
146
+ expiresIn: string;
147
+ };
148
+ }
149
+
150
+ /**
151
+ * Self-contained translation hook for payments extension
152
+ *
153
+ * Uses built-in translations based on current locale from next-intl.
154
+ * No need to add translations to app's i18n config.
155
+ *
156
+ * @example
157
+ * ```tsx
158
+ * function BalanceCard() {
159
+ * const t = usePaymentsT();
160
+ * return <span>{t('balance.available')}</span>;
161
+ * }
162
+ * ```
163
+ */
164
+ declare function usePaymentsT(): (key: PaymentsLocalKeys) => string;
165
+
166
+ declare const en: PaymentsTranslations;
167
+
168
+ declare const ru: PaymentsTranslations;
169
+
170
+ declare const ko: PaymentsTranslations;
171
+
172
+ export { type PaymentsLocalKeys, type PaymentsTranslations, en, ko, ru, usePaymentsT };