@rhinestone/deposit-modal 0.12.2 → 0.14.0
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 +73 -18
- package/bridge-transcript.json +653 -0
- package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
- package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
- package/dist/{DepositModalReown-VG66OTIU.cjs → DepositModalReown-46LPVFB6.cjs} +58 -35
- package/dist/{DepositModalReown-TEC3MEZ4.mjs → DepositModalReown-Q2JMLT47.mjs} +45 -22
- package/dist/{QRCode-WUC652SH.mjs → QRCode-5RGIZZHL.mjs} +1 -1
- package/dist/{QRCode-5DXFNKI2.cjs → QRCode-JKXG4RHN.cjs} +2 -2
- package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
- package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
- package/dist/{chunk-O7BCVQ6L.cjs → chunk-4KCSH4T3.cjs} +157 -199
- package/dist/chunk-6KG642KH.cjs +31 -0
- package/dist/{chunk-PWLEBV5V.cjs → chunk-7ICSHJFE.cjs} +296 -220
- package/dist/{chunk-J46WDSRD.mjs → chunk-7SR7ENVJ.mjs} +165 -89
- package/dist/{chunk-2TPSF77V.mjs → chunk-CFKC77SV.mjs} +455 -261
- package/dist/{chunk-75DVGSAX.cjs → chunk-DW2EQA2U.cjs} +6 -3
- package/dist/{chunk-FXXUIK4E.mjs → chunk-IN77XSWO.mjs} +899 -153
- package/dist/chunk-K4H6TGBE.mjs +31 -0
- package/dist/{chunk-SDSKIJC7.mjs → chunk-KTUVSKR4.mjs} +2410 -1177
- package/dist/{chunk-HL5NUKZW.cjs → chunk-LZFRL2AL.cjs} +3 -3
- package/dist/{chunk-UQIJU6HV.cjs → chunk-MTFJSE52.cjs} +499 -191
- package/dist/{chunk-FLVLYO64.mjs → chunk-PKML3XVS.mjs} +430 -122
- package/dist/{chunk-4ZXQPFNU.mjs → chunk-RN5VKWI6.mjs} +4 -1
- package/dist/{chunk-BRYNGLDM.cjs → chunk-V2OBGLJD.cjs} +961 -215
- package/dist/{chunk-3STTWRAN.mjs → chunk-VUATPOWJ.mjs} +147 -189
- package/dist/{chunk-JE4R5VA3.mjs → chunk-WUJIKCFU.mjs} +1 -1
- package/dist/chunk-X2IPAPXU.cjs +163 -0
- package/dist/{chunk-OIN4CXCP.cjs → chunk-YCQZJQO6.cjs} +2343 -1110
- package/dist/{chunk-TM7VGHAG.cjs → chunk-YWMWI7PZ.cjs} +462 -268
- package/dist/chunk-ZEO6ADM3.mjs +163 -0
- package/dist/claim.cjs +7 -6
- package/dist/claim.d.cts +11 -3
- package/dist/claim.d.ts +11 -3
- package/dist/claim.mjs +6 -5
- package/dist/{constants-FuzG3h4m.d.cts → constants-DBrWhJWE.d.cts} +12 -7
- package/dist/{constants-FuzG3h4m.d.ts → constants-DBrWhJWE.d.ts} +12 -7
- package/dist/constants.cjs +3 -9
- package/dist/constants.d.cts +2 -3
- package/dist/constants.d.ts +2 -3
- package/dist/constants.mjs +4 -10
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +7 -7
- package/dist/embed.cjs +1476 -0
- package/dist/embed.d.cts +183 -0
- package/dist/embed.d.ts +183 -0
- package/dist/embed.mjs +1476 -0
- package/dist/index.cjs +11 -16
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +14 -19
- package/dist/modal-ui-state-OD1RmKkK.d.cts +30 -0
- package/dist/modal-ui-state-OD1RmKkK.d.ts +30 -0
- package/dist/polymarket.cjs +17 -7
- package/dist/polymarket.mjs +13 -3
- package/dist/styles.css +124 -98
- package/dist/types-Bho4OA03.d.ts +982 -0
- package/dist/types-DP_3KwlD.d.cts +982 -0
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +11 -3
- package/dist/withdraw.d.ts +11 -3
- package/dist/withdraw.mjs +5 -5
- package/package.json +59 -6
- package/dist/chunk-IAGFDSNC.mjs +0 -11
- package/dist/chunk-L32UI7LA.cjs +0 -11
- package/dist/types-BO4iP6fG.d.cts +0 -612
- package/dist/types-oFblf65g.d.ts +0 -612
|
@@ -24,16 +24,17 @@ import {
|
|
|
24
24
|
tokenAmountToNumber,
|
|
25
25
|
useExplorerTxUrl,
|
|
26
26
|
useLatestRef
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IN77XSWO.mjs";
|
|
28
28
|
import {
|
|
29
29
|
NATIVE_TOKEN_ADDRESS,
|
|
30
|
+
SOLANA_MAINNET_CAIP2,
|
|
30
31
|
cdnIconUrl,
|
|
31
32
|
getChainIcon,
|
|
32
33
|
getChainName,
|
|
33
34
|
targetChainToCaip2,
|
|
34
35
|
targetChainToChainId,
|
|
35
36
|
toEvmCaip2
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-VUATPOWJ.mjs";
|
|
37
38
|
|
|
38
39
|
// src/core/removed-props.ts
|
|
39
40
|
var MANAGED_ACCOUNT_REMOVALS = {
|
|
@@ -62,7 +63,7 @@ var REMOVED_PROPS = {
|
|
|
62
63
|
}
|
|
63
64
|
};
|
|
64
65
|
var REMOVED_UI_CONFIG_KEYS = {
|
|
65
|
-
checkLiquidity: "removed \u2014 the
|
|
66
|
+
checkLiquidity: "removed \u2014 the modal no longer surfaces a liquidity cap. Route capacity is enforced when the deposit is processed.",
|
|
66
67
|
showHistoryButton: "removed \u2014 deposit history is always offered, from the modal's home screen. There is no way to hide it."
|
|
67
68
|
};
|
|
68
69
|
var warned = /* @__PURE__ */ new Set();
|
|
@@ -96,73 +97,49 @@ function warnRemovedProps(component, props) {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
// src/core/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
// src/core/analytics-target.ts
|
|
101
|
+
var HEX_TOKEN = /^0x(?:[0-9a-f]{32}|[0-9a-f]{40})$/i;
|
|
102
|
+
var BASE58_TOKEN = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
103
|
+
function analyticsTargetProperties(input) {
|
|
104
|
+
const properties = {};
|
|
105
|
+
const chain = resolveChain(input.targetChain);
|
|
106
|
+
const token = resolveToken(input.targetToken);
|
|
107
|
+
if (chain) properties.target_chain = chain;
|
|
108
|
+
if (token) properties.target_token = token;
|
|
109
|
+
return properties;
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const price2 = prices2[caip2];
|
|
112
|
-
return typeof price2 === "number" && price2 > 0 ? price2 : null;
|
|
111
|
+
function resolveChain(targetChain) {
|
|
112
|
+
if (targetChain === void 0) return void 0;
|
|
113
|
+
if (typeof targetChain === "number" && !(targetChain > 0 && Number.isInteger(targetChain))) {
|
|
114
|
+
return void 0;
|
|
113
115
|
}
|
|
114
|
-
|
|
115
|
-
const prices = await service.fetchPrices([symbol]);
|
|
116
|
-
const price = prices[symbol];
|
|
117
|
-
return typeof price === "number" && price > 0 ? price : null;
|
|
116
|
+
return targetChainToCaip2(targetChain);
|
|
118
117
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
parsed.filter((e) => e.caip2).map((e) => e.caip2)
|
|
145
|
-
)
|
|
146
|
-
];
|
|
147
|
-
Promise.all([
|
|
148
|
-
symbols.length > 0 ? service.fetchPrices(symbols) : Promise.resolve({}),
|
|
149
|
-
caip2Ids.length > 0 ? service.fetchPricesByAddress(caip2Ids) : Promise.resolve({})
|
|
150
|
-
]).then(([bySymbol, byAddress]) => {
|
|
151
|
-
if (cancelled) return;
|
|
152
|
-
const merged = { ...bySymbol };
|
|
153
|
-
for (const entry of parsed) {
|
|
154
|
-
if (!entry.caip2) continue;
|
|
155
|
-
const price = byAddress[entry.caip2];
|
|
156
|
-
if (typeof price === "number") merged[entry.symbol] = price;
|
|
157
|
-
}
|
|
158
|
-
setPrices(merged);
|
|
159
|
-
}).catch(() => {
|
|
160
|
-
});
|
|
161
|
-
return () => {
|
|
162
|
-
cancelled = true;
|
|
163
|
-
};
|
|
164
|
-
}, [service, key]);
|
|
165
|
-
return prices;
|
|
118
|
+
function resolveToken(targetToken) {
|
|
119
|
+
const raw = targetToken?.trim();
|
|
120
|
+
if (!raw) return void 0;
|
|
121
|
+
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
122
|
+
if (BASE58_TOKEN.test(raw)) return raw;
|
|
123
|
+
return raw.toLowerCase() === "native" ? "native" : void 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/core/submission-uncertainty.ts
|
|
127
|
+
var MARKER = "__rhinestoneSubmissionUncertain";
|
|
128
|
+
function markSubmissionUncertain(error) {
|
|
129
|
+
Object.defineProperty(error, MARKER, {
|
|
130
|
+
value: true,
|
|
131
|
+
enumerable: false
|
|
132
|
+
});
|
|
133
|
+
return error;
|
|
134
|
+
}
|
|
135
|
+
function isSubmissionUncertain(error) {
|
|
136
|
+
let current = error;
|
|
137
|
+
for (let depth = 0; depth < 10; depth += 1) {
|
|
138
|
+
if (typeof current !== "object" || current === null) return false;
|
|
139
|
+
if (current[MARKER] === true) return true;
|
|
140
|
+
current = current.cause;
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
166
143
|
}
|
|
167
144
|
|
|
168
145
|
// src/components/steps/ProcessingStep.tsx
|
|
@@ -170,16 +147,16 @@ import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef2
|
|
|
170
147
|
|
|
171
148
|
// src/components/ui/Tooltip.tsx
|
|
172
149
|
import {
|
|
173
|
-
useState
|
|
150
|
+
useState,
|
|
174
151
|
useRef,
|
|
175
|
-
useEffect
|
|
152
|
+
useEffect,
|
|
176
153
|
useCallback
|
|
177
154
|
} from "react";
|
|
178
155
|
import { createPortal } from "react-dom";
|
|
179
156
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
180
157
|
function Tooltip({ content, children, className }) {
|
|
181
|
-
const [open, setOpen] =
|
|
182
|
-
const [position, setPosition] =
|
|
158
|
+
const [open, setOpen] = useState(false);
|
|
159
|
+
const [position, setPosition] = useState(null);
|
|
183
160
|
const triggerRef = useRef(null);
|
|
184
161
|
const bubbleRef = useRef(null);
|
|
185
162
|
const updatePosition = useCallback(() => {
|
|
@@ -191,7 +168,7 @@ function Tooltip({ content, children, className }) {
|
|
|
191
168
|
left: rect.left + rect.width / 2
|
|
192
169
|
});
|
|
193
170
|
}, []);
|
|
194
|
-
|
|
171
|
+
useEffect(() => {
|
|
195
172
|
if (!open) return;
|
|
196
173
|
updatePosition();
|
|
197
174
|
function handleOutside(event) {
|
|
@@ -266,10 +243,10 @@ function Tooltip({ content, children, className }) {
|
|
|
266
243
|
Tooltip.displayName = "Tooltip";
|
|
267
244
|
|
|
268
245
|
// src/components/ui/FeesAccordion.tsx
|
|
269
|
-
import { useState as
|
|
246
|
+
import { useState as useState2 } from "react";
|
|
270
247
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
271
248
|
function FeesAccordion({ total, rows, tooltip }) {
|
|
272
|
-
const [open, setOpen] =
|
|
249
|
+
const [open, setOpen] = useState2(false);
|
|
273
250
|
const expandable = rows.length > 0;
|
|
274
251
|
return /* @__PURE__ */ jsxs2("div", { className: "rs-fees-accordion", children: [
|
|
275
252
|
/* @__PURE__ */ jsxs2("div", { className: "rs-fees-accordion-summary", children: [
|
|
@@ -555,6 +532,70 @@ function failureMessageForEvent(event) {
|
|
|
555
532
|
return formatBridgeFailedMessage(event).message;
|
|
556
533
|
}
|
|
557
534
|
|
|
535
|
+
// src/core/useTokenPrices.ts
|
|
536
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
537
|
+
var PRICE_SERVICE_NATIVE = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
538
|
+
var WRAPPED_SOL_MINT = "So11111111111111111111111111111111111111112";
|
|
539
|
+
var SOL_SYSTEM_PROGRAM = "11111111111111111111111111111111";
|
|
540
|
+
function isSolanaNativeAddress(address) {
|
|
541
|
+
if (!address) return true;
|
|
542
|
+
const lower = address.toLowerCase();
|
|
543
|
+
return lower === "native" || lower === SOL_SYSTEM_PROGRAM;
|
|
544
|
+
}
|
|
545
|
+
function isNativeAddress(address) {
|
|
546
|
+
if (!address) return true;
|
|
547
|
+
return address.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
548
|
+
}
|
|
549
|
+
function caip2For(token) {
|
|
550
|
+
if (token.chainId === "solana") {
|
|
551
|
+
const mint = isSolanaNativeAddress(token.address) ? WRAPPED_SOL_MINT : token.address;
|
|
552
|
+
return mint ? `${SOLANA_MAINNET_CAIP2}:${mint}` : void 0;
|
|
553
|
+
}
|
|
554
|
+
if (typeof token.chainId !== "number") return void 0;
|
|
555
|
+
const address = isNativeAddress(token.address) ? PRICE_SERVICE_NATIVE : token.address;
|
|
556
|
+
return `${toEvmCaip2(token.chainId)}:${address.toLowerCase()}`;
|
|
557
|
+
}
|
|
558
|
+
async function fetchTokenPriceUsd(service, token) {
|
|
559
|
+
const caip2 = caip2For(token);
|
|
560
|
+
if (!caip2) return null;
|
|
561
|
+
const prices = await service.fetchPricesByAddress([caip2]);
|
|
562
|
+
const price = prices[caip2];
|
|
563
|
+
return typeof price === "number" && price > 0 ? price : null;
|
|
564
|
+
}
|
|
565
|
+
function useTokenPrices(service, tokens) {
|
|
566
|
+
const [prices, setPrices] = useState3({});
|
|
567
|
+
const defined = tokens.filter((t) => Boolean(t?.symbol));
|
|
568
|
+
const entries = [
|
|
569
|
+
...new Map(
|
|
570
|
+
defined.flatMap((token) => {
|
|
571
|
+
const caip2 = caip2For(token);
|
|
572
|
+
return caip2 ? [{ symbol: token.symbol.toUpperCase(), caip2 }] : [];
|
|
573
|
+
}).map((entry) => [entry.caip2, entry])
|
|
574
|
+
).values()
|
|
575
|
+
].sort((a, b) => a.caip2.localeCompare(b.caip2));
|
|
576
|
+
const key = JSON.stringify(entries);
|
|
577
|
+
useEffect2(() => {
|
|
578
|
+
if (key === "[]") return;
|
|
579
|
+
let cancelled = false;
|
|
580
|
+
const parsed = JSON.parse(key);
|
|
581
|
+
const caip2Ids = [...new Set(parsed.map((e) => e.caip2))];
|
|
582
|
+
service.fetchPricesByAddress(caip2Ids).then((byAddress) => {
|
|
583
|
+
if (cancelled) return;
|
|
584
|
+
const merged = {};
|
|
585
|
+
for (const entry of parsed) {
|
|
586
|
+
const price = byAddress[entry.caip2];
|
|
587
|
+
if (typeof price === "number") merged[entry.symbol] = price;
|
|
588
|
+
}
|
|
589
|
+
setPrices(merged);
|
|
590
|
+
}).catch(() => {
|
|
591
|
+
});
|
|
592
|
+
return () => {
|
|
593
|
+
cancelled = true;
|
|
594
|
+
};
|
|
595
|
+
}, [service, key]);
|
|
596
|
+
return prices;
|
|
597
|
+
}
|
|
598
|
+
|
|
558
599
|
// src/components/steps/ProcessingStep.tsx
|
|
559
600
|
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
560
601
|
function SuccessBadge() {
|
|
@@ -837,6 +878,9 @@ function getInitialProcessingState(event, txHash) {
|
|
|
837
878
|
}
|
|
838
879
|
return null;
|
|
839
880
|
}
|
|
881
|
+
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
882
|
+
return event?.data?.source?.transactionHash ?? fallbackTxHash;
|
|
883
|
+
}
|
|
840
884
|
function ProcessingStep({
|
|
841
885
|
smartAccount,
|
|
842
886
|
solanaDepositAddress,
|
|
@@ -850,6 +894,7 @@ function ProcessingStep({
|
|
|
850
894
|
amountUsd,
|
|
851
895
|
service,
|
|
852
896
|
directTransfer,
|
|
897
|
+
sourceTxHashPending,
|
|
853
898
|
initialEvent,
|
|
854
899
|
flowLabel = "deposit",
|
|
855
900
|
debug,
|
|
@@ -866,6 +911,7 @@ function ProcessingStep({
|
|
|
866
911
|
onRetry,
|
|
867
912
|
onDepositComplete,
|
|
868
913
|
onDepositFailed,
|
|
914
|
+
onSourceTransactionObserved,
|
|
869
915
|
onError
|
|
870
916
|
}) {
|
|
871
917
|
const startTimeRef = useRef2(Date.now());
|
|
@@ -959,20 +1005,26 @@ function ProcessingStep({
|
|
|
959
1005
|
if (!outcome) return;
|
|
960
1006
|
if (outcome.type === "complete") {
|
|
961
1007
|
const context = processingContextRef.current;
|
|
1008
|
+
const sourceTxHash2 = getSettledSourceTxHash(event, txHash);
|
|
962
1009
|
debugLog(debug, "processing", "initial-event:complete", {
|
|
963
1010
|
txHash,
|
|
1011
|
+
sourceTxHash: sourceTxHash2,
|
|
964
1012
|
destinationTxHash: outcome.destinationTxHash,
|
|
965
1013
|
event: event.type
|
|
966
1014
|
});
|
|
967
|
-
onDepositCompleteRef.current?.(
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1015
|
+
onDepositCompleteRef.current?.(
|
|
1016
|
+
sourceTxHash2,
|
|
1017
|
+
outcome.destinationTxHash,
|
|
1018
|
+
{
|
|
1019
|
+
amount: context.amount,
|
|
1020
|
+
sourceChain: context.sourceChain,
|
|
1021
|
+
sourceToken: context.sourceToken,
|
|
1022
|
+
sourceDecimals: context.sourceDecimals,
|
|
1023
|
+
amountUsd: context.amountUsd,
|
|
1024
|
+
targetChain: context.targetChain,
|
|
1025
|
+
targetToken: context.targetToken
|
|
1026
|
+
}
|
|
1027
|
+
);
|
|
976
1028
|
return;
|
|
977
1029
|
}
|
|
978
1030
|
debugLog(debug, "processing", "initial-event:failed", {
|
|
@@ -1101,14 +1153,19 @@ function ProcessingStep({
|
|
|
1101
1153
|
if (!isMounted) return;
|
|
1102
1154
|
if (eventForCurrentTx?.type === "bridge-complete") {
|
|
1103
1155
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1156
|
+
const sourceTxHash2 = getSettledSourceTxHash(
|
|
1157
|
+
eventForCurrentTx,
|
|
1158
|
+
txHash
|
|
1159
|
+
);
|
|
1104
1160
|
const destinationTxHash2 = eventForCurrentTx.data?.destination?.transactionHash;
|
|
1105
1161
|
debugLog(debug, "processing", "state:complete", {
|
|
1106
1162
|
txHash,
|
|
1163
|
+
sourceTxHash: sourceTxHash2,
|
|
1107
1164
|
destinationTxHash: destinationTxHash2,
|
|
1108
1165
|
event: eventForCurrentTx.type
|
|
1109
1166
|
});
|
|
1110
1167
|
const context = processingContextRef.current;
|
|
1111
|
-
onDepositCompleteRef.current?.(
|
|
1168
|
+
onDepositCompleteRef.current?.(sourceTxHash2, destinationTxHash2, {
|
|
1112
1169
|
amount: context.amount,
|
|
1113
1170
|
sourceChain: context.sourceChain,
|
|
1114
1171
|
sourceToken: context.sourceToken,
|
|
@@ -1219,12 +1276,20 @@ function ProcessingStep({
|
|
|
1219
1276
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1220
1277
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1221
1278
|
const destinationTxHash = lastEvent?.data?.destination?.transactionHash || null;
|
|
1279
|
+
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
1222
1280
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
1223
1281
|
const displaySourceChain = sourceDetails.chainId ?? sourceChain;
|
|
1224
1282
|
const displaySourceToken = sourceDetails.token ?? sourceToken;
|
|
1225
1283
|
const displayAmount = sourceDetails.amount ?? amount;
|
|
1226
1284
|
const targetChainId = targetChainToChainId(targetChain);
|
|
1227
|
-
const
|
|
1285
|
+
const settledSourceTxHash = lastEvent?.data?.source?.transactionHash;
|
|
1286
|
+
const sourceExplorerHash = settledSourceTxHash ?? (sourceTxHashPending ? null : sourceTxHash);
|
|
1287
|
+
useEffect3(() => {
|
|
1288
|
+
if (sourceTxHashPending && settledSourceTxHash) {
|
|
1289
|
+
onSourceTransactionObserved?.(settledSourceTxHash);
|
|
1290
|
+
}
|
|
1291
|
+
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
1292
|
+
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
1228
1293
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
|
|
1229
1294
|
const sourceDisplay = (() => {
|
|
1230
1295
|
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
@@ -1372,7 +1437,7 @@ function ProcessingStep({
|
|
|
1372
1437
|
feesTooltip,
|
|
1373
1438
|
newLabel: `New ${flowNoun}`,
|
|
1374
1439
|
onNewDeposit,
|
|
1375
|
-
onClose
|
|
1440
|
+
onClose: onClose ? () => onClose("success_done") : void 0
|
|
1376
1441
|
}
|
|
1377
1442
|
);
|
|
1378
1443
|
}
|
|
@@ -1547,10 +1612,18 @@ function ProcessingStep({
|
|
|
1547
1612
|
"New ",
|
|
1548
1613
|
flowNoun
|
|
1549
1614
|
] }),
|
|
1550
|
-
onClose && /* @__PURE__ */ jsx5(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
1615
|
+
onClose && /* @__PURE__ */ jsx5(Button, { onClick: () => onClose("success_done"), fullWidth: true, children: "Done" })
|
|
1551
1616
|
] }),
|
|
1552
1617
|
isFailed && /* @__PURE__ */ jsxs4("div", { className: "rs-screen-button-row", children: [
|
|
1553
|
-
onClose && /* @__PURE__ */ jsx5(
|
|
1618
|
+
onClose && /* @__PURE__ */ jsx5(
|
|
1619
|
+
Button,
|
|
1620
|
+
{
|
|
1621
|
+
variant: "outline",
|
|
1622
|
+
onClick: () => onClose("failure_cancel"),
|
|
1623
|
+
fullWidth: true,
|
|
1624
|
+
children: "Cancel"
|
|
1625
|
+
}
|
|
1626
|
+
),
|
|
1554
1627
|
handleRetry && /* @__PURE__ */ jsx5(Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
1555
1628
|
] })
|
|
1556
1629
|
] }),
|
|
@@ -1748,6 +1821,8 @@ export {
|
|
|
1748
1821
|
getExchangeLogoSrc,
|
|
1749
1822
|
getExchangeLogo,
|
|
1750
1823
|
Tooltip,
|
|
1824
|
+
markSubmissionUncertain,
|
|
1825
|
+
isSubmissionUncertain,
|
|
1751
1826
|
getEventTxHash,
|
|
1752
1827
|
getEventSourceDetails,
|
|
1753
1828
|
isDepositEvent,
|
|
@@ -1764,5 +1839,6 @@ export {
|
|
|
1764
1839
|
computeIsCacheable,
|
|
1765
1840
|
readDedupedAccountSetupResult,
|
|
1766
1841
|
runAccountSetupDeduped,
|
|
1767
|
-
warnRemovedProps
|
|
1842
|
+
warnRemovedProps,
|
|
1843
|
+
analyticsTargetProperties
|
|
1768
1844
|
};
|