@rhinestone/deposit-modal 0.2.4 → 0.3.0-alpha.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 +40 -211
- package/dist/{DepositModalReown-CY5MSQGK.mjs → DepositModalReown-GXY65HZP.mjs} +3 -3
- package/dist/{DepositModalReown-2UMPITRN.cjs → DepositModalReown-HVIEA6YA.cjs} +4 -4
- package/dist/QRCode-SMMYPUQC.cjs +58 -0
- package/dist/QRCode-YMQTKSSK.mjs +58 -0
- package/dist/{WithdrawModalReown-Z5BUZQ4Z.cjs → WithdrawModalReown-4M3PBY2T.cjs} +4 -4
- package/dist/{WithdrawModalReown-YSRO5ZTA.mjs → WithdrawModalReown-O6V6KRH6.mjs} +3 -3
- package/dist/{chunk-ARGMXV6E.cjs → chunk-7SYZG47X.cjs} +1723 -1881
- package/dist/{chunk-WHW3ZMOT.mjs → chunk-EEHUOFIW.mjs} +107 -90
- package/dist/{chunk-KJEHVIPZ.mjs → chunk-FKPTIHU7.mjs} +631 -423
- package/dist/{chunk-HFQV7EHS.mjs → chunk-U5QIFNG4.mjs} +1774 -1932
- package/dist/{chunk-WNFGZS56.mjs → chunk-UIHAYD7J.mjs} +1079 -784
- package/dist/{chunk-R2HP743T.cjs → chunk-XCAF6B3D.cjs} +51 -34
- package/dist/{chunk-NFXJEOE6.cjs → chunk-Y3RA3YGA.cjs} +1101 -806
- package/dist/{chunk-QUOP5C6V.cjs → chunk-Z2SIC2TH.cjs} +686 -478
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -3
- package/dist/deposit.d.ts +2 -3
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +4 -4
- package/dist/styles.css +1068 -752
- package/dist/{types-DGQzvl6v.d.ts → types-DRou84ZM.d.cts} +147 -33
- package/dist/{types-DJ1fzNC7.d.cts → types-DRou84ZM.d.ts} +147 -33
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -3
- package/dist/withdraw.d.ts +2 -3
- package/dist/withdraw.mjs +3 -3
- package/package.json +13 -12
- package/dist/reown.cjs +0 -16
- package/dist/reown.d.cts +0 -10
- package/dist/reown.d.ts +0 -10
- package/dist/reown.mjs +0 -16
- package/dist/safe.cjs +0 -1
- package/dist/safe.d.cts +0 -62
- package/dist/safe.d.ts +0 -62
- package/dist/safe.mjs +0 -0
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkXCAF6B3Dcjs = require('./chunk-XCAF6B3D.cjs');
|
|
12
13
|
|
|
13
14
|
// src/components/ui/Modal.tsx
|
|
14
15
|
|
|
@@ -141,6 +142,46 @@ function Modal({
|
|
|
141
142
|
}
|
|
142
143
|
Modal.displayName = "Modal";
|
|
143
144
|
|
|
145
|
+
// src/components/ui/Icons.tsx
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
var _lucidereact = require('lucide-react');
|
|
166
|
+
var WalletIcon = _lucidereact.Wallet;
|
|
167
|
+
var ExternalLinkIcon = _lucidereact.ExternalLink;
|
|
168
|
+
var CheckIcon = _lucidereact.Check;
|
|
169
|
+
var ChevronRightIcon = _lucidereact.ChevronRight;
|
|
170
|
+
var ChevronLeftIcon = _lucidereact.ChevronLeft;
|
|
171
|
+
var ChevronDownIcon = _lucidereact.ChevronDown;
|
|
172
|
+
var CloseIcon = _lucidereact.X;
|
|
173
|
+
var HandCoinsIcon = _lucidereact.HandCoins;
|
|
174
|
+
var CoinsIcon = _lucidereact.Coins;
|
|
175
|
+
var HistoryIcon = _lucidereact.History;
|
|
176
|
+
var InfoIcon = _lucidereact.Info;
|
|
177
|
+
var CopyIcon = _lucidereact.Copy;
|
|
178
|
+
var ArrowRightIcon = _lucidereact.ArrowRight;
|
|
179
|
+
var AlertTriangleIcon = _lucidereact.AlertTriangle;
|
|
180
|
+
var PercentIcon = _lucidereact.Percent;
|
|
181
|
+
var ClockIcon = _lucidereact.Clock;
|
|
182
|
+
var PlusCircleIcon = _lucidereact.CirclePlus;
|
|
183
|
+
var CircleArrowOutUpLeftIcon = _lucidereact.CircleArrowOutUpLeft;
|
|
184
|
+
|
|
144
185
|
// src/core/debug.ts
|
|
145
186
|
function truncateString(value, max = 240) {
|
|
146
187
|
if (value.length <= max) return value;
|
|
@@ -214,6 +255,48 @@ function isSolanaCaip2(value) {
|
|
|
214
255
|
return typeof value === "string" && value.startsWith("solana:");
|
|
215
256
|
}
|
|
216
257
|
|
|
258
|
+
// src/core/deposit-asset-helpers.ts
|
|
259
|
+
function getAssetId(asset) {
|
|
260
|
+
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
261
|
+
}
|
|
262
|
+
function isEvmAddress(value) {
|
|
263
|
+
return /^0x[a-fA-F0-9]{40}$/.test(value);
|
|
264
|
+
}
|
|
265
|
+
function portfolioTokenToAsset(token) {
|
|
266
|
+
if (typeof token.chainId !== "number") return null;
|
|
267
|
+
if (!isEvmAddress(token.address)) return null;
|
|
268
|
+
return {
|
|
269
|
+
id: getAssetId({ chainId: token.chainId, token: token.address }),
|
|
270
|
+
chainId: token.chainId,
|
|
271
|
+
token: token.address,
|
|
272
|
+
symbol: token.symbol,
|
|
273
|
+
name: token.name,
|
|
274
|
+
decimals: token.decimals,
|
|
275
|
+
balance: token.balance,
|
|
276
|
+
balanceUsd: token.balanceUsd
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function safeBigInt(value) {
|
|
280
|
+
if (!value) return BigInt(0);
|
|
281
|
+
try {
|
|
282
|
+
return BigInt(value);
|
|
283
|
+
} catch (e) {
|
|
284
|
+
return BigInt(0);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function portfolioToAssets(tokens) {
|
|
288
|
+
return tokens.map(portfolioTokenToAsset).filter((token) => token !== null).sort((a, b) => {
|
|
289
|
+
const balanceA = safeBigInt(a.balance);
|
|
290
|
+
const balanceB = safeBigInt(b.balance);
|
|
291
|
+
if (balanceB > balanceA) return 1;
|
|
292
|
+
if (balanceB < balanceA) return -1;
|
|
293
|
+
return 0;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function isNativeAsset(asset) {
|
|
297
|
+
return asset.token.toLowerCase() === "0x0000000000000000000000000000000000000000";
|
|
298
|
+
}
|
|
299
|
+
|
|
217
300
|
// src/core/deposit-service.ts
|
|
218
301
|
function depositRowToEvent(row) {
|
|
219
302
|
const status = row.status;
|
|
@@ -359,6 +442,25 @@ function createDepositService(baseUrl, options) {
|
|
|
359
442
|
if (value.length <= 20) return value;
|
|
360
443
|
return `${value.slice(0, 10)}...${value.slice(-8)}`;
|
|
361
444
|
}
|
|
445
|
+
const PORTFOLIO_CACHE_TTL_MS = 3e4;
|
|
446
|
+
const portfolioCache = /* @__PURE__ */ new Map();
|
|
447
|
+
function cachedPortfolio(key, fetcher) {
|
|
448
|
+
const now = Date.now();
|
|
449
|
+
const entry = portfolioCache.get(key);
|
|
450
|
+
if (entry && entry.expiresAt > now) {
|
|
451
|
+
debugLog(debug, scope, "portfolio:cache-hit", { key });
|
|
452
|
+
return entry.promise;
|
|
453
|
+
}
|
|
454
|
+
const promise = fetcher().catch((err) => {
|
|
455
|
+
portfolioCache.delete(key);
|
|
456
|
+
throw err;
|
|
457
|
+
});
|
|
458
|
+
portfolioCache.set(key, {
|
|
459
|
+
promise,
|
|
460
|
+
expiresAt: now + PORTFOLIO_CACHE_TTL_MS
|
|
461
|
+
});
|
|
462
|
+
return promise;
|
|
463
|
+
}
|
|
362
464
|
return {
|
|
363
465
|
async setupAccount(params) {
|
|
364
466
|
const url = apiUrl("/setup-account");
|
|
@@ -443,78 +545,82 @@ function createDepositService(baseUrl, options) {
|
|
|
443
545
|
return result;
|
|
444
546
|
},
|
|
445
547
|
async fetchPortfolio(address) {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
548
|
+
return cachedPortfolio(`evm:${address.toLowerCase()}`, async () => {
|
|
549
|
+
const url = apiUrl(`/portfolio/${address}`);
|
|
550
|
+
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
551
|
+
const response = await fetch(url, {
|
|
552
|
+
method: "GET",
|
|
553
|
+
headers: { "Content-Type": "application/json" }
|
|
554
|
+
});
|
|
555
|
+
if (!response.ok) {
|
|
556
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
557
|
+
debugError(
|
|
558
|
+
debug,
|
|
559
|
+
scope,
|
|
560
|
+
"fetchPortfolio:failed",
|
|
561
|
+
error,
|
|
562
|
+
{ status: response.status, address }
|
|
563
|
+
);
|
|
564
|
+
throw new Error(
|
|
565
|
+
error.error || `Portfolio fetch failed: ${response.status}`
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
const data = await response.json();
|
|
569
|
+
const direct = normalizeDirectPortfolio(data);
|
|
570
|
+
if (direct.tokens.length > 0) {
|
|
571
|
+
debugLog(debug, scope, "fetchPortfolio:success", {
|
|
572
|
+
address,
|
|
573
|
+
source: "direct",
|
|
574
|
+
tokenCount: direct.tokens.length,
|
|
575
|
+
totalUsd: direct.totalUsd
|
|
576
|
+
});
|
|
577
|
+
return direct;
|
|
578
|
+
}
|
|
579
|
+
const portfolioData = extractOrchestratorPortfolio(data);
|
|
580
|
+
if (portfolioData) {
|
|
581
|
+
const normalized = normalizeOrchestratorPortfolio(portfolioData);
|
|
582
|
+
debugLog(debug, scope, "fetchPortfolio:success", {
|
|
583
|
+
address,
|
|
584
|
+
source: "orchestrator",
|
|
585
|
+
tokenCount: normalized.tokens.length,
|
|
586
|
+
totalUsd: normalized.totalUsd
|
|
587
|
+
});
|
|
588
|
+
return normalized;
|
|
589
|
+
}
|
|
590
|
+
debugLog(debug, scope, "fetchPortfolio:empty", { address });
|
|
591
|
+
return { tokens: [], totalUsd: 0 };
|
|
451
592
|
});
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
{
|
|
460
|
-
);
|
|
461
|
-
throw new Error(
|
|
462
|
-
error.error || `Portfolio fetch failed: ${response.status}`
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
const data = await response.json();
|
|
466
|
-
const direct = normalizeDirectPortfolio(data);
|
|
467
|
-
if (direct.tokens.length > 0) {
|
|
468
|
-
debugLog(debug, scope, "fetchPortfolio:success", {
|
|
469
|
-
address,
|
|
470
|
-
source: "direct",
|
|
471
|
-
tokenCount: direct.tokens.length,
|
|
472
|
-
totalUsd: direct.totalUsd
|
|
593
|
+
},
|
|
594
|
+
async fetchSolanaPortfolio(address) {
|
|
595
|
+
return cachedPortfolio(`sol:${address}`, async () => {
|
|
596
|
+
const url = apiUrl(`/portfolio/solana/${address}`);
|
|
597
|
+
debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
|
|
598
|
+
const response = await fetch(url, {
|
|
599
|
+
method: "GET",
|
|
600
|
+
headers: { "Content-Type": "application/json" }
|
|
473
601
|
});
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
602
|
+
if (!response.ok) {
|
|
603
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
604
|
+
debugError(
|
|
605
|
+
debug,
|
|
606
|
+
scope,
|
|
607
|
+
"fetchSolanaPortfolio:failed",
|
|
608
|
+
error,
|
|
609
|
+
{ status: response.status, address }
|
|
610
|
+
);
|
|
611
|
+
throw new Error(
|
|
612
|
+
error.error || `Solana portfolio fetch failed: ${response.status}`
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
const data = await response.json();
|
|
616
|
+
const normalized = normalizeDirectPortfolio(data);
|
|
617
|
+
debugLog(debug, scope, "fetchSolanaPortfolio:success", {
|
|
480
618
|
address,
|
|
481
|
-
source: "orchestrator",
|
|
482
619
|
tokenCount: normalized.tokens.length,
|
|
483
620
|
totalUsd: normalized.totalUsd
|
|
484
621
|
});
|
|
485
622
|
return normalized;
|
|
486
|
-
}
|
|
487
|
-
debugLog(debug, scope, "fetchPortfolio:empty", { address });
|
|
488
|
-
return { tokens: [], totalUsd: 0 };
|
|
489
|
-
},
|
|
490
|
-
async fetchSolanaPortfolio(address) {
|
|
491
|
-
const url = apiUrl(`/portfolio/solana/${address}`);
|
|
492
|
-
debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
|
|
493
|
-
const response = await fetch(url, {
|
|
494
|
-
method: "GET",
|
|
495
|
-
headers: { "Content-Type": "application/json" }
|
|
496
|
-
});
|
|
497
|
-
if (!response.ok) {
|
|
498
|
-
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
499
|
-
debugError(
|
|
500
|
-
debug,
|
|
501
|
-
scope,
|
|
502
|
-
"fetchSolanaPortfolio:failed",
|
|
503
|
-
error,
|
|
504
|
-
{ status: response.status, address }
|
|
505
|
-
);
|
|
506
|
-
throw new Error(
|
|
507
|
-
error.error || `Solana portfolio fetch failed: ${response.status}`
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
const data = await response.json();
|
|
511
|
-
const normalized = normalizeDirectPortfolio(data);
|
|
512
|
-
debugLog(debug, scope, "fetchSolanaPortfolio:success", {
|
|
513
|
-
address,
|
|
514
|
-
tokenCount: normalized.tokens.length,
|
|
515
|
-
totalUsd: normalized.totalUsd
|
|
516
623
|
});
|
|
517
|
-
return normalized;
|
|
518
624
|
},
|
|
519
625
|
async checkAccount(address) {
|
|
520
626
|
const url = apiUrl(`/check/${address}`);
|
|
@@ -775,14 +881,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
775
881
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _24 => _24.balance, 'optionalAccess', _25 => _25.unlocked]), () => ( "0"));
|
|
776
882
|
const normalizedName = tokenData.tokenName.trim();
|
|
777
883
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
778
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
779
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
884
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkXCAF6B3Dcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
885
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkXCAF6B3Dcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
780
886
|
if (!resolvedTokenAddress) {
|
|
781
887
|
continue;
|
|
782
888
|
}
|
|
783
|
-
const registrySymbol =
|
|
889
|
+
const registrySymbol = _chunkXCAF6B3Dcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
784
890
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
785
|
-
const decimals = registrySymbol !== "Token" ?
|
|
891
|
+
const decimals = registrySymbol !== "Token" ? _chunkXCAF6B3Dcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
786
892
|
tokens.push({
|
|
787
893
|
chainId: chainBalance.chainId,
|
|
788
894
|
address: resolvedTokenAddress,
|
|
@@ -811,14 +917,14 @@ function normalizeDirectToken(token) {
|
|
|
811
917
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
812
918
|
token.token,
|
|
813
919
|
"address"
|
|
814
|
-
))), () => ( (typeof chainId === "number" ?
|
|
920
|
+
))), () => ( (typeof chainId === "number" ? _chunkXCAF6B3Dcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
|
|
815
921
|
if (!address) return null;
|
|
816
922
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
817
923
|
const isSolanaToken = chainId === "solana";
|
|
818
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
924
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkXCAF6B3Dcjs.getTokenSymbol.call(void 0, address, chainId);
|
|
819
925
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
820
926
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
821
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
927
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkXCAF6B3Dcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
822
928
|
return {
|
|
823
929
|
chainId,
|
|
824
930
|
address,
|
|
@@ -857,111 +963,6 @@ function extractNumericString(data, key) {
|
|
|
857
963
|
const parsed = Number(value);
|
|
858
964
|
return Number.isFinite(parsed) ? parsed : null;
|
|
859
965
|
}
|
|
860
|
-
function getAssetId(asset) {
|
|
861
|
-
return `${asset.chainId}:${asset.token.toLowerCase()}`;
|
|
862
|
-
}
|
|
863
|
-
function isEvmAddress(value) {
|
|
864
|
-
return /^0x[a-fA-F0-9]{40}$/.test(value);
|
|
865
|
-
}
|
|
866
|
-
function portfolioTokenToAsset(token) {
|
|
867
|
-
if (typeof token.chainId !== "number") return null;
|
|
868
|
-
if (!isEvmAddress(token.address)) return null;
|
|
869
|
-
return {
|
|
870
|
-
id: getAssetId({ chainId: token.chainId, token: token.address }),
|
|
871
|
-
chainId: token.chainId,
|
|
872
|
-
token: token.address,
|
|
873
|
-
symbol: token.symbol,
|
|
874
|
-
name: token.name,
|
|
875
|
-
decimals: token.decimals,
|
|
876
|
-
balance: token.balance,
|
|
877
|
-
balanceUsd: token.balanceUsd
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
function portfolioToAssets(tokens) {
|
|
881
|
-
return tokens.map(portfolioTokenToAsset).filter((token) => token !== null).sort((a, b) => {
|
|
882
|
-
const balanceA = safeBigInt(a.balance);
|
|
883
|
-
const balanceB = safeBigInt(b.balance);
|
|
884
|
-
if (balanceB > balanceA) return 1;
|
|
885
|
-
if (balanceB < balanceA) return -1;
|
|
886
|
-
return 0;
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
function safeBigInt(value) {
|
|
890
|
-
if (!value) return BigInt(0);
|
|
891
|
-
try {
|
|
892
|
-
return BigInt(value);
|
|
893
|
-
} catch (e) {
|
|
894
|
-
return BigInt(0);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
function isNativeAsset(asset) {
|
|
898
|
-
return asset.token.toLowerCase() === "0x0000000000000000000000000000000000000000";
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
// src/core/formatters.ts
|
|
902
|
-
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
903
|
-
style: "currency",
|
|
904
|
-
currency: "USD",
|
|
905
|
-
maximumFractionDigits: 2
|
|
906
|
-
});
|
|
907
|
-
var tokenFormatter = new Intl.NumberFormat("en-US", {
|
|
908
|
-
maximumFractionDigits: 6
|
|
909
|
-
});
|
|
910
|
-
function formatUserError(raw) {
|
|
911
|
-
const lower = raw.toLowerCase();
|
|
912
|
-
if (lower.includes("user rejected") || lower.includes("user denied")) {
|
|
913
|
-
return "Transaction cancelled";
|
|
914
|
-
}
|
|
915
|
-
if (lower.includes("insufficient funds")) {
|
|
916
|
-
return "Insufficient funds for this transaction";
|
|
917
|
-
}
|
|
918
|
-
if (lower.includes("nonce too low") || lower.includes("nonce too high")) {
|
|
919
|
-
return "Transaction conflict \u2014 please try again";
|
|
920
|
-
}
|
|
921
|
-
if (lower.includes("execution reverted")) {
|
|
922
|
-
return "Transaction would fail on-chain";
|
|
923
|
-
}
|
|
924
|
-
if (lower.includes("timed out") || lower.includes("took too long")) {
|
|
925
|
-
return "Request timed out \u2014 please try again";
|
|
926
|
-
}
|
|
927
|
-
if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
|
|
928
|
-
return "Service unavailable \u2014 please try again";
|
|
929
|
-
}
|
|
930
|
-
if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
|
|
931
|
-
return "Solana RPC unavailable \u2014 please retry";
|
|
932
|
-
}
|
|
933
|
-
if (lower.includes("network") || lower.includes("disconnected")) {
|
|
934
|
-
return "Network error \u2014 check your connection";
|
|
935
|
-
}
|
|
936
|
-
if (lower.includes("rate limit") || lower.includes("429")) {
|
|
937
|
-
return "Rate limited \u2014 please try again shortly";
|
|
938
|
-
}
|
|
939
|
-
let cleaned = raw;
|
|
940
|
-
const stripMarkers = [
|
|
941
|
-
"\n\nRequest Arguments:",
|
|
942
|
-
"\nRaw Call Arguments:",
|
|
943
|
-
"\nRequest body:",
|
|
944
|
-
"\nContract Call:",
|
|
945
|
-
"\nDocs:",
|
|
946
|
-
"\nDetails:",
|
|
947
|
-
"\nVersion:",
|
|
948
|
-
"\nURL:"
|
|
949
|
-
];
|
|
950
|
-
for (const marker of stripMarkers) {
|
|
951
|
-
const idx = cleaned.indexOf(marker);
|
|
952
|
-
if (idx !== -1) {
|
|
953
|
-
cleaned = cleaned.slice(0, idx).trim();
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
|
|
957
|
-
if (cleaned.length === 0) {
|
|
958
|
-
return "An unexpected error occurred";
|
|
959
|
-
}
|
|
960
|
-
if (cleaned.length > 120) {
|
|
961
|
-
return cleaned.slice(0, 120) + "...";
|
|
962
|
-
}
|
|
963
|
-
return cleaned;
|
|
964
|
-
}
|
|
965
966
|
|
|
966
967
|
// src/core/useLatestRef.ts
|
|
967
968
|
|
|
@@ -986,14 +987,100 @@ function setVar(targets, prop, value) {
|
|
|
986
987
|
el.style.setProperty(prop, value);
|
|
987
988
|
}
|
|
988
989
|
}
|
|
990
|
+
function clearVar(targets, prop) {
|
|
991
|
+
for (const el of targets) {
|
|
992
|
+
el.style.removeProperty(prop);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
function normalizeHex(input) {
|
|
996
|
+
const v = input.trim().replace(/^#/, "");
|
|
997
|
+
if (/^[0-9a-fA-F]{3}$/.test(v)) {
|
|
998
|
+
return v.split("").map((c) => c + c).join("").toLowerCase();
|
|
999
|
+
}
|
|
1000
|
+
if (/^[0-9a-fA-F]{6}$/.test(v)) return v.toLowerCase();
|
|
1001
|
+
return null;
|
|
1002
|
+
}
|
|
1003
|
+
function hexToHsl(hex) {
|
|
1004
|
+
const normalized = normalizeHex(hex);
|
|
1005
|
+
if (!normalized) return null;
|
|
1006
|
+
const r = parseInt(normalized.slice(0, 2), 16) / 255;
|
|
1007
|
+
const g = parseInt(normalized.slice(2, 4), 16) / 255;
|
|
1008
|
+
const b = parseInt(normalized.slice(4, 6), 16) / 255;
|
|
1009
|
+
const max = Math.max(r, g, b);
|
|
1010
|
+
const min = Math.min(r, g, b);
|
|
1011
|
+
const l = (max + min) / 2;
|
|
1012
|
+
let h = 0;
|
|
1013
|
+
let s = 0;
|
|
1014
|
+
if (max !== min) {
|
|
1015
|
+
const d = max - min;
|
|
1016
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
1017
|
+
switch (max) {
|
|
1018
|
+
case r:
|
|
1019
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
1020
|
+
break;
|
|
1021
|
+
case g:
|
|
1022
|
+
h = (b - r) / d + 2;
|
|
1023
|
+
break;
|
|
1024
|
+
case b:
|
|
1025
|
+
h = (r - g) / d + 4;
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
h *= 60;
|
|
1029
|
+
}
|
|
1030
|
+
return { h, s: s * 100, l: l * 100 };
|
|
1031
|
+
}
|
|
1032
|
+
var clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
|
|
1033
|
+
var hsl = ({ h, s, l }) => `hsl(${h.toFixed(1)} ${clamp(s, 0, 100).toFixed(1)}% ${clamp(l, 0, 100).toFixed(1)}%)`;
|
|
1034
|
+
function deriveCustomPrimary(baseHex) {
|
|
1035
|
+
const base = hexToHsl(baseHex);
|
|
1036
|
+
if (!base) return null;
|
|
1037
|
+
const { h, s, l } = base;
|
|
1038
|
+
const direction = l < 25 ? 1 : -1;
|
|
1039
|
+
const hoverL = clamp(l + 8 * direction, 4, 96);
|
|
1040
|
+
const activeL = clamp(l + 14 * direction, 2, 98);
|
|
1041
|
+
const disabledBg = {
|
|
1042
|
+
h,
|
|
1043
|
+
s: clamp(s * 0.25, 0, 20),
|
|
1044
|
+
l: clamp(l > 75 ? l - 15 : 88, 12, 92)
|
|
1045
|
+
};
|
|
1046
|
+
const disabledFg = {
|
|
1047
|
+
h,
|
|
1048
|
+
s: clamp(s * 0.35, 0, 25),
|
|
1049
|
+
l: clamp(l > 75 ? 35 : 45, 30, 60)
|
|
1050
|
+
};
|
|
1051
|
+
const norm = normalizeHex(baseHex);
|
|
1052
|
+
const ch = (i) => {
|
|
1053
|
+
const v = parseInt(norm.slice(i, i + 2), 16) / 255;
|
|
1054
|
+
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
1055
|
+
};
|
|
1056
|
+
const y = 0.2126 * ch(0) + 0.7152 * ch(2) + 0.0722 * ch(4);
|
|
1057
|
+
const foreground = y > 0.45 ? "#18181b" : "#fafafa";
|
|
1058
|
+
return {
|
|
1059
|
+
base: hsl({ h, s, l }),
|
|
1060
|
+
hover: hsl({ h, s, l: hoverL }),
|
|
1061
|
+
active: hsl({ h, s, l: activeL }),
|
|
1062
|
+
disabledBg: hsl(disabledBg),
|
|
1063
|
+
disabledFg: hsl(disabledFg),
|
|
1064
|
+
foreground
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
var CUSTOM_PRIMARY_VARS = [
|
|
1068
|
+
"--rs-primary",
|
|
1069
|
+
"--rs-primary-hover",
|
|
1070
|
+
"--rs-primary-active",
|
|
1071
|
+
"--rs-primary-disabled-bg",
|
|
1072
|
+
"--rs-primary-disabled-fg",
|
|
1073
|
+
"--rs-primary-foreground",
|
|
1074
|
+
"--rs-border-accent"
|
|
1075
|
+
];
|
|
989
1076
|
function applyTheme(element, theme) {
|
|
990
1077
|
if (!element) return;
|
|
991
1078
|
const parent = element.parentElement;
|
|
992
1079
|
const targets = _optionalChain([parent, 'optionalAccess', _45 => _45.classList, 'access', _46 => _46.contains, 'call', _47 => _47("rs-modal-content")]) ? [element, parent] : [element];
|
|
993
1080
|
if (_optionalChain([theme, 'optionalAccess', _48 => _48.mode])) {
|
|
994
|
-
|
|
1081
|
+
for (const t of targets) t.setAttribute("data-theme", theme.mode);
|
|
995
1082
|
} else {
|
|
996
|
-
|
|
1083
|
+
for (const t of targets) t.removeAttribute("data-theme");
|
|
997
1084
|
}
|
|
998
1085
|
if (_optionalChain([theme, 'optionalAccess', _49 => _49.fontColor])) {
|
|
999
1086
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
@@ -1002,15 +1089,33 @@ function applyTheme(element, theme) {
|
|
|
1002
1089
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
1003
1090
|
}
|
|
1004
1091
|
if (_optionalChain([theme, 'optionalAccess', _51 => _51.ctaColor])) {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1092
|
+
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
1093
|
+
if (derived) {
|
|
1094
|
+
setVar(targets, "--rs-primary", derived.base);
|
|
1095
|
+
setVar(
|
|
1096
|
+
targets,
|
|
1097
|
+
"--rs-primary-hover",
|
|
1098
|
+
_nullishCoalesce(theme.ctaHoverColor, () => ( derived.hover))
|
|
1099
|
+
);
|
|
1100
|
+
setVar(targets, "--rs-primary-active", derived.active);
|
|
1101
|
+
setVar(targets, "--rs-primary-disabled-bg", derived.disabledBg);
|
|
1102
|
+
setVar(targets, "--rs-primary-disabled-fg", derived.disabledFg);
|
|
1103
|
+
setVar(targets, "--rs-primary-foreground", derived.foreground);
|
|
1104
|
+
setVar(targets, "--rs-border-accent", derived.base);
|
|
1105
|
+
} else {
|
|
1106
|
+
setVar(targets, "--rs-primary", theme.ctaColor);
|
|
1107
|
+
setVar(targets, "--rs-border-accent", theme.ctaColor);
|
|
1108
|
+
setVar(
|
|
1109
|
+
targets,
|
|
1110
|
+
"--rs-primary-hover",
|
|
1111
|
+
_nullishCoalesce(theme.ctaHoverColor, () => ( theme.ctaColor))
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
} else {
|
|
1115
|
+
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
1116
|
+
if (_optionalChain([theme, 'optionalAccess', _52 => _52.ctaHoverColor])) {
|
|
1117
|
+
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
1118
|
+
}
|
|
1014
1119
|
}
|
|
1015
1120
|
if (_optionalChain([theme, 'optionalAccess', _53 => _53.borderColor])) {
|
|
1016
1121
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
@@ -1028,355 +1133,494 @@ function applyTheme(element, theme) {
|
|
|
1028
1133
|
}
|
|
1029
1134
|
}
|
|
1030
1135
|
|
|
1031
|
-
// src/components/ui/
|
|
1136
|
+
// src/components/ui/BodyHeader.tsx
|
|
1032
1137
|
|
|
1033
|
-
function
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1138
|
+
function BodyHeader({
|
|
1139
|
+
icon,
|
|
1140
|
+
title,
|
|
1141
|
+
subtitle,
|
|
1142
|
+
variant = "default"
|
|
1143
|
+
}) {
|
|
1144
|
+
const iconClasses = [
|
|
1145
|
+
"rs-body-header-icon",
|
|
1146
|
+
variant === "success" ? "rs-body-header-icon--success" : "",
|
|
1147
|
+
variant === "error" ? "rs-body-header-icon--error" : ""
|
|
1148
|
+
].filter(Boolean).join(" ");
|
|
1149
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
1150
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: iconClasses, children: icon }),
|
|
1151
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header-text", children: [
|
|
1152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: title }),
|
|
1153
|
+
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-body-header-subtitle", children: subtitle })
|
|
1154
|
+
] })
|
|
1155
|
+
] });
|
|
1156
|
+
}
|
|
1157
|
+
BodyHeader.displayName = "BodyHeader";
|
|
1158
|
+
|
|
1159
|
+
// src/components/ui/PoweredBy.tsx
|
|
1160
|
+
|
|
1161
|
+
var rhinestoneLogo = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1162
|
+
"svg",
|
|
1163
|
+
{
|
|
1164
|
+
className: "rs-powered-by-logo",
|
|
1165
|
+
viewBox: "0 0 72 16",
|
|
1166
|
+
fill: "none",
|
|
1167
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1168
|
+
"aria-hidden": "true",
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "g", { fill: "currentColor", clipPath: "url(#rs-pb-clip)", children: [
|
|
1041
1171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1042
1172
|
"path",
|
|
1043
1173
|
{
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1174
|
+
opacity: "0.5",
|
|
1175
|
+
fillRule: "evenodd",
|
|
1176
|
+
clipRule: "evenodd",
|
|
1177
|
+
d: "M10.48 14.82a4.3 4.3 0 0 1-2.9 1 4.3 4.3 0 0 1-2.4-1 25 25 0 0 1-2.08-1.95l-.13-.13c-.78-.78-1.46-1.46-1.94-2.08a4.3 4.3 0 0 1-1-2.9c.05-.96.48-1.72 1-2.4a25 25 0 0 1 1.94-2.08l.07-.06.06-.07a25 25 0 0 1 2.08-1.94 4.3 4.3 0 0 1 2.9-1c.96.05 1.73.48 2.4 1 .62.49 1.3 1.17 2.08 1.94l.13.13c.77.78 1.46 1.46 1.94 2.09a4.3 4.3 0 0 1 1 2.9 4.3 4.3 0 0 1-1 2.39c-.48.62-1.17 1.3-1.94 2.08l-.07.07-.06.06c-.78.78-1.46 1.46-2.08 1.94m-8.9-6.63c.07 1.02.9 1.86 2.56 3.52s2.5 2.5 3.53 2.56h.32c1.03-.06 1.86-.9 3.53-2.56s2.5-2.5 2.56-3.52v-.33c-.07-1.03-.9-1.86-2.56-3.52-1.67-1.67-2.5-2.5-3.53-2.56h-.32c-1.03.06-1.86.89-3.53 2.56-1.66 1.66-2.5 2.5-2.56 3.52z"
|
|
1047
1178
|
}
|
|
1048
1179
|
),
|
|
1180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M3.66 8.01q.02-.27.28-.35a4.6 4.6 0 0 0 2.53-1.48q.72-.8 1-2.05a.4.4 0 0 1 .36-.29c.17 0 .32.12.36.29a4.6 4.6 0 0 0 1.47 2.52c.55.49 1.21.8 2.06 1a.4.4 0 0 1 .28.36.4.4 0 0 1-.28.36 4.6 4.6 0 0 0-2.53 1.47 4.6 4.6 0 0 0-1 2.06.4.4 0 0 1-.36.28.4.4 0 0 1-.36-.28A4.6 4.6 0 0 0 6 9.38a4.6 4.6 0 0 0-2.06-1.01.4.4 0 0 1-.28-.36m26.46-3.44c0 .51.38.87.96.87s.95-.36.95-.87c0-.52-.37-.86-.95-.86s-.96.34-.96.86m.2 1.44v5.33h1.53V6.01zm-4.4 5.33h-1.55V3.88h1.54v2.98c.25-.5.8-1.01 1.6-1.01 1.29 0 1.87.83 1.87 2.28v3.21h-1.54V8.3c0-.77-.34-1.16-.92-1.16-.67 0-1 .53-1 1.3zm-4.45 0h-1.54V6.01h1.54l-.27 1.22a.1.1 0 0 0 .02.1.1.1 0 0 0 .1.04q.09 0 .1-.09c.24-.84.93-1.36 1.64-1.36q.4.01.57.05v1.42l-.67-.04c-.67 0-1.5.31-1.5 2zm13 0h-1.55V6.01h1.54l-.02.9a1.8 1.8 0 0 1 1.61-1.06c1.3 0 1.88.83 1.88 2.28v3.21H36.4V8.3c0-.77-.35-1.16-.93-1.16-.67 0-1 .53-1 1.3z" }),
|
|
1049
1181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
1182
|
"path",
|
|
1051
1183
|
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1184
|
+
fillRule: "evenodd",
|
|
1185
|
+
clipRule: "evenodd",
|
|
1186
|
+
d: "M38.74 8.69c0 1.63 1.01 2.82 2.7 2.82 1.51 0 2.32-.82 2.55-1.73l-1.43-.26c-.1.37-.47.82-1.12.82-.67 0-1.23-.6-1.24-1.31H44q.05-.19.06-.56a2.55 2.55 0 0 0-2.6-2.63c-1.5 0-2.72 1.2-2.72 2.85m3.82-.58h-2.3a1.2 1.2 0 0 1 1.18-1.13c.6 0 1.14.45 1.12 1.13"
|
|
1054
1187
|
}
|
|
1055
|
-
)
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M47.1 11.51c-1.2 0-2.33-.41-2.55-1.65l1.43-.21q.27.8 1.1.79c.5 0 .77-.24.77-.55 0-.27-.2-.45-.75-.55l-.5-.1c-1.1-.24-1.77-.74-1.77-1.63 0-1.06.91-1.78 2.25-1.78 1.26 0 2.2.59 2.32 1.68l-1.41.22c-.07-.52-.43-.82-.91-.82-.5 0-.75.26-.75.57 0 .25.17.42.63.51l.5.1c1.28.26 1.94.77 1.94 1.75 0 1.01-1.03 1.66-2.3 1.66" }),
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1191
|
+
"path",
|
|
1192
|
+
{
|
|
1193
|
+
fillRule: "evenodd",
|
|
1194
|
+
clipRule: "evenodd",
|
|
1195
|
+
d: "M54.44 8.68c0 1.53 1.08 2.83 2.78 2.83s2.79-1.3 2.79-2.83c0-1.55-1.1-2.84-2.79-2.84-1.7 0-2.78 1.29-2.78 2.84m4.02 0c0 .98-.59 1.45-1.24 1.45-.64 0-1.23-.47-1.23-1.45 0-.97.59-1.47 1.23-1.47.65 0 1.24.48 1.24 1.47"
|
|
1196
|
+
}
|
|
1197
|
+
),
|
|
1198
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M62.4 11.34h-1.53V6.01h1.54l-.02.9a1.8 1.8 0 0 1 1.6-1.06c1.3 0 1.89.83 1.89 2.28v3.21h-1.54V8.3c0-.77-.34-1.16-.93-1.16-.66 0-1 .53-1 1.3z" }),
|
|
1199
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1200
|
+
"path",
|
|
1201
|
+
{
|
|
1202
|
+
fillRule: "evenodd",
|
|
1203
|
+
clipRule: "evenodd",
|
|
1204
|
+
d: "M66.68 8.69c0 1.63 1.02 2.82 2.71 2.82 1.51 0 2.31-.82 2.55-1.73l-1.44-.26c-.1.37-.47.82-1.12.82-.67 0-1.23-.6-1.24-1.31h3.8q.06-.19.06-.56a2.55 2.55 0 0 0-2.6-2.63c-1.5 0-2.72 1.2-2.72 2.85m3.82-.58h-2.3a1.2 1.2 0 0 1 1.18-1.13c.6 0 1.15.45 1.12 1.13"
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M52.44 9.05V7.26h1.53V6h-1.53V4.42h-1.53V6h-1.1v1.26h1.1v1.85l.02.49a1.9 1.9 0 0 0 1.67 1.67c.22.03.47.03.62.03h.65V9.87h-.61c-.4 0-.59 0-.7-.12-.12-.11-.12-.3-.12-.64z" })
|
|
1208
|
+
] }),
|
|
1209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "defs", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "clipPath", { id: "rs-pb-clip", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { fill: "#fff", d: "M0 0h72v16H0z" }) }) })
|
|
1210
|
+
]
|
|
1211
|
+
}
|
|
1212
|
+
);
|
|
1213
|
+
function PoweredBy() {
|
|
1214
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-powered-by", "aria-label": "Powered by Rhinestone", children: [
|
|
1215
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Powered by" }),
|
|
1216
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
+
"a",
|
|
1218
|
+
{
|
|
1219
|
+
className: "rs-powered-by-link",
|
|
1220
|
+
href: "https://www.rhinestone.dev",
|
|
1221
|
+
target: "_blank",
|
|
1222
|
+
rel: "noopener noreferrer",
|
|
1223
|
+
children: rhinestoneLogo
|
|
1224
|
+
}
|
|
1225
|
+
)
|
|
1226
|
+
] });
|
|
1059
1227
|
}
|
|
1228
|
+
PoweredBy.displayName = "PoweredBy";
|
|
1060
1229
|
|
|
1061
|
-
// src/components/ui/
|
|
1230
|
+
// src/components/ui/ListRow.tsx
|
|
1062
1231
|
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1232
|
+
function ListRow({
|
|
1233
|
+
leading,
|
|
1234
|
+
leadingMedia,
|
|
1235
|
+
title,
|
|
1236
|
+
subtitle,
|
|
1237
|
+
meta,
|
|
1238
|
+
trailing,
|
|
1070
1239
|
className = "",
|
|
1071
1240
|
...props
|
|
1072
1241
|
}) {
|
|
1073
|
-
const classes = [
|
|
1074
|
-
"rs-button",
|
|
1075
|
-
`rs-button--${variant}`,
|
|
1076
|
-
`rs-button--size-${size}`,
|
|
1077
|
-
fullWidth ? "rs-button--full-width" : "",
|
|
1078
|
-
className
|
|
1079
|
-
].filter(Boolean).join(" ");
|
|
1080
1242
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1081
1243
|
"button",
|
|
1082
1244
|
{
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
"aria-busy": loading || void 0,
|
|
1245
|
+
type: "button",
|
|
1246
|
+
className: `rs-list-row ${className}`.trim(),
|
|
1086
1247
|
...props,
|
|
1087
1248
|
children: [
|
|
1088
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className:
|
|
1089
|
-
|
|
1249
|
+
leadingMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: leadingMedia, alt: "" }) }) : leading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-leading", children: leading }) : null,
|
|
1250
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-body", children: [
|
|
1251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list-row-text", children: [
|
|
1252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-title", children: title }),
|
|
1253
|
+
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-subtitle", children: subtitle })
|
|
1254
|
+
] }),
|
|
1255
|
+
meta && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list-row-meta", children: meta })
|
|
1256
|
+
] }),
|
|
1257
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-chevron", children: _nullishCoalesce(trailing, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}))) })
|
|
1090
1258
|
]
|
|
1091
1259
|
}
|
|
1092
1260
|
);
|
|
1093
1261
|
}
|
|
1094
|
-
|
|
1262
|
+
ListRow.displayName = "ListRow";
|
|
1095
1263
|
|
|
1096
|
-
// src/components/ui/
|
|
1264
|
+
// src/components/ui/WalletBadgeIcons.tsx
|
|
1097
1265
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1266
|
+
var RabbyIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1267
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "g", { clipPath: "url(#rs-rabby-clip)", children: [
|
|
1100
1268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1101
|
-
"
|
|
1269
|
+
"mask",
|
|
1270
|
+
{
|
|
1271
|
+
id: "rs-rabby-mask",
|
|
1272
|
+
style: { maskType: "luminance" },
|
|
1273
|
+
maskUnits: "userSpaceOnUse",
|
|
1274
|
+
x: "0",
|
|
1275
|
+
y: "0",
|
|
1276
|
+
width: "20",
|
|
1277
|
+
height: "20",
|
|
1278
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1279
|
+
"path",
|
|
1280
|
+
{
|
|
1281
|
+
d: "M20 10C20 4.47688 15.5231 0 10 0C4.47688 0 0 4.47688 0 10C0 15.5231 4.47688 20 10 20C15.5231 20 20 15.5231 20 10Z",
|
|
1282
|
+
fill: "white"
|
|
1283
|
+
}
|
|
1284
|
+
)
|
|
1285
|
+
}
|
|
1286
|
+
),
|
|
1287
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "g", { mask: "url(#rs-rabby-mask)", children: [
|
|
1288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1289
|
+
"path",
|
|
1290
|
+
{
|
|
1291
|
+
d: "M20 10C20 4.47688 15.5231 0 10 0C4.47688 0 0 4.47688 0 10C0 15.5231 4.47688 20 10 20C15.5231 20 20 15.5231 20 10Z",
|
|
1292
|
+
fill: "#7084FF"
|
|
1293
|
+
}
|
|
1294
|
+
),
|
|
1295
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1296
|
+
"path",
|
|
1297
|
+
{
|
|
1298
|
+
d: "M17.2515 10.8675C17.8265 9.57871 14.9847 5.97871 12.2697 4.47934C10.5584 3.31684 8.77529 3.47684 8.41404 3.98684C7.62154 5.10684 11.039 6.05559 13.3234 7.16184C12.8322 7.37621 12.3697 7.76059 12.0972 8.25184C11.2453 7.31871 9.37529 6.51434 7.18154 7.16246C5.70279 7.59871 4.47404 8.62684 3.99904 10.18C3.85708 10.1175 3.70178 10.0914 3.5472 10.1041C3.39262 10.1168 3.24365 10.1678 3.11376 10.2526C2.98388 10.3373 2.87719 10.4532 2.80336 10.5896C2.72952 10.726 2.69088 10.8786 2.69092 11.0337C2.69092 11.55 3.10717 11.9681 3.62154 11.9681C3.71654 11.9681 4.01467 11.9037 4.01467 11.9037L8.77529 11.9387C6.87154 14.9687 5.36654 15.4118 5.36654 15.9368C5.36654 16.4618 6.80654 16.32 7.34717 16.1243C9.93467 15.1868 12.714 12.2675 13.1909 11.4268C15.1934 11.6775 16.8765 11.7075 17.2515 10.8675Z",
|
|
1299
|
+
fill: "url(#rs-rabby-grad0)"
|
|
1300
|
+
}
|
|
1301
|
+
),
|
|
1302
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1303
|
+
"path",
|
|
1304
|
+
{
|
|
1305
|
+
fillRule: "evenodd",
|
|
1306
|
+
clipRule: "evenodd",
|
|
1307
|
+
d: "M13.3147 7.15865L13.3216 7.16177C13.4279 7.1199 13.4104 6.96302 13.3816 6.8399C13.3147 6.55615 12.161 5.41365 11.0779 4.90177C9.60224 4.20427 8.51536 4.2399 8.35474 4.56177C8.65474 5.18052 10.0485 5.76052 11.5047 6.3674C12.1235 6.6249 12.7529 6.88677 13.3147 7.15865Z",
|
|
1308
|
+
fill: "url(#rs-rabby-grad1)"
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1312
|
+
"path",
|
|
1313
|
+
{
|
|
1314
|
+
fillRule: "evenodd",
|
|
1315
|
+
clipRule: "evenodd",
|
|
1316
|
+
d: "M11.4522 13.3856C11.1193 13.26 10.7791 13.1548 10.4335 13.0706C10.8422 12.3369 10.9278 11.2506 10.5416 10.5644C10.0003 9.60001 9.32033 9.08688 7.73971 9.08688C6.87096 9.08688 4.53096 9.38063 4.48971 11.3406C4.48471 11.5456 4.4895 11.7346 4.50408 11.9075L8.77721 11.9388C8.20096 12.8556 7.66158 13.5363 7.18908 14.0531C7.75596 14.1994 8.22408 14.3219 8.65408 14.4344C9.06158 14.5406 9.43471 14.6381 9.82471 14.7381C10.4141 14.3069 10.9685 13.8381 11.4522 13.3856Z",
|
|
1317
|
+
fill: "url(#rs-rabby-grad2)"
|
|
1318
|
+
}
|
|
1319
|
+
),
|
|
1320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1321
|
+
"path",
|
|
1322
|
+
{
|
|
1323
|
+
d: "M3.94351 11.7048C4.11789 13.1936 4.96101 13.7773 6.68476 13.9498C8.40851 14.1223 9.39664 14.0067 10.7123 14.1273C11.8116 14.2273 12.7929 14.7898 13.1573 14.5954C13.4848 14.4204 13.301 13.7892 12.8629 13.3836C12.2941 12.8586 11.5079 12.4936 10.1241 12.3642C10.3998 11.6061 10.3223 10.5436 9.89414 9.96543C9.27476 9.1298 8.13164 8.7523 6.68476 8.9173C5.17226 9.0898 3.72414 9.83605 3.94351 11.7048Z",
|
|
1324
|
+
fill: "url(#rs-rabby-grad3)"
|
|
1325
|
+
}
|
|
1326
|
+
)
|
|
1327
|
+
] })
|
|
1328
|
+
] }),
|
|
1329
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "defs", { children: [
|
|
1330
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1331
|
+
"linearGradient",
|
|
1102
1332
|
{
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1333
|
+
id: "rs-rabby-grad0",
|
|
1334
|
+
x1: "7.00904",
|
|
1335
|
+
y1: "9.72621",
|
|
1336
|
+
x2: "17.1328",
|
|
1337
|
+
y2: "12.5875",
|
|
1338
|
+
gradientUnits: "userSpaceOnUse",
|
|
1339
|
+
children: [
|
|
1340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { stopColor: "white" }),
|
|
1341
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { offset: "1", stopColor: "white" })
|
|
1342
|
+
]
|
|
1110
1343
|
}
|
|
1111
1344
|
),
|
|
1112
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1113
|
-
"
|
|
1345
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1346
|
+
"linearGradient",
|
|
1114
1347
|
{
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1348
|
+
id: "rs-rabby-grad1",
|
|
1349
|
+
x1: "15.4216",
|
|
1350
|
+
y1: "9.5324",
|
|
1351
|
+
x2: "8.09661",
|
|
1352
|
+
y2: "2.21365",
|
|
1353
|
+
gradientUnits: "userSpaceOnUse",
|
|
1354
|
+
children: [
|
|
1355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { stopColor: "#8697FF" }),
|
|
1356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1357
|
+
]
|
|
1118
1358
|
}
|
|
1119
1359
|
),
|
|
1120
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
function ExternalLinkIcon() {
|
|
1124
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
"path",
|
|
1360
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1361
|
+
"linearGradient",
|
|
1127
1362
|
{
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1363
|
+
id: "rs-rabby-grad2",
|
|
1364
|
+
x1: "11.6553",
|
|
1365
|
+
y1: "13.6413",
|
|
1366
|
+
x2: "4.63033",
|
|
1367
|
+
y2: "9.61626",
|
|
1368
|
+
gradientUnits: "userSpaceOnUse",
|
|
1369
|
+
children: [
|
|
1370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { stopColor: "#8697FF" }),
|
|
1371
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1372
|
+
]
|
|
1131
1373
|
}
|
|
1132
1374
|
),
|
|
1133
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1375
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1376
|
+
"linearGradient",
|
|
1377
|
+
{
|
|
1378
|
+
id: "rs-rabby-grad3",
|
|
1379
|
+
x1: "7.61476",
|
|
1380
|
+
y1: "9.64918",
|
|
1381
|
+
x2: "12.3748",
|
|
1382
|
+
y2: "15.6773",
|
|
1383
|
+
gradientUnits: "userSpaceOnUse",
|
|
1384
|
+
children: [
|
|
1385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { stopColor: "white" }),
|
|
1386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { offset: "0.984", stopColor: "#D1D8FF" })
|
|
1387
|
+
]
|
|
1388
|
+
}
|
|
1389
|
+
),
|
|
1390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "clipPath", { id: "rs-rabby-clip", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "20", height: "20", fill: "white" }) })
|
|
1391
|
+
] })
|
|
1392
|
+
] });
|
|
1393
|
+
var PhantomIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1394
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1139
1395
|
"path",
|
|
1140
1396
|
{
|
|
1141
|
-
d: "
|
|
1142
|
-
|
|
1143
|
-
strokeWidth: "1.5",
|
|
1144
|
-
strokeLinecap: "round",
|
|
1145
|
-
strokeLinejoin: "round"
|
|
1397
|
+
d: "M15.1852 0H4.81481C2.15567 0 0 2.15567 0 4.81481V15.1852C0 17.8443 2.15567 20 4.81481 20H15.1852C17.8443 20 20 17.8443 20 15.1852V4.81481C20 2.15567 17.8443 0 15.1852 0Z",
|
|
1398
|
+
fill: "#AB9FF2"
|
|
1146
1399
|
}
|
|
1147
|
-
)
|
|
1148
|
-
|
|
1149
|
-
function CheckIcon() {
|
|
1150
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1400
|
+
),
|
|
1401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1151
1402
|
"path",
|
|
1152
1403
|
{
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1404
|
+
fillRule: "evenodd",
|
|
1405
|
+
clipRule: "evenodd",
|
|
1406
|
+
d: "M8.61617 12.9486C7.77876 14.2315 6.37579 15.855 4.50894 15.855C3.62635 15.855 2.77783 15.4917 2.77783 13.9136C2.77783 9.89449 8.26542 3.67264 13.3569 3.67264C16.2534 3.67264 17.4075 5.68227 17.4075 7.9643C17.4075 10.8936 15.5067 14.2428 13.6171 14.2428C13.0175 14.2428 12.7232 13.9136 12.7232 13.3913C12.7232 13.255 12.7459 13.1075 12.7912 12.9486C12.1462 14.0499 10.9015 15.0717 9.73617 15.0717C8.88765 15.0717 8.45765 14.538 8.45765 13.7887C8.45765 13.5162 8.51431 13.2325 8.61617 12.9486ZM15.4958 7.88486C15.4958 8.54986 15.1032 8.88245 14.6643 8.88245C14.2189 8.88245 13.8332 8.54986 13.8332 7.88486C13.8332 7.21986 14.2189 6.88745 14.6645 6.88745C15.1034 6.88745 15.4958 7.22004 15.4958 7.88486ZM13.0017 7.88486C13.0017 8.54986 12.6095 8.88245 12.1706 8.88245C11.7251 8.88245 11.3393 8.54986 11.3393 7.88505C11.3393 7.22005 11.7251 6.88745 12.1706 6.88745C12.6095 6.88745 13.0017 7.22005 13.0017 7.88505",
|
|
1407
|
+
fill: "#FFFDF8"
|
|
1156
1408
|
}
|
|
1157
|
-
)
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1409
|
+
)
|
|
1410
|
+
] });
|
|
1411
|
+
var WalletConnectIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1412
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "20", height: "20", rx: "2.5", fill: "#3B99FC" }),
|
|
1413
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1161
1414
|
"path",
|
|
1162
1415
|
{
|
|
1163
|
-
d: "
|
|
1164
|
-
|
|
1165
|
-
strokeLinejoin: "round"
|
|
1416
|
+
d: "M6.18 7.96a5.36 5.36 0 0 1 7.64 0l.25.26a.26.26 0 0 1 0 .37l-.87.87a.13.13 0 0 1-.19 0l-.35-.35a3.74 3.74 0 0 0-5.32 0l-.38.37a.13.13 0 0 1-.19 0l-.86-.86a.26.26 0 0 1 0-.37l.27-.29Zm9.43 1.79.78.78a.26.26 0 0 1 0 .37l-3.54 3.54a.26.26 0 0 1-.37 0l-2.51-2.5a.07.07 0 0 0-.09 0l-2.51 2.5a.26.26 0 0 1-.37 0L3.46 10.9a.26.26 0 0 1 0-.37l.78-.78a.26.26 0 0 1 .37 0l2.5 2.5a.07.07 0 0 0 .1 0L9.72 9.75a.26.26 0 0 1 .37 0l2.5 2.5a.07.07 0 0 0 .1 0l2.5-2.5a.26.26 0 0 1 .37 0Z",
|
|
1417
|
+
fill: "#fff"
|
|
1166
1418
|
}
|
|
1167
|
-
)
|
|
1168
|
-
}
|
|
1419
|
+
)
|
|
1420
|
+
] });
|
|
1421
|
+
var EthBadgeIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1423
|
+
"path",
|
|
1424
|
+
{
|
|
1425
|
+
d: "M9.99987 19.9319C15.4852 19.9319 19.9319 15.4852 19.9319 9.9999C19.9319 4.51461 15.4852 0.0679016 9.99987 0.0679016C4.51458 0.0679016 0.0678711 4.51461 0.0678711 9.9999C0.0678711 15.4852 4.51458 19.9319 9.99987 19.9319Z",
|
|
1426
|
+
fill: "#E3E3E3"
|
|
1427
|
+
}
|
|
1428
|
+
),
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10.0073 2.18121L14.6948 9.99371L10.0247 7.98052L10.0073 2.18121Z", fill: "#2F3030" }),
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M5.31982 9.99371L9.98998 2.18121L10.0073 7.98052L5.31982 9.99371Z", fill: "#828384" }),
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M9.98998 12.8062L5.31982 10.047L10.0073 8.11871L9.98998 12.8062Z", fill: "#343535" }),
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14.6948 10.047L10.0247 8.11871L10.0073 12.8062L14.6948 10.047Z", fill: "#131313" }),
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10.0073 14.0046L14.6948 11.2437L10.0073 17.8062V14.0046Z", fill: "#2F3030" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10.0073 14.0046L5.31982 11.2437L10.0073 17.8062V14.0046Z", fill: "#828384" })
|
|
1435
|
+
] });
|
|
1436
|
+
var SolBadgeIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "20", height: "20", rx: "10", fill: "#0C0C0C" }),
|
|
1438
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1439
|
+
"path",
|
|
1440
|
+
{
|
|
1441
|
+
fillRule: "evenodd",
|
|
1442
|
+
clipRule: "evenodd",
|
|
1443
|
+
d: "M4.62391 9.04404H13.8799C13.9959 9.04404 14.1039 9.08804 14.1839 9.17204L15.6479 10.644C15.9199 10.916 15.7279 11.38 15.3439 11.38H6.08791C5.97191 11.38 5.86391 11.336 5.78391 11.252L4.31991 9.78004C4.04791 9.51203 4.23991 9.04404 4.62391 9.04404ZM4.31591 7.09204L5.77991 5.62003C5.86391 5.53603 5.97191 5.49203 6.08391 5.49203H15.3359C15.7199 5.49203 15.9159 5.95603 15.6399 6.22803L14.1799 7.70003C14.0999 7.78403 13.9879 7.82803 13.8759 7.82803H4.62391C4.23991 7.82803 4.04791 7.36404 4.31591 7.09204ZM15.6439 13.34L14.1799 14.816C14.0999 14.896 13.9879 14.944 13.8759 14.944H4.62391C4.23991 14.944 4.04791 14.48 4.31591 14.208L5.77991 12.732C5.86391 12.652 5.97191 12.604 6.08391 12.604H15.3359C15.7239 12.6 15.9199 13.064 15.6439 13.34Z",
|
|
1444
|
+
fill: "url(#rs-sol-badge-grad)"
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "defs", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1448
|
+
"linearGradient",
|
|
1449
|
+
{
|
|
1450
|
+
id: "rs-sol-badge-grad",
|
|
1451
|
+
x1: "4.85031",
|
|
1452
|
+
y1: "15.3466",
|
|
1453
|
+
x2: "15.1135",
|
|
1454
|
+
y2: "5.08343",
|
|
1455
|
+
gradientUnits: "userSpaceOnUse",
|
|
1456
|
+
children: [
|
|
1457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { stopColor: "#CB4EE8" }),
|
|
1458
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "stop", { offset: "1", stopColor: "#10F4B1" })
|
|
1459
|
+
]
|
|
1460
|
+
}
|
|
1461
|
+
) })
|
|
1462
|
+
] });
|
|
1463
|
+
var BaseBadgeIcon = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 111 111", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1464
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "55.5", cy: "55.5", r: "55.5", fill: "#0052FF" }),
|
|
1465
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1466
|
+
"path",
|
|
1467
|
+
{
|
|
1468
|
+
d: "M54.921 93.4c20.942 0 37.92-16.978 37.92-37.921S75.863 17.558 54.92 17.558c-19.498 0-35.57 14.725-37.655 33.647h49.82v5.548h-49.82C19.351 75.675 35.423 93.4 54.921 93.4z",
|
|
1469
|
+
fill: "#fff"
|
|
1470
|
+
}
|
|
1471
|
+
)
|
|
1472
|
+
] });
|
|
1473
|
+
var walletBadge = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-list-row-meta-icons", children: [
|
|
1474
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RabbyIcon, {}) }),
|
|
1475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PhantomIcon, {}) }),
|
|
1476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletConnectIcon, {}) })
|
|
1477
|
+
] });
|
|
1478
|
+
var chainBadge = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-list-row-meta-icons", children: [
|
|
1479
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EthBadgeIcon, {}) }),
|
|
1480
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SolBadgeIcon, {}) }),
|
|
1481
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BaseBadgeIcon, {}) })
|
|
1482
|
+
] });
|
|
1483
|
+
function WalletBadgeIcons() {
|
|
1484
|
+
return walletBadge;
|
|
1485
|
+
}
|
|
1486
|
+
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
1487
|
+
function ChainBadgeIcons() {
|
|
1488
|
+
return chainBadge;
|
|
1489
|
+
}
|
|
1490
|
+
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
1169
1491
|
|
|
1170
1492
|
// src/components/steps/ConnectStep.tsx
|
|
1171
1493
|
|
|
1172
|
-
function
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1494
|
+
function shorten(addr) {
|
|
1495
|
+
return addr.length > 12 ? `${addr.slice(0, 6)}...${addr.slice(-4)}` : addr;
|
|
1496
|
+
}
|
|
1497
|
+
function renderWalletLeading(option) {
|
|
1498
|
+
if (option.icon) {
|
|
1499
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1500
|
+
"img",
|
|
1501
|
+
{
|
|
1502
|
+
src: option.icon,
|
|
1503
|
+
alt: "",
|
|
1504
|
+
style: { width: 24, height: 24, borderRadius: 6 }
|
|
1505
|
+
}
|
|
1506
|
+
);
|
|
1507
|
+
}
|
|
1508
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {});
|
|
1176
1509
|
}
|
|
1177
1510
|
function ConnectStep({
|
|
1178
1511
|
walletOptions,
|
|
1179
|
-
|
|
1180
|
-
onSelectWallet,
|
|
1512
|
+
onConfirmWallet,
|
|
1181
1513
|
onSelectTransferCrypto,
|
|
1182
1514
|
onRequestConnect,
|
|
1183
1515
|
onConnect,
|
|
1184
1516
|
onDisconnect,
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
connectButtonLabel = "Connect external wallet"
|
|
1517
|
+
title = "Deposit",
|
|
1518
|
+
subtitle
|
|
1188
1519
|
}) {
|
|
1189
|
-
const
|
|
1190
|
-
if (hasWalletOptions) {
|
|
1191
|
-
const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _57 => _57.some, 'call', _58 => _58(
|
|
1192
|
-
(option) => option.kind === "external" || option.kind === "solana"
|
|
1193
|
-
)]), () => ( false));
|
|
1194
|
-
const showConnectDifferentWalletOption = Boolean(onConnect) && !hasReownWallet;
|
|
1195
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1196
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
|
|
1197
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
|
|
1198
|
-
_optionalChain([walletOptions, 'optionalAccess', _59 => _59.map, 'call', _60 => _60((option) => {
|
|
1199
|
-
const isSelected = option.id === selectedWalletId;
|
|
1200
|
-
const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
|
|
1201
|
-
const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
|
|
1202
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1203
|
-
"button",
|
|
1204
|
-
{
|
|
1205
|
-
type: "button",
|
|
1206
|
-
className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
|
|
1207
|
-
onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _61 => _61(option.id)]),
|
|
1208
|
-
children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
-
"div",
|
|
1211
|
-
{
|
|
1212
|
-
className: `rs-connect-wallet-icon ${isSelected ? "rs-connect-wallet-icon--selected" : ""}`,
|
|
1213
|
-
children: option.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1214
|
-
"img",
|
|
1215
|
-
{
|
|
1216
|
-
src: option.icon,
|
|
1217
|
-
alt: option.label,
|
|
1218
|
-
style: { width: 24, height: 24, borderRadius: 6 }
|
|
1219
|
-
}
|
|
1220
|
-
) : rowIcon(option.kind)
|
|
1221
|
-
}
|
|
1222
|
-
),
|
|
1223
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1224
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: option.label }),
|
|
1225
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: shortAddress })
|
|
1226
|
-
] }),
|
|
1227
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: isSelected ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1228
|
-
]
|
|
1229
|
-
},
|
|
1230
|
-
option.id
|
|
1231
|
-
);
|
|
1232
|
-
})]),
|
|
1233
|
-
showConnectDifferentWalletOption && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1234
|
-
"button",
|
|
1235
|
-
{
|
|
1236
|
-
type: "button",
|
|
1237
|
-
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1238
|
-
onClick: onConnect,
|
|
1239
|
-
children: [
|
|
1240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {}) }),
|
|
1241
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1242
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "External Wallet" }),
|
|
1243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "Connect different wallet" })
|
|
1244
|
-
] }),
|
|
1245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1246
|
-
]
|
|
1247
|
-
}
|
|
1248
|
-
),
|
|
1249
|
-
onSelectTransferCrypto && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1250
|
-
"button",
|
|
1251
|
-
{
|
|
1252
|
-
type: "button",
|
|
1253
|
-
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1254
|
-
onClick: onSelectTransferCrypto,
|
|
1255
|
-
children: [
|
|
1256
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TransferIcon, {}) }),
|
|
1257
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
1259
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
1260
|
-
] }),
|
|
1261
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1262
|
-
]
|
|
1263
|
-
}
|
|
1264
|
-
)
|
|
1265
|
-
] }),
|
|
1266
|
-
(onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _62 => _62.some, 'call', _63 => _63(
|
|
1267
|
-
(option) => option.kind === "external" || option.kind === "solana"
|
|
1268
|
-
)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1269
|
-
"button",
|
|
1270
|
-
{
|
|
1271
|
-
type: "button",
|
|
1272
|
-
className: "rs-connect-wallet-manage",
|
|
1273
|
-
onClick: _nullishCoalesce(onDisconnect, () => ( onConnect)),
|
|
1274
|
-
children: "Disconnect Wallet"
|
|
1275
|
-
}
|
|
1276
|
-
)
|
|
1277
|
-
] }),
|
|
1278
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer rs-step-footer--connect-empty", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1279
|
-
Button,
|
|
1280
|
-
{
|
|
1281
|
-
onClick: onContinue,
|
|
1282
|
-
variant: "accent",
|
|
1283
|
-
fullWidth: true,
|
|
1284
|
-
disabled: !selectedWalletId || !onContinue,
|
|
1285
|
-
children: continueButtonLabel
|
|
1286
|
-
}
|
|
1287
|
-
) })
|
|
1288
|
-
] });
|
|
1289
|
-
}
|
|
1520
|
+
const options = _nullishCoalesce(walletOptions, () => ( []));
|
|
1290
1521
|
const handleConnect = _nullishCoalesce(onConnect, () => ( onRequestConnect));
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1522
|
+
const hasReownWallet = options.some(
|
|
1523
|
+
(option) => option.kind === "external" || option.kind === "solana"
|
|
1524
|
+
);
|
|
1525
|
+
const extraChainCount = Math.max(0, _chunkXCAF6B3Dcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
1526
|
+
const chainBadge2 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1527
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
1528
|
+
extraChainCount > 0 ? `+${extraChainCount} chains` : "All chains"
|
|
1529
|
+
] });
|
|
1530
|
+
const defaultSubtitle = onSelectTransferCrypto ? "Add money to your balance" : "Choose a wallet to continue";
|
|
1531
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1532
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
+
BodyHeader,
|
|
1295
1535
|
{
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
children: [
|
|
1300
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TransferIcon, {}) }),
|
|
1301
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1302
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
1303
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
1304
|
-
] }),
|
|
1305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1306
|
-
]
|
|
1536
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HandCoinsIcon, {}),
|
|
1537
|
+
title,
|
|
1538
|
+
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle))
|
|
1307
1539
|
}
|
|
1308
1540
|
),
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
type: "button",
|
|
1313
|
-
className: "rs-connect-wallet-row rs-connect-wallet-row--action",
|
|
1314
|
-
onClick: handleConnect,
|
|
1315
|
-
children: [
|
|
1316
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}) }),
|
|
1317
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-meta", children: [
|
|
1318
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-label", children: "Connect Wallet" }),
|
|
1319
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-address", children: "Connect your wallet to deposit" })
|
|
1320
|
-
] }),
|
|
1321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
|
|
1322
|
-
]
|
|
1323
|
-
}
|
|
1324
|
-
)
|
|
1325
|
-
] }) }) });
|
|
1326
|
-
}
|
|
1327
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--minimal", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-empty", children: [
|
|
1329
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-empty-graphic", "aria-hidden": "true", children: [
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--outer" }),
|
|
1331
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-empty-orbit rs-connect-empty-orbit--inner" }),
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-empty-core", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1333
|
-
"svg",
|
|
1541
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-list", children: [
|
|
1542
|
+
onSelectTransferCrypto && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1543
|
+
ListRow,
|
|
1334
1544
|
{
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1341
|
-
"path",
|
|
1342
|
-
{
|
|
1343
|
-
strokeLinecap: "round",
|
|
1344
|
-
strokeLinejoin: "round",
|
|
1345
|
-
d: "M4 8.25A2.25 2.25 0 016.25 6h11.5A2.25 2.25 0 0120 8.25v7.5A2.25 2.25 0 0117.75 18H6.25A2.25 2.25 0 014 15.75v-7.5z"
|
|
1346
|
-
}
|
|
1347
|
-
),
|
|
1348
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1349
|
-
"path",
|
|
1350
|
-
{
|
|
1351
|
-
strokeLinecap: "round",
|
|
1352
|
-
strokeLinejoin: "round",
|
|
1353
|
-
d: "M20 10.5h-3.75a2.25 2.25 0 100 4.5H20"
|
|
1354
|
-
}
|
|
1355
|
-
),
|
|
1356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "16.25", cy: "12.75", r: "0.85", fill: "currentColor" })
|
|
1357
|
-
]
|
|
1545
|
+
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CoinsIcon, {}),
|
|
1546
|
+
title: "Transfer crypto",
|
|
1547
|
+
subtitle: "Instant - No limit",
|
|
1548
|
+
meta: chainBadge2,
|
|
1549
|
+
onClick: onSelectTransferCrypto
|
|
1358
1550
|
}
|
|
1359
|
-
)
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1551
|
+
),
|
|
1552
|
+
options.map((option) => {
|
|
1553
|
+
const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
|
|
1554
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
+
ListRow,
|
|
1556
|
+
{
|
|
1557
|
+
leading: renderWalletLeading(option),
|
|
1558
|
+
title: onSelectTransferCrypto ? "External wallet" : option.label,
|
|
1559
|
+
subtitle: shorten(rawAddress),
|
|
1560
|
+
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall', _56 => _56(option.id)])
|
|
1561
|
+
},
|
|
1562
|
+
option.id
|
|
1563
|
+
);
|
|
1564
|
+
}),
|
|
1565
|
+
!hasReownWallet && handleConnect && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1566
|
+
ListRow,
|
|
1567
|
+
{
|
|
1568
|
+
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}),
|
|
1569
|
+
title: "Connect wallet",
|
|
1570
|
+
subtitle: "Instant - No limit",
|
|
1571
|
+
meta: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
1573
|
+
"+100 wallets"
|
|
1574
|
+
] }),
|
|
1575
|
+
onClick: handleConnect
|
|
1576
|
+
}
|
|
1577
|
+
)
|
|
1578
|
+
] })
|
|
1579
|
+
] }),
|
|
1580
|
+
onDisconnect && hasReownWallet && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen-tight-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1581
|
+
"button",
|
|
1368
1582
|
{
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
children: connectButtonLabel
|
|
1583
|
+
type: "button",
|
|
1584
|
+
className: "rs-connect-wallet-manage",
|
|
1585
|
+
onClick: onDisconnect,
|
|
1586
|
+
children: "Disconnect wallet"
|
|
1374
1587
|
}
|
|
1375
|
-
) })
|
|
1588
|
+
) }),
|
|
1589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PoweredBy, {})
|
|
1376
1590
|
] });
|
|
1377
1591
|
}
|
|
1378
1592
|
ConnectStep.displayName = "ConnectStep";
|
|
1379
1593
|
|
|
1594
|
+
// src/components/ui/Spinner.tsx
|
|
1595
|
+
|
|
1596
|
+
function Spinner({ className }) {
|
|
1597
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1598
|
+
"svg",
|
|
1599
|
+
{
|
|
1600
|
+
className: `rs-spinner ${className || ""}`,
|
|
1601
|
+
fill: "none",
|
|
1602
|
+
viewBox: "0 0 20 21",
|
|
1603
|
+
children: [
|
|
1604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1605
|
+
"path",
|
|
1606
|
+
{
|
|
1607
|
+
d: "M10 0.5C8.02219 0.5 6.08879 1.08649 4.4443 2.1853C2.79981 3.28412 1.51809 4.8459 0.761209 6.67316C0.00433288 8.50043 -0.1937 10.5111 0.192152 12.4509C0.578004 14.3907 1.53041 16.1725 2.92894 17.5711C4.32746 18.9696 6.10929 19.922 8.0491 20.3078C9.98891 20.6937 11.9996 20.4957 13.8268 19.7388C15.6541 18.9819 17.2159 17.7002 18.3147 16.0557C19.4135 14.4112 20 12.4778 20 10.5C20 7.84783 18.9464 5.3043 17.0711 3.42893C15.1957 1.55357 12.6522 0.5 10 0.5ZM10 17.7727C8.56159 17.7727 7.15549 17.3462 5.95949 16.547C4.7635 15.7479 3.83134 14.6121 3.28088 13.2831C2.73042 11.9542 2.5864 10.4919 2.86702 9.08116C3.14764 7.67039 3.8403 6.37451 4.85741 5.3574C5.87452 4.3403 7.17039 3.64764 8.58116 3.36702C9.99193 3.0864 11.4542 3.23042 12.7832 3.78088C14.1121 4.33133 15.2479 5.26349 16.0471 6.45949C16.8462 7.65548 17.2727 9.06159 17.2727 10.5C17.2727 12.4288 16.5065 14.2787 15.1426 15.6426C13.7787 17.0065 11.9288 17.7727 10 17.7727Z",
|
|
1608
|
+
fill: "currentColor",
|
|
1609
|
+
opacity: 0.3
|
|
1610
|
+
}
|
|
1611
|
+
),
|
|
1612
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1613
|
+
"path",
|
|
1614
|
+
{
|
|
1615
|
+
d: "M10 3.22767C11.7423 3.22846 13.4276 3.8412 14.7556 4.95667C16.0837 6.07214 16.9681 7.61784 17.2512 9.31825C17.3012 9.64364 17.4662 9.94096 17.7169 10.1573C17.9677 10.3737 18.2878 10.4951 18.6205 10.5C18.8211 10.5001 19.0193 10.457 19.2012 10.3735C19.3832 10.2901 19.5445 10.1684 19.674 10.017C19.8036 9.86549 19.8981 9.68789 19.9511 9.49656C20.004 9.30523 20.0141 9.10478 19.9807 8.90918C19.5986 6.56305 18.3843 4.42821 16.5554 2.88726C14.7265 1.34631 12.4025 0.5 10 0.5C7.59751 0.5 5.27354 1.34631 3.44461 2.88726C1.61569 4.42821 0.401366 6.56305 0.0192815 8.90918C-0.0141442 9.10478 -0.00402016 9.30523 0.0489472 9.49656C0.101914 9.68789 0.196449 9.86549 0.325956 10.017C0.455463 10.1684 0.616823 10.2901 0.798778 10.3735C0.980732 10.457 1.1789 10.5001 1.37945 10.5C1.71216 10.4951 2.03235 10.3737 2.28307 10.1573C2.5338 9.94096 2.69883 9.64364 2.74882 9.31825C3.03193 7.61784 3.91633 6.07214 5.24436 4.95667C6.57239 3.8412 8.25775 3.22846 10 3.22767Z",
|
|
1616
|
+
fill: "currentColor"
|
|
1617
|
+
}
|
|
1618
|
+
)
|
|
1619
|
+
]
|
|
1620
|
+
}
|
|
1621
|
+
);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1380
1624
|
// src/core/session-owner.ts
|
|
1381
1625
|
var _viem = require('viem');
|
|
1382
1626
|
|
|
@@ -1426,46 +1670,211 @@ function accountFromPrivateKey(privateKey) {
|
|
|
1426
1670
|
return _accounts.privateKeyToAccount.call(void 0, privateKey);
|
|
1427
1671
|
}
|
|
1428
1672
|
|
|
1673
|
+
// src/core/formatters.ts
|
|
1674
|
+
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
1675
|
+
style: "currency",
|
|
1676
|
+
currency: "USD",
|
|
1677
|
+
maximumFractionDigits: 2
|
|
1678
|
+
});
|
|
1679
|
+
var tokenFormatter = new Intl.NumberFormat("en-US", {
|
|
1680
|
+
maximumFractionDigits: 6
|
|
1681
|
+
});
|
|
1682
|
+
function formatUserError(raw) {
|
|
1683
|
+
const lower = raw.toLowerCase();
|
|
1684
|
+
if (lower.includes("user rejected") || lower.includes("user denied")) {
|
|
1685
|
+
return "Transaction cancelled";
|
|
1686
|
+
}
|
|
1687
|
+
if (lower.includes("insufficient funds")) {
|
|
1688
|
+
return "Insufficient funds for this transaction";
|
|
1689
|
+
}
|
|
1690
|
+
if (lower.includes("nonce too low") || lower.includes("nonce too high")) {
|
|
1691
|
+
return "Transaction conflict \u2014 please try again";
|
|
1692
|
+
}
|
|
1693
|
+
if (lower.includes("execution reverted")) {
|
|
1694
|
+
return "Transaction would fail on-chain";
|
|
1695
|
+
}
|
|
1696
|
+
if (lower.includes("timed out") || lower.includes("took too long")) {
|
|
1697
|
+
return "Request timed out \u2014 please try again";
|
|
1698
|
+
}
|
|
1699
|
+
if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
|
|
1700
|
+
return "Service unavailable \u2014 please try again";
|
|
1701
|
+
}
|
|
1702
|
+
if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
|
|
1703
|
+
return "Solana RPC unavailable \u2014 please retry";
|
|
1704
|
+
}
|
|
1705
|
+
if (lower.includes("network") || lower.includes("disconnected")) {
|
|
1706
|
+
return "Network error \u2014 check your connection";
|
|
1707
|
+
}
|
|
1708
|
+
if (lower.includes("rate limit") || lower.includes("429")) {
|
|
1709
|
+
return "Rate limited \u2014 please try again shortly";
|
|
1710
|
+
}
|
|
1711
|
+
let cleaned = raw;
|
|
1712
|
+
const stripMarkers = [
|
|
1713
|
+
"\n\nRequest Arguments:",
|
|
1714
|
+
"\nRaw Call Arguments:",
|
|
1715
|
+
"\nRequest body:",
|
|
1716
|
+
"\nContract Call:",
|
|
1717
|
+
"\nDocs:",
|
|
1718
|
+
"\nDetails:",
|
|
1719
|
+
"\nVersion:",
|
|
1720
|
+
"\nURL:"
|
|
1721
|
+
];
|
|
1722
|
+
for (const marker of stripMarkers) {
|
|
1723
|
+
const idx = cleaned.indexOf(marker);
|
|
1724
|
+
if (idx !== -1) {
|
|
1725
|
+
cleaned = cleaned.slice(0, idx).trim();
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
|
|
1729
|
+
if (cleaned.length === 0) {
|
|
1730
|
+
return "An unexpected error occurred";
|
|
1731
|
+
}
|
|
1732
|
+
if (cleaned.length > 120) {
|
|
1733
|
+
return cleaned.slice(0, 120) + "...";
|
|
1734
|
+
}
|
|
1735
|
+
return cleaned;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1429
1738
|
// src/components/steps/ProcessingStep.tsx
|
|
1430
1739
|
|
|
1431
1740
|
|
|
1432
1741
|
|
|
1433
|
-
// src/components/ui/
|
|
1742
|
+
// src/components/ui/Button.tsx
|
|
1434
1743
|
|
|
1435
|
-
function
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1744
|
+
function Button({
|
|
1745
|
+
children,
|
|
1746
|
+
variant = "accent",
|
|
1747
|
+
size = "default",
|
|
1748
|
+
loading = false,
|
|
1749
|
+
loadingText,
|
|
1750
|
+
fullWidth = false,
|
|
1751
|
+
disabled,
|
|
1752
|
+
className = "",
|
|
1753
|
+
...props
|
|
1754
|
+
}) {
|
|
1755
|
+
const classes = [
|
|
1756
|
+
"rs-button",
|
|
1757
|
+
`rs-button--${variant}`,
|
|
1758
|
+
`rs-button--size-${size}`,
|
|
1759
|
+
fullWidth ? "rs-button--full-width" : "",
|
|
1760
|
+
className
|
|
1761
|
+
].filter(Boolean).join(" ");
|
|
1762
|
+
const showInlineLoadingText = loading && loadingText !== void 0;
|
|
1763
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1764
|
+
"button",
|
|
1765
|
+
{
|
|
1766
|
+
className: classes,
|
|
1767
|
+
disabled: disabled || loading,
|
|
1768
|
+
"aria-busy": loading || void 0,
|
|
1769
|
+
...props,
|
|
1770
|
+
children: showInlineLoadingText ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-button__loading-row", children: [
|
|
1771
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Spinner, { className: "rs-spinner--sm" }),
|
|
1772
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: loadingText })
|
|
1773
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1774
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: loading ? "rs-button__content--hidden" : "", children }),
|
|
1775
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-button__spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Spinner, { className: "rs-spinner--sm" }) })
|
|
1776
|
+
] })
|
|
1777
|
+
}
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
Button.displayName = "Button";
|
|
1781
|
+
|
|
1782
|
+
// src/components/ui/Tooltip.tsx
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
function Tooltip({ content, children, className }) {
|
|
1792
|
+
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
1793
|
+
const [position, setPosition] = _react.useState.call(void 0, null);
|
|
1794
|
+
const triggerRef = _react.useRef.call(void 0, null);
|
|
1795
|
+
const bubbleRef = _react.useRef.call(void 0, null);
|
|
1796
|
+
const updatePosition = _react.useCallback.call(void 0, () => {
|
|
1797
|
+
const trigger = triggerRef.current;
|
|
1798
|
+
if (!trigger) return;
|
|
1799
|
+
const rect = trigger.getBoundingClientRect();
|
|
1800
|
+
setPosition({
|
|
1801
|
+
top: rect.top,
|
|
1802
|
+
left: rect.left + rect.width / 2
|
|
1803
|
+
});
|
|
1804
|
+
}, []);
|
|
1805
|
+
_react.useEffect.call(void 0, () => {
|
|
1806
|
+
if (!open) return;
|
|
1807
|
+
updatePosition();
|
|
1808
|
+
function handleOutside(event) {
|
|
1809
|
+
const target = event.target;
|
|
1810
|
+
if (!target) return;
|
|
1811
|
+
if (_optionalChain([triggerRef, 'access', _57 => _57.current, 'optionalAccess', _58 => _58.contains, 'call', _59 => _59(target)])) return;
|
|
1812
|
+
if (_optionalChain([bubbleRef, 'access', _60 => _60.current, 'optionalAccess', _61 => _61.contains, 'call', _62 => _62(target)])) return;
|
|
1813
|
+
setOpen(false);
|
|
1814
|
+
}
|
|
1815
|
+
function handleKey(event) {
|
|
1816
|
+
if (event.key === "Escape") setOpen(false);
|
|
1817
|
+
}
|
|
1818
|
+
document.addEventListener("mousedown", handleOutside);
|
|
1819
|
+
document.addEventListener("touchstart", handleOutside);
|
|
1820
|
+
document.addEventListener("keydown", handleKey);
|
|
1821
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
1822
|
+
window.addEventListener("resize", updatePosition);
|
|
1823
|
+
return () => {
|
|
1824
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
1825
|
+
document.removeEventListener("touchstart", handleOutside);
|
|
1826
|
+
document.removeEventListener("keydown", handleKey);
|
|
1827
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
1828
|
+
window.removeEventListener("resize", updatePosition);
|
|
1829
|
+
};
|
|
1830
|
+
}, [open, updatePosition]);
|
|
1831
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1832
|
+
"span",
|
|
1833
|
+
{
|
|
1834
|
+
ref: triggerRef,
|
|
1835
|
+
className: `rs-tooltip ${_nullishCoalesce(className, () => ( ""))}`,
|
|
1836
|
+
onMouseEnter: () => setOpen(true),
|
|
1837
|
+
onMouseLeave: () => setOpen(false),
|
|
1838
|
+
children: [
|
|
1839
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1840
|
+
"span",
|
|
1446
1841
|
{
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1842
|
+
className: "rs-tooltip-trigger",
|
|
1843
|
+
role: "button",
|
|
1844
|
+
tabIndex: 0,
|
|
1845
|
+
"aria-label": content,
|
|
1846
|
+
onClick: (event) => {
|
|
1847
|
+
event.stopPropagation();
|
|
1848
|
+
event.preventDefault();
|
|
1849
|
+
setOpen((value) => !value);
|
|
1850
|
+
},
|
|
1851
|
+
onKeyDown: (event) => {
|
|
1852
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
1853
|
+
event.preventDefault();
|
|
1854
|
+
setOpen((value) => !value);
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
children
|
|
1450
1858
|
}
|
|
1859
|
+
),
|
|
1860
|
+
open && position && typeof document !== "undefined" && _reactdom.createPortal.call(void 0,
|
|
1861
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1862
|
+
"span",
|
|
1863
|
+
{
|
|
1864
|
+
ref: bubbleRef,
|
|
1865
|
+
className: "rs-tooltip-bubble",
|
|
1866
|
+
role: "tooltip",
|
|
1867
|
+
style: { top: position.top, left: position.left },
|
|
1868
|
+
children: content
|
|
1869
|
+
}
|
|
1870
|
+
),
|
|
1871
|
+
document.body
|
|
1451
1872
|
)
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
"Powered by",
|
|
1456
|
-
" ",
|
|
1457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1458
|
-
"a",
|
|
1459
|
-
{
|
|
1460
|
-
href: "https://www.rhinestone.dev",
|
|
1461
|
-
target: "_blank",
|
|
1462
|
-
rel: "noopener noreferrer",
|
|
1463
|
-
children: "Rhinestone"
|
|
1464
|
-
}
|
|
1465
|
-
)
|
|
1466
|
-
] })
|
|
1467
|
-
] });
|
|
1873
|
+
]
|
|
1874
|
+
}
|
|
1875
|
+
);
|
|
1468
1876
|
}
|
|
1877
|
+
Tooltip.displayName = "Tooltip";
|
|
1469
1878
|
|
|
1470
1879
|
// src/core/webhook.ts
|
|
1471
1880
|
function isRecord(value) {
|
|
@@ -1480,7 +1889,7 @@ function asNumber(value) {
|
|
|
1480
1889
|
const trimmed = value.trim();
|
|
1481
1890
|
if (!trimmed) return void 0;
|
|
1482
1891
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
1483
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
1892
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _63 => _63[1]])) {
|
|
1484
1893
|
const parsed2 = Number(caipMatch[1]);
|
|
1485
1894
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
1486
1895
|
}
|
|
@@ -1499,28 +1908,28 @@ function asAddress(value) {
|
|
|
1499
1908
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
1500
1909
|
}
|
|
1501
1910
|
function getEventTxHash(event) {
|
|
1502
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1911
|
+
if (!_optionalChain([event, 'optionalAccess', _64 => _64.type])) return void 0;
|
|
1503
1912
|
if (event.type === "deposit-received") {
|
|
1504
|
-
return asString(_optionalChain([event, 'access',
|
|
1913
|
+
return asString(_optionalChain([event, 'access', _65 => _65.data, 'optionalAccess', _66 => _66.transactionHash]));
|
|
1505
1914
|
}
|
|
1506
1915
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
1507
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1508
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1509
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
1916
|
+
const deposit = isRecord(_optionalChain([event, 'access', _67 => _67.data, 'optionalAccess', _68 => _68.deposit])) ? event.data.deposit : void 0;
|
|
1917
|
+
const source = isRecord(_optionalChain([event, 'access', _69 => _69.data, 'optionalAccess', _70 => _70.source])) ? event.data.source : void 0;
|
|
1918
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _71 => _71.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _72 => _72.transactionHash]))));
|
|
1510
1919
|
}
|
|
1511
1920
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
1512
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1513
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
1514
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
1921
|
+
const deposit = isRecord(_optionalChain([event, 'access', _73 => _73.data, 'optionalAccess', _74 => _74.deposit])) ? event.data.deposit : void 0;
|
|
1922
|
+
const source = isRecord(_optionalChain([event, 'access', _75 => _75.data, 'optionalAccess', _76 => _76.source])) ? event.data.source : void 0;
|
|
1923
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _77 => _77.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _78 => _78.transactionHash]))));
|
|
1515
1924
|
}
|
|
1516
1925
|
if (event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
1517
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
1518
|
-
return asString(_optionalChain([deposit, 'optionalAccess',
|
|
1926
|
+
const deposit = isRecord(_optionalChain([event, 'access', _79 => _79.data, 'optionalAccess', _80 => _80.deposit])) ? event.data.deposit : void 0;
|
|
1927
|
+
return asString(_optionalChain([deposit, 'optionalAccess', _81 => _81.transactionHash]));
|
|
1519
1928
|
}
|
|
1520
1929
|
return void 0;
|
|
1521
1930
|
}
|
|
1522
1931
|
function getEventSourceDetails(event) {
|
|
1523
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1932
|
+
if (!_optionalChain([event, 'optionalAccess', _82 => _82.type]) || !isRecord(event.data)) return {};
|
|
1524
1933
|
if (event.type === "deposit-received") {
|
|
1525
1934
|
return {
|
|
1526
1935
|
chainId: asNumber(event.data.chain),
|
|
@@ -1532,15 +1941,15 @@ function getEventSourceDetails(event) {
|
|
|
1532
1941
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1533
1942
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
1534
1943
|
return {
|
|
1535
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
1536
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1537
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
1944
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _83 => _83.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _84 => _84.chain])))),
|
|
1945
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _85 => _85.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _86 => _86.amount])))),
|
|
1946
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _87 => _87.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _88 => _88.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _89 => _89.token]))))
|
|
1538
1947
|
};
|
|
1539
1948
|
}
|
|
1540
1949
|
return {};
|
|
1541
1950
|
}
|
|
1542
1951
|
function isDepositEvent(event) {
|
|
1543
|
-
return _optionalChain([event, 'optionalAccess',
|
|
1952
|
+
return _optionalChain([event, 'optionalAccess', _90 => _90.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _91 => _91.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _92 => _92.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _93 => _93.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _94 => _94.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _95 => _95.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _96 => _96.type]) === "error";
|
|
1544
1953
|
}
|
|
1545
1954
|
function isHexString(value) {
|
|
1546
1955
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -1586,16 +1995,13 @@ function savePhaseTimings(txHash, timings) {
|
|
|
1586
1995
|
} catch (e4) {
|
|
1587
1996
|
}
|
|
1588
1997
|
}
|
|
1589
|
-
function truncateHash(hash) {
|
|
1590
|
-
return `${hash.slice(0, 10)}...${hash.slice(-8)}`;
|
|
1591
|
-
}
|
|
1592
1998
|
function isEventForTx(event, txHash) {
|
|
1593
1999
|
const eventTxHash = getEventTxHash(event);
|
|
1594
2000
|
if (!eventTxHash) return false;
|
|
1595
2001
|
return txRefsMatch(eventTxHash, txHash);
|
|
1596
2002
|
}
|
|
1597
2003
|
function formatBridgeFailedMessage(event) {
|
|
1598
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2004
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _97 => _97.data]), () => ( {}));
|
|
1599
2005
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
1600
2006
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1601
2007
|
function toUserFacingFailure(raw) {
|
|
@@ -1627,12 +2033,12 @@ function formatBridgeFailedMessage(event) {
|
|
|
1627
2033
|
return { message: "Bridge failed" };
|
|
1628
2034
|
}
|
|
1629
2035
|
function parseWebhookTimestamp(event) {
|
|
1630
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
2036
|
+
if (typeof _optionalChain([event, 'optionalAccess', _98 => _98.time]) !== "string") return void 0;
|
|
1631
2037
|
const timestamp = Date.parse(event.time);
|
|
1632
2038
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
1633
2039
|
}
|
|
1634
2040
|
function syncPhaseTimings(previous, event) {
|
|
1635
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2041
|
+
if (!_optionalChain([event, 'optionalAccess', _99 => _99.type])) return previous;
|
|
1636
2042
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
1637
2043
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
1638
2044
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
|
|
@@ -1673,9 +2079,9 @@ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
|
|
|
1673
2079
|
if (state.type === "complete") {
|
|
1674
2080
|
return void 0;
|
|
1675
2081
|
}
|
|
1676
|
-
if (_optionalChain([state, 'access',
|
|
2082
|
+
if (_optionalChain([state, 'access', _100 => _100.lastEvent, 'optionalAccess', _101 => _101.type]) === "bridge-started" || _optionalChain([state, 'access', _102 => _102.lastEvent, 'optionalAccess', _103 => _103.type]) === "bridge-complete")
|
|
1677
2083
|
return "bridging";
|
|
1678
|
-
if (_optionalChain([state, 'access',
|
|
2084
|
+
if (_optionalChain([state, 'access', _104 => _104.lastEvent, 'optionalAccess', _105 => _105.type]) === "deposit-received") return "received";
|
|
1679
2085
|
return "confirming";
|
|
1680
2086
|
}
|
|
1681
2087
|
function ProcessingStep({
|
|
@@ -1695,8 +2101,14 @@ function ProcessingStep({
|
|
|
1695
2101
|
flowLabel = "deposit",
|
|
1696
2102
|
debug,
|
|
1697
2103
|
targetToken,
|
|
2104
|
+
uiConfig,
|
|
2105
|
+
estimatedTime = "< 1 min",
|
|
2106
|
+
quotedFeeAmount = "0.1",
|
|
2107
|
+
quotedFeeSymbol,
|
|
2108
|
+
balanceAfterUsd,
|
|
1698
2109
|
onClose,
|
|
1699
2110
|
onNewDeposit,
|
|
2111
|
+
onRetry,
|
|
1700
2112
|
onDepositComplete,
|
|
1701
2113
|
onDepositFailed,
|
|
1702
2114
|
onError
|
|
@@ -1743,7 +2155,7 @@ function ProcessingStep({
|
|
|
1743
2155
|
flowLabel
|
|
1744
2156
|
});
|
|
1745
2157
|
const context = processingContextRef.current;
|
|
1746
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2158
|
+
_optionalChain([onDepositCompleteRef, 'access', _106 => _106.current, 'optionalCall', _107 => _107(txHash, void 0, {
|
|
1747
2159
|
amount: context.amount,
|
|
1748
2160
|
sourceChain: context.sourceChain,
|
|
1749
2161
|
sourceToken: context.sourceToken,
|
|
@@ -1780,7 +2192,7 @@ function ProcessingStep({
|
|
|
1780
2192
|
_react.useEffect.call(void 0, () => {
|
|
1781
2193
|
if (!state.lastEvent) return;
|
|
1782
2194
|
setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
|
|
1783
|
-
}, [_optionalChain([state, 'access',
|
|
2195
|
+
}, [_optionalChain([state, 'access', _108 => _108.lastEvent, 'optionalAccess', _109 => _109.time]), _optionalChain([state, 'access', _110 => _110.lastEvent, 'optionalAccess', _111 => _111.type])]);
|
|
1784
2196
|
_react.useEffect.call(void 0, () => {
|
|
1785
2197
|
savePhaseTimings(txHash, phaseTimings);
|
|
1786
2198
|
}, [txHash, phaseTimings]);
|
|
@@ -1808,21 +2220,21 @@ function ProcessingStep({
|
|
|
1808
2220
|
debugLog(debug, "processing", "poll:event", {
|
|
1809
2221
|
type: lastEvent2.type,
|
|
1810
2222
|
matchesTx: eventMatchesTx,
|
|
1811
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
2223
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _112 => _112.intentId])
|
|
1812
2224
|
});
|
|
1813
2225
|
}
|
|
1814
2226
|
if (!isMounted) return;
|
|
1815
2227
|
const awaitingPostBridgeSwap = processingContextRef.current.waitForFinalTx && processingContextRef.current.hasPostBridgeActions;
|
|
1816
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2228
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _113 => _113.type]) === "post-bridge-swap-complete") {
|
|
1817
2229
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1818
|
-
const swapTxHash = _optionalChain([eventForCurrentTx, 'access',
|
|
2230
|
+
const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _114 => _114.data, 'optionalAccess', _115 => _115.swap, 'optionalAccess', _116 => _116.transactionHash]);
|
|
1819
2231
|
debugLog(debug, "processing", "state:complete", {
|
|
1820
2232
|
txHash,
|
|
1821
2233
|
destinationTxHash: swapTxHash,
|
|
1822
2234
|
event: eventForCurrentTx.type
|
|
1823
2235
|
});
|
|
1824
2236
|
const context = processingContextRef.current;
|
|
1825
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2237
|
+
_optionalChain([onDepositCompleteRef, 'access', _117 => _117.current, 'optionalCall', _118 => _118(txHash, swapTxHash, {
|
|
1826
2238
|
amount: context.amount,
|
|
1827
2239
|
sourceChain: context.sourceChain,
|
|
1828
2240
|
sourceToken: context.sourceToken,
|
|
@@ -1831,7 +2243,7 @@ function ProcessingStep({
|
|
|
1831
2243
|
})]);
|
|
1832
2244
|
return;
|
|
1833
2245
|
}
|
|
1834
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2246
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _119 => _119.type]) === "post-bridge-swap-failed") {
|
|
1835
2247
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1836
2248
|
setState({
|
|
1837
2249
|
type: "failed",
|
|
@@ -1843,19 +2255,19 @@ function ProcessingStep({
|
|
|
1843
2255
|
message: formatted.message,
|
|
1844
2256
|
code: formatted.code
|
|
1845
2257
|
});
|
|
1846
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2258
|
+
_optionalChain([onDepositFailedRef, 'access', _120 => _120.current, 'optionalCall', _121 => _121(txHash, formatted.message)]);
|
|
1847
2259
|
return;
|
|
1848
2260
|
}
|
|
1849
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2261
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _122 => _122.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1850
2262
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1851
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
2263
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _123 => _123.data, 'optionalAccess', _124 => _124.destination, 'optionalAccess', _125 => _125.transactionHash]);
|
|
1852
2264
|
debugLog(debug, "processing", "state:complete", {
|
|
1853
2265
|
txHash,
|
|
1854
2266
|
destinationTxHash: destinationTxHash2,
|
|
1855
2267
|
event: eventForCurrentTx.type
|
|
1856
2268
|
});
|
|
1857
2269
|
const context = processingContextRef.current;
|
|
1858
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2270
|
+
_optionalChain([onDepositCompleteRef, 'access', _126 => _126.current, 'optionalCall', _127 => _127(txHash, destinationTxHash2, {
|
|
1859
2271
|
amount: context.amount,
|
|
1860
2272
|
sourceChain: context.sourceChain,
|
|
1861
2273
|
sourceToken: context.sourceToken,
|
|
@@ -1864,14 +2276,14 @@ function ProcessingStep({
|
|
|
1864
2276
|
})]);
|
|
1865
2277
|
return;
|
|
1866
2278
|
}
|
|
1867
|
-
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2279
|
+
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _128 => _128.type]) === "bridge-started") {
|
|
1868
2280
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1869
2281
|
debugLog(debug, "processing", "state:early-complete", {
|
|
1870
2282
|
txHash,
|
|
1871
2283
|
event: eventForCurrentTx.type
|
|
1872
2284
|
});
|
|
1873
2285
|
const context = processingContextRef.current;
|
|
1874
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2286
|
+
_optionalChain([onDepositCompleteRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130(txHash, void 0, {
|
|
1875
2287
|
amount: context.amount,
|
|
1876
2288
|
sourceChain: context.sourceChain,
|
|
1877
2289
|
sourceToken: context.sourceToken,
|
|
@@ -1880,7 +2292,7 @@ function ProcessingStep({
|
|
|
1880
2292
|
})]);
|
|
1881
2293
|
return;
|
|
1882
2294
|
}
|
|
1883
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2295
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _131 => _131.type]) === "bridge-failed") {
|
|
1884
2296
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1885
2297
|
setState({
|
|
1886
2298
|
type: "failed",
|
|
@@ -1892,11 +2304,11 @@ function ProcessingStep({
|
|
|
1892
2304
|
message: formatted.message,
|
|
1893
2305
|
code: formatted.code
|
|
1894
2306
|
});
|
|
1895
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2307
|
+
_optionalChain([onDepositFailedRef, 'access', _132 => _132.current, 'optionalCall', _133 => _133(txHash, formatted.message)]);
|
|
1896
2308
|
return;
|
|
1897
2309
|
}
|
|
1898
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1899
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
2310
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _134 => _134.type]) === "error") {
|
|
2311
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _135 => _135.data, 'optionalAccess', _136 => _136.message]), () => ( "Unknown error"));
|
|
1900
2312
|
setState({
|
|
1901
2313
|
type: "failed",
|
|
1902
2314
|
message: errorMessage,
|
|
@@ -1906,7 +2318,7 @@ function ProcessingStep({
|
|
|
1906
2318
|
txHash,
|
|
1907
2319
|
message: errorMessage
|
|
1908
2320
|
});
|
|
1909
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2321
|
+
_optionalChain([onDepositFailedRef, 'access', _137 => _137.current, 'optionalCall', _138 => _138(txHash, errorMessage)]);
|
|
1910
2322
|
return;
|
|
1911
2323
|
}
|
|
1912
2324
|
setState((previous) => ({
|
|
@@ -1967,7 +2379,7 @@ function ProcessingStep({
|
|
|
1967
2379
|
txHash,
|
|
1968
2380
|
timeoutMs: ESCALATED_DELAY_MS
|
|
1969
2381
|
});
|
|
1970
|
-
_optionalChain([onErrorRef, 'access',
|
|
2382
|
+
_optionalChain([onErrorRef, 'access', _139 => _139.current, 'optionalCall', _140 => _140(message, "PROCESS_TIMEOUT")]);
|
|
1971
2383
|
}, ESCALATED_DELAY_MS);
|
|
1972
2384
|
return () => clearTimeout(timeoutId);
|
|
1973
2385
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -1976,23 +2388,21 @@ function ProcessingStep({
|
|
|
1976
2388
|
const isProcessing = state.type === "processing";
|
|
1977
2389
|
const lastEvent = state.lastEvent;
|
|
1978
2390
|
const failureMessage = state.type === "failed" ? state.message : void 0;
|
|
1979
|
-
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess',
|
|
2391
|
+
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _141 => _141.type]) === "bridge-started";
|
|
1980
2392
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
1981
2393
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1982
2394
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1983
|
-
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess',
|
|
1984
|
-
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess',
|
|
1985
|
-
const bridgeTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _151 => _151.data, 'optionalAccess', _152 => _152.bridge, 'optionalAccess', _153 => _153.transactionHash]) || null : null;
|
|
2395
|
+
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _142 => _142.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _143 => _143.type]) === "post-bridge-swap-failed";
|
|
2396
|
+
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _144 => _144.data, 'optionalAccess', _145 => _145.swap, 'optionalAccess', _146 => _146.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _147 => _147.data, 'optionalAccess', _148 => _148.destination, 'optionalAccess', _149 => _149.transactionHash]) || null;
|
|
1986
2397
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
1987
2398
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
1988
2399
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
1989
2400
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
1990
|
-
const sourceExplorerUrl =
|
|
1991
|
-
const
|
|
1992
|
-
const destExplorerUrl = destinationTxHash ? _chunkR2HP743Tcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
2401
|
+
const sourceExplorerUrl = _chunkXCAF6B3Dcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
|
|
2402
|
+
const destExplorerUrl = destinationTxHash ? _chunkXCAF6B3Dcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1993
2403
|
const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
|
|
1994
|
-
const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ?
|
|
1995
|
-
const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ?
|
|
2404
|
+
const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkXCAF6B3Dcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
|
|
2405
|
+
const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkXCAF6B3Dcjs.getTokenDecimalsByAddress.call(void 0,
|
|
1996
2406
|
displaySourceToken,
|
|
1997
2407
|
displaySourceChain
|
|
1998
2408
|
) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
|
|
@@ -2012,275 +2422,142 @@ function ProcessingStep({
|
|
|
2012
2422
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
2013
2423
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
2014
2424
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
const fillStatusClass = isComplete ? "rs-card-value--success" : isFailed ? "rs-card-value--error" : "";
|
|
2021
|
-
const [detailsExpanded, setDetailsExpanded] = _react.useState.call(void 0, false);
|
|
2022
|
-
const txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2023
|
-
"path",
|
|
2024
|
-
{
|
|
2025
|
-
strokeLinecap: "round",
|
|
2026
|
-
strokeLinejoin: "round",
|
|
2027
|
-
d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
|
|
2425
|
+
void delayPhaseId;
|
|
2426
|
+
void hasEscalatedDelay;
|
|
2427
|
+
const targetSymbol = (() => {
|
|
2428
|
+
if (typeof targetToken === "string" && /^0x[a-fA-F0-9]{40}$/.test(targetToken)) {
|
|
2429
|
+
return _chunkXCAF6B3Dcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2028
2430
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2431
|
+
return _nullishCoalesce(providedSourceSymbol, () => ( "USDC"));
|
|
2432
|
+
})();
|
|
2433
|
+
const targetTokenIcon = _chunkXCAF6B3Dcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
2434
|
+
const sourceChainIcon = _chunkXCAF6B3Dcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
2435
|
+
const targetChainIcon = _chunkXCAF6B3Dcjs.getChainIcon.call(void 0, targetChain);
|
|
2436
|
+
const sourceTokenIcon = _chunkXCAF6B3Dcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
2437
|
+
const sourceChainName = _chunkXCAF6B3Dcjs.getChainName.call(void 0, displaySourceChain);
|
|
2438
|
+
const targetChainName = _chunkXCAF6B3Dcjs.getChainName.call(void 0, targetChain);
|
|
2439
|
+
const totalTimeText = formatElapsedTime(elapsedSeconds);
|
|
2440
|
+
const feeSymbol = _nullishCoalesce(quotedFeeSymbol, () => ( sourceSymbol));
|
|
2441
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _150 => _150.feeSponsored]), () => ( false));
|
|
2442
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _151 => _151.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
2443
|
+
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
2444
|
+
const stateVariant = isComplete ? "success" : isFailed ? "error" : "default";
|
|
2445
|
+
const stateIcon = isComplete ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckIcon, {}) : isFailed ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CloseIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {});
|
|
2446
|
+
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
2447
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2448
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2450
|
+
BodyHeader,
|
|
2034
2451
|
{
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2452
|
+
variant: stateVariant,
|
|
2453
|
+
icon: stateIcon,
|
|
2454
|
+
title: stateTitle
|
|
2455
|
+
}
|
|
2456
|
+
),
|
|
2457
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-details", children: [
|
|
2458
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
2460
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2461
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
2462
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "" }) }),
|
|
2463
|
+
sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2464
|
+
"a",
|
|
2042
2465
|
{
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2466
|
+
href: sourceExplorerUrl,
|
|
2467
|
+
target: "_blank",
|
|
2468
|
+
rel: "noopener noreferrer",
|
|
2469
|
+
className: "rs-amount-detail-link",
|
|
2470
|
+
"aria-label": "View source transaction",
|
|
2471
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
2046
2472
|
}
|
|
2047
|
-
)
|
|
2048
|
-
|
|
2049
|
-
|
|
2473
|
+
)
|
|
2474
|
+
] })
|
|
2475
|
+
] }),
|
|
2476
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
2478
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2479
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
2480
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "" }) }),
|
|
2481
|
+
destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2482
|
+
"a",
|
|
2050
2483
|
{
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2484
|
+
href: destExplorerUrl,
|
|
2485
|
+
target: "_blank",
|
|
2486
|
+
rel: "noopener noreferrer",
|
|
2487
|
+
className: "rs-amount-detail-link",
|
|
2488
|
+
"aria-label": "View destination transaction",
|
|
2489
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
2054
2490
|
}
|
|
2055
2491
|
)
|
|
2056
|
-
]
|
|
2057
|
-
}
|
|
2058
|
-
) }) : isComplete ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-success-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2059
|
-
"svg",
|
|
2060
|
-
{
|
|
2061
|
-
viewBox: "0 0 24 24",
|
|
2062
|
-
fill: "none",
|
|
2063
|
-
stroke: "currentColor",
|
|
2064
|
-
strokeWidth: "2.5",
|
|
2065
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2066
|
-
"path",
|
|
2067
|
-
{
|
|
2068
|
-
strokeLinecap: "round",
|
|
2069
|
-
strokeLinejoin: "round",
|
|
2070
|
-
d: "M5 12l5 5L20 7"
|
|
2071
|
-
}
|
|
2072
|
-
)
|
|
2073
|
-
}
|
|
2074
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-processing-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Spinner, {}) }),
|
|
2075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-title", children: headerTitle }),
|
|
2076
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-description rs-text-secondary", children: headerDescription })
|
|
2077
|
-
] }),
|
|
2078
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-space-y-3", children: [
|
|
2079
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card", children: [
|
|
2080
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
2081
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Fill status" }),
|
|
2082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-card-value ${fillStatusClass}`, children: fillStatus })
|
|
2492
|
+
] })
|
|
2083
2493
|
] }),
|
|
2084
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
2085
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
2086
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
2087
|
-
] })
|
|
2088
|
-
] }),
|
|
2089
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card", children: [
|
|
2090
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
2091
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Source" }),
|
|
2092
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2093
|
-
"span",
|
|
2094
|
-
{
|
|
2095
|
-
className: "rs-card-value",
|
|
2096
|
-
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2097
|
-
children: [
|
|
2098
|
-
_chunkR2HP743Tcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2099
|
-
"img",
|
|
2100
|
-
{
|
|
2101
|
-
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, displaySourceChain),
|
|
2102
|
-
alt: "",
|
|
2103
|
-
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2104
|
-
}
|
|
2105
|
-
),
|
|
2106
|
-
_chunkR2HP743Tcjs.getChainName.call(void 0, displaySourceChain),
|
|
2107
|
-
sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2108
|
-
"a",
|
|
2109
|
-
{
|
|
2110
|
-
href: sourceExplorerUrl,
|
|
2111
|
-
target: "_blank",
|
|
2112
|
-
rel: "noopener noreferrer",
|
|
2113
|
-
className: "rs-card-external-link",
|
|
2114
|
-
children: txLinkIcon
|
|
2115
|
-
}
|
|
2116
|
-
)
|
|
2117
|
-
]
|
|
2118
|
-
}
|
|
2119
|
-
)
|
|
2494
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Estimated time" : "Total time" }),
|
|
2496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: isProcessing ? estimatedTime : totalTimeText })
|
|
2120
2497
|
] }),
|
|
2121
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
2122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
2123
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2124
|
-
"span",
|
|
2125
|
-
{
|
|
2126
|
-
className: "rs-card-value",
|
|
2127
|
-
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2128
|
-
children: [
|
|
2129
|
-
_chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2130
|
-
"img",
|
|
2131
|
-
{
|
|
2132
|
-
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain),
|
|
2133
|
-
alt: "",
|
|
2134
|
-
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2135
|
-
}
|
|
2136
|
-
),
|
|
2137
|
-
_chunkR2HP743Tcjs.getChainName.call(void 0, targetChain),
|
|
2138
|
-
destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2139
|
-
"a",
|
|
2140
|
-
{
|
|
2141
|
-
href: destExplorerUrl,
|
|
2142
|
-
target: "_blank",
|
|
2143
|
-
rel: "noopener noreferrer",
|
|
2144
|
-
className: "rs-card-external-link",
|
|
2145
|
-
children: txLinkIcon
|
|
2146
|
-
}
|
|
2147
|
-
)
|
|
2148
|
-
]
|
|
2149
|
-
}
|
|
2150
|
-
)
|
|
2151
|
-
] })
|
|
2152
|
-
] }),
|
|
2153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-card", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
2154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "You receive" }),
|
|
2155
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2156
|
-
"span",
|
|
2157
|
-
{
|
|
2158
|
-
className: "rs-card-value",
|
|
2159
|
-
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2160
|
-
children: [
|
|
2161
|
-
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, sourceSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2162
|
-
"img",
|
|
2163
|
-
{
|
|
2164
|
-
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, sourceSymbol),
|
|
2165
|
-
alt: "",
|
|
2166
|
-
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2167
|
-
}
|
|
2168
|
-
),
|
|
2498
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2499
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You send" }),
|
|
2500
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
2169
2502
|
formattedReceivedAmount,
|
|
2170
2503
|
" ",
|
|
2171
2504
|
sourceSymbol
|
|
2172
|
-
]
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
] }) }),
|
|
2176
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2177
|
-
"button",
|
|
2178
|
-
{
|
|
2179
|
-
type: "button",
|
|
2180
|
-
className: `rs-details-toggle ${detailsExpanded ? "rs-details-toggle--open" : ""}`,
|
|
2181
|
-
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
2182
|
-
children: [
|
|
2183
|
-
detailsExpanded ? "Less details" : "More details",
|
|
2184
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2185
|
-
"svg",
|
|
2186
|
-
{
|
|
2187
|
-
viewBox: "0 0 24 24",
|
|
2188
|
-
fill: "none",
|
|
2189
|
-
stroke: "currentColor",
|
|
2190
|
-
strokeWidth: "2",
|
|
2191
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2192
|
-
"path",
|
|
2193
|
-
{
|
|
2194
|
-
strokeLinecap: "round",
|
|
2195
|
-
strokeLinejoin: "round",
|
|
2196
|
-
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
2197
|
-
}
|
|
2198
|
-
)
|
|
2199
|
-
}
|
|
2200
|
-
)
|
|
2201
|
-
]
|
|
2202
|
-
}
|
|
2203
|
-
),
|
|
2204
|
-
detailsExpanded && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card", children: [
|
|
2205
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
2206
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Source tx" }),
|
|
2207
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: sourceExplorerUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2208
|
-
"a",
|
|
2209
|
-
{
|
|
2210
|
-
href: sourceExplorerUrl,
|
|
2211
|
-
target: "_blank",
|
|
2212
|
-
rel: "noopener noreferrer",
|
|
2213
|
-
className: "rs-card-external-link",
|
|
2214
|
-
style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
|
|
2215
|
-
children: [
|
|
2216
|
-
truncateHash(txHash),
|
|
2217
|
-
txLinkIcon
|
|
2218
|
-
]
|
|
2219
|
-
}
|
|
2220
|
-
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(txHash) }) })
|
|
2505
|
+
] }),
|
|
2506
|
+
sourceTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceTokenIcon, alt: "" }) })
|
|
2507
|
+
] })
|
|
2221
2508
|
] }),
|
|
2222
|
-
|
|
2223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
2224
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2225
|
-
"
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
truncateHash(bridgeTxHash),
|
|
2234
|
-
txLinkIcon
|
|
2235
|
-
]
|
|
2236
|
-
}
|
|
2237
|
-
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(bridgeTxHash) }) })
|
|
2509
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
2511
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2512
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
2513
|
+
"~",
|
|
2514
|
+
formattedReceivedAmount,
|
|
2515
|
+
" ",
|
|
2516
|
+
targetSymbol
|
|
2517
|
+
] }),
|
|
2518
|
+
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
2519
|
+
] })
|
|
2238
2520
|
] }),
|
|
2239
|
-
|
|
2240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
|
|
2241
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2242
|
-
"
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
txLinkIcon
|
|
2252
|
-
]
|
|
2253
|
-
}
|
|
2254
|
-
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(destinationTxHash) }) })
|
|
2255
|
-
] })
|
|
2256
|
-
] }),
|
|
2257
|
-
showAlert && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--warning", children: [
|
|
2258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2259
|
-
"svg",
|
|
2260
|
-
{
|
|
2261
|
-
className: "rs-alert-icon",
|
|
2262
|
-
viewBox: "0 0 24 24",
|
|
2263
|
-
fill: "none",
|
|
2264
|
-
stroke: "currentColor",
|
|
2265
|
-
strokeWidth: "2",
|
|
2266
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2267
|
-
"path",
|
|
2521
|
+
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2522
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance" }),
|
|
2523
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2524
|
+
"$",
|
|
2525
|
+
balanceAfterUsd.toFixed(2)
|
|
2526
|
+
] })
|
|
2527
|
+
] }),
|
|
2528
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2529
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
2530
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
2531
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2532
|
+
"span",
|
|
2268
2533
|
{
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2534
|
+
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
2535
|
+
children: [
|
|
2536
|
+
quotedFeeAmount,
|
|
2537
|
+
" ",
|
|
2538
|
+
feeSymbol
|
|
2539
|
+
]
|
|
2272
2540
|
}
|
|
2273
|
-
)
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
] })
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2541
|
+
),
|
|
2542
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {}) }) })
|
|
2543
|
+
] })
|
|
2544
|
+
] })
|
|
2545
|
+
] }),
|
|
2546
|
+
isFailed && failureMessage && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
2547
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
2548
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: failureMessage })
|
|
2549
|
+
] }),
|
|
2550
|
+
isProcessing && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { fullWidth: true, disabled: true, loading: true, children: "Submitting transaction..." }),
|
|
2551
|
+
isComplete && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
2552
|
+
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
2553
|
+
"New ",
|
|
2554
|
+
flowNoun
|
|
2555
|
+
] }),
|
|
2556
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
2557
|
+
] }),
|
|
2558
|
+
isFailed && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
2559
|
+
onClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
2560
|
+
handleRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
2284
2561
|
] })
|
|
2285
2562
|
] }),
|
|
2286
2563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PoweredBy, {})
|
|
@@ -2293,7 +2570,7 @@ var clientCache = /* @__PURE__ */ new Map();
|
|
|
2293
2570
|
function getPublicClient(chainId) {
|
|
2294
2571
|
let client = clientCache.get(chainId);
|
|
2295
2572
|
if (!client) {
|
|
2296
|
-
const chain =
|
|
2573
|
+
const chain = _chunkXCAF6B3Dcjs.CHAIN_BY_ID[chainId];
|
|
2297
2574
|
client = _viem.createPublicClient.call(void 0, {
|
|
2298
2575
|
chain,
|
|
2299
2576
|
transport: _viem.http.call(void 0, )
|
|
@@ -2333,4 +2610,22 @@ function getPublicClient(chainId) {
|
|
|
2333
2610
|
|
|
2334
2611
|
|
|
2335
2612
|
|
|
2336
|
-
|
|
2613
|
+
|
|
2614
|
+
|
|
2615
|
+
|
|
2616
|
+
|
|
2617
|
+
|
|
2618
|
+
|
|
2619
|
+
|
|
2620
|
+
|
|
2621
|
+
|
|
2622
|
+
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.CoinsIcon = CoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowRightIcon = ArrowRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.ConnectStep = ConnectStep; exports.Spinner = Spinner; exports.Button = Button; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.txRefsMatch = txRefsMatch; exports.useLatestRef = useLatestRef; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;
|