@rhinestone/deposit-modal 0.0.0-dev-20260901162023 → 0.0.0-dev-20260901193125
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 +6 -0
- package/dist/ClaimModal-BBBAC6XN.cjs +12 -0
- package/dist/{ClaimModal-NJEVCXFZ.mjs → ClaimModal-W56MCJYJ.mjs} +4 -4
- package/dist/{DepositModalReown-THSTSQHI.mjs → DepositModalReown-HQQTSUQ6.mjs} +5 -5
- package/dist/{DepositModalReown-7JUC6U7W.cjs → DepositModalReown-XUEEHFK6.cjs} +18 -18
- package/dist/WithdrawModal-SVOM4TXP.cjs +12 -0
- package/dist/{WithdrawModal-DXZYG3HU.mjs → WithdrawModal-Z2YVJTLU.mjs} +4 -4
- package/dist/{chunk-GMYOHPI6.cjs → chunk-36GWVLRT.cjs} +42 -42
- package/dist/{chunk-MANGCUEL.cjs → chunk-4V4XWVUW.cjs} +1 -1
- package/dist/{chunk-I32JWFY4.mjs → chunk-5MU5AVHG.mjs} +74 -763
- package/dist/{chunk-OPRCCLSY.cjs → chunk-6ENL3HQ2.cjs} +956 -147
- package/dist/{chunk-EVAKCGLK.mjs → chunk-CHSY7OAO.mjs} +128 -44
- package/dist/chunk-FNBIWPMN.mjs +81 -0
- package/dist/{chunk-J7ZCRY3H.cjs → chunk-I4XVX57T.cjs} +538 -113
- package/dist/{chunk-UU5JG66V.cjs → chunk-J5VSN4KV.cjs} +290 -979
- package/dist/{chunk-OJRBZQIE.mjs → chunk-JMARY733.mjs} +12 -12
- package/dist/{chunk-JICOHQHN.cjs → chunk-JQKTAFUP.cjs} +183 -99
- package/dist/{chunk-DHGJHRBX.mjs → chunk-NYQIEJNC.mjs} +488 -63
- package/dist/chunk-PHYX2K4K.cjs +81 -0
- package/dist/{chunk-PSLNTPKP.mjs → chunk-Q3NGNK2F.mjs} +1 -1
- package/dist/{chunk-ZJKENYOD.mjs → chunk-QOC5ILJT.mjs} +985 -176
- package/dist/claim.cjs +5 -5
- package/dist/claim.d.cts +2 -2
- package/dist/claim.d.ts +2 -2
- 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/embed.cjs +26 -17
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +16 -7
- 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/{types-D36e_rVZ.d.ts → types-BT1KmcJS.d.ts} +25 -0
- package/dist/{types-TsOeInuD.d.cts → types-CUCD4RvY.d.cts} +25 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +4 -4
- package/package.json +5 -5
- package/dist/ClaimModal-5JQHZ6RG.cjs +0 -12
- package/dist/WithdrawModal-VUILQYNT.cjs +0 -12
- package/dist/chunk-FI6F5GUL.cjs +0 -529
- package/dist/chunk-VMP2UYAN.mjs +0 -529
package/README.md
CHANGED
|
@@ -143,6 +143,12 @@ The user picks the destination chain, token, recipient, and amount in the modal;
|
|
|
143
143
|
- **Send to `to`.** It's the Rhinestone deposit account the processor watches and bridges on to the recipient — except on a same-route withdrawal (source chain and token identical to the target), where the modal skips the bridge and `to` is the recipient itself. Never substitute an address of your own.
|
|
144
144
|
- **Return the on-chain transaction hash**, not a userOp hash. The modal tracks progress by looking the deposit up by that hash. Reject the promise to surface a failure.
|
|
145
145
|
|
|
146
|
+
### History
|
|
147
|
+
|
|
148
|
+
Once the form holds a valid recipient, the header offers that **destination's** deposit history — a cross-route withdrawal funds a deposit account keyed to its destination, so it shows up there as an ordinary deposit row. The entry point carries the same status dot the deposit modal's does, and is hidden while the transfer is being signed and while its status is polled.
|
|
149
|
+
|
|
150
|
+
Pass the optional `signRecovery` to let the user recover a failed row from the panel; omit it and the panel is read-only. The signer is the address the user is withdrawing **to**, so only supply it if your users can sign for their withdrawal destinations.
|
|
151
|
+
|
|
146
152
|
## Claim a failed deposit
|
|
147
153
|
|
|
148
154
|
`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, and there is no chain to pick: the hash is looked up across every chain, including ones the deposit flow itself doesn't list.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk36GWVLRTcjs = require('./chunk-36GWVLRT.cjs');
|
|
5
|
+
require('./chunk-PHYX2K4K.cjs');
|
|
6
|
+
require('./chunk-I4XVX57T.cjs');
|
|
7
|
+
require('./chunk-4V4XWVUW.cjs');
|
|
8
|
+
require('./chunk-4KCSH4T3.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.ClaimModal = _chunk36GWVLRTcjs.ClaimModal; exports.buildClaimAnalyticsSessionProperties = _chunk36GWVLRTcjs.buildClaimAnalyticsSessionProperties;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClaimModal,
|
|
3
3
|
buildClaimAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JMARY733.mjs";
|
|
5
|
+
import "./chunk-FNBIWPMN.mjs";
|
|
6
|
+
import "./chunk-NYQIEJNC.mjs";
|
|
7
|
+
import "./chunk-Q3NGNK2F.mjs";
|
|
8
8
|
import "./chunk-VUATPOWJ.mjs";
|
|
9
9
|
export {
|
|
10
10
|
ClaimModal,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner,
|
|
3
3
|
getReownDependencies
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5MU5AVHG.mjs";
|
|
5
|
+
import "./chunk-QOC5ILJT.mjs";
|
|
6
|
+
import "./chunk-FNBIWPMN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
followSystemAppearance,
|
|
9
9
|
isUnsupportedChainSwitchError,
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
resolveThemeMode,
|
|
13
13
|
rpcUrlFor,
|
|
14
14
|
useStableRpcUrls
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-NYQIEJNC.mjs";
|
|
16
|
+
import "./chunk-Q3NGNK2F.mjs";
|
|
17
17
|
import "./chunk-RN5VKWI6.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SUPPORTED_CHAIN_IDS,
|
|
@@ -1,9 +1,9 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkJ5VSN4KVcjs = require('./chunk-J5VSN4KV.cjs');
|
|
5
|
+
require('./chunk-6ENL3HQ2.cjs');
|
|
6
|
+
require('./chunk-PHYX2K4K.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,8 +12,8 @@ require('./chunk-FI6F5GUL.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
require('./chunk-
|
|
15
|
+
var _chunkI4XVX57Tcjs = require('./chunk-I4XVX57T.cjs');
|
|
16
|
+
require('./chunk-4V4XWVUW.cjs');
|
|
17
17
|
require('./chunk-DW2EQA2U.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
@@ -46,7 +46,7 @@ var {
|
|
|
46
46
|
unichain,
|
|
47
47
|
katana,
|
|
48
48
|
hyperEvm
|
|
49
|
-
} =
|
|
49
|
+
} = _chunkJ5VSN4KVcjs.getReownDependencies.call(void 0, )[1];
|
|
50
50
|
var APPKIT_NETWORK_BY_ID = {
|
|
51
51
|
[mainnet.id]: mainnet,
|
|
52
52
|
[optimism.id]: optimism,
|
|
@@ -78,7 +78,7 @@ function getAppKitNetwork(chainId) {
|
|
|
78
78
|
|
|
79
79
|
// src/core/reown-theme.ts
|
|
80
80
|
function mapTheme(theme) {
|
|
81
|
-
const themeMode =
|
|
81
|
+
const themeMode = _chunkI4XVX57Tcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
|
|
82
82
|
const themeVariables = {
|
|
83
83
|
"--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
|
|
84
84
|
};
|
|
@@ -95,7 +95,7 @@ function setAppKitTheme(appKit, theme) {
|
|
|
95
95
|
|
|
96
96
|
// src/core/reown.tsx
|
|
97
97
|
var _jsxruntime = require('react/jsx-runtime');
|
|
98
|
-
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] =
|
|
98
|
+
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkJ5VSN4KVcjs.getReownDependencies.call(void 0, );
|
|
99
99
|
var {
|
|
100
100
|
createAppKit,
|
|
101
101
|
useAppKit,
|
|
@@ -111,14 +111,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
|
111
111
|
const transports = {};
|
|
112
112
|
for (const network of networks) {
|
|
113
113
|
const id = Number(network.id);
|
|
114
|
-
transports[id] = _viem.http.call(void 0,
|
|
114
|
+
transports[id] = _viem.http.call(void 0, _chunkI4XVX57Tcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
115
115
|
}
|
|
116
116
|
return transports;
|
|
117
117
|
}
|
|
118
118
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
119
119
|
return networks.map((network) => {
|
|
120
120
|
const id = Number(network.id);
|
|
121
|
-
return `${id}=${_nullishCoalesce(
|
|
121
|
+
return `${id}=${_nullishCoalesce(_chunkI4XVX57Tcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
122
122
|
}).join("|");
|
|
123
123
|
}
|
|
124
124
|
var cachedAdapter = null;
|
|
@@ -189,7 +189,7 @@ function ReownWalletProvider({
|
|
|
189
189
|
backendUrl,
|
|
190
190
|
children
|
|
191
191
|
}) {
|
|
192
|
-
const rpcUrls =
|
|
192
|
+
const rpcUrls = _chunkI4XVX57Tcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
193
193
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
194
194
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
195
195
|
if (!rpcUrls) return void 0;
|
|
@@ -201,14 +201,14 @@ function ReownWalletProvider({
|
|
|
201
201
|
return out;
|
|
202
202
|
}, [rpcUrls]);
|
|
203
203
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
204
|
-
const primed =
|
|
204
|
+
const primed = _chunkI4XVX57Tcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
205
205
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
206
206
|
});
|
|
207
207
|
_react.useEffect.call(void 0, () => {
|
|
208
208
|
let active = true;
|
|
209
|
-
const primed =
|
|
209
|
+
const primed = _chunkI4XVX57Tcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
210
210
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
211
|
-
|
|
211
|
+
_chunkI4XVX57Tcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
212
212
|
if (active) setState({ ready: true, chains });
|
|
213
213
|
});
|
|
214
214
|
return () => {
|
|
@@ -217,7 +217,7 @@ function ReownWalletProvider({
|
|
|
217
217
|
}, [backendUrl, overrides]);
|
|
218
218
|
_react.useEffect.call(void 0, () => {
|
|
219
219
|
setAppKitTheme(appKitReact.modal, theme);
|
|
220
|
-
return
|
|
220
|
+
return _chunkI4XVX57Tcjs.followSystemAppearance.call(void 0,
|
|
221
221
|
_optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
|
|
222
222
|
() => setAppKitTheme(appKitReact.modal, theme)
|
|
223
223
|
);
|
|
@@ -281,7 +281,7 @@ function useReownWalletSession() {
|
|
|
281
281
|
await switchChainAsync({ chainId });
|
|
282
282
|
}
|
|
283
283
|
} catch (err) {
|
|
284
|
-
if (
|
|
284
|
+
if (_chunkI4XVX57Tcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
285
285
|
throw new Error(
|
|
286
286
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
287
287
|
);
|
|
@@ -294,7 +294,7 @@ function useReownWalletSession() {
|
|
|
294
294
|
|
|
295
295
|
// src/DepositModalReown.tsx
|
|
296
296
|
|
|
297
|
-
var [appKitReact2, , , , solanaAdapterReact] =
|
|
297
|
+
var [appKitReact2, , , , solanaAdapterReact] = _chunkJ5VSN4KVcjs.getReownDependencies.call(void 0, );
|
|
298
298
|
var { useAppKitProvider } = appKitReact2;
|
|
299
299
|
var { useAppKitConnection } = solanaAdapterReact;
|
|
300
300
|
function DepositModalWithReown(props) {
|
|
@@ -316,7 +316,7 @@ function DepositModalWithReown(props) {
|
|
|
316
316
|
reown.disconnect();
|
|
317
317
|
}, [reown.disconnect]);
|
|
318
318
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
319
|
-
|
|
319
|
+
_chunkJ5VSN4KVcjs.DepositModalInner,
|
|
320
320
|
{
|
|
321
321
|
...props,
|
|
322
322
|
walletSession: reownWithSolana,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkJQKTAFUPcjs = require('./chunk-JQKTAFUP.cjs');
|
|
5
|
+
require('./chunk-6ENL3HQ2.cjs');
|
|
6
|
+
require('./chunk-I4XVX57T.cjs');
|
|
7
|
+
require('./chunk-4V4XWVUW.cjs');
|
|
8
|
+
require('./chunk-4KCSH4T3.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.WithdrawModal = _chunkJQKTAFUPcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkJQKTAFUPcjs.buildWithdrawAnalyticsSessionProperties;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModal,
|
|
3
3
|
buildWithdrawAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-CHSY7OAO.mjs";
|
|
5
|
+
import "./chunk-QOC5ILJT.mjs";
|
|
6
|
+
import "./chunk-NYQIEJNC.mjs";
|
|
7
|
+
import "./chunk-Q3NGNK2F.mjs";
|
|
8
8
|
import "./chunk-VUATPOWJ.mjs";
|
|
9
9
|
export {
|
|
10
10
|
WithdrawModal,
|
|
@@ -1,5 +1,6 @@
|
|
|
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 _chunkPHYX2K4Kcjs = require('./chunk-PHYX2K4K.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -9,7 +10,6 @@
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
var _chunkFI6F5GULcjs = require('./chunk-FI6F5GUL.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ var _chunkFI6F5GULcjs = require('./chunk-FI6F5GUL.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkI4XVX57Tcjs = require('./chunk-I4XVX57T.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -57,7 +57,7 @@ var _viem = require('viem');
|
|
|
57
57
|
|
|
58
58
|
var _jsxruntime = require('react/jsx-runtime');
|
|
59
59
|
function claimFailureReasonForError(error) {
|
|
60
|
-
if (!(error instanceof
|
|
60
|
+
if (!(error instanceof _chunkI4XVX57Tcjs.RecoveryError)) return "refund_failed";
|
|
61
61
|
switch (error.code) {
|
|
62
62
|
case "SIGNATURE_INVALID":
|
|
63
63
|
return "signature_invalid";
|
|
@@ -225,7 +225,7 @@ function ClaimAnalyticsControllerProvider({
|
|
|
225
225
|
children,
|
|
226
226
|
controllerRef
|
|
227
227
|
}) {
|
|
228
|
-
const emit =
|
|
228
|
+
const emit = _chunkI4XVX57Tcjs.useClaimAnalyticsEmitter.call(void 0, );
|
|
229
229
|
const controller = _react.useMemo.call(void 0, () => createClaimAnalyticsController(emit), [emit]);
|
|
230
230
|
if (controllerRef) controllerRef.current = controller;
|
|
231
231
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ClaimAnalyticsControllerContext.Provider, { value: controller, children });
|
|
@@ -242,13 +242,13 @@ function evmChainIdFromCaip2(chain) {
|
|
|
242
242
|
return Number.isFinite(id) ? id : null;
|
|
243
243
|
}
|
|
244
244
|
function isEligible(row) {
|
|
245
|
-
return
|
|
245
|
+
return _chunkI4XVX57Tcjs.toRecoverableDeposit.call(void 0, row) !== null;
|
|
246
246
|
}
|
|
247
247
|
function describeDeposit(row) {
|
|
248
248
|
const chainId = _nullishCoalesce(evmChainIdFromCaip2(row.chain), () => ( 0));
|
|
249
249
|
return {
|
|
250
250
|
chainId,
|
|
251
|
-
...
|
|
251
|
+
..._chunkI4XVX57Tcjs.describeRecoveryDeposit.call(void 0, {
|
|
252
252
|
chainId,
|
|
253
253
|
token: row.token,
|
|
254
254
|
amountRaw: _nullishCoalesce(row.sourceAmount, () => ( row.amount))
|
|
@@ -361,17 +361,17 @@ function ClaimModal({
|
|
|
361
361
|
debug,
|
|
362
362
|
onUiState
|
|
363
363
|
}) {
|
|
364
|
-
|
|
364
|
+
_chunkI4XVX57Tcjs.checkBackendUrl.call(void 0, "ClaimModal", backendUrl);
|
|
365
365
|
const modalRef = _react.useRef.call(void 0, null);
|
|
366
|
-
const onReadyRef =
|
|
367
|
-
const onLifecycleRef =
|
|
368
|
-
const onErrorRef =
|
|
366
|
+
const onReadyRef = _chunkI4XVX57Tcjs.useLatestRef.call(void 0, onReady);
|
|
367
|
+
const onLifecycleRef = _chunkI4XVX57Tcjs.useLatestRef.call(void 0, onLifecycle);
|
|
368
|
+
const onErrorRef = _chunkI4XVX57Tcjs.useLatestRef.call(void 0, onError);
|
|
369
369
|
const analyticsControllerRef = _react.useRef.call(void 0, null);
|
|
370
370
|
const lastSubmitFailureRef = _react.useRef.call(void 0, null);
|
|
371
371
|
const previousOpenRef = _react.useRef.call(void 0, isOpen);
|
|
372
|
-
const rpcUrls =
|
|
372
|
+
const rpcUrls = _chunkI4XVX57Tcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
373
373
|
const service = _react.useMemo.call(void 0,
|
|
374
|
-
() =>
|
|
374
|
+
() => _chunkI4XVX57Tcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:claim" }),
|
|
375
375
|
[backendUrl, debug]
|
|
376
376
|
);
|
|
377
377
|
const [state, dispatch] = _react.useReducer.call(void 0, claimReducer, INITIAL_STATE);
|
|
@@ -380,7 +380,7 @@ function ClaimModal({
|
|
|
380
380
|
isOpenRef.current = isOpen;
|
|
381
381
|
_react.useEffect.call(void 0, () => {
|
|
382
382
|
if (!isOpen || !modalRef.current) return;
|
|
383
|
-
return
|
|
383
|
+
return _chunkI4XVX57Tcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
384
384
|
}, [isOpen, theme]);
|
|
385
385
|
_react.useEffect.call(void 0, () => {
|
|
386
386
|
if (isOpen) {
|
|
@@ -439,7 +439,7 @@ function ClaimModal({
|
|
|
439
439
|
dispatch({ type: "back" });
|
|
440
440
|
}, [state.step]);
|
|
441
441
|
const canGoBack = state.step === "select" || state.step === "review" || state.step === "failed";
|
|
442
|
-
const onUiStateRef =
|
|
442
|
+
const onUiStateRef = _chunkI4XVX57Tcjs.useLatestRef.call(void 0, onUiState);
|
|
443
443
|
_react.useEffect.call(void 0, () => {
|
|
444
444
|
_optionalChain([onUiStateRef, 'access', _22 => _22.current, 'optionalCall', _23 => _23({
|
|
445
445
|
screen: state.step,
|
|
@@ -448,8 +448,8 @@ function ClaimModal({
|
|
|
448
448
|
})]);
|
|
449
449
|
}, [state.step, canGoBack, goBack, onUiStateRef]);
|
|
450
450
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _24 => _24.showBackButton]), () => ( true));
|
|
451
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
452
|
-
|
|
451
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
452
|
+
_chunkI4XVX57Tcjs.Modal,
|
|
453
453
|
{
|
|
454
454
|
isOpen,
|
|
455
455
|
onClose: handleModalDismiss,
|
|
@@ -458,7 +458,7 @@ function ClaimModal({
|
|
|
458
458
|
closeOnOverlayClick,
|
|
459
459
|
ariaLabel: "Claim your deposit",
|
|
460
460
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
461
|
-
|
|
461
|
+
_chunkI4XVX57Tcjs.AnalyticsSession,
|
|
462
462
|
{
|
|
463
463
|
modal: "claim",
|
|
464
464
|
sessionProperties: buildClaimAnalyticsSessionProperties({
|
|
@@ -480,7 +480,7 @@ function ClaimModal({
|
|
|
480
480
|
className: "rs-modal-header-back",
|
|
481
481
|
"aria-label": "Go back",
|
|
482
482
|
onClick: goBack,
|
|
483
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
483
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.ChevronLeftIcon, {})
|
|
484
484
|
}
|
|
485
485
|
) }),
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -491,7 +491,7 @@ function ClaimModal({
|
|
|
491
491
|
disabled: state.step === "processing",
|
|
492
492
|
className: "rs-modal-close",
|
|
493
493
|
"aria-label": "Close",
|
|
494
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
494
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.CloseIcon, {})
|
|
495
495
|
}
|
|
496
496
|
) })
|
|
497
497
|
] }),
|
|
@@ -622,7 +622,7 @@ function ClaimBody({
|
|
|
622
622
|
const deposit = state.selected;
|
|
623
623
|
if (!deposit) return;
|
|
624
624
|
const sourceChainId = evmChainIdFromCaip2(deposit.chain);
|
|
625
|
-
const signingChainId =
|
|
625
|
+
const signingChainId = _chunkI4XVX57Tcjs.recoverySigningChainId.call(void 0, deposit);
|
|
626
626
|
if (sourceChainId == null || signingChainId == null || !deposit.id || !deposit.recipient || !deposit.depositAddress || !deposit.token || !deposit.chain) {
|
|
627
627
|
analytics.failure("recovery_deposit_data_incomplete", false, "review");
|
|
628
628
|
analytics.outcome("failed");
|
|
@@ -651,7 +651,7 @@ function ClaimBody({
|
|
|
651
651
|
chain: sourceChainId
|
|
652
652
|
})]);
|
|
653
653
|
try {
|
|
654
|
-
const result = await
|
|
654
|
+
const result = await _chunkI4XVX57Tcjs.submitSignedRecovery.call(void 0, {
|
|
655
655
|
backendUrl,
|
|
656
656
|
chainId: signingChainId,
|
|
657
657
|
depositId: deposit.id,
|
|
@@ -667,7 +667,7 @@ function ClaimBody({
|
|
|
667
667
|
const refundedRaw = BigInt(
|
|
668
668
|
_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(result.amount, () => ( deposit.sourceAmount)), () => ( deposit.amount)), () => ( "0"))
|
|
669
669
|
);
|
|
670
|
-
const amountDisplay = _nullishCoalesce(
|
|
670
|
+
const amountDisplay = _nullishCoalesce(_chunkI4XVX57Tcjs.formatTokenAmount.call(void 0, Number(_viem.formatUnits.call(void 0, refundedRaw, decimals)), symbol), () => ( _viem.formatUnits.call(void 0, refundedRaw, decimals)));
|
|
671
671
|
dispatch({
|
|
672
672
|
type: "complete",
|
|
673
673
|
txHash: result.transactionHash,
|
|
@@ -698,9 +698,9 @@ function ClaimBody({
|
|
|
698
698
|
})]);
|
|
699
699
|
} catch (err) {
|
|
700
700
|
if (!isCurrentOperation()) return;
|
|
701
|
-
const recoveryError = err instanceof
|
|
701
|
+
const recoveryError = err instanceof _chunkI4XVX57Tcjs.RecoveryError ? err : void 0;
|
|
702
702
|
const status = _optionalChain([recoveryError, 'optionalAccess', _29 => _29.status]);
|
|
703
|
-
const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _30 => _30.message]), () => (
|
|
703
|
+
const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _30 => _30.message]), () => ( _chunkI4XVX57Tcjs.formatUserError.call(void 0,
|
|
704
704
|
err instanceof Error ? err.message : "Recovery failed"
|
|
705
705
|
)));
|
|
706
706
|
const retryable = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _31 => _31.retryable]), () => ( true));
|
|
@@ -771,7 +771,7 @@ function LookupStep({
|
|
|
771
771
|
onResults(deposits);
|
|
772
772
|
} catch (err) {
|
|
773
773
|
if (!isCurrentOperation()) return;
|
|
774
|
-
const message =
|
|
774
|
+
const message = _chunkI4XVX57Tcjs.formatUserError.call(void 0,
|
|
775
775
|
err instanceof Error ? err.message : "Lookup failed"
|
|
776
776
|
);
|
|
777
777
|
analytics.failure("lookup_failed", true, "lookup");
|
|
@@ -793,15 +793,15 @@ function LookupStep({
|
|
|
793
793
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
794
794
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
795
795
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
-
|
|
796
|
+
_chunkI4XVX57Tcjs.BodyHeader,
|
|
797
797
|
{
|
|
798
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.HandCoinsIcon, {}),
|
|
799
799
|
title: "Claim a deposit",
|
|
800
800
|
subtitle: "Get funds from a failed deposit sent back to you on the source chain."
|
|
801
801
|
}
|
|
802
802
|
),
|
|
803
803
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
804
|
-
|
|
804
|
+
_chunkI4XVX57Tcjs.Input,
|
|
805
805
|
{
|
|
806
806
|
label: "Transaction hash",
|
|
807
807
|
placeholder: "0x\u2026",
|
|
@@ -810,9 +810,9 @@ function LookupStep({
|
|
|
810
810
|
error: trimmed.length > 0 && !validTxHash ? "Enter a valid transaction hash" : void 0
|
|
811
811
|
}
|
|
812
812
|
),
|
|
813
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
813
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.Callout, { variant: "error", children: error }),
|
|
814
814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
815
|
-
|
|
815
|
+
_chunkI4XVX57Tcjs.Button,
|
|
816
816
|
{
|
|
817
817
|
onClick: handleLookup,
|
|
818
818
|
loading,
|
|
@@ -823,7 +823,7 @@ function LookupStep({
|
|
|
823
823
|
}
|
|
824
824
|
)
|
|
825
825
|
] }),
|
|
826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.PoweredBy, {})
|
|
827
827
|
] });
|
|
828
828
|
}
|
|
829
829
|
function SelectStep({
|
|
@@ -833,9 +833,9 @@ function SelectStep({
|
|
|
833
833
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
834
834
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
835
835
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
836
|
-
|
|
836
|
+
_chunkI4XVX57Tcjs.BodyHeader,
|
|
837
837
|
{
|
|
838
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
838
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.CoinsIcon, {}),
|
|
839
839
|
title: "Select a deposit",
|
|
840
840
|
subtitle: "This transaction produced multiple deposits. Choose the one to claim."
|
|
841
841
|
}
|
|
@@ -844,7 +844,7 @@ function SelectStep({
|
|
|
844
844
|
const { symbol, amount, chainName } = describeDeposit(row);
|
|
845
845
|
const eligible = isEligible(row);
|
|
846
846
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
847
|
-
|
|
847
|
+
_chunkPHYX2K4Kcjs.ListRow,
|
|
848
848
|
{
|
|
849
849
|
leadingMedia: _chunk4KCSH4T3cjs.tokenIconUrl.call(void 0, symbol),
|
|
850
850
|
title: `${amount} ${symbol}`,
|
|
@@ -857,7 +857,7 @@ function SelectStep({
|
|
|
857
857
|
);
|
|
858
858
|
}) })
|
|
859
859
|
] }),
|
|
860
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.PoweredBy, {})
|
|
861
861
|
] });
|
|
862
862
|
}
|
|
863
863
|
function ReviewStep({
|
|
@@ -868,12 +868,12 @@ function ReviewStep({
|
|
|
868
868
|
}) {
|
|
869
869
|
const analytics = useClaimAnalyticsController();
|
|
870
870
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
871
|
-
|
|
871
|
+
_chunkI4XVX57Tcjs.RecoveryReviewScreen,
|
|
872
872
|
{
|
|
873
873
|
chainId: _nullishCoalesce(evmChainIdFromCaip2(deposit.chain), () => ( 0)),
|
|
874
874
|
token: deposit.token,
|
|
875
875
|
amountRaw: _nullishCoalesce(deposit.sourceAmount, () => ( deposit.amount)),
|
|
876
|
-
txHash:
|
|
876
|
+
txHash: _chunkI4XVX57Tcjs.sourceDepositTxHash.call(void 0, deposit),
|
|
877
877
|
defaultDestination: defaultRefundDestination,
|
|
878
878
|
submitting,
|
|
879
879
|
onSubmit,
|
|
@@ -889,7 +889,7 @@ function ResultStep({
|
|
|
889
889
|
onRetry
|
|
890
890
|
}) {
|
|
891
891
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
|
-
|
|
892
|
+
_chunkI4XVX57Tcjs.RecoveryOutcomeScreen,
|
|
893
893
|
{
|
|
894
894
|
result: result ? {
|
|
895
895
|
amountDisplay: result.amountDisplay,
|
|
@@ -900,11 +900,11 @@ function ResultStep({
|
|
|
900
900
|
} : null,
|
|
901
901
|
error,
|
|
902
902
|
children: result ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
903
|
-
onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
903
|
+
onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.Button, { variant: "outline", onClick: onReset, fullWidth: true, children: "Claim another deposit" }),
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
905
905
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
906
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
-
onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
906
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
907
|
+
onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkI4XVX57Tcjs.Button, { onClick: onRetry, fullWidth: true, children: "Try again" })
|
|
908
908
|
] })
|
|
909
909
|
}
|
|
910
910
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/core/version.ts
|
|
2
|
-
var MODAL_VERSION = "0.0.0-dev-
|
|
2
|
+
var MODAL_VERSION = "0.0.0-dev-20260901193125";
|
|
3
3
|
var SERVICE_HEADERS = {
|
|
4
4
|
"Content-Type": "application/json",
|
|
5
5
|
"x-deposit-modal-version": MODAL_VERSION
|