payment-kit 1.18.50 → 1.18.52
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/api/src/crons/currency.ts +25 -4
- package/api/src/libs/payment.ts +92 -0
- package/api/src/routes/connect/shared.ts +5 -3
- package/api/src/routes/connect/subscribe.ts +36 -5
- package/api/src/routes/invoices.ts +47 -0
- package/blocklet.yml +1 -1
- package/package.json +18 -18
- package/public/currencies/0xBTC.png +0 -0
- package/public/currencies/1INCH.svg +1 -0
- package/public/currencies/AAVE.svg +1 -0
- package/public/currencies/ABT.svg +16 -0
- package/public/currencies/ACX.png +0 -0
- package/public/currencies/ADX.svg +12 -0
- package/public/currencies/AIKEK.png +0 -0
- package/public/currencies/AJNA.svg +12 -0
- package/public/currencies/AKIRA.png +0 -0
- package/public/currencies/ALEX.png +0 -0
- package/public/currencies/ALI.png +0 -0
- package/public/currencies/ALT.svg +12 -0
- package/public/currencies/AMKT.svg +5 -0
- package/public/currencies/AMP.svg +7 -0
- package/public/currencies/APU.png +0 -0
- package/public/currencies/APW.svg +21 -0
- package/public/currencies/APX.png +0 -0
- package/public/currencies/ARC.png +0 -0
- package/public/currencies/ARIA20.svg +1 -0
- package/public/currencies/ARPA.svg +1 -0
- package/public/currencies/ATH.svg +1 -0
- package/public/currencies/AVC.png +0 -0
- package/public/currencies/AVRK.png +0 -0
- package/public/currencies/AXGT.svg +1 -0
- package/public/currencies/AZUR.svg +20 -0
- package/public/currencies/BAL.png +0 -0
- package/public/currencies/BANK.png +0 -0
- package/public/currencies/BAXA.svg +3 -0
- package/public/currencies/BCAT.png +0 -0
- package/public/currencies/BEPRO.svg +1 -0
- package/public/currencies/BERRY.svg +1 -0
- package/public/currencies/BICO.svg +11 -0
- package/public/currencies/BITBOT.jpg +0 -0
- package/public/currencies/BITCOIN.png +0 -0
- package/public/currencies/BKN.svg +1 -0
- package/public/currencies/BLUE.png +0 -0
- package/public/currencies/BNB.png +0 -0
- package/public/currencies/BOBA.svg +16 -0
- package/public/currencies/BOBO.png +0 -0
- package/public/currencies/BOND.svg +10 -0
- package/public/currencies/BOTTO.svg +4 -0
- package/public/currencies/BRIGHT.svg +83 -0
- package/public/currencies/BTRST.svg +1 -0
- package/public/currencies/BURN.png +0 -0
- package/public/currencies/BitANT.png +0 -0
- package/public/currencies/BitBTC.png +0 -0
- package/public/currencies/CARD.svg +1 -0
- package/public/currencies/CBX.svg +1 -0
- package/public/currencies/CHI.svg +1 -0
- package/public/currencies/CIG.svg +21 -0
- package/public/currencies/CNG.svg +9 -0
- package/public/currencies/COC.svg +8 -0
- package/public/currencies/COLLAB.svg +8 -0
- package/public/currencies/COMP.svg +1 -0
- package/public/currencies/COW.svg +1 -0
- package/public/currencies/CRV.png +0 -0
- package/public/currencies/CRYO.svg +1 -0
- package/public/currencies/CTRAVL.svg +1 -0
- package/public/currencies/CTSI.svg +1 -0
- package/public/currencies/CTX.svg +1 -0
- package/public/currencies/CUSD.png +0 -0
- package/public/currencies/CXT.svg +11 -0
- package/public/currencies/D2D.svg +6 -0
- package/public/currencies/DAI.svg +13 -0
- package/public/currencies/DCN.svg +47 -0
- package/public/currencies/DF.svg +15 -0
- package/public/currencies/DHT.svg +1 -0
- package/public/currencies/DIMO.svg +1 -0
- package/public/currencies/DMS.png +0 -0
- package/public/currencies/DODO.svg +6 -0
- package/public/currencies/DOGEGF.png +0 -0
- package/public/currencies/DOLA.svg +1 -0
- package/public/currencies/DOSE.svg +1 -0
- package/public/currencies/DUCK.png +0 -0
- package/public/currencies/DYP.png +0 -0
- package/public/currencies/EIGEN.svg +13 -0
- package/public/currencies/ENS.png +0 -0
- package/public/currencies/EPOCH.svg +1 -0
- package/public/currencies/EQB.svg +4 -0
- package/public/currencies/EQZ.png +0 -0
- package/public/currencies/ERN.png +0 -0
- package/public/currencies/ERNTST.png +0 -0
- package/public/currencies/EST.png +0 -0
- package/public/currencies/ETH.svg +13 -0
- package/public/currencies/ETHIX.svg +1 -0
- package/public/currencies/EVERY.svg +13 -0
- package/public/currencies/F.svg +1 -0
- package/public/currencies/FACTR.png +0 -0
- package/public/currencies/FANS.svg +11 -0
- package/public/currencies/FARM.png +0 -0
- package/public/currencies/FCR.png +0 -0
- package/public/currencies/FET.svg +21 -0
- package/public/currencies/FIS.svg +22 -0
- package/public/currencies/FLASH.svg +22 -0
- package/public/currencies/FLy.png +0 -0
- package/public/currencies/FOAM.svg +23 -0
- package/public/currencies/FORTH.svg +1 -0
- package/public/currencies/FOX.svg +8 -0
- package/public/currencies/FRAX.png +0 -0
- package/public/currencies/FU.svg +17 -0
- package/public/currencies/FVT.svg +1 -0
- package/public/currencies/FXN.svg +25 -0
- package/public/currencies/FXS.png +0 -0
- package/public/currencies/Froglic.png +0 -0
- package/public/currencies/GALAXIS.svg +1 -0
- package/public/currencies/GCH.png +0 -0
- package/public/currencies/GENOME.svg +23 -0
- package/public/currencies/GGTK.svg +1 -0
- package/public/currencies/GHST.svg +15 -0
- package/public/currencies/GIGACHAD.png +0 -0
- package/public/currencies/GIV.svg +6 -0
- package/public/currencies/GLS.svg +22 -0
- package/public/currencies/GOLD.png +0 -0
- package/public/currencies/GRG.png +0 -0
- package/public/currencies/GROW.svg +1 -0
- package/public/currencies/GRT.svg +11 -0
- package/public/currencies/GTC.svg +5 -0
- package/public/currencies/GURU.svg +1 -0
- package/public/currencies/GYEN.svg +1 -0
- package/public/currencies/GYSR.png +0 -0
- package/public/currencies/HAIR.svg +1 -0
- package/public/currencies/HAN.svg +25 -0
- package/public/currencies/HANeP.svg +1 -0
- package/public/currencies/HAUS.png +0 -0
- package/public/currencies/HEU.svg +5 -0
- package/public/currencies/HOBA.png +0 -0
- package/public/currencies/HUNT.svg +1 -0
- package/public/currencies/IBEX.png +0 -0
- package/public/currencies/IDRISS.svg +4 -0
- package/public/currencies/IOTX.png +0 -0
- package/public/currencies/IPOR.svg +1 -0
- package/public/currencies/IPT.svg +7 -0
- package/public/currencies/IRARA.svg +1 -0
- package/public/currencies/ISK.png +0 -0
- package/public/currencies/IYKYK.svg +14 -0
- package/public/currencies/JAM.svg +20 -0
- package/public/currencies/JRT.svg +8 -0
- package/public/currencies/KAGE.png +0 -0
- package/public/currencies/KAI.svg +23 -0
- package/public/currencies/KIBSHI.png +0 -0
- package/public/currencies/KNC.png +0 -0
- package/public/currencies/KOMPETE.png +0 -0
- package/public/currencies/KROM.png +0 -0
- package/public/currencies/LCX.svg +6 -0
- package/public/currencies/LDO.svg +5 -0
- package/public/currencies/LIF3.svg +27 -0
- package/public/currencies/LINK.png +0 -0
- package/public/currencies/LIZ.png +0 -0
- package/public/currencies/LMEOW.png +0 -0
- package/public/currencies/LOCG.png +0 -0
- package/public/currencies/LORDS.png +0 -0
- package/public/currencies/LPF.svg +18 -0
- package/public/currencies/LQTY.svg +1 -0
- package/public/currencies/LRC.png +0 -0
- package/public/currencies/LRDS.svg +44 -0
- package/public/currencies/LSK.png +0 -0
- package/public/currencies/LUSD.svg +1 -0
- package/public/currencies/LYRA.png +0 -0
- package/public/currencies/MASK.svg +4 -0
- package/public/currencies/MASQ.png +0 -0
- package/public/currencies/MBS.png +0 -0
- package/public/currencies/MCADE.svg +26 -0
- package/public/currencies/MET.svg +15 -0
- package/public/currencies/MINDS.svg +32 -0
- package/public/currencies/MKR.png +0 -0
- package/public/currencies/MLN.svg +1 -0
- package/public/currencies/MOCHI.svg +1 -0
- package/public/currencies/MOM.svg +5 -0
- package/public/currencies/MONKE.png +0 -0
- package/public/currencies/MOOV.svg +5 -0
- package/public/currencies/MORPHO.svg +14 -0
- package/public/currencies/MPWR.svg +5 -0
- package/public/currencies/MTA.svg +15 -0
- package/public/currencies/MTL.png +0 -0
- package/public/currencies/MUGLOO.png +0 -0
- package/public/currencies/Mog.png +0 -0
- package/public/currencies/NAVI.svg +1 -0
- package/public/currencies/NCT.svg +49 -0
- package/public/currencies/NET.svg +11 -0
- package/public/currencies/NEURON.svg +38 -0
- package/public/currencies/NFD.png +0 -0
- package/public/currencies/NOGS.png +0 -0
- package/public/currencies/NOUNS.png +0 -0
- package/public/currencies/NOVA.png +0 -0
- package/public/currencies/NSTR.svg +4 -0
- package/public/currencies/Neiro.png +0 -0
- package/public/currencies/OCEAN.png +0 -0
- package/public/currencies/OGN.svg +8 -0
- package/public/currencies/OL.svg +21 -0
- package/public/currencies/OLAS.svg +7 -0
- package/public/currencies/OM.png +0 -0
- package/public/currencies/OMETA.svg +7 -0
- package/public/currencies/OMI.svg +42 -0
- package/public/currencies/OPENLOOT.svg +21 -0
- package/public/currencies/OPN.svg +1 -0
- package/public/currencies/OS.svg +1 -0
- package/public/currencies/OUTb.svg +4 -0
- package/public/currencies/OVR.png +0 -0
- package/public/currencies/PAGE.svg +1 -0
- package/public/currencies/PAL.svg +1 -0
- package/public/currencies/PAPER.svg +4 -0
- package/public/currencies/PENDLE.png +0 -0
- package/public/currencies/PEPE.png +0 -0
- package/public/currencies/PERP.png +0 -0
- package/public/currencies/PHTK.svg +14 -0
- package/public/currencies/PIP.svg +11 -0
- package/public/currencies/POGS.png +0 -0
- package/public/currencies/POOL.svg +22 -0
- package/public/currencies/POP.svg +8 -0
- package/public/currencies/PORK.png +0 -0
- package/public/currencies/PRE.svg +66 -0
- package/public/currencies/PREMIA.svg +4 -0
- package/public/currencies/PRF.png +0 -0
- package/public/currencies/PRO.svg +1 -0
- package/public/currencies/PSP.svg +35 -0
- package/public/currencies/PSTAKE.png +0 -0
- package/public/currencies/PSY.svg +26 -0
- package/public/currencies/RAC.png +0 -0
- package/public/currencies/RAI.svg +1 -0
- package/public/currencies/RAZOR.svg +1 -0
- package/public/currencies/REKT.png +0 -0
- package/public/currencies/RFKJ.png +0 -0
- package/public/currencies/RFWSTETH.svg +36 -0
- package/public/currencies/RGT.png +0 -0
- package/public/currencies/RICE.svg +22 -0
- package/public/currencies/RIZE.svg +21 -0
- package/public/currencies/RPL.svg +1 -0
- package/public/currencies/RSC.svg +6 -0
- package/public/currencies/RSR.png +0 -0
- package/public/currencies/RSS3.png +0 -0
- package/public/currencies/Reach.svg +17 -0
- package/public/currencies/SAIL.png +0 -0
- package/public/currencies/SALD.png +0 -0
- package/public/currencies/SARCO.png +0 -0
- package/public/currencies/SCM.svg +1 -0
- package/public/currencies/SCRY.svg +13 -0
- package/public/currencies/SDL.svg +1 -0
- package/public/currencies/SEAM.svg +5 -0
- package/public/currencies/SEXY.svg +1 -0
- package/public/currencies/SHU.png +0 -0
- package/public/currencies/SIPHER.png +0 -0
- package/public/currencies/SKAI.svg +1 -0
- package/public/currencies/SLN.png +0 -0
- package/public/currencies/SMT.svg +1 -0
- package/public/currencies/SMURFCAT.png +0 -0
- package/public/currencies/SNT.svg +14 -0
- package/public/currencies/SNX.svg +20 -0
- package/public/currencies/SOFI.png +0 -0
- package/public/currencies/SOFT.svg +1 -0
- package/public/currencies/SOVRN.svg +13 -0
- package/public/currencies/SPANK.png +0 -0
- package/public/currencies/SPC.png +0 -0
- package/public/currencies/SPOT.svg +1 -0
- package/public/currencies/SQD.png +0 -0
- package/public/currencies/SQT.svg +14 -0
- package/public/currencies/STNT.svg +38 -0
- package/public/currencies/STPT.png +0 -0
- package/public/currencies/SUDO.svg +6 -0
- package/public/currencies/SUKU.png +0 -0
- package/public/currencies/SUPER.svg +6 -0
- package/public/currencies/SUSHI.svg +19 -0
- package/public/currencies/SYNTH.svg +1 -0
- package/public/currencies/ShibDoge.png +0 -0
- package/public/currencies/Silo.svg +4 -0
- package/public/currencies/StaFi.svg +65 -0
- package/public/currencies/T.svg +4 -0
- package/public/currencies/TEN.svg +1 -0
- package/public/currencies/TETU.svg +6 -0
- package/public/currencies/THALES.png +0 -0
- package/public/currencies/THING.png +0 -0
- package/public/currencies/THX.svg +22 -0
- package/public/currencies/TKAI.svg +1 -0
- package/public/currencies/TKN.png +0 -0
- package/public/currencies/TODL.png +0 -0
- package/public/currencies/TOWER.svg +1 -0
- package/public/currencies/TRAC.png +0 -0
- package/public/currencies/TRB.png +0 -0
- package/public/currencies/TRUE.svg +11 -0
- package/public/currencies/TRX.svg +4 -0
- package/public/currencies/TSC.png +0 -0
- package/public/currencies/TT.png +0 -0
- package/public/currencies/TUSD.png +0 -0
- package/public/currencies/TYBENG.png +0 -0
- package/public/currencies/TheDAO.svg +1 -0
- package/public/currencies/U.png +0 -0
- package/public/currencies/UBI.svg +5 -0
- package/public/currencies/UCASH.svg +1 -0
- package/public/currencies/UDT.svg +4 -0
- package/public/currencies/UMA.png +0 -0
- package/public/currencies/UNI.png +0 -0
- package/public/currencies/USA.png +0 -0
- package/public/currencies/USC.svg +23 -0
- package/public/currencies/USD3.svg +13 -0
- package/public/currencies/USDD.png +0 -0
- package/public/currencies/USDS.png +0 -0
- package/public/currencies/USDbC.png +0 -0
- package/public/currencies/UST.png +0 -0
- package/public/currencies/VALX.png +0 -0
- package/public/currencies/VIDYA.png +0 -0
- package/public/currencies/VITA.svg +10 -0
- package/public/currencies/VSP.svg +15 -0
- package/public/currencies/VUSD.svg +1 -0
- package/public/currencies/WAAC.png +0 -0
- package/public/currencies/WAD.png +0 -0
- package/public/currencies/WALLET.svg +1 -0
- package/public/currencies/WAMPL.svg +53 -0
- package/public/currencies/WBTC.png +0 -0
- package/public/currencies/WCT.svg +5 -0
- package/public/currencies/WEXO.png +0 -0
- package/public/currencies/WLD.jpeg +0 -0
- package/public/currencies/WMC.png +0 -0
- package/public/currencies/WOO.png +0 -0
- package/public/currencies/Wildfire.svg +1 -0
- package/public/currencies/XCHF.png +0 -0
- package/public/currencies/XCN.svg +1 -0
- package/public/currencies/XMT.svg +1 -0
- package/public/currencies/XYO.svg +1 -0
- package/public/currencies/YFI.svg +4 -0
- package/public/currencies/YFX.svg +11 -0
- package/public/currencies/YGG.svg +11 -0
- package/public/currencies/YOKAI.png +0 -0
- package/public/currencies/YYY.svg +1 -0
- package/public/currencies/ZENT.svg +12 -0
- package/public/currencies/ZRX.png +0 -0
- package/public/currencies/ZUN.svg +24 -0
- package/public/currencies/ZUSD.svg +1 -0
- package/public/currencies/ZYN.png +0 -0
- package/public/currencies/aCRV.png +0 -0
- package/public/currencies/btc.png +0 -0
- package/public/currencies/bwAJNA.svg +1 -0
- package/public/currencies/cSTONE.svg +23 -0
- package/public/currencies/cbETH.svg +9 -0
- package/public/currencies/crvUSD.png +0 -0
- package/public/currencies/cvxFXS.png +0 -0
- package/public/currencies/dollar.png +0 -0
- package/public/currencies/ePendle.png +0 -0
- package/public/currencies/frxETH.png +0 -0
- package/public/currencies/fxUSD.svg +5 -0
- package/public/currencies/iFARM.png +0 -0
- package/public/currencies/iZi.png +0 -0
- package/public/currencies/imgnAI.svg +1 -0
- package/public/currencies/mpETH.svg +4 -0
- package/public/currencies/nETH.svg +11 -0
- package/public/currencies/rETH.svg +1 -0
- package/public/currencies/rgUSD.svg +5 -0
- package/public/currencies/rnETH.svg +11 -0
- package/public/currencies/sDAI.svg +13 -0
- package/public/currencies/sFRAX.png +0 -0
- package/public/currencies/sUSDS.png +0 -0
- package/public/currencies/scWETHv2.svg +1 -0
- package/public/currencies/send.svg +12 -0
- package/public/currencies/stETH.png +1 -0
- package/public/currencies/stZENT.svg +12 -0
- package/public/currencies/stkLYRA.svg +26 -0
- package/public/currencies/tGS.png +0 -0
- package/public/currencies/tSTAR.png +0 -0
- package/public/currencies/usdc.png +0 -0
- package/public/currencies/usdt.png +0 -0
- package/public/currencies/veKWENTA.svg +24 -0
- package/public/currencies/wHOGE.svg +14 -0
- package/public/currencies/wOpenX.svg +140 -0
- package/public/currencies/wPOKT.svg +17 -0
- package/public/currencies/wTBT.svg +1 -0
- package/public/currencies/weETH.svg +23 -0
- package/public/currencies/wstETH.svg +11 -0
- package/public/currencies/yETH.svg +8 -0
- package/public/currencies/zunETH.svg +46 -0
- package/public/currencies/zunUSD.svg +33 -0
- package/src/components/customer/overdraft-protection.tsx +37 -9
- package/src/components/invoice/action.tsx +20 -0
- package/src/components/invoice/list.tsx +4 -1
- package/src/components/payment-currency/add.tsx +12 -3
- package/src/components/payment-currency/edit.tsx +89 -3
- package/src/components/payment-currency/tokenList.json +8847 -8156
- package/src/components/payment-intent/list.tsx +2 -4
- package/src/components/subscription/portal/actions.tsx +6 -2
- package/src/libs/util.ts +2 -0
- package/src/locales/en.tsx +11 -3
- package/src/locales/zh.tsx +11 -3
- package/src/pages/admin/settings/vault-config/edit-form.tsx +13 -0
- package/src/pages/customer/recharge/account.tsx +8 -1
- package/src/pages/customer/recharge/subscription.tsx +8 -1
- package/src/pages/customer/subscription/detail.tsx +1 -3
|
@@ -117,12 +117,10 @@ export default function PaymentList({ customer_id, invoice_id, features }: ListP
|
|
|
117
117
|
options: {
|
|
118
118
|
customBodyRenderLite: (_: string, index: number) => {
|
|
119
119
|
const item = data.list[index] as TPaymentIntentExpanded;
|
|
120
|
+
const highlight = item.amount_received === '0' && item.status !== 'canceled';
|
|
120
121
|
return (
|
|
121
122
|
<Link to={`/admin/payments/${item.id}`}>
|
|
122
|
-
<Typography
|
|
123
|
-
component="strong"
|
|
124
|
-
sx={{ color: item.amount_received === '0' ? 'warning.main' : 'inherit' }}
|
|
125
|
-
fontWeight={600}>
|
|
123
|
+
<Typography component="strong" sx={{ color: highlight ? 'warning.main' : 'inherit' }} fontWeight={600}>
|
|
126
124
|
{formatBNStr(
|
|
127
125
|
item.amount_received === '0' ? item.amount : item.amount_received,
|
|
128
126
|
item?.paymentCurrency.decimal
|
|
@@ -335,7 +335,11 @@ export function SubscriptionActionsInner({
|
|
|
335
335
|
} as any,
|
|
336
336
|
onSuccess: () => {
|
|
337
337
|
connect.close();
|
|
338
|
-
|
|
338
|
+
if (!subscription.overdraft_protection?.enabled) {
|
|
339
|
+
Toast.success(t('customer.overdraftProtection.openSuccess'));
|
|
340
|
+
} else {
|
|
341
|
+
Toast.success(t('customer.overdraftProtection.settingSuccess'));
|
|
342
|
+
}
|
|
339
343
|
setState({ openProtection: false });
|
|
340
344
|
refreshOverdraftProtection();
|
|
341
345
|
// @ts-ignore
|
|
@@ -348,7 +352,7 @@ export function SubscriptionActionsInner({
|
|
|
348
352
|
},
|
|
349
353
|
});
|
|
350
354
|
} else {
|
|
351
|
-
Toast.success(t('customer.overdraftProtection.
|
|
355
|
+
Toast.success(t('customer.overdraftProtection.closeSuccess'));
|
|
352
356
|
setState({ openProtection: false });
|
|
353
357
|
refreshOverdraftProtection();
|
|
354
358
|
// @ts-ignore
|
package/src/libs/util.ts
CHANGED
|
@@ -23,6 +23,8 @@ import { joinURL } from 'ufo';
|
|
|
23
23
|
|
|
24
24
|
import { t } from '../locales/index';
|
|
25
25
|
|
|
26
|
+
export const MAX_SAFE_AMOUNT = 1000000000;
|
|
27
|
+
|
|
26
28
|
export const formatProductPrice = (
|
|
27
29
|
{ prices, unit_label }: { prices: TPrice[]; unit_label: string },
|
|
28
30
|
currency: TPaymentCurrency,
|
package/src/locales/en.tsx
CHANGED
|
@@ -41,6 +41,7 @@ export default flat({
|
|
|
41
41
|
cancel: 'Cancel',
|
|
42
42
|
know: 'I Know',
|
|
43
43
|
confirm: 'Confirm',
|
|
44
|
+
maxAmount: 'Max amount is {max}',
|
|
44
45
|
days: {
|
|
45
46
|
sunday: 'Sunday',
|
|
46
47
|
monday: 'Monday',
|
|
@@ -520,9 +521,14 @@ export default flat({
|
|
|
520
521
|
duplicate: 'Duplicate Invoice',
|
|
521
522
|
returnStake: {
|
|
522
523
|
title: 'Return Stake',
|
|
523
|
-
tip: 'Are you sure you want to return the stake? This action will return the stake to the customer.',
|
|
524
|
+
tip: 'Are you sure you want to return the stake? This action will return the stake to the customer immediately.',
|
|
524
525
|
success: 'Stake return application has been successfully created',
|
|
525
526
|
},
|
|
527
|
+
void: {
|
|
528
|
+
title: 'Void Invoice',
|
|
529
|
+
tip: 'Are you sure you want to void this invoice? This action will immediately void the invoice.',
|
|
530
|
+
success: 'Invoice voided',
|
|
531
|
+
},
|
|
526
532
|
},
|
|
527
533
|
subscription: {
|
|
528
534
|
view: 'View subscription',
|
|
@@ -878,8 +884,10 @@ export default flat({
|
|
|
878
884
|
ruleTip:
|
|
879
885
|
'N is the number of cycles, P is the subscription bill amount, Fee is the SubGuard™ service fee, the single fee is {gas} {symbol}',
|
|
880
886
|
min: 'The amount must be greater or equal to {min} {symbol}',
|
|
881
|
-
settingSuccess: '
|
|
882
|
-
settingError: '
|
|
887
|
+
settingSuccess: 'Settings Updated',
|
|
888
|
+
settingError: 'Failed to update SubGuard™ settings',
|
|
889
|
+
openSuccess: 'SubGuard™ Enabled',
|
|
890
|
+
closeSuccess: 'SubGuard™ Disabled',
|
|
883
891
|
keepStake: 'Keep Remaining Stake For SubGuard™',
|
|
884
892
|
returnStake: 'Return Remaining Stake',
|
|
885
893
|
stake: 'Stake',
|
package/src/locales/zh.tsx
CHANGED
|
@@ -49,6 +49,7 @@ export default flat({
|
|
|
49
49
|
friday: '星期五',
|
|
50
50
|
saturday: '星期六',
|
|
51
51
|
},
|
|
52
|
+
maxAmount: '最大金额为 {max}',
|
|
52
53
|
},
|
|
53
54
|
notification: {
|
|
54
55
|
preferences: {
|
|
@@ -509,9 +510,14 @@ export default flat({
|
|
|
509
510
|
attention: '未完成的账单',
|
|
510
511
|
returnStake: {
|
|
511
512
|
title: '退还质押',
|
|
512
|
-
tip: '
|
|
513
|
+
tip: '您确定要退还质押吗?此操作将立即退还质押给客户。',
|
|
513
514
|
success: '质押退还申请已提交',
|
|
514
515
|
},
|
|
516
|
+
void: {
|
|
517
|
+
title: '作废账单',
|
|
518
|
+
tip: '您确定要作废此账单吗?此操作将立即作废账单。',
|
|
519
|
+
success: '账单作废成功',
|
|
520
|
+
},
|
|
515
521
|
},
|
|
516
522
|
subscription: {
|
|
517
523
|
view: '查看订阅',
|
|
@@ -848,8 +854,10 @@ export default flat({
|
|
|
848
854
|
rule: '规则:N * ( P + Fee )',
|
|
849
855
|
ruleTip: 'N 为周期数, P 为订阅账单费用, Fee 为订阅守护服务费用,单次费用为 {gas} {symbol}',
|
|
850
856
|
min: '质押金额不得小于 {min} {symbol}',
|
|
851
|
-
settingSuccess: '
|
|
852
|
-
settingError: '
|
|
857
|
+
settingSuccess: '配置更新成功',
|
|
858
|
+
settingError: '配置更新失败',
|
|
859
|
+
openSuccess: '订阅守护已开启',
|
|
860
|
+
closeSuccess: '订阅守护已关闭',
|
|
853
861
|
keepStake: '不退还质押',
|
|
854
862
|
returnStake: '退还剩余质押',
|
|
855
863
|
stake: '质押',
|
|
@@ -8,6 +8,7 @@ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
|
|
8
8
|
import { useRequest } from 'ahooks';
|
|
9
9
|
import type { TPaymentCurrencyExpanded } from '@blocklet/payment-types';
|
|
10
10
|
import Currency from '../../../../components/currency';
|
|
11
|
+
import { MAX_SAFE_AMOUNT } from '../../../../libs/util';
|
|
11
12
|
|
|
12
13
|
type EditFormProps = {
|
|
13
14
|
item: TPaymentCurrencyExpanded | null;
|
|
@@ -178,6 +179,11 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
178
179
|
if (Number(value) <= 0) {
|
|
179
180
|
return t('admin.vaultConfig.depositThresholdRequired');
|
|
180
181
|
}
|
|
182
|
+
if (Number(value) > MAX_SAFE_AMOUNT) {
|
|
183
|
+
return t('common.maxAmount', {
|
|
184
|
+
max: MAX_SAFE_AMOUNT,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
181
187
|
const validPrecision = formatAmountPrecisionLimit(value.toString(), locale, item.decimal || 6);
|
|
182
188
|
return validPrecision || true;
|
|
183
189
|
},
|
|
@@ -199,6 +205,7 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
199
205
|
),
|
|
200
206
|
inputProps: {
|
|
201
207
|
min: 0,
|
|
208
|
+
max: MAX_SAFE_AMOUNT,
|
|
202
209
|
},
|
|
203
210
|
}}
|
|
204
211
|
sx={{ mt: 1 }}
|
|
@@ -223,6 +230,11 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
223
230
|
if (Number(value) < 0) {
|
|
224
231
|
return t('admin.vaultConfig.bufferThresholdInvalid');
|
|
225
232
|
}
|
|
233
|
+
if (Number(value) > MAX_SAFE_AMOUNT) {
|
|
234
|
+
return t('common.maxAmount', {
|
|
235
|
+
max: MAX_SAFE_AMOUNT,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
226
238
|
const validPrecision = formatAmountPrecisionLimit(value.toString(), locale, item.decimal || 6);
|
|
227
239
|
return validPrecision || true;
|
|
228
240
|
},
|
|
@@ -244,6 +256,7 @@ function EditForm({ item, onClose, onSuccess, isOwner }: EditFormProps) {
|
|
|
244
256
|
),
|
|
245
257
|
inputProps: {
|
|
246
258
|
min: 0,
|
|
259
|
+
max: MAX_SAFE_AMOUNT,
|
|
247
260
|
},
|
|
248
261
|
}}
|
|
249
262
|
sx={{ mt: 1 }}
|
|
@@ -34,7 +34,7 @@ import { AccountBalanceWalletOutlined, ArrowBackOutlined, ArrowForwardOutlined }
|
|
|
34
34
|
import Empty from '@arcblock/ux/lib/Empty';
|
|
35
35
|
import { BN, fromUnitToToken } from '@ocap/util';
|
|
36
36
|
import RechargeList from '../../../components/invoice/recharge';
|
|
37
|
-
import { goBackOrFallback } from '../../../libs/util';
|
|
37
|
+
import { goBackOrFallback, MAX_SAFE_AMOUNT } from '../../../libs/util';
|
|
38
38
|
import { useSessionContext } from '../../../contexts/session';
|
|
39
39
|
import { formatSmartDuration, TimeUnit } from '../../../libs/dayjs';
|
|
40
40
|
|
|
@@ -257,6 +257,9 @@ export default function BalanceRechargePage() {
|
|
|
257
257
|
if (!/^\d*\.?\d*$/.test(value)) return;
|
|
258
258
|
// 不允许以小数点开头
|
|
259
259
|
if (value.startsWith('.')) return;
|
|
260
|
+
if (Number(value) > MAX_SAFE_AMOUNT) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
260
263
|
const precision = currency.decimal;
|
|
261
264
|
const errorMessage = formatAmountPrecisionLimit(value, locale, precision || 6);
|
|
262
265
|
setAmountError(errorMessage || '');
|
|
@@ -513,6 +516,10 @@ export default function BalanceRechargePage() {
|
|
|
513
516
|
InputProps={{
|
|
514
517
|
endAdornment: <Typography>{currency.symbol}</Typography>,
|
|
515
518
|
autoComplete: 'off',
|
|
519
|
+
inputProps: {
|
|
520
|
+
min: 0,
|
|
521
|
+
max: MAX_SAFE_AMOUNT,
|
|
522
|
+
},
|
|
516
523
|
}}
|
|
517
524
|
inputRef={customInputRef}
|
|
518
525
|
/>
|
|
@@ -35,7 +35,7 @@ import SubscriptionDescription from '../../../components/subscription/descriptio
|
|
|
35
35
|
import InfoRow from '../../../components/info-row';
|
|
36
36
|
import Currency from '../../../components/currency';
|
|
37
37
|
import SubscriptionMetrics from '../../../components/subscription/metrics';
|
|
38
|
-
import { goBackOrFallback } from '../../../libs/util';
|
|
38
|
+
import { goBackOrFallback, MAX_SAFE_AMOUNT } from '../../../libs/util';
|
|
39
39
|
import CustomerLink from '../../../components/customer/link';
|
|
40
40
|
import { useSessionContext } from '../../../contexts/session';
|
|
41
41
|
import { formatSmartDuration, TimeUnit } from '../../../libs/dayjs';
|
|
@@ -191,6 +191,9 @@ export default function RechargePage() {
|
|
|
191
191
|
if (!/^\d*\.?\d*$/.test(value)) return;
|
|
192
192
|
// 不允许以小数点开头
|
|
193
193
|
if (value.startsWith('.')) return;
|
|
194
|
+
if (Number(value) > MAX_SAFE_AMOUNT) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
194
197
|
const precision = subscription.paymentCurrency.maximum_precision || 6;
|
|
195
198
|
const errorMessage = formatAmountPrecisionLimit(value, locale, precision);
|
|
196
199
|
setAmountError(errorMessage || '');
|
|
@@ -479,6 +482,10 @@ export default function RechargePage() {
|
|
|
479
482
|
InputProps={{
|
|
480
483
|
endAdornment: <Typography>{subscription.paymentCurrency.symbol}</Typography>,
|
|
481
484
|
autoComplete: 'off',
|
|
485
|
+
inputProps: {
|
|
486
|
+
min: 0,
|
|
487
|
+
max: MAX_SAFE_AMOUNT,
|
|
488
|
+
},
|
|
482
489
|
}}
|
|
483
490
|
sx={{ mt: 1 }}
|
|
484
491
|
inputRef={customInputRef}
|
|
@@ -382,9 +382,7 @@ export default function CustomerSubscriptionDetail() {
|
|
|
382
382
|
<InfoMetric
|
|
383
383
|
label={
|
|
384
384
|
<Stack direction="row" alignItems="center" spacing={0.5}>
|
|
385
|
-
<Typography
|
|
386
|
-
{t('customer.overdraftProtection.title')}
|
|
387
|
-
</Typography>
|
|
385
|
+
<Typography component="span">{t('customer.overdraftProtection.title')}</Typography>
|
|
388
386
|
<MuiLink
|
|
389
387
|
href="https://www.arcblock.io/content/blog/en/payment-kit-v117-sub-guard#listen-to-the-audio-overview"
|
|
390
388
|
target="_blank"
|