@rhinestone/deposit-modal 0.13.0 → 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 +43 -2
- package/bridge-transcript.json +653 -0
- package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
- package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
- package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-46LPVFB6.cjs} +16 -15
- package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-Q2JMLT47.mjs} +6 -5
- package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
- package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
- package/dist/{chunk-GACIGCSN.cjs → chunk-6KG642KH.cjs} +1 -1
- package/dist/{chunk-RAADLTSW.cjs → chunk-7ICSHJFE.cjs} +179 -138
- package/dist/{chunk-COCBCQQC.mjs → chunk-7SR7ENVJ.mjs} +46 -5
- package/dist/{chunk-OLCD75JK.mjs → chunk-CFKC77SV.mjs} +451 -131
- package/dist/{chunk-EOMT5LKX.mjs → chunk-IN77XSWO.mjs} +526 -3
- package/dist/{chunk-FZ5FZFIG.mjs → chunk-K4H6TGBE.mjs} +1 -1
- package/dist/{chunk-DSIZNRWA.mjs → chunk-KTUVSKR4.mjs} +979 -360
- package/dist/{chunk-HOGZKHHY.cjs → chunk-LZFRL2AL.cjs} +3 -3
- package/dist/{chunk-7N77GIP4.cjs → chunk-MTFJSE52.cjs} +465 -171
- package/dist/{chunk-LTMMETAB.mjs → chunk-PKML3XVS.mjs} +404 -110
- package/dist/{chunk-ZMT4ATHR.cjs → chunk-V2OBGLJD.cjs} +564 -41
- package/dist/{chunk-XYJFEN5D.mjs → chunk-WUJIKCFU.mjs} +1 -1
- package/dist/{chunk-CVGNCUVU.cjs → chunk-X2IPAPXU.cjs} +22 -13
- package/dist/{chunk-2G2EIN4A.cjs → chunk-YCQZJQO6.cjs} +1272 -653
- package/dist/{chunk-5NUIKYSF.cjs → chunk-YWMWI7PZ.cjs} +458 -138
- package/dist/{chunk-YREVFB64.mjs → chunk-ZEO6ADM3.mjs} +16 -7
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/embed.cjs +310 -102
- package/dist/embed.d.cts +7 -1
- package/dist/embed.d.ts +7 -1
- package/dist/embed.mjs +285 -77
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -8
- package/dist/types-Bho4OA03.d.ts +982 -0
- package/dist/types-DP_3KwlD.d.cts +982 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +4 -4
- package/package.json +28 -7
- package/dist/ClaimModal-CREZO27I.mjs +0 -11
- package/dist/ClaimModal-JRIA32U2.cjs +0 -11
- package/dist/WithdrawModal-NVRX44IZ.mjs +0 -10
- package/dist/WithdrawModal-YYSBPCJJ.cjs +0 -10
- package/dist/types-B89I8_8H.d.ts +0 -638
- package/dist/types-nnDR4tqA.d.cts +0 -638
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -97,6 +97,32 @@ function warnRemovedProps(component, props) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
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;
|
|
110
|
+
}
|
|
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;
|
|
115
|
+
}
|
|
116
|
+
return _chunk4KCSH4T3cjs.targetChainToCaip2.call(void 0, targetChain);
|
|
117
|
+
}
|
|
118
|
+
function resolveToken(targetToken) {
|
|
119
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]);
|
|
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
|
+
|
|
100
126
|
// src/core/submission-uncertainty.ts
|
|
101
127
|
var MARKER = "__rhinestoneSubmissionUncertain";
|
|
102
128
|
function markSubmissionUncertain(error) {
|
|
@@ -148,8 +174,8 @@ function Tooltip({ content, children, className }) {
|
|
|
148
174
|
function handleOutside(event) {
|
|
149
175
|
const target = event.target;
|
|
150
176
|
if (!target) return;
|
|
151
|
-
if (_optionalChain([triggerRef, 'access',
|
|
152
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
177
|
+
if (_optionalChain([triggerRef, 'access', _3 => _3.current, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(target)])) return;
|
|
178
|
+
if (_optionalChain([bubbleRef, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.contains, 'call', _8 => _8(target)])) return;
|
|
153
179
|
setOpen(false);
|
|
154
180
|
}
|
|
155
181
|
function handleKey(event) {
|
|
@@ -226,7 +252,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
226
252
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-summary", children: [
|
|
227
253
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-fees-accordion-label", children: [
|
|
228
254
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
229
|
-
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,
|
|
255
|
+
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, _chunkV2OBGLJDcjs.InfoIcon, {}) }) })
|
|
230
256
|
] }),
|
|
231
257
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
232
258
|
"button",
|
|
@@ -244,7 +270,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
244
270
|
{
|
|
245
271
|
className: `rs-fees-accordion-chevron${open ? " rs-fees-accordion-chevron--open" : ""}`,
|
|
246
272
|
"aria-hidden": "true",
|
|
247
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
273
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, {})
|
|
248
274
|
}
|
|
249
275
|
)
|
|
250
276
|
]
|
|
@@ -266,7 +292,7 @@ function FeesAccordion({ total, rows, tooltip }) {
|
|
|
266
292
|
{
|
|
267
293
|
className: "rs-review-detail-info",
|
|
268
294
|
"aria-label": `${row.label} info`,
|
|
269
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
295
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.InfoIcon, {})
|
|
270
296
|
}
|
|
271
297
|
) })
|
|
272
298
|
] })
|
|
@@ -292,13 +318,13 @@ function SwappedReceipt({
|
|
|
292
318
|
}) {
|
|
293
319
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
294
320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CheckIcon, {}), title: "Deposit successful" }),
|
|
296
322
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
297
323
|
onrampMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
298
324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Onramp method" }),
|
|
299
325
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
300
326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: onrampMethod }),
|
|
301
|
-
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,
|
|
327
|
+
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, _chunkV2OBGLJDcjs.CdnIcon, { src: onrampMethodIcon }) })
|
|
302
328
|
] })
|
|
303
329
|
] }),
|
|
304
330
|
amountPaid && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -309,7 +335,7 @@ function SwappedReceipt({
|
|
|
309
335
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Deposited amount" }),
|
|
310
336
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
311
337
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: depositedAmount }),
|
|
312
|
-
depositedSymbol && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
338
|
+
depositedSymbol && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: depositedSymbol }) })
|
|
313
339
|
] })
|
|
314
340
|
] }),
|
|
315
341
|
feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -322,11 +348,11 @@ function SwappedReceipt({
|
|
|
322
348
|
)
|
|
323
349
|
] }),
|
|
324
350
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
325
|
-
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
326
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
352
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
327
353
|
] })
|
|
328
354
|
] }),
|
|
329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
330
356
|
] });
|
|
331
357
|
}
|
|
332
358
|
SwappedReceipt.displayName = "SwappedReceipt";
|
|
@@ -362,7 +388,7 @@ function getExchangeLogoSrc(name, connection) {
|
|
|
362
388
|
}
|
|
363
389
|
function getExchangeLogo(name, connection) {
|
|
364
390
|
const src = getExchangeLogoSrc(name, connection);
|
|
365
|
-
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
391
|
+
return src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src }) : null;
|
|
366
392
|
}
|
|
367
393
|
|
|
368
394
|
// src/core/webhook.ts
|
|
@@ -378,7 +404,7 @@ function asNumber(value) {
|
|
|
378
404
|
const trimmed = value.trim();
|
|
379
405
|
if (!trimmed) return void 0;
|
|
380
406
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
381
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
407
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _9 => _9[1]])) {
|
|
382
408
|
const parsed2 = Number(caipMatch[1]);
|
|
383
409
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
384
410
|
}
|
|
@@ -397,24 +423,24 @@ function asAddress(value) {
|
|
|
397
423
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
398
424
|
}
|
|
399
425
|
function getEventTxHash(event) {
|
|
400
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
426
|
+
if (!_optionalChain([event, 'optionalAccess', _10 => _10.type])) return void 0;
|
|
401
427
|
if (event.type === "deposit-received") {
|
|
402
|
-
return asString(_optionalChain([event, 'access',
|
|
428
|
+
return asString(_optionalChain([event, 'access', _11 => _11.data, 'optionalAccess', _12 => _12.transactionHash]));
|
|
403
429
|
}
|
|
404
430
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
405
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
406
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
407
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
431
|
+
const deposit = isRecord(_optionalChain([event, 'access', _13 => _13.data, 'optionalAccess', _14 => _14.deposit])) ? event.data.deposit : void 0;
|
|
432
|
+
const source = isRecord(_optionalChain([event, 'access', _15 => _15.data, 'optionalAccess', _16 => _16.source])) ? event.data.source : void 0;
|
|
433
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _17 => _17.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _18 => _18.transactionHash]))));
|
|
408
434
|
}
|
|
409
435
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
410
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
411
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
412
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
436
|
+
const deposit = isRecord(_optionalChain([event, 'access', _19 => _19.data, 'optionalAccess', _20 => _20.deposit])) ? event.data.deposit : void 0;
|
|
437
|
+
const source = isRecord(_optionalChain([event, 'access', _21 => _21.data, 'optionalAccess', _22 => _22.source])) ? event.data.source : void 0;
|
|
438
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _23 => _23.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _24 => _24.transactionHash]))));
|
|
413
439
|
}
|
|
414
440
|
return void 0;
|
|
415
441
|
}
|
|
416
442
|
function getEventSourceDetails(event) {
|
|
417
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
443
|
+
if (!_optionalChain([event, 'optionalAccess', _25 => _25.type]) || !isRecord(event.data)) return {};
|
|
418
444
|
if (event.type === "deposit-received") {
|
|
419
445
|
return {
|
|
420
446
|
chainId: asNumber(event.data.chain),
|
|
@@ -426,9 +452,9 @@ function getEventSourceDetails(event) {
|
|
|
426
452
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
427
453
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
428
454
|
return {
|
|
429
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
430
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
431
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
455
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _26 => _26.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _27 => _27.chain])))),
|
|
456
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _28 => _28.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _29 => _29.amount])))),
|
|
457
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _30 => _30.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _31 => _31.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _32 => _32.token]))))
|
|
432
458
|
};
|
|
433
459
|
}
|
|
434
460
|
return {};
|
|
@@ -442,7 +468,7 @@ function asChain(value) {
|
|
|
442
468
|
return asNumber(value);
|
|
443
469
|
}
|
|
444
470
|
function getEventDestinationDetails(event) {
|
|
445
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
471
|
+
if (!_optionalChain([event, 'optionalAccess', _33 => _33.type]) || !isRecord(event.data)) return {};
|
|
446
472
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
447
473
|
return {};
|
|
448
474
|
}
|
|
@@ -452,14 +478,14 @@ function getEventDestinationDetails(event) {
|
|
|
452
478
|
return {
|
|
453
479
|
chainId: asChain(destination.chain),
|
|
454
480
|
amount: asAmount(destination.amount),
|
|
455
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
481
|
+
token: _optionalChain([token, 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]) || void 0
|
|
456
482
|
};
|
|
457
483
|
}
|
|
458
484
|
function isDepositEvent(event) {
|
|
459
|
-
return _optionalChain([event, 'optionalAccess',
|
|
485
|
+
return _optionalChain([event, 'optionalAccess', _36 => _36.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _37 => _37.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _38 => _38.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _39 => _39.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _40 => _40.type]) === "error";
|
|
460
486
|
}
|
|
461
487
|
function isFailedEvent(event) {
|
|
462
|
-
return _optionalChain([event, 'optionalAccess',
|
|
488
|
+
return _optionalChain([event, 'optionalAccess', _41 => _41.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _42 => _42.type]) === "error";
|
|
463
489
|
}
|
|
464
490
|
function isHexString(value) {
|
|
465
491
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -471,7 +497,7 @@ function txRefsMatch(a, b) {
|
|
|
471
497
|
return a === b;
|
|
472
498
|
}
|
|
473
499
|
function formatBridgeFailedMessage(event) {
|
|
474
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
500
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _43 => _43.data]), () => ( {}));
|
|
475
501
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
476
502
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
477
503
|
function toUserFacingFailure(raw) {
|
|
@@ -499,7 +525,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
499
525
|
return { message: "Bridge failed" };
|
|
500
526
|
}
|
|
501
527
|
function failureMessageForEvent(event) {
|
|
502
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
528
|
+
if (_optionalChain([event, 'optionalAccess', _44 => _44.type]) === "error") {
|
|
503
529
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
504
530
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
505
531
|
}
|
|
@@ -538,7 +564,7 @@ async function fetchTokenPriceUsd(service, token) {
|
|
|
538
564
|
}
|
|
539
565
|
function useTokenPrices(service, tokens) {
|
|
540
566
|
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
541
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
567
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _45 => _45.symbol])));
|
|
542
568
|
const entries = [
|
|
543
569
|
...new Map(
|
|
544
570
|
defined.flatMap((token) => {
|
|
@@ -671,14 +697,14 @@ function buildQuoteFeeRows(breakdown, sponsoredTooltip) {
|
|
|
671
697
|
if (!breakdown) return { rows: [], chargeableUsd: 0 };
|
|
672
698
|
const rows = [];
|
|
673
699
|
let chargeableUsd = 0;
|
|
674
|
-
for (const group of
|
|
700
|
+
for (const group of _chunkV2OBGLJDcjs.quoteFeeGroups.call(void 0, breakdown)) {
|
|
675
701
|
if (group.chargedUsd > 0) {
|
|
676
702
|
chargeableUsd += group.chargedUsd;
|
|
677
|
-
rows.push({ label: group.label, value:
|
|
703
|
+
rows.push({ label: group.label, value: _chunkV2OBGLJDcjs.formatFeeUsd.call(void 0, group.chargedUsd) });
|
|
678
704
|
} else if (group.sponsoredUsd > 0) {
|
|
679
705
|
rows.push({
|
|
680
706
|
label: group.label,
|
|
681
|
-
value:
|
|
707
|
+
value: _chunkV2OBGLJDcjs.formatFeeUsd.call(void 0, group.sponsoredUsd),
|
|
682
708
|
strike: true,
|
|
683
709
|
tooltip: sponsoredTooltip
|
|
684
710
|
});
|
|
@@ -727,12 +753,12 @@ function isEventForTx(event, txHash) {
|
|
|
727
753
|
return txRefsMatch(eventTxHash, txHash);
|
|
728
754
|
}
|
|
729
755
|
function parseWebhookTimestamp(event) {
|
|
730
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
756
|
+
if (typeof _optionalChain([event, 'optionalAccess', _46 => _46.time]) !== "string") return void 0;
|
|
731
757
|
const timestamp = Date.parse(event.time);
|
|
732
758
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
733
759
|
}
|
|
734
760
|
function syncPhaseTimings(previous, event) {
|
|
735
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
761
|
+
if (!_optionalChain([event, 'optionalAccess', _47 => _47.type])) return previous;
|
|
736
762
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
737
763
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
738
764
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -794,46 +820,46 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
794
820
|
if (state.type === "complete") {
|
|
795
821
|
return void 0;
|
|
796
822
|
}
|
|
797
|
-
if (_optionalChain([state, 'access',
|
|
823
|
+
if (_optionalChain([state, 'access', _48 => _48.lastEvent, 'optionalAccess', _49 => _49.type]) === "bridge-started" || _optionalChain([state, 'access', _50 => _50.lastEvent, 'optionalAccess', _51 => _51.type]) === "bridge-complete")
|
|
798
824
|
return "bridging";
|
|
799
|
-
if (_optionalChain([state, 'access',
|
|
825
|
+
if (_optionalChain([state, 'access', _52 => _52.lastEvent, 'optionalAccess', _53 => _53.type]) === "deposit-received") return "received";
|
|
800
826
|
return "confirming";
|
|
801
827
|
}
|
|
802
828
|
function getCompletionDestinationTxHash(event) {
|
|
803
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
804
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
805
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
829
|
+
const eventData = _optionalChain([event, 'optionalAccess', _54 => _54.data]);
|
|
830
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _55 => _55.swap, 'optionalAccess', _56 => _56.transactionHash]);
|
|
831
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _57 => _57.destination, 'optionalAccess', _58 => _58.transactionHash]);
|
|
806
832
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
807
833
|
}
|
|
808
834
|
function getTerminalProcessingOutcome(event) {
|
|
809
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
835
|
+
if (_optionalChain([event, 'optionalAccess', _59 => _59.type]) === "post-bridge-swap-complete") {
|
|
810
836
|
return {
|
|
811
837
|
type: "complete",
|
|
812
838
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
813
839
|
};
|
|
814
840
|
}
|
|
815
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
841
|
+
if (_optionalChain([event, 'optionalAccess', _60 => _60.type]) === "post-bridge-swap-failed") {
|
|
816
842
|
return {
|
|
817
843
|
type: "failed",
|
|
818
844
|
message: formatBridgeFailedMessage(event).message
|
|
819
845
|
};
|
|
820
846
|
}
|
|
821
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
847
|
+
if (_optionalChain([event, 'optionalAccess', _61 => _61.type]) === "bridge-complete") {
|
|
822
848
|
return {
|
|
823
849
|
type: "complete",
|
|
824
850
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
825
851
|
};
|
|
826
852
|
}
|
|
827
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
853
|
+
if (_optionalChain([event, 'optionalAccess', _62 => _62.type]) === "bridge-failed") {
|
|
828
854
|
return {
|
|
829
855
|
type: "failed",
|
|
830
856
|
message: formatBridgeFailedMessage(event).message
|
|
831
857
|
};
|
|
832
858
|
}
|
|
833
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
859
|
+
if (_optionalChain([event, 'optionalAccess', _63 => _63.type]) === "error") {
|
|
834
860
|
return {
|
|
835
861
|
type: "failed",
|
|
836
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
862
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _64 => _64.data, 'optionalAccess', _65 => _65.message]), () => ( "Unknown error"))
|
|
837
863
|
};
|
|
838
864
|
}
|
|
839
865
|
return null;
|
|
@@ -841,10 +867,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
841
867
|
function getInitialProcessingState(event, txHash) {
|
|
842
868
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
843
869
|
const terminal = getTerminalProcessingOutcome(event);
|
|
844
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
870
|
+
if (_optionalChain([terminal, 'optionalAccess', _66 => _66.type]) === "complete") {
|
|
845
871
|
return { type: "complete", lastEvent: event };
|
|
846
872
|
}
|
|
847
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
873
|
+
if (_optionalChain([terminal, 'optionalAccess', _67 => _67.type]) === "failed") {
|
|
848
874
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
849
875
|
}
|
|
850
876
|
if (isDepositEvent(event)) {
|
|
@@ -853,7 +879,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
853
879
|
return null;
|
|
854
880
|
}
|
|
855
881
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
856
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
882
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _68 => _68.data, 'optionalAccess', _69 => _69.source, 'optionalAccess', _70 => _70.transactionHash]), () => ( fallbackTxHash));
|
|
857
883
|
}
|
|
858
884
|
function ProcessingStep({
|
|
859
885
|
smartAccount,
|
|
@@ -885,13 +911,14 @@ function ProcessingStep({
|
|
|
885
911
|
onRetry,
|
|
886
912
|
onDepositComplete,
|
|
887
913
|
onDepositFailed,
|
|
914
|
+
onSourceTransactionObserved,
|
|
888
915
|
onError
|
|
889
916
|
}) {
|
|
890
917
|
const startTimeRef = _react.useRef.call(void 0, Date.now());
|
|
891
918
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
892
919
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
893
920
|
const escalatedDelayRef = _react.useRef.call(void 0, false);
|
|
894
|
-
const processingContextRef =
|
|
921
|
+
const processingContextRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, {
|
|
895
922
|
amount,
|
|
896
923
|
sourceChain,
|
|
897
924
|
sourceToken,
|
|
@@ -900,10 +927,10 @@ function ProcessingStep({
|
|
|
900
927
|
targetChain,
|
|
901
928
|
targetToken
|
|
902
929
|
});
|
|
903
|
-
const onDepositCompleteRef =
|
|
904
|
-
const onDepositFailedRef =
|
|
905
|
-
const onErrorRef =
|
|
906
|
-
const explorerTxUrl =
|
|
930
|
+
const onDepositCompleteRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onDepositComplete);
|
|
931
|
+
const onDepositFailedRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onDepositFailed);
|
|
932
|
+
const onErrorRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onError);
|
|
933
|
+
const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
|
|
907
934
|
const initialTerminalEventRef = _react.useRef.call(void 0, null);
|
|
908
935
|
const [state, setState] = _react.useState.call(void 0, () => {
|
|
909
936
|
if (directTransfer) return { type: "complete" };
|
|
@@ -947,12 +974,12 @@ function ProcessingStep({
|
|
|
947
974
|
completedAt,
|
|
948
975
|
endedAt: completedAt
|
|
949
976
|
}));
|
|
950
|
-
|
|
977
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "direct-transfer:complete", {
|
|
951
978
|
txHash,
|
|
952
979
|
flowLabel
|
|
953
980
|
});
|
|
954
981
|
const context = processingContextRef.current;
|
|
955
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
982
|
+
_optionalChain([onDepositCompleteRef, 'access', _71 => _71.current, 'optionalCall', _72 => _72(txHash, void 0, {
|
|
956
983
|
amount: context.amount,
|
|
957
984
|
sourceChain: context.sourceChain,
|
|
958
985
|
sourceToken: context.sourceToken,
|
|
@@ -979,13 +1006,13 @@ function ProcessingStep({
|
|
|
979
1006
|
if (outcome.type === "complete") {
|
|
980
1007
|
const context = processingContextRef.current;
|
|
981
1008
|
const sourceTxHash2 = getSettledSourceTxHash(event, txHash);
|
|
982
|
-
|
|
1009
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "initial-event:complete", {
|
|
983
1010
|
txHash,
|
|
984
1011
|
sourceTxHash: sourceTxHash2,
|
|
985
1012
|
destinationTxHash: outcome.destinationTxHash,
|
|
986
1013
|
event: event.type
|
|
987
1014
|
});
|
|
988
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1015
|
+
_optionalChain([onDepositCompleteRef, 'access', _73 => _73.current, 'optionalCall', _74 => _74(
|
|
989
1016
|
sourceTxHash2,
|
|
990
1017
|
outcome.destinationTxHash,
|
|
991
1018
|
{
|
|
@@ -1000,12 +1027,12 @@ function ProcessingStep({
|
|
|
1000
1027
|
)]);
|
|
1001
1028
|
return;
|
|
1002
1029
|
}
|
|
1003
|
-
|
|
1030
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "initial-event:failed", {
|
|
1004
1031
|
txHash,
|
|
1005
1032
|
message: outcome.message,
|
|
1006
1033
|
event: event.type
|
|
1007
1034
|
});
|
|
1008
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1035
|
+
_optionalChain([onDepositFailedRef, 'access', _75 => _75.current, 'optionalCall', _76 => _76(txHash, outcome.message)]);
|
|
1009
1036
|
}, [
|
|
1010
1037
|
debug,
|
|
1011
1038
|
onDepositCompleteRef,
|
|
@@ -1037,13 +1064,13 @@ function ProcessingStep({
|
|
|
1037
1064
|
updatePhaseTimings(
|
|
1038
1065
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
1039
1066
|
);
|
|
1040
|
-
}, [_optionalChain([state, 'access',
|
|
1067
|
+
}, [_optionalChain([state, 'access', _77 => _77.lastEvent, 'optionalAccess', _78 => _78.time]), _optionalChain([state, 'access', _79 => _79.lastEvent, 'optionalAccess', _80 => _80.type]), updatePhaseTimings]);
|
|
1041
1068
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
1042
1069
|
_react.useEffect.call(void 0, () => {
|
|
1043
1070
|
let cancelled = false;
|
|
1044
1071
|
let timeoutId;
|
|
1045
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
1046
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
1072
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _81 => _81.variant]) === "fiat";
|
|
1073
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _82 => _82.expectedOrderUuid]), () => ( null));
|
|
1047
1074
|
setSwappedFiatContext(null);
|
|
1048
1075
|
if (isFiatSwappedOrder && !expectedOrderUuid) {
|
|
1049
1076
|
return () => {
|
|
@@ -1093,8 +1120,8 @@ function ProcessingStep({
|
|
|
1093
1120
|
smartAccount,
|
|
1094
1121
|
txHash,
|
|
1095
1122
|
isSwappedOrder,
|
|
1096
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
1097
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
1123
|
+
_optionalChain([swappedContext, 'optionalAccess', _83 => _83.variant]),
|
|
1124
|
+
_optionalChain([swappedContext, 'optionalAccess', _84 => _84.expectedOrderUuid])
|
|
1098
1125
|
]);
|
|
1099
1126
|
_react.useEffect.call(void 0, () => {
|
|
1100
1127
|
if (directTransfer) return;
|
|
@@ -1106,7 +1133,7 @@ function ProcessingStep({
|
|
|
1106
1133
|
async function pollStatus() {
|
|
1107
1134
|
try {
|
|
1108
1135
|
const account = sourceChain === "solana" && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1109
|
-
|
|
1136
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "poll:request", {
|
|
1110
1137
|
account,
|
|
1111
1138
|
txHash,
|
|
1112
1139
|
intervalMs: pollIntervalRef.current
|
|
@@ -1117,28 +1144,28 @@ function ProcessingStep({
|
|
|
1117
1144
|
const eventForCurrentTx = eventMatchesTx ? lastEvent2 : void 0;
|
|
1118
1145
|
if (lastEvent2) {
|
|
1119
1146
|
const eventData = lastEvent2.data;
|
|
1120
|
-
|
|
1147
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "poll:event", {
|
|
1121
1148
|
type: lastEvent2.type,
|
|
1122
1149
|
matchesTx: eventMatchesTx,
|
|
1123
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
1150
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _85 => _85.intentId])
|
|
1124
1151
|
});
|
|
1125
1152
|
}
|
|
1126
1153
|
if (!isMounted) return;
|
|
1127
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1154
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _86 => _86.type]) === "bridge-complete") {
|
|
1128
1155
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1129
1156
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
1130
1157
|
eventForCurrentTx,
|
|
1131
1158
|
txHash
|
|
1132
1159
|
);
|
|
1133
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
1134
|
-
|
|
1160
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _87 => _87.data, 'optionalAccess', _88 => _88.destination, 'optionalAccess', _89 => _89.transactionHash]);
|
|
1161
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "state:complete", {
|
|
1135
1162
|
txHash,
|
|
1136
1163
|
sourceTxHash: sourceTxHash2,
|
|
1137
1164
|
destinationTxHash: destinationTxHash2,
|
|
1138
1165
|
event: eventForCurrentTx.type
|
|
1139
1166
|
});
|
|
1140
1167
|
const context = processingContextRef.current;
|
|
1141
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1168
|
+
_optionalChain([onDepositCompleteRef, 'access', _90 => _90.current, 'optionalCall', _91 => _91(sourceTxHash2, destinationTxHash2, {
|
|
1142
1169
|
amount: context.amount,
|
|
1143
1170
|
sourceChain: context.sourceChain,
|
|
1144
1171
|
sourceToken: context.sourceToken,
|
|
@@ -1149,33 +1176,33 @@ function ProcessingStep({
|
|
|
1149
1176
|
})]);
|
|
1150
1177
|
return;
|
|
1151
1178
|
}
|
|
1152
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1179
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _92 => _92.type]) === "bridge-failed") {
|
|
1153
1180
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1154
1181
|
setState({
|
|
1155
1182
|
type: "failed",
|
|
1156
1183
|
message: formatted.message,
|
|
1157
1184
|
lastEvent: eventForCurrentTx
|
|
1158
1185
|
});
|
|
1159
|
-
|
|
1186
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "state:failed", {
|
|
1160
1187
|
txHash,
|
|
1161
1188
|
message: formatted.message,
|
|
1162
1189
|
code: formatted.code
|
|
1163
1190
|
});
|
|
1164
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1191
|
+
_optionalChain([onDepositFailedRef, 'access', _93 => _93.current, 'optionalCall', _94 => _94(txHash, formatted.message)]);
|
|
1165
1192
|
return;
|
|
1166
1193
|
}
|
|
1167
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1168
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
1194
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _95 => _95.type]) === "error") {
|
|
1195
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _96 => _96.data, 'optionalAccess', _97 => _97.message]), () => ( "Unknown error"));
|
|
1169
1196
|
setState({
|
|
1170
1197
|
type: "failed",
|
|
1171
1198
|
message: errorMessage,
|
|
1172
1199
|
lastEvent: eventForCurrentTx
|
|
1173
1200
|
});
|
|
1174
|
-
|
|
1201
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "state:error-event", {
|
|
1175
1202
|
txHash,
|
|
1176
1203
|
message: errorMessage
|
|
1177
1204
|
});
|
|
1178
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1205
|
+
_optionalChain([onDepositFailedRef, 'access', _98 => _98.current, 'optionalCall', _99 => _99(txHash, errorMessage)]);
|
|
1179
1206
|
return;
|
|
1180
1207
|
}
|
|
1181
1208
|
setState((previous) => ({
|
|
@@ -1184,7 +1211,7 @@ function ProcessingStep({
|
|
|
1184
1211
|
}));
|
|
1185
1212
|
scheduleNextPoll();
|
|
1186
1213
|
} catch (error) {
|
|
1187
|
-
|
|
1214
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, "processing", "poll:failure", error, {
|
|
1188
1215
|
smartAccount,
|
|
1189
1216
|
txHash,
|
|
1190
1217
|
intervalMs: pollIntervalRef.current
|
|
@@ -1199,7 +1226,7 @@ function ProcessingStep({
|
|
|
1199
1226
|
pollIntervalRef.current * BACKOFF_MULTIPLIER,
|
|
1200
1227
|
MAX_POLL_INTERVAL
|
|
1201
1228
|
);
|
|
1202
|
-
|
|
1229
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "poll:scheduled", {
|
|
1203
1230
|
nextIntervalMs: pollIntervalRef.current
|
|
1204
1231
|
});
|
|
1205
1232
|
pollStatus();
|
|
@@ -1232,11 +1259,11 @@ function ProcessingStep({
|
|
|
1232
1259
|
escalatedDelayRef.current = true;
|
|
1233
1260
|
setHasEscalatedDelay(true);
|
|
1234
1261
|
const message = "Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.";
|
|
1235
|
-
|
|
1262
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "processing", "state:delay-escalated", {
|
|
1236
1263
|
txHash,
|
|
1237
1264
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1238
1265
|
});
|
|
1239
|
-
_optionalChain([onErrorRef, 'access',
|
|
1266
|
+
_optionalChain([onErrorRef, 'access', _100 => _100.current, 'optionalCall', _101 => _101(message, "PROCESS_TIMEOUT")]);
|
|
1240
1267
|
}, ESCALATED_DELAY_MS);
|
|
1241
1268
|
return () => clearTimeout(timeoutId);
|
|
1242
1269
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -1248,19 +1275,24 @@ function ProcessingStep({
|
|
|
1248
1275
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
1249
1276
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1250
1277
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1251
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1278
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _102 => _102.data, 'optionalAccess', _103 => _103.destination, 'optionalAccess', _104 => _104.transactionHash]) || null;
|
|
1252
1279
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
1253
1280
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
1254
1281
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1255
1282
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
1256
1283
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
1257
1284
|
const targetChainId = _chunk4KCSH4T3cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1258
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1285
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _105 => _105.data, 'optionalAccess', _106 => _106.source, 'optionalAccess', _107 => _107.transactionHash]);
|
|
1259
1286
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
1287
|
+
_react.useEffect.call(void 0, () => {
|
|
1288
|
+
if (sourceTxHashPending && settledSourceTxHash) {
|
|
1289
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _108 => _108(settledSourceTxHash)]);
|
|
1290
|
+
}
|
|
1291
|
+
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
1260
1292
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
1261
1293
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainId, destinationTxHash) : null;
|
|
1262
1294
|
const sourceDisplay = (() => {
|
|
1263
|
-
const resolved =
|
|
1295
|
+
const resolved = _chunkV2OBGLJDcjs.resolveTokenDisplay.call(void 0, displaySourceToken, displaySourceChain, {
|
|
1264
1296
|
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
1265
1297
|
decimals: providedSourceDecimals
|
|
1266
1298
|
});
|
|
@@ -1270,10 +1302,10 @@ function ProcessingStep({
|
|
|
1270
1302
|
};
|
|
1271
1303
|
})();
|
|
1272
1304
|
const sourceSymbol = sourceDisplay.symbol;
|
|
1273
|
-
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(
|
|
1274
|
-
|
|
1305
|
+
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(_chunkV2OBGLJDcjs.formatRawTokenAmount.call(void 0, displayAmount, sourceDisplay), () => ( // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
1306
|
+
_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, Number(displayAmount), sourceDisplay.symbol))), () => ( displayAmount));
|
|
1275
1307
|
const eventDestination = getEventDestinationDetails(lastEvent);
|
|
1276
|
-
const targetDisplay =
|
|
1308
|
+
const targetDisplay = _chunkV2OBGLJDcjs.resolveTokenDisplay.call(void 0,
|
|
1277
1309
|
_nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
1278
1310
|
_nullishCoalesce(eventDestination.chainId, () => ( targetChainId)),
|
|
1279
1311
|
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
@@ -1281,7 +1313,7 @@ function ProcessingStep({
|
|
|
1281
1313
|
{ symbol: _nullishCoalesce(providedSourceSymbol, () => ( "USDC")) }
|
|
1282
1314
|
);
|
|
1283
1315
|
const targetSymbol = targetDisplay.symbol;
|
|
1284
|
-
const formattedDestinationAmount = eventDestination.amount !== void 0 ?
|
|
1316
|
+
const formattedDestinationAmount = eventDestination.amount !== void 0 ? _chunkV2OBGLJDcjs.formatRawTokenAmount.call(void 0, eventDestination.amount, targetDisplay) : void 0;
|
|
1285
1317
|
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
1286
1318
|
const prices = useTokenPrices(service, [
|
|
1287
1319
|
{
|
|
@@ -1296,17 +1328,17 @@ function ProcessingStep({
|
|
|
1296
1328
|
}
|
|
1297
1329
|
]);
|
|
1298
1330
|
const estimatedReceiveAmount = (() => {
|
|
1299
|
-
const estimate =
|
|
1300
|
-
sourceAmount:
|
|
1331
|
+
const estimate = _chunkV2OBGLJDcjs.estimateReceiveAmount.call(void 0, {
|
|
1332
|
+
sourceAmount: _chunkV2OBGLJDcjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals),
|
|
1301
1333
|
sourceSymbol: sourceDisplay.symbol,
|
|
1302
1334
|
targetSymbol: targetDisplay.symbol,
|
|
1303
1335
|
sourceAmountUsd: amountUsdNumber,
|
|
1304
|
-
sourceTrusted:
|
|
1336
|
+
sourceTrusted: _chunkV2OBGLJDcjs.isRecognizedToken.call(void 0, displaySourceToken, displaySourceChain),
|
|
1305
1337
|
prices
|
|
1306
1338
|
});
|
|
1307
|
-
return estimate !== void 0 ?
|
|
1339
|
+
return estimate !== void 0 ? _chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, estimate, targetDisplay.symbol) : void 0;
|
|
1308
1340
|
})();
|
|
1309
|
-
const quotedReceive = quote ?
|
|
1341
|
+
const quotedReceive = quote ? _chunkV2OBGLJDcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol) : void 0;
|
|
1310
1342
|
const receiveDisplay = formattedDestinationAmount ? (
|
|
1311
1343
|
// The delivered amount, once the bridge reports it — actual, not an
|
|
1312
1344
|
// estimate, so it wins over the quote and carries no "~".
|
|
@@ -1320,12 +1352,12 @@ function ProcessingStep({
|
|
|
1320
1352
|
if (sourceSymbol.toUpperCase() !== targetSymbol.toUpperCase()) {
|
|
1321
1353
|
return void 0;
|
|
1322
1354
|
}
|
|
1323
|
-
const sentValue =
|
|
1324
|
-
const receivedValue = eventDestination.amount !== void 0 ?
|
|
1355
|
+
const sentValue = _chunkV2OBGLJDcjs.tokenAmountToNumber.call(void 0, displayAmount, sourceDisplay.decimals);
|
|
1356
|
+
const receivedValue = eventDestination.amount !== void 0 ? _chunkV2OBGLJDcjs.tokenAmountToNumber.call(void 0, eventDestination.amount, targetDisplay.decimals) : void 0;
|
|
1325
1357
|
if (sentValue === void 0 || receivedValue === void 0 || sentValue <= receivedValue) {
|
|
1326
1358
|
return void 0;
|
|
1327
1359
|
}
|
|
1328
|
-
const formatted =
|
|
1360
|
+
const formatted = _chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, sentValue - receivedValue, sourceSymbol);
|
|
1329
1361
|
if (formatted === void 0 || Number(formatted.replace(/,/g, "")) === 0) {
|
|
1330
1362
|
return void 0;
|
|
1331
1363
|
}
|
|
@@ -1342,8 +1374,8 @@ function ProcessingStep({
|
|
|
1342
1374
|
const sourceChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, displaySourceChain);
|
|
1343
1375
|
const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
|
|
1344
1376
|
const timerText = formatTimer(elapsedSeconds);
|
|
1345
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1346
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1377
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.feeSponsored]), () => ( false));
|
|
1378
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
1347
1379
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
1348
1380
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
1349
1381
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -1352,29 +1384,29 @@ function ProcessingStep({
|
|
|
1352
1384
|
] }) : isFailed ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
1353
1385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FailedBadge, {}),
|
|
1354
1386
|
/* @__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 }) })
|
|
1355
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1387
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}), title: stateTitle });
|
|
1356
1388
|
if (isComplete && isSwappedOrder) {
|
|
1357
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
1389
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _111 => _111.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _112 => _112.paymentMethod]))), () => ( null));
|
|
1358
1390
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
1359
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
1391
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _113 => _113.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
1360
1392
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
1361
1393
|
effectivePaymentMethod
|
|
1362
1394
|
) : null;
|
|
1363
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
1364
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
1395
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _114 => _114.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
1396
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _115 => _115.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
1365
1397
|
const depositedAmount = receiveDisplay;
|
|
1366
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
1398
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _116 => _116.onrampFeeUsd]), () => ( null));
|
|
1367
1399
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
1368
1400
|
const feesTooltip = feeSponsored ? "On-ramp fees are charged by the payment provider. Market and network fees are sponsored for this deposit." : "Fees include on-ramp, market, and network costs for this deposit.";
|
|
1369
1401
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
1370
|
-
_optionalChain([quote, 'optionalAccess',
|
|
1402
|
+
_optionalChain([quote, 'optionalAccess', _117 => _117.fees, 'access', _118 => _118.breakdown]),
|
|
1371
1403
|
sponsoredFeeTooltip
|
|
1372
1404
|
);
|
|
1373
1405
|
const feeRows = [];
|
|
1374
1406
|
if (onrampFeeUsd != null) {
|
|
1375
1407
|
feeRows.push({
|
|
1376
1408
|
label: "On-ramp fee",
|
|
1377
|
-
value:
|
|
1409
|
+
value: _chunkV2OBGLJDcjs.formatFeeUsd.call(void 0, onrampFeeUsd)
|
|
1378
1410
|
});
|
|
1379
1411
|
}
|
|
1380
1412
|
const hasFallbackFee = quoteFeeRows.length === 0 && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount));
|
|
@@ -1383,13 +1415,13 @@ function ProcessingStep({
|
|
|
1383
1415
|
} else if (hasFallbackFee) {
|
|
1384
1416
|
feeRows.push({
|
|
1385
1417
|
label: "Network fee",
|
|
1386
|
-
value:
|
|
1418
|
+
value: _chunkV2OBGLJDcjs.formatFeeUsd.call(void 0, Number(quotedFeeAmount)),
|
|
1387
1419
|
strike: feeSponsored,
|
|
1388
1420
|
tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
|
|
1389
1421
|
});
|
|
1390
1422
|
}
|
|
1391
1423
|
const fallbackChargeableUsd = hasFallbackFee && !feeSponsored ? Number(quotedFeeAmount) : 0;
|
|
1392
|
-
const feesTotal = feeRows.length > 0 ?
|
|
1424
|
+
const feesTotal = feeRows.length > 0 ? _chunkV2OBGLJDcjs.formatFeeUsd.call(void 0,
|
|
1393
1425
|
(_nullishCoalesce(onrampFeeUsd, () => ( 0))) + chargeableUsd + fallbackChargeableUsd
|
|
1394
1426
|
) : null;
|
|
1395
1427
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1405,7 +1437,7 @@ function ProcessingStep({
|
|
|
1405
1437
|
feesTooltip,
|
|
1406
1438
|
newLabel: `New ${flowNoun}`,
|
|
1407
1439
|
onNewDeposit,
|
|
1408
|
-
onClose
|
|
1440
|
+
onClose: onClose ? () => onClose("success_done") : void 0
|
|
1409
1441
|
}
|
|
1410
1442
|
);
|
|
1411
1443
|
}
|
|
@@ -1417,7 +1449,7 @@ function ProcessingStep({
|
|
|
1417
1449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1418
1450
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1419
1451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1420
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1452
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) }),
|
|
1421
1453
|
sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1422
1454
|
"a",
|
|
1423
1455
|
{
|
|
@@ -1426,7 +1458,7 @@ function ProcessingStep({
|
|
|
1426
1458
|
rel: "noopener noreferrer",
|
|
1427
1459
|
className: "rs-review-detail-link",
|
|
1428
1460
|
"aria-label": "View source transaction",
|
|
1429
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1461
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ExternalLinkIcon, {})
|
|
1430
1462
|
}
|
|
1431
1463
|
)
|
|
1432
1464
|
] })
|
|
@@ -1435,7 +1467,7 @@ function ProcessingStep({
|
|
|
1435
1467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1436
1468
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1437
1469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1438
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: targetChainIcon }) }),
|
|
1439
1471
|
destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1440
1472
|
"a",
|
|
1441
1473
|
{
|
|
@@ -1444,7 +1476,7 @@ function ProcessingStep({
|
|
|
1444
1476
|
rel: "noopener noreferrer",
|
|
1445
1477
|
className: "rs-review-detail-link",
|
|
1446
1478
|
"aria-label": "View destination transaction",
|
|
1447
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1479
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ExternalLinkIcon, {})
|
|
1448
1480
|
}
|
|
1449
1481
|
)
|
|
1450
1482
|
] })
|
|
@@ -1454,7 +1486,7 @@ function ProcessingStep({
|
|
|
1454
1486
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
1455
1487
|
] }),
|
|
1456
1488
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1457
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
1489
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _119 => _119.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1458
1490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
1459
1491
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1460
1492
|
"$",
|
|
@@ -1466,7 +1498,7 @@ function ProcessingStep({
|
|
|
1466
1498
|
] })
|
|
1467
1499
|
] })
|
|
1468
1500
|
] }),
|
|
1469
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
1501
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _120 => _120.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1470
1502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
1471
1503
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1472
1504
|
"$",
|
|
@@ -1481,7 +1513,7 @@ function ProcessingStep({
|
|
|
1481
1513
|
" ",
|
|
1482
1514
|
sourceSymbol
|
|
1483
1515
|
] }),
|
|
1484
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1516
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1485
1517
|
] })
|
|
1486
1518
|
] })
|
|
1487
1519
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1492,14 +1524,14 @@ function ProcessingStep({
|
|
|
1492
1524
|
" ",
|
|
1493
1525
|
sourceSymbol
|
|
1494
1526
|
] }),
|
|
1495
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1527
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
1496
1528
|
] })
|
|
1497
1529
|
] }),
|
|
1498
1530
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1499
1531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Receive" : "Received" }),
|
|
1500
1532
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1501
1533
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1503
1535
|
] })
|
|
1504
1536
|
] }),
|
|
1505
1537
|
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1528,12 +1560,12 @@ function ProcessingStep({
|
|
|
1528
1560
|
{
|
|
1529
1561
|
className: "rs-review-detail-info",
|
|
1530
1562
|
"aria-label": "Fee info",
|
|
1531
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1563
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.InfoIcon, {})
|
|
1532
1564
|
}
|
|
1533
1565
|
) })
|
|
1534
1566
|
] })
|
|
1535
1567
|
] }) : (() => {
|
|
1536
|
-
const { display, struck } =
|
|
1568
|
+
const { display, struck } = _chunkV2OBGLJDcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'optionalAccess', _121 => _121.fees]));
|
|
1537
1569
|
if (display !== null) {
|
|
1538
1570
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1539
1571
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -1564,9 +1596,9 @@ function ProcessingStep({
|
|
|
1564
1596
|
] });
|
|
1565
1597
|
})()
|
|
1566
1598
|
] }),
|
|
1567
|
-
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1599
|
+
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: failureMessage }),
|
|
1568
1600
|
isProcessing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1569
|
-
|
|
1601
|
+
_chunkV2OBGLJDcjs.Button,
|
|
1570
1602
|
{
|
|
1571
1603
|
fullWidth: true,
|
|
1572
1604
|
disabled: true,
|
|
@@ -1576,18 +1608,26 @@ function ProcessingStep({
|
|
|
1576
1608
|
}
|
|
1577
1609
|
),
|
|
1578
1610
|
isComplete && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1579
|
-
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1611
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkV2OBGLJDcjs.Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
1580
1612
|
"New ",
|
|
1581
1613
|
flowNoun
|
|
1582
1614
|
] }),
|
|
1583
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1615
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: () => onClose("success_done"), fullWidth: true, children: "Done" })
|
|
1584
1616
|
] }),
|
|
1585
1617
|
isFailed && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
1586
|
-
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1587
|
-
|
|
1618
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
+
_chunkV2OBGLJDcjs.Button,
|
|
1620
|
+
{
|
|
1621
|
+
variant: "outline",
|
|
1622
|
+
onClick: () => onClose("failure_cancel"),
|
|
1623
|
+
fullWidth: true,
|
|
1624
|
+
children: "Cancel"
|
|
1625
|
+
}
|
|
1626
|
+
),
|
|
1627
|
+
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
1588
1628
|
] })
|
|
1589
1629
|
] }),
|
|
1590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
1591
1631
|
] });
|
|
1592
1632
|
}
|
|
1593
1633
|
|
|
@@ -1656,7 +1696,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
1656
1696
|
function readDedupedAccountSetupResult(requestKey) {
|
|
1657
1697
|
const now = Date.now();
|
|
1658
1698
|
const existing = setupRequestDedupe.get(requestKey);
|
|
1659
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1699
|
+
if (_optionalChain([existing, 'optionalAccess', _122 => _122.settled]) && existing.expiresAt > now && existing.result) {
|
|
1660
1700
|
return existing.result;
|
|
1661
1701
|
}
|
|
1662
1702
|
return null;
|
|
@@ -1678,7 +1718,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1678
1718
|
}
|
|
1679
1719
|
try {
|
|
1680
1720
|
const salt = deriveAccountSalt(input);
|
|
1681
|
-
|
|
1721
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
1682
1722
|
salt,
|
|
1683
1723
|
recipient: input.recipient,
|
|
1684
1724
|
targetChain: input.targetChain,
|
|
@@ -1690,7 +1730,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1690
1730
|
chain: _chunk4KCSH4T3cjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
1691
1731
|
token: input.targetToken,
|
|
1692
1732
|
recipient: input.recipient,
|
|
1693
|
-
..._optionalChain([input, 'access',
|
|
1733
|
+
..._optionalChain([input, 'access', _123 => _123.outputTokenRules, 'optionalAccess', _124 => _124.length]) && {
|
|
1694
1734
|
outputTokenRules: input.outputTokenRules
|
|
1695
1735
|
},
|
|
1696
1736
|
...input.rejectUnmapped != null && {
|
|
@@ -1704,7 +1744,7 @@ async function runAccountSetup(input, deps) {
|
|
|
1704
1744
|
cacheKey
|
|
1705
1745
|
};
|
|
1706
1746
|
} catch (error) {
|
|
1707
|
-
|
|
1747
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
1708
1748
|
recipient: input.recipient
|
|
1709
1749
|
});
|
|
1710
1750
|
if (error instanceof SetupError) throw error;
|
|
@@ -1715,7 +1755,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
1715
1755
|
const now = Date.now();
|
|
1716
1756
|
const existing = setupRequestDedupe.get(requestKey);
|
|
1717
1757
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
1718
|
-
|
|
1758
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
1719
1759
|
recipient: input.recipient,
|
|
1720
1760
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
1721
1761
|
});
|
|
@@ -1800,4 +1840,5 @@ function mapError(error) {
|
|
|
1800
1840
|
|
|
1801
1841
|
|
|
1802
1842
|
|
|
1803
|
-
|
|
1843
|
+
|
|
1844
|
+
exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.Tooltip = Tooltip; exports.markSubmissionUncertain = markSubmissionUncertain; exports.isSubmissionUncertain = isSubmissionUncertain; 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; exports.analyticsTargetProperties = analyticsTargetProperties;
|