@rhinestone/deposit-modal 0.0.0-dev-20260727172000 → 0.0.0-dev-20260728133107
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/README.md +2 -3
- package/dist/{DepositModalReown-XIJUAOYR.mjs → DepositModalReown-5OJ5W7UF.mjs} +5 -5
- package/dist/{DepositModalReown-2VJFCAUT.cjs → DepositModalReown-ITBBFOT5.cjs} +9 -9
- package/dist/{chunk-7PLFGGXC.mjs → chunk-3HNPIAZ2.mjs} +126 -10
- package/dist/{chunk-ESWMFZEV.mjs → chunk-3RS2MAZQ.mjs} +1 -1
- package/dist/{chunk-VZKUD5IN.mjs → chunk-73ONCSU4.mjs} +2 -97
- package/dist/{chunk-H7TD7XE5.cjs → chunk-ADZHPRS6.cjs} +55 -55
- package/dist/{chunk-PGBW524J.mjs → chunk-DVGQIPR3.mjs} +1 -1
- package/dist/{chunk-UIN4SMPX.cjs → chunk-MGY6ZIRN.cjs} +60 -60
- package/dist/{chunk-5S7WGG7V.mjs → chunk-NGHW6KWC.mjs} +25 -6
- package/dist/{chunk-UI3JRDXX.mjs → chunk-NNMMD33D.mjs} +2 -2
- package/dist/{chunk-UKS5VK74.cjs → chunk-OO3YA7KN.cjs} +3 -3
- package/dist/{chunk-62PQAA3X.mjs → chunk-OVBGVQ3N.mjs} +1 -1
- package/dist/{chunk-ONPO2OFC.cjs → chunk-UIZAZSPM.cjs} +474 -358
- package/dist/{chunk-7RZPE5KV.cjs → chunk-WS5LFG34.cjs} +1 -1
- package/dist/{chunk-U2SADOVK.cjs → chunk-XBT6WQYZ.cjs} +52 -147
- package/dist/{chunk-4ALOTMS6.cjs → chunk-YK7VHKW7.cjs} +27 -8
- package/dist/claim.cjs +5 -5
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +7 -7
- package/dist/styles.css +10 -0
- package/dist/{types-Cuyhz25e.d.cts → types-vpysc9yQ.d.cts} +1 -4
- package/dist/{types-Cuyhz25e.d.ts → types-vpysc9yQ.d.ts} +1 -4
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +4 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ The user picks the destination chain, token, recipient, and amount in the modal;
|
|
|
98
98
|
|
|
99
99
|
## Claim a failed deposit
|
|
100
100
|
|
|
101
|
-
`ClaimModal` lets a user get a failed or rejected EVM deposit sent back to them on its source chain. They paste the deposit's transaction hash and name a destination — **no wallet connection is involved at any point
|
|
101
|
+
`ClaimModal` lets a user get a failed or rejected EVM deposit sent back to them on its source chain. They paste the deposit's transaction hash and name a destination — **no wallet connection is involved at any point**, and there is no chain to pick: the hash is looked up across every chain, including ones the deposit flow itself doesn't list.
|
|
102
102
|
|
|
103
103
|
```tsx
|
|
104
104
|
import { ClaimModal } from "@rhinestone/deposit-modal/claim";
|
|
@@ -107,8 +107,7 @@ import { ClaimModal } from "@rhinestone/deposit-modal/claim";
|
|
|
107
107
|
isOpen={claimOpen}
|
|
108
108
|
onClose={() => setClaimOpen(false)}
|
|
109
109
|
refundEndpoint="/api/refund"
|
|
110
|
-
// Optional
|
|
111
|
-
defaultSourceChain={42161}
|
|
110
|
+
// Optional prefills:
|
|
112
111
|
defaultTxHash={depositTxHash}
|
|
113
112
|
onLifecycle={(event) => console.log(event)}
|
|
114
113
|
/>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3HNPIAZ2.mjs";
|
|
4
|
+
import "./chunk-3RS2MAZQ.mjs";
|
|
5
|
+
import "./chunk-DVGQIPR3.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isUnsupportedChainSwitchError,
|
|
8
8
|
rpcUrlFor
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-NGHW6KWC.mjs";
|
|
10
|
+
import "./chunk-OVBGVQ3N.mjs";
|
|
11
11
|
import "./chunk-YJP274QC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SUPPORTED_CHAINS,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkUIZAZSPMcjs = require('./chunk-UIZAZSPM.cjs');
|
|
4
|
+
require('./chunk-MGY6ZIRN.cjs');
|
|
5
|
+
require('./chunk-OO3YA7KN.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkYK7VHKW7cjs = require('./chunk-YK7VHKW7.cjs');
|
|
10
|
+
require('./chunk-WS5LFG34.cjs');
|
|
11
11
|
require('./chunk-W3WWC4LD.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -88,14 +88,14 @@ function buildTransports(rpcUrls) {
|
|
|
88
88
|
const transports = {};
|
|
89
89
|
for (const network of EVM_NETWORKS) {
|
|
90
90
|
const id = Number(network.id);
|
|
91
|
-
transports[id] = _viem.http.call(void 0,
|
|
91
|
+
transports[id] = _viem.http.call(void 0, _chunkYK7VHKW7cjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
92
92
|
}
|
|
93
93
|
return transports;
|
|
94
94
|
}
|
|
95
95
|
function getEvmRpcFingerprint(rpcUrls) {
|
|
96
96
|
return EVM_NETWORKS.map((network) => {
|
|
97
97
|
const id = Number(network.id);
|
|
98
|
-
return `${id}=${_nullishCoalesce(
|
|
98
|
+
return `${id}=${_nullishCoalesce(_chunkYK7VHKW7cjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
99
99
|
}).join("|");
|
|
100
100
|
}
|
|
101
101
|
var cachedAdapter = null;
|
|
@@ -189,7 +189,7 @@ function useReownWallet() {
|
|
|
189
189
|
await switchChainAsync({ chainId });
|
|
190
190
|
}
|
|
191
191
|
} catch (err) {
|
|
192
|
-
if (
|
|
192
|
+
if (_chunkYK7VHKW7cjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
193
193
|
throw new Error(
|
|
194
194
|
`Switch to ${_chunkEGB3NWMLcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
195
195
|
);
|
|
@@ -226,7 +226,7 @@ function DepositModalWithReown(props) {
|
|
|
226
226
|
reown.disconnect();
|
|
227
227
|
}, [reown.disconnect]);
|
|
228
228
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
-
|
|
229
|
+
_chunkUIZAZSPMcjs.DepositModalInner,
|
|
230
230
|
{
|
|
231
231
|
...props,
|
|
232
232
|
reownWallet: reownWithSolana,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
readDedupedAccountSetupResult,
|
|
19
19
|
runAccountSetupDeduped,
|
|
20
20
|
txRefsMatch
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3RS2MAZQ.mjs";
|
|
22
22
|
import {
|
|
23
23
|
ListRow
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DVGQIPR3.mjs";
|
|
25
25
|
import {
|
|
26
26
|
AlertTriangleIcon,
|
|
27
27
|
AppleIcon,
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
PoweredBy,
|
|
50
50
|
RpcUrlsProvider,
|
|
51
51
|
Spinner,
|
|
52
|
+
SwappedConnectFeeChangedError,
|
|
52
53
|
TokenIcon,
|
|
53
54
|
TransferCryptoIcon,
|
|
54
55
|
UnplugIcon,
|
|
@@ -73,7 +74,7 @@ import {
|
|
|
73
74
|
useLatestRef,
|
|
74
75
|
useRpcUrls,
|
|
75
76
|
useStableRpcUrls
|
|
76
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-NGHW6KWC.mjs";
|
|
77
78
|
import {
|
|
78
79
|
POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
79
80
|
POLYMARKET_ICON_URL,
|
|
@@ -3210,6 +3211,7 @@ function ExchangeConnectStep({
|
|
|
3210
3211
|
smartAccount,
|
|
3211
3212
|
service,
|
|
3212
3213
|
connection,
|
|
3214
|
+
loadUrl: loadPreparedUrl,
|
|
3213
3215
|
onSwappedComplete,
|
|
3214
3216
|
onSwappedFailed,
|
|
3215
3217
|
onClose,
|
|
@@ -3218,12 +3220,13 @@ function ExchangeConnectStep({
|
|
|
3218
3220
|
onImmersiveChange
|
|
3219
3221
|
}) {
|
|
3220
3222
|
const loadUrl = useCallback4(async () => {
|
|
3223
|
+
if (loadPreparedUrl) return loadPreparedUrl();
|
|
3221
3224
|
const res = await service.getSwappedConnectUrl({
|
|
3222
3225
|
smartAccount,
|
|
3223
3226
|
connection
|
|
3224
3227
|
});
|
|
3225
3228
|
return res;
|
|
3226
|
-
}, [service, smartAccount, connection]);
|
|
3229
|
+
}, [loadPreparedUrl, service, smartAccount, connection]);
|
|
3227
3230
|
return /* @__PURE__ */ jsx16(
|
|
3228
3231
|
SwappedIframeStep,
|
|
3229
3232
|
{
|
|
@@ -3263,6 +3266,9 @@ function ExchangeLogo({ exchange }) {
|
|
|
3263
3266
|
}
|
|
3264
3267
|
);
|
|
3265
3268
|
}
|
|
3269
|
+
function formatFeeRate(bps) {
|
|
3270
|
+
return `${(bps / 100).toFixed(2).replace(/\.?0+$/, "")}%`;
|
|
3271
|
+
}
|
|
3266
3272
|
function ExchangeSelectStep({
|
|
3267
3273
|
service,
|
|
3268
3274
|
onSelectExchange,
|
|
@@ -3272,6 +3278,11 @@ function ExchangeSelectStep({
|
|
|
3272
3278
|
const [loading, setLoading] = useState8(true);
|
|
3273
3279
|
const [error, setError] = useState8(null);
|
|
3274
3280
|
const [retryToken, setRetryToken] = useState8(0);
|
|
3281
|
+
const [exchangeFeeBps, setExchangeFeeBps] = useState8(0);
|
|
3282
|
+
const [selectingConnection, setSelectingConnection] = useState8(
|
|
3283
|
+
null
|
|
3284
|
+
);
|
|
3285
|
+
const [selectionNotice, setSelectionNotice] = useState8(null);
|
|
3275
3286
|
const retry = useCallback5(() => {
|
|
3276
3287
|
setRetryToken((n) => n + 1);
|
|
3277
3288
|
}, []);
|
|
@@ -3282,10 +3293,12 @@ function ExchangeSelectStep({
|
|
|
3282
3293
|
service.getSwappedConnectExchanges().then((res) => {
|
|
3283
3294
|
if (cancelled) return;
|
|
3284
3295
|
setExchanges(res.exchanges);
|
|
3296
|
+
setExchangeFeeBps(res.exchangeFeeBps ?? 0);
|
|
3285
3297
|
}).catch((err) => {
|
|
3286
3298
|
if (cancelled) return;
|
|
3287
3299
|
const message = err instanceof Error ? err.message : "Failed to load exchanges";
|
|
3288
3300
|
setExchanges([]);
|
|
3301
|
+
setExchangeFeeBps(0);
|
|
3289
3302
|
setError(message);
|
|
3290
3303
|
onError?.(message, "SWAPPED_CONNECT_EXCHANGES_FAILED");
|
|
3291
3304
|
}).finally(() => {
|
|
@@ -3295,6 +3308,31 @@ function ExchangeSelectStep({
|
|
|
3295
3308
|
cancelled = true;
|
|
3296
3309
|
};
|
|
3297
3310
|
}, [service, retryToken, onError]);
|
|
3311
|
+
const selectExchange = useCallback5(
|
|
3312
|
+
async (connection) => {
|
|
3313
|
+
setSelectingConnection(connection);
|
|
3314
|
+
setSelectionNotice(null);
|
|
3315
|
+
try {
|
|
3316
|
+
const actualFeeBps = await onSelectExchange(
|
|
3317
|
+
connection,
|
|
3318
|
+
exchangeFeeBps
|
|
3319
|
+
);
|
|
3320
|
+
if (actualFeeBps !== exchangeFeeBps) {
|
|
3321
|
+
setExchangeFeeBps(actualFeeBps);
|
|
3322
|
+
setSelectionNotice(
|
|
3323
|
+
"The Exchange Fee changed. Review the updated rate and select your exchange again."
|
|
3324
|
+
);
|
|
3325
|
+
}
|
|
3326
|
+
} catch (err) {
|
|
3327
|
+
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
3328
|
+
setSelectionNotice(message);
|
|
3329
|
+
onError?.(message, "SWAPPED_CONNECT_URL_FAILED");
|
|
3330
|
+
} finally {
|
|
3331
|
+
setSelectingConnection(null);
|
|
3332
|
+
}
|
|
3333
|
+
},
|
|
3334
|
+
[exchangeFeeBps, onError, onSelectExchange]
|
|
3335
|
+
);
|
|
3298
3336
|
return /* @__PURE__ */ jsxs14("div", { className: "rs-screen rs-exchange-select", children: [
|
|
3299
3337
|
/* @__PURE__ */ jsxs14("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3300
3338
|
/* @__PURE__ */ jsx17(
|
|
@@ -3337,7 +3375,9 @@ function ExchangeSelectStep({
|
|
|
3337
3375
|
{
|
|
3338
3376
|
type: "button",
|
|
3339
3377
|
className: "rs-exchange-card",
|
|
3340
|
-
onClick: () =>
|
|
3378
|
+
onClick: () => void selectExchange(exchange.connection),
|
|
3379
|
+
disabled: selectingConnection !== null,
|
|
3380
|
+
"aria-busy": selectingConnection === exchange.connection,
|
|
3341
3381
|
"aria-label": `Select ${exchange.name}`,
|
|
3342
3382
|
children: [
|
|
3343
3383
|
/* @__PURE__ */ jsx17(
|
|
@@ -3354,7 +3394,13 @@ function ExchangeSelectStep({
|
|
|
3354
3394
|
);
|
|
3355
3395
|
}) })
|
|
3356
3396
|
] }),
|
|
3357
|
-
/* @__PURE__ */ jsx17(PoweredBy, {})
|
|
3397
|
+
/* @__PURE__ */ jsx17(PoweredBy, {}),
|
|
3398
|
+
exchangeFeeBps > 0 && /* @__PURE__ */ jsxs14("p", { className: "rs-exchange-select-fee-note", children: [
|
|
3399
|
+
"A ",
|
|
3400
|
+
formatFeeRate(exchangeFeeBps),
|
|
3401
|
+
" Exchange Fee applies to your deposit."
|
|
3402
|
+
] }),
|
|
3403
|
+
selectionNotice && /* @__PURE__ */ jsx17("p", { className: "rs-exchange-select-fee-note", role: "status", children: selectionNotice })
|
|
3358
3404
|
] });
|
|
3359
3405
|
}
|
|
3360
3406
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -6819,14 +6865,79 @@ function DepositFlow({
|
|
|
6819
6865
|
const handleSelectExchange = useCallback7(() => {
|
|
6820
6866
|
storeApi.dispatch({ type: "connect/exchange-selected" });
|
|
6821
6867
|
}, [storeApi]);
|
|
6868
|
+
const swappedConnectUrlRef = useRef8(/* @__PURE__ */ new Map());
|
|
6869
|
+
const acknowledgedConnectFeeRef = useRef8(/* @__PURE__ */ new Map());
|
|
6822
6870
|
const handleSelectExchangeConnection = useCallback7(
|
|
6823
|
-
(connection) => {
|
|
6871
|
+
async (connection, disclosedFeeBps) => {
|
|
6872
|
+
if (setupSlice.status !== "ready" || !setupSlice.smartAccount) {
|
|
6873
|
+
throw new Error("Deposit account is not ready");
|
|
6874
|
+
}
|
|
6875
|
+
const smartAccount = setupSlice.smartAccount;
|
|
6876
|
+
const owner = smartAccount.toLowerCase();
|
|
6877
|
+
const key = `${owner}:${connection}`;
|
|
6878
|
+
let entry = swappedConnectUrlRef.current.get(key);
|
|
6879
|
+
if (!entry) {
|
|
6880
|
+
let response;
|
|
6881
|
+
try {
|
|
6882
|
+
response = await service.getSwappedConnectUrl({
|
|
6883
|
+
smartAccount,
|
|
6884
|
+
connection,
|
|
6885
|
+
acceptedExchangeFeeBps: disclosedFeeBps
|
|
6886
|
+
});
|
|
6887
|
+
} catch (error) {
|
|
6888
|
+
if (error instanceof SwappedConnectFeeChangedError) {
|
|
6889
|
+
return error.exchangeFeeBps;
|
|
6890
|
+
}
|
|
6891
|
+
throw error;
|
|
6892
|
+
}
|
|
6893
|
+
entry = { smartAccount: owner, response };
|
|
6894
|
+
}
|
|
6895
|
+
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
6896
|
+
if (currentAccount?.toLowerCase() !== owner) {
|
|
6897
|
+
swappedConnectUrlRef.current.delete(key);
|
|
6898
|
+
throw new Error("Deposit account changed. Select your exchange again.");
|
|
6899
|
+
}
|
|
6900
|
+
const actualFeeBps = entry.response.exchangeFeeBps ?? 0;
|
|
6901
|
+
if (actualFeeBps !== disclosedFeeBps) {
|
|
6902
|
+
swappedConnectUrlRef.current.delete(key);
|
|
6903
|
+
acknowledgedConnectFeeRef.current.delete(key);
|
|
6904
|
+
return actualFeeBps;
|
|
6905
|
+
}
|
|
6906
|
+
swappedConnectUrlRef.current.set(key, entry);
|
|
6907
|
+
acknowledgedConnectFeeRef.current.set(key, actualFeeBps);
|
|
6824
6908
|
storeApi.dispatch({
|
|
6825
6909
|
type: "exchange/connection-selected",
|
|
6826
6910
|
connection
|
|
6827
6911
|
});
|
|
6912
|
+
return actualFeeBps;
|
|
6828
6913
|
},
|
|
6829
|
-
[storeApi]
|
|
6914
|
+
[service, setupSlice.status, setupSlice.smartAccount, storeApi]
|
|
6915
|
+
);
|
|
6916
|
+
const loadSwappedConnectUrl = useCallback7(
|
|
6917
|
+
async (smartAccount, connection) => {
|
|
6918
|
+
const key = `${smartAccount.toLowerCase()}:${connection}`;
|
|
6919
|
+
const entry = swappedConnectUrlRef.current.get(key);
|
|
6920
|
+
const expectedFeeBps = acknowledgedConnectFeeRef.current.get(key);
|
|
6921
|
+
if (expectedFeeBps === void 0) {
|
|
6922
|
+
throw new Error(
|
|
6923
|
+
"The Exchange Fee changed. Go back and select your exchange again."
|
|
6924
|
+
);
|
|
6925
|
+
}
|
|
6926
|
+
swappedConnectUrlRef.current.delete(key);
|
|
6927
|
+
const response = entry?.smartAccount === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
6928
|
+
smartAccount,
|
|
6929
|
+
connection,
|
|
6930
|
+
acceptedExchangeFeeBps: expectedFeeBps
|
|
6931
|
+
});
|
|
6932
|
+
const actualFeeBps = response.exchangeFeeBps ?? 0;
|
|
6933
|
+
if (actualFeeBps !== expectedFeeBps) {
|
|
6934
|
+
throw new Error(
|
|
6935
|
+
"The Exchange Fee changed. Go back and select your exchange again."
|
|
6936
|
+
);
|
|
6937
|
+
}
|
|
6938
|
+
return response;
|
|
6939
|
+
},
|
|
6940
|
+
[service]
|
|
6830
6941
|
);
|
|
6831
6942
|
const swappedUrlPrefetchRef = useRef8(/* @__PURE__ */ new Map());
|
|
6832
6943
|
const prefetchSwappedWidgetUrl = useCallback7(
|
|
@@ -6866,7 +6977,9 @@ function DepositFlow({
|
|
|
6866
6977
|
);
|
|
6867
6978
|
useEffect11(() => {
|
|
6868
6979
|
swappedUrlPrefetchRef.current.clear();
|
|
6869
|
-
|
|
6980
|
+
swappedConnectUrlRef.current.clear();
|
|
6981
|
+
acknowledgedConnectFeeRef.current.clear();
|
|
6982
|
+
}, [dappAddress, setupSlice.smartAccount]);
|
|
6870
6983
|
const handleNewDeposit = useCallback7(() => {
|
|
6871
6984
|
onLifecycleRef.current?.({
|
|
6872
6985
|
type: "smart-account-changed",
|
|
@@ -6877,6 +6990,8 @@ function DepositFlow({
|
|
|
6877
6990
|
stableWalletSignerRef.current = null;
|
|
6878
6991
|
stableWalletSelectionKeyRef.current = null;
|
|
6879
6992
|
swappedUrlPrefetchRef.current.clear();
|
|
6993
|
+
swappedConnectUrlRef.current.clear();
|
|
6994
|
+
acknowledgedConnectFeeRef.current.clear();
|
|
6880
6995
|
lastSmartAccountLifecycleKeyRef.current = null;
|
|
6881
6996
|
}, [onLifecycleRef, storeApi]);
|
|
6882
6997
|
const setupInput = useMemo7(
|
|
@@ -7504,6 +7619,7 @@ function DepositFlow({
|
|
|
7504
7619
|
smartAccount: step.smartAccount,
|
|
7505
7620
|
service,
|
|
7506
7621
|
connection: step.connection,
|
|
7622
|
+
loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
|
|
7507
7623
|
onSwappedComplete: handleSwappedComplete,
|
|
7508
7624
|
onSwappedFailed: handleDepositFailed,
|
|
7509
7625
|
onClose: onClose ?? (() => {
|
|
@@ -8159,7 +8275,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8159
8275
|
// src/DepositModal.tsx
|
|
8160
8276
|
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
8161
8277
|
var ReownDepositInner = lazy2(
|
|
8162
|
-
() => import("./DepositModalReown-
|
|
8278
|
+
() => import("./DepositModalReown-5OJ5W7UF.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
8163
8279
|
);
|
|
8164
8280
|
function sortByCreatedAtDesc(items) {
|
|
8165
8281
|
return [...items].sort((a, b) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ListRow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DVGQIPR3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlertTriangleIcon,
|
|
6
6
|
BodyHeader,
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Callout,
|
|
9
9
|
CdnIcon,
|
|
10
10
|
CheckIcon,
|
|
11
|
-
ChevronDownIcon,
|
|
12
11
|
ChevronLeftIcon,
|
|
13
12
|
CloseIcon,
|
|
14
13
|
CoinsIcon,
|
|
@@ -26,12 +25,10 @@ import {
|
|
|
26
25
|
formatUserError,
|
|
27
26
|
useLatestRef,
|
|
28
27
|
useStableRpcUrls
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NGHW6KWC.mjs";
|
|
30
29
|
import {
|
|
31
30
|
DEFAULT_BACKEND_URL,
|
|
32
|
-
SOURCE_CHAINS,
|
|
33
31
|
getChainIcon,
|
|
34
|
-
getChainId,
|
|
35
32
|
getChainName,
|
|
36
33
|
getExplorerTxUrl,
|
|
37
34
|
getTokenDecimalsByAddress,
|
|
@@ -252,7 +249,6 @@ function ClaimModal({
|
|
|
252
249
|
closeOnOverlayClick,
|
|
253
250
|
backendUrl = DEFAULT_BACKEND_URL,
|
|
254
251
|
rpcUrls: rpcUrlsProp,
|
|
255
|
-
defaultSourceChain,
|
|
256
252
|
defaultTxHash,
|
|
257
253
|
defaultRecipient,
|
|
258
254
|
theme,
|
|
@@ -342,7 +338,6 @@ function ClaimModal({
|
|
|
342
338
|
refundEndpoint,
|
|
343
339
|
getUserToken,
|
|
344
340
|
debug,
|
|
345
|
-
defaultSourceChain,
|
|
346
341
|
defaultTxHash,
|
|
347
342
|
defaultRecipient,
|
|
348
343
|
onClose: handleClose,
|
|
@@ -364,7 +359,6 @@ function ClaimBody({
|
|
|
364
359
|
refundEndpoint,
|
|
365
360
|
getUserToken,
|
|
366
361
|
debug,
|
|
367
|
-
defaultSourceChain,
|
|
368
362
|
defaultTxHash,
|
|
369
363
|
defaultRecipient,
|
|
370
364
|
onClose,
|
|
@@ -380,7 +374,6 @@ function ClaimBody({
|
|
|
380
374
|
LookupStep,
|
|
381
375
|
{
|
|
382
376
|
service,
|
|
383
|
-
defaultSourceChain,
|
|
384
377
|
defaultTxHash,
|
|
385
378
|
operationEpochRef,
|
|
386
379
|
isOpenRef,
|
|
@@ -517,83 +510,8 @@ function ClaimBody({
|
|
|
517
510
|
}
|
|
518
511
|
}
|
|
519
512
|
}
|
|
520
|
-
function ChainDropdown({
|
|
521
|
-
value,
|
|
522
|
-
onChange
|
|
523
|
-
}) {
|
|
524
|
-
const [open, setOpen] = useState(false);
|
|
525
|
-
const ref = useRef(null);
|
|
526
|
-
useEffect(() => {
|
|
527
|
-
if (!open) return;
|
|
528
|
-
function onPointerDown(event) {
|
|
529
|
-
const target = event.target;
|
|
530
|
-
if (target && ref.current?.contains(target)) return;
|
|
531
|
-
setOpen(false);
|
|
532
|
-
}
|
|
533
|
-
document.addEventListener("mousedown", onPointerDown);
|
|
534
|
-
document.addEventListener("touchstart", onPointerDown, { passive: true });
|
|
535
|
-
return () => {
|
|
536
|
-
document.removeEventListener("mousedown", onPointerDown);
|
|
537
|
-
document.removeEventListener("touchstart", onPointerDown);
|
|
538
|
-
};
|
|
539
|
-
}, [open]);
|
|
540
|
-
const icon = getChainIcon(value);
|
|
541
|
-
return /* @__PURE__ */ jsxs2("div", { className: "rs-deposit-address-dropdown", ref, children: [
|
|
542
|
-
/* @__PURE__ */ jsx2("div", { className: "rs-deposit-address-dropdown-label", children: "Source chain" }),
|
|
543
|
-
/* @__PURE__ */ jsxs2(
|
|
544
|
-
"button",
|
|
545
|
-
{
|
|
546
|
-
type: "button",
|
|
547
|
-
className: `rs-deposit-address-dropdown-trigger ${open ? "rs-deposit-address-dropdown-trigger--open" : ""}`,
|
|
548
|
-
"aria-expanded": open,
|
|
549
|
-
onClick: () => setOpen((v) => !v),
|
|
550
|
-
children: [
|
|
551
|
-
/* @__PURE__ */ jsx2(CdnIcon, { src: icon, className: "rs-deposit-address-dropdown-icon" }),
|
|
552
|
-
/* @__PURE__ */ jsx2("span", { children: getChainName(value) }),
|
|
553
|
-
/* @__PURE__ */ jsx2(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
554
|
-
]
|
|
555
|
-
}
|
|
556
|
-
),
|
|
557
|
-
open && // Cap to the space below the trigger in this compact modal (~172px
|
|
558
|
-
// before the modal body clips) so the full menu stays visible and
|
|
559
|
-
// scrolls internally — a peek of the next row signals more chains.
|
|
560
|
-
/* @__PURE__ */ jsx2(
|
|
561
|
-
"div",
|
|
562
|
-
{
|
|
563
|
-
className: "rs-deposit-address-dropdown-menu",
|
|
564
|
-
style: { maxHeight: 168 },
|
|
565
|
-
children: SOURCE_CHAINS.map((c) => {
|
|
566
|
-
const optionIcon = getChainIcon(c.id);
|
|
567
|
-
return /* @__PURE__ */ jsxs2(
|
|
568
|
-
"button",
|
|
569
|
-
{
|
|
570
|
-
type: "button",
|
|
571
|
-
className: `rs-deposit-address-dropdown-item ${c.id === value ? "rs-deposit-address-dropdown-item--active" : ""}`,
|
|
572
|
-
onClick: () => {
|
|
573
|
-
onChange(c.id);
|
|
574
|
-
setOpen(false);
|
|
575
|
-
},
|
|
576
|
-
children: [
|
|
577
|
-
/* @__PURE__ */ jsx2(
|
|
578
|
-
CdnIcon,
|
|
579
|
-
{
|
|
580
|
-
src: optionIcon,
|
|
581
|
-
className: "rs-deposit-address-dropdown-icon"
|
|
582
|
-
}
|
|
583
|
-
),
|
|
584
|
-
/* @__PURE__ */ jsx2("span", { children: getChainName(c.id) })
|
|
585
|
-
]
|
|
586
|
-
},
|
|
587
|
-
c.id
|
|
588
|
-
);
|
|
589
|
-
})
|
|
590
|
-
}
|
|
591
|
-
)
|
|
592
|
-
] });
|
|
593
|
-
}
|
|
594
513
|
function LookupStep({
|
|
595
514
|
service,
|
|
596
|
-
defaultSourceChain,
|
|
597
515
|
defaultTxHash,
|
|
598
516
|
operationEpochRef,
|
|
599
517
|
isOpenRef,
|
|
@@ -602,13 +520,6 @@ function LookupStep({
|
|
|
602
520
|
onEventRef,
|
|
603
521
|
onErrorRef
|
|
604
522
|
}) {
|
|
605
|
-
const [chainId, setChainId] = useState(() => {
|
|
606
|
-
const requested = defaultSourceChain != null ? getChainId(defaultSourceChain) : void 0;
|
|
607
|
-
if (requested != null && SOURCE_CHAINS.some((c) => c.id === requested)) {
|
|
608
|
-
return requested;
|
|
609
|
-
}
|
|
610
|
-
return SOURCE_CHAINS[0]?.id ?? 1;
|
|
611
|
-
});
|
|
612
523
|
const [txHash, setTxHash] = useState(defaultTxHash ?? "");
|
|
613
524
|
const [loading, setLoading] = useState(false);
|
|
614
525
|
const [error, setError] = useState(null);
|
|
@@ -619,22 +530,18 @@ function LookupStep({
|
|
|
619
530
|
const isCurrentOperation = () => isOpenRef.current && operationEpochRef.current === operationEpoch;
|
|
620
531
|
setError(null);
|
|
621
532
|
setLoading(true);
|
|
622
|
-
const chain = `eip155:${chainId}`;
|
|
623
533
|
try {
|
|
624
534
|
const deposits = await service.lookupRecoverableDeposits({
|
|
625
|
-
chain,
|
|
626
535
|
txHash: trimmed
|
|
627
536
|
});
|
|
628
537
|
if (!isCurrentOperation()) return;
|
|
629
538
|
onLifecycleRef.current?.({
|
|
630
539
|
type: "lookup",
|
|
631
|
-
chain: chainId,
|
|
632
540
|
txHash: trimmed,
|
|
633
541
|
matches: deposits.length
|
|
634
542
|
});
|
|
635
543
|
onEventRef.current?.({
|
|
636
544
|
type: "claim_modal_lookup",
|
|
637
|
-
chain,
|
|
638
545
|
matches: deposits.length
|
|
639
546
|
});
|
|
640
547
|
if (deposits.length === 0) {
|
|
@@ -659,7 +566,6 @@ function LookupStep({
|
|
|
659
566
|
if (isCurrentOperation()) setLoading(false);
|
|
660
567
|
}
|
|
661
568
|
}, [
|
|
662
|
-
chainId,
|
|
663
569
|
trimmed,
|
|
664
570
|
service,
|
|
665
571
|
operationEpochRef,
|
|
@@ -679,7 +585,6 @@ function LookupStep({
|
|
|
679
585
|
subtitle: "Get funds from a failed deposit sent back to you on the source chain."
|
|
680
586
|
}
|
|
681
587
|
),
|
|
682
|
-
/* @__PURE__ */ jsx2("div", { className: "rs-deposit-address-selectors", children: /* @__PURE__ */ jsx2(ChainDropdown, { value: chainId, onChange: setChainId }) }),
|
|
683
588
|
/* @__PURE__ */ jsx2(
|
|
684
589
|
Input,
|
|
685
590
|
{
|