@rhinestone/deposit-modal 0.0.0-dev-20260914164601 → 0.0.0-dev-20260916185228
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 +24 -8
- package/dist/{DepositModalReown-7PM5I4UX.cjs → DepositModalReown-M3H3X23K.cjs} +16 -16
- package/dist/{DepositModalReown-WD2DP5HI.mjs → DepositModalReown-RMTBRO4Q.mjs} +3 -3
- package/dist/{WithdrawModal-NB3S67VA.mjs → WithdrawModal-LDYM3DPR.mjs} +3 -3
- package/dist/WithdrawModal-UMEOIJPI.cjs +11 -0
- package/dist/{chunk-ZIDADGB2.mjs → chunk-34VFJFTK.mjs} +1 -1
- package/dist/{chunk-5AKQEUUL.mjs → chunk-6XT2RYUM.mjs} +2 -2
- package/dist/{chunk-7PI23YXC.cjs → chunk-DKCYP2HE.cjs} +2 -2
- package/dist/{chunk-PI2YFOJ3.mjs → chunk-DVF5ICWP.mjs} +1 -1
- package/dist/{chunk-K42S5AAT.cjs → chunk-FHFE45VE.cjs} +1 -1
- package/dist/{chunk-Q7SSUQ3M.mjs → chunk-HBPNV42Y.mjs} +1 -1
- package/dist/{chunk-IOEHILE7.mjs → chunk-NOPHRYC6.mjs} +38 -7
- package/dist/{chunk-RVOJPY6D.cjs → chunk-U5Z4SDVI.cjs} +71 -71
- package/dist/{chunk-R7MRWCR6.cjs → chunk-UTXVVJ3D.cjs} +196 -165
- package/dist/{chunk-3CIYJ3I3.cjs → chunk-VAND2EHN.cjs} +280 -280
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +2 -2
- 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 +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/offramp.cjs +9 -9
- package/dist/offramp.mjs +7 -7
- package/dist/onramp.cjs +24 -11
- package/dist/onramp.d.cts +24 -6
- package/dist/onramp.d.ts +24 -6
- package/dist/onramp.mjs +22 -9
- package/dist/{types-CZYypODQ.d.ts → types-B6B91Z3z.d.ts} +1 -1
- package/dist/{types-CbUs4boj.d.cts → types-ohJcqB1R.d.cts} +1 -1
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/WithdrawModal-2UTUBDEK.cjs +0 -11
package/README.md
CHANGED
|
@@ -375,21 +375,24 @@ const options = {
|
|
|
375
375
|
};
|
|
376
376
|
const onramp = createOnrampService(options);
|
|
377
377
|
const offramp = createOfframpService(options);
|
|
378
|
-
const
|
|
378
|
+
const setup = await onramp.createSetup({
|
|
379
379
|
purpose: 'account_setup',
|
|
380
380
|
country: 'DE',
|
|
381
381
|
currency: 'EUR',
|
|
382
382
|
paymentMethod: 'bank_transfer',
|
|
383
383
|
});
|
|
384
|
-
//
|
|
384
|
+
// Setup completes in this call and returns the account it configured.
|
|
385
|
+
// Show the customer their bank details through a separate, repeatable call:
|
|
386
|
+
const { nextAction } = await onramp.getAccountDetails(setup.account.id);
|
|
385
387
|
const status = await getComplianceStatus(options);
|
|
386
388
|
```
|
|
387
389
|
|
|
388
|
-
The onramp client has `
|
|
389
|
-
`getAccount`, `listPayments` and `getPayment`. The offramp
|
|
390
|
-
session/options/payment methods, without accounts.
|
|
391
|
-
the existing `/compliance/status` read separately;
|
|
392
|
-
Shared types include `RampSession
|
|
390
|
+
The onramp client has `createSetup`, `getSetup`, `getOptions`, `listAccounts`,
|
|
391
|
+
`getAccount`, `getAccountDetails`, `listPayments` and `getPayment`. The offramp
|
|
392
|
+
client has session/options/payment methods, without accounts.
|
|
393
|
+
`getComplianceStatus` retains the existing `/compliance/status` read separately;
|
|
394
|
+
it is not a preliminary step. Shared types include `RampSession` (offramp),
|
|
395
|
+
`OnrampSetup`, `RampOption` and `RampCurrency`.
|
|
393
396
|
`CustomerSession` remains the browser bearer/expiry pair. Catch `ScopedRequestError`
|
|
394
397
|
and inspect its `status` for HTTP failures; response bodies are not included.
|
|
395
398
|
|
|
@@ -403,7 +406,20 @@ until explicitly invoked, so existing modals and Swapped flows remain unchanged.
|
|
|
403
406
|
There is no preliminary capability request. Support/recovery methods belong to
|
|
404
407
|
the future provider lifecycle implementation and are not exposed here.
|
|
405
408
|
|
|
406
|
-
|
|
409
|
+
**An onramp setup is not a session.** It completes in the call that creates it
|
|
410
|
+
and returns `{ id, account }` — no status to poll, no expiry, no `nextAction`.
|
|
411
|
+
Bank details are read separately through `getAccountDetails`, because a customer
|
|
412
|
+
reads them before every transfer while setup happens once; that call returns a
|
|
413
|
+
hosted address and never the coordinates themselves. An offramp session keeps
|
|
414
|
+
`RampSession` with its status, expiry and `nextAction`, because it really is one
|
|
415
|
+
interaction.
|
|
416
|
+
|
|
417
|
+
Routes are scoped to the provider that serves them — `/onramp/noah/*` and
|
|
418
|
+
`/offramp/noah/*` here, while the existing Swapped flows keep their own paths.
|
|
419
|
+
A proxy must allow each one explicitly; an unlisted path 404s before reaching
|
|
420
|
+
the processor.
|
|
421
|
+
|
|
422
|
+
The initial contracts support EUR/USD bank transfers only. Onramp setup
|
|
407
423
|
uses `purpose: 'account_setup'` without an amount; the actual transfer determines
|
|
408
424
|
fiat sent. Offramp hosted beneficiary collection uses
|
|
409
425
|
`purpose: 'beneficiary_collection'`, separately from quoting and funding.
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
4
|
+
var _chunkVAND2EHNcjs = require('./chunk-VAND2EHN.cjs');
|
|
5
5
|
require('./chunk-LVCD6RHF.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,12 +11,12 @@ require('./chunk-LVCD6RHF.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkUTXVVJ3Dcjs = require('./chunk-UTXVVJ3D.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkOY5N3E6Lcjs = require('./chunk-OY5N3E6L.cjs');
|
|
19
|
-
require('./chunk-
|
|
19
|
+
require('./chunk-FHFE45VE.cjs');
|
|
20
20
|
|
|
21
21
|
// src/DepositModalReown.tsx
|
|
22
22
|
var _react = require('react');
|
|
@@ -44,7 +44,7 @@ var {
|
|
|
44
44
|
unichain,
|
|
45
45
|
katana,
|
|
46
46
|
hyperEvm
|
|
47
|
-
} =
|
|
47
|
+
} = _chunkVAND2EHNcjs.getReownDependencies.call(void 0, )[1];
|
|
48
48
|
var APPKIT_NETWORK_BY_ID = {
|
|
49
49
|
[mainnet.id]: mainnet,
|
|
50
50
|
[optimism.id]: optimism,
|
|
@@ -76,7 +76,7 @@ function getAppKitNetwork(chainId) {
|
|
|
76
76
|
|
|
77
77
|
// src/core/reown-theme.ts
|
|
78
78
|
function mapTheme(theme) {
|
|
79
|
-
const themeMode =
|
|
79
|
+
const themeMode = _chunkUTXVVJ3Dcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
|
|
80
80
|
const themeVariables = {
|
|
81
81
|
"--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
|
|
82
82
|
};
|
|
@@ -93,7 +93,7 @@ function setAppKitTheme(appKit, theme) {
|
|
|
93
93
|
|
|
94
94
|
// src/core/reown.tsx
|
|
95
95
|
var _jsxruntime = require('react/jsx-runtime');
|
|
96
|
-
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] =
|
|
96
|
+
var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkVAND2EHNcjs.getReownDependencies.call(void 0, );
|
|
97
97
|
var {
|
|
98
98
|
createAppKit,
|
|
99
99
|
useAppKit,
|
|
@@ -109,14 +109,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
|
|
|
109
109
|
const transports = {};
|
|
110
110
|
for (const network of networks) {
|
|
111
111
|
const id = Number(network.id);
|
|
112
|
-
transports[id] = _viem.http.call(void 0,
|
|
112
|
+
transports[id] = _viem.http.call(void 0, _chunkUTXVVJ3Dcjs.rpcUrlFor.call(void 0, rpcUrls, id));
|
|
113
113
|
}
|
|
114
114
|
return transports;
|
|
115
115
|
}
|
|
116
116
|
function getEvmRpcFingerprint(rpcUrls, networks) {
|
|
117
117
|
return networks.map((network) => {
|
|
118
118
|
const id = Number(network.id);
|
|
119
|
-
return `${id}=${_nullishCoalesce(
|
|
119
|
+
return `${id}=${_nullishCoalesce(_chunkUTXVVJ3Dcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
|
|
120
120
|
}).join("|");
|
|
121
121
|
}
|
|
122
122
|
var cachedAdapter = null;
|
|
@@ -187,7 +187,7 @@ function ReownWalletProvider({
|
|
|
187
187
|
backendUrl,
|
|
188
188
|
children
|
|
189
189
|
}) {
|
|
190
|
-
const rpcUrls =
|
|
190
|
+
const rpcUrls = _chunkUTXVVJ3Dcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
191
191
|
const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
|
|
192
192
|
const overrides = _react.useMemo.call(void 0, () => {
|
|
193
193
|
if (!rpcUrls) return void 0;
|
|
@@ -199,14 +199,14 @@ function ReownWalletProvider({
|
|
|
199
199
|
return out;
|
|
200
200
|
}, [rpcUrls]);
|
|
201
201
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
202
|
-
const primed =
|
|
202
|
+
const primed = _chunkUTXVVJ3Dcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
203
203
|
return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
|
|
204
204
|
});
|
|
205
205
|
_react.useEffect.call(void 0, () => {
|
|
206
206
|
let active = true;
|
|
207
|
-
const primed =
|
|
207
|
+
const primed = _chunkUTXVVJ3Dcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
|
|
208
208
|
setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
|
|
209
|
-
|
|
209
|
+
_chunkUTXVVJ3Dcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
|
|
210
210
|
if (active) setState({ ready: true, chains });
|
|
211
211
|
});
|
|
212
212
|
return () => {
|
|
@@ -215,7 +215,7 @@ function ReownWalletProvider({
|
|
|
215
215
|
}, [backendUrl, overrides]);
|
|
216
216
|
_react.useEffect.call(void 0, () => {
|
|
217
217
|
setAppKitTheme(appKitReact.modal, theme);
|
|
218
|
-
return
|
|
218
|
+
return _chunkUTXVVJ3Dcjs.followSystemAppearance.call(void 0,
|
|
219
219
|
_optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
|
|
220
220
|
() => setAppKitTheme(appKitReact.modal, theme)
|
|
221
221
|
);
|
|
@@ -279,7 +279,7 @@ function useReownWalletSession() {
|
|
|
279
279
|
await switchChainAsync({ chainId });
|
|
280
280
|
}
|
|
281
281
|
} catch (err) {
|
|
282
|
-
if (
|
|
282
|
+
if (_chunkUTXVVJ3Dcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
283
283
|
throw new Error(
|
|
284
284
|
`Switch to ${chainDisplayName(chainId)} in your wallet to continue`
|
|
285
285
|
);
|
|
@@ -292,7 +292,7 @@ function useReownWalletSession() {
|
|
|
292
292
|
|
|
293
293
|
// src/DepositModalReown.tsx
|
|
294
294
|
|
|
295
|
-
var [appKitReact2, , , , solanaAdapterReact] =
|
|
295
|
+
var [appKitReact2, , , , solanaAdapterReact] = _chunkVAND2EHNcjs.getReownDependencies.call(void 0, );
|
|
296
296
|
var { useAppKitProvider } = appKitReact2;
|
|
297
297
|
var { useAppKitConnection } = solanaAdapterReact;
|
|
298
298
|
function DepositModalWithReown(props) {
|
|
@@ -314,7 +314,7 @@ function DepositModalWithReown(props) {
|
|
|
314
314
|
reown.disconnect();
|
|
315
315
|
}, [reown.disconnect]);
|
|
316
316
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
317
|
-
|
|
317
|
+
_chunkVAND2EHNcjs.DepositModalInner,
|
|
318
318
|
{
|
|
319
319
|
...props,
|
|
320
320
|
walletSession: reownWithSolana,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner,
|
|
3
3
|
getReownDependencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6XT2RYUM.mjs";
|
|
5
5
|
import "./chunk-FTWKAJGN.mjs";
|
|
6
6
|
import {
|
|
7
7
|
followSystemAppearance,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
resolveThemeMode,
|
|
12
12
|
rpcUrlFor,
|
|
13
13
|
useStableRpcUrls
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NOPHRYC6.mjs";
|
|
15
15
|
import {
|
|
16
16
|
SUPPORTED_CHAIN_IDS,
|
|
17
17
|
getChainName
|
|
18
18
|
} from "./chunk-EAGMY3QE.mjs";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-DVF5ICWP.mjs";
|
|
20
20
|
|
|
21
21
|
// src/DepositModalReown.tsx
|
|
22
22
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModal,
|
|
3
3
|
buildWithdrawAnalyticsSessionProperties
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-34VFJFTK.mjs";
|
|
5
|
+
import "./chunk-NOPHRYC6.mjs";
|
|
6
6
|
import "./chunk-EAGMY3QE.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DVF5ICWP.mjs";
|
|
8
8
|
export {
|
|
9
9
|
WithdrawModal,
|
|
10
10
|
buildWithdrawAnalyticsSessionProperties
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkU5Z4SDVIcjs = require('./chunk-U5Z4SDVI.cjs');
|
|
5
|
+
require('./chunk-UTXVVJ3D.cjs');
|
|
6
|
+
require('./chunk-OY5N3E6L.cjs');
|
|
7
|
+
require('./chunk-FHFE45VE.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.WithdrawModal = _chunkU5Z4SDVIcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkU5Z4SDVIcjs.buildWithdrawAnalyticsSessionProperties;
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
useRpcUrls,
|
|
106
106
|
useStableRpcUrls,
|
|
107
107
|
warnRemovedProps
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-NOPHRYC6.mjs";
|
|
109
109
|
import {
|
|
110
110
|
HYPERCORE_CHAIN_ID,
|
|
111
111
|
HYPERCORE_MIN_DEPOSIT_USD,
|
|
@@ -9759,7 +9759,7 @@ function DepositFlow({
|
|
|
9759
9759
|
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9760
9760
|
var ReownDepositInner = lazy2(async () => {
|
|
9761
9761
|
await loadReownDependencies();
|
|
9762
|
-
const module = await import("./DepositModalReown-
|
|
9762
|
+
const module = await import("./DepositModalReown-RMTBRO4Q.mjs");
|
|
9763
9763
|
return { default: module.DepositModalReown };
|
|
9764
9764
|
});
|
|
9765
9765
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFHFE45VEcjs = require('./chunk-FHFE45VE.cjs');
|
|
4
4
|
|
|
5
5
|
// src/core/bearer-transport.ts
|
|
6
6
|
var ScopedRequestError = class extends Error {
|
|
@@ -22,7 +22,7 @@ function createBearerTransport(options) {
|
|
|
22
22
|
const response = await fetch(`${base}${path}`, {
|
|
23
23
|
method: body === void 0 ? "GET" : "POST",
|
|
24
24
|
headers: {
|
|
25
|
-
...
|
|
25
|
+
..._chunkFHFE45VEcjs.serviceHeaders.call(void 0, ),
|
|
26
26
|
Authorization: `Bearer ${session.token}`
|
|
27
27
|
},
|
|
28
28
|
body: body === void 0 ? void 0 : JSON.stringify(body),
|
|
@@ -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-20260916185228";
|
|
3
3
|
var SERVICE_HEADERS = {
|
|
4
4
|
"Content-Type": "application/json",
|
|
5
5
|
"x-deposit-modal-version": MODAL_VERSION
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import {
|
|
36
36
|
MODAL_VERSION,
|
|
37
37
|
serviceHeaders
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-DVF5ICWP.mjs";
|
|
39
39
|
|
|
40
40
|
// src/components/ui/Modal.tsx
|
|
41
41
|
import {
|
|
@@ -3203,6 +3203,7 @@ function toRecoverableDeposit(row, options = {}) {
|
|
|
3203
3203
|
depositId: row.id,
|
|
3204
3204
|
signer,
|
|
3205
3205
|
destinationPrefill: signer,
|
|
3206
|
+
depositAddress: row.depositAddress,
|
|
3206
3207
|
sourceChainId,
|
|
3207
3208
|
targetChainId,
|
|
3208
3209
|
token: row.token,
|
|
@@ -3210,6 +3211,12 @@ function toRecoverableDeposit(row, options = {}) {
|
|
|
3210
3211
|
sourceTxHash: sourceDepositTxHash(row)
|
|
3211
3212
|
};
|
|
3212
3213
|
}
|
|
3214
|
+
function isDepositSelfDestination(row, destination) {
|
|
3215
|
+
const depositAddress = row.depositAddress?.trim();
|
|
3216
|
+
const candidate = destination.trim();
|
|
3217
|
+
if (!depositAddress || !candidate) return false;
|
|
3218
|
+
return depositAddress.toLowerCase() === candidate.toLowerCase();
|
|
3219
|
+
}
|
|
3213
3220
|
function recoveryFailureCause(sourceChainName) {
|
|
3214
3221
|
return sourceChainName ? `This deposit couldn't be completed. Your funds are still on ${sourceChainName}.` : "This deposit couldn't be completed and your funds were not moved.";
|
|
3215
3222
|
}
|
|
@@ -5168,9 +5175,11 @@ function RecoveryReviewScreen({
|
|
|
5168
5175
|
txHash,
|
|
5169
5176
|
defaultDestination,
|
|
5170
5177
|
destinationHint,
|
|
5178
|
+
depositAddress,
|
|
5171
5179
|
submitting,
|
|
5172
5180
|
onSubmit,
|
|
5173
|
-
onDestinationInvalid
|
|
5181
|
+
onDestinationInvalid,
|
|
5182
|
+
onDestinationIsDepositAddress
|
|
5174
5183
|
}) {
|
|
5175
5184
|
const { symbol, amount, chainName, chainIcon } = describeRecoveryDeposit({
|
|
5176
5185
|
chainId,
|
|
@@ -5181,13 +5190,30 @@ function RecoveryReviewScreen({
|
|
|
5181
5190
|
const [destination, setDestination] = useState6(
|
|
5182
5191
|
defaultDestination ?? ""
|
|
5183
5192
|
);
|
|
5184
|
-
const
|
|
5193
|
+
const isSelfDestination = isDepositSelfDestination(
|
|
5194
|
+
{ depositAddress },
|
|
5195
|
+
destination
|
|
5196
|
+
);
|
|
5197
|
+
const destinationValid = isAddress2(destination) && !isSelfDestination;
|
|
5185
5198
|
const onDestinationInvalidRef = useLatestRef(onDestinationInvalid);
|
|
5199
|
+
const onDestinationIsDepositAddressRef = useLatestRef(
|
|
5200
|
+
onDestinationIsDepositAddress
|
|
5201
|
+
);
|
|
5186
5202
|
useEffect8(() => {
|
|
5187
|
-
if (destination.length
|
|
5203
|
+
if (destination.length === 0) return;
|
|
5204
|
+
if (isSelfDestination) {
|
|
5205
|
+
onDestinationIsDepositAddressRef.current?.();
|
|
5206
|
+
} else if (!destinationValid) {
|
|
5188
5207
|
onDestinationInvalidRef.current?.();
|
|
5189
5208
|
}
|
|
5190
|
-
}, [
|
|
5209
|
+
}, [
|
|
5210
|
+
destination,
|
|
5211
|
+
destinationValid,
|
|
5212
|
+
isSelfDestination,
|
|
5213
|
+
onDestinationInvalidRef,
|
|
5214
|
+
onDestinationIsDepositAddressRef
|
|
5215
|
+
]);
|
|
5216
|
+
const selfDestinationError = `${shortenAddress(destination)} is this deposit's own address. Enter a different address.`;
|
|
5191
5217
|
const txUrl = txHash ? explorerTxUrl(chainId, txHash) : null;
|
|
5192
5218
|
const txShort = txHash ? shortenHash2(txHash) : "\u2014";
|
|
5193
5219
|
return /* @__PURE__ */ jsxs14("div", { className: "rs-screen", children: [
|
|
@@ -5244,7 +5270,7 @@ function RecoveryReviewScreen({
|
|
|
5244
5270
|
value: destination,
|
|
5245
5271
|
onChange: (e) => setDestination(e.target.value),
|
|
5246
5272
|
hint: destinationHint,
|
|
5247
|
-
error: destination.length > 0 && !destinationValid ? "Enter a valid address" : void 0
|
|
5273
|
+
error: isSelfDestination ? selfDestinationError : destination.length > 0 && !destinationValid ? "Enter a valid address" : void 0
|
|
5248
5274
|
}
|
|
5249
5275
|
),
|
|
5250
5276
|
/* @__PURE__ */ jsx20(
|
|
@@ -5422,9 +5448,14 @@ function HistoryRecoveryFlow({
|
|
|
5422
5448
|
txHash: deposit.sourceTxHash,
|
|
5423
5449
|
defaultDestination: deposit.destinationPrefill,
|
|
5424
5450
|
destinationHint: "Prefilled with the account this deposit was for. Editable.",
|
|
5451
|
+
depositAddress: deposit.depositAddress,
|
|
5425
5452
|
submitting,
|
|
5426
5453
|
onSubmit: submit,
|
|
5427
|
-
onDestinationInvalid: () => analytics.friction("refund_destination_invalid", "review")
|
|
5454
|
+
onDestinationInvalid: () => analytics.friction("refund_destination_invalid", "review"),
|
|
5455
|
+
onDestinationIsDepositAddress: () => analytics.friction(
|
|
5456
|
+
"refund_destination_is_deposit_address",
|
|
5457
|
+
"review"
|
|
5458
|
+
)
|
|
5428
5459
|
}
|
|
5429
5460
|
),
|
|
5430
5461
|
phase === "success" && outcome && /* @__PURE__ */ jsx21(
|