@rhinestone/deposit-modal 0.11.0 → 0.12.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/dist/{DepositModalReown-6RVLEM3B.mjs → DepositModalReown-MVVRUXO4.mjs} +7 -7
- package/dist/{DepositModalReown-TXTLVZIQ.cjs → DepositModalReown-PZXHTPIS.cjs} +17 -17
- package/dist/{chunk-VRNRRN2U.mjs → chunk-2AMRKYJ4.mjs} +4 -4
- package/dist/{chunk-JYKMR6QI.cjs → chunk-2PQ34KU3.cjs} +3 -3
- package/dist/{chunk-TENL4H64.cjs → chunk-4R2ZHSDQ.cjs} +4 -9
- package/dist/{chunk-XVKBCDZI.cjs → chunk-4SRVZRZF.cjs} +1 -1
- package/dist/{chunk-MZ53PDIX.mjs → chunk-53IGTENZ.mjs} +1 -1
- package/dist/{chunk-ITAYM7SB.mjs → chunk-5IP67CL5.mjs} +45 -17
- package/dist/{chunk-HCQWFL3A.cjs → chunk-6ZJTZ7DS.cjs} +81 -80
- package/dist/{chunk-BLJMYCBF.cjs → chunk-BK54FZAE.cjs} +83 -83
- package/dist/{chunk-G4FVZQOM.mjs → chunk-EUIPQ3T4.mjs} +7 -7
- package/dist/{chunk-QRR3Y7EK.mjs → chunk-GZNMBZHY.mjs} +1 -1
- package/dist/{chunk-NPSC5R22.cjs → chunk-LBJFACLH.cjs} +125 -97
- package/dist/{chunk-7RNEYPI4.cjs → chunk-LTPVHQXJ.cjs} +555 -549
- package/dist/{chunk-TRD2FCAR.mjs → chunk-Q5MFRAWD.mjs} +417 -411
- package/dist/{chunk-WLDTBKRA.mjs → chunk-QF5T6HXC.mjs} +5 -4
- package/dist/{chunk-DYTRG4C7.mjs → chunk-RMYUE6HJ.mjs} +1 -1
- package/dist/{chunk-GWA6GFTI.cjs → chunk-WZJMJFP7.cjs} +62 -62
- package/dist/{chunk-JPRV36DT.cjs → chunk-XJB3VG4C.cjs} +2 -2
- package/dist/{chunk-53IFZGSF.mjs → chunk-YR43AAX5.mjs} +0 -5
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +2 -2
- package/dist/claim.d.ts +2 -2
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +2 -2
- 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/index.cjs +10 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +9 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/{types-C7wag_iL.d.cts → types-BO4iP6fG.d.cts} +6 -1
- package/dist/{types-D4b6Cjox.d.ts → types-oFblf65g.d.ts} +6 -1
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkLBJFACLHcjs = require('./chunk-LBJFACLH.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ var _chunkNPSC5R22cjs = require('./chunk-NPSC5R22.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk4R2ZHSDQcjs = require('./chunk-4R2ZHSDQ.cjs');
|
|
38
38
|
|
|
39
39
|
// src/core/removed-props.ts
|
|
40
40
|
var MANAGED_ACCOUNT_REMOVALS = {
|
|
@@ -63,7 +63,8 @@ var REMOVED_PROPS = {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
var REMOVED_UI_CONFIG_KEYS = {
|
|
66
|
-
checkLiquidity: "removed \u2014 the liquidity cap is shown on the QR / transfer screen, which checks it directly."
|
|
66
|
+
checkLiquidity: "removed \u2014 the liquidity cap is shown on the QR / transfer screen, which checks it directly.",
|
|
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();
|
|
69
70
|
function warnOnce(component, key, replacement) {
|
|
@@ -71,7 +72,7 @@ function warnOnce(component, key, replacement) {
|
|
|
71
72
|
if (warned.has(id)) return;
|
|
72
73
|
warned.add(id);
|
|
73
74
|
console.error(
|
|
74
|
-
`[rhinestone] <${component}> was passed \`${key}\`, which no longer exists
|
|
75
|
+
`[rhinestone] <${component}> was passed \`${key}\`, which no longer exists: ${replacement}`
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
function warnRemovedProps(component, props) {
|
|
@@ -99,10 +100,10 @@ function warnRemovedProps(component, props) {
|
|
|
99
100
|
// src/core/useTokenPrices.ts
|
|
100
101
|
var _react = require('react');
|
|
101
102
|
function isErc20(token) {
|
|
102
|
-
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !==
|
|
103
|
+
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !== _chunk4R2ZHSDQcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
103
104
|
}
|
|
104
105
|
function caip2For(token) {
|
|
105
|
-
return `${
|
|
106
|
+
return `${_chunk4R2ZHSDQcjs.toEvmCaip2.call(void 0, token.chainId)}:${token.address.toLowerCase()}`;
|
|
106
107
|
}
|
|
107
108
|
async function fetchTokenPriceUsd(service, token) {
|
|
108
109
|
if (isErc20(token)) {
|
|
@@ -275,7 +276,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
275
276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-summary", children: [
|
|
276
277
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-fees-accordion-label", children: [
|
|
277
278
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
278
|
-
tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
279
|
+
tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.InfoIcon, {}) }) })
|
|
279
280
|
] }),
|
|
280
281
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
281
282
|
"button",
|
|
@@ -293,7 +294,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
293
294
|
{
|
|
294
295
|
className: `rs-fees-accordion-chevron${open ? " rs-fees-accordion-chevron--open" : ""}`,
|
|
295
296
|
"aria-hidden": "true",
|
|
296
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
297
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.ChevronDownIcon, {})
|
|
297
298
|
}
|
|
298
299
|
)
|
|
299
300
|
]
|
|
@@ -315,7 +316,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
315
316
|
{
|
|
316
317
|
className: "rs-review-detail-info",
|
|
317
318
|
"aria-label": `${row.label} info`,
|
|
318
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
319
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.InfoIcon, {})
|
|
319
320
|
}
|
|
320
321
|
) })
|
|
321
322
|
] })
|
|
@@ -341,13 +342,13 @@ function SwappedReceipt({
|
|
|
341
342
|
}) {
|
|
342
343
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
343
344
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
344
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CheckIcon, {}), title: "Deposit successful" }),
|
|
345
346
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
346
347
|
onrampMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
347
348
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Onramp method" }),
|
|
348
349
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
349
350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: onrampMethod }),
|
|
350
|
-
onrampMethodIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon rs-review-detail-icon--square", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
onrampMethodIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon rs-review-detail-icon--square", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CdnIcon, { src: onrampMethodIcon }) })
|
|
351
352
|
] })
|
|
352
353
|
] }),
|
|
353
354
|
amountPaid && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -358,7 +359,7 @@ function SwappedReceipt({
|
|
|
358
359
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Deposited amount" }),
|
|
359
360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
360
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: depositedAmount }),
|
|
361
|
-
depositedSymbol && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
362
|
+
depositedSymbol && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.TokenIcon, { symbol: depositedSymbol }) })
|
|
362
363
|
] })
|
|
363
364
|
] }),
|
|
364
365
|
feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -371,11 +372,11 @@ function SwappedReceipt({
|
|
|
371
372
|
)
|
|
372
373
|
] }),
|
|
373
374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
374
|
-
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
375
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
375
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
376
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
376
377
|
] })
|
|
377
378
|
] }),
|
|
378
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.PoweredBy, {})
|
|
379
380
|
] });
|
|
380
381
|
}
|
|
381
382
|
SwappedReceipt.displayName = "SwappedReceipt";
|
|
@@ -394,7 +395,7 @@ var EXCHANGE_SLUGS = [
|
|
|
394
395
|
"kucoin"
|
|
395
396
|
];
|
|
396
397
|
var EXCHANGE_LOGO_SOURCES = Object.fromEntries(
|
|
397
|
-
EXCHANGE_SLUGS.map((slug) => [slug,
|
|
398
|
+
EXCHANGE_SLUGS.map((slug) => [slug, _chunk4R2ZHSDQcjs.cdnIconUrl.call(void 0, "exchanges", slug)])
|
|
398
399
|
);
|
|
399
400
|
var EXCHANGE_LOGO_ALIASES = {
|
|
400
401
|
gate: "gateio"
|
|
@@ -411,7 +412,7 @@ function getExchangeLogoSrc(name, connection) {
|
|
|
411
412
|
}
|
|
412
413
|
function getExchangeLogo(name, connection) {
|
|
413
414
|
const src = getExchangeLogoSrc(name, connection);
|
|
414
|
-
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
415
|
+
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CdnIcon, { src }) : null;
|
|
415
416
|
}
|
|
416
417
|
|
|
417
418
|
// src/core/webhook.ts
|
|
@@ -656,14 +657,14 @@ function buildQuoteFeeRows(breakdown, sponsoredTooltip) {
|
|
|
656
657
|
if (!breakdown) return { rows: [], chargeableUsd: 0 };
|
|
657
658
|
const rows = [];
|
|
658
659
|
let chargeableUsd = 0;
|
|
659
|
-
for (const group of
|
|
660
|
+
for (const group of _chunkLBJFACLHcjs.quoteFeeGroups.call(void 0, breakdown)) {
|
|
660
661
|
if (group.chargedUsd > 0) {
|
|
661
662
|
chargeableUsd += group.chargedUsd;
|
|
662
|
-
rows.push({ label: group.label, value:
|
|
663
|
+
rows.push({ label: group.label, value: _chunkLBJFACLHcjs.formatFeeUsd.call(void 0, group.chargedUsd) });
|
|
663
664
|
} else if (group.sponsoredUsd > 0) {
|
|
664
665
|
rows.push({
|
|
665
666
|
label: group.label,
|
|
666
|
-
value:
|
|
667
|
+
value: _chunkLBJFACLHcjs.formatFeeUsd.call(void 0, group.sponsoredUsd),
|
|
667
668
|
strike: true,
|
|
668
669
|
tooltip: sponsoredTooltip
|
|
669
670
|
});
|
|
@@ -872,7 +873,7 @@ function ProcessingStep({
|
|
|
872
873
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
873
874
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
874
875
|
const escalatedDelayRef = _react.useRef.call(void 0, false);
|
|
875
|
-
const processingContextRef =
|
|
876
|
+
const processingContextRef = _chunkLBJFACLHcjs.useLatestRef.call(void 0, {
|
|
876
877
|
amount,
|
|
877
878
|
sourceChain,
|
|
878
879
|
sourceToken,
|
|
@@ -881,10 +882,10 @@ function ProcessingStep({
|
|
|
881
882
|
targetChain,
|
|
882
883
|
targetToken
|
|
883
884
|
});
|
|
884
|
-
const onDepositCompleteRef =
|
|
885
|
-
const onDepositFailedRef =
|
|
886
|
-
const onErrorRef =
|
|
887
|
-
const explorerTxUrl =
|
|
885
|
+
const onDepositCompleteRef = _chunkLBJFACLHcjs.useLatestRef.call(void 0, onDepositComplete);
|
|
886
|
+
const onDepositFailedRef = _chunkLBJFACLHcjs.useLatestRef.call(void 0, onDepositFailed);
|
|
887
|
+
const onErrorRef = _chunkLBJFACLHcjs.useLatestRef.call(void 0, onError);
|
|
888
|
+
const explorerTxUrl = _chunkLBJFACLHcjs.useExplorerTxUrl.call(void 0, );
|
|
888
889
|
const initialTerminalEventRef = _react.useRef.call(void 0, null);
|
|
889
890
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
890
891
|
if (directTransfer) return { type: "complete" };
|
|
@@ -928,7 +929,7 @@ function ProcessingStep({
|
|
|
928
929
|
completedAt,
|
|
929
930
|
endedAt: completedAt
|
|
930
931
|
}));
|
|
931
|
-
|
|
932
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "direct-transfer:complete", {
|
|
932
933
|
txHash,
|
|
933
934
|
flowLabel
|
|
934
935
|
});
|
|
@@ -959,7 +960,7 @@ function ProcessingStep({
|
|
|
959
960
|
if (!outcome) return;
|
|
960
961
|
if (outcome.type === "complete") {
|
|
961
962
|
const context = processingContextRef.current;
|
|
962
|
-
|
|
963
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "initial-event:complete", {
|
|
963
964
|
txHash,
|
|
964
965
|
destinationTxHash: outcome.destinationTxHash,
|
|
965
966
|
event: event.type
|
|
@@ -975,7 +976,7 @@ function ProcessingStep({
|
|
|
975
976
|
})]);
|
|
976
977
|
return;
|
|
977
978
|
}
|
|
978
|
-
|
|
979
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "initial-event:failed", {
|
|
979
980
|
txHash,
|
|
980
981
|
message: outcome.message,
|
|
981
982
|
event: event.type
|
|
@@ -1081,7 +1082,7 @@ function ProcessingStep({
|
|
|
1081
1082
|
async function pollStatus() {
|
|
1082
1083
|
try {
|
|
1083
1084
|
const account = sourceChain === "solana" && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1084
|
-
|
|
1085
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "poll:request", {
|
|
1085
1086
|
account,
|
|
1086
1087
|
txHash,
|
|
1087
1088
|
intervalMs: pollIntervalRef.current
|
|
@@ -1092,7 +1093,7 @@ function ProcessingStep({
|
|
|
1092
1093
|
const eventForCurrentTx = eventMatchesTx ? lastEvent2 : void 0;
|
|
1093
1094
|
if (lastEvent2) {
|
|
1094
1095
|
const eventData = lastEvent2.data;
|
|
1095
|
-
|
|
1096
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "poll:event", {
|
|
1096
1097
|
type: lastEvent2.type,
|
|
1097
1098
|
matchesTx: eventMatchesTx,
|
|
1098
1099
|
intentId: _optionalChain([eventData, 'optionalAccess', _80 => _80.intentId])
|
|
@@ -1102,7 +1103,7 @@ function ProcessingStep({
|
|
|
1102
1103
|
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _81 => _81.type]) === "bridge-complete") {
|
|
1103
1104
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1104
1105
|
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _82 => _82.data, 'optionalAccess', _83 => _83.destination, 'optionalAccess', _84 => _84.transactionHash]);
|
|
1105
|
-
|
|
1106
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "state:complete", {
|
|
1106
1107
|
txHash,
|
|
1107
1108
|
destinationTxHash: destinationTxHash2,
|
|
1108
1109
|
event: eventForCurrentTx.type
|
|
@@ -1126,7 +1127,7 @@ function ProcessingStep({
|
|
|
1126
1127
|
message: formatted.message,
|
|
1127
1128
|
lastEvent: eventForCurrentTx
|
|
1128
1129
|
});
|
|
1129
|
-
|
|
1130
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "state:failed", {
|
|
1130
1131
|
txHash,
|
|
1131
1132
|
message: formatted.message,
|
|
1132
1133
|
code: formatted.code
|
|
@@ -1141,7 +1142,7 @@ function ProcessingStep({
|
|
|
1141
1142
|
message: errorMessage,
|
|
1142
1143
|
lastEvent: eventForCurrentTx
|
|
1143
1144
|
});
|
|
1144
|
-
|
|
1145
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "state:error-event", {
|
|
1145
1146
|
txHash,
|
|
1146
1147
|
message: errorMessage
|
|
1147
1148
|
});
|
|
@@ -1154,7 +1155,7 @@ function ProcessingStep({
|
|
|
1154
1155
|
}));
|
|
1155
1156
|
scheduleNextPoll();
|
|
1156
1157
|
} catch (error) {
|
|
1157
|
-
|
|
1158
|
+
_chunkLBJFACLHcjs.debugError.call(void 0, debug, "processing", "poll:failure", error, {
|
|
1158
1159
|
smartAccount,
|
|
1159
1160
|
txHash,
|
|
1160
1161
|
intervalMs: pollIntervalRef.current
|
|
@@ -1169,7 +1170,7 @@ function ProcessingStep({
|
|
|
1169
1170
|
pollIntervalRef.current * BACKOFF_MULTIPLIER,
|
|
1170
1171
|
MAX_POLL_INTERVAL
|
|
1171
1172
|
);
|
|
1172
|
-
|
|
1173
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "poll:scheduled", {
|
|
1173
1174
|
nextIntervalMs: pollIntervalRef.current
|
|
1174
1175
|
});
|
|
1175
1176
|
pollStatus();
|
|
@@ -1202,7 +1203,7 @@ function ProcessingStep({
|
|
|
1202
1203
|
escalatedDelayRef.current = true;
|
|
1203
1204
|
setHasEscalatedDelay(true);
|
|
1204
1205
|
const message = "Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.";
|
|
1205
|
-
|
|
1206
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "processing", "state:delay-escalated", {
|
|
1206
1207
|
txHash,
|
|
1207
1208
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1208
1209
|
});
|
|
@@ -1223,11 +1224,11 @@ function ProcessingStep({
|
|
|
1223
1224
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1224
1225
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
1225
1226
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
1226
|
-
const targetChainId =
|
|
1227
|
+
const targetChainId = _chunk4R2ZHSDQcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1227
1228
|
const sourceExplorerUrl = explorerTxUrl(displaySourceChain, txHash);
|
|
1228
1229
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
|
|
1229
1230
|
const sourceDisplay = (() => {
|
|
1230
|
-
const resolved =
|
|
1231
|
+
const resolved = _chunkLBJFACLHcjs.resolveTokenDisplay.call(void 0, displaySourceToken, displaySourceChain, {
|
|
1231
1232
|
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
1232
1233
|
decimals: providedSourceDecimals
|
|
1233
1234
|
});
|
|
@@ -1237,10 +1238,10 @@ function ProcessingStep({
|
|
|
1237
1238
|
};
|
|
1238
1239
|
})();
|
|
1239
1240
|
const sourceSymbol = sourceDisplay.symbol;
|
|
1240
|
-
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(
|
|
1241
|
-
|
|
1241
|
+
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(_chunkLBJFACLHcjs.formatRawTokenAmount.call(void 0, displayAmount, sourceDisplay), () => ( // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
1242
|
+
_chunkLBJFACLHcjs.formatTokenAmount.call(void 0, Number(displayAmount), sourceDisplay.symbol))), () => ( displayAmount));
|
|
1242
1243
|
const eventDestination = getEventDestinationDetails(lastEvent);
|
|
1243
|
-
const targetDisplay =
|
|
1244
|
+
const targetDisplay = _chunkLBJFACLHcjs.resolveTokenDisplay.call(void 0,
|
|
1244
1245
|
_nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
1245
1246
|
_nullishCoalesce(eventDestination.chainId, () => ( targetChainId)),
|
|
1246
1247
|
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
@@ -1248,7 +1249,7 @@ function ProcessingStep({
|
|
|
1248
1249
|
{ symbol: _nullishCoalesce(providedSourceSymbol, () => ( "USDC")) }
|
|
1249
1250
|
);
|
|
1250
1251
|
const targetSymbol = targetDisplay.symbol;
|
|
1251
|
-
const formattedDestinationAmount = eventDestination.amount !== void 0 ?
|
|
1252
|
+
const formattedDestinationAmount = eventDestination.amount !== void 0 ? _chunkLBJFACLHcjs.formatRawTokenAmount.call(void 0, eventDestination.amount, targetDisplay) : void 0;
|
|
1252
1253
|
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
1253
1254
|
const prices = useTokenPrices(service, [
|
|
1254
1255
|
{
|
|
@@ -1263,17 +1264,17 @@ function ProcessingStep({
|
|
|
1263
1264
|
}
|
|
1264
1265
|
]);
|
|
1265
1266
|
const estimatedReceiveAmount = (() => {
|
|
1266
|
-
const estimate =
|
|
1267
|
-
sourceAmount:
|
|
1267
|
+
const estimate = _chunkLBJFACLHcjs.estimateReceiveAmount.call(void 0, {
|
|
1268
|
+
sourceAmount: _chunkLBJFACLHcjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals),
|
|
1268
1269
|
sourceSymbol: sourceDisplay.symbol,
|
|
1269
1270
|
targetSymbol: targetDisplay.symbol,
|
|
1270
1271
|
sourceAmountUsd: amountUsdNumber,
|
|
1271
|
-
sourceTrusted:
|
|
1272
|
+
sourceTrusted: _chunkLBJFACLHcjs.isRecognizedToken.call(void 0, displaySourceToken, displaySourceChain),
|
|
1272
1273
|
prices
|
|
1273
1274
|
});
|
|
1274
|
-
return estimate !== void 0 ?
|
|
1275
|
+
return estimate !== void 0 ? _chunkLBJFACLHcjs.formatTokenAmount.call(void 0, estimate, targetDisplay.symbol) : void 0;
|
|
1275
1276
|
})();
|
|
1276
|
-
const quotedReceive = quote ?
|
|
1277
|
+
const quotedReceive = quote ? _chunkLBJFACLHcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol) : void 0;
|
|
1277
1278
|
const receiveDisplay = formattedDestinationAmount ? (
|
|
1278
1279
|
// The delivered amount, once the bridge reports it — actual, not an
|
|
1279
1280
|
// estimate, so it wins over the quote and carries no "~".
|
|
@@ -1287,12 +1288,12 @@ function ProcessingStep({
|
|
|
1287
1288
|
if (sourceSymbol.toUpperCase() !== targetSymbol.toUpperCase()) {
|
|
1288
1289
|
return void 0;
|
|
1289
1290
|
}
|
|
1290
|
-
const sentValue =
|
|
1291
|
-
const receivedValue = eventDestination.amount !== void 0 ?
|
|
1291
|
+
const sentValue = _chunkLBJFACLHcjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals);
|
|
1292
|
+
const receivedValue = eventDestination.amount !== void 0 ? _chunkLBJFACLHcjs.tokenAmountToNumber.call(void 0, eventDestination.amount, targetDisplay.decimals) : void 0;
|
|
1292
1293
|
if (sentValue === void 0 || receivedValue === void 0 || sentValue <= receivedValue) {
|
|
1293
1294
|
return void 0;
|
|
1294
1295
|
}
|
|
1295
|
-
const formatted =
|
|
1296
|
+
const formatted = _chunkLBJFACLHcjs.formatTokenAmount.call(void 0, sentValue - receivedValue, sourceSymbol);
|
|
1296
1297
|
if (formatted === void 0 || Number(formatted.replace(/,/g, "")) === 0) {
|
|
1297
1298
|
return void 0;
|
|
1298
1299
|
}
|
|
@@ -1304,10 +1305,10 @@ function ProcessingStep({
|
|
|
1304
1305
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
1305
1306
|
void delayPhaseId;
|
|
1306
1307
|
void hasEscalatedDelay;
|
|
1307
|
-
const sourceChainIcon =
|
|
1308
|
-
const targetChainIcon =
|
|
1309
|
-
const sourceChainName =
|
|
1310
|
-
const targetChainName =
|
|
1308
|
+
const sourceChainIcon = _chunk4R2ZHSDQcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
1309
|
+
const targetChainIcon = _chunk4R2ZHSDQcjs.getChainIcon.call(void 0, targetChainId);
|
|
1310
|
+
const sourceChainName = _chunk4R2ZHSDQcjs.getChainName.call(void 0, displaySourceChain);
|
|
1311
|
+
const targetChainName = _chunk4R2ZHSDQcjs.getChainName.call(void 0, targetChainId);
|
|
1311
1312
|
const timerText = formatTimer(elapsedSeconds);
|
|
1312
1313
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.feeSponsored]), () => ( false));
|
|
1313
1314
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
@@ -1319,7 +1320,7 @@ function ProcessingStep({
|
|
|
1319
1320
|
] }) : isFailed ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
1320
1321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FailedBadge, {}),
|
|
1321
1322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
1322
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1323
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.WalletIcon, {}), title: stateTitle });
|
|
1323
1324
|
if (isComplete && isSwappedOrder) {
|
|
1324
1325
|
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _102 => _102.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _103 => _103.paymentMethod]))), () => ( null));
|
|
1325
1326
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
@@ -1341,7 +1342,7 @@ function ProcessingStep({
|
|
|
1341
1342
|
if (onrampFeeUsd != null) {
|
|
1342
1343
|
feeRows.push({
|
|
1343
1344
|
label: "On-ramp fee",
|
|
1344
|
-
value:
|
|
1345
|
+
value: _chunkLBJFACLHcjs.formatFeeUsd.call(void 0, onrampFeeUsd)
|
|
1345
1346
|
});
|
|
1346
1347
|
}
|
|
1347
1348
|
const hasFallbackFee = quoteFeeRows.length === 0 && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount));
|
|
@@ -1350,13 +1351,13 @@ function ProcessingStep({
|
|
|
1350
1351
|
} else if (hasFallbackFee) {
|
|
1351
1352
|
feeRows.push({
|
|
1352
1353
|
label: "Network fee",
|
|
1353
|
-
value:
|
|
1354
|
+
value: _chunkLBJFACLHcjs.formatFeeUsd.call(void 0, Number(quotedFeeAmount)),
|
|
1354
1355
|
strike: feeSponsored,
|
|
1355
1356
|
tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
|
|
1356
1357
|
});
|
|
1357
1358
|
}
|
|
1358
1359
|
const fallbackChargeableUsd = hasFallbackFee && !feeSponsored ? Number(quotedFeeAmount) : 0;
|
|
1359
|
-
const feesTotal = feeRows.length > 0 ?
|
|
1360
|
+
const feesTotal = feeRows.length > 0 ? _chunkLBJFACLHcjs.formatFeeUsd.call(void 0,
|
|
1360
1361
|
(_nullishCoalesce(onrampFeeUsd, () => ( 0))) + chargeableUsd + fallbackChargeableUsd
|
|
1361
1362
|
) : null;
|
|
1362
1363
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1384,7 +1385,7 @@ function ProcessingStep({
|
|
|
1384
1385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1385
1386
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1386
1387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1387
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1388
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CdnIcon, { src: sourceChainIcon }) }),
|
|
1388
1389
|
sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1389
1390
|
"a",
|
|
1390
1391
|
{
|
|
@@ -1393,7 +1394,7 @@ function ProcessingStep({
|
|
|
1393
1394
|
rel: "noopener noreferrer",
|
|
1394
1395
|
className: "rs-review-detail-link",
|
|
1395
1396
|
"aria-label": "View source transaction",
|
|
1396
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1397
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.ExternalLinkIcon, {})
|
|
1397
1398
|
}
|
|
1398
1399
|
)
|
|
1399
1400
|
] })
|
|
@@ -1402,7 +1403,7 @@ function ProcessingStep({
|
|
|
1402
1403
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1403
1404
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1404
1405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1405
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1406
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.CdnIcon, { src: targetChainIcon }) }),
|
|
1406
1407
|
destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1407
1408
|
"a",
|
|
1408
1409
|
{
|
|
@@ -1411,7 +1412,7 @@ function ProcessingStep({
|
|
|
1411
1412
|
rel: "noopener noreferrer",
|
|
1412
1413
|
className: "rs-review-detail-link",
|
|
1413
1414
|
"aria-label": "View destination transaction",
|
|
1414
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1415
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.ExternalLinkIcon, {})
|
|
1415
1416
|
}
|
|
1416
1417
|
)
|
|
1417
1418
|
] })
|
|
@@ -1448,7 +1449,7 @@ function ProcessingStep({
|
|
|
1448
1449
|
" ",
|
|
1449
1450
|
sourceSymbol
|
|
1450
1451
|
] }),
|
|
1451
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1452
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1452
1453
|
] })
|
|
1453
1454
|
] })
|
|
1454
1455
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1459,14 +1460,14 @@ function ProcessingStep({
|
|
|
1459
1460
|
" ",
|
|
1460
1461
|
sourceSymbol
|
|
1461
1462
|
] }),
|
|
1462
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1463
1464
|
] })
|
|
1464
1465
|
] }),
|
|
1465
1466
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1466
1467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Receive" : "Received" }),
|
|
1467
1468
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1468
1469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1470
1471
|
] })
|
|
1471
1472
|
] }),
|
|
1472
1473
|
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1495,12 +1496,12 @@ function ProcessingStep({
|
|
|
1495
1496
|
{
|
|
1496
1497
|
className: "rs-review-detail-info",
|
|
1497
1498
|
"aria-label": "Fee info",
|
|
1498
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1499
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.InfoIcon, {})
|
|
1499
1500
|
}
|
|
1500
1501
|
) })
|
|
1501
1502
|
] })
|
|
1502
1503
|
] }) : (() => {
|
|
1503
|
-
const { display, struck } =
|
|
1504
|
+
const { display, struck } = _chunkLBJFACLHcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'optionalAccess', _112 => _112.fees]));
|
|
1504
1505
|
if (display !== null) {
|
|
1505
1506
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1506
1507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -1531,9 +1532,9 @@ function ProcessingStep({
|
|
|
1531
1532
|
] });
|
|
1532
1533
|
})()
|
|
1533
1534
|
] }),
|
|
1534
|
-
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1535
|
+
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Callout, { variant: "error", children: failureMessage }),
|
|
1535
1536
|
isProcessing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1536
|
-
|
|
1537
|
+
_chunkLBJFACLHcjs.Button,
|
|
1537
1538
|
{
|
|
1538
1539
|
fullWidth: true,
|
|
1539
1540
|
disabled: true,
|
|
@@ -1543,18 +1544,18 @@ function ProcessingStep({
|
|
|
1543
1544
|
}
|
|
1544
1545
|
),
|
|
1545
1546
|
isComplete && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1546
|
-
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1547
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLBJFACLHcjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
1547
1548
|
"New ",
|
|
1548
1549
|
flowNoun
|
|
1549
1550
|
] }),
|
|
1550
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1551
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
1551
1552
|
] }),
|
|
1552
1553
|
isFailed && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1553
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1554
|
-
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1554
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
1555
|
+
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
1555
1556
|
] })
|
|
1556
1557
|
] }),
|
|
1557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLBJFACLHcjs.PoweredBy, {})
|
|
1558
1559
|
] });
|
|
1559
1560
|
}
|
|
1560
1561
|
|
|
@@ -1585,13 +1586,13 @@ function normalizeKeyToken(value) {
|
|
|
1585
1586
|
}
|
|
1586
1587
|
var SOLANA_ADDRESS_PATTERN = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
1587
1588
|
function recipientMatchesTarget(recipient, targetChain) {
|
|
1588
|
-
return
|
|
1589
|
+
return _chunk4R2ZHSDQcjs.targetChainToCaip2.call(void 0, targetChain).startsWith("solana:") ? SOLANA_ADDRESS_PATTERN.test(recipient) : _viem.isAddress.call(void 0, recipient);
|
|
1589
1590
|
}
|
|
1590
1591
|
function deriveAccountSalt(input) {
|
|
1591
1592
|
return _viem.keccak256.call(void 0,
|
|
1592
1593
|
_viem.concat.call(void 0, [
|
|
1593
1594
|
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _nullishCoalesce(normalizeKeyToken(input.recipient), () => ( "")))),
|
|
1594
|
-
_viem.keccak256.call(void 0, _viem.toHex.call(void 0,
|
|
1595
|
+
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _chunk4R2ZHSDQcjs.targetChainToAccountKey.call(void 0, input.targetChain))),
|
|
1595
1596
|
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _nullishCoalesce(normalizeKeyToken(input.targetToken), () => ( ""))))
|
|
1596
1597
|
])
|
|
1597
1598
|
);
|
|
@@ -1645,7 +1646,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1645
1646
|
}
|
|
1646
1647
|
try {
|
|
1647
1648
|
const salt = deriveAccountSalt(input);
|
|
1648
|
-
|
|
1649
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
1649
1650
|
salt,
|
|
1650
1651
|
recipient: input.recipient,
|
|
1651
1652
|
targetChain: input.targetChain,
|
|
@@ -1654,7 +1655,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1654
1655
|
const result = await service.registerManagedAccount({
|
|
1655
1656
|
salt,
|
|
1656
1657
|
target: {
|
|
1657
|
-
chain:
|
|
1658
|
+
chain: _chunk4R2ZHSDQcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
1658
1659
|
token: input.targetToken,
|
|
1659
1660
|
recipient: input.recipient,
|
|
1660
1661
|
..._optionalChain([input, 'access', _114 => _114.outputTokenRules, 'optionalAccess', _115 => _115.length]) && {
|
|
@@ -1671,7 +1672,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1671
1672
|
cacheKey
|
|
1672
1673
|
};
|
|
1673
1674
|
} catch (error) {
|
|
1674
|
-
|
|
1675
|
+
_chunkLBJFACLHcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
1675
1676
|
recipient: input.recipient
|
|
1676
1677
|
});
|
|
1677
1678
|
if (error instanceof SetupError) throw error;
|
|
@@ -1682,7 +1683,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
1682
1683
|
const now = Date.now();
|
|
1683
1684
|
const existing = setupRequestDedupe.get(requestKey);
|
|
1684
1685
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
1685
|
-
|
|
1686
|
+
_chunkLBJFACLHcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
1686
1687
|
recipient: input.recipient,
|
|
1687
1688
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
1688
1689
|
});
|