@rhinestone/deposit-modal 0.9.1 → 0.11.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-JUJI7UHE.mjs → DepositModalReown-6RVLEM3B.mjs} +96 -26
- package/dist/{DepositModalReown-YQSO4SVY.cjs → DepositModalReown-TXTLVZIQ.cjs} +97 -27
- package/dist/caip-D8aRWdEY.d.cts +40 -0
- package/dist/caip-D8aRWdEY.d.ts +40 -0
- package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
- package/dist/{chunk-VQJHYWAE.cjs → chunk-7RNEYPI4.cjs} +836 -579
- package/dist/{chunk-ITFRTPGF.cjs → chunk-BLJMYCBF.cjs} +92 -90
- package/dist/{chunk-AYWEWI47.mjs → chunk-DYTRG4C7.mjs} +1 -1
- package/dist/{chunk-QGXAAFHU.mjs → chunk-G4FVZQOM.mjs} +23 -21
- package/dist/{chunk-SQOEHQNT.cjs → chunk-GWA6GFTI.cjs} +66 -63
- package/dist/{chunk-EEEQZOTJ.cjs → chunk-HCQWFL3A.cjs} +84 -101
- package/dist/{chunk-WUQZYQRK.mjs → chunk-ITAYM7SB.mjs} +784 -167
- package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
- package/dist/{chunk-EAUF7SGM.cjs → chunk-JYKMR6QI.cjs} +3 -3
- package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
- package/dist/{chunk-6U2H3R3T.cjs → chunk-NPSC5R22.cjs} +862 -245
- package/dist/{chunk-QLZ5RZTA.mjs → chunk-QRR3Y7EK.mjs} +1 -1
- package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
- package/dist/{chunk-N3OHR3T2.mjs → chunk-TRD2FCAR.mjs} +363 -106
- package/dist/{chunk-7OQO6JDC.mjs → chunk-VRNRRN2U.mjs} +12 -9
- package/dist/{chunk-GYEUZSQP.mjs → chunk-WLDTBKRA.mjs} +14 -31
- package/dist/{chunk-XJE5MRY4.cjs → chunk-XVKBCDZI.cjs} +1 -1
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -2
- package/dist/claim.d.ts +3 -2
- package/dist/claim.mjs +5 -5
- package/dist/{caip-523Zrc3r.d.cts → constants-FuzG3h4m.d.cts} +1 -18
- package/dist/{caip-523Zrc3r.d.ts → constants-FuzG3h4m.d.ts} +1 -18
- package/dist/constants.cjs +5 -3
- package/dist/constants.d.cts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.mjs +4 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +3 -2
- package/dist/deposit.d.ts +3 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +11 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +14 -0
- package/dist/{types-C0SGf-21.d.cts → types-C7wag_iL.d.cts} +4 -3
- package/dist/{types-C0SGf-21.d.ts → types-D4b6Cjox.d.ts} +4 -3
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +3 -2
- package/dist/withdraw.d.ts +3 -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 _chunkNPSC5R22cjs = require('./chunk-NPSC5R22.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
38
38
|
|
|
39
39
|
// src/core/removed-props.ts
|
|
40
40
|
var MANAGED_ACCOUNT_REMOVALS = {
|
|
@@ -99,10 +99,10 @@ function warnRemovedProps(component, props) {
|
|
|
99
99
|
// src/core/useTokenPrices.ts
|
|
100
100
|
var _react = require('react');
|
|
101
101
|
function isErc20(token) {
|
|
102
|
-
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !==
|
|
102
|
+
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !== _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
103
103
|
}
|
|
104
104
|
function caip2For(token) {
|
|
105
|
-
return `${
|
|
105
|
+
return `${_chunkTENL4H64cjs.toEvmCaip2.call(void 0, token.chainId)}:${token.address.toLowerCase()}`;
|
|
106
106
|
}
|
|
107
107
|
async function fetchTokenPriceUsd(service, token) {
|
|
108
108
|
if (isErc20(token)) {
|
|
@@ -275,7 +275,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
275
275
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-summary", children: [
|
|
276
276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-fees-accordion-label", children: [
|
|
277
277
|
/* @__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,
|
|
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, _chunkNPSC5R22cjs.InfoIcon, {}) }) })
|
|
279
279
|
] }),
|
|
280
280
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
281
281
|
"button",
|
|
@@ -293,7 +293,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
293
293
|
{
|
|
294
294
|
className: `rs-fees-accordion-chevron${open ? " rs-fees-accordion-chevron--open" : ""}`,
|
|
295
295
|
"aria-hidden": "true",
|
|
296
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
296
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, {})
|
|
297
297
|
}
|
|
298
298
|
)
|
|
299
299
|
]
|
|
@@ -315,7 +315,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
315
315
|
{
|
|
316
316
|
className: "rs-review-detail-info",
|
|
317
317
|
"aria-label": `${row.label} info`,
|
|
318
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
318
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.InfoIcon, {})
|
|
319
319
|
}
|
|
320
320
|
) })
|
|
321
321
|
] })
|
|
@@ -341,13 +341,13 @@ function SwappedReceipt({
|
|
|
341
341
|
}) {
|
|
342
342
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
343
343
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
344
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
344
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CheckIcon, {}), title: "Deposit successful" }),
|
|
345
345
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
346
346
|
onrampMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
347
347
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Onramp method" }),
|
|
348
348
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
349
349
|
/* @__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,
|
|
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, _chunkNPSC5R22cjs.CdnIcon, { src: onrampMethodIcon }) })
|
|
351
351
|
] })
|
|
352
352
|
] }),
|
|
353
353
|
amountPaid && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -358,7 +358,7 @@ function SwappedReceipt({
|
|
|
358
358
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Deposited amount" }),
|
|
359
359
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
360
360
|
/* @__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,
|
|
361
|
+
depositedSymbol && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: depositedSymbol }) })
|
|
362
362
|
] })
|
|
363
363
|
] }),
|
|
364
364
|
feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -371,11 +371,11 @@ function SwappedReceipt({
|
|
|
371
371
|
)
|
|
372
372
|
] }),
|
|
373
373
|
/* @__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,
|
|
374
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
375
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
376
376
|
] })
|
|
377
377
|
] }),
|
|
378
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
378
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
379
379
|
] });
|
|
380
380
|
}
|
|
381
381
|
SwappedReceipt.displayName = "SwappedReceipt";
|
|
@@ -394,7 +394,7 @@ var EXCHANGE_SLUGS = [
|
|
|
394
394
|
"kucoin"
|
|
395
395
|
];
|
|
396
396
|
var EXCHANGE_LOGO_SOURCES = Object.fromEntries(
|
|
397
|
-
EXCHANGE_SLUGS.map((slug) => [slug,
|
|
397
|
+
EXCHANGE_SLUGS.map((slug) => [slug, _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "exchanges", slug)])
|
|
398
398
|
);
|
|
399
399
|
var EXCHANGE_LOGO_ALIASES = {
|
|
400
400
|
gate: "gateio"
|
|
@@ -411,7 +411,7 @@ function getExchangeLogoSrc(name, connection) {
|
|
|
411
411
|
}
|
|
412
412
|
function getExchangeLogo(name, connection) {
|
|
413
413
|
const src = getExchangeLogoSrc(name, connection);
|
|
414
|
-
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src }) : null;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// src/core/webhook.ts
|
|
@@ -656,14 +656,14 @@ function buildQuoteFeeRows(breakdown, sponsoredTooltip) {
|
|
|
656
656
|
if (!breakdown) return { rows: [], chargeableUsd: 0 };
|
|
657
657
|
const rows = [];
|
|
658
658
|
let chargeableUsd = 0;
|
|
659
|
-
for (const group of
|
|
659
|
+
for (const group of _chunkNPSC5R22cjs.quoteFeeGroups.call(void 0, breakdown)) {
|
|
660
660
|
if (group.chargedUsd > 0) {
|
|
661
661
|
chargeableUsd += group.chargedUsd;
|
|
662
|
-
rows.push({ label: group.label, value:
|
|
662
|
+
rows.push({ label: group.label, value: _chunkNPSC5R22cjs.formatFeeUsd.call(void 0, group.chargedUsd) });
|
|
663
663
|
} else if (group.sponsoredUsd > 0) {
|
|
664
664
|
rows.push({
|
|
665
665
|
label: group.label,
|
|
666
|
-
value:
|
|
666
|
+
value: _chunkNPSC5R22cjs.formatFeeUsd.call(void 0, group.sponsoredUsd),
|
|
667
667
|
strike: true,
|
|
668
668
|
tooltip: sponsoredTooltip
|
|
669
669
|
});
|
|
@@ -872,7 +872,7 @@ function ProcessingStep({
|
|
|
872
872
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
873
873
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
874
874
|
const escalatedDelayRef = _react.useRef.call(void 0, false);
|
|
875
|
-
const processingContextRef =
|
|
875
|
+
const processingContextRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, {
|
|
876
876
|
amount,
|
|
877
877
|
sourceChain,
|
|
878
878
|
sourceToken,
|
|
@@ -881,9 +881,10 @@ function ProcessingStep({
|
|
|
881
881
|
targetChain,
|
|
882
882
|
targetToken
|
|
883
883
|
});
|
|
884
|
-
const onDepositCompleteRef =
|
|
885
|
-
const onDepositFailedRef =
|
|
886
|
-
const onErrorRef =
|
|
884
|
+
const onDepositCompleteRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
885
|
+
const onDepositFailedRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
886
|
+
const onErrorRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onError);
|
|
887
|
+
const explorerTxUrl = _chunkNPSC5R22cjs.useExplorerTxUrl.call(void 0, );
|
|
887
888
|
const initialTerminalEventRef = _react.useRef.call(void 0, null);
|
|
888
889
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
889
890
|
if (directTransfer) return { type: "complete" };
|
|
@@ -927,7 +928,7 @@ function ProcessingStep({
|
|
|
927
928
|
completedAt,
|
|
928
929
|
endedAt: completedAt
|
|
929
930
|
}));
|
|
930
|
-
|
|
931
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "direct-transfer:complete", {
|
|
931
932
|
txHash,
|
|
932
933
|
flowLabel
|
|
933
934
|
});
|
|
@@ -958,7 +959,7 @@ function ProcessingStep({
|
|
|
958
959
|
if (!outcome) return;
|
|
959
960
|
if (outcome.type === "complete") {
|
|
960
961
|
const context = processingContextRef.current;
|
|
961
|
-
|
|
962
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "initial-event:complete", {
|
|
962
963
|
txHash,
|
|
963
964
|
destinationTxHash: outcome.destinationTxHash,
|
|
964
965
|
event: event.type
|
|
@@ -974,7 +975,7 @@ function ProcessingStep({
|
|
|
974
975
|
})]);
|
|
975
976
|
return;
|
|
976
977
|
}
|
|
977
|
-
|
|
978
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "initial-event:failed", {
|
|
978
979
|
txHash,
|
|
979
980
|
message: outcome.message,
|
|
980
981
|
event: event.type
|
|
@@ -1080,7 +1081,7 @@ function ProcessingStep({
|
|
|
1080
1081
|
async function pollStatus() {
|
|
1081
1082
|
try {
|
|
1082
1083
|
const account = sourceChain === "solana" && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1083
|
-
|
|
1084
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "poll:request", {
|
|
1084
1085
|
account,
|
|
1085
1086
|
txHash,
|
|
1086
1087
|
intervalMs: pollIntervalRef.current
|
|
@@ -1091,7 +1092,7 @@ function ProcessingStep({
|
|
|
1091
1092
|
const eventForCurrentTx = eventMatchesTx ? lastEvent2 : void 0;
|
|
1092
1093
|
if (lastEvent2) {
|
|
1093
1094
|
const eventData = lastEvent2.data;
|
|
1094
|
-
|
|
1095
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "poll:event", {
|
|
1095
1096
|
type: lastEvent2.type,
|
|
1096
1097
|
matchesTx: eventMatchesTx,
|
|
1097
1098
|
intentId: _optionalChain([eventData, 'optionalAccess', _80 => _80.intentId])
|
|
@@ -1101,7 +1102,7 @@ function ProcessingStep({
|
|
|
1101
1102
|
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _81 => _81.type]) === "bridge-complete") {
|
|
1102
1103
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1103
1104
|
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _82 => _82.data, 'optionalAccess', _83 => _83.destination, 'optionalAccess', _84 => _84.transactionHash]);
|
|
1104
|
-
|
|
1105
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "state:complete", {
|
|
1105
1106
|
txHash,
|
|
1106
1107
|
destinationTxHash: destinationTxHash2,
|
|
1107
1108
|
event: eventForCurrentTx.type
|
|
@@ -1125,7 +1126,7 @@ function ProcessingStep({
|
|
|
1125
1126
|
message: formatted.message,
|
|
1126
1127
|
lastEvent: eventForCurrentTx
|
|
1127
1128
|
});
|
|
1128
|
-
|
|
1129
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "state:failed", {
|
|
1129
1130
|
txHash,
|
|
1130
1131
|
message: formatted.message,
|
|
1131
1132
|
code: formatted.code
|
|
@@ -1140,7 +1141,7 @@ function ProcessingStep({
|
|
|
1140
1141
|
message: errorMessage,
|
|
1141
1142
|
lastEvent: eventForCurrentTx
|
|
1142
1143
|
});
|
|
1143
|
-
|
|
1144
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "state:error-event", {
|
|
1144
1145
|
txHash,
|
|
1145
1146
|
message: errorMessage
|
|
1146
1147
|
});
|
|
@@ -1153,7 +1154,7 @@ function ProcessingStep({
|
|
|
1153
1154
|
}));
|
|
1154
1155
|
scheduleNextPoll();
|
|
1155
1156
|
} catch (error) {
|
|
1156
|
-
|
|
1157
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "processing", "poll:failure", error, {
|
|
1157
1158
|
smartAccount,
|
|
1158
1159
|
txHash,
|
|
1159
1160
|
intervalMs: pollIntervalRef.current
|
|
@@ -1168,7 +1169,7 @@ function ProcessingStep({
|
|
|
1168
1169
|
pollIntervalRef.current * BACKOFF_MULTIPLIER,
|
|
1169
1170
|
MAX_POLL_INTERVAL
|
|
1170
1171
|
);
|
|
1171
|
-
|
|
1172
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "poll:scheduled", {
|
|
1172
1173
|
nextIntervalMs: pollIntervalRef.current
|
|
1173
1174
|
});
|
|
1174
1175
|
pollStatus();
|
|
@@ -1201,7 +1202,7 @@ function ProcessingStep({
|
|
|
1201
1202
|
escalatedDelayRef.current = true;
|
|
1202
1203
|
setHasEscalatedDelay(true);
|
|
1203
1204
|
const message = "Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.";
|
|
1204
|
-
|
|
1205
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "processing", "state:delay-escalated", {
|
|
1205
1206
|
txHash,
|
|
1206
1207
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1207
1208
|
});
|
|
@@ -1222,10 +1223,11 @@ function ProcessingStep({
|
|
|
1222
1223
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1223
1224
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
1224
1225
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
1225
|
-
const
|
|
1226
|
-
const
|
|
1226
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1227
|
+
const sourceExplorerUrl = explorerTxUrl(displaySourceChain, txHash);
|
|
1228
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
|
|
1227
1229
|
const sourceDisplay = (() => {
|
|
1228
|
-
const resolved =
|
|
1230
|
+
const resolved = _chunkNPSC5R22cjs.resolveTokenDisplay.call(void 0, displaySourceToken, displaySourceChain, {
|
|
1229
1231
|
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
1230
1232
|
decimals: providedSourceDecimals
|
|
1231
1233
|
});
|
|
@@ -1235,18 +1237,18 @@ function ProcessingStep({
|
|
|
1235
1237
|
};
|
|
1236
1238
|
})();
|
|
1237
1239
|
const sourceSymbol = sourceDisplay.symbol;
|
|
1238
|
-
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(
|
|
1239
|
-
|
|
1240
|
+
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(_chunkNPSC5R22cjs.formatRawTokenAmount.call(void 0, displayAmount, sourceDisplay), () => ( // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
1241
|
+
_chunkNPSC5R22cjs.formatTokenAmount.call(void 0, Number(displayAmount), sourceDisplay.symbol))), () => ( displayAmount));
|
|
1240
1242
|
const eventDestination = getEventDestinationDetails(lastEvent);
|
|
1241
|
-
const targetDisplay =
|
|
1243
|
+
const targetDisplay = _chunkNPSC5R22cjs.resolveTokenDisplay.call(void 0,
|
|
1242
1244
|
_nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
1243
|
-
_nullishCoalesce(eventDestination.chainId, () => (
|
|
1245
|
+
_nullishCoalesce(eventDestination.chainId, () => ( targetChainId)),
|
|
1244
1246
|
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
1245
1247
|
// unresolvable same-token routes still label sensibly.
|
|
1246
1248
|
{ symbol: _nullishCoalesce(providedSourceSymbol, () => ( "USDC")) }
|
|
1247
1249
|
);
|
|
1248
1250
|
const targetSymbol = targetDisplay.symbol;
|
|
1249
|
-
const formattedDestinationAmount = eventDestination.amount !== void 0 ?
|
|
1251
|
+
const formattedDestinationAmount = eventDestination.amount !== void 0 ? _chunkNPSC5R22cjs.formatRawTokenAmount.call(void 0, eventDestination.amount, targetDisplay) : void 0;
|
|
1250
1252
|
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
1251
1253
|
const prices = useTokenPrices(service, [
|
|
1252
1254
|
{
|
|
@@ -1255,23 +1257,23 @@ function ProcessingStep({
|
|
|
1255
1257
|
symbol: sourceDisplay.symbol
|
|
1256
1258
|
},
|
|
1257
1259
|
{
|
|
1258
|
-
chainId: _nullishCoalesce(eventDestination.chainId, () => (
|
|
1260
|
+
chainId: _nullishCoalesce(eventDestination.chainId, () => ( targetChainId)),
|
|
1259
1261
|
address: _nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
1260
1262
|
symbol: targetDisplay.symbol
|
|
1261
1263
|
}
|
|
1262
1264
|
]);
|
|
1263
1265
|
const estimatedReceiveAmount = (() => {
|
|
1264
|
-
const estimate =
|
|
1265
|
-
sourceAmount:
|
|
1266
|
+
const estimate = _chunkNPSC5R22cjs.estimateReceiveAmount.call(void 0, {
|
|
1267
|
+
sourceAmount: _chunkNPSC5R22cjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals),
|
|
1266
1268
|
sourceSymbol: sourceDisplay.symbol,
|
|
1267
1269
|
targetSymbol: targetDisplay.symbol,
|
|
1268
1270
|
sourceAmountUsd: amountUsdNumber,
|
|
1269
|
-
sourceTrusted:
|
|
1271
|
+
sourceTrusted: _chunkNPSC5R22cjs.isRecognizedToken.call(void 0, displaySourceToken, displaySourceChain),
|
|
1270
1272
|
prices
|
|
1271
1273
|
});
|
|
1272
|
-
return estimate !== void 0 ?
|
|
1274
|
+
return estimate !== void 0 ? _chunkNPSC5R22cjs.formatTokenAmount.call(void 0, estimate, targetDisplay.symbol) : void 0;
|
|
1273
1275
|
})();
|
|
1274
|
-
const quotedReceive = quote ?
|
|
1276
|
+
const quotedReceive = quote ? _chunkNPSC5R22cjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol) : void 0;
|
|
1275
1277
|
const receiveDisplay = formattedDestinationAmount ? (
|
|
1276
1278
|
// The delivered amount, once the bridge reports it — actual, not an
|
|
1277
1279
|
// estimate, so it wins over the quote and carries no "~".
|
|
@@ -1285,12 +1287,12 @@ function ProcessingStep({
|
|
|
1285
1287
|
if (sourceSymbol.toUpperCase() !== targetSymbol.toUpperCase()) {
|
|
1286
1288
|
return void 0;
|
|
1287
1289
|
}
|
|
1288
|
-
const sentValue =
|
|
1289
|
-
const receivedValue = eventDestination.amount !== void 0 ?
|
|
1290
|
+
const sentValue = _chunkNPSC5R22cjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals);
|
|
1291
|
+
const receivedValue = eventDestination.amount !== void 0 ? _chunkNPSC5R22cjs.tokenAmountToNumber.call(void 0, eventDestination.amount, targetDisplay.decimals) : void 0;
|
|
1290
1292
|
if (sentValue === void 0 || receivedValue === void 0 || sentValue <= receivedValue) {
|
|
1291
1293
|
return void 0;
|
|
1292
1294
|
}
|
|
1293
|
-
const formatted =
|
|
1295
|
+
const formatted = _chunkNPSC5R22cjs.formatTokenAmount.call(void 0, sentValue - receivedValue, sourceSymbol);
|
|
1294
1296
|
if (formatted === void 0 || Number(formatted.replace(/,/g, "")) === 0) {
|
|
1295
1297
|
return void 0;
|
|
1296
1298
|
}
|
|
@@ -1302,10 +1304,10 @@ function ProcessingStep({
|
|
|
1302
1304
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
1303
1305
|
void delayPhaseId;
|
|
1304
1306
|
void hasEscalatedDelay;
|
|
1305
|
-
const sourceChainIcon =
|
|
1306
|
-
const targetChainIcon =
|
|
1307
|
-
const sourceChainName =
|
|
1308
|
-
const targetChainName =
|
|
1307
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, displaySourceChain);
|
|
1308
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId);
|
|
1309
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, displaySourceChain);
|
|
1310
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
1309
1311
|
const timerText = formatTimer(elapsedSeconds);
|
|
1310
1312
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.feeSponsored]), () => ( false));
|
|
1311
1313
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
@@ -1317,7 +1319,7 @@ function ProcessingStep({
|
|
|
1317
1319
|
] }) : isFailed ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
1318
1320
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FailedBadge, {}),
|
|
1319
1321
|
/* @__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 }) })
|
|
1320
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}), title: stateTitle });
|
|
1321
1323
|
if (isComplete && isSwappedOrder) {
|
|
1322
1324
|
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _102 => _102.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _103 => _103.paymentMethod]))), () => ( null));
|
|
1323
1325
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
@@ -1339,7 +1341,7 @@ function ProcessingStep({
|
|
|
1339
1341
|
if (onrampFeeUsd != null) {
|
|
1340
1342
|
feeRows.push({
|
|
1341
1343
|
label: "On-ramp fee",
|
|
1342
|
-
value:
|
|
1344
|
+
value: _chunkNPSC5R22cjs.formatFeeUsd.call(void 0, onrampFeeUsd)
|
|
1343
1345
|
});
|
|
1344
1346
|
}
|
|
1345
1347
|
const hasFallbackFee = quoteFeeRows.length === 0 && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount));
|
|
@@ -1348,13 +1350,13 @@ function ProcessingStep({
|
|
|
1348
1350
|
} else if (hasFallbackFee) {
|
|
1349
1351
|
feeRows.push({
|
|
1350
1352
|
label: "Network fee",
|
|
1351
|
-
value:
|
|
1353
|
+
value: _chunkNPSC5R22cjs.formatFeeUsd.call(void 0, Number(quotedFeeAmount)),
|
|
1352
1354
|
strike: feeSponsored,
|
|
1353
1355
|
tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
|
|
1354
1356
|
});
|
|
1355
1357
|
}
|
|
1356
1358
|
const fallbackChargeableUsd = hasFallbackFee && !feeSponsored ? Number(quotedFeeAmount) : 0;
|
|
1357
|
-
const feesTotal = feeRows.length > 0 ?
|
|
1359
|
+
const feesTotal = feeRows.length > 0 ? _chunkNPSC5R22cjs.formatFeeUsd.call(void 0,
|
|
1358
1360
|
(_nullishCoalesce(onrampFeeUsd, () => ( 0))) + chargeableUsd + fallbackChargeableUsd
|
|
1359
1361
|
) : null;
|
|
1360
1362
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1382,7 +1384,7 @@ function ProcessingStep({
|
|
|
1382
1384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1383
1385
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1384
1386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1385
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1387
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) }),
|
|
1386
1388
|
sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1387
1389
|
"a",
|
|
1388
1390
|
{
|
|
@@ -1391,7 +1393,7 @@ function ProcessingStep({
|
|
|
1391
1393
|
rel: "noopener noreferrer",
|
|
1392
1394
|
className: "rs-review-detail-link",
|
|
1393
1395
|
"aria-label": "View source transaction",
|
|
1394
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1396
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ExternalLinkIcon, {})
|
|
1395
1397
|
}
|
|
1396
1398
|
)
|
|
1397
1399
|
] })
|
|
@@ -1400,7 +1402,7 @@ function ProcessingStep({
|
|
|
1400
1402
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1401
1403
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1402
1404
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1403
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1405
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: targetChainIcon }) }),
|
|
1404
1406
|
destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1405
1407
|
"a",
|
|
1406
1408
|
{
|
|
@@ -1409,7 +1411,7 @@ function ProcessingStep({
|
|
|
1409
1411
|
rel: "noopener noreferrer",
|
|
1410
1412
|
className: "rs-review-detail-link",
|
|
1411
1413
|
"aria-label": "View destination transaction",
|
|
1412
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1414
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ExternalLinkIcon, {})
|
|
1413
1415
|
}
|
|
1414
1416
|
)
|
|
1415
1417
|
] })
|
|
@@ -1446,7 +1448,7 @@ function ProcessingStep({
|
|
|
1446
1448
|
" ",
|
|
1447
1449
|
sourceSymbol
|
|
1448
1450
|
] }),
|
|
1449
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1451
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1450
1452
|
] })
|
|
1451
1453
|
] })
|
|
1452
1454
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1457,14 +1459,14 @@ function ProcessingStep({
|
|
|
1457
1459
|
" ",
|
|
1458
1460
|
sourceSymbol
|
|
1459
1461
|
] }),
|
|
1460
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1462
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1461
1463
|
] })
|
|
1462
1464
|
] }),
|
|
1463
1465
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1464
1466
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Receive" : "Received" }),
|
|
1465
1467
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1466
1468
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1467
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1468
1470
|
] })
|
|
1469
1471
|
] }),
|
|
1470
1472
|
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1493,12 +1495,12 @@ function ProcessingStep({
|
|
|
1493
1495
|
{
|
|
1494
1496
|
className: "rs-review-detail-info",
|
|
1495
1497
|
"aria-label": "Fee info",
|
|
1496
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1498
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.InfoIcon, {})
|
|
1497
1499
|
}
|
|
1498
1500
|
) })
|
|
1499
1501
|
] })
|
|
1500
1502
|
] }) : (() => {
|
|
1501
|
-
const { display, struck } =
|
|
1503
|
+
const { display, struck } = _chunkNPSC5R22cjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'optionalAccess', _112 => _112.fees]));
|
|
1502
1504
|
if (display !== null) {
|
|
1503
1505
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1504
1506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -1529,9 +1531,9 @@ function ProcessingStep({
|
|
|
1529
1531
|
] });
|
|
1530
1532
|
})()
|
|
1531
1533
|
] }),
|
|
1532
|
-
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
+
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: failureMessage }),
|
|
1533
1535
|
isProcessing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
-
|
|
1536
|
+
_chunkNPSC5R22cjs.Button,
|
|
1535
1537
|
{
|
|
1536
1538
|
fullWidth: true,
|
|
1537
1539
|
disabled: true,
|
|
@@ -1541,41 +1543,23 @@ function ProcessingStep({
|
|
|
1541
1543
|
}
|
|
1542
1544
|
),
|
|
1543
1545
|
isComplete && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1544
|
-
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1546
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkNPSC5R22cjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
1545
1547
|
"New ",
|
|
1546
1548
|
flowNoun
|
|
1547
1549
|
] }),
|
|
1548
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1550
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
1549
1551
|
] }),
|
|
1550
1552
|
isFailed && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1551
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1552
|
-
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1553
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
1554
|
+
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
1553
1555
|
] })
|
|
1554
1556
|
] }),
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
1556
1558
|
] });
|
|
1557
1559
|
}
|
|
1558
1560
|
|
|
1559
|
-
// src/core/public-client.ts
|
|
1560
|
-
var _viem = require('viem');
|
|
1561
|
-
var clientCache = /* @__PURE__ */ new Map();
|
|
1562
|
-
function getPublicClient(chainId, rpcUrls) {
|
|
1563
|
-
const url = _chunk6U2H3R3Tcjs.rpcUrlFor.call(void 0, rpcUrls, chainId);
|
|
1564
|
-
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1565
|
-
let client = clientCache.get(cacheKey);
|
|
1566
|
-
if (!client) {
|
|
1567
|
-
const chain = _chunkH577RJN5cjs.CHAIN_BY_ID[chainId];
|
|
1568
|
-
client = _viem.createPublicClient.call(void 0, {
|
|
1569
|
-
chain,
|
|
1570
|
-
transport: _viem.http.call(void 0, url)
|
|
1571
|
-
});
|
|
1572
|
-
clientCache.set(cacheKey, client);
|
|
1573
|
-
}
|
|
1574
|
-
return client;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
1561
|
// src/core/account-setup.ts
|
|
1578
|
-
|
|
1562
|
+
var _viem = require('viem');
|
|
1579
1563
|
var SetupError = class extends Error {
|
|
1580
1564
|
constructor(message, category) {
|
|
1581
1565
|
super(message);
|
|
@@ -1601,13 +1585,13 @@ function normalizeKeyToken(value) {
|
|
|
1601
1585
|
}
|
|
1602
1586
|
var SOLANA_ADDRESS_PATTERN = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
1603
1587
|
function recipientMatchesTarget(recipient, targetChain) {
|
|
1604
|
-
return
|
|
1588
|
+
return _chunkTENL4H64cjs.targetChainToCaip2.call(void 0, targetChain).startsWith("solana:") ? SOLANA_ADDRESS_PATTERN.test(recipient) : _viem.isAddress.call(void 0, recipient);
|
|
1605
1589
|
}
|
|
1606
1590
|
function deriveAccountSalt(input) {
|
|
1607
1591
|
return _viem.keccak256.call(void 0,
|
|
1608
1592
|
_viem.concat.call(void 0, [
|
|
1609
1593
|
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _nullishCoalesce(normalizeKeyToken(input.recipient), () => ( "")))),
|
|
1610
|
-
_viem.keccak256.call(void 0, _viem.toHex.call(void 0,
|
|
1594
|
+
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _chunkTENL4H64cjs.targetChainToAccountKey.call(void 0, input.targetChain))),
|
|
1611
1595
|
_viem.keccak256.call(void 0, _viem.toHex.call(void 0, _nullishCoalesce(normalizeKeyToken(input.targetToken), () => ( ""))))
|
|
1612
1596
|
])
|
|
1613
1597
|
);
|
|
@@ -1661,7 +1645,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1661
1645
|
}
|
|
1662
1646
|
try {
|
|
1663
1647
|
const salt = deriveAccountSalt(input);
|
|
1664
|
-
|
|
1648
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
1665
1649
|
salt,
|
|
1666
1650
|
recipient: input.recipient,
|
|
1667
1651
|
targetChain: input.targetChain,
|
|
@@ -1670,7 +1654,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1670
1654
|
const result = await service.registerManagedAccount({
|
|
1671
1655
|
salt,
|
|
1672
1656
|
target: {
|
|
1673
|
-
chain:
|
|
1657
|
+
chain: _chunkTENL4H64cjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
1674
1658
|
token: input.targetToken,
|
|
1675
1659
|
recipient: input.recipient,
|
|
1676
1660
|
..._optionalChain([input, 'access', _114 => _114.outputTokenRules, 'optionalAccess', _115 => _115.length]) && {
|
|
@@ -1687,7 +1671,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1687
1671
|
cacheKey
|
|
1688
1672
|
};
|
|
1689
1673
|
} catch (error) {
|
|
1690
|
-
|
|
1674
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
1691
1675
|
recipient: input.recipient
|
|
1692
1676
|
});
|
|
1693
1677
|
if (error instanceof SetupError) throw error;
|
|
@@ -1698,7 +1682,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
1698
1682
|
const now = Date.now();
|
|
1699
1683
|
const existing = setupRequestDedupe.get(requestKey);
|
|
1700
1684
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
1701
|
-
|
|
1685
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
1702
1686
|
recipient: input.recipient,
|
|
1703
1687
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
1704
1688
|
});
|
|
@@ -1781,5 +1765,4 @@ function mapError(error) {
|
|
|
1781
1765
|
|
|
1782
1766
|
|
|
1783
1767
|
|
|
1784
|
-
|
|
1785
|
-
exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.fetchTokenPriceUsd = fetchTokenPriceUsd; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.SetupError = SetupError; exports.deriveAccountSalt = deriveAccountSalt; exports.computeRequestKey = computeRequestKey; exports.computeCacheKey = computeCacheKey; exports.computeIsCacheable = computeIsCacheable; exports.readDedupedAccountSetupResult = readDedupedAccountSetupResult; exports.runAccountSetupDeduped = runAccountSetupDeduped; exports.warnRemovedProps = warnRemovedProps;
|
|
1768
|
+
exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.fetchTokenPriceUsd = fetchTokenPriceUsd; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.SetupError = SetupError; exports.deriveAccountSalt = deriveAccountSalt; exports.computeRequestKey = computeRequestKey; exports.computeCacheKey = computeCacheKey; exports.computeIsCacheable = computeIsCacheable; exports.readDedupedAccountSetupResult = readDedupedAccountSetupResult; exports.runAccountSetupDeduped = runAccountSetupDeduped; exports.warnRemovedProps = warnRemovedProps;
|