@rhinestone/deposit-modal 0.1.47 → 0.1.48
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/{DepositModalReown-DKLN3IE3.mjs → DepositModalReown-3V2EFXH5.mjs} +2 -2
- package/dist/{DepositModalReown-IUZNTZ3Y.cjs → DepositModalReown-SV6QIUTL.cjs} +3 -3
- package/dist/{WithdrawModalReown-XOFREB4D.mjs → WithdrawModalReown-FODH7PY5.mjs} +2 -2
- package/dist/{WithdrawModalReown-FGUHFUVN.cjs → WithdrawModalReown-ZSR3RP44.cjs} +3 -3
- package/dist/{chunk-LT3QKJI2.cjs → chunk-7HJ7IBRH.cjs} +43 -27
- package/dist/{chunk-QIK6ONMQ.mjs → chunk-FKNYONM2.mjs} +43 -27
- package/dist/{chunk-O3VFAUSL.mjs → chunk-HCZNF6CR.mjs} +2 -2
- package/dist/{chunk-MS2J6M5C.cjs → chunk-PW55TOFK.cjs} +33 -33
- package/dist/{chunk-7U5TNZZB.mjs → chunk-ZAQISJAP.mjs} +21 -4
- package/dist/{chunk-LOOU3NCI.cjs → chunk-ZK6VAHSB.cjs} +166 -149
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +3 -3
- package/dist/{types-DQG7NEBI.d.ts → types-B0FLVdXb.d.ts} +6 -1
- package/dist/{types-CyUiKQ4H.d.cts → types-dY70pF2y.d.cts} +6 -1
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toEvmCaip2,
|
|
26
26
|
tokenFormatter,
|
|
27
27
|
txRefsMatch
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-FKNYONM2.mjs";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_BACKEND_URL,
|
|
31
31
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -253,6 +253,7 @@ function AssetSelectStep({
|
|
|
253
253
|
publicClient,
|
|
254
254
|
defaultSourceChain,
|
|
255
255
|
defaultSourceToken,
|
|
256
|
+
allowedRoutes,
|
|
256
257
|
service,
|
|
257
258
|
onContinue,
|
|
258
259
|
onTotalBalanceComputed,
|
|
@@ -325,13 +326,25 @@ function AssetSelectStep({
|
|
|
325
326
|
onTotalBalanceComputed?.(total);
|
|
326
327
|
if (assets.length > 0) onAssetsLoaded?.(assets);
|
|
327
328
|
}, [assets, onTotalBalanceComputed, onAssetsLoaded]);
|
|
329
|
+
const allowedChainSet = useMemo(
|
|
330
|
+
() => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
|
|
331
|
+
[allowedRoutes?.sourceChains]
|
|
332
|
+
);
|
|
333
|
+
const allowedTokenSet = useMemo(
|
|
334
|
+
() => allowedRoutes?.sourceTokens ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
335
|
+
[allowedRoutes?.sourceTokens]
|
|
336
|
+
);
|
|
328
337
|
const rows = useMemo(() => {
|
|
329
338
|
return assets.filter((a) => {
|
|
330
339
|
try {
|
|
331
|
-
|
|
340
|
+
if (BigInt(a.balance ?? "0") <= BigInt(0)) return false;
|
|
332
341
|
} catch {
|
|
333
342
|
return false;
|
|
334
343
|
}
|
|
344
|
+
if (allowedChainSet && !allowedChainSet.has(a.chainId)) return false;
|
|
345
|
+
if (allowedTokenSet && !allowedTokenSet.has(a.symbol.toUpperCase()))
|
|
346
|
+
return false;
|
|
347
|
+
return true;
|
|
335
348
|
}).sort((a, b) => {
|
|
336
349
|
const usdA = a.balanceUsd ?? 0;
|
|
337
350
|
const usdB = b.balanceUsd ?? 0;
|
|
@@ -342,7 +355,7 @@ function AssetSelectStep({
|
|
|
342
355
|
if (balB < balA) return -1;
|
|
343
356
|
return 0;
|
|
344
357
|
});
|
|
345
|
-
}, [assets]);
|
|
358
|
+
}, [assets, allowedChainSet, allowedTokenSet]);
|
|
346
359
|
const selectedAsset = selectedAssetId && assets.find((asset) => asset.id === selectedAssetId);
|
|
347
360
|
const formatBalance = (asset) => {
|
|
348
361
|
if (!asset.balance) return "--";
|
|
@@ -2462,6 +2475,7 @@ function DepositFlow({
|
|
|
2462
2475
|
onRequestConnect,
|
|
2463
2476
|
connectButtonLabel,
|
|
2464
2477
|
uiConfig,
|
|
2478
|
+
allowedRoutes,
|
|
2465
2479
|
onStepChange,
|
|
2466
2480
|
onTotalBalanceChange,
|
|
2467
2481
|
onClose,
|
|
@@ -3348,6 +3362,7 @@ function DepositFlow({
|
|
|
3348
3362
|
publicClient: getReadClientForChain(ownerChainId),
|
|
3349
3363
|
defaultSourceChain,
|
|
3350
3364
|
defaultSourceToken,
|
|
3365
|
+
allowedRoutes,
|
|
3351
3366
|
service,
|
|
3352
3367
|
onContinue: handleAssetContinue,
|
|
3353
3368
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
@@ -3417,7 +3432,7 @@ function DepositFlow({
|
|
|
3417
3432
|
// src/DepositModal.tsx
|
|
3418
3433
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3419
3434
|
var ReownDepositInner = lazy(
|
|
3420
|
-
() => import("./DepositModalReown-
|
|
3435
|
+
() => import("./DepositModalReown-3V2EFXH5.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
3421
3436
|
);
|
|
3422
3437
|
function DepositModal(props) {
|
|
3423
3438
|
const needsReown = !!props.reownAppId;
|
|
@@ -3454,6 +3469,7 @@ function DepositModalInner({
|
|
|
3454
3469
|
theme,
|
|
3455
3470
|
branding,
|
|
3456
3471
|
uiConfig,
|
|
3472
|
+
allowedRoutes,
|
|
3457
3473
|
className,
|
|
3458
3474
|
onReady,
|
|
3459
3475
|
onConnected,
|
|
@@ -3631,6 +3647,7 @@ function DepositModalInner({
|
|
|
3631
3647
|
onRequestConnect,
|
|
3632
3648
|
connectButtonLabel,
|
|
3633
3649
|
uiConfig,
|
|
3650
|
+
allowedRoutes,
|
|
3634
3651
|
onStepChange: handleStepChange,
|
|
3635
3652
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
3636
3653
|
onClose,
|