payment-kit 1.18.56 → 1.19.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/.eslintrc.js +6 -0
- package/api/src/crons/index.ts +8 -0
- package/api/src/index.ts +4 -0
- package/api/src/libs/credit-grant.ts +146 -0
- package/api/src/libs/env.ts +1 -0
- package/api/src/libs/invoice.ts +4 -3
- package/api/src/libs/notification/template/base.ts +388 -2
- package/api/src/libs/notification/template/customer-credit-grant-granted.ts +149 -0
- package/api/src/libs/notification/template/customer-credit-grant-low-balance.ts +151 -0
- package/api/src/libs/notification/template/customer-credit-insufficient.ts +254 -0
- package/api/src/libs/notification/template/subscription-canceled.ts +193 -202
- package/api/src/libs/notification/template/subscription-refund-succeeded.ts +215 -237
- package/api/src/libs/notification/template/subscription-renewed.ts +130 -200
- package/api/src/libs/notification/template/subscription-succeeded.ts +100 -202
- package/api/src/libs/notification/template/subscription-trial-start.ts +142 -188
- package/api/src/libs/notification/template/subscription-trial-will-end.ts +146 -174
- package/api/src/libs/notification/template/subscription-upgraded.ts +96 -192
- package/api/src/libs/notification/template/subscription-will-canceled.ts +94 -135
- package/api/src/libs/notification/template/subscription-will-renew.ts +220 -245
- package/api/src/libs/payment.ts +69 -0
- package/api/src/libs/queue/index.ts +3 -2
- package/api/src/libs/session.ts +8 -0
- package/api/src/libs/subscription.ts +74 -3
- package/api/src/libs/ws.ts +23 -1
- package/api/src/locales/en.ts +33 -0
- package/api/src/locales/zh.ts +31 -0
- package/api/src/queues/credit-consume.ts +715 -0
- package/api/src/queues/credit-grant.ts +572 -0
- package/api/src/queues/notification.ts +173 -128
- package/api/src/queues/payment.ts +210 -122
- package/api/src/queues/subscription.ts +179 -0
- package/api/src/routes/checkout-sessions.ts +157 -9
- package/api/src/routes/connect/shared.ts +3 -2
- package/api/src/routes/credit-grants.ts +241 -0
- package/api/src/routes/credit-transactions.ts +208 -0
- package/api/src/routes/index.ts +8 -0
- package/api/src/routes/meter-events.ts +347 -0
- package/api/src/routes/meters.ts +219 -0
- package/api/src/routes/payment-currencies.ts +14 -2
- package/api/src/routes/payment-links.ts +1 -1
- package/api/src/routes/payment-methods.ts +14 -2
- package/api/src/routes/prices.ts +43 -0
- package/api/src/routes/pricing-table.ts +13 -7
- package/api/src/routes/products.ts +63 -4
- package/api/src/routes/settings.ts +1 -1
- package/api/src/routes/subscriptions.ts +4 -0
- package/api/src/store/migrations/20250610-billing-credit.ts +43 -0
- package/api/src/store/models/credit-grant.ts +486 -0
- package/api/src/store/models/credit-transaction.ts +268 -0
- package/api/src/store/models/customer.ts +8 -0
- package/api/src/store/models/index.ts +52 -1
- package/api/src/store/models/meter-event.ts +423 -0
- package/api/src/store/models/meter.ts +176 -0
- package/api/src/store/models/payment-currency.ts +66 -14
- package/api/src/store/models/price.ts +6 -0
- package/api/src/store/models/product.ts +2 -2
- package/api/src/store/models/subscription.ts +24 -0
- package/api/src/store/models/types.ts +28 -2
- package/api/tests/libs/subscription.spec.ts +53 -0
- package/blocklet.yml +9 -1
- package/package.json +57 -58
- package/scripts/sdk.js +233 -1
- package/src/app.tsx +10 -0
- package/src/components/actions.tsx +22 -9
- package/src/components/balance-list.tsx +40 -12
- package/src/components/collapse.tsx +33 -15
- package/src/components/copyable.tsx +8 -7
- package/src/components/currency.tsx +15 -7
- package/src/components/customer/actions.tsx +1 -5
- package/src/components/customer/credit-grant-item-list.tsx +99 -0
- package/src/components/customer/credit-overview.tsx +233 -0
- package/src/components/customer/form.tsx +7 -2
- package/src/components/customer/link.tsx +4 -12
- package/src/components/customer/notification-preference.tsx +18 -9
- package/src/components/customer/overdraft-protection.tsx +112 -41
- package/src/components/drawer-form.tsx +42 -18
- package/src/components/error.tsx +1 -5
- package/src/components/event/list.tsx +9 -10
- package/src/components/filter-toolbar.tsx +20 -19
- package/src/components/info-card.tsx +32 -18
- package/src/components/info-metric.tsx +16 -6
- package/src/components/info-row-group.tsx +1 -7
- package/src/components/info-row.tsx +30 -24
- package/src/components/invoice/action.tsx +1 -7
- package/src/components/invoice/list.tsx +34 -26
- package/src/components/invoice/recharge.tsx +5 -7
- package/src/components/invoice/table.tsx +17 -12
- package/src/components/layout/user.tsx +1 -1
- package/src/components/metadata/form.tsx +290 -94
- package/src/components/metadata/list.tsx +11 -3
- package/src/components/meter/actions.tsx +101 -0
- package/src/components/meter/add-usage-dialog.tsx +239 -0
- package/src/components/meter/events-list.tsx +657 -0
- package/src/components/meter/form.tsx +245 -0
- package/src/components/meter/products.tsx +264 -0
- package/src/components/meter/usage-guide.tsx +174 -0
- package/src/components/passport/actions.tsx +9 -4
- package/src/components/payment-currency/add.tsx +16 -3
- package/src/components/payment-currency/form.tsx +14 -6
- package/src/components/payment-intent/actions.tsx +24 -16
- package/src/components/payment-intent/list.tsx +30 -9
- package/src/components/payment-link/actions.tsx +1 -5
- package/src/components/payment-link/after-pay.tsx +4 -2
- package/src/components/payment-link/before-pay.tsx +14 -4
- package/src/components/payment-link/item.tsx +27 -6
- package/src/components/payment-link/preview.tsx +9 -9
- package/src/components/payment-link/product-select.tsx +69 -15
- package/src/components/payment-method/arcblock.tsx +8 -1
- package/src/components/payment-method/base.tsx +8 -1
- package/src/components/payment-method/bitcoin.tsx +8 -1
- package/src/components/payment-method/ethereum.tsx +8 -1
- package/src/components/payment-method/evm-rpc-input.tsx +11 -7
- package/src/components/payment-method/form.tsx +2 -7
- package/src/components/payment-method/stripe.tsx +2 -0
- package/src/components/payouts/actions.tsx +1 -5
- package/src/components/payouts/list.tsx +30 -10
- package/src/components/payouts/portal/list.tsx +11 -9
- package/src/components/price/currency-select.tsx +63 -32
- package/src/components/price/form.tsx +895 -370
- package/src/components/price/upsell-select.tsx +10 -2
- package/src/components/price/upsell.tsx +7 -2
- package/src/components/pricing-table/actions.tsx +1 -5
- package/src/components/pricing-table/customer-settings.tsx +5 -1
- package/src/components/pricing-table/payment-settings.tsx +14 -4
- package/src/components/pricing-table/preview.tsx +9 -9
- package/src/components/pricing-table/price-item.tsx +6 -1
- package/src/components/pricing-table/product-item.tsx +6 -1
- package/src/components/pricing-table/product-settings.tsx +17 -4
- package/src/components/product/actions.tsx +1 -5
- package/src/components/product/add-price.tsx +9 -7
- package/src/components/product/create.tsx +8 -9
- package/src/components/product/cross-sell-select.tsx +5 -1
- package/src/components/product/cross-sell.tsx +7 -2
- package/src/components/product/edit-price.tsx +21 -12
- package/src/components/product/features.tsx +26 -6
- package/src/components/product/form.tsx +115 -72
- package/src/components/progress-bar.tsx +1 -1
- package/src/components/refund/actions.tsx +1 -7
- package/src/components/refund/list.tsx +31 -18
- package/src/components/section/header.tsx +12 -14
- package/src/components/subscription/actions/cancel.tsx +22 -5
- package/src/components/subscription/actions/index.tsx +9 -10
- package/src/components/subscription/actions/pause.tsx +32 -6
- package/src/components/subscription/actions/slash-stake.tsx +5 -3
- package/src/components/subscription/description.tsx +12 -8
- package/src/components/subscription/items/index.tsx +31 -16
- package/src/components/subscription/items/usage-records.tsx +19 -5
- package/src/components/subscription/list.tsx +5 -7
- package/src/components/subscription/metrics.tsx +62 -15
- package/src/components/subscription/portal/actions.tsx +78 -71
- package/src/components/subscription/portal/cancel.tsx +10 -3
- package/src/components/subscription/portal/list.tsx +48 -26
- package/src/components/uploader.tsx +5 -13
- package/src/components/webhook/attempts.tsx +51 -16
- package/src/components/webhook/request-info.tsx +8 -6
- package/src/contexts/products.tsx +27 -10
- package/src/hooks/subscription.ts +34 -0
- package/src/libs/meter-utils.ts +196 -0
- package/src/libs/util.ts +4 -0
- package/src/locales/en.tsx +385 -4
- package/src/locales/zh.tsx +364 -0
- package/src/pages/admin/billing/index.tsx +61 -33
- package/src/pages/admin/billing/invoices/detail.tsx +49 -13
- package/src/pages/admin/billing/meters/create.tsx +60 -0
- package/src/pages/admin/billing/meters/detail.tsx +435 -0
- package/src/pages/admin/billing/meters/index.tsx +210 -0
- package/src/pages/admin/billing/meters/meter-event.tsx +346 -0
- package/src/pages/admin/billing/subscriptions/detail.tsx +90 -25
- package/src/pages/admin/customers/customers/credit-grant/detail.tsx +391 -0
- package/src/pages/admin/customers/customers/detail.tsx +67 -14
- package/src/pages/admin/customers/customers/index.tsx +6 -1
- package/src/pages/admin/customers/index.tsx +5 -0
- package/src/pages/admin/developers/events/detail.tsx +37 -11
- package/src/pages/admin/developers/index.tsx +1 -1
- package/src/pages/admin/developers/webhooks/detail.tsx +41 -11
- package/src/pages/admin/index.tsx +15 -2
- package/src/pages/admin/overview.tsx +107 -19
- package/src/pages/admin/payments/intents/detail.tsx +58 -14
- package/src/pages/admin/payments/payouts/detail.tsx +63 -15
- package/src/pages/admin/payments/refunds/detail.tsx +58 -14
- package/src/pages/admin/products/index.tsx +11 -4
- package/src/pages/admin/products/links/create.tsx +22 -4
- package/src/pages/admin/products/links/detail.tsx +43 -14
- package/src/pages/admin/products/passports/index.tsx +23 -4
- package/src/pages/admin/products/prices/actions.tsx +16 -9
- package/src/pages/admin/products/prices/detail.tsx +73 -14
- package/src/pages/admin/products/prices/list.tsx +15 -3
- package/src/pages/admin/products/pricing-tables/create.tsx +45 -12
- package/src/pages/admin/products/pricing-tables/detail.tsx +45 -14
- package/src/pages/admin/products/products/create.tsx +233 -54
- package/src/pages/admin/products/products/detail.tsx +74 -18
- package/src/pages/admin/settings/index.tsx +8 -1
- package/src/pages/admin/settings/payment-methods/index.tsx +87 -19
- package/src/pages/admin/settings/vault-config/edit-form.tsx +42 -28
- package/src/pages/admin/settings/vault-config/index.tsx +57 -10
- package/src/pages/customer/credit-grant/detail.tsx +308 -0
- package/src/pages/customer/index.tsx +76 -17
- package/src/pages/customer/invoice/detail.tsx +63 -14
- package/src/pages/customer/invoice/past-due.tsx +11 -3
- package/src/pages/customer/payout/detail.tsx +56 -13
- package/src/pages/customer/recharge/account.tsx +78 -18
- package/src/pages/customer/recharge/subscription.tsx +86 -25
- package/src/pages/customer/refund/list.tsx +60 -24
- package/src/pages/customer/subscription/change-payment.tsx +17 -6
- package/src/pages/customer/subscription/change-plan.tsx +34 -7
- package/src/pages/customer/subscription/detail.tsx +134 -34
- package/src/pages/customer/subscription/embed.tsx +25 -5
- package/src/pages/home.tsx +26 -4
- package/src/pages/integrations/donations/edit-form.tsx +25 -9
- package/src/pages/integrations/donations/index.tsx +26 -9
- package/src/pages/integrations/donations/preview.tsx +59 -15
- package/src/pages/integrations/index.tsx +10 -1
- package/src/pages/integrations/overview.tsx +78 -17
- package/vite.config.ts +60 -30
|
@@ -99,7 +99,13 @@ function EditApiHost({ method }: { method: TPaymentMethodExpanded }) {
|
|
|
99
99
|
<InfoRow
|
|
100
100
|
label={t('admin.paymentMethod.arcblock.api_host.label')}
|
|
101
101
|
value={
|
|
102
|
-
<Stack
|
|
102
|
+
<Stack
|
|
103
|
+
direction="row"
|
|
104
|
+
spacing={1}
|
|
105
|
+
sx={{
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
flexWrap: 'wrap',
|
|
108
|
+
}}>
|
|
103
109
|
{edit ? (
|
|
104
110
|
<>
|
|
105
111
|
<TextField
|
|
@@ -118,12 +124,14 @@ function EditApiHost({ method }: { method: TPaymentMethodExpanded }) {
|
|
|
118
124
|
sx={{ flex: 1 }}
|
|
119
125
|
placeholder={t('admin.paymentMethod.arcblock.api_host.tip')}
|
|
120
126
|
error={!!error}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
slotProps={{
|
|
128
|
+
input: {
|
|
129
|
+
endAdornment: error ? (
|
|
130
|
+
<Typography color="error" sx={{ whiteSpace: 'nowrap' }}>
|
|
131
|
+
{error}
|
|
132
|
+
</Typography>
|
|
133
|
+
) : undefined,
|
|
134
|
+
},
|
|
127
135
|
}}
|
|
128
136
|
/>
|
|
129
137
|
<IconButton onClick={handleSave} size="small">
|
|
@@ -168,7 +176,12 @@ function RpcStatus({ method }: { method: TPaymentMethodExpanded }) {
|
|
|
168
176
|
return (
|
|
169
177
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
|
170
178
|
<CircularProgress size={14} />
|
|
171
|
-
<Typography
|
|
179
|
+
<Typography
|
|
180
|
+
sx={{
|
|
181
|
+
color: 'text.secondary',
|
|
182
|
+
}}>
|
|
183
|
+
{t('admin.paymentMethod.evm.checking')}
|
|
184
|
+
</Typography>
|
|
172
185
|
</Box>
|
|
173
186
|
);
|
|
174
187
|
}
|
|
@@ -176,7 +189,12 @@ function RpcStatus({ method }: { method: TPaymentMethodExpanded }) {
|
|
|
176
189
|
return (
|
|
177
190
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
|
|
178
191
|
<CheckCircleOutline sx={{ fontSize: 14 }} color="success" />
|
|
179
|
-
<Typography
|
|
192
|
+
<Typography
|
|
193
|
+
sx={{
|
|
194
|
+
color: 'text.secondary',
|
|
195
|
+
}}>
|
|
196
|
+
{t('admin.paymentMethod.evm.connected')}
|
|
197
|
+
</Typography>
|
|
180
198
|
</Box>
|
|
181
199
|
);
|
|
182
200
|
}
|
|
@@ -237,7 +255,12 @@ function Balance({
|
|
|
237
255
|
<InfoRow label={t('admin.paymentMethod.props.explorer_host')} value={explorerHost} />
|
|
238
256
|
<InfoRow
|
|
239
257
|
label={
|
|
240
|
-
<Box
|
|
258
|
+
<Box
|
|
259
|
+
sx={{
|
|
260
|
+
display: 'flex',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
gap: 0.5,
|
|
263
|
+
}}>
|
|
241
264
|
{t('admin.paymentMethod.props.balance')}
|
|
242
265
|
{['ethereum', 'base'].includes(method.type) && (
|
|
243
266
|
<Tooltip
|
|
@@ -255,8 +278,8 @@ function Balance({
|
|
|
255
278
|
value={
|
|
256
279
|
<Stack
|
|
257
280
|
direction="row"
|
|
258
|
-
alignItems="center"
|
|
259
281
|
sx={{
|
|
282
|
+
alignItems: 'center',
|
|
260
283
|
display: 'inline-flex',
|
|
261
284
|
borderRadius: 1,
|
|
262
285
|
}}>
|
|
@@ -302,8 +325,19 @@ function PaymentMethodSkeleton() {
|
|
|
302
325
|
return (
|
|
303
326
|
<>
|
|
304
327
|
{[1].map((group) => (
|
|
305
|
-
<Box
|
|
306
|
-
|
|
328
|
+
<Box
|
|
329
|
+
key={group}
|
|
330
|
+
sx={{
|
|
331
|
+
mt: 3,
|
|
332
|
+
}}>
|
|
333
|
+
<Stack
|
|
334
|
+
direction="row"
|
|
335
|
+
sx={{
|
|
336
|
+
alignItems: 'center',
|
|
337
|
+
mb: 1,
|
|
338
|
+
flexWrap: 'wrap',
|
|
339
|
+
gap: 1,
|
|
340
|
+
}}>
|
|
307
341
|
<Skeleton variant="text" width={120} height={32} />
|
|
308
342
|
</Stack>
|
|
309
343
|
<Box
|
|
@@ -314,8 +348,19 @@ function PaymentMethodSkeleton() {
|
|
|
314
348
|
borderColor: 'divider',
|
|
315
349
|
mb: 1,
|
|
316
350
|
}}>
|
|
317
|
-
<Stack
|
|
318
|
-
|
|
351
|
+
<Stack
|
|
352
|
+
direction="row"
|
|
353
|
+
sx={{
|
|
354
|
+
justifyContent: 'space-between',
|
|
355
|
+
alignItems: 'center',
|
|
356
|
+
}}>
|
|
357
|
+
<Stack
|
|
358
|
+
direction="row"
|
|
359
|
+
spacing={2}
|
|
360
|
+
sx={{
|
|
361
|
+
alignItems: 'center',
|
|
362
|
+
flex: 1,
|
|
363
|
+
}}>
|
|
319
364
|
<Skeleton variant="rectangular" width={40} height={40} />
|
|
320
365
|
<Box sx={{ flex: 1 }}>
|
|
321
366
|
<Skeleton variant="text" width="20%" height={24} />
|
|
@@ -419,8 +464,19 @@ export default function PaymentMethods() {
|
|
|
419
464
|
return (
|
|
420
465
|
<>
|
|
421
466
|
{Object.keys(groups).map((x) => (
|
|
422
|
-
<Box
|
|
423
|
-
|
|
467
|
+
<Box
|
|
468
|
+
key={x}
|
|
469
|
+
sx={{
|
|
470
|
+
mt: 3,
|
|
471
|
+
}}>
|
|
472
|
+
<Stack
|
|
473
|
+
direction="row"
|
|
474
|
+
sx={{
|
|
475
|
+
alignItems: 'center',
|
|
476
|
+
mb: 1,
|
|
477
|
+
flexWrap: 'wrap',
|
|
478
|
+
gap: 1,
|
|
479
|
+
}}>
|
|
424
480
|
<Typography variant="subtitle2" sx={{ textTransform: 'uppercase' }}>
|
|
425
481
|
{x}
|
|
426
482
|
</Typography>
|
|
@@ -453,8 +509,17 @@ export default function PaymentMethods() {
|
|
|
453
509
|
expanded={expandedId === method.id}
|
|
454
510
|
onChange={(value, expanded) => handleExpand(value, expanded)}
|
|
455
511
|
lazy={false}>
|
|
456
|
-
<Grid
|
|
457
|
-
|
|
512
|
+
<Grid
|
|
513
|
+
container
|
|
514
|
+
spacing={2}
|
|
515
|
+
sx={{
|
|
516
|
+
mt: 0,
|
|
517
|
+
}}>
|
|
518
|
+
<Grid
|
|
519
|
+
size={{
|
|
520
|
+
xs: 12,
|
|
521
|
+
md: 6,
|
|
522
|
+
}}>
|
|
458
523
|
<InfoRow label={t('admin.paymentMethod.props.type')} value={method.type} />
|
|
459
524
|
{method.type === 'arcblock' && <EditApiHost method={method} />}
|
|
460
525
|
{['ethereum', 'base'].includes(method.type) && <RpcStatus method={method} />}
|
|
@@ -484,6 +549,9 @@ export default function PaymentMethods() {
|
|
|
484
549
|
if (!currency) {
|
|
485
550
|
return null;
|
|
486
551
|
}
|
|
552
|
+
if (currency.type === 'credit') {
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
487
555
|
return (
|
|
488
556
|
<ListItem
|
|
489
557
|
key={currency.id}
|
|
@@ -109,7 +109,12 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
109
109
|
if (!item) return null;
|
|
110
110
|
|
|
111
111
|
const renderLabelWithTooltip = (label: string, tooltip: string) => (
|
|
112
|
-
<Stack
|
|
112
|
+
<Stack
|
|
113
|
+
direction="row"
|
|
114
|
+
spacing={1}
|
|
115
|
+
sx={{
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
}}>
|
|
113
118
|
<Typography variant="subtitle2">{label}</Typography>
|
|
114
119
|
<Tooltip title={tooltip}>
|
|
115
120
|
<HelpOutlineIcon fontSize="small" sx={{ color: 'text.secondary' }} />
|
|
@@ -149,7 +154,12 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
149
154
|
|
|
150
155
|
<Stack spacing={3}>
|
|
151
156
|
{/* 启用设置 */}
|
|
152
|
-
<Stack
|
|
157
|
+
<Stack
|
|
158
|
+
direction="row"
|
|
159
|
+
sx={{
|
|
160
|
+
alignItems: 'center',
|
|
161
|
+
gap: 2,
|
|
162
|
+
}}>
|
|
153
163
|
<Typography variant="subtitle1">{t('admin.vaultConfig.enableVault')}</Typography>
|
|
154
164
|
<Controller
|
|
155
165
|
name="enabled"
|
|
@@ -195,21 +205,23 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
195
205
|
type="number"
|
|
196
206
|
error={!!errors.deposit_threshold}
|
|
197
207
|
helperText={getDepositHelperText(errors.deposit_threshold)}
|
|
198
|
-
InputProps={{
|
|
199
|
-
endAdornment: (
|
|
200
|
-
<InputAdornment position="end">
|
|
201
|
-
<Box sx={{ display: 'flex', alignItems: 'center', ml: 1 }}>
|
|
202
|
-
<Currency logo={item.logo} name={item.symbol} />
|
|
203
|
-
</Box>
|
|
204
|
-
</InputAdornment>
|
|
205
|
-
),
|
|
206
|
-
inputProps: {
|
|
207
|
-
min: 0,
|
|
208
|
-
max: MAX_SAFE_AMOUNT,
|
|
209
|
-
},
|
|
210
|
-
}}
|
|
211
208
|
sx={{ mt: 1 }}
|
|
212
209
|
placeholder={VAULT_DEPOSIT_THRESHOLD}
|
|
210
|
+
slotProps={{
|
|
211
|
+
input: {
|
|
212
|
+
endAdornment: (
|
|
213
|
+
<InputAdornment position="end">
|
|
214
|
+
<Box sx={{ display: 'flex', alignItems: 'center', ml: 1 }}>
|
|
215
|
+
<Currency logo={item.logo} name={item.symbol} />
|
|
216
|
+
</Box>
|
|
217
|
+
</InputAdornment>
|
|
218
|
+
),
|
|
219
|
+
inputProps: {
|
|
220
|
+
min: 0,
|
|
221
|
+
max: MAX_SAFE_AMOUNT,
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
}}
|
|
213
225
|
/>
|
|
214
226
|
)}
|
|
215
227
|
/>
|
|
@@ -246,21 +258,23 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
246
258
|
type="number"
|
|
247
259
|
error={!!errors.buffer_threshold}
|
|
248
260
|
helperText={getBufferHelperText(errors.buffer_threshold)}
|
|
249
|
-
InputProps={{
|
|
250
|
-
endAdornment: (
|
|
251
|
-
<InputAdornment position="end">
|
|
252
|
-
<Box sx={{ display: 'flex', alignItems: 'center', ml: 1 }}>
|
|
253
|
-
<Currency logo={item.logo} name={item.symbol} />
|
|
254
|
-
</Box>
|
|
255
|
-
</InputAdornment>
|
|
256
|
-
),
|
|
257
|
-
inputProps: {
|
|
258
|
-
min: 0,
|
|
259
|
-
max: MAX_SAFE_AMOUNT,
|
|
260
|
-
},
|
|
261
|
-
}}
|
|
262
261
|
sx={{ mt: 1 }}
|
|
263
262
|
placeholder={VAULT_BUFFER_THRESHOLD}
|
|
263
|
+
slotProps={{
|
|
264
|
+
input: {
|
|
265
|
+
endAdornment: (
|
|
266
|
+
<InputAdornment position="end">
|
|
267
|
+
<Box sx={{ display: 'flex', alignItems: 'center', ml: 1 }}>
|
|
268
|
+
<Currency logo={item.logo} name={item.symbol} />
|
|
269
|
+
</Box>
|
|
270
|
+
</InputAdornment>
|
|
271
|
+
),
|
|
272
|
+
inputProps: {
|
|
273
|
+
min: 0,
|
|
274
|
+
max: MAX_SAFE_AMOUNT,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
}}
|
|
264
278
|
/>
|
|
265
279
|
)}
|
|
266
280
|
/>
|
|
@@ -110,12 +110,21 @@ export default function VaultConfig() {
|
|
|
110
110
|
return '-';
|
|
111
111
|
}
|
|
112
112
|
return (
|
|
113
|
-
<Stack
|
|
113
|
+
<Stack
|
|
114
|
+
direction="row"
|
|
115
|
+
spacing={1}
|
|
116
|
+
sx={{
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
}}>
|
|
114
119
|
<Avatar src={item.logo} alt={item.symbol} style={{ width: 24, height: 24 }} />
|
|
115
120
|
<Box>
|
|
116
121
|
<Typography variant="body2">{item.symbol}</Typography>
|
|
117
122
|
{!isMobile && (
|
|
118
|
-
<Typography
|
|
123
|
+
<Typography
|
|
124
|
+
variant="caption"
|
|
125
|
+
sx={{
|
|
126
|
+
color: 'text.secondary',
|
|
127
|
+
}}>
|
|
119
128
|
{item.payment_method?.name}
|
|
120
129
|
</Typography>
|
|
121
130
|
)}
|
|
@@ -153,7 +162,12 @@ export default function VaultConfig() {
|
|
|
153
162
|
}
|
|
154
163
|
const enabled = item.vault_config?.enabled;
|
|
155
164
|
return (
|
|
156
|
-
<Stack
|
|
165
|
+
<Stack
|
|
166
|
+
direction="row"
|
|
167
|
+
spacing={1}
|
|
168
|
+
sx={{
|
|
169
|
+
alignItems: 'center',
|
|
170
|
+
}}>
|
|
157
171
|
<Box
|
|
158
172
|
sx={{
|
|
159
173
|
width: 8,
|
|
@@ -181,7 +195,11 @@ export default function VaultConfig() {
|
|
|
181
195
|
}
|
|
182
196
|
if (!item?.vault_config) {
|
|
183
197
|
return (
|
|
184
|
-
<Typography
|
|
198
|
+
<Typography
|
|
199
|
+
variant="body2"
|
|
200
|
+
sx={{
|
|
201
|
+
color: 'text.secondary',
|
|
202
|
+
}}>
|
|
185
203
|
{t('admin.vaultConfig.notConfig')}
|
|
186
204
|
</Typography>
|
|
187
205
|
);
|
|
@@ -194,7 +212,12 @@ export default function VaultConfig() {
|
|
|
194
212
|
},
|
|
195
213
|
customHeadLabelRender: () => {
|
|
196
214
|
return (
|
|
197
|
-
<Box
|
|
215
|
+
<Box
|
|
216
|
+
sx={{
|
|
217
|
+
display: 'flex',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
gap: 1,
|
|
220
|
+
}}>
|
|
198
221
|
{t('admin.vaultConfig.depositThreshold')}
|
|
199
222
|
<Tooltip title={t('admin.vaultConfig.depositThresholdHelp')}>
|
|
200
223
|
<HelpOutline fontSize="small" sx={{ color: 'text.lighter' }} />
|
|
@@ -215,7 +238,11 @@ export default function VaultConfig() {
|
|
|
215
238
|
}
|
|
216
239
|
if (!item?.vault_config) {
|
|
217
240
|
return (
|
|
218
|
-
<Typography
|
|
241
|
+
<Typography
|
|
242
|
+
variant="body2"
|
|
243
|
+
sx={{
|
|
244
|
+
color: 'text.secondary',
|
|
245
|
+
}}>
|
|
219
246
|
{t('admin.vaultConfig.notConfig')}
|
|
220
247
|
</Typography>
|
|
221
248
|
);
|
|
@@ -228,7 +255,12 @@ export default function VaultConfig() {
|
|
|
228
255
|
},
|
|
229
256
|
customHeadLabelRender: () => {
|
|
230
257
|
return (
|
|
231
|
-
<Box
|
|
258
|
+
<Box
|
|
259
|
+
sx={{
|
|
260
|
+
display: 'flex',
|
|
261
|
+
alignItems: 'center',
|
|
262
|
+
gap: 1,
|
|
263
|
+
}}>
|
|
232
264
|
{t('admin.vaultConfig.bufferThreshold')}
|
|
233
265
|
<Tooltip title={t('admin.vaultConfig.bufferThresholdHelp')}>
|
|
234
266
|
<HelpOutline fontSize="small" sx={{ color: 'text.lighter' }} />
|
|
@@ -317,7 +349,14 @@ export default function VaultConfig() {
|
|
|
317
349
|
return (
|
|
318
350
|
<Empty>
|
|
319
351
|
<Typography variant="body1">{t('admin.vaultConfig.notConfigured')}</Typography>
|
|
320
|
-
<Typography
|
|
352
|
+
<Typography
|
|
353
|
+
variant="body2"
|
|
354
|
+
sx={{
|
|
355
|
+
mt: 1,
|
|
356
|
+
display: 'flex',
|
|
357
|
+
alignItems: 'center',
|
|
358
|
+
gap: 0.5,
|
|
359
|
+
}}>
|
|
321
360
|
{parsedParts.map((part: { type: 'text' | 'marked'; content: string }) =>
|
|
322
361
|
part.type === 'text' ? (
|
|
323
362
|
part.content
|
|
@@ -337,8 +376,16 @@ export default function VaultConfig() {
|
|
|
337
376
|
|
|
338
377
|
return (
|
|
339
378
|
<Root>
|
|
340
|
-
<Box
|
|
341
|
-
|
|
379
|
+
<Box
|
|
380
|
+
sx={{
|
|
381
|
+
mb: 2,
|
|
382
|
+
}}>
|
|
383
|
+
<Typography
|
|
384
|
+
variant="body2"
|
|
385
|
+
sx={{
|
|
386
|
+
color: 'text.secondary',
|
|
387
|
+
mt: 1,
|
|
388
|
+
}}>
|
|
342
389
|
{t('admin.vaultConfig.description')}
|
|
343
390
|
<Box
|
|
344
391
|
component="a"
|