@rhinestone/deposit-modal 0.17.0 → 0.18.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 +68 -0
- package/dist/{DepositModalReown-6CXXGQ7X.cjs → DepositModalReown-TVO3ZQQK.cjs} +17 -17
- package/dist/{DepositModalReown-ELDSTIME.mjs → DepositModalReown-VCY65DJX.mjs} +4 -4
- package/dist/WithdrawModal-GR3HLYXU.cjs +11 -0
- package/dist/{WithdrawModal-QRMDR5T4.mjs → WithdrawModal-RMCYJJ4S.mjs} +3 -3
- package/dist/bearer-transport-CVHNBgoV.d.cts +14 -0
- package/dist/bearer-transport-CVHNBgoV.d.ts +14 -0
- package/dist/{chunk-2W4BJ5I3.cjs → chunk-34JVJZEZ.cjs} +71 -71
- package/dist/{chunk-XCBDJPBD.mjs → chunk-3TEVMP76.mjs} +1 -1
- package/dist/chunk-ADEWTBSN.cjs +19 -0
- package/dist/{chunk-QMGEK623.mjs → chunk-AIZKGFVA.mjs} +468 -207
- package/dist/{chunk-H66WM5AO.mjs → chunk-EKC2IRQG.mjs} +180 -67
- package/dist/{chunk-XJMDCBHS.cjs → chunk-JV5OGG53.cjs} +629 -516
- package/dist/{chunk-QGNJFDEO.cjs → chunk-N3AAT6BS.cjs} +623 -362
- package/dist/{chunk-JCWJ6HW7.cjs → chunk-N6JJG57R.cjs} +1 -1
- package/dist/chunk-O4JZKKCZ.cjs +41 -0
- package/dist/chunk-PP4QE32S.mjs +19 -0
- package/dist/{chunk-ZHX4QROC.mjs → chunk-R2B6VD4E.mjs} +1 -1
- package/dist/chunk-X4EUXBHJ.mjs +41 -0
- package/dist/compliance.cjs +14 -0
- package/dist/compliance.d.cts +10 -0
- package/dist/compliance.d.ts +10 -0
- package/dist/compliance.mjs +14 -0
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +3 -3
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +16 -16
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +8 -8
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/offramp.cjs +25 -0
- package/dist/offramp.d.cts +28 -0
- package/dist/offramp.d.ts +28 -0
- package/dist/offramp.mjs +25 -0
- package/dist/onramp.cjs +27 -0
- package/dist/onramp.d.cts +37 -0
- package/dist/onramp.d.ts +37 -0
- package/dist/onramp.mjs +27 -0
- package/dist/ramp-types-C6aUz4SZ.d.cts +43 -0
- package/dist/ramp-types-C6aUz4SZ.d.ts +43 -0
- package/dist/server.cjs +54 -2
- package/dist/server.d.cts +13 -1
- package/dist/server.d.ts +13 -1
- package/dist/server.mjs +52 -0
- package/dist/{types-B9SbZQIG.d.ts → types-CZYypODQ.d.ts} +3 -2
- package/dist/{types-SwGGf0eH.d.cts → types-CbUs4boj.d.cts} +3 -2
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +35 -5
- package/dist/WithdrawModal-QB2U756L.cjs +0 -11
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var _chunkJCWJ6HW7cjs = require('./chunk-JCWJ6HW7.cjs');
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
@@ -32,10 +31,11 @@ var _chunkJCWJ6HW7cjs = require('./chunk-JCWJ6HW7.cjs');
|
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
|
|
34
|
+
var _chunkOY5N3E6Lcjs = require('./chunk-OY5N3E6L.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkN6JJG57Rcjs = require('./chunk-N6JJG57R.cjs');
|
|
39
39
|
|
|
40
40
|
// src/components/ui/Modal.tsx
|
|
41
41
|
|
|
@@ -736,6 +736,31 @@ function resolveAppFeeBps(appFees, sourceChainCaip2, sourceToken) {
|
|
|
736
736
|
const bps = _nullishCoalesce(_nullishCoalesce(override, () => ( _optionalChain([appFees, 'optionalAccess', _8 => _8.feeBps]))), () => ( 0));
|
|
737
737
|
return bps > 0 ? bps : 0;
|
|
738
738
|
}
|
|
739
|
+
function isRawAmount(value) {
|
|
740
|
+
return typeof value === "string" && /^\d+$/.test(value);
|
|
741
|
+
}
|
|
742
|
+
function isDepositPolicyRefusal(value) {
|
|
743
|
+
return typeof value === "object" && value !== null && "policyRefusal" in value;
|
|
744
|
+
}
|
|
745
|
+
var DEPOSIT_POLICY_REFUSAL_CODES = [
|
|
746
|
+
"TOKEN-3",
|
|
747
|
+
"BALANCE-3",
|
|
748
|
+
"BALANCE-4"
|
|
749
|
+
];
|
|
750
|
+
var DEPOSIT_PREFLIGHT_TIMEOUT_MS = 1e4;
|
|
751
|
+
async function readPolicyRefusal(response) {
|
|
752
|
+
if (response.status !== 422) return null;
|
|
753
|
+
try {
|
|
754
|
+
const body = await response.json();
|
|
755
|
+
if (!body || typeof body.code !== "string" || !DEPOSIT_POLICY_REFUSAL_CODES.includes(body.code)) {
|
|
756
|
+
return null;
|
|
757
|
+
}
|
|
758
|
+
const message = typeof body.error === "string" && body.error !== "" ? body.error : "This deposit is not accepted.";
|
|
759
|
+
return { policyRefusal: { code: body.code, message } };
|
|
760
|
+
} catch (e4) {
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
739
764
|
var PermitDepositSubmitError = class extends Error {
|
|
740
765
|
constructor(message, safeToTransfer) {
|
|
741
766
|
super(message);
|
|
@@ -762,62 +787,93 @@ function createDepositService(baseUrl, options) {
|
|
|
762
787
|
if (value.length <= 20) return value;
|
|
763
788
|
return `${value.slice(0, 10)}...${value.slice(-8)}`;
|
|
764
789
|
}
|
|
790
|
+
function withPreflightTimeout(label, fallback, run) {
|
|
791
|
+
const controller = new AbortController();
|
|
792
|
+
return new Promise((resolve) => {
|
|
793
|
+
const timer = setTimeout(() => {
|
|
794
|
+
debugLog(debug, scope, `${label}:timeout`, {
|
|
795
|
+
timeoutMs: DEPOSIT_PREFLIGHT_TIMEOUT_MS
|
|
796
|
+
});
|
|
797
|
+
controller.abort();
|
|
798
|
+
resolve(fallback);
|
|
799
|
+
}, DEPOSIT_PREFLIGHT_TIMEOUT_MS);
|
|
800
|
+
run(controller.signal).then(
|
|
801
|
+
(value) => {
|
|
802
|
+
clearTimeout(timer);
|
|
803
|
+
resolve(value);
|
|
804
|
+
},
|
|
805
|
+
() => {
|
|
806
|
+
clearTimeout(timer);
|
|
807
|
+
resolve(fallback);
|
|
808
|
+
}
|
|
809
|
+
);
|
|
810
|
+
});
|
|
811
|
+
}
|
|
765
812
|
const PORTFOLIO_CACHE_TTL_MS = 3e4;
|
|
766
813
|
const portfolioCache = /* @__PURE__ */ new Map();
|
|
767
814
|
let topTokensPromise = null;
|
|
768
815
|
let chainsPromise = null;
|
|
769
|
-
function
|
|
770
|
-
if (typeof value !== "object" || value === null
|
|
816
|
+
function parseDepositOptions(value) {
|
|
817
|
+
if (typeof value !== "object" || value === null) return null;
|
|
818
|
+
const { restricted, tokens: rawTokens } = value;
|
|
819
|
+
if (typeof restricted !== "boolean") return null;
|
|
820
|
+
if (typeof rawTokens !== "object" || rawTokens === null || Array.isArray(rawTokens)) {
|
|
771
821
|
return null;
|
|
772
822
|
}
|
|
773
|
-
const
|
|
774
|
-
for (const [chainKey, list] of Object.entries(
|
|
823
|
+
const tokens = {};
|
|
824
|
+
for (const [chainKey, list] of Object.entries(rawTokens)) {
|
|
775
825
|
if (!Array.isArray(list)) return null;
|
|
776
|
-
const
|
|
826
|
+
const parsed = [];
|
|
777
827
|
for (const entry of list) {
|
|
778
828
|
if (typeof entry !== "object" || entry === null) return null;
|
|
779
|
-
const { symbol, address, decimals } = entry;
|
|
829
|
+
const { symbol, address, decimals, minAmount, maxAmount } = entry;
|
|
780
830
|
if (typeof symbol !== "string" || typeof address !== "string" || typeof decimals !== "number") {
|
|
781
831
|
return null;
|
|
782
832
|
}
|
|
783
|
-
|
|
833
|
+
parsed.push({
|
|
834
|
+
symbol,
|
|
835
|
+
address,
|
|
836
|
+
decimals,
|
|
837
|
+
...isRawAmount(minAmount) && { minAmount },
|
|
838
|
+
...isRawAmount(maxAmount) && { maxAmount }
|
|
839
|
+
});
|
|
784
840
|
}
|
|
785
|
-
|
|
841
|
+
tokens[chainKey] = parsed;
|
|
786
842
|
}
|
|
787
|
-
return
|
|
843
|
+
return { restricted, tokens };
|
|
788
844
|
}
|
|
789
845
|
async function requestTopTokens() {
|
|
790
846
|
try {
|
|
791
847
|
const response = await fetch(apiUrl("/qr/tokens"), {
|
|
792
848
|
method: "GET",
|
|
793
|
-
headers:
|
|
849
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, )
|
|
794
850
|
});
|
|
795
851
|
if (!response.ok) {
|
|
796
852
|
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
797
853
|
status: response.status
|
|
798
854
|
});
|
|
799
|
-
return
|
|
855
|
+
return { ok: false };
|
|
800
856
|
}
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
if (!tokens) {
|
|
857
|
+
const options2 = parseDepositOptions(await response.json());
|
|
858
|
+
if (!options2) {
|
|
804
859
|
debugLog(debug, scope, "getTopTokens:malformed");
|
|
805
|
-
return
|
|
860
|
+
return { ok: false };
|
|
806
861
|
}
|
|
807
862
|
debugLog(debug, scope, "getTopTokens:success", {
|
|
808
|
-
chains: Object.keys(tokens).length
|
|
863
|
+
chains: Object.keys(options2.tokens).length,
|
|
864
|
+
restricted: options2.restricted
|
|
809
865
|
});
|
|
810
|
-
return
|
|
866
|
+
return { ok: true, options: options2 };
|
|
811
867
|
} catch (error) {
|
|
812
868
|
debugError(debug, scope, "getTopTokens:error", error);
|
|
813
|
-
return
|
|
869
|
+
return { ok: false };
|
|
814
870
|
}
|
|
815
871
|
}
|
|
816
872
|
async function requestChains() {
|
|
817
873
|
try {
|
|
818
874
|
const response = await fetch(apiUrl("/chains"), {
|
|
819
875
|
method: "GET",
|
|
820
|
-
headers:
|
|
876
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, )
|
|
821
877
|
});
|
|
822
878
|
if (!response.ok) {
|
|
823
879
|
debugLog(debug, scope, "getChains:unavailable", {
|
|
@@ -871,7 +927,7 @@ function createDepositService(baseUrl, options) {
|
|
|
871
927
|
});
|
|
872
928
|
const response = await fetch(url, {
|
|
873
929
|
method: "POST",
|
|
874
|
-
headers:
|
|
930
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
875
931
|
body: JSON.stringify({ account: params })
|
|
876
932
|
});
|
|
877
933
|
if (!response.ok) {
|
|
@@ -906,7 +962,7 @@ function createDepositService(baseUrl, options) {
|
|
|
906
962
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
907
963
|
const response = await fetch(url, {
|
|
908
964
|
method: "GET",
|
|
909
|
-
headers:
|
|
965
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, )
|
|
910
966
|
});
|
|
911
967
|
if (!response.ok) {
|
|
912
968
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -957,7 +1013,7 @@ function createDepositService(baseUrl, options) {
|
|
|
957
1013
|
});
|
|
958
1014
|
const response = await fetch(url, {
|
|
959
1015
|
method: "GET",
|
|
960
|
-
headers:
|
|
1016
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, )
|
|
961
1017
|
});
|
|
962
1018
|
if (!response.ok) {
|
|
963
1019
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -986,7 +1042,7 @@ function createDepositService(baseUrl, options) {
|
|
|
986
1042
|
debugLog(debug, scope, "checkAccount:request", { url, address });
|
|
987
1043
|
const response = await fetch(url, {
|
|
988
1044
|
method: "GET",
|
|
989
|
-
headers:
|
|
1045
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, )
|
|
990
1046
|
});
|
|
991
1047
|
if (!response.ok) {
|
|
992
1048
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
@@ -1022,7 +1078,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1022
1078
|
);
|
|
1023
1079
|
const response = await fetch(url, {
|
|
1024
1080
|
method: "GET",
|
|
1025
|
-
headers:
|
|
1081
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1026
1082
|
cache: "no-store"
|
|
1027
1083
|
});
|
|
1028
1084
|
if (!response.ok) {
|
|
@@ -1050,7 +1106,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1050
1106
|
);
|
|
1051
1107
|
const response = await fetch(url, {
|
|
1052
1108
|
method: "GET",
|
|
1053
|
-
headers:
|
|
1109
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1054
1110
|
cache: "no-store"
|
|
1055
1111
|
});
|
|
1056
1112
|
if (!response.ok) {
|
|
@@ -1074,7 +1130,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1074
1130
|
);
|
|
1075
1131
|
const response = await fetch(url, {
|
|
1076
1132
|
method: "GET",
|
|
1077
|
-
headers:
|
|
1133
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1078
1134
|
cache: "no-store"
|
|
1079
1135
|
});
|
|
1080
1136
|
if (!response.ok) {
|
|
@@ -1096,7 +1152,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1096
1152
|
async getPositions(address) {
|
|
1097
1153
|
const url = apiUrl(`/positions/${address}`);
|
|
1098
1154
|
debugLog(debug, scope, "getPositions:request", { url, address });
|
|
1099
|
-
const response = await fetch(url, { headers:
|
|
1155
|
+
const response = await fetch(url, { headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ) });
|
|
1100
1156
|
if (!response.ok) {
|
|
1101
1157
|
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1102
1158
|
debugError(debug, scope, "getPositions:failed", error, {
|
|
@@ -1130,7 +1186,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1130
1186
|
});
|
|
1131
1187
|
const response = await fetch(url, {
|
|
1132
1188
|
method: "POST",
|
|
1133
|
-
headers:
|
|
1189
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1134
1190
|
body: JSON.stringify({ account, market, chainId, asset, amount })
|
|
1135
1191
|
});
|
|
1136
1192
|
if (!response.ok) {
|
|
@@ -1166,7 +1222,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1166
1222
|
});
|
|
1167
1223
|
const response = await fetch(url, {
|
|
1168
1224
|
method: "POST",
|
|
1169
|
-
headers:
|
|
1225
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1170
1226
|
body: JSON.stringify({
|
|
1171
1227
|
depositWallet,
|
|
1172
1228
|
owner,
|
|
@@ -1208,7 +1264,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1208
1264
|
});
|
|
1209
1265
|
const response = await fetch(url, {
|
|
1210
1266
|
method: "GET",
|
|
1211
|
-
headers:
|
|
1267
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1212
1268
|
cache: "no-store"
|
|
1213
1269
|
});
|
|
1214
1270
|
if (!response.ok) {
|
|
@@ -1258,7 +1314,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1258
1314
|
});
|
|
1259
1315
|
const response = await fetch(url, {
|
|
1260
1316
|
method: "GET",
|
|
1261
|
-
headers:
|
|
1317
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1262
1318
|
cache: "no-store"
|
|
1263
1319
|
});
|
|
1264
1320
|
if (!response.ok) {
|
|
@@ -1303,36 +1359,46 @@ function createDepositService(baseUrl, options) {
|
|
|
1303
1359
|
sourceToken: params.sourceToken,
|
|
1304
1360
|
amount: params.amount
|
|
1305
1361
|
});
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
debugLog(debug, scope, "getQuotePreview:unavailable", {
|
|
1315
|
-
status: response.status
|
|
1362
|
+
return withPreflightTimeout("getQuotePreview", null, async (signal) => {
|
|
1363
|
+
try {
|
|
1364
|
+
const response = await fetch(url, {
|
|
1365
|
+
method: "POST",
|
|
1366
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1367
|
+
body: JSON.stringify(body),
|
|
1368
|
+
cache: "no-store",
|
|
1369
|
+
signal
|
|
1316
1370
|
});
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1371
|
+
if (!response.ok) {
|
|
1372
|
+
const refusal = await readPolicyRefusal(response);
|
|
1373
|
+
if (refusal) {
|
|
1374
|
+
debugLog(debug, scope, "getQuotePreview:refused", {
|
|
1375
|
+
code: refusal.policyRefusal.code
|
|
1376
|
+
});
|
|
1377
|
+
return refusal;
|
|
1378
|
+
}
|
|
1379
|
+
debugLog(debug, scope, "getQuotePreview:unavailable", {
|
|
1380
|
+
status: response.status
|
|
1381
|
+
});
|
|
1382
|
+
return null;
|
|
1383
|
+
}
|
|
1384
|
+
const quote = parseQuotePreview(await response.json());
|
|
1385
|
+
if (!quote) {
|
|
1386
|
+
debugLog(debug, scope, "getQuotePreview:unavailable", {
|
|
1387
|
+
status: response.status,
|
|
1388
|
+
reason: "malformed"
|
|
1389
|
+
});
|
|
1390
|
+
return null;
|
|
1391
|
+
}
|
|
1392
|
+
debugLog(debug, scope, "getQuotePreview:success", {
|
|
1393
|
+
settlementLayer: quote.settlementLayer,
|
|
1394
|
+
totalUsd: quote.fees.total.usd
|
|
1324
1395
|
});
|
|
1396
|
+
return quote;
|
|
1397
|
+
} catch (error) {
|
|
1398
|
+
debugError(debug, scope, "getQuotePreview:error", error);
|
|
1325
1399
|
return null;
|
|
1326
1400
|
}
|
|
1327
|
-
|
|
1328
|
-
settlementLayer: quote.settlementLayer,
|
|
1329
|
-
totalUsd: quote.fees.total.usd
|
|
1330
|
-
});
|
|
1331
|
-
return quote;
|
|
1332
|
-
} catch (error) {
|
|
1333
|
-
debugError(debug, scope, "getQuotePreview:error", error);
|
|
1334
|
-
return null;
|
|
1335
|
-
}
|
|
1401
|
+
});
|
|
1336
1402
|
},
|
|
1337
1403
|
async preparePermitDeposit(params) {
|
|
1338
1404
|
const url = apiUrl("/deposits/permit/prepare");
|
|
@@ -1343,88 +1409,98 @@ function createDepositService(baseUrl, options) {
|
|
|
1343
1409
|
token: params.token,
|
|
1344
1410
|
amount: params.amount
|
|
1345
1411
|
});
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
debugLog(debug, scope, "preparePermitDeposit:unavailable", {
|
|
1355
|
-
status: response.status
|
|
1356
|
-
});
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
const data = await response.json();
|
|
1360
|
-
if (!data || typeof data.available !== "boolean") {
|
|
1361
|
-
debugLog(debug, scope, "preparePermitDeposit:unavailable", {
|
|
1362
|
-
status: response.status,
|
|
1363
|
-
reason: "malformed"
|
|
1412
|
+
return withPreflightTimeout("preparePermitDeposit", null, async (signal) => {
|
|
1413
|
+
try {
|
|
1414
|
+
const response = await fetch(url, {
|
|
1415
|
+
method: "POST",
|
|
1416
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1417
|
+
body: JSON.stringify({ ...params, kind: "auto" }),
|
|
1418
|
+
cache: "no-store",
|
|
1419
|
+
signal
|
|
1364
1420
|
});
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1421
|
+
if (!response.ok) {
|
|
1422
|
+
const refusal = await readPolicyRefusal(response);
|
|
1423
|
+
if (refusal) {
|
|
1424
|
+
debugLog(debug, scope, "preparePermitDeposit:refused", {
|
|
1425
|
+
code: refusal.policyRefusal.code
|
|
1426
|
+
});
|
|
1427
|
+
return refusal;
|
|
1428
|
+
}
|
|
1429
|
+
debugLog(debug, scope, "preparePermitDeposit:unavailable", {
|
|
1430
|
+
status: response.status
|
|
1431
|
+
});
|
|
1370
1432
|
return null;
|
|
1371
1433
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
reason,
|
|
1385
|
-
...parsedApproval && { approval: parsedApproval }
|
|
1386
|
-
};
|
|
1387
|
-
}
|
|
1388
|
-
const authorization = data.authorization;
|
|
1389
|
-
if (!authorization || typeof authorization.typedData !== "object" || authorization.typedData === null || typeof authorization.nonce !== "string") {
|
|
1390
|
-
return null;
|
|
1391
|
-
}
|
|
1392
|
-
if (authorization.kind === "erc3009" && typeof authorization.validAfter === "string" && typeof authorization.validBefore === "string") {
|
|
1393
|
-
debugLog(debug, scope, "preparePermitDeposit:success", {
|
|
1394
|
-
kind: authorization.kind,
|
|
1395
|
-
nonce: authorization.nonce
|
|
1396
|
-
});
|
|
1397
|
-
return {
|
|
1398
|
-
available: true,
|
|
1399
|
-
authorization: {
|
|
1400
|
-
kind: "erc3009",
|
|
1401
|
-
typedData: authorization.typedData,
|
|
1402
|
-
nonce: authorization.nonce,
|
|
1403
|
-
validAfter: authorization.validAfter,
|
|
1404
|
-
validBefore: authorization.validBefore
|
|
1434
|
+
const data = await response.json();
|
|
1435
|
+
if (!data || typeof data.available !== "boolean") {
|
|
1436
|
+
debugLog(debug, scope, "preparePermitDeposit:unavailable", {
|
|
1437
|
+
status: response.status,
|
|
1438
|
+
reason: "malformed"
|
|
1439
|
+
});
|
|
1440
|
+
return null;
|
|
1441
|
+
}
|
|
1442
|
+
if (data.available === false) {
|
|
1443
|
+
const reason = data.reason;
|
|
1444
|
+
if (reason !== "permit2-approval-required" && reason !== "unsupported-token" && reason !== "unsupported-owner") {
|
|
1445
|
+
return null;
|
|
1405
1446
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1447
|
+
debugLog(debug, scope, "preparePermitDeposit:unavailable", {
|
|
1448
|
+
status: response.status,
|
|
1449
|
+
reason
|
|
1450
|
+
});
|
|
1451
|
+
const approval = data.approval;
|
|
1452
|
+
const parsedApproval = approval && typeof approval.token === "string" && typeof approval.spender === "string" && typeof approval.minimumAmount === "string" ? {
|
|
1453
|
+
token: approval.token,
|
|
1454
|
+
spender: approval.spender,
|
|
1455
|
+
minimumAmount: approval.minimumAmount
|
|
1456
|
+
} : void 0;
|
|
1457
|
+
return {
|
|
1458
|
+
available: false,
|
|
1459
|
+
reason,
|
|
1460
|
+
...parsedApproval && { approval: parsedApproval }
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
const authorization = data.authorization;
|
|
1464
|
+
if (!authorization || typeof authorization.typedData !== "object" || authorization.typedData === null || typeof authorization.nonce !== "string") {
|
|
1465
|
+
return null;
|
|
1466
|
+
}
|
|
1467
|
+
if (authorization.kind === "erc3009" && typeof authorization.validAfter === "string" && typeof authorization.validBefore === "string") {
|
|
1468
|
+
debugLog(debug, scope, "preparePermitDeposit:success", {
|
|
1416
1469
|
kind: authorization.kind,
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1470
|
+
nonce: authorization.nonce
|
|
1471
|
+
});
|
|
1472
|
+
return {
|
|
1473
|
+
available: true,
|
|
1474
|
+
authorization: {
|
|
1475
|
+
kind: "erc3009",
|
|
1476
|
+
typedData: authorization.typedData,
|
|
1477
|
+
nonce: authorization.nonce,
|
|
1478
|
+
validAfter: authorization.validAfter,
|
|
1479
|
+
validBefore: authorization.validBefore
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
if ((authorization.kind === "erc2612" || authorization.kind === "permit2") && typeof authorization.deadline === "string") {
|
|
1484
|
+
debugLog(debug, scope, "preparePermitDeposit:success", {
|
|
1485
|
+
kind: authorization.kind,
|
|
1486
|
+
nonce: authorization.nonce
|
|
1487
|
+
});
|
|
1488
|
+
return {
|
|
1489
|
+
available: true,
|
|
1490
|
+
authorization: {
|
|
1491
|
+
kind: authorization.kind,
|
|
1492
|
+
typedData: authorization.typedData,
|
|
1493
|
+
nonce: authorization.nonce,
|
|
1494
|
+
deadline: authorization.deadline
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
return null;
|
|
1499
|
+
} catch (error) {
|
|
1500
|
+
debugError(debug, scope, "preparePermitDeposit:error", error);
|
|
1501
|
+
return null;
|
|
1422
1502
|
}
|
|
1423
|
-
|
|
1424
|
-
} catch (error) {
|
|
1425
|
-
debugError(debug, scope, "preparePermitDeposit:error", error);
|
|
1426
|
-
return null;
|
|
1427
|
-
}
|
|
1503
|
+
});
|
|
1428
1504
|
},
|
|
1429
1505
|
async submitPermitDeposit(params) {
|
|
1430
1506
|
const url = apiUrl("/deposits/permit");
|
|
@@ -1440,7 +1516,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1440
1516
|
try {
|
|
1441
1517
|
response = await fetch(url, {
|
|
1442
1518
|
method: "POST",
|
|
1443
|
-
headers:
|
|
1519
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1444
1520
|
body: JSON.stringify(params)
|
|
1445
1521
|
});
|
|
1446
1522
|
} catch (error) {
|
|
@@ -1491,7 +1567,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1491
1567
|
try {
|
|
1492
1568
|
const response = await fetch(url, {
|
|
1493
1569
|
method: "GET",
|
|
1494
|
-
headers:
|
|
1570
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1495
1571
|
cache: "no-store"
|
|
1496
1572
|
});
|
|
1497
1573
|
if (!response.ok) {
|
|
@@ -1523,7 +1599,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1523
1599
|
try {
|
|
1524
1600
|
const response = await fetch(url, {
|
|
1525
1601
|
method: "GET",
|
|
1526
|
-
headers:
|
|
1602
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1527
1603
|
cache: "no-store"
|
|
1528
1604
|
});
|
|
1529
1605
|
if (!response.ok) {
|
|
@@ -1548,7 +1624,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1548
1624
|
});
|
|
1549
1625
|
const response = await fetch(url, {
|
|
1550
1626
|
method: "POST",
|
|
1551
|
-
headers:
|
|
1627
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1552
1628
|
body: JSON.stringify(params)
|
|
1553
1629
|
});
|
|
1554
1630
|
if (!response.ok) {
|
|
@@ -1580,7 +1656,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1580
1656
|
});
|
|
1581
1657
|
const response = await fetch(url, {
|
|
1582
1658
|
method: "POST",
|
|
1583
|
-
headers:
|
|
1659
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1584
1660
|
body: JSON.stringify(params)
|
|
1585
1661
|
});
|
|
1586
1662
|
if (!response.ok) {
|
|
@@ -1617,7 +1693,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1617
1693
|
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1618
1694
|
const response = await fetch(url, {
|
|
1619
1695
|
method: "GET",
|
|
1620
|
-
headers:
|
|
1696
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1621
1697
|
cache: "no-store"
|
|
1622
1698
|
});
|
|
1623
1699
|
if (!response.ok) {
|
|
@@ -1670,7 +1746,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1670
1746
|
try {
|
|
1671
1747
|
const response = await fetch(url, {
|
|
1672
1748
|
method: "GET",
|
|
1673
|
-
headers:
|
|
1749
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1674
1750
|
cache: "no-store"
|
|
1675
1751
|
});
|
|
1676
1752
|
if (!response.ok) {
|
|
@@ -1733,9 +1809,11 @@ function createDepositService(baseUrl, options) {
|
|
|
1733
1809
|
},
|
|
1734
1810
|
getTopTokens() {
|
|
1735
1811
|
if (!topTokensPromise) {
|
|
1736
|
-
const attempt = requestTopTokens().then((
|
|
1737
|
-
if (!
|
|
1738
|
-
|
|
1812
|
+
const attempt = requestTopTokens().then((result) => {
|
|
1813
|
+
if (!result.ok && topTokensPromise === attempt) {
|
|
1814
|
+
topTokensPromise = null;
|
|
1815
|
+
}
|
|
1816
|
+
return result;
|
|
1739
1817
|
});
|
|
1740
1818
|
topTokensPromise = attempt;
|
|
1741
1819
|
}
|
|
@@ -1756,7 +1834,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1756
1834
|
try {
|
|
1757
1835
|
const response = await fetch(url, {
|
|
1758
1836
|
method: "GET",
|
|
1759
|
-
headers:
|
|
1837
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1760
1838
|
cache: "no-store"
|
|
1761
1839
|
});
|
|
1762
1840
|
if (!response.ok) {
|
|
@@ -1783,14 +1861,14 @@ function createDepositService(baseUrl, options) {
|
|
|
1783
1861
|
);
|
|
1784
1862
|
const response = await fetch(url, {
|
|
1785
1863
|
method: "GET",
|
|
1786
|
-
headers:
|
|
1864
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
1787
1865
|
cache: "no-store"
|
|
1788
1866
|
});
|
|
1789
1867
|
if (!response.ok) return null;
|
|
1790
1868
|
let body = null;
|
|
1791
1869
|
try {
|
|
1792
1870
|
body = await response.json();
|
|
1793
|
-
} catch (
|
|
1871
|
+
} catch (e5) {
|
|
1794
1872
|
return null;
|
|
1795
1873
|
}
|
|
1796
1874
|
if (!body || body.ok !== true) return null;
|
|
@@ -1971,6 +2049,60 @@ function useStableRpcUrls(rpcUrls) {
|
|
|
1971
2049
|
|
|
1972
2050
|
|
|
1973
2051
|
|
|
2052
|
+
|
|
2053
|
+
// src/core/deposit-bounds.ts
|
|
2054
|
+
|
|
2055
|
+
function findListed(options, chain, token) {
|
|
2056
|
+
const normalize2 = (value) => chain === "solana" ? value : value.toLowerCase();
|
|
2057
|
+
return _optionalChain([options, 'access', _71 => _71.tokens, 'access', _72 => _72[String(chain)], 'optionalAccess', _73 => _73.find, 'call', _74 => _74(
|
|
2058
|
+
(listed) => normalize2(listed.address) === normalize2(token)
|
|
2059
|
+
)]);
|
|
2060
|
+
}
|
|
2061
|
+
function isExcludedByRestrictedList(options, chain, token) {
|
|
2062
|
+
return Boolean(_optionalChain([options, 'optionalAccess', _75 => _75.restricted]) && !findListed(options, chain, token));
|
|
2063
|
+
}
|
|
2064
|
+
function findDepositBounds(options, chain, token) {
|
|
2065
|
+
if (!_optionalChain([options, 'optionalAccess', _76 => _76.restricted])) return void 0;
|
|
2066
|
+
const entry = findListed(options, chain, token);
|
|
2067
|
+
if (!entry || entry.minAmount === void 0 && entry.maxAmount === void 0) {
|
|
2068
|
+
return void 0;
|
|
2069
|
+
}
|
|
2070
|
+
return {
|
|
2071
|
+
symbol: entry.symbol,
|
|
2072
|
+
decimals: entry.decimals,
|
|
2073
|
+
...entry.minAmount !== void 0 && { minAmount: BigInt(entry.minAmount) },
|
|
2074
|
+
...entry.maxAmount !== void 0 && { maxAmount: BigInt(entry.maxAmount) }
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
function boundMessage(bounds, bound) {
|
|
2078
|
+
const raw = _optionalChain([bounds, 'optionalAccess', _77 => _77[bound]]);
|
|
2079
|
+
if (!bounds || raw === void 0) return null;
|
|
2080
|
+
const amount = new Intl.NumberFormat("en-US", {
|
|
2081
|
+
maximumFractionDigits: Math.min(bounds.decimals, 20)
|
|
2082
|
+
}).format(Number(_viem.formatUnits.call(void 0, raw, bounds.decimals)));
|
|
2083
|
+
return `${bound === "minAmount" ? "Minimum" : "Maximum"} deposit is ${amount} ${bounds.symbol}`;
|
|
2084
|
+
}
|
|
2085
|
+
function depositBoundsViolation(bounds, units) {
|
|
2086
|
+
if (!bounds || units === null || units <= 0n) return null;
|
|
2087
|
+
if (bounds.minAmount !== void 0 && units < bounds.minAmount) {
|
|
2088
|
+
return boundMessage(bounds, "minAmount");
|
|
2089
|
+
}
|
|
2090
|
+
if (bounds.maxAmount !== void 0 && units > bounds.maxAmount) {
|
|
2091
|
+
return boundMessage(bounds, "maxAmount");
|
|
2092
|
+
}
|
|
2093
|
+
return null;
|
|
2094
|
+
}
|
|
2095
|
+
function describePolicyRefusal(refusal, bounds) {
|
|
2096
|
+
switch (refusal.code) {
|
|
2097
|
+
case "BALANCE-4":
|
|
2098
|
+
return _nullishCoalesce(boundMessage(bounds, "minAmount"), () => ( "This amount is below the minimum deposit"));
|
|
2099
|
+
case "BALANCE-3":
|
|
2100
|
+
return _nullishCoalesce(boundMessage(bounds, "maxAmount"), () => ( "This amount is above the maximum deposit"));
|
|
2101
|
+
default:
|
|
2102
|
+
return "This token isn't accepted for deposits";
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
|
|
1974
2106
|
// src/core/public-client.ts
|
|
1975
2107
|
|
|
1976
2108
|
var clientCache = /* @__PURE__ */ new Map();
|
|
@@ -2042,7 +2174,7 @@ async function loadViemChains() {
|
|
|
2042
2174
|
viemChainsPromise = Promise.resolve().then(() => _interopRequireWildcard(require("viem/chains"))).then((module) => {
|
|
2043
2175
|
const map = /* @__PURE__ */ new Map();
|
|
2044
2176
|
for (const value of Object.values(module)) {
|
|
2045
|
-
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access',
|
|
2177
|
+
if (value && typeof value === "object" && typeof value.id === "number" && _optionalChain([value, 'access', _78 => _78.rpcUrls, 'optionalAccess', _79 => _79.default, 'optionalAccess', _80 => _80.http, 'optionalAccess', _81 => _81.length])) {
|
|
2046
2178
|
const chain = value;
|
|
2047
2179
|
const existing = map.get(chain.id);
|
|
2048
2180
|
if (existing) existing.push(chain);
|
|
@@ -2056,7 +2188,7 @@ async function loadViemChains() {
|
|
|
2056
2188
|
return viemChainsPromise;
|
|
2057
2189
|
}
|
|
2058
2190
|
function pickViemChain(candidates, chain) {
|
|
2059
|
-
if (!_optionalChain([candidates, 'optionalAccess',
|
|
2191
|
+
if (!_optionalChain([candidates, 'optionalAccess', _82 => _82.length])) return void 0;
|
|
2060
2192
|
if (candidates.length === 1) return candidates[0];
|
|
2061
2193
|
const sameNetworkClass = candidates.filter(
|
|
2062
2194
|
(candidate) => Boolean(candidate.testnet) === chain.testnet
|
|
@@ -2072,10 +2204,10 @@ function pickViemChain(candidates, chain) {
|
|
|
2072
2204
|
}
|
|
2073
2205
|
function resolveRpcUrls(chain, override, viemChains) {
|
|
2074
2206
|
const urls = [];
|
|
2075
|
-
if (_optionalChain([override, 'optionalAccess',
|
|
2207
|
+
if (_optionalChain([override, 'optionalAccess', _83 => _83.trim, 'call', _84 => _84()])) urls.push(override.trim());
|
|
2076
2208
|
if (chain.publicRpcUrl) urls.push(chain.publicRpcUrl);
|
|
2077
2209
|
if (chain.chainId !== null && chain.vmType === "evm") {
|
|
2078
|
-
const http2 = _optionalChain([pickViemChain, 'call',
|
|
2210
|
+
const http2 = _optionalChain([pickViemChain, 'call', _85 => _85(_optionalChain([viemChains, 'optionalAccess', _86 => _86.get, 'call', _87 => _87(chain.chainId)]), chain), 'optionalAccess', _88 => _88.rpcUrls, 'optionalAccess', _89 => _89.default, 'optionalAccess', _90 => _90.http]);
|
|
2079
2211
|
if (http2) urls.push(...http2);
|
|
2080
2212
|
}
|
|
2081
2213
|
return [...new Set(urls)];
|
|
@@ -2084,7 +2216,7 @@ function toViemChain(chain, override, viemChains) {
|
|
|
2084
2216
|
if (chain.vmType !== "evm" || chain.chainId === null) return null;
|
|
2085
2217
|
const rpcUrls = resolveRpcUrls(chain, override, viemChains);
|
|
2086
2218
|
if (rpcUrls.length === 0) return null;
|
|
2087
|
-
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess',
|
|
2219
|
+
const bundled = pickViemChain(_optionalChain([viemChains, 'optionalAccess', _91 => _91.get, 'call', _92 => _92(chain.chainId)]), chain);
|
|
2088
2220
|
if (bundled) {
|
|
2089
2221
|
if (rpcUrls[0] === bundled.rpcUrls.default.http[0]) return bundled;
|
|
2090
2222
|
return _viem.defineChain.call(void 0, {
|
|
@@ -2115,7 +2247,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2115
2247
|
for (const entry of catalog.all) {
|
|
2116
2248
|
const chain = toViemChain(
|
|
2117
2249
|
entry,
|
|
2118
|
-
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess',
|
|
2250
|
+
entry.chainId === null ? void 0 : _optionalChain([overrides, 'optionalAccess', _93 => _93[entry.chainId]]),
|
|
2119
2251
|
viemChains
|
|
2120
2252
|
);
|
|
2121
2253
|
if (chain) chains.push(chain);
|
|
@@ -2124,7 +2256,7 @@ function toViemChains(catalog, overrides, viemChains) {
|
|
|
2124
2256
|
}
|
|
2125
2257
|
function needsViemChains(catalog, overrides) {
|
|
2126
2258
|
return catalog.all.some(
|
|
2127
|
-
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess',
|
|
2259
|
+
(chain) => chain.vmType === "evm" && chain.chainId !== null && !chain.publicRpcUrl && !_optionalChain([overrides, 'optionalAccess', _94 => _94[chain.chainId], 'optionalAccess', _95 => _95.trim, 'call', _96 => _96()])
|
|
2128
2260
|
);
|
|
2129
2261
|
}
|
|
2130
2262
|
|
|
@@ -2135,6 +2267,9 @@ var EMPTY = {
|
|
|
2135
2267
|
viemChains: null,
|
|
2136
2268
|
isLoading: true,
|
|
2137
2269
|
shortlist: null,
|
|
2270
|
+
depositOptions: { status: "loading" },
|
|
2271
|
+
retryDepositOptions: () => {
|
|
2272
|
+
},
|
|
2138
2273
|
clientCapableChainIds: null
|
|
2139
2274
|
};
|
|
2140
2275
|
var ChainCatalogContext = _react.createContext.call(void 0, EMPTY);
|
|
@@ -2200,9 +2335,9 @@ function publishRuntimeChainMeta(catalog) {
|
|
|
2200
2335
|
name: chain.name,
|
|
2201
2336
|
iconUrl: _nullishCoalesce(chain.iconUrl, () => ( void 0)),
|
|
2202
2337
|
nativeSymbol: chain.nativeToken.symbol,
|
|
2203
|
-
explorerUrl: _optionalChain([chain, 'access',
|
|
2204
|
-
explorerTxPath: _optionalChain([chain, 'access',
|
|
2205
|
-
explorerAddressPath: _optionalChain([chain, 'access',
|
|
2338
|
+
explorerUrl: _optionalChain([chain, 'access', _97 => _97.explorer, 'optionalAccess', _98 => _98.url]),
|
|
2339
|
+
explorerTxPath: _optionalChain([chain, 'access', _99 => _99.explorer, 'optionalAccess', _100 => _100.txPath]),
|
|
2340
|
+
explorerAddressPath: _optionalChain([chain, 'access', _101 => _101.explorer, 'optionalAccess', _102 => _102.addressPath])
|
|
2206
2341
|
}));
|
|
2207
2342
|
})
|
|
2208
2343
|
);
|
|
@@ -2275,7 +2410,7 @@ function useTargetTokens() {
|
|
|
2275
2410
|
const { catalog, shortlist } = useChainCatalog();
|
|
2276
2411
|
return _react.useMemo.call(void 0, () => {
|
|
2277
2412
|
return (chainId) => {
|
|
2278
|
-
const fromShortlist = _optionalChain([shortlist, 'optionalAccess',
|
|
2413
|
+
const fromShortlist = _optionalChain([shortlist, 'optionalAccess', _103 => _103[String(chainId)]]);
|
|
2279
2414
|
if (fromShortlist) {
|
|
2280
2415
|
return fromShortlist.map((token) => ({
|
|
2281
2416
|
symbol: token.symbol,
|
|
@@ -2283,8 +2418,8 @@ function useTargetTokens() {
|
|
|
2283
2418
|
decimals: token.decimals
|
|
2284
2419
|
}));
|
|
2285
2420
|
}
|
|
2286
|
-
const entry = _optionalChain([catalog, 'optionalAccess',
|
|
2287
|
-
return Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
2421
|
+
const entry = _optionalChain([catalog, 'optionalAccess', _104 => _104.byChainId, 'access', _105 => _105.get, 'call', _106 => _106(chainId)]);
|
|
2422
|
+
return Array.isArray(_optionalChain([entry, 'optionalAccess', _107 => _107.supportedTokens])) ? entry.supportedTokens.map((token) => ({
|
|
2288
2423
|
symbol: token.symbol,
|
|
2289
2424
|
address: token.address,
|
|
2290
2425
|
decimals: token.decimals
|
|
@@ -2292,6 +2427,48 @@ function useTargetTokens() {
|
|
|
2292
2427
|
};
|
|
2293
2428
|
}, [catalog, shortlist]);
|
|
2294
2429
|
}
|
|
2430
|
+
function createDepositOffer(state, retry) {
|
|
2431
|
+
const options = state.status === "ready" ? state.options : null;
|
|
2432
|
+
const restricted = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _108 => _108.restricted]), () => ( false));
|
|
2433
|
+
const listed = (chain) => _optionalChain([options, 'optionalAccess', _109 => _109.tokens, 'access', _110 => _110[String(chain)]]);
|
|
2434
|
+
const isChainOffered = (chain) => {
|
|
2435
|
+
if (!options) return false;
|
|
2436
|
+
const entry = listed(chain);
|
|
2437
|
+
return restricted ? (_nullishCoalesce(_optionalChain([entry, 'optionalAccess', _111 => _111.length]), () => ( 0))) > 0 : _optionalChain([entry, 'optionalAccess', _112 => _112.length]) !== 0;
|
|
2438
|
+
};
|
|
2439
|
+
return {
|
|
2440
|
+
status: state.status,
|
|
2441
|
+
restricted,
|
|
2442
|
+
retry,
|
|
2443
|
+
tokensFor: (chain) => {
|
|
2444
|
+
if (!options) return [];
|
|
2445
|
+
const entry = listed(chain);
|
|
2446
|
+
return restricted ? _nullishCoalesce(entry, () => ( [])) : entry;
|
|
2447
|
+
},
|
|
2448
|
+
isChainOffered
|
|
2449
|
+
};
|
|
2450
|
+
}
|
|
2451
|
+
function useDepositOffer() {
|
|
2452
|
+
const { depositOptions, retryDepositOptions } = useChainCatalog();
|
|
2453
|
+
return _react.useMemo.call(void 0,
|
|
2454
|
+
() => createDepositOffer(depositOptions, retryDepositOptions),
|
|
2455
|
+
[depositOptions, retryDepositOptions]
|
|
2456
|
+
);
|
|
2457
|
+
}
|
|
2458
|
+
function useDepositBounds() {
|
|
2459
|
+
const { depositOptions } = useChainCatalog();
|
|
2460
|
+
return _react.useMemo.call(void 0, () => {
|
|
2461
|
+
const options = depositOptions.status === "ready" ? depositOptions.options : null;
|
|
2462
|
+
return (chain, token) => findDepositBounds(options, chain, token);
|
|
2463
|
+
}, [depositOptions]);
|
|
2464
|
+
}
|
|
2465
|
+
function useRestrictedListExclusion() {
|
|
2466
|
+
const { depositOptions } = useChainCatalog();
|
|
2467
|
+
return _react.useMemo.call(void 0, () => {
|
|
2468
|
+
const options = depositOptions.status === "ready" ? depositOptions.options : null;
|
|
2469
|
+
return (chain, token) => isExcludedByRestrictedList(options, chain, token);
|
|
2470
|
+
}, [depositOptions]);
|
|
2471
|
+
}
|
|
2295
2472
|
function useIsDepositChain() {
|
|
2296
2473
|
const ids = useDepositChainIds();
|
|
2297
2474
|
const { clientCapableChainIds } = useChainCatalog();
|
|
@@ -2307,7 +2484,7 @@ function useChainName() {
|
|
|
2307
2484
|
if (!catalog) return _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId);
|
|
2308
2485
|
const key = catalogKeyForChain(chainId);
|
|
2309
2486
|
const entry = typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2310
|
-
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
2487
|
+
return _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _113 => _113.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
2311
2488
|
};
|
|
2312
2489
|
}, [catalog]);
|
|
2313
2490
|
}
|
|
@@ -2331,7 +2508,7 @@ function useExplorerTxUrl() {
|
|
|
2331
2508
|
return (chainId, txHash) => {
|
|
2332
2509
|
if (chainId === "hypercore") return _chunkOY5N3E6Lcjs.getExplorerTxUrl.call(void 0, chainId, txHash);
|
|
2333
2510
|
const key = catalog ? catalogKeyForChain(chainId) : void 0;
|
|
2334
|
-
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess',
|
|
2511
|
+
const entry = key === void 0 ? void 0 : typeof key === "number" ? _optionalChain([catalog, 'optionalAccess', _114 => _114.byChainId, 'access', _115 => _115.get, 'call', _116 => _116(key)]) : _optionalChain([catalog, 'optionalAccess', _117 => _117.byCaip2, 'access', _118 => _118.get, 'call', _119 => _119(key)]);
|
|
2335
2512
|
return _nullishCoalesce(catalogExplorerTxUrl(entry, txHash), () => ( _chunkOY5N3E6Lcjs.getExplorerTxUrl.call(void 0, chainId, txHash)));
|
|
2336
2513
|
};
|
|
2337
2514
|
}, [catalog]);
|
|
@@ -2384,19 +2561,36 @@ function ChainCatalogProvider({
|
|
|
2384
2561
|
const chains = toViemChains(catalog, overrides, viemChains);
|
|
2385
2562
|
if (chains.length > 0) setRuntimeChains(chains);
|
|
2386
2563
|
}, [catalog, viemChains, overrides]);
|
|
2387
|
-
const [
|
|
2564
|
+
const [depositOptions, setDepositOptions] = _react.useState.call(void 0, {
|
|
2565
|
+
status: "loading"
|
|
2566
|
+
});
|
|
2567
|
+
const [depositOptionsAttempt, setDepositOptionsAttempt] = _react.useState.call(void 0, 0);
|
|
2388
2568
|
_react.useEffect.call(void 0, () => {
|
|
2389
2569
|
let active = true;
|
|
2390
|
-
|
|
2391
|
-
service.getTopTokens().then(
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2570
|
+
setDepositOptions({ status: "loading" });
|
|
2571
|
+
service.getTopTokens().then(
|
|
2572
|
+
(result) => {
|
|
2573
|
+
if (!active) return;
|
|
2574
|
+
if (!_optionalChain([result, 'optionalAccess', _120 => _120.ok])) {
|
|
2575
|
+
setDepositOptions({ status: "error" });
|
|
2576
|
+
return;
|
|
2577
|
+
}
|
|
2578
|
+
_chunkOY5N3E6Lcjs.publishShortlistTokens.call(void 0, result.options.tokens);
|
|
2579
|
+
setDepositOptions({ status: "ready", options: result.options });
|
|
2580
|
+
},
|
|
2581
|
+
() => {
|
|
2582
|
+
if (active) setDepositOptions({ status: "error" });
|
|
2583
|
+
}
|
|
2584
|
+
);
|
|
2396
2585
|
return () => {
|
|
2397
2586
|
active = false;
|
|
2398
2587
|
};
|
|
2399
|
-
}, [service]);
|
|
2588
|
+
}, [service, depositOptionsAttempt]);
|
|
2589
|
+
const retryDepositOptions = _react.useCallback.call(void 0,
|
|
2590
|
+
() => setDepositOptionsAttempt((attempt) => attempt + 1),
|
|
2591
|
+
[]
|
|
2592
|
+
);
|
|
2593
|
+
const shortlist = depositOptions.status === "ready" ? depositOptions.options.tokens : null;
|
|
2400
2594
|
const clientCapableChainIds = _react.useMemo.call(void 0, () => {
|
|
2401
2595
|
if (!catalog) return null;
|
|
2402
2596
|
return new Set(
|
|
@@ -2409,9 +2603,19 @@ function ChainCatalogProvider({
|
|
|
2409
2603
|
viemChains,
|
|
2410
2604
|
isLoading,
|
|
2411
2605
|
shortlist,
|
|
2606
|
+
depositOptions,
|
|
2607
|
+
retryDepositOptions,
|
|
2412
2608
|
clientCapableChainIds
|
|
2413
2609
|
}),
|
|
2414
|
-
[
|
|
2610
|
+
[
|
|
2611
|
+
catalog,
|
|
2612
|
+
viemChains,
|
|
2613
|
+
isLoading,
|
|
2614
|
+
shortlist,
|
|
2615
|
+
depositOptions,
|
|
2616
|
+
retryDepositOptions,
|
|
2617
|
+
clientCapableChainIds
|
|
2618
|
+
]
|
|
2415
2619
|
);
|
|
2416
2620
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainCatalogContext.Provider, { value, children });
|
|
2417
2621
|
}
|
|
@@ -2492,7 +2696,7 @@ function createIngestTransport(options) {
|
|
|
2492
2696
|
function report(reason, status) {
|
|
2493
2697
|
try {
|
|
2494
2698
|
onFailure({ reason, status, droppedEvents: dropped });
|
|
2495
|
-
} catch (
|
|
2699
|
+
} catch (e6) {
|
|
2496
2700
|
}
|
|
2497
2701
|
}
|
|
2498
2702
|
function drop(batch, reason, status) {
|
|
@@ -2546,10 +2750,10 @@ function createIngestTransport(options) {
|
|
|
2546
2750
|
}
|
|
2547
2751
|
function interruptForUnload() {
|
|
2548
2752
|
for (const wake of [...sleepers]) wake();
|
|
2549
|
-
_optionalChain([mintAbort, 'optionalAccess',
|
|
2753
|
+
_optionalChain([mintAbort, 'optionalAccess', _121 => _121.abort, 'call', _122 => _122()]);
|
|
2550
2754
|
}
|
|
2551
2755
|
function retryDelay(response, attempt) {
|
|
2552
|
-
const seconds = Number(_optionalChain([response, 'access',
|
|
2756
|
+
const seconds = Number(_optionalChain([response, 'access', _123 => _123.headers, 'optionalAccess', _124 => _124.get, 'optionalCall', _125 => _125("Retry-After")]));
|
|
2553
2757
|
if (Number.isFinite(seconds) && seconds > 0) {
|
|
2554
2758
|
return Math.min(seconds * 1e3, MAX_BACKOFF_MS);
|
|
2555
2759
|
}
|
|
@@ -2564,10 +2768,10 @@ function createIngestTransport(options) {
|
|
|
2564
2768
|
try {
|
|
2565
2769
|
response = await fetchImpl(mintUrl, {
|
|
2566
2770
|
method: "POST",
|
|
2567
|
-
headers:
|
|
2568
|
-
signal: _optionalChain([controller, 'optionalAccess',
|
|
2771
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
2772
|
+
signal: _optionalChain([controller, 'optionalAccess', _126 => _126.signal])
|
|
2569
2773
|
});
|
|
2570
|
-
} catch (
|
|
2774
|
+
} catch (e7) {
|
|
2571
2775
|
if (urgency !== DISMISSAL) {
|
|
2572
2776
|
mintFailures += 1;
|
|
2573
2777
|
mintBackoffUntil = now() + backoff(mintFailures);
|
|
@@ -2595,7 +2799,7 @@ function createIngestTransport(options) {
|
|
|
2595
2799
|
token = { value, expiresAt };
|
|
2596
2800
|
mintFailures = 0;
|
|
2597
2801
|
mintBackoffUntil = 0;
|
|
2598
|
-
} catch (
|
|
2802
|
+
} catch (e8) {
|
|
2599
2803
|
mintUnavailable = true;
|
|
2600
2804
|
report("token_unavailable", response.status);
|
|
2601
2805
|
}
|
|
@@ -2635,7 +2839,7 @@ function createIngestTransport(options) {
|
|
|
2635
2839
|
body: bodyOf(batch),
|
|
2636
2840
|
keepalive: true
|
|
2637
2841
|
});
|
|
2638
|
-
} catch (
|
|
2842
|
+
} catch (e9) {
|
|
2639
2843
|
if (terminal || attempt >= MAX_ATTEMPTS) {
|
|
2640
2844
|
return drop(batch, "network");
|
|
2641
2845
|
}
|
|
@@ -2740,7 +2944,7 @@ function createIngestTransport(options) {
|
|
|
2740
2944
|
}
|
|
2741
2945
|
},
|
|
2742
2946
|
flush(flushOptions) {
|
|
2743
|
-
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess',
|
|
2947
|
+
const dismissal = _nullishCoalesce(_optionalChain([flushOptions, 'optionalAccess', _127 => _127.terminal]), () => ( false));
|
|
2744
2948
|
if (disposed && !dismissal) return;
|
|
2745
2949
|
clearFlushTimer();
|
|
2746
2950
|
void run(dismissal ? DISMISSAL : IDLE);
|
|
@@ -2755,11 +2959,11 @@ function createIngestTransport(options) {
|
|
|
2755
2959
|
};
|
|
2756
2960
|
}
|
|
2757
2961
|
function randomUuid() {
|
|
2758
|
-
if (typeof _optionalChain([globalThis, 'access',
|
|
2962
|
+
if (typeof _optionalChain([globalThis, 'access', _128 => _128.crypto, 'optionalAccess', _129 => _129.randomUUID]) === "function") {
|
|
2759
2963
|
return globalThis.crypto.randomUUID();
|
|
2760
2964
|
}
|
|
2761
2965
|
const bytes = new Uint8Array(16);
|
|
2762
|
-
_optionalChain([globalThis, 'access',
|
|
2966
|
+
_optionalChain([globalThis, 'access', _130 => _130.crypto, 'optionalAccess', _131 => _131.getRandomValues, 'optionalCall', _132 => _132(bytes)]);
|
|
2763
2967
|
if (!bytes.some(Boolean)) {
|
|
2764
2968
|
for (let index = 0; index < bytes.length; index += 1) {
|
|
2765
2969
|
bytes[index] = Math.floor(Math.random() * 256);
|
|
@@ -2773,9 +2977,9 @@ function randomUuid() {
|
|
|
2773
2977
|
function resolveProxyOrigin(backendUrl) {
|
|
2774
2978
|
if (!backendUrl.trim()) return null;
|
|
2775
2979
|
try {
|
|
2776
|
-
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access',
|
|
2980
|
+
const { origin } = new URL(backendUrl, _optionalChain([globalThis, 'access', _133 => _133.location, 'optionalAccess', _134 => _134.href]));
|
|
2777
2981
|
return origin.startsWith("http") ? origin : null;
|
|
2778
|
-
} catch (
|
|
2982
|
+
} catch (e10) {
|
|
2779
2983
|
return null;
|
|
2780
2984
|
}
|
|
2781
2985
|
}
|
|
@@ -2825,13 +3029,13 @@ function AnalyticsSession(props) {
|
|
|
2825
3029
|
type: "analytics_ingest_failure",
|
|
2826
3030
|
session_id: sessionIdRef.current,
|
|
2827
3031
|
modal,
|
|
2828
|
-
widget_version:
|
|
3032
|
+
widget_version: _chunkN6JJG57Rcjs.MODAL_VERSION,
|
|
2829
3033
|
timestamp: nowRef.current().toISOString(),
|
|
2830
3034
|
reason,
|
|
2831
3035
|
...status === void 0 ? {} : { status },
|
|
2832
3036
|
dropped_events: droppedEvents
|
|
2833
3037
|
};
|
|
2834
|
-
_optionalChain([onEventRef, 'access',
|
|
3038
|
+
_optionalChain([onEventRef, 'access', _135 => _135.current, 'optionalCall', _136 => _136(event)]);
|
|
2835
3039
|
},
|
|
2836
3040
|
[modal]
|
|
2837
3041
|
);
|
|
@@ -2853,7 +3057,7 @@ function AnalyticsSession(props) {
|
|
|
2853
3057
|
proxyOrigin,
|
|
2854
3058
|
sessionId: sessionIdRef.current,
|
|
2855
3059
|
modal,
|
|
2856
|
-
widgetVersion:
|
|
3060
|
+
widgetVersion: _chunkN6JJG57Rcjs.MODAL_VERSION,
|
|
2857
3061
|
sessionProperties: sessionPropertiesRef.current,
|
|
2858
3062
|
onFailure: (failure) => emitFailure(failure),
|
|
2859
3063
|
fetchImpl: props.fetchImpl,
|
|
@@ -2870,10 +3074,10 @@ function AnalyticsSession(props) {
|
|
|
2870
3074
|
const enqueue = _react.useCallback.call(void 0,
|
|
2871
3075
|
(event) => {
|
|
2872
3076
|
try {
|
|
2873
|
-
_optionalChain([ingestRef, 'access',
|
|
3077
|
+
_optionalChain([ingestRef, 'access', _137 => _137.current, 'optionalAccess', _138 => _138.transport, 'optionalAccess', _139 => _139.enqueue, 'call', _140 => _140(
|
|
2874
3078
|
event
|
|
2875
3079
|
)]);
|
|
2876
|
-
} catch (
|
|
3080
|
+
} catch (e11) {
|
|
2877
3081
|
}
|
|
2878
3082
|
},
|
|
2879
3083
|
[]
|
|
@@ -2909,12 +3113,12 @@ function AnalyticsSession(props) {
|
|
|
2909
3113
|
...payload,
|
|
2910
3114
|
session_id: sessionIdRef.current,
|
|
2911
3115
|
modal,
|
|
2912
|
-
widget_version:
|
|
3116
|
+
widget_version: _chunkN6JJG57Rcjs.MODAL_VERSION,
|
|
2913
3117
|
timestamp: nowRef.current().toISOString(),
|
|
2914
3118
|
session_properties: sessionPropertiesRef.current,
|
|
2915
3119
|
funding_method: fundingMethod
|
|
2916
3120
|
};
|
|
2917
|
-
_optionalChain([onEventRef, 'access',
|
|
3121
|
+
_optionalChain([onEventRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142(
|
|
2918
3122
|
event
|
|
2919
3123
|
)]);
|
|
2920
3124
|
enqueue(event);
|
|
@@ -2928,11 +3132,11 @@ function AnalyticsSession(props) {
|
|
|
2928
3132
|
...payload,
|
|
2929
3133
|
session_id: sessionIdRef.current,
|
|
2930
3134
|
modal,
|
|
2931
|
-
widget_version:
|
|
3135
|
+
widget_version: _chunkN6JJG57Rcjs.MODAL_VERSION,
|
|
2932
3136
|
timestamp: nowRef.current().toISOString(),
|
|
2933
3137
|
session_properties: sessionPropertiesRef.current
|
|
2934
3138
|
};
|
|
2935
|
-
_optionalChain([onEventRef, 'access',
|
|
3139
|
+
_optionalChain([onEventRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144(event)]);
|
|
2936
3140
|
enqueue(event);
|
|
2937
3141
|
},
|
|
2938
3142
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -2944,11 +3148,11 @@ function AnalyticsSession(props) {
|
|
|
2944
3148
|
...payload,
|
|
2945
3149
|
session_id: sessionIdRef.current,
|
|
2946
3150
|
modal,
|
|
2947
|
-
widget_version:
|
|
3151
|
+
widget_version: _chunkN6JJG57Rcjs.MODAL_VERSION,
|
|
2948
3152
|
timestamp: nowRef.current().toISOString(),
|
|
2949
3153
|
session_properties: sessionPropertiesRef.current
|
|
2950
3154
|
};
|
|
2951
|
-
_optionalChain([onEventRef, 'access',
|
|
3155
|
+
_optionalChain([onEventRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(event)]);
|
|
2952
3156
|
enqueue(event);
|
|
2953
3157
|
},
|
|
2954
3158
|
[enqueue, modal, nowRef, onEventRef]
|
|
@@ -3011,17 +3215,38 @@ function recoveryFailureCause(sourceChainName) {
|
|
|
3011
3215
|
}
|
|
3012
3216
|
|
|
3013
3217
|
// src/core/history-status.ts
|
|
3014
|
-
|
|
3218
|
+
var UNKNOWN = ["pending", false, []];
|
|
3219
|
+
var STATUS_FACTS = [
|
|
3220
|
+
// `delayed` is held up but still coming on the corridor's schedule.
|
|
3221
|
+
["pending", true, ["pending", "delayed"]],
|
|
3222
|
+
// Nothing emits `submitted` or `bridging`; they are here so the badge and
|
|
3223
|
+
// the arrival line cannot diverge should a row ever carry them.
|
|
3224
|
+
["processing", true, ["processing", "submitted", "bridging"]],
|
|
3225
|
+
["completed", false, ["completed", "complete", "bridge-complete", "processed"]],
|
|
3226
|
+
// `rejected` is recoverable upstream exactly like `failed`, so it must not
|
|
3227
|
+
// read as Pending — a row offering recovery would otherwise claim to still
|
|
3228
|
+
// be on its way.
|
|
3229
|
+
["failed", false, ["failed", "error", "bridge-failed", "rejected"]],
|
|
3230
|
+
// Where a recovered deposit lands. Terminal and not recoverable again.
|
|
3231
|
+
["refunded", false, ["refunded"]],
|
|
3232
|
+
// These read Pending but are not arriving: the deposit is bound for a refund
|
|
3233
|
+
// or for manual reconciliation rather than for the recipient, so an arrival
|
|
3234
|
+
// expectation would be a claim about a corridor it never enters.
|
|
3235
|
+
["pending", false, ["ignored", "expecting_refund", "reconciliation_required"]]
|
|
3236
|
+
];
|
|
3237
|
+
function lookup(raw) {
|
|
3015
3238
|
const lower = raw.toLowerCase();
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3239
|
+
return _nullishCoalesce(STATUS_FACTS.find((facts) => facts[2].includes(lower)), () => ( UNKNOWN));
|
|
3240
|
+
}
|
|
3241
|
+
function normalizeStatus(raw, isSpam) {
|
|
3242
|
+
const [badge] = lookup(raw);
|
|
3243
|
+
return isSpam && badge === "failed" ? "spam" : badge;
|
|
3244
|
+
}
|
|
3245
|
+
function isInFlight(status) {
|
|
3246
|
+
return status === "pending" || status === "processing";
|
|
3247
|
+
}
|
|
3248
|
+
function expectsArrival(raw) {
|
|
3249
|
+
return lookup(raw)[1];
|
|
3025
3250
|
}
|
|
3026
3251
|
var STATUS_LABEL = {
|
|
3027
3252
|
pending: "Pending",
|
|
@@ -3033,7 +3258,7 @@ var STATUS_LABEL = {
|
|
|
3033
3258
|
};
|
|
3034
3259
|
function filterVisibleDeposits(deposits) {
|
|
3035
3260
|
const sourceHashes = new Set(
|
|
3036
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
3261
|
+
deposits.map((d) => _optionalChain([d, 'access', _147 => _147.sourceTxHash, 'optionalAccess', _148 => _148.toLowerCase, 'call', _149 => _149()])).filter((h) => Boolean(h))
|
|
3037
3262
|
);
|
|
3038
3263
|
return deposits.filter(
|
|
3039
3264
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -3041,20 +3266,37 @@ function filterVisibleDeposits(deposits) {
|
|
|
3041
3266
|
}
|
|
3042
3267
|
|
|
3043
3268
|
// src/core/history-badge.ts
|
|
3044
|
-
|
|
3269
|
+
var RECOVERY_INDICATOR_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
3270
|
+
function deriveHistoryBadgeState(deposits, {
|
|
3271
|
+
recipient,
|
|
3272
|
+
canRecover,
|
|
3273
|
+
evaluatedAt = Date.now()
|
|
3274
|
+
}) {
|
|
3045
3275
|
const visible = filterVisibleDeposits(deposits);
|
|
3046
3276
|
if (canRecover) {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
)
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3277
|
+
let count = 0;
|
|
3278
|
+
let nextExpiryAt = null;
|
|
3279
|
+
for (const row of visible) {
|
|
3280
|
+
if (toRecoverableDeposit(row, { recipient }) === null) continue;
|
|
3281
|
+
const expiryAt = Date.parse(_nullishCoalesce(row.createdAt, () => ( ""))) + RECOVERY_INDICATOR_WINDOW_MS;
|
|
3282
|
+
if (!(evaluatedAt < expiryAt)) continue;
|
|
3283
|
+
count += 1;
|
|
3284
|
+
nextExpiryAt = nextExpiryAt === null ? expiryAt : Math.min(nextExpiryAt, expiryAt);
|
|
3285
|
+
}
|
|
3286
|
+
if (count > 0) {
|
|
3287
|
+
return {
|
|
3288
|
+
badge: { state: "needs-you", count },
|
|
3289
|
+
nextExpiryAt
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
const inProgress = visible.filter(
|
|
3294
|
+
(row) => isInFlight(normalizeStatus(row.status, row.isSpam))
|
|
3295
|
+
).length;
|
|
3296
|
+
return {
|
|
3297
|
+
badge: inProgress > 0 ? { state: "progress", count: inProgress } : null,
|
|
3298
|
+
nextExpiryAt: null
|
|
3299
|
+
};
|
|
3058
3300
|
}
|
|
3059
3301
|
function historyBadgeAriaLabel(badge) {
|
|
3060
3302
|
if (!badge) return "Deposit history";
|
|
@@ -3134,7 +3376,7 @@ function CdnIcon({
|
|
|
3134
3376
|
}
|
|
3135
3377
|
const isLoading = loadedSrc !== src;
|
|
3136
3378
|
const settleIfAlreadyComplete = (el) => {
|
|
3137
|
-
if (_optionalChain([el, 'optionalAccess',
|
|
3379
|
+
if (_optionalChain([el, 'optionalAccess', _150 => _150.complete])) setLoadedSrc(src);
|
|
3138
3380
|
};
|
|
3139
3381
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3140
3382
|
"img",
|
|
@@ -3428,14 +3670,13 @@ function advancePendingTimingState(previous, next) {
|
|
|
3428
3670
|
}
|
|
3429
3671
|
|
|
3430
3672
|
// src/core/history-timing.ts
|
|
3431
|
-
var TIMED_HISTORY_STATUSES = /* @__PURE__ */ new Set(["pending", "processing", "delayed"]);
|
|
3432
3673
|
function resolveHistoryTiming({
|
|
3433
3674
|
status,
|
|
3434
3675
|
timing,
|
|
3435
3676
|
createdAt,
|
|
3436
3677
|
nowMs
|
|
3437
3678
|
}) {
|
|
3438
|
-
if (!
|
|
3679
|
+
if (!expectsArrival(status) || !timing || !createdAt) {
|
|
3439
3680
|
return void 0;
|
|
3440
3681
|
}
|
|
3441
3682
|
const createdAtMs = Date.parse(createdAt);
|
|
@@ -3467,7 +3708,7 @@ function formatDate(iso) {
|
|
|
3467
3708
|
month: "short",
|
|
3468
3709
|
year: "numeric"
|
|
3469
3710
|
});
|
|
3470
|
-
} catch (
|
|
3711
|
+
} catch (e12) {
|
|
3471
3712
|
return iso;
|
|
3472
3713
|
}
|
|
3473
3714
|
}
|
|
@@ -3534,7 +3775,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
3534
3775
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
3535
3776
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
3536
3777
|
return `${whole}.${frac}`;
|
|
3537
|
-
} catch (
|
|
3778
|
+
} catch (e13) {
|
|
3538
3779
|
return rawAmount;
|
|
3539
3780
|
}
|
|
3540
3781
|
}
|
|
@@ -3557,7 +3798,7 @@ function DepositHistoryPanel({
|
|
|
3557
3798
|
}) {
|
|
3558
3799
|
const rootRef = _react.useRef.call(void 0, null);
|
|
3559
3800
|
_react.useEffect.call(void 0, () => {
|
|
3560
|
-
_optionalChain([rootRef, 'access',
|
|
3801
|
+
_optionalChain([rootRef, 'access', _151 => _151.current, 'optionalAccess', _152 => _152.toggleAttribute, 'call', _153 => _153("inert", Boolean(obscured))]);
|
|
3561
3802
|
}, [obscured]);
|
|
3562
3803
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
3563
3804
|
(e) => {
|
|
@@ -3591,7 +3832,7 @@ function DepositHistoryPanel({
|
|
|
3591
3832
|
_react.useEffect.call(void 0, () => {
|
|
3592
3833
|
const nextBoundary = timingPresentations.reduce(
|
|
3593
3834
|
(earliest, presentation) => {
|
|
3594
|
-
const next = _optionalChain([presentation, 'optionalAccess',
|
|
3835
|
+
const next = _optionalChain([presentation, 'optionalAccess', _154 => _154.nextTransitionAtMs]);
|
|
3595
3836
|
if (next === void 0) return earliest;
|
|
3596
3837
|
return earliest === void 0 || next < earliest ? next : earliest;
|
|
3597
3838
|
},
|
|
@@ -3753,7 +3994,7 @@ function HistoryCard({
|
|
|
3753
3994
|
setExpanded(next);
|
|
3754
3995
|
const depositId = _nullishCoalesce(deposit.id, () => ( deposit.txHash));
|
|
3755
3996
|
if (!next || !depositId) return;
|
|
3756
|
-
_optionalChain([onRowView, 'optionalCall',
|
|
3997
|
+
_optionalChain([onRowView, 'optionalCall', _155 => _155({
|
|
3757
3998
|
depositId,
|
|
3758
3999
|
status,
|
|
3759
4000
|
recoverable: eligible !== null,
|
|
@@ -3840,7 +4081,7 @@ function HistoryCard({
|
|
|
3840
4081
|
recoverable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3841
4082
|
Button,
|
|
3842
4083
|
{
|
|
3843
|
-
onClick: () => _optionalChain([onRecover, 'optionalCall',
|
|
4084
|
+
onClick: () => _optionalChain([onRecover, 'optionalCall', _156 => _156(recoverable)]),
|
|
3844
4085
|
fullWidth: true,
|
|
3845
4086
|
className: "rs-history-card-recover",
|
|
3846
4087
|
children: [
|
|
@@ -3905,7 +4146,7 @@ function ListRow({
|
|
|
3905
4146
|
if (disabled) return;
|
|
3906
4147
|
if (e.key === "Enter" || e.key === " ") {
|
|
3907
4148
|
e.preventDefault();
|
|
3908
|
-
_optionalChain([onClick, 'optionalCall',
|
|
4149
|
+
_optionalChain([onClick, 'optionalCall', _157 => _157(e)]);
|
|
3909
4150
|
}
|
|
3910
4151
|
};
|
|
3911
4152
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3915,7 +4156,7 @@ function ListRow({
|
|
|
3915
4156
|
role: "button",
|
|
3916
4157
|
tabIndex: disabled ? -1 : 0,
|
|
3917
4158
|
"aria-disabled": disabled || void 0,
|
|
3918
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
4159
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _158 => _158(e)]),
|
|
3919
4160
|
onKeyDown: handleKey,
|
|
3920
4161
|
children: inner
|
|
3921
4162
|
}
|
|
@@ -3973,7 +4214,7 @@ var RECOVERY_LOOKUP_MISS_COPY = {
|
|
|
3973
4214
|
};
|
|
3974
4215
|
function classifyRecoveryLookup(rows, options = {}) {
|
|
3975
4216
|
const inScope = options.recipient ? rows.filter(
|
|
3976
|
-
(row) => _optionalChain([row, 'access',
|
|
4217
|
+
(row) => _optionalChain([row, 'access', _159 => _159.recipient, 'optionalAccess', _160 => _160.toLowerCase, 'call', _161 => _161()]) === _optionalChain([options, 'access', _162 => _162.recipient, 'optionalAccess', _163 => _163.toLowerCase, 'call', _164 => _164()])
|
|
3977
4218
|
) : rows;
|
|
3978
4219
|
const eligible = inScope.map((row) => toRecoverableDeposit(row, options)).filter((deposit) => deposit !== null);
|
|
3979
4220
|
return {
|
|
@@ -4001,7 +4242,7 @@ function RecoveryLookupScreen({
|
|
|
4001
4242
|
const valid = isRecoveryTxHash(trimmed);
|
|
4002
4243
|
_react.useEffect.call(void 0, () => {
|
|
4003
4244
|
if (trimmed.length > 0 && !valid) {
|
|
4004
|
-
_optionalChain([onInvalidRef, 'access',
|
|
4245
|
+
_optionalChain([onInvalidRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166()]);
|
|
4005
4246
|
}
|
|
4006
4247
|
}, [trimmed, valid, onInvalidRef]);
|
|
4007
4248
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -4086,15 +4327,15 @@ function resolveTokenDisplay(token, chain, fallback) {
|
|
|
4086
4327
|
const decimals = _chunkOY5N3E6Lcjs.findTokenDecimals.call(void 0, token, chain);
|
|
4087
4328
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
4088
4329
|
return {
|
|
4089
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
4090
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
4330
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _167 => _167.symbol]), () => ( symbol)),
|
|
4331
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _168 => _168.decimals])))
|
|
4091
4332
|
};
|
|
4092
4333
|
}
|
|
4093
4334
|
}
|
|
4094
4335
|
}
|
|
4095
4336
|
return {
|
|
4096
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
4097
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
4337
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _169 => _169.symbol]), () => ( "Token")),
|
|
4338
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _170 => _170.decimals])
|
|
4098
4339
|
};
|
|
4099
4340
|
}
|
|
4100
4341
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -4113,7 +4354,7 @@ function tokenAmountToNumber(rawAmount, decimals) {
|
|
|
4113
4354
|
try {
|
|
4114
4355
|
const value = Number(_viem.formatUnits.call(void 0, BigInt(rawAmount), decimals));
|
|
4115
4356
|
return Number.isFinite(value) ? value : void 0;
|
|
4116
|
-
} catch (
|
|
4357
|
+
} catch (e14) {
|
|
4117
4358
|
return void 0;
|
|
4118
4359
|
}
|
|
4119
4360
|
}
|
|
@@ -4171,7 +4412,7 @@ function formatQuotedReceive(output, fallbackSymbol) {
|
|
|
4171
4412
|
let raw;
|
|
4172
4413
|
try {
|
|
4173
4414
|
raw = BigInt(output.amount);
|
|
4174
|
-
} catch (
|
|
4415
|
+
} catch (e15) {
|
|
4175
4416
|
return void 0;
|
|
4176
4417
|
}
|
|
4177
4418
|
if (raw <= 0n) return void 0;
|
|
@@ -4214,7 +4455,7 @@ function formatRecoveryAmount(amountRaw, decimals, symbol) {
|
|
|
4214
4455
|
function toBigInt(value) {
|
|
4215
4456
|
try {
|
|
4216
4457
|
return BigInt(value || "0");
|
|
4217
|
-
} catch (
|
|
4458
|
+
} catch (e16) {
|
|
4218
4459
|
return 0n;
|
|
4219
4460
|
}
|
|
4220
4461
|
}
|
|
@@ -4348,7 +4589,7 @@ async function submitSignedRecovery(params) {
|
|
|
4348
4589
|
// The shared const, so recovery carries `x-deposit-modal-version` like
|
|
4349
4590
|
// every other backend call. Without it this path would be invisible in the
|
|
4350
4591
|
// per-client version telemetry the processor records.
|
|
4351
|
-
headers:
|
|
4592
|
+
headers: _chunkN6JJG57Rcjs.serviceHeaders.call(void 0, ),
|
|
4352
4593
|
// `depositId` as a string: it is a uint256 upstream and JSON numbers lose
|
|
4353
4594
|
// precision well before that range.
|
|
4354
4595
|
body: JSON.stringify({ depositId, destination, signature })
|
|
@@ -4707,7 +4948,7 @@ function HistoryFallbackFlow({
|
|
|
4707
4948
|
},
|
|
4708
4949
|
[analytics]
|
|
4709
4950
|
);
|
|
4710
|
-
const
|
|
4951
|
+
const lookup2 = _react.useCallback.call(void 0,
|
|
4711
4952
|
async (txHash) => {
|
|
4712
4953
|
const epoch = epochRef.current;
|
|
4713
4954
|
const isCurrentLookup = () => epochRef.current === epoch;
|
|
@@ -4837,7 +5078,7 @@ function HistoryFallbackFlow({
|
|
|
4837
5078
|
hint: "The transaction hash from the wallet or exchange you sent from.",
|
|
4838
5079
|
loading,
|
|
4839
5080
|
error,
|
|
4840
|
-
onSubmit:
|
|
5081
|
+
onSubmit: lookup2,
|
|
4841
5082
|
onInvalid: () => analytics.friction("lookup_transaction_hash_invalid", "lookup")
|
|
4842
5083
|
}
|
|
4843
5084
|
)
|
|
@@ -4944,7 +5185,7 @@ function RecoveryReviewScreen({
|
|
|
4944
5185
|
const onDestinationInvalidRef = useLatestRef(onDestinationInvalid);
|
|
4945
5186
|
_react.useEffect.call(void 0, () => {
|
|
4946
5187
|
if (destination.length > 0 && !destinationValid) {
|
|
4947
|
-
_optionalChain([onDestinationInvalidRef, 'access',
|
|
5188
|
+
_optionalChain([onDestinationInvalidRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172()]);
|
|
4948
5189
|
}
|
|
4949
5190
|
}, [destination, destinationValid, onDestinationInvalidRef]);
|
|
4950
5191
|
const txUrl = txHash ? explorerTxUrl(chainId, txHash) : null;
|
|
@@ -5102,11 +5343,11 @@ function HistoryRecoveryFlow({
|
|
|
5102
5343
|
} catch (err) {
|
|
5103
5344
|
const recoveryError = err instanceof RecoveryError ? err : void 0;
|
|
5104
5345
|
setError(
|
|
5105
|
-
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5346
|
+
_nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _173 => _173.message]), () => ( formatUserError(
|
|
5106
5347
|
err instanceof Error ? err.message : "Recovery failed"
|
|
5107
5348
|
)))
|
|
5108
5349
|
);
|
|
5109
|
-
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess',
|
|
5350
|
+
const canRetry = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _174 => _174.retryable]), () => ( true));
|
|
5110
5351
|
setRetryable(canRetry);
|
|
5111
5352
|
setPhase("failed");
|
|
5112
5353
|
const reason = claimFailureReasonForError(err);
|
|
@@ -5247,8 +5488,8 @@ function HistoryOverlay({
|
|
|
5247
5488
|
const endAttempt = _react.useCallback.call(void 0,
|
|
5248
5489
|
(source, reason) => {
|
|
5249
5490
|
const claim = claimControllerRef.current;
|
|
5250
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5251
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5491
|
+
_optionalChain([claim, 'optionalAccess', _175 => _175.abandon, 'call', _176 => _176(reason)]);
|
|
5492
|
+
_optionalChain([claim, 'optionalAccess', _177 => _177.close, 'call', _178 => _178(source)]);
|
|
5252
5493
|
claimControllerRef.current = null;
|
|
5253
5494
|
setAttempt(null);
|
|
5254
5495
|
},
|
|
@@ -5306,8 +5547,8 @@ function HistoryOverlay({
|
|
|
5306
5547
|
if (!attempt) return;
|
|
5307
5548
|
return () => {
|
|
5308
5549
|
const claim = claimControllerRef.current;
|
|
5309
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5310
|
-
_optionalChain([claim, 'optionalAccess',
|
|
5550
|
+
_optionalChain([claim, 'optionalAccess', _179 => _179.abandon, 'call', _180 => _180("modal_close")]);
|
|
5551
|
+
_optionalChain([claim, 'optionalAccess', _181 => _181.close, 'call', _182 => _182("host_controlled")]);
|
|
5311
5552
|
};
|
|
5312
5553
|
}, [attempt]);
|
|
5313
5554
|
const claimSessionProperties = _react.useMemo.call(void 0,
|
|
@@ -5333,7 +5574,7 @@ function HistoryOverlay({
|
|
|
5333
5574
|
HistoryRecoveryFlow,
|
|
5334
5575
|
{
|
|
5335
5576
|
deposit: recovering,
|
|
5336
|
-
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess',
|
|
5577
|
+
entrySource: _nullishCoalesce(_optionalChain([attempt, 'optionalAccess', _183 => _183.entrySource]), () => ( "history_row")),
|
|
5337
5578
|
backendUrl,
|
|
5338
5579
|
signRecovery,
|
|
5339
5580
|
debug,
|
|
@@ -5390,6 +5631,7 @@ function HistoryOverlay({
|
|
|
5390
5631
|
|
|
5391
5632
|
// src/components/history/useHistoryPanel.ts
|
|
5392
5633
|
|
|
5634
|
+
var MAX_TIMEOUT_MS = 2147483647;
|
|
5393
5635
|
function sortByCreatedAtDesc(items) {
|
|
5394
5636
|
return [...items].sort((a, b) => {
|
|
5395
5637
|
const at = a.createdAt ? Date.parse(a.createdAt) : 0;
|
|
@@ -5467,13 +5709,26 @@ function useHistoryPanel({
|
|
|
5467
5709
|
},
|
|
5468
5710
|
[recipient, service]
|
|
5469
5711
|
);
|
|
5470
|
-
const
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
);
|
|
5712
|
+
const badgeState2 = deriveHistoryBadgeState(deposits, {
|
|
5713
|
+
recipient,
|
|
5714
|
+
canRecover
|
|
5715
|
+
});
|
|
5716
|
+
const badge = badgeState2.badge;
|
|
5717
|
+
_react.useEffect.call(void 0, () => {
|
|
5718
|
+
if (!isOpen || badgeState2.nextExpiryAt === null) return;
|
|
5719
|
+
const delay = Math.min(
|
|
5720
|
+
badgeState2.nextExpiryAt - Date.now(),
|
|
5721
|
+
MAX_TIMEOUT_MS
|
|
5722
|
+
);
|
|
5723
|
+
const timeout = setTimeout(
|
|
5724
|
+
() => setDeposits((current) => current.slice()),
|
|
5725
|
+
delay
|
|
5726
|
+
);
|
|
5727
|
+
return () => clearTimeout(timeout);
|
|
5728
|
+
}, [isOpen, badgeState2.nextExpiryAt]);
|
|
5474
5729
|
const openPanel = _react.useCallback.call(void 0, () => {
|
|
5475
5730
|
setIsPanelOpen(true);
|
|
5476
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5731
|
+
_optionalChain([analytics, 'optionalAccess', _184 => _184.visitOpened, 'call', _185 => _185(badge)]);
|
|
5477
5732
|
if (!loadedRef.current || staleRef.current) {
|
|
5478
5733
|
fetchHistory("initial");
|
|
5479
5734
|
}
|
|
@@ -5481,10 +5736,10 @@ function useHistoryPanel({
|
|
|
5481
5736
|
const closePanel = _react.useCallback.call(void 0, () => {
|
|
5482
5737
|
if (recovering) return;
|
|
5483
5738
|
setIsPanelOpen(false);
|
|
5484
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5739
|
+
_optionalChain([analytics, 'optionalAccess', _186 => _186.visitEnded, 'call', _187 => _187()]);
|
|
5485
5740
|
}, [analytics, recovering]);
|
|
5486
5741
|
const loadMore = _react.useCallback.call(void 0, () => {
|
|
5487
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5742
|
+
_optionalChain([analytics, 'optionalAccess', _188 => _188.loadMore, 'call', _189 => _189(filterVisibleDeposits(deposits).length)]);
|
|
5488
5743
|
fetchHistory("more");
|
|
5489
5744
|
}, [analytics, deposits, fetchHistory]);
|
|
5490
5745
|
const markStale = _react.useCallback.call(void 0, () => {
|
|
@@ -5512,7 +5767,7 @@ function useHistoryPanel({
|
|
|
5512
5767
|
_react.useEffect.call(void 0, () => {
|
|
5513
5768
|
if (isOpen) return;
|
|
5514
5769
|
setIsPanelOpen(false);
|
|
5515
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
5770
|
+
_optionalChain([analytics, 'optionalAccess', _190 => _190.visitEnded, 'call', _191 => _191()]);
|
|
5516
5771
|
setDeposits([]);
|
|
5517
5772
|
setHasMore(false);
|
|
5518
5773
|
setError(null);
|
|
@@ -5671,11 +5926,11 @@ var NOTHING_TO_STOP = () => {
|
|
|
5671
5926
|
};
|
|
5672
5927
|
function resolveThemeMode(mode) {
|
|
5673
5928
|
if (mode !== "system") return mode;
|
|
5674
|
-
return _optionalChain([globalThis, 'access',
|
|
5929
|
+
return _optionalChain([globalThis, 'access', _192 => _192.matchMedia, 'optionalCall', _193 => _193(DARK_SCHEME_QUERY), 'access', _194 => _194.matches]) ? "dark" : "light";
|
|
5675
5930
|
}
|
|
5676
5931
|
function followSystemAppearance(mode, onChange) {
|
|
5677
5932
|
if (mode !== "system") return NOTHING_TO_STOP;
|
|
5678
|
-
const query = _optionalChain([globalThis, 'access',
|
|
5933
|
+
const query = _optionalChain([globalThis, 'access', _195 => _195.matchMedia, 'optionalCall', _196 => _196(DARK_SCHEME_QUERY)]);
|
|
5679
5934
|
if (!query) return NOTHING_TO_STOP;
|
|
5680
5935
|
query.addEventListener("change", onChange);
|
|
5681
5936
|
return () => query.removeEventListener("change", onChange);
|
|
@@ -5683,22 +5938,22 @@ function followSystemAppearance(mode, onChange) {
|
|
|
5683
5938
|
function applyTheme(element, theme) {
|
|
5684
5939
|
if (!element) return NOTHING_TO_STOP;
|
|
5685
5940
|
const parent = element.parentElement;
|
|
5686
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
5941
|
+
const targets = _optionalChain([parent, 'optionalAccess', _197 => _197.classList, 'access', _198 => _198.contains, 'call', _199 => _199("rs-modal-content")]) ? [element, parent] : [element];
|
|
5687
5942
|
const paintMode = () => {
|
|
5688
|
-
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess',
|
|
5943
|
+
const resolved = resolveThemeMode(_optionalChain([theme, 'optionalAccess', _200 => _200.mode]));
|
|
5689
5944
|
for (const t of targets) {
|
|
5690
5945
|
if (resolved) t.setAttribute("data-theme", resolved);
|
|
5691
5946
|
else t.removeAttribute("data-theme");
|
|
5692
5947
|
}
|
|
5693
5948
|
};
|
|
5694
5949
|
paintMode();
|
|
5695
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5950
|
+
if (_optionalChain([theme, 'optionalAccess', _201 => _201.fontColor])) {
|
|
5696
5951
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
5697
5952
|
}
|
|
5698
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5953
|
+
if (_optionalChain([theme, 'optionalAccess', _202 => _202.iconColor])) {
|
|
5699
5954
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
5700
5955
|
}
|
|
5701
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5956
|
+
if (_optionalChain([theme, 'optionalAccess', _203 => _203.ctaColor])) {
|
|
5702
5957
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
5703
5958
|
if (derived) {
|
|
5704
5959
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -5723,25 +5978,25 @@ function applyTheme(element, theme) {
|
|
|
5723
5978
|
}
|
|
5724
5979
|
} else {
|
|
5725
5980
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
5726
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5981
|
+
if (_optionalChain([theme, 'optionalAccess', _204 => _204.ctaHoverColor])) {
|
|
5727
5982
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
5728
5983
|
}
|
|
5729
5984
|
}
|
|
5730
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5985
|
+
if (_optionalChain([theme, 'optionalAccess', _205 => _205.borderColor])) {
|
|
5731
5986
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
5732
5987
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
5733
5988
|
}
|
|
5734
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5989
|
+
if (_optionalChain([theme, 'optionalAccess', _206 => _206.backgroundColor])) {
|
|
5735
5990
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
5736
5991
|
}
|
|
5737
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
5992
|
+
if (_optionalChain([theme, 'optionalAccess', _207 => _207.radius])) {
|
|
5738
5993
|
const scale = RADIUS_SCALE[theme.radius];
|
|
5739
5994
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
5740
5995
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
5741
5996
|
setVar(targets, "--rs-radius-lg", scale.lg);
|
|
5742
5997
|
setVar(targets, "--rs-radius", scale.md);
|
|
5743
5998
|
}
|
|
5744
|
-
return followSystemAppearance(_optionalChain([theme, 'optionalAccess',
|
|
5999
|
+
return followSystemAppearance(_optionalChain([theme, 'optionalAccess', _208 => _208.mode]), paintMode);
|
|
5745
6000
|
}
|
|
5746
6001
|
|
|
5747
6002
|
// src/core/removed-props.ts
|
|
@@ -5830,20 +6085,20 @@ function sinkFor(source) {
|
|
|
5830
6085
|
if (source.modal === "deposit") {
|
|
5831
6086
|
const at2 = () => source.controllerRef.current;
|
|
5832
6087
|
return {
|
|
5833
|
-
opened: (detail) => _optionalChain([at2, 'call',
|
|
5834
|
-
rowViewed: (detail) => _optionalChain([at2, 'call',
|
|
5835
|
-
loadMore: (detail) => _optionalChain([at2, 'call',
|
|
5836
|
-
fallbackOpened: (detail) => _optionalChain([at2, 'call',
|
|
5837
|
-
recoveryStarted: (detail) => _optionalChain([at2, 'call',
|
|
6088
|
+
opened: (detail) => _optionalChain([at2, 'call', _209 => _209(), 'optionalAccess', _210 => _210.historyOpened, 'call', _211 => _211({ ...detail, step: _nullishCoalesce(_optionalChain([at2, 'call', _212 => _212(), 'optionalAccess', _213 => _213.step]), () => ( null)) })]),
|
|
6089
|
+
rowViewed: (detail) => _optionalChain([at2, 'call', _214 => _214(), 'optionalAccess', _215 => _215.historyRowViewed, 'call', _216 => _216(detail)]),
|
|
6090
|
+
loadMore: (detail) => _optionalChain([at2, 'call', _217 => _217(), 'optionalAccess', _218 => _218.historyLoadMore, 'call', _219 => _219(detail)]),
|
|
6091
|
+
fallbackOpened: (detail) => _optionalChain([at2, 'call', _220 => _220(), 'optionalAccess', _221 => _221.historyFallbackOpened, 'call', _222 => _222(detail)]),
|
|
6092
|
+
recoveryStarted: (detail) => _optionalChain([at2, 'call', _223 => _223(), 'optionalAccess', _224 => _224.historyRecoveryStarted, 'call', _225 => _225(detail)])
|
|
5838
6093
|
};
|
|
5839
6094
|
}
|
|
5840
6095
|
const at = () => source.controllerRef.current;
|
|
5841
6096
|
return {
|
|
5842
|
-
opened: (detail) => _optionalChain([at, 'call',
|
|
5843
|
-
rowViewed: (detail) => _optionalChain([at, 'call',
|
|
5844
|
-
loadMore: (detail) => _optionalChain([at, 'call',
|
|
5845
|
-
fallbackOpened: (detail) => _optionalChain([at, 'call',
|
|
5846
|
-
recoveryStarted: (detail) => _optionalChain([at, 'call',
|
|
6097
|
+
opened: (detail) => _optionalChain([at, 'call', _226 => _226(), 'optionalAccess', _227 => _227.historyOpened, 'call', _228 => _228({ ...detail, step: _nullishCoalesce(_optionalChain([at, 'call', _229 => _229(), 'optionalAccess', _230 => _230.step]), () => ( null)) })]),
|
|
6098
|
+
rowViewed: (detail) => _optionalChain([at, 'call', _231 => _231(), 'optionalAccess', _232 => _232.historyRowViewed, 'call', _233 => _233(detail)]),
|
|
6099
|
+
loadMore: (detail) => _optionalChain([at, 'call', _234 => _234(), 'optionalAccess', _235 => _235.historyLoadMore, 'call', _236 => _236(detail)]),
|
|
6100
|
+
fallbackOpened: (detail) => _optionalChain([at, 'call', _237 => _237(), 'optionalAccess', _238 => _238.historyFallbackOpened, 'call', _239 => _239(detail)]),
|
|
6101
|
+
recoveryStarted: (detail) => _optionalChain([at, 'call', _240 => _240(), 'optionalAccess', _241 => _241.historyRecoveryStarted, 'call', _242 => _242(detail)])
|
|
5847
6102
|
};
|
|
5848
6103
|
}
|
|
5849
6104
|
function badgeState(badge) {
|
|
@@ -5869,7 +6124,7 @@ function createHistoryAnalytics(source) {
|
|
|
5869
6124
|
sink.opened({
|
|
5870
6125
|
history_visit_id: visitId,
|
|
5871
6126
|
badge: badgeState(badge),
|
|
5872
|
-
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess',
|
|
6127
|
+
badge_count: _nullishCoalesce(_optionalChain([badge, 'optionalAccess', _243 => _243.count]), () => ( 0))
|
|
5873
6128
|
});
|
|
5874
6129
|
},
|
|
5875
6130
|
visitEnded() {
|
|
@@ -5933,7 +6188,7 @@ function resolveChain(targetChain) {
|
|
|
5933
6188
|
return _chunkOY5N3E6Lcjs.targetChainToCaip2.call(void 0, targetChain);
|
|
5934
6189
|
}
|
|
5935
6190
|
function resolveToken(targetToken) {
|
|
5936
|
-
const raw = _optionalChain([targetToken, 'optionalAccess',
|
|
6191
|
+
const raw = _optionalChain([targetToken, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
|
|
5937
6192
|
if (!raw) return void 0;
|
|
5938
6193
|
if (HEX_TOKEN.test(raw)) return raw.toLowerCase();
|
|
5939
6194
|
if (BASE58_TOKEN.test(raw)) return raw;
|
|
@@ -5991,8 +6246,8 @@ function Tooltip({ content, children, className }) {
|
|
|
5991
6246
|
function handleOutside(event) {
|
|
5992
6247
|
const target = event.target;
|
|
5993
6248
|
if (!target) return;
|
|
5994
|
-
if (_optionalChain([triggerRef, 'access',
|
|
5995
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
6249
|
+
if (_optionalChain([triggerRef, 'access', _246 => _246.current, 'optionalAccess', _247 => _247.contains, 'call', _248 => _248(target)])) return;
|
|
6250
|
+
if (_optionalChain([bubbleRef, 'access', _249 => _249.current, 'optionalAccess', _250 => _250.contains, 'call', _251 => _251(target)])) return;
|
|
5996
6251
|
setOpen(false);
|
|
5997
6252
|
}
|
|
5998
6253
|
function handleKey(event) {
|
|
@@ -6221,7 +6476,7 @@ function asNumber(value) {
|
|
|
6221
6476
|
const trimmed = value.trim();
|
|
6222
6477
|
if (!trimmed) return void 0;
|
|
6223
6478
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
6224
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
6479
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _252 => _252[1]])) {
|
|
6225
6480
|
const parsed2 = Number(caipMatch[1]);
|
|
6226
6481
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
6227
6482
|
}
|
|
@@ -6240,24 +6495,24 @@ function asAddress(value) {
|
|
|
6240
6495
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
6241
6496
|
}
|
|
6242
6497
|
function getEventTxHash(event) {
|
|
6243
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6498
|
+
if (!_optionalChain([event, 'optionalAccess', _253 => _253.type])) return void 0;
|
|
6244
6499
|
if (event.type === "deposit-received") {
|
|
6245
|
-
return asString(_optionalChain([event, 'access',
|
|
6500
|
+
return asString(_optionalChain([event, 'access', _254 => _254.data, 'optionalAccess', _255 => _255.transactionHash]));
|
|
6246
6501
|
}
|
|
6247
6502
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
6248
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
6249
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
6250
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
6503
|
+
const deposit = isRecord(_optionalChain([event, 'access', _256 => _256.data, 'optionalAccess', _257 => _257.deposit])) ? event.data.deposit : void 0;
|
|
6504
|
+
const source = isRecord(_optionalChain([event, 'access', _258 => _258.data, 'optionalAccess', _259 => _259.source])) ? event.data.source : void 0;
|
|
6505
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _260 => _260.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _261 => _261.transactionHash]))));
|
|
6251
6506
|
}
|
|
6252
6507
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
6253
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
6254
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
6255
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
6508
|
+
const deposit = isRecord(_optionalChain([event, 'access', _262 => _262.data, 'optionalAccess', _263 => _263.deposit])) ? event.data.deposit : void 0;
|
|
6509
|
+
const source = isRecord(_optionalChain([event, 'access', _264 => _264.data, 'optionalAccess', _265 => _265.source])) ? event.data.source : void 0;
|
|
6510
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _266 => _266.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _267 => _267.transactionHash]))));
|
|
6256
6511
|
}
|
|
6257
6512
|
return void 0;
|
|
6258
6513
|
}
|
|
6259
6514
|
function getEventSourceDetails(event) {
|
|
6260
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6515
|
+
if (!_optionalChain([event, 'optionalAccess', _268 => _268.type]) || !isRecord(event.data)) return {};
|
|
6261
6516
|
if (event.type === "deposit-received") {
|
|
6262
6517
|
return {
|
|
6263
6518
|
chainId: asNumber(event.data.chain),
|
|
@@ -6269,9 +6524,9 @@ function getEventSourceDetails(event) {
|
|
|
6269
6524
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
6270
6525
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
6271
6526
|
return {
|
|
6272
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
6273
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
6274
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
6527
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _269 => _269.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _270 => _270.chain])))),
|
|
6528
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _271 => _271.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _272 => _272.amount])))),
|
|
6529
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _273 => _273.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _274 => _274.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _275 => _275.token]))))
|
|
6275
6530
|
};
|
|
6276
6531
|
}
|
|
6277
6532
|
return {};
|
|
@@ -6285,7 +6540,7 @@ function asChain(value) {
|
|
|
6285
6540
|
return asNumber(value);
|
|
6286
6541
|
}
|
|
6287
6542
|
function getEventDestinationDetails(event) {
|
|
6288
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6543
|
+
if (!_optionalChain([event, 'optionalAccess', _276 => _276.type]) || !isRecord(event.data)) return {};
|
|
6289
6544
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
6290
6545
|
return {};
|
|
6291
6546
|
}
|
|
@@ -6295,14 +6550,14 @@ function getEventDestinationDetails(event) {
|
|
|
6295
6550
|
return {
|
|
6296
6551
|
chainId: asChain(destination.chain),
|
|
6297
6552
|
amount: asAmount(destination.amount),
|
|
6298
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
6553
|
+
token: _optionalChain([token, 'optionalAccess', _277 => _277.trim, 'call', _278 => _278()]) || void 0
|
|
6299
6554
|
};
|
|
6300
6555
|
}
|
|
6301
6556
|
function isDepositEvent(event) {
|
|
6302
|
-
return _optionalChain([event, 'optionalAccess',
|
|
6557
|
+
return _optionalChain([event, 'optionalAccess', _279 => _279.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _280 => _280.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _281 => _281.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _282 => _282.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _283 => _283.type]) === "error";
|
|
6303
6558
|
}
|
|
6304
6559
|
function isFailedEvent(event) {
|
|
6305
|
-
return _optionalChain([event, 'optionalAccess',
|
|
6560
|
+
return _optionalChain([event, 'optionalAccess', _284 => _284.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _285 => _285.type]) === "error";
|
|
6306
6561
|
}
|
|
6307
6562
|
function isHexString(value) {
|
|
6308
6563
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -6314,7 +6569,7 @@ function txRefsMatch(a, b) {
|
|
|
6314
6569
|
return a === b;
|
|
6315
6570
|
}
|
|
6316
6571
|
function formatBridgeFailedMessage(event) {
|
|
6317
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
6572
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _286 => _286.data]), () => ( {}));
|
|
6318
6573
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
6319
6574
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
6320
6575
|
function toUserFacingFailure(raw) {
|
|
@@ -6342,7 +6597,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
6342
6597
|
return { message: "Bridge failed" };
|
|
6343
6598
|
}
|
|
6344
6599
|
function failureMessageForEvent(event) {
|
|
6345
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6600
|
+
if (_optionalChain([event, 'optionalAccess', _287 => _287.type]) === "error") {
|
|
6346
6601
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
6347
6602
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
6348
6603
|
}
|
|
@@ -6381,7 +6636,7 @@ async function fetchTokenPriceUsd(service, token) {
|
|
|
6381
6636
|
}
|
|
6382
6637
|
function useTokenPrices(service, tokens) {
|
|
6383
6638
|
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
6384
|
-
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess',
|
|
6639
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _288 => _288.symbol])));
|
|
6385
6640
|
const entries = [
|
|
6386
6641
|
...new Map(
|
|
6387
6642
|
defined.flatMap((token) => {
|
|
@@ -6544,7 +6799,7 @@ function loadPhaseTimings(txHash) {
|
|
|
6544
6799
|
const parsed = JSON.parse(raw);
|
|
6545
6800
|
if (typeof parsed.startedAt !== "number") return null;
|
|
6546
6801
|
return parsed;
|
|
6547
|
-
} catch (
|
|
6802
|
+
} catch (e17) {
|
|
6548
6803
|
return null;
|
|
6549
6804
|
}
|
|
6550
6805
|
}
|
|
@@ -6555,7 +6810,7 @@ function savePhaseTimings(txHash, timings) {
|
|
|
6555
6810
|
`${PHASE_TIMINGS_PREFIX}:${txHash}`,
|
|
6556
6811
|
JSON.stringify(timings)
|
|
6557
6812
|
);
|
|
6558
|
-
} catch (
|
|
6813
|
+
} catch (e18) {
|
|
6559
6814
|
}
|
|
6560
6815
|
}
|
|
6561
6816
|
function isEventForTx(event, txHash) {
|
|
@@ -6564,12 +6819,12 @@ function isEventForTx(event, txHash) {
|
|
|
6564
6819
|
return txRefsMatch(eventTxHash, txHash);
|
|
6565
6820
|
}
|
|
6566
6821
|
function parseWebhookTimestamp(event) {
|
|
6567
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
6822
|
+
if (typeof _optionalChain([event, 'optionalAccess', _289 => _289.time]) !== "string") return void 0;
|
|
6568
6823
|
const timestamp = Date.parse(event.time);
|
|
6569
6824
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
6570
6825
|
}
|
|
6571
6826
|
function syncPhaseTimings(previous, event) {
|
|
6572
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
6827
|
+
if (!_optionalChain([event, 'optionalAccess', _290 => _290.type])) return previous;
|
|
6573
6828
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
6574
6829
|
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;
|
|
6575
6830
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -6631,46 +6886,46 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
6631
6886
|
if (state.type === "complete") {
|
|
6632
6887
|
return void 0;
|
|
6633
6888
|
}
|
|
6634
|
-
if (_optionalChain([state, 'access',
|
|
6889
|
+
if (_optionalChain([state, 'access', _291 => _291.lastEvent, 'optionalAccess', _292 => _292.type]) === "bridge-started" || _optionalChain([state, 'access', _293 => _293.lastEvent, 'optionalAccess', _294 => _294.type]) === "bridge-complete")
|
|
6635
6890
|
return "bridging";
|
|
6636
|
-
if (_optionalChain([state, 'access',
|
|
6891
|
+
if (_optionalChain([state, 'access', _295 => _295.lastEvent, 'optionalAccess', _296 => _296.type]) === "deposit-received") return "received";
|
|
6637
6892
|
return "confirming";
|
|
6638
6893
|
}
|
|
6639
6894
|
function getCompletionDestinationTxHash(event) {
|
|
6640
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
6641
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
6642
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
6895
|
+
const eventData = _optionalChain([event, 'optionalAccess', _297 => _297.data]);
|
|
6896
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _298 => _298.swap, 'optionalAccess', _299 => _299.transactionHash]);
|
|
6897
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _300 => _300.destination, 'optionalAccess', _301 => _301.transactionHash]);
|
|
6643
6898
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
6644
6899
|
}
|
|
6645
6900
|
function getTerminalProcessingOutcome(event) {
|
|
6646
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6901
|
+
if (_optionalChain([event, 'optionalAccess', _302 => _302.type]) === "post-bridge-swap-complete") {
|
|
6647
6902
|
return {
|
|
6648
6903
|
type: "complete",
|
|
6649
6904
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
6650
6905
|
};
|
|
6651
6906
|
}
|
|
6652
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6907
|
+
if (_optionalChain([event, 'optionalAccess', _303 => _303.type]) === "post-bridge-swap-failed") {
|
|
6653
6908
|
return {
|
|
6654
6909
|
type: "failed",
|
|
6655
6910
|
message: formatBridgeFailedMessage(event).message
|
|
6656
6911
|
};
|
|
6657
6912
|
}
|
|
6658
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6913
|
+
if (_optionalChain([event, 'optionalAccess', _304 => _304.type]) === "bridge-complete") {
|
|
6659
6914
|
return {
|
|
6660
6915
|
type: "complete",
|
|
6661
6916
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
6662
6917
|
};
|
|
6663
6918
|
}
|
|
6664
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6919
|
+
if (_optionalChain([event, 'optionalAccess', _305 => _305.type]) === "bridge-failed") {
|
|
6665
6920
|
return {
|
|
6666
6921
|
type: "failed",
|
|
6667
6922
|
message: formatBridgeFailedMessage(event).message
|
|
6668
6923
|
};
|
|
6669
6924
|
}
|
|
6670
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
6925
|
+
if (_optionalChain([event, 'optionalAccess', _306 => _306.type]) === "error") {
|
|
6671
6926
|
return {
|
|
6672
6927
|
type: "failed",
|
|
6673
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
6928
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _307 => _307.data, 'optionalAccess', _308 => _308.message]), () => ( "Unknown error"))
|
|
6674
6929
|
};
|
|
6675
6930
|
}
|
|
6676
6931
|
return null;
|
|
@@ -6678,10 +6933,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
6678
6933
|
function getInitialProcessingState(event, txHash) {
|
|
6679
6934
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
6680
6935
|
const terminal = getTerminalProcessingOutcome(event);
|
|
6681
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
6936
|
+
if (_optionalChain([terminal, 'optionalAccess', _309 => _309.type]) === "complete") {
|
|
6682
6937
|
return { type: "complete", lastEvent: event };
|
|
6683
6938
|
}
|
|
6684
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
6939
|
+
if (_optionalChain([terminal, 'optionalAccess', _310 => _310.type]) === "failed") {
|
|
6685
6940
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
6686
6941
|
}
|
|
6687
6942
|
if (isDepositEvent(event)) {
|
|
@@ -6690,7 +6945,7 @@ function getInitialProcessingState(event, txHash) {
|
|
|
6690
6945
|
return null;
|
|
6691
6946
|
}
|
|
6692
6947
|
function getSettledSourceTxHash(event, fallbackTxHash) {
|
|
6693
|
-
return _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
6948
|
+
return _nullishCoalesce(_optionalChain([event, 'optionalAccess', _311 => _311.data, 'optionalAccess', _312 => _312.source, 'optionalAccess', _313 => _313.transactionHash]), () => ( fallbackTxHash));
|
|
6694
6949
|
}
|
|
6695
6950
|
function ProcessingStep({
|
|
6696
6951
|
smartAccount,
|
|
@@ -6770,8 +7025,8 @@ function ProcessingStep({
|
|
|
6770
7025
|
const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0,
|
|
6771
7026
|
() => Math.max(0, Math.floor((Date.now() - startTimeRef.current) / 1e3))
|
|
6772
7027
|
);
|
|
6773
|
-
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess',
|
|
6774
|
-
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess',
|
|
7028
|
+
const [latchedTiming, setLatchedTiming] = _react.useState.call(void 0, _optionalChain([quote, 'optionalAccess', _314 => _314.timing]));
|
|
7029
|
+
if (latchedTiming === void 0 && _optionalChain([quote, 'optionalAccess', _315 => _315.timing]) !== void 0) {
|
|
6775
7030
|
setLatchedTiming(quote.timing);
|
|
6776
7031
|
}
|
|
6777
7032
|
const timingStateRef = _react.useRef.call(void 0, "expected");
|
|
@@ -6802,7 +7057,7 @@ function ProcessingStep({
|
|
|
6802
7057
|
flowLabel
|
|
6803
7058
|
});
|
|
6804
7059
|
const context = processingContextRef.current;
|
|
6805
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7060
|
+
_optionalChain([onDepositCompleteRef, 'access', _316 => _316.current, 'optionalCall', _317 => _317(txHash, void 0, {
|
|
6806
7061
|
amount: context.amount,
|
|
6807
7062
|
sourceChain: context.sourceChain,
|
|
6808
7063
|
sourceToken: context.sourceToken,
|
|
@@ -6835,7 +7090,7 @@ function ProcessingStep({
|
|
|
6835
7090
|
destinationTxHash: outcome.destinationTxHash,
|
|
6836
7091
|
event: event.type
|
|
6837
7092
|
});
|
|
6838
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7093
|
+
_optionalChain([onDepositCompleteRef, 'access', _318 => _318.current, 'optionalCall', _319 => _319(
|
|
6839
7094
|
sourceTxHash2,
|
|
6840
7095
|
outcome.destinationTxHash,
|
|
6841
7096
|
{
|
|
@@ -6855,7 +7110,7 @@ function ProcessingStep({
|
|
|
6855
7110
|
message: outcome.message,
|
|
6856
7111
|
event: event.type
|
|
6857
7112
|
});
|
|
6858
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7113
|
+
_optionalChain([onDepositFailedRef, 'access', _320 => _320.current, 'optionalCall', _321 => _321(txHash, outcome.message)]);
|
|
6859
7114
|
}, [
|
|
6860
7115
|
debug,
|
|
6861
7116
|
onDepositCompleteRef,
|
|
@@ -6866,8 +7121,8 @@ function ProcessingStep({
|
|
|
6866
7121
|
const onSettledChangeRef = _react.useRef.call(void 0, onSettledChange);
|
|
6867
7122
|
onSettledChangeRef.current = onSettledChange;
|
|
6868
7123
|
_react.useEffect.call(void 0, () => {
|
|
6869
|
-
_optionalChain([onSettledChangeRef, 'access',
|
|
6870
|
-
return () => _optionalChain([onSettledChangeRef, 'access',
|
|
7124
|
+
_optionalChain([onSettledChangeRef, 'access', _322 => _322.current, 'optionalCall', _323 => _323(state.type !== "processing")]);
|
|
7125
|
+
return () => _optionalChain([onSettledChangeRef, 'access', _324 => _324.current, 'optionalCall', _325 => _325(false)]);
|
|
6871
7126
|
}, [state.type]);
|
|
6872
7127
|
_react.useEffect.call(void 0, () => {
|
|
6873
7128
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -6893,13 +7148,13 @@ function ProcessingStep({
|
|
|
6893
7148
|
updatePhaseTimings(
|
|
6894
7149
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
6895
7150
|
);
|
|
6896
|
-
}, [_optionalChain([state, 'access',
|
|
7151
|
+
}, [_optionalChain([state, 'access', _326 => _326.lastEvent, 'optionalAccess', _327 => _327.time]), _optionalChain([state, 'access', _328 => _328.lastEvent, 'optionalAccess', _329 => _329.type]), updatePhaseTimings]);
|
|
6897
7152
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
6898
7153
|
_react.useEffect.call(void 0, () => {
|
|
6899
7154
|
let cancelled = false;
|
|
6900
7155
|
let timeoutId;
|
|
6901
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
6902
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7156
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _330 => _330.variant]) === "fiat";
|
|
7157
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _331 => _331.expectedOrderUuid]), () => ( null));
|
|
6903
7158
|
setSwappedFiatContext(null);
|
|
6904
7159
|
if (isFiatSwappedOrder && !expectedOrderUuid) {
|
|
6905
7160
|
return () => {
|
|
@@ -6935,7 +7190,7 @@ function ProcessingStep({
|
|
|
6935
7190
|
if (isFiatSwappedOrder && !hasFiatReceiptPricing(res)) {
|
|
6936
7191
|
scheduleRetry();
|
|
6937
7192
|
}
|
|
6938
|
-
} catch (
|
|
7193
|
+
} catch (e19) {
|
|
6939
7194
|
scheduleRetry();
|
|
6940
7195
|
}
|
|
6941
7196
|
}
|
|
@@ -6949,8 +7204,8 @@ function ProcessingStep({
|
|
|
6949
7204
|
smartAccount,
|
|
6950
7205
|
txHash,
|
|
6951
7206
|
isSwappedOrder,
|
|
6952
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
6953
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
7207
|
+
_optionalChain([swappedContext, 'optionalAccess', _332 => _332.variant]),
|
|
7208
|
+
_optionalChain([swappedContext, 'optionalAccess', _333 => _333.expectedOrderUuid])
|
|
6954
7209
|
]);
|
|
6955
7210
|
_react.useEffect.call(void 0, () => {
|
|
6956
7211
|
if (directTransfer) return;
|
|
@@ -6976,17 +7231,17 @@ function ProcessingStep({
|
|
|
6976
7231
|
debugLog(debug, "processing", "poll:event", {
|
|
6977
7232
|
type: lastEvent2.type,
|
|
6978
7233
|
matchesTx: eventMatchesTx,
|
|
6979
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
7234
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _334 => _334.intentId])
|
|
6980
7235
|
});
|
|
6981
7236
|
}
|
|
6982
7237
|
if (!isMounted) return;
|
|
6983
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7238
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _335 => _335.type]) === "bridge-complete") {
|
|
6984
7239
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
6985
7240
|
const sourceTxHash2 = getSettledSourceTxHash(
|
|
6986
7241
|
eventForCurrentTx,
|
|
6987
7242
|
txHash
|
|
6988
7243
|
);
|
|
6989
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
7244
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _336 => _336.data, 'optionalAccess', _337 => _337.destination, 'optionalAccess', _338 => _338.transactionHash]);
|
|
6990
7245
|
debugLog(debug, "processing", "state:complete", {
|
|
6991
7246
|
txHash,
|
|
6992
7247
|
sourceTxHash: sourceTxHash2,
|
|
@@ -6994,7 +7249,7 @@ function ProcessingStep({
|
|
|
6994
7249
|
event: eventForCurrentTx.type
|
|
6995
7250
|
});
|
|
6996
7251
|
const context = processingContextRef.current;
|
|
6997
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
7252
|
+
_optionalChain([onDepositCompleteRef, 'access', _339 => _339.current, 'optionalCall', _340 => _340(sourceTxHash2, destinationTxHash2, {
|
|
6998
7253
|
amount: context.amount,
|
|
6999
7254
|
sourceChain: context.sourceChain,
|
|
7000
7255
|
sourceToken: context.sourceToken,
|
|
@@ -7005,7 +7260,7 @@ function ProcessingStep({
|
|
|
7005
7260
|
})]);
|
|
7006
7261
|
return;
|
|
7007
7262
|
}
|
|
7008
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7263
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _341 => _341.type]) === "bridge-failed") {
|
|
7009
7264
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
7010
7265
|
setState({
|
|
7011
7266
|
type: "failed",
|
|
@@ -7017,11 +7272,11 @@ function ProcessingStep({
|
|
|
7017
7272
|
message: formatted.message,
|
|
7018
7273
|
code: formatted.code
|
|
7019
7274
|
});
|
|
7020
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7275
|
+
_optionalChain([onDepositFailedRef, 'access', _342 => _342.current, 'optionalCall', _343 => _343(txHash, formatted.message)]);
|
|
7021
7276
|
return;
|
|
7022
7277
|
}
|
|
7023
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
7024
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
7278
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _344 => _344.type]) === "error") {
|
|
7279
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _345 => _345.data, 'optionalAccess', _346 => _346.message]), () => ( "Unknown error"));
|
|
7025
7280
|
setState({
|
|
7026
7281
|
type: "failed",
|
|
7027
7282
|
message: errorMessage,
|
|
@@ -7031,7 +7286,7 @@ function ProcessingStep({
|
|
|
7031
7286
|
txHash,
|
|
7032
7287
|
message: errorMessage
|
|
7033
7288
|
});
|
|
7034
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
7289
|
+
_optionalChain([onDepositFailedRef, 'access', _347 => _347.current, 'optionalCall', _348 => _348(txHash, errorMessage)]);
|
|
7035
7290
|
return;
|
|
7036
7291
|
}
|
|
7037
7292
|
setState((previous) => ({
|
|
@@ -7089,18 +7344,18 @@ function ProcessingStep({
|
|
|
7089
7344
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
7090
7345
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
7091
7346
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
7092
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7347
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _349 => _349.data, 'optionalAccess', _350 => _350.destination, 'optionalAccess', _351 => _351.transactionHash]) || null;
|
|
7093
7348
|
const sourceTxHash = getSettledSourceTxHash(lastEvent, txHash);
|
|
7094
7349
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
7095
7350
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
7096
7351
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
7097
7352
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
7098
7353
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7099
|
-
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
7354
|
+
const settledSourceTxHash = _optionalChain([lastEvent, 'optionalAccess', _352 => _352.data, 'optionalAccess', _353 => _353.source, 'optionalAccess', _354 => _354.transactionHash]);
|
|
7100
7355
|
const sourceExplorerHash = _nullishCoalesce(settledSourceTxHash, () => ( (sourceTxHashPending ? null : sourceTxHash)));
|
|
7101
7356
|
_react.useEffect.call(void 0, () => {
|
|
7102
7357
|
if (sourceTxHashPending && settledSourceTxHash) {
|
|
7103
|
-
_optionalChain([onSourceTransactionObserved, 'optionalCall',
|
|
7358
|
+
_optionalChain([onSourceTransactionObserved, 'optionalCall', _355 => _355(settledSourceTxHash)]);
|
|
7104
7359
|
}
|
|
7105
7360
|
}, [onSourceTransactionObserved, settledSourceTxHash, sourceTxHashPending]);
|
|
7106
7361
|
const sourceExplorerUrl = sourceExplorerHash ? explorerTxUrl(displaySourceChain, sourceExplorerHash) : null;
|
|
@@ -7204,7 +7459,7 @@ function ProcessingStep({
|
|
|
7204
7459
|
timeoutMs: latchedTiming ? resolveServedThresholds(latchedTiming).escalatedMs : FALLBACK_ESCALATED_DELAY_MS,
|
|
7205
7460
|
served: latchedTiming !== void 0
|
|
7206
7461
|
});
|
|
7207
|
-
_optionalChain([onErrorRef, 'access',
|
|
7462
|
+
_optionalChain([onErrorRef, 'access', _356 => _356.current, 'optionalCall', _357 => _357(
|
|
7208
7463
|
"Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.",
|
|
7209
7464
|
"PROCESS_TIMEOUT"
|
|
7210
7465
|
)]);
|
|
@@ -7222,8 +7477,8 @@ function ProcessingStep({
|
|
|
7222
7477
|
const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, displaySourceChain);
|
|
7223
7478
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
7224
7479
|
const timerText = formatTimer(elapsedSeconds);
|
|
7225
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7226
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7480
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _358 => _358.feeSponsored]), () => ( false));
|
|
7481
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _359 => _359.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
7227
7482
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
7228
7483
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
7229
7484
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -7234,20 +7489,20 @@ function ProcessingStep({
|
|
|
7234
7489
|
/* @__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 }) })
|
|
7235
7490
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
7236
7491
|
if (isComplete && isSwappedOrder) {
|
|
7237
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
7492
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _360 => _360.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _361 => _361.paymentMethod]))), () => ( null));
|
|
7238
7493
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
7239
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
7494
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _362 => _362.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
7240
7495
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
7241
7496
|
effectivePaymentMethod
|
|
7242
7497
|
) : null;
|
|
7243
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
7244
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7498
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _363 => _363.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
7499
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _364 => _364.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
7245
7500
|
const depositedAmount = receiveDisplay;
|
|
7246
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7501
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _365 => _365.onrampFeeUsd]), () => ( null));
|
|
7247
7502
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
7248
7503
|
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.";
|
|
7249
7504
|
const { rows: quoteFeeRows, chargeableUsd } = buildQuoteFeeRows(
|
|
7250
|
-
_optionalChain([quote, 'optionalAccess',
|
|
7505
|
+
_optionalChain([quote, 'optionalAccess', _366 => _366.fees, 'access', _367 => _367.breakdown]),
|
|
7251
7506
|
sponsoredFeeTooltip
|
|
7252
7507
|
);
|
|
7253
7508
|
const feeRows = [];
|
|
@@ -7334,7 +7589,7 @@ function ProcessingStep({
|
|
|
7334
7589
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
7335
7590
|
] }),
|
|
7336
7591
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
7337
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7592
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _368 => _368.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7338
7593
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
7339
7594
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
7340
7595
|
"$",
|
|
@@ -7346,7 +7601,7 @@ function ProcessingStep({
|
|
|
7346
7601
|
] })
|
|
7347
7602
|
] })
|
|
7348
7603
|
] }),
|
|
7349
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
7604
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _369 => _369.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7350
7605
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
7351
7606
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
7352
7607
|
"$",
|
|
@@ -7413,7 +7668,7 @@ function ProcessingStep({
|
|
|
7413
7668
|
) })
|
|
7414
7669
|
] })
|
|
7415
7670
|
] }) : (() => {
|
|
7416
|
-
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess',
|
|
7671
|
+
const { display, struck } = quoteFeeRow(_optionalChain([quote, 'optionalAccess', _370 => _370.fees]));
|
|
7417
7672
|
if (display !== null) {
|
|
7418
7673
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
7419
7674
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
@@ -7562,7 +7817,7 @@ var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
|
7562
7817
|
function readDedupedAccountSetupResult(requestKey) {
|
|
7563
7818
|
const now = Date.now();
|
|
7564
7819
|
const existing = setupRequestDedupe.get(requestKey);
|
|
7565
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
7820
|
+
if (_optionalChain([existing, 'optionalAccess', _371 => _371.settled]) && existing.expiresAt > now && existing.result) {
|
|
7566
7821
|
return existing.result;
|
|
7567
7822
|
}
|
|
7568
7823
|
return null;
|
|
@@ -7596,7 +7851,7 @@ async function runAccountSetup(input, deps) {
|
|
|
7596
7851
|
chain: _chunkOY5N3E6Lcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
7597
7852
|
token: input.targetToken,
|
|
7598
7853
|
recipient: input.recipient,
|
|
7599
|
-
..._optionalChain([input, 'access',
|
|
7854
|
+
..._optionalChain([input, 'access', _372 => _372.outputTokenRules, 'optionalAccess', _373 => _373.length]) && {
|
|
7600
7855
|
outputTokenRules: input.outputTokenRules
|
|
7601
7856
|
},
|
|
7602
7857
|
...input.rejectUnmapped != null && {
|
|
@@ -7777,4 +8032,10 @@ function mapError(error) {
|
|
|
7777
8032
|
|
|
7778
8033
|
|
|
7779
8034
|
|
|
7780
|
-
|
|
8035
|
+
|
|
8036
|
+
|
|
8037
|
+
|
|
8038
|
+
|
|
8039
|
+
|
|
8040
|
+
|
|
8041
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.CardIcon = CardIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.MigrateAssetsIcon = MigrateAssetsIcon; exports.AppleIcon = AppleIcon; exports.BodyHeader = BodyHeader; exports.CdnIcon = CdnIcon; exports.ListRow = ListRow; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.catalogKeyForChain = catalogKeyForChain; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.chainIdsByValue = chainIdsByValue; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.quoteFeeRow = quoteFeeRow; exports.SwappedConnectFeeChangedError = SwappedConnectFeeChangedError; exports.SUPPORTED_CONNECT_EXCHANGE_COUNT = SUPPORTED_CONNECT_EXCHANGE_COUNT; exports.resolveAppFeeBps = resolveAppFeeBps; exports.isDepositPolicyRefusal = isDepositPolicyRefusal; exports.PermitDepositSubmitError = PermitDepositSubmitError; exports.createDepositService = createDepositService; exports.depositBoundsViolation = depositBoundsViolation; exports.describePolicyRefusal = describePolicyRefusal; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.useStableRpcUrls = useStableRpcUrls; exports.getPublicClient = getPublicClient; exports.peekRuntimeChains = peekRuntimeChains; exports.primeRuntimeChains = primeRuntimeChains; exports.useChainCatalog = useChainCatalog; exports.useCatalogChain = useCatalogChain; exports.useDepositChainIds = useDepositChainIds; exports.useDestinationChains = useDestinationChains; exports.useTargetTokens = useTargetTokens; exports.useDepositOffer = useDepositOffer; exports.useDepositBounds = useDepositBounds; exports.useRestrictedListExclusion = useRestrictedListExclusion; exports.useIsDepositChain = useIsDepositChain; exports.useChainName = useChainName; exports.useReadClient = useReadClient; exports.useExplorerTxUrl = useExplorerTxUrl; exports.ChainCatalogProvider = ChainCatalogProvider; exports.getExchangeLogoSrc = getExchangeLogoSrc; exports.getExchangeLogo = getExchangeLogo; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.Callout = Callout; exports.TokenIcon = TokenIcon; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.formatExpectedDuration = formatExpectedDuration; exports.markSubmissionUncertain = markSubmissionUncertain; exports.isSubmissionUncertain = isSubmissionUncertain; exports.formatTokenAmount = formatTokenAmount; exports.isDisplayStablecoinSymbol = isDisplayStablecoinSymbol; exports.isRecognizedToken = isRecognizedToken; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; 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.AnalyticsSession = AnalyticsSession; exports.useDepositAnalyticsEmitter = useDepositAnalyticsEmitter; exports.useWithdrawAnalyticsEmitter = useWithdrawAnalyticsEmitter; exports.SetupError = SetupError; exports.deriveAccountSalt = deriveAccountSalt; exports.computeRequestKey = computeRequestKey; exports.computeCacheKey = computeCacheKey; exports.computeIsCacheable = computeIsCacheable; exports.readDedupedAccountSetupResult = readDedupedAccountSetupResult; exports.runAccountSetupDeduped = runAccountSetupDeduped; exports.HistoryEntryButton = HistoryEntryButton; exports.HistoryOverlay = HistoryOverlay; exports.useHistoryPanel = useHistoryPanel; exports.resolveThemeMode = resolveThemeMode; exports.followSystemAppearance = followSystemAppearance; exports.applyTheme = applyTheme; exports.warnRemovedProps = warnRemovedProps; exports.checkBackendUrl = checkBackendUrl; exports.isHistoryEntryVisible = isHistoryEntryVisible; exports.createHistoryAnalytics = createHistoryAnalytics; exports.analyticsTargetProperties = analyticsTargetProperties;
|