@rhinestone/deposit-modal 0.3.0-alpha.1 → 0.3.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-EESTTLN4.mjs → DepositModalReown-2S76TEXU.mjs} +9 -6
- package/dist/{DepositModalReown-VV3H2WWC.cjs → DepositModalReown-4NV6JM2U.cjs} +12 -9
- package/dist/{QRCode-SMMYPUQC.cjs → QRCode-KG47KTGX.cjs} +1 -1
- package/dist/{QRCode-YMQTKSSK.mjs → QRCode-YJ3EGWQS.mjs} +1 -1
- package/dist/{WithdrawModalReown-SQQQV6KQ.mjs → WithdrawModalReown-QEQPCSWT.mjs} +4 -4
- package/dist/{WithdrawModalReown-IP4MOGER.cjs → WithdrawModalReown-Z5JVENP6.cjs} +7 -7
- package/dist/{chunk-DCAANLEP.cjs → chunk-2TWQGPPB.cjs} +1323 -590
- package/dist/chunk-7JIDIX27.cjs +554 -0
- package/dist/{chunk-D5YCALVX.mjs → chunk-7MZNQ4C2.mjs} +74 -349
- package/dist/{chunk-YQFH2WSW.cjs → chunk-FGVSNARE.cjs} +55 -25
- package/dist/{chunk-C6JK3IO6.cjs → chunk-HUPEN2T5.cjs} +2820 -1509
- package/dist/{chunk-SLLI7SB6.mjs → chunk-N5NOJ4ZV.mjs} +2746 -1435
- package/dist/{chunk-5YXAQB6A.mjs → chunk-QXIJLRKC.mjs} +56 -26
- package/dist/chunk-SZIYS42B.mjs +554 -0
- package/dist/{chunk-FY76DWPD.mjs → chunk-WVE3JN3C.mjs} +1308 -575
- package/dist/{chunk-K7MNFNR7.cjs → chunk-YI63OMXN.cjs} +155 -430
- package/dist/constants-DqVn968d.d.cts +52 -0
- package/dist/constants-DqVn968d.d.ts +52 -0
- package/dist/constants.cjs +8 -2
- package/dist/constants.d.cts +17 -48
- package/dist/constants.d.ts +17 -48
- package/dist/constants.mjs +7 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +16 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +16 -7
- package/dist/styles.css +656 -207
- package/dist/{types-DRou84ZM.d.cts → types-D6wrO4Ow.d.cts} +33 -8
- package/dist/{types-DRou84ZM.d.ts → types-D6wrO4Ow.d.ts} +33 -8
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
- package/dist/chunk-IVTXEYB2.cjs +0 -507
- package/dist/chunk-VA3ANS7D.mjs +0 -507
|
@@ -4,12 +4,14 @@ import {
|
|
|
4
4
|
getChainIcon,
|
|
5
5
|
getChainName,
|
|
6
6
|
getExplorerTxUrl,
|
|
7
|
+
getSolanaTokenByMint,
|
|
7
8
|
getSupportedChainIds,
|
|
9
|
+
getTargetTokenSymbol,
|
|
8
10
|
getTokenAddress,
|
|
9
11
|
getTokenDecimalsByAddress,
|
|
10
12
|
getTokenIcon,
|
|
11
13
|
getTokenSymbol
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SZIYS42B.mjs";
|
|
13
15
|
|
|
14
16
|
// src/components/ui/Modal.tsx
|
|
15
17
|
import {
|
|
@@ -157,31 +159,65 @@ import {
|
|
|
157
159
|
Info,
|
|
158
160
|
Copy,
|
|
159
161
|
ArrowRight,
|
|
162
|
+
ArrowUpRight,
|
|
160
163
|
AlertTriangle,
|
|
161
164
|
Percent,
|
|
162
165
|
Clock,
|
|
163
166
|
CirclePlus,
|
|
164
167
|
CircleArrowOutUpLeft
|
|
165
168
|
} from "lucide-react";
|
|
169
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
166
170
|
var WalletIcon = Wallet;
|
|
167
171
|
var ExternalLinkIcon = ExternalLink;
|
|
168
172
|
var CheckIcon = Check;
|
|
173
|
+
function TransferCryptoIcon() {
|
|
174
|
+
return /* @__PURE__ */ jsx2(
|
|
175
|
+
"svg",
|
|
176
|
+
{
|
|
177
|
+
width: "24",
|
|
178
|
+
height: "24",
|
|
179
|
+
viewBox: "8 8 24 24",
|
|
180
|
+
fill: "none",
|
|
181
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
182
|
+
"aria-hidden": "true",
|
|
183
|
+
children: /* @__PURE__ */ jsx2(
|
|
184
|
+
"path",
|
|
185
|
+
{
|
|
186
|
+
d: "M26.08 18.37C27.03 18.72 27.87 19.30 28.53 20.07C29.19 20.83 29.65 21.75 29.86 22.73C30.07 23.72 30.03 24.74 29.74 25.71C29.45 26.68 28.92 27.55 28.20 28.26C27.48 28.97 26.59 29.49 25.62 29.76C24.65 30.04 23.63 30.06 22.64 29.83C21.66 29.61 20.75 29.14 20.00 28.47C19.24 27.80 18.67 26.95 18.33 26.00M15 14H16V18M24.70 21.87L25.40 22.58L22.58 25.40M22 16C22 19.31 19.31 22 16 22C12.68 22 10 19.31 10 16C10 12.68 12.68 10 16 10C19.31 10 22 12.68 22 16Z",
|
|
187
|
+
stroke: "currentColor",
|
|
188
|
+
strokeWidth: "2",
|
|
189
|
+
strokeLinecap: "round",
|
|
190
|
+
strokeLinejoin: "round"
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
169
196
|
var ChevronRightIcon = ChevronRight;
|
|
170
197
|
var ChevronLeftIcon = ChevronLeft;
|
|
171
198
|
var ChevronDownIcon = ChevronDown;
|
|
172
199
|
var CloseIcon = X;
|
|
173
200
|
var HandCoinsIcon = HandCoins;
|
|
174
|
-
var CoinsIcon = Coins;
|
|
175
201
|
var HistoryIcon = History;
|
|
176
202
|
var InfoIcon = Info;
|
|
177
203
|
var CopyIcon = Copy;
|
|
178
|
-
var
|
|
204
|
+
var ArrowUpRightIcon = ArrowUpRight;
|
|
179
205
|
var AlertTriangleIcon = AlertTriangle;
|
|
180
206
|
var PercentIcon = Percent;
|
|
181
207
|
var ClockIcon = Clock;
|
|
182
208
|
var PlusCircleIcon = CirclePlus;
|
|
183
209
|
var CircleArrowOutUpLeftIcon = CircleArrowOutUpLeft;
|
|
184
210
|
|
|
211
|
+
// src/core/useLatestRef.ts
|
|
212
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
213
|
+
function useLatestRef(value) {
|
|
214
|
+
const ref = useRef2(value);
|
|
215
|
+
useEffect2(() => {
|
|
216
|
+
ref.current = value;
|
|
217
|
+
}, [value]);
|
|
218
|
+
return ref;
|
|
219
|
+
}
|
|
220
|
+
|
|
185
221
|
// src/core/debug.ts
|
|
186
222
|
function truncateString(value, max = 240) {
|
|
187
223
|
if (value.length <= max) return value;
|
|
@@ -241,6 +277,9 @@ var SOLANA_MAINNET_CAIP2 = `solana:${SOLANA_MAINNET_GENESIS}`;
|
|
|
241
277
|
function toEvmCaip2(chainId) {
|
|
242
278
|
return `eip155:${chainId}`;
|
|
243
279
|
}
|
|
280
|
+
function targetChainToCaip2(targetChain) {
|
|
281
|
+
return targetChain === "solana" ? SOLANA_MAINNET_CAIP2 : toEvmCaip2(targetChain);
|
|
282
|
+
}
|
|
244
283
|
function parseEvmChainId(value) {
|
|
245
284
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
246
285
|
return value;
|
|
@@ -487,9 +526,9 @@ function createDepositService(baseUrl, options) {
|
|
|
487
526
|
error,
|
|
488
527
|
{ status: response.status, ownerAddress: params.ownerAddress }
|
|
489
528
|
);
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
);
|
|
529
|
+
const detail = Array.isArray(error.details) ? error.details.map((d) => d?.message).filter(Boolean).join("; ") : void 0;
|
|
530
|
+
const base = error.error || `Setup account failed: ${response.status}`;
|
|
531
|
+
throw new Error(detail ? `${base}: ${detail}` : base);
|
|
493
532
|
}
|
|
494
533
|
const normalized = normalizeSetupAccountResponse(await response.json());
|
|
495
534
|
debugLog(debug, scope, "setupAccount:success", {
|
|
@@ -770,8 +809,48 @@ function createDepositService(baseUrl, options) {
|
|
|
770
809
|
});
|
|
771
810
|
return result;
|
|
772
811
|
},
|
|
812
|
+
async submitPolymarketWithdraw(params) {
|
|
813
|
+
const { depositWallet, owner, nonce, deadline, calls, signature } = params;
|
|
814
|
+
const url = apiUrl(`/polymarket/withdraw`);
|
|
815
|
+
debugLog(debug, scope, "submitPolymarketWithdraw:request", {
|
|
816
|
+
url,
|
|
817
|
+
depositWallet,
|
|
818
|
+
owner,
|
|
819
|
+
nonce,
|
|
820
|
+
callCount: calls.length
|
|
821
|
+
});
|
|
822
|
+
const response = await fetch(url, {
|
|
823
|
+
method: "POST",
|
|
824
|
+
headers: { "Content-Type": "application/json" },
|
|
825
|
+
body: JSON.stringify({
|
|
826
|
+
depositWallet,
|
|
827
|
+
owner,
|
|
828
|
+
nonce,
|
|
829
|
+
deadline,
|
|
830
|
+
calls,
|
|
831
|
+
signature
|
|
832
|
+
})
|
|
833
|
+
});
|
|
834
|
+
if (!response.ok) {
|
|
835
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
836
|
+
debugError(debug, scope, "submitPolymarketWithdraw:failed", error, {
|
|
837
|
+
status: response.status,
|
|
838
|
+
depositWallet,
|
|
839
|
+
owner
|
|
840
|
+
});
|
|
841
|
+
throw new Error(
|
|
842
|
+
error.error || `Polymarket withdraw failed: ${response.status}`
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
const result = await response.json();
|
|
846
|
+
debugLog(debug, scope, "submitPolymarketWithdraw:success", {
|
|
847
|
+
depositWallet,
|
|
848
|
+
txHash: result?.txHash ? shortRef(result.txHash) : void 0
|
|
849
|
+
});
|
|
850
|
+
return result;
|
|
851
|
+
},
|
|
773
852
|
async fetchDepositHistory(params) {
|
|
774
|
-
const searchParams = new URLSearchParams({
|
|
853
|
+
const searchParams = new URLSearchParams({ recipient: params.recipient });
|
|
775
854
|
searchParams.set("limit", String(params.limit ?? 20));
|
|
776
855
|
if (params.cursor) {
|
|
777
856
|
searchParams.set("cursor", params.cursor);
|
|
@@ -779,7 +858,7 @@ function createDepositService(baseUrl, options) {
|
|
|
779
858
|
const url = apiUrl(`/deposits?${searchParams.toString()}`);
|
|
780
859
|
debugLog(debug, scope, "fetchDepositHistory:request", {
|
|
781
860
|
url,
|
|
782
|
-
|
|
861
|
+
recipient: shortRef(params.recipient),
|
|
783
862
|
cursor: params.cursor
|
|
784
863
|
});
|
|
785
864
|
const response = await fetch(url, {
|
|
@@ -794,7 +873,7 @@ function createDepositService(baseUrl, options) {
|
|
|
794
873
|
scope,
|
|
795
874
|
"fetchDepositHistory:failed",
|
|
796
875
|
error,
|
|
797
|
-
{ status: response.status,
|
|
876
|
+
{ status: response.status, recipient: shortRef(params.recipient) }
|
|
798
877
|
);
|
|
799
878
|
throw new Error(
|
|
800
879
|
error.error || `Deposit history fetch failed: ${response.status}`
|
|
@@ -804,13 +883,23 @@ function createDepositService(baseUrl, options) {
|
|
|
804
883
|
const deposits = Array.isArray(data?.deposits) ? data.deposits : [];
|
|
805
884
|
const nextCursor = data?.nextCursor ?? data?.next_cursor ?? null;
|
|
806
885
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
807
|
-
|
|
886
|
+
recipient: shortRef(params.recipient),
|
|
808
887
|
count: deposits.length,
|
|
809
888
|
hasMore: Boolean(nextCursor)
|
|
810
889
|
});
|
|
811
890
|
return { deposits, nextCursor };
|
|
812
891
|
},
|
|
813
892
|
async checkLiquidity(params) {
|
|
893
|
+
if (params.destinationChainId === "solana") {
|
|
894
|
+
const token = getSolanaTokenByMint(params.destinationToken);
|
|
895
|
+
return {
|
|
896
|
+
hasLiquidity: true,
|
|
897
|
+
symbol: token?.symbol ?? "Token",
|
|
898
|
+
decimals: token?.decimals ?? 9,
|
|
899
|
+
unlimited: true,
|
|
900
|
+
maxAmount: null
|
|
901
|
+
};
|
|
902
|
+
}
|
|
814
903
|
const searchParams = new URLSearchParams({
|
|
815
904
|
sourceChainId: String(params.sourceChainId),
|
|
816
905
|
sourceToken: params.sourceToken,
|
|
@@ -853,6 +942,36 @@ function createDepositService(baseUrl, options) {
|
|
|
853
942
|
maxAmount: result.maxAmount
|
|
854
943
|
});
|
|
855
944
|
return result;
|
|
945
|
+
},
|
|
946
|
+
async fetchPrices(symbols) {
|
|
947
|
+
const list = symbols.filter((s) => s.length > 0);
|
|
948
|
+
if (list.length === 0) return {};
|
|
949
|
+
const url = apiUrl(
|
|
950
|
+
`/prices?${new URLSearchParams({ symbols: list.join(",") }).toString()}`
|
|
951
|
+
);
|
|
952
|
+
try {
|
|
953
|
+
const response = await fetch(url, {
|
|
954
|
+
method: "GET",
|
|
955
|
+
headers: { "Content-Type": "application/json" },
|
|
956
|
+
cache: "no-store"
|
|
957
|
+
});
|
|
958
|
+
if (!response.ok) {
|
|
959
|
+
debugError(debug, scope, "fetchPrices:failed", {
|
|
960
|
+
status: response.status
|
|
961
|
+
});
|
|
962
|
+
return {};
|
|
963
|
+
}
|
|
964
|
+
const data = await response.json();
|
|
965
|
+
return Object.fromEntries(
|
|
966
|
+
Object.entries(data.prices ?? {}).map(([symbol, price]) => [
|
|
967
|
+
symbol.toUpperCase(),
|
|
968
|
+
price
|
|
969
|
+
])
|
|
970
|
+
);
|
|
971
|
+
} catch (err) {
|
|
972
|
+
debugError(debug, scope, "fetchPrices:error", err);
|
|
973
|
+
return {};
|
|
974
|
+
}
|
|
856
975
|
}
|
|
857
976
|
};
|
|
858
977
|
}
|
|
@@ -964,14 +1083,76 @@ function extractNumericString(data, key) {
|
|
|
964
1083
|
return Number.isFinite(parsed) ? parsed : null;
|
|
965
1084
|
}
|
|
966
1085
|
|
|
967
|
-
// src/core/
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1086
|
+
// src/core/formatters.ts
|
|
1087
|
+
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
1088
|
+
style: "currency",
|
|
1089
|
+
currency: "USD",
|
|
1090
|
+
maximumFractionDigits: 2
|
|
1091
|
+
});
|
|
1092
|
+
var tokenFormatter = new Intl.NumberFormat("en-US", {
|
|
1093
|
+
minimumFractionDigits: 2,
|
|
1094
|
+
maximumFractionDigits: 5
|
|
1095
|
+
});
|
|
1096
|
+
function isUnsupportedChainSwitchError(error) {
|
|
1097
|
+
if (!error) return false;
|
|
1098
|
+
const name = error instanceof Error ? error.name : "";
|
|
1099
|
+
const message = (error instanceof Error ? error.message : String(error)).toLowerCase();
|
|
1100
|
+
return name === "SwitchChainNotSupportedError" || message.includes("does not support programmatic chain switching") || message.includes("switch chain not supported") || message.includes("method not found") || message.includes("does not exist") || message.includes("is not available");
|
|
1101
|
+
}
|
|
1102
|
+
function formatUserError(raw) {
|
|
1103
|
+
const lower = raw.toLowerCase();
|
|
1104
|
+
if (lower.includes("user rejected") || lower.includes("user denied")) {
|
|
1105
|
+
return "Transaction cancelled";
|
|
1106
|
+
}
|
|
1107
|
+
if (lower.includes("insufficient funds")) {
|
|
1108
|
+
return "Insufficient funds for this transaction";
|
|
1109
|
+
}
|
|
1110
|
+
if (lower.includes("nonce too low") || lower.includes("nonce too high")) {
|
|
1111
|
+
return "Transaction conflict \u2014 please try again";
|
|
1112
|
+
}
|
|
1113
|
+
if (lower.includes("execution reverted")) {
|
|
1114
|
+
return "Transaction would fail on-chain";
|
|
1115
|
+
}
|
|
1116
|
+
if (lower.includes("timed out") || lower.includes("took too long")) {
|
|
1117
|
+
return "Request timed out \u2014 please try again";
|
|
1118
|
+
}
|
|
1119
|
+
if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
|
|
1120
|
+
return "Service unavailable \u2014 please try again";
|
|
1121
|
+
}
|
|
1122
|
+
if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
|
|
1123
|
+
return "Solana RPC unavailable \u2014 please retry";
|
|
1124
|
+
}
|
|
1125
|
+
if (lower.includes("network") || lower.includes("disconnected")) {
|
|
1126
|
+
return "Network error \u2014 check your connection";
|
|
1127
|
+
}
|
|
1128
|
+
if (lower.includes("rate limit") || lower.includes("429")) {
|
|
1129
|
+
return "Rate limited \u2014 please try again shortly";
|
|
1130
|
+
}
|
|
1131
|
+
let cleaned = raw;
|
|
1132
|
+
const stripMarkers = [
|
|
1133
|
+
"\n\nRequest Arguments:",
|
|
1134
|
+
"\nRaw Call Arguments:",
|
|
1135
|
+
"\nRequest body:",
|
|
1136
|
+
"\nContract Call:",
|
|
1137
|
+
"\nDocs:",
|
|
1138
|
+
"\nDetails:",
|
|
1139
|
+
"\nVersion:",
|
|
1140
|
+
"\nURL:"
|
|
1141
|
+
];
|
|
1142
|
+
for (const marker of stripMarkers) {
|
|
1143
|
+
const idx = cleaned.indexOf(marker);
|
|
1144
|
+
if (idx !== -1) {
|
|
1145
|
+
cleaned = cleaned.slice(0, idx).trim();
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
|
|
1149
|
+
if (cleaned.length === 0) {
|
|
1150
|
+
return "An unexpected error occurred";
|
|
1151
|
+
}
|
|
1152
|
+
if (cleaned.length > 120) {
|
|
1153
|
+
return cleaned.slice(0, 120) + "...";
|
|
1154
|
+
}
|
|
1155
|
+
return cleaned;
|
|
975
1156
|
}
|
|
976
1157
|
|
|
977
1158
|
// src/core/theme.ts
|
|
@@ -1134,7 +1315,7 @@ function applyTheme(element, theme) {
|
|
|
1134
1315
|
}
|
|
1135
1316
|
|
|
1136
1317
|
// src/components/ui/BodyHeader.tsx
|
|
1137
|
-
import { jsx as
|
|
1318
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1138
1319
|
function BodyHeader({
|
|
1139
1320
|
icon,
|
|
1140
1321
|
title,
|
|
@@ -1147,17 +1328,17 @@ function BodyHeader({
|
|
|
1147
1328
|
variant === "error" ? "rs-body-header-icon--error" : ""
|
|
1148
1329
|
].filter(Boolean).join(" ");
|
|
1149
1330
|
return /* @__PURE__ */ jsxs("div", { className: "rs-body-header", children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx3("div", { className: iconClasses, children: icon }),
|
|
1151
1332
|
/* @__PURE__ */ jsxs("div", { className: "rs-body-header-text", children: [
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
subtitle && /* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ jsx3("h2", { className: "rs-body-header-title", children: title }),
|
|
1334
|
+
subtitle && /* @__PURE__ */ jsx3("p", { className: "rs-body-header-subtitle", children: subtitle })
|
|
1154
1335
|
] })
|
|
1155
1336
|
] });
|
|
1156
1337
|
}
|
|
1157
1338
|
BodyHeader.displayName = "BodyHeader";
|
|
1158
1339
|
|
|
1159
1340
|
// src/components/ui/PoweredBy.tsx
|
|
1160
|
-
import { jsx as
|
|
1341
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1161
1342
|
var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
1162
1343
|
"svg",
|
|
1163
1344
|
{
|
|
@@ -1168,7 +1349,7 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
|
1168
1349
|
"aria-hidden": "true",
|
|
1169
1350
|
children: [
|
|
1170
1351
|
/* @__PURE__ */ jsxs2("g", { fill: "currentColor", clipPath: "url(#rs-pb-clip)", children: [
|
|
1171
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx4(
|
|
1172
1353
|
"path",
|
|
1173
1354
|
{
|
|
1174
1355
|
opacity: "0.5",
|
|
@@ -1177,8 +1358,8 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
|
1177
1358
|
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"
|
|
1178
1359
|
}
|
|
1179
1360
|
),
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ jsx4("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" }),
|
|
1362
|
+
/* @__PURE__ */ jsx4(
|
|
1182
1363
|
"path",
|
|
1183
1364
|
{
|
|
1184
1365
|
fillRule: "evenodd",
|
|
@@ -1186,8 +1367,8 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
|
1186
1367
|
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"
|
|
1187
1368
|
}
|
|
1188
1369
|
),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx4("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" }),
|
|
1371
|
+
/* @__PURE__ */ jsx4(
|
|
1191
1372
|
"path",
|
|
1192
1373
|
{
|
|
1193
1374
|
fillRule: "evenodd",
|
|
@@ -1195,8 +1376,8 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
|
1195
1376
|
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
1377
|
}
|
|
1197
1378
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx4("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" }),
|
|
1380
|
+
/* @__PURE__ */ jsx4(
|
|
1200
1381
|
"path",
|
|
1201
1382
|
{
|
|
1202
1383
|
fillRule: "evenodd",
|
|
@@ -1204,16 +1385,16 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs2(
|
|
|
1204
1385
|
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
1386
|
}
|
|
1206
1387
|
),
|
|
1207
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsx4("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
1389
|
] }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ jsx4("defs", { children: /* @__PURE__ */ jsx4("clipPath", { id: "rs-pb-clip", children: /* @__PURE__ */ jsx4("path", { fill: "#fff", d: "M0 0h72v16H0z" }) }) })
|
|
1210
1391
|
]
|
|
1211
1392
|
}
|
|
1212
1393
|
);
|
|
1213
1394
|
function PoweredBy() {
|
|
1214
1395
|
return /* @__PURE__ */ jsxs2("div", { className: "rs-powered-by", "aria-label": "Powered by Rhinestone", children: [
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ jsx4("span", { children: "Powered by" }),
|
|
1397
|
+
/* @__PURE__ */ jsx4(
|
|
1217
1398
|
"a",
|
|
1218
1399
|
{
|
|
1219
1400
|
className: "rs-powered-by-link",
|
|
@@ -1227,8 +1408,38 @@ function PoweredBy() {
|
|
|
1227
1408
|
}
|
|
1228
1409
|
PoweredBy.displayName = "PoweredBy";
|
|
1229
1410
|
|
|
1411
|
+
// src/components/ui/Spinner.tsx
|
|
1412
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1413
|
+
function Spinner({ className }) {
|
|
1414
|
+
return /* @__PURE__ */ jsxs3(
|
|
1415
|
+
"svg",
|
|
1416
|
+
{
|
|
1417
|
+
className: `rs-spinner ${className || ""}`,
|
|
1418
|
+
fill: "none",
|
|
1419
|
+
viewBox: "0 0 20 21",
|
|
1420
|
+
children: [
|
|
1421
|
+
/* @__PURE__ */ jsx5(
|
|
1422
|
+
"path",
|
|
1423
|
+
{
|
|
1424
|
+
d: "M10 0.5C8.02 0.5 6.08 1.08 4.44 2.18C2.79 3.28 1.51 4.84 0.76 6.67C0.00 8.50 -0.19 10.51 0.19 12.45C0.57 14.39 1.53 16.17 2.92 17.57C4.32 18.96 6.10 19.92 8.04 20.30C9.98 20.69 11.99 20.49 13.82 19.73C15.65 18.98 17.21 17.70 18.31 16.05C19.41 14.41 20 12.47 20 10.5C20 7.84 18.94 5.30 17.07 3.42C15.19 1.55 12.65 0.5 10 0.5ZM10 17.77C8.56 17.77 7.15 17.34 5.95 16.54C4.76 15.74 3.83 14.61 3.28 13.28C2.73 11.95 2.58 10.49 2.86 9.08C3.14 7.67 3.84 6.37 4.85 5.35C5.87 4.34 7.17 3.64 8.58 3.36C9.99 3.08 11.45 3.23 12.78 3.78C14.11 4.33 15.24 5.26 16.04 6.45C16.84 7.65 17.27 9.06 17.27 10.5C17.27 12.42 16.50 14.27 15.14 15.64C13.77 17.00 11.92 17.77 10 17.77Z",
|
|
1425
|
+
fill: "currentColor",
|
|
1426
|
+
opacity: 0.3
|
|
1427
|
+
}
|
|
1428
|
+
),
|
|
1429
|
+
/* @__PURE__ */ jsx5(
|
|
1430
|
+
"path",
|
|
1431
|
+
{
|
|
1432
|
+
d: "M10 3.22C11.74 3.22 13.42 3.84 14.75 4.95C16.08 6.07 16.96 7.61 17.25 9.31C17.30 9.64 17.46 9.94 17.71 10.15C17.96 10.37 18.28 10.49 18.62 10.5C18.82 10.50 19.01 10.45 19.20 10.37C19.38 10.29 19.54 10.16 19.67 10.01C19.80 9.86 19.89 9.68 19.95 9.49C20.00 9.30 20.01 9.10 19.98 8.90C19.59 6.56 18.38 4.42 16.55 2.88C14.72 1.34 12.40 0.5 10 0.5C7.59 0.5 5.27 1.34 3.44 2.88C1.61 4.42 0.40 6.56 0.01 8.90C-0.01 9.10 -0.00 9.30 0.04 9.49C0.10 9.68 0.19 9.86 0.32 10.01C0.45 10.16 0.61 10.29 0.79 10.37C0.98 10.45 1.17 10.50 1.37 10.5C1.71 10.49 2.03 10.37 2.28 10.15C2.53 9.94 2.69 9.64 2.74 9.31C3.03 7.61 3.91 6.07 5.24 4.95C6.57 3.84 8.25 3.22 10 3.22Z",
|
|
1433
|
+
fill: "currentColor"
|
|
1434
|
+
}
|
|
1435
|
+
)
|
|
1436
|
+
]
|
|
1437
|
+
}
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1230
1441
|
// src/components/ui/ListRow.tsx
|
|
1231
|
-
import { jsx as
|
|
1442
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1232
1443
|
function ListRow({
|
|
1233
1444
|
leading,
|
|
1234
1445
|
leadingMedia,
|
|
@@ -1236,348 +1447,561 @@ function ListRow({
|
|
|
1236
1447
|
subtitle,
|
|
1237
1448
|
meta,
|
|
1238
1449
|
trailing,
|
|
1450
|
+
action,
|
|
1239
1451
|
className = "",
|
|
1452
|
+
onClick,
|
|
1453
|
+
disabled,
|
|
1240
1454
|
...props
|
|
1241
1455
|
}) {
|
|
1242
|
-
|
|
1456
|
+
const inner = /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1457
|
+
leadingMedia ? /* @__PURE__ */ jsx6("span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ jsx6("img", { src: leadingMedia, alt: "" }) }) : leading ? /* @__PURE__ */ jsx6("span", { className: "rs-list-row-leading", children: leading }) : null,
|
|
1458
|
+
/* @__PURE__ */ jsxs4("div", { className: "rs-list-row-body", children: [
|
|
1459
|
+
/* @__PURE__ */ jsxs4("div", { className: "rs-list-row-text", children: [
|
|
1460
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-list-row-title", children: title }),
|
|
1461
|
+
subtitle && /* @__PURE__ */ jsx6("span", { className: "rs-list-row-subtitle", children: subtitle })
|
|
1462
|
+
] }),
|
|
1463
|
+
action ? /* @__PURE__ */ jsx6(
|
|
1464
|
+
"button",
|
|
1465
|
+
{
|
|
1466
|
+
type: "button",
|
|
1467
|
+
className: "rs-list-row-action",
|
|
1468
|
+
disabled,
|
|
1469
|
+
onClick: (e) => {
|
|
1470
|
+
e.stopPropagation();
|
|
1471
|
+
action.onClick();
|
|
1472
|
+
},
|
|
1473
|
+
children: action.label
|
|
1474
|
+
}
|
|
1475
|
+
) : meta && /* @__PURE__ */ jsx6("div", { className: "rs-list-row-meta", children: meta })
|
|
1476
|
+
] }),
|
|
1477
|
+
/* @__PURE__ */ jsx6("span", { className: "rs-list-row-chevron", children: trailing ?? /* @__PURE__ */ jsx6(ChevronRightIcon, {}) })
|
|
1478
|
+
] });
|
|
1479
|
+
if (action) {
|
|
1480
|
+
const handleKey = (e) => {
|
|
1481
|
+
if (disabled) return;
|
|
1482
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1483
|
+
e.preventDefault();
|
|
1484
|
+
onClick?.(e);
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
return /* @__PURE__ */ jsx6(
|
|
1488
|
+
"div",
|
|
1489
|
+
{
|
|
1490
|
+
className: `rs-list-row ${className}`.trim(),
|
|
1491
|
+
role: "button",
|
|
1492
|
+
tabIndex: disabled ? -1 : 0,
|
|
1493
|
+
"aria-disabled": disabled || void 0,
|
|
1494
|
+
onClick: disabled ? void 0 : (e) => onClick?.(e),
|
|
1495
|
+
onKeyDown: handleKey,
|
|
1496
|
+
children: inner
|
|
1497
|
+
}
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
return /* @__PURE__ */ jsx6(
|
|
1243
1501
|
"button",
|
|
1244
1502
|
{
|
|
1245
1503
|
type: "button",
|
|
1246
1504
|
className: `rs-list-row ${className}`.trim(),
|
|
1505
|
+
onClick,
|
|
1506
|
+
disabled,
|
|
1247
1507
|
...props,
|
|
1508
|
+
children: inner
|
|
1509
|
+
}
|
|
1510
|
+
);
|
|
1511
|
+
}
|
|
1512
|
+
ListRow.displayName = "ListRow";
|
|
1513
|
+
|
|
1514
|
+
// src/components/ui/WalletBadgeIcons/RabbyIcon.tsx
|
|
1515
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1516
|
+
function RabbyIcon() {
|
|
1517
|
+
return /* @__PURE__ */ jsxs5(
|
|
1518
|
+
"svg",
|
|
1519
|
+
{
|
|
1520
|
+
width: "20",
|
|
1521
|
+
height: "20",
|
|
1522
|
+
viewBox: "0 0 20 20",
|
|
1523
|
+
fill: "none",
|
|
1524
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1248
1525
|
children: [
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1526
|
+
/* @__PURE__ */ jsxs5("g", { clipPath: "url(#rs-rabby-clip)", children: [
|
|
1527
|
+
/* @__PURE__ */ jsx7(
|
|
1528
|
+
"mask",
|
|
1529
|
+
{
|
|
1530
|
+
id: "rs-rabby-mask",
|
|
1531
|
+
style: { maskType: "luminance" },
|
|
1532
|
+
maskUnits: "userSpaceOnUse",
|
|
1533
|
+
x: "0",
|
|
1534
|
+
y: "0",
|
|
1535
|
+
width: "20",
|
|
1536
|
+
height: "20",
|
|
1537
|
+
children: /* @__PURE__ */ jsx7(
|
|
1538
|
+
"path",
|
|
1539
|
+
{
|
|
1540
|
+
d: "M20 10C20 4.47 15.52 0 10 0C4.47 0 0 4.47 0 10C0 15.52 4.47 20 10 20C15.52 20 20 15.52 20 10Z",
|
|
1541
|
+
fill: "white"
|
|
1542
|
+
}
|
|
1543
|
+
)
|
|
1544
|
+
}
|
|
1545
|
+
),
|
|
1546
|
+
/* @__PURE__ */ jsxs5("g", { mask: "url(#rs-rabby-mask)", children: [
|
|
1547
|
+
/* @__PURE__ */ jsx7(
|
|
1548
|
+
"path",
|
|
1549
|
+
{
|
|
1550
|
+
d: "M20 10C20 4.47 15.52 0 10 0C4.47 0 0 4.47 0 10C0 15.52 4.47 20 10 20C15.52 20 20 15.52 20 10Z",
|
|
1551
|
+
fill: "#7084FF"
|
|
1552
|
+
}
|
|
1553
|
+
),
|
|
1554
|
+
/* @__PURE__ */ jsx7(
|
|
1555
|
+
"path",
|
|
1556
|
+
{
|
|
1557
|
+
d: "M17.25 10.86C17.82 9.57 14.98 5.97 12.26 4.47C10.55 3.31 8.77 3.47 8.41 3.98C7.62 5.10 11.03 6.05 13.32 7.16C12.83 7.37 12.36 7.76 12.09 8.25C11.24 7.31 9.37 6.51 7.18 7.16C5.70 7.59 4.47 8.62 3.99 10.18C3.85 10.11 3.70 10.09 3.54 10.10C3.39 10.11 3.24 10.16 3.11 10.25C2.98 10.33 2.87 10.45 2.80 10.58C2.72 10.72 2.69 10.87 2.69 11.03C2.69 11.55 3.10 11.96 3.62 11.96C3.71 11.96 4.01 11.90 4.01 11.90L8.77 11.93C6.87 14.96 5.36 15.41 5.36 15.93C5.36 16.46 6.80 16.32 7.34 16.12C9.93 15.18 12.71 12.26 13.19 11.42C15.19 11.67 16.87 11.70 17.25 10.86Z",
|
|
1558
|
+
fill: "url(#rs-rabby-grad0)"
|
|
1559
|
+
}
|
|
1560
|
+
),
|
|
1561
|
+
/* @__PURE__ */ jsx7(
|
|
1562
|
+
"path",
|
|
1563
|
+
{
|
|
1564
|
+
fillRule: "evenodd",
|
|
1565
|
+
clipRule: "evenodd",
|
|
1566
|
+
d: "M13.31 7.15L13.32 7.16C13.42 7.11 13.41 6.96 13.38 6.83C13.31 6.55 12.16 5.41 11.07 4.90C9.60 4.20 8.51 4.23 8.35 4.56C8.65 5.18 10.04 5.76 11.50 6.36C12.12 6.62 12.75 6.88 13.31 7.15Z",
|
|
1567
|
+
fill: "url(#rs-rabby-grad1)"
|
|
1568
|
+
}
|
|
1569
|
+
),
|
|
1570
|
+
/* @__PURE__ */ jsx7(
|
|
1571
|
+
"path",
|
|
1572
|
+
{
|
|
1573
|
+
fillRule: "evenodd",
|
|
1574
|
+
clipRule: "evenodd",
|
|
1575
|
+
d: "M11.45 13.38C11.11 13.26 10.77 13.15 10.43 13.07C10.84 12.33 10.92 11.25 10.54 10.56C10.00 9.60 9.32 9.08 7.73 9.08C6.87 9.08 4.53 9.38 4.48 11.34C4.48 11.54 4.48 11.73 4.50 11.90L8.77 11.93C8.20 12.85 7.66 13.53 7.18 14.05C7.75 14.19 8.22 14.32 8.65 14.43C9.06 14.54 9.43 14.63 9.82 14.73C10.41 14.30 10.96 13.83 11.45 13.38Z",
|
|
1576
|
+
fill: "url(#rs-rabby-grad2)"
|
|
1577
|
+
}
|
|
1578
|
+
),
|
|
1579
|
+
/* @__PURE__ */ jsx7(
|
|
1580
|
+
"path",
|
|
1581
|
+
{
|
|
1582
|
+
d: "M3.94 11.70C4.11 13.19 4.96 13.77 6.68 13.94C8.40 14.12 9.39 14.00 10.71 14.12C11.81 14.22 12.79 14.78 13.15 14.59C13.48 14.42 13.30 13.78 12.86 13.38C12.29 12.85 11.50 12.49 10.12 12.36C10.39 11.60 10.32 10.54 9.89 9.96C9.27 9.12 8.13 8.75 6.68 8.91C5.17 9.08 3.72 9.83 3.94 11.70Z",
|
|
1583
|
+
fill: "url(#rs-rabby-grad3)"
|
|
1584
|
+
}
|
|
1585
|
+
)
|
|
1586
|
+
] })
|
|
1256
1587
|
] }),
|
|
1257
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ jsxs5("defs", { children: [
|
|
1589
|
+
/* @__PURE__ */ jsxs5(
|
|
1590
|
+
"linearGradient",
|
|
1591
|
+
{
|
|
1592
|
+
id: "rs-rabby-grad0",
|
|
1593
|
+
x1: "7.00",
|
|
1594
|
+
y1: "9.72",
|
|
1595
|
+
x2: "17.13",
|
|
1596
|
+
y2: "12.58",
|
|
1597
|
+
gradientUnits: "userSpaceOnUse",
|
|
1598
|
+
children: [
|
|
1599
|
+
/* @__PURE__ */ jsx7("stop", { stopColor: "white" }),
|
|
1600
|
+
/* @__PURE__ */ jsx7("stop", { offset: "1", stopColor: "white" })
|
|
1601
|
+
]
|
|
1602
|
+
}
|
|
1603
|
+
),
|
|
1604
|
+
/* @__PURE__ */ jsxs5(
|
|
1605
|
+
"linearGradient",
|
|
1606
|
+
{
|
|
1607
|
+
id: "rs-rabby-grad1",
|
|
1608
|
+
x1: "15.42",
|
|
1609
|
+
y1: "9.53",
|
|
1610
|
+
x2: "8.09",
|
|
1611
|
+
y2: "2.21",
|
|
1612
|
+
gradientUnits: "userSpaceOnUse",
|
|
1613
|
+
children: [
|
|
1614
|
+
/* @__PURE__ */ jsx7("stop", { stopColor: "#8697FF" }),
|
|
1615
|
+
/* @__PURE__ */ jsx7("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1616
|
+
]
|
|
1617
|
+
}
|
|
1618
|
+
),
|
|
1619
|
+
/* @__PURE__ */ jsxs5(
|
|
1620
|
+
"linearGradient",
|
|
1621
|
+
{
|
|
1622
|
+
id: "rs-rabby-grad2",
|
|
1623
|
+
x1: "11.65",
|
|
1624
|
+
y1: "13.64",
|
|
1625
|
+
x2: "4.63",
|
|
1626
|
+
y2: "9.61",
|
|
1627
|
+
gradientUnits: "userSpaceOnUse",
|
|
1628
|
+
children: [
|
|
1629
|
+
/* @__PURE__ */ jsx7("stop", { stopColor: "#8697FF" }),
|
|
1630
|
+
/* @__PURE__ */ jsx7("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
/* @__PURE__ */ jsxs5(
|
|
1635
|
+
"linearGradient",
|
|
1636
|
+
{
|
|
1637
|
+
id: "rs-rabby-grad3",
|
|
1638
|
+
x1: "7.61",
|
|
1639
|
+
y1: "9.64",
|
|
1640
|
+
x2: "12.37",
|
|
1641
|
+
y2: "15.67",
|
|
1642
|
+
gradientUnits: "userSpaceOnUse",
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ jsx7("stop", { stopColor: "white" }),
|
|
1645
|
+
/* @__PURE__ */ jsx7("stop", { offset: "0.98", stopColor: "#D1D8FF" })
|
|
1646
|
+
]
|
|
1647
|
+
}
|
|
1648
|
+
),
|
|
1649
|
+
/* @__PURE__ */ jsx7("clipPath", { id: "rs-rabby-clip", children: /* @__PURE__ */ jsx7("rect", { width: "20", height: "20", fill: "white" }) })
|
|
1650
|
+
] })
|
|
1258
1651
|
]
|
|
1259
1652
|
}
|
|
1260
1653
|
);
|
|
1261
1654
|
}
|
|
1262
|
-
ListRow.displayName = "ListRow";
|
|
1263
1655
|
|
|
1264
|
-
// src/components/ui/WalletBadgeIcons.tsx
|
|
1265
|
-
import { jsx as
|
|
1266
|
-
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1656
|
+
// src/components/ui/WalletBadgeIcons/PhantomIcon.tsx
|
|
1657
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1658
|
+
function PhantomIcon() {
|
|
1659
|
+
return /* @__PURE__ */ jsxs6(
|
|
1660
|
+
"svg",
|
|
1661
|
+
{
|
|
1662
|
+
width: "20",
|
|
1663
|
+
height: "20",
|
|
1664
|
+
viewBox: "0 0 20 20",
|
|
1665
|
+
fill: "none",
|
|
1666
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1667
|
+
children: [
|
|
1668
|
+
/* @__PURE__ */ jsx8(
|
|
1669
|
+
"path",
|
|
1670
|
+
{
|
|
1671
|
+
d: "M15.18 0H4.81C2.15 0 0 2.15 0 4.81V15.18C0 17.84 2.15 20 4.81 20H15.18C17.84 20 20 17.84 20 15.18V4.81C20 2.15 17.84 0 15.18 0Z",
|
|
1672
|
+
fill: "#AB9FF2"
|
|
1673
|
+
}
|
|
1674
|
+
),
|
|
1675
|
+
/* @__PURE__ */ jsx8(
|
|
1279
1676
|
"path",
|
|
1280
1677
|
{
|
|
1281
|
-
|
|
1282
|
-
|
|
1678
|
+
fillRule: "evenodd",
|
|
1679
|
+
clipRule: "evenodd",
|
|
1680
|
+
d: "M8.61 12.94C7.77 14.23 6.37 15.85 4.50 15.85C3.62 15.85 2.77 15.49 2.77 13.91C2.77 9.89 8.26 3.67 13.35 3.67C16.25 3.67 17.40 5.68 17.40 7.96C17.40 10.89 15.50 14.24 13.61 14.24C13.01 14.24 12.72 13.91 12.72 13.39C12.72 13.25 12.74 13.10 12.79 12.94C12.14 14.04 10.90 15.07 9.73 15.07C8.88 15.07 8.45 14.53 8.45 13.78C8.45 13.51 8.51 13.23 8.61 12.94ZM15.49 7.88C15.49 8.54 15.10 8.88 14.66 8.88C14.21 8.88 13.83 8.54 13.83 7.88C13.83 7.21 14.21 6.88 14.66 6.88C15.10 6.88 15.49 7.22 15.49 7.88ZM13.00 7.88C13.00 8.54 12.60 8.88 12.17 8.88C11.72 8.88 11.33 8.54 11.33 7.88C11.33 7.22 11.72 6.88 12.17 6.88C12.60 6.88 13.00 7.22 13.00 7.88",
|
|
1681
|
+
fill: "#FFFDF8"
|
|
1283
1682
|
}
|
|
1284
1683
|
)
|
|
1285
|
-
|
|
1286
|
-
),
|
|
1287
|
-
/* @__PURE__ */ jsxs4("g", { mask: "url(#rs-rabby-mask)", children: [
|
|
1288
|
-
/* @__PURE__ */ jsx5(
|
|
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__ */ jsx5(
|
|
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__ */ jsx5(
|
|
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__ */ jsx5(
|
|
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__ */ jsx5(
|
|
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__ */ jsxs4("defs", { children: [
|
|
1330
|
-
/* @__PURE__ */ jsxs4(
|
|
1331
|
-
"linearGradient",
|
|
1332
|
-
{
|
|
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__ */ jsx5("stop", { stopColor: "white" }),
|
|
1341
|
-
/* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "white" })
|
|
1342
|
-
]
|
|
1343
|
-
}
|
|
1344
|
-
),
|
|
1345
|
-
/* @__PURE__ */ jsxs4(
|
|
1346
|
-
"linearGradient",
|
|
1347
|
-
{
|
|
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__ */ jsx5("stop", { stopColor: "#8697FF" }),
|
|
1356
|
-
/* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1357
|
-
]
|
|
1358
|
-
}
|
|
1359
|
-
),
|
|
1360
|
-
/* @__PURE__ */ jsxs4(
|
|
1361
|
-
"linearGradient",
|
|
1362
|
-
{
|
|
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__ */ jsx5("stop", { stopColor: "#8697FF" }),
|
|
1371
|
-
/* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1372
|
-
]
|
|
1373
|
-
}
|
|
1374
|
-
),
|
|
1375
|
-
/* @__PURE__ */ jsxs4(
|
|
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__ */ jsx5("stop", { stopColor: "white" }),
|
|
1386
|
-
/* @__PURE__ */ jsx5("stop", { offset: "0.984", stopColor: "#D1D8FF" })
|
|
1387
|
-
]
|
|
1388
|
-
}
|
|
1389
|
-
),
|
|
1390
|
-
/* @__PURE__ */ jsx5("clipPath", { id: "rs-rabby-clip", children: /* @__PURE__ */ jsx5("rect", { width: "20", height: "20", fill: "white" }) })
|
|
1391
|
-
] })
|
|
1392
|
-
] });
|
|
1393
|
-
var PhantomIcon = () => /* @__PURE__ */ jsxs4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1394
|
-
/* @__PURE__ */ jsx5(
|
|
1395
|
-
"path",
|
|
1396
|
-
{
|
|
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"
|
|
1399
|
-
}
|
|
1400
|
-
),
|
|
1401
|
-
/* @__PURE__ */ jsx5(
|
|
1402
|
-
"path",
|
|
1403
|
-
{
|
|
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"
|
|
1408
|
-
}
|
|
1409
|
-
)
|
|
1410
|
-
] });
|
|
1411
|
-
var WalletConnectIcon = () => /* @__PURE__ */ jsxs4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1412
|
-
/* @__PURE__ */ jsx5("rect", { width: "20", height: "20", rx: "2.5", fill: "#3B99FC" }),
|
|
1413
|
-
/* @__PURE__ */ jsx5(
|
|
1414
|
-
"path",
|
|
1415
|
-
{
|
|
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"
|
|
1684
|
+
]
|
|
1418
1685
|
}
|
|
1419
|
-
)
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
// src/components/ui/WalletBadgeIcons/WalletConnectIcon.tsx
|
|
1690
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1691
|
+
function WalletConnectIcon() {
|
|
1692
|
+
return /* @__PURE__ */ jsxs7(
|
|
1693
|
+
"svg",
|
|
1424
1694
|
{
|
|
1425
|
-
|
|
1426
|
-
|
|
1695
|
+
width: "20",
|
|
1696
|
+
height: "20",
|
|
1697
|
+
viewBox: "0 0 20 20",
|
|
1698
|
+
fill: "none",
|
|
1699
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1700
|
+
children: [
|
|
1701
|
+
/* @__PURE__ */ jsx9("rect", { width: "20", height: "20", rx: "2.5", fill: "#3B99FC" }),
|
|
1702
|
+
/* @__PURE__ */ jsx9(
|
|
1703
|
+
"path",
|
|
1704
|
+
{
|
|
1705
|
+
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",
|
|
1706
|
+
fill: "#fff"
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1709
|
+
]
|
|
1427
1710
|
}
|
|
1428
|
-
)
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
|
|
1436
|
-
var SolBadgeIcon = () => /* @__PURE__ */ jsxs4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1437
|
-
/* @__PURE__ */ jsx5("rect", { width: "20", height: "20", rx: "10", fill: "#0C0C0C" }),
|
|
1438
|
-
/* @__PURE__ */ jsx5(
|
|
1439
|
-
"path",
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
// src/components/ui/WalletBadgeIcons/EthBadgeIcon.tsx
|
|
1715
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1716
|
+
function EthBadgeIcon() {
|
|
1717
|
+
return /* @__PURE__ */ jsxs8(
|
|
1718
|
+
"svg",
|
|
1440
1719
|
{
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
fill: "
|
|
1720
|
+
width: "20",
|
|
1721
|
+
height: "20",
|
|
1722
|
+
viewBox: "0 0 20 20",
|
|
1723
|
+
fill: "none",
|
|
1724
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1725
|
+
children: [
|
|
1726
|
+
/* @__PURE__ */ jsx10(
|
|
1727
|
+
"path",
|
|
1728
|
+
{
|
|
1729
|
+
d: "M9.99 19.93C15.48 19.93 19.93 15.48 19.93 9.99C19.93 4.51 15.48 0.06 9.99 0.06C4.51 0.06 0.06 4.51 0.06 9.99C0.06 15.48 4.51 19.93 9.99 19.93Z",
|
|
1730
|
+
fill: "#E3E3E3"
|
|
1731
|
+
}
|
|
1732
|
+
),
|
|
1733
|
+
/* @__PURE__ */ jsx10("path", { d: "M10.00 2.18L14.69 9.99L10.02 7.98L10.00 2.18Z", fill: "#2F3030" }),
|
|
1734
|
+
/* @__PURE__ */ jsx10("path", { d: "M5.31 9.99L9.98 2.18L10.00 7.98L5.31 9.99Z", fill: "#828384" }),
|
|
1735
|
+
/* @__PURE__ */ jsx10("path", { d: "M9.98 12.80L5.31 10.04L10.00 8.11L9.98 12.80Z", fill: "#343535" }),
|
|
1736
|
+
/* @__PURE__ */ jsx10("path", { d: "M14.69 10.04L10.02 8.11L10.00 12.80L14.69 10.04Z", fill: "#131313" }),
|
|
1737
|
+
/* @__PURE__ */ jsx10("path", { d: "M10.00 14.00L14.69 11.24L10.00 17.80V14.00Z", fill: "#2F3030" }),
|
|
1738
|
+
/* @__PURE__ */ jsx10("path", { d: "M10.00 14.00L5.31 11.24L10.00 17.80V14.00Z", fill: "#828384" })
|
|
1739
|
+
]
|
|
1445
1740
|
}
|
|
1446
|
-
)
|
|
1447
|
-
|
|
1448
|
-
|
|
1741
|
+
);
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
// src/components/ui/WalletBadgeIcons/SolBadgeIcon.tsx
|
|
1745
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1746
|
+
function SolBadgeIcon() {
|
|
1747
|
+
return /* @__PURE__ */ jsxs9(
|
|
1748
|
+
"svg",
|
|
1449
1749
|
{
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
gradientUnits: "userSpaceOnUse",
|
|
1750
|
+
width: "20",
|
|
1751
|
+
height: "20",
|
|
1752
|
+
viewBox: "0 0 20 20",
|
|
1753
|
+
fill: "none",
|
|
1754
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1456
1755
|
children: [
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsx11("rect", { width: "20", height: "20", rx: "10", fill: "#0C0C0C" }),
|
|
1757
|
+
/* @__PURE__ */ jsx11(
|
|
1758
|
+
"path",
|
|
1759
|
+
{
|
|
1760
|
+
fillRule: "evenodd",
|
|
1761
|
+
clipRule: "evenodd",
|
|
1762
|
+
d: "M4.62 9.04H13.87C13.99 9.04 14.10 9.08 14.18 9.17L15.64 10.64C15.91 10.91 15.72 11.38 15.34 11.38H6.08C5.97 11.38 5.86 11.33 5.78 11.25L4.31 9.78C4.04 9.51 4.23 9.04 4.62 9.04ZM4.31 7.09L5.77 5.62C5.86 5.53 5.97 5.49 6.08 5.49H15.33C15.71 5.49 15.91 5.95 15.63 6.22L14.17 7.70C14.09 7.78 13.98 7.82 13.87 7.82H4.62C4.23 7.82 4.04 7.36 4.31 7.09ZM15.64 13.34L14.17 14.81C14.09 14.89 13.98 14.94 13.87 14.94H4.62C4.23 14.94 4.04 14.48 4.31 14.20L5.77 12.73C5.86 12.65 5.97 12.60 6.08 12.60H15.33C15.72 12.6 15.91 13.06 15.64 13.34Z",
|
|
1763
|
+
fill: "url(#rs-sol-badge-grad)"
|
|
1764
|
+
}
|
|
1765
|
+
),
|
|
1766
|
+
/* @__PURE__ */ jsx11("defs", { children: /* @__PURE__ */ jsxs9(
|
|
1767
|
+
"linearGradient",
|
|
1768
|
+
{
|
|
1769
|
+
id: "rs-sol-badge-grad",
|
|
1770
|
+
x1: "4.85",
|
|
1771
|
+
y1: "15.34",
|
|
1772
|
+
x2: "15.11",
|
|
1773
|
+
y2: "5.08",
|
|
1774
|
+
gradientUnits: "userSpaceOnUse",
|
|
1775
|
+
children: [
|
|
1776
|
+
/* @__PURE__ */ jsx11("stop", { stopColor: "#CB4EE8" }),
|
|
1777
|
+
/* @__PURE__ */ jsx11("stop", { offset: "1", stopColor: "#10F4B1" })
|
|
1778
|
+
]
|
|
1779
|
+
}
|
|
1780
|
+
) })
|
|
1459
1781
|
]
|
|
1460
1782
|
}
|
|
1461
|
-
)
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
// src/components/ui/WalletBadgeIcons/BaseBadgeIcon.tsx
|
|
1787
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1788
|
+
function BaseBadgeIcon() {
|
|
1789
|
+
return /* @__PURE__ */ jsxs10(
|
|
1790
|
+
"svg",
|
|
1467
1791
|
{
|
|
1468
|
-
|
|
1469
|
-
|
|
1792
|
+
width: "20",
|
|
1793
|
+
height: "20",
|
|
1794
|
+
viewBox: "0 0 111 111",
|
|
1795
|
+
fill: "none",
|
|
1796
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1797
|
+
children: [
|
|
1798
|
+
/* @__PURE__ */ jsx12("circle", { cx: "55.5", cy: "55.5", r: "55.5", fill: "#0052FF" }),
|
|
1799
|
+
/* @__PURE__ */ jsx12(
|
|
1800
|
+
"path",
|
|
1801
|
+
{
|
|
1802
|
+
d: "M54.92 93.4c20.94 0 37.92-16.97 37.92-37.92S75.86 17.55 54.92 17.55c-19.49 0-35.57 14.72-37.65 33.64h49.82v5.54h-49.82C19.35 75.67 35.42 93.4 54.92 93.4z",
|
|
1803
|
+
fill: "#fff"
|
|
1804
|
+
}
|
|
1805
|
+
)
|
|
1806
|
+
]
|
|
1470
1807
|
}
|
|
1471
|
-
)
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
/* @__PURE__ */ jsx5("span", { children: /* @__PURE__ */ jsx5(WalletConnectIcon, {}) })
|
|
1477
|
-
] });
|
|
1478
|
-
var chainBadge = /* @__PURE__ */ jsxs4("span", { className: "rs-list-row-meta-icons", children: [
|
|
1479
|
-
/* @__PURE__ */ jsx5("span", { children: /* @__PURE__ */ jsx5(EthBadgeIcon, {}) }),
|
|
1480
|
-
/* @__PURE__ */ jsx5("span", { children: /* @__PURE__ */ jsx5(SolBadgeIcon, {}) }),
|
|
1481
|
-
/* @__PURE__ */ jsx5("span", { children: /* @__PURE__ */ jsx5(BaseBadgeIcon, {}) })
|
|
1482
|
-
] });
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
1812
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1483
1813
|
function WalletBadgeIcons() {
|
|
1484
|
-
return
|
|
1814
|
+
return /* @__PURE__ */ jsxs11("span", { className: "rs-list-row-meta-icons", children: [
|
|
1815
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(RabbyIcon, {}) }),
|
|
1816
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(PhantomIcon, {}) }),
|
|
1817
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(WalletConnectIcon, {}) })
|
|
1818
|
+
] });
|
|
1485
1819
|
}
|
|
1486
1820
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
1487
1821
|
function ChainBadgeIcons() {
|
|
1488
|
-
return
|
|
1822
|
+
return /* @__PURE__ */ jsxs11("span", { className: "rs-list-row-meta-icons", children: [
|
|
1823
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(EthBadgeIcon, {}) }),
|
|
1824
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(SolBadgeIcon, {}) }),
|
|
1825
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13(BaseBadgeIcon, {}) })
|
|
1826
|
+
] });
|
|
1489
1827
|
}
|
|
1490
1828
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
1491
1829
|
|
|
1492
1830
|
// src/components/steps/ConnectStep.tsx
|
|
1493
|
-
import { Fragment, jsx as
|
|
1831
|
+
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1832
|
+
function formatBalanceUsd(value) {
|
|
1833
|
+
if (!Number.isFinite(value) || value <= 0) return "$0.00";
|
|
1834
|
+
return `$${value.toFixed(2)}`;
|
|
1835
|
+
}
|
|
1494
1836
|
function shorten(addr) {
|
|
1495
1837
|
return addr.length > 12 ? `${addr.slice(0, 6)}...${addr.slice(-4)}` : addr;
|
|
1496
1838
|
}
|
|
1497
|
-
function renderWalletLeading(
|
|
1498
|
-
if (
|
|
1499
|
-
return /* @__PURE__ */
|
|
1839
|
+
function renderWalletLeading(row) {
|
|
1840
|
+
if (row.icon) {
|
|
1841
|
+
return /* @__PURE__ */ jsx14(
|
|
1500
1842
|
"img",
|
|
1501
1843
|
{
|
|
1502
|
-
src:
|
|
1844
|
+
src: row.icon,
|
|
1503
1845
|
alt: "",
|
|
1504
1846
|
style: { width: 24, height: 24, borderRadius: 6 }
|
|
1505
1847
|
}
|
|
1506
1848
|
);
|
|
1507
1849
|
}
|
|
1508
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ jsx14(WalletIcon, {});
|
|
1851
|
+
}
|
|
1852
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ jsx14(TransferCryptoIcon, {});
|
|
1853
|
+
var WALLET_LEADING = /* @__PURE__ */ jsx14(WalletIcon, {});
|
|
1854
|
+
var SMALL_SPINNER = /* @__PURE__ */ jsx14(Spinner, { className: "rs-spinner--sm" });
|
|
1855
|
+
var CONNECT_META = /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
1856
|
+
/* @__PURE__ */ jsx14(WalletBadgeIcons, {}),
|
|
1857
|
+
"+100 wallets"
|
|
1858
|
+
] });
|
|
1859
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, getSupportedChainIds().length - 3);
|
|
1860
|
+
var CHAIN_BADGE_META = /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
1861
|
+
/* @__PURE__ */ jsx14(ChainBadgeIcons, {}),
|
|
1862
|
+
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT} chains` : "All chains"
|
|
1863
|
+
] });
|
|
1864
|
+
function renderRowTrailing(state) {
|
|
1865
|
+
if (state === "loading") {
|
|
1866
|
+
return SMALL_SPINNER;
|
|
1867
|
+
}
|
|
1868
|
+
return void 0;
|
|
1509
1869
|
}
|
|
1510
1870
|
function ConnectStep({
|
|
1511
|
-
|
|
1871
|
+
walletRows,
|
|
1512
1872
|
onConfirmWallet,
|
|
1513
1873
|
onSelectTransferCrypto,
|
|
1874
|
+
transferCryptoState,
|
|
1875
|
+
transferCryptoErrorReason,
|
|
1514
1876
|
onRequestConnect,
|
|
1515
1877
|
onConnect,
|
|
1516
1878
|
onDisconnect,
|
|
1879
|
+
dappImports,
|
|
1880
|
+
onSelectDappImport,
|
|
1517
1881
|
title = "Deposit",
|
|
1518
1882
|
subtitle
|
|
1519
1883
|
}) {
|
|
1520
|
-
const
|
|
1884
|
+
const rows = walletRows ?? [];
|
|
1521
1885
|
const handleConnect = onConnect ?? onRequestConnect;
|
|
1522
|
-
const hasReownWallet =
|
|
1523
|
-
(
|
|
1886
|
+
const hasReownWallet = rows.some(
|
|
1887
|
+
(row) => row.kind === "external" || row.kind === "solana"
|
|
1524
1888
|
);
|
|
1525
|
-
const
|
|
1526
|
-
const chainBadge2 = /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1527
|
-
/* @__PURE__ */ jsx6(ChainBadgeIcons, {}),
|
|
1528
|
-
extraChainCount > 0 ? `+${extraChainCount} chains` : "All chains"
|
|
1529
|
-
] });
|
|
1889
|
+
const showDappImports = (dappImports?.length ?? 0) > 0;
|
|
1530
1890
|
const defaultSubtitle = onSelectTransferCrypto ? "Add money to your balance" : "Choose a wallet to continue";
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ jsxs12("div", { className: "rs-screen", children: [
|
|
1892
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1893
|
+
/* @__PURE__ */ jsx14(
|
|
1534
1894
|
BodyHeader,
|
|
1535
1895
|
{
|
|
1536
|
-
icon: /* @__PURE__ */
|
|
1896
|
+
icon: /* @__PURE__ */ jsx14(HandCoinsIcon, {}),
|
|
1537
1897
|
title,
|
|
1538
1898
|
subtitle: subtitle ?? defaultSubtitle
|
|
1539
1899
|
}
|
|
1540
1900
|
),
|
|
1541
|
-
/* @__PURE__ */
|
|
1542
|
-
onSelectTransferCrypto && /* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsxs12("div", { className: "rs-list", children: [
|
|
1902
|
+
onSelectTransferCrypto && /* @__PURE__ */ jsx14(
|
|
1543
1903
|
ListRow,
|
|
1544
1904
|
{
|
|
1545
|
-
leading:
|
|
1905
|
+
leading: TRANSFER_CRYPTO_LEADING,
|
|
1546
1906
|
title: "Transfer crypto",
|
|
1547
|
-
subtitle: "Instant - No limit",
|
|
1548
|
-
meta:
|
|
1549
|
-
onClick: onSelectTransferCrypto
|
|
1907
|
+
subtitle: transferCryptoState === "loading" ? "Preparing\u2026" : transferCryptoState === "error" ? transferCryptoErrorReason ?? "Couldn't prepare account \u2014 tap to retry" : "Instant - No limit",
|
|
1908
|
+
meta: CHAIN_BADGE_META,
|
|
1909
|
+
onClick: onSelectTransferCrypto,
|
|
1910
|
+
disabled: transferCryptoState === "loading",
|
|
1911
|
+
trailing: transferCryptoState === "loading" ? SMALL_SPINNER : void 0
|
|
1550
1912
|
}
|
|
1551
1913
|
),
|
|
1552
|
-
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1914
|
+
rows.map((row) => {
|
|
1915
|
+
const collapseToExternal = Boolean(onSelectTransferCrypto) && row.kind !== "solana";
|
|
1916
|
+
const subtitleText = row.state === "loading" ? "Preparing\u2026" : row.state === "error" ? row.errorReason ?? "Couldn't prepare wallet \u2014 tap to retry" : shorten(row.address);
|
|
1917
|
+
return /* @__PURE__ */ jsx14(
|
|
1555
1918
|
ListRow,
|
|
1556
1919
|
{
|
|
1557
|
-
leading: renderWalletLeading(
|
|
1558
|
-
title:
|
|
1559
|
-
subtitle:
|
|
1560
|
-
onClick: () => onConfirmWallet?.(
|
|
1920
|
+
leading: renderWalletLeading(row),
|
|
1921
|
+
title: collapseToExternal ? "External wallet" : row.label,
|
|
1922
|
+
subtitle: subtitleText,
|
|
1923
|
+
onClick: () => onConfirmWallet?.(row.id),
|
|
1924
|
+
disabled: row.state === "loading",
|
|
1925
|
+
trailing: renderRowTrailing(row.state)
|
|
1561
1926
|
},
|
|
1562
|
-
|
|
1927
|
+
row.id
|
|
1563
1928
|
);
|
|
1564
1929
|
}),
|
|
1565
|
-
!hasReownWallet && handleConnect && /* @__PURE__ */
|
|
1930
|
+
!hasReownWallet && handleConnect && /* @__PURE__ */ jsx14(
|
|
1566
1931
|
ListRow,
|
|
1567
1932
|
{
|
|
1568
|
-
leading:
|
|
1933
|
+
leading: WALLET_LEADING,
|
|
1569
1934
|
title: "Connect wallet",
|
|
1570
1935
|
subtitle: "Instant - No limit",
|
|
1571
|
-
meta:
|
|
1572
|
-
/* @__PURE__ */ jsx6(WalletBadgeIcons, {}),
|
|
1573
|
-
"+100 wallets"
|
|
1574
|
-
] }),
|
|
1936
|
+
meta: CONNECT_META,
|
|
1575
1937
|
onClick: handleConnect
|
|
1576
1938
|
}
|
|
1577
|
-
)
|
|
1939
|
+
),
|
|
1940
|
+
showDappImports && dappImports?.map((row) => {
|
|
1941
|
+
if (!hasReownWallet) {
|
|
1942
|
+
return /* @__PURE__ */ jsx14(
|
|
1943
|
+
ListRow,
|
|
1944
|
+
{
|
|
1945
|
+
leading: row.icon,
|
|
1946
|
+
title: row.label,
|
|
1947
|
+
subtitle: "Connect wallet to view balance",
|
|
1948
|
+
onClick: handleConnect,
|
|
1949
|
+
disabled: !handleConnect
|
|
1950
|
+
},
|
|
1951
|
+
row.id
|
|
1952
|
+
);
|
|
1953
|
+
}
|
|
1954
|
+
if (row.status === "loading" || row.status === "needs-connect") {
|
|
1955
|
+
return /* @__PURE__ */ jsx14(
|
|
1956
|
+
ListRow,
|
|
1957
|
+
{
|
|
1958
|
+
leading: row.icon,
|
|
1959
|
+
title: row.label,
|
|
1960
|
+
subtitle: "Checking balance\u2026",
|
|
1961
|
+
disabled: true,
|
|
1962
|
+
trailing: SMALL_SPINNER
|
|
1963
|
+
},
|
|
1964
|
+
row.id
|
|
1965
|
+
);
|
|
1966
|
+
}
|
|
1967
|
+
if (row.status.enabled) {
|
|
1968
|
+
return /* @__PURE__ */ jsx14(
|
|
1969
|
+
ListRow,
|
|
1970
|
+
{
|
|
1971
|
+
leading: row.icon,
|
|
1972
|
+
title: row.label,
|
|
1973
|
+
subtitle: formatBalanceUsd(row.status.balanceUsd),
|
|
1974
|
+
onClick: () => onSelectDappImport?.(row.id)
|
|
1975
|
+
},
|
|
1976
|
+
row.id
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
if (row.status.retryable) {
|
|
1980
|
+
return /* @__PURE__ */ jsx14(
|
|
1981
|
+
ListRow,
|
|
1982
|
+
{
|
|
1983
|
+
leading: row.icon,
|
|
1984
|
+
title: row.label,
|
|
1985
|
+
subtitle: row.status.reason,
|
|
1986
|
+
onClick: () => onSelectDappImport?.(row.id)
|
|
1987
|
+
},
|
|
1988
|
+
row.id
|
|
1989
|
+
);
|
|
1990
|
+
}
|
|
1991
|
+
return /* @__PURE__ */ jsx14(
|
|
1992
|
+
ListRow,
|
|
1993
|
+
{
|
|
1994
|
+
leading: row.icon,
|
|
1995
|
+
title: row.label,
|
|
1996
|
+
subtitle: row.status.reason,
|
|
1997
|
+
disabled: true
|
|
1998
|
+
},
|
|
1999
|
+
row.id
|
|
2000
|
+
);
|
|
2001
|
+
})
|
|
1578
2002
|
] })
|
|
1579
2003
|
] }),
|
|
1580
|
-
onDisconnect && hasReownWallet && /* @__PURE__ */
|
|
2004
|
+
onDisconnect && hasReownWallet && /* @__PURE__ */ jsx14("div", { className: "rs-screen-tight-row", children: /* @__PURE__ */ jsx14(
|
|
1581
2005
|
"button",
|
|
1582
2006
|
{
|
|
1583
2007
|
type: "button",
|
|
@@ -1586,161 +2010,17 @@ function ConnectStep({
|
|
|
1586
2010
|
children: "Disconnect wallet"
|
|
1587
2011
|
}
|
|
1588
2012
|
) }),
|
|
1589
|
-
/* @__PURE__ */
|
|
2013
|
+
/* @__PURE__ */ jsx14(PoweredBy, {})
|
|
1590
2014
|
] });
|
|
1591
2015
|
}
|
|
1592
2016
|
ConnectStep.displayName = "ConnectStep";
|
|
1593
2017
|
|
|
1594
|
-
// src/components/ui/Spinner.tsx
|
|
1595
|
-
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1596
|
-
function Spinner({ className }) {
|
|
1597
|
-
return /* @__PURE__ */ jsxs6(
|
|
1598
|
-
"svg",
|
|
1599
|
-
{
|
|
1600
|
-
className: `rs-spinner ${className || ""}`,
|
|
1601
|
-
fill: "none",
|
|
1602
|
-
viewBox: "0 0 20 21",
|
|
1603
|
-
children: [
|
|
1604
|
-
/* @__PURE__ */ jsx7(
|
|
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__ */ jsx7(
|
|
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
|
-
|
|
1624
|
-
// src/core/session-owner.ts
|
|
1625
|
-
import { isAddress } from "viem";
|
|
1626
|
-
import {
|
|
1627
|
-
generatePrivateKey,
|
|
1628
|
-
privateKeyToAccount
|
|
1629
|
-
} from "viem/accounts";
|
|
1630
|
-
var STORAGE_PREFIX = "rhinestone:session-owner";
|
|
1631
|
-
function storageKey(eoaAddress) {
|
|
1632
|
-
return `${STORAGE_PREFIX}:${eoaAddress.toLowerCase()}`;
|
|
1633
|
-
}
|
|
1634
|
-
function loadSessionOwnerFromStorage(eoaAddress) {
|
|
1635
|
-
if (typeof window === "undefined") return null;
|
|
1636
|
-
const raw = window.localStorage.getItem(storageKey(eoaAddress));
|
|
1637
|
-
if (!raw) return null;
|
|
1638
|
-
try {
|
|
1639
|
-
const parsed = JSON.parse(raw);
|
|
1640
|
-
if (!parsed.privateKey) return null;
|
|
1641
|
-
const account = privateKeyToAccount(parsed.privateKey);
|
|
1642
|
-
return {
|
|
1643
|
-
privateKey: parsed.privateKey,
|
|
1644
|
-
address: account.address
|
|
1645
|
-
};
|
|
1646
|
-
} catch {
|
|
1647
|
-
return null;
|
|
1648
|
-
}
|
|
1649
|
-
}
|
|
1650
|
-
function saveSessionOwnerToStorage(eoaAddress, privateKey, address) {
|
|
1651
|
-
if (typeof window === "undefined") return;
|
|
1652
|
-
if (!isAddress(address)) return;
|
|
1653
|
-
const payload = {
|
|
1654
|
-
privateKey,
|
|
1655
|
-
address,
|
|
1656
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1657
|
-
};
|
|
1658
|
-
window.localStorage.setItem(storageKey(eoaAddress), JSON.stringify(payload));
|
|
1659
|
-
}
|
|
1660
|
-
function createSessionOwnerKey() {
|
|
1661
|
-
const privateKey = generatePrivateKey();
|
|
1662
|
-
const account = privateKeyToAccount(privateKey);
|
|
1663
|
-
return {
|
|
1664
|
-
privateKey,
|
|
1665
|
-
account,
|
|
1666
|
-
address: account.address
|
|
1667
|
-
};
|
|
1668
|
-
}
|
|
1669
|
-
function accountFromPrivateKey(privateKey) {
|
|
1670
|
-
return privateKeyToAccount(privateKey);
|
|
1671
|
-
}
|
|
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
|
-
|
|
1738
2018
|
// src/components/steps/ProcessingStep.tsx
|
|
1739
|
-
import { useEffect as useEffect4, useRef as useRef4, useState as useState2 } from "react";
|
|
2019
|
+
import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef4, useState as useState2 } from "react";
|
|
1740
2020
|
import { formatUnits } from "viem";
|
|
1741
2021
|
|
|
1742
2022
|
// src/components/ui/Button.tsx
|
|
1743
|
-
import { Fragment as
|
|
2023
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1744
2024
|
function Button({
|
|
1745
2025
|
children,
|
|
1746
2026
|
variant = "accent",
|
|
@@ -1760,19 +2040,19 @@ function Button({
|
|
|
1760
2040
|
className
|
|
1761
2041
|
].filter(Boolean).join(" ");
|
|
1762
2042
|
const showInlineLoadingText = loading && loadingText !== void 0;
|
|
1763
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ jsx15(
|
|
1764
2044
|
"button",
|
|
1765
2045
|
{
|
|
1766
2046
|
className: classes,
|
|
1767
2047
|
disabled: disabled || loading,
|
|
1768
2048
|
"aria-busy": loading || void 0,
|
|
1769
2049
|
...props,
|
|
1770
|
-
children: showInlineLoadingText ? /* @__PURE__ */
|
|
1771
|
-
/* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
] }) : /* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
loading && /* @__PURE__ */
|
|
2050
|
+
children: showInlineLoadingText ? /* @__PURE__ */ jsxs13("span", { className: "rs-button__loading-row", children: [
|
|
2051
|
+
/* @__PURE__ */ jsx15(Spinner, { className: "rs-spinner--sm" }),
|
|
2052
|
+
/* @__PURE__ */ jsx15("span", { children: loadingText })
|
|
2053
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2054
|
+
/* @__PURE__ */ jsx15("span", { className: loading ? "rs-button__content--hidden" : "", children }),
|
|
2055
|
+
loading && /* @__PURE__ */ jsx15("span", { className: "rs-button__spinner", children: /* @__PURE__ */ jsx15(Spinner, { className: "rs-spinner--sm" }) })
|
|
1776
2056
|
] })
|
|
1777
2057
|
}
|
|
1778
2058
|
);
|
|
@@ -1787,7 +2067,7 @@ import {
|
|
|
1787
2067
|
useCallback as useCallback2
|
|
1788
2068
|
} from "react";
|
|
1789
2069
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1790
|
-
import { jsx as
|
|
2070
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1791
2071
|
function Tooltip({ content, children, className }) {
|
|
1792
2072
|
const [open, setOpen] = useState(false);
|
|
1793
2073
|
const [position, setPosition] = useState(null);
|
|
@@ -1816,7 +2096,7 @@ function Tooltip({ content, children, className }) {
|
|
|
1816
2096
|
if (event.key === "Escape") setOpen(false);
|
|
1817
2097
|
}
|
|
1818
2098
|
document.addEventListener("mousedown", handleOutside);
|
|
1819
|
-
document.addEventListener("touchstart", handleOutside);
|
|
2099
|
+
document.addEventListener("touchstart", handleOutside, { passive: true });
|
|
1820
2100
|
document.addEventListener("keydown", handleKey);
|
|
1821
2101
|
window.addEventListener("scroll", updatePosition, true);
|
|
1822
2102
|
window.addEventListener("resize", updatePosition);
|
|
@@ -1828,7 +2108,7 @@ function Tooltip({ content, children, className }) {
|
|
|
1828
2108
|
window.removeEventListener("resize", updatePosition);
|
|
1829
2109
|
};
|
|
1830
2110
|
}, [open, updatePosition]);
|
|
1831
|
-
return /* @__PURE__ */
|
|
2111
|
+
return /* @__PURE__ */ jsxs14(
|
|
1832
2112
|
"span",
|
|
1833
2113
|
{
|
|
1834
2114
|
ref: triggerRef,
|
|
@@ -1836,7 +2116,7 @@ function Tooltip({ content, children, className }) {
|
|
|
1836
2116
|
onMouseEnter: () => setOpen(true),
|
|
1837
2117
|
onMouseLeave: () => setOpen(false),
|
|
1838
2118
|
children: [
|
|
1839
|
-
/* @__PURE__ */
|
|
2119
|
+
/* @__PURE__ */ jsx16(
|
|
1840
2120
|
"span",
|
|
1841
2121
|
{
|
|
1842
2122
|
className: "rs-tooltip-trigger",
|
|
@@ -1858,7 +2138,7 @@ function Tooltip({ content, children, className }) {
|
|
|
1858
2138
|
}
|
|
1859
2139
|
),
|
|
1860
2140
|
open && position && typeof document !== "undefined" && createPortal2(
|
|
1861
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx16(
|
|
1862
2142
|
"span",
|
|
1863
2143
|
{
|
|
1864
2144
|
ref: bubbleRef,
|
|
@@ -1876,6 +2156,46 @@ function Tooltip({ content, children, className }) {
|
|
|
1876
2156
|
}
|
|
1877
2157
|
Tooltip.displayName = "Tooltip";
|
|
1878
2158
|
|
|
2159
|
+
// src/components/ui/Callout.tsx
|
|
2160
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2161
|
+
function CircleAlertIcon() {
|
|
2162
|
+
return /* @__PURE__ */ jsx17(
|
|
2163
|
+
"svg",
|
|
2164
|
+
{
|
|
2165
|
+
width: "16",
|
|
2166
|
+
height: "16",
|
|
2167
|
+
viewBox: "0 0 16 16",
|
|
2168
|
+
fill: "none",
|
|
2169
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2170
|
+
"aria-hidden": "true",
|
|
2171
|
+
children: /* @__PURE__ */ jsx17(
|
|
2172
|
+
"path",
|
|
2173
|
+
{
|
|
2174
|
+
d: "M10 5.99L6 9.99M6 5.99L10 9.99M14.66 7.99C14.66 11.68 11.68 14.66 8 14.66C4.31 14.66 1.33 11.68 1.33 7.99C1.33 4.31 4.31 1.33 8 1.33C11.68 1.33 14.66 4.31 14.66 7.99Z",
|
|
2175
|
+
stroke: "currentColor",
|
|
2176
|
+
strokeWidth: "1.33",
|
|
2177
|
+
strokeLinecap: "round",
|
|
2178
|
+
strokeLinejoin: "round"
|
|
2179
|
+
}
|
|
2180
|
+
)
|
|
2181
|
+
}
|
|
2182
|
+
);
|
|
2183
|
+
}
|
|
2184
|
+
function Callout({ variant = "error", children, role }) {
|
|
2185
|
+
return /* @__PURE__ */ jsxs15(
|
|
2186
|
+
"div",
|
|
2187
|
+
{
|
|
2188
|
+
className: `rs-callout rs-callout--${variant}`,
|
|
2189
|
+
role: role ?? (variant === "error" ? "alert" : "status"),
|
|
2190
|
+
children: [
|
|
2191
|
+
/* @__PURE__ */ jsx17("span", { className: "rs-callout-icon", children: variant === "error" ? /* @__PURE__ */ jsx17(CircleAlertIcon, {}) : /* @__PURE__ */ jsx17(AlertTriangleIcon, {}) }),
|
|
2192
|
+
/* @__PURE__ */ jsx17("span", { className: "rs-callout-text", children })
|
|
2193
|
+
]
|
|
2194
|
+
}
|
|
2195
|
+
);
|
|
2196
|
+
}
|
|
2197
|
+
Callout.displayName = "Callout";
|
|
2198
|
+
|
|
1879
2199
|
// src/core/webhook.ts
|
|
1880
2200
|
function isRecord(value) {
|
|
1881
2201
|
return typeof value === "object" && value !== null;
|
|
@@ -1962,7 +2282,67 @@ function txRefsMatch(a, b) {
|
|
|
1962
2282
|
}
|
|
1963
2283
|
|
|
1964
2284
|
// src/components/steps/ProcessingStep.tsx
|
|
1965
|
-
import { jsx as
|
|
2285
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2286
|
+
function SuccessBadge() {
|
|
2287
|
+
return /* @__PURE__ */ jsxs16(
|
|
2288
|
+
"svg",
|
|
2289
|
+
{
|
|
2290
|
+
width: "40",
|
|
2291
|
+
height: "40",
|
|
2292
|
+
viewBox: "0 0 40 40",
|
|
2293
|
+
fill: "none",
|
|
2294
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2295
|
+
"aria-hidden": "true",
|
|
2296
|
+
children: [
|
|
2297
|
+
/* @__PURE__ */ jsx18(
|
|
2298
|
+
"rect",
|
|
2299
|
+
{
|
|
2300
|
+
width: "40",
|
|
2301
|
+
height: "40",
|
|
2302
|
+
rx: "8",
|
|
2303
|
+
fill: "var(--rs-icon-wrapper-bg)"
|
|
2304
|
+
}
|
|
2305
|
+
),
|
|
2306
|
+
/* @__PURE__ */ jsx18(
|
|
2307
|
+
"path",
|
|
2308
|
+
{
|
|
2309
|
+
d: "M28 14L17 25L12 20",
|
|
2310
|
+
stroke: "var(--rs-icon-wrapper-icon)",
|
|
2311
|
+
strokeWidth: "2",
|
|
2312
|
+
strokeLinecap: "round",
|
|
2313
|
+
strokeLinejoin: "round"
|
|
2314
|
+
}
|
|
2315
|
+
)
|
|
2316
|
+
]
|
|
2317
|
+
}
|
|
2318
|
+
);
|
|
2319
|
+
}
|
|
2320
|
+
function FailedBadge() {
|
|
2321
|
+
return /* @__PURE__ */ jsxs16(
|
|
2322
|
+
"svg",
|
|
2323
|
+
{
|
|
2324
|
+
width: "40",
|
|
2325
|
+
height: "40",
|
|
2326
|
+
viewBox: "0 0 40 40",
|
|
2327
|
+
fill: "none",
|
|
2328
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2329
|
+
"aria-hidden": "true",
|
|
2330
|
+
children: [
|
|
2331
|
+
/* @__PURE__ */ jsx18("rect", { width: "40", height: "40", rx: "8", fill: "#FB2C36" }),
|
|
2332
|
+
/* @__PURE__ */ jsx18(
|
|
2333
|
+
"path",
|
|
2334
|
+
{
|
|
2335
|
+
d: "M26 14L14 26M14 14L26 26",
|
|
2336
|
+
stroke: "white",
|
|
2337
|
+
strokeWidth: "2",
|
|
2338
|
+
strokeLinecap: "round",
|
|
2339
|
+
strokeLinejoin: "round"
|
|
2340
|
+
}
|
|
2341
|
+
)
|
|
2342
|
+
]
|
|
2343
|
+
}
|
|
2344
|
+
);
|
|
2345
|
+
}
|
|
1966
2346
|
var INITIAL_POLL_INTERVAL = 3e3;
|
|
1967
2347
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1968
2348
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
@@ -2051,11 +2431,35 @@ function syncPhaseTimings(previous, event) {
|
|
|
2051
2431
|
...setCompleted && { completedAt: timestamp }
|
|
2052
2432
|
};
|
|
2053
2433
|
}
|
|
2054
|
-
function
|
|
2055
|
-
|
|
2056
|
-
const mins = Math.floor(
|
|
2057
|
-
const secs =
|
|
2058
|
-
return `${mins}
|
|
2434
|
+
function formatTimer(seconds) {
|
|
2435
|
+
const safe = Math.max(0, seconds);
|
|
2436
|
+
const mins = Math.floor(safe / 60);
|
|
2437
|
+
const secs = safe % 60;
|
|
2438
|
+
return `${mins}:${String(secs).padStart(2, "0")}`;
|
|
2439
|
+
}
|
|
2440
|
+
function TickerChar({ value }) {
|
|
2441
|
+
const [current, setCurrent] = useState2(value);
|
|
2442
|
+
const [previous, setPrevious] = useState2(null);
|
|
2443
|
+
const [animKey, setAnimKey] = useState2(0);
|
|
2444
|
+
useEffect4(() => {
|
|
2445
|
+
if (value === current) return;
|
|
2446
|
+
setPrevious(current);
|
|
2447
|
+
setCurrent(value);
|
|
2448
|
+
setAnimKey((k) => k + 1);
|
|
2449
|
+
const timeout = setTimeout(() => setPrevious(null), 360);
|
|
2450
|
+
return () => clearTimeout(timeout);
|
|
2451
|
+
}, [value, current]);
|
|
2452
|
+
return /* @__PURE__ */ jsxs16("span", { className: "rs-ticker-slot", children: [
|
|
2453
|
+
previous !== null && /* @__PURE__ */ jsx18("span", { className: "rs-ticker-out", children: previous }, `out-${animKey}`),
|
|
2454
|
+
/* @__PURE__ */ jsx18("span", { className: "rs-ticker-in", children: current }, `in-${animKey}`)
|
|
2455
|
+
] });
|
|
2456
|
+
}
|
|
2457
|
+
function Ticker({ value }) {
|
|
2458
|
+
return /* @__PURE__ */ jsx18("span", { className: "rs-ticker", "aria-label": value, children: value.split("").map((char, index) => (
|
|
2459
|
+
// Position-stable key so each slot keeps its own animation state.
|
|
2460
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
2461
|
+
/* @__PURE__ */ jsx18(TickerChar, { value: char }, index)
|
|
2462
|
+
)) });
|
|
2059
2463
|
}
|
|
2060
2464
|
function getPhaseStartTime(phaseId, phaseTimings) {
|
|
2061
2465
|
if (phaseId === "confirming") return phaseTimings.startedAt;
|
|
@@ -2069,13 +2473,10 @@ function getFailedPhaseId(phaseTimings) {
|
|
|
2069
2473
|
if (phaseTimings.receivedAt !== void 0) return "received";
|
|
2070
2474
|
return "confirming";
|
|
2071
2475
|
}
|
|
2072
|
-
function getCurrentPhaseId(state, phaseTimings
|
|
2476
|
+
function getCurrentPhaseId(state, phaseTimings) {
|
|
2073
2477
|
if (state.type === "failed") {
|
|
2074
2478
|
return getFailedPhaseId(phaseTimings);
|
|
2075
2479
|
}
|
|
2076
|
-
if (isEarlyComplete) {
|
|
2077
|
-
return "bridging";
|
|
2078
|
-
}
|
|
2079
2480
|
if (state.type === "complete") {
|
|
2080
2481
|
return void 0;
|
|
2081
2482
|
}
|
|
@@ -2094,7 +2495,6 @@ function ProcessingStep({
|
|
|
2094
2495
|
amount,
|
|
2095
2496
|
sourceSymbol: providedSourceSymbol,
|
|
2096
2497
|
sourceDecimals: providedSourceDecimals,
|
|
2097
|
-
waitForFinalTx,
|
|
2098
2498
|
hasPostBridgeActions,
|
|
2099
2499
|
service,
|
|
2100
2500
|
directTransfer,
|
|
@@ -2102,7 +2502,6 @@ function ProcessingStep({
|
|
|
2102
2502
|
debug,
|
|
2103
2503
|
targetToken,
|
|
2104
2504
|
uiConfig,
|
|
2105
|
-
estimatedTime = "< 1 min",
|
|
2106
2505
|
quotedFeeAmount = "0.1",
|
|
2107
2506
|
quotedFeeSymbol,
|
|
2108
2507
|
balanceAfterUsd,
|
|
@@ -2123,7 +2522,6 @@ function ProcessingStep({
|
|
|
2123
2522
|
sourceToken,
|
|
2124
2523
|
targetChain,
|
|
2125
2524
|
targetToken,
|
|
2126
|
-
waitForFinalTx,
|
|
2127
2525
|
hasPostBridgeActions
|
|
2128
2526
|
});
|
|
2129
2527
|
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
@@ -2142,14 +2540,24 @@ function ProcessingStep({
|
|
|
2142
2540
|
return { startedAt: startTimeRef.current };
|
|
2143
2541
|
});
|
|
2144
2542
|
const [hasEscalatedDelay, setHasEscalatedDelay] = useState2(false);
|
|
2543
|
+
const updatePhaseTimings = useCallback3(
|
|
2544
|
+
(updater) => {
|
|
2545
|
+
setPhaseTimings((previous) => {
|
|
2546
|
+
const next = updater(previous);
|
|
2547
|
+
savePhaseTimings(txHash, next);
|
|
2548
|
+
return next;
|
|
2549
|
+
});
|
|
2550
|
+
},
|
|
2551
|
+
[txHash]
|
|
2552
|
+
);
|
|
2145
2553
|
useEffect4(() => {
|
|
2146
2554
|
if (!directTransfer) return;
|
|
2147
2555
|
const completedAt = Date.now();
|
|
2148
|
-
|
|
2556
|
+
updatePhaseTimings(() => ({
|
|
2149
2557
|
startedAt: startTimeRef.current,
|
|
2150
2558
|
completedAt,
|
|
2151
2559
|
endedAt: completedAt
|
|
2152
|
-
});
|
|
2560
|
+
}));
|
|
2153
2561
|
debugLog(debug, "processing", "direct-transfer:complete", {
|
|
2154
2562
|
txHash,
|
|
2155
2563
|
flowLabel
|
|
@@ -2168,7 +2576,8 @@ function ProcessingStep({
|
|
|
2168
2576
|
flowLabel,
|
|
2169
2577
|
onDepositCompleteRef,
|
|
2170
2578
|
processingContextRef,
|
|
2171
|
-
txHash
|
|
2579
|
+
txHash,
|
|
2580
|
+
updatePhaseTimings
|
|
2172
2581
|
]);
|
|
2173
2582
|
useEffect4(() => {
|
|
2174
2583
|
if (directTransfer || state.type !== "processing") return;
|
|
@@ -2185,17 +2594,16 @@ function ProcessingStep({
|
|
|
2185
2594
|
if (state.type === "processing") return;
|
|
2186
2595
|
const endedAt = state.type === "complete" ? phaseTimings.completedAt ?? Date.now() : Date.now();
|
|
2187
2596
|
setElapsedSeconds(Math.floor((endedAt - startTimeRef.current) / 1e3));
|
|
2188
|
-
|
|
2597
|
+
updatePhaseTimings(
|
|
2189
2598
|
(previous) => previous.endedAt !== void 0 ? previous : { ...previous, endedAt }
|
|
2190
2599
|
);
|
|
2191
|
-
}, [phaseTimings.completedAt, state.type]);
|
|
2600
|
+
}, [phaseTimings.completedAt, state.type, updatePhaseTimings]);
|
|
2192
2601
|
useEffect4(() => {
|
|
2193
2602
|
if (!state.lastEvent) return;
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
}, [txHash, phaseTimings]);
|
|
2603
|
+
updatePhaseTimings(
|
|
2604
|
+
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
2605
|
+
);
|
|
2606
|
+
}, [state.lastEvent?.time, state.lastEvent?.type, updatePhaseTimings]);
|
|
2199
2607
|
useEffect4(() => {
|
|
2200
2608
|
if (directTransfer) return;
|
|
2201
2609
|
if (state.type !== "processing") {
|
|
@@ -2224,7 +2632,7 @@ function ProcessingStep({
|
|
|
2224
2632
|
});
|
|
2225
2633
|
}
|
|
2226
2634
|
if (!isMounted) return;
|
|
2227
|
-
const awaitingPostBridgeSwap = processingContextRef.current.
|
|
2635
|
+
const awaitingPostBridgeSwap = processingContextRef.current.hasPostBridgeActions;
|
|
2228
2636
|
if (eventForCurrentTx?.type === "post-bridge-swap-complete") {
|
|
2229
2637
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2230
2638
|
const swapTxHash = eventForCurrentTx.data?.swap?.transactionHash;
|
|
@@ -2276,22 +2684,6 @@ function ProcessingStep({
|
|
|
2276
2684
|
});
|
|
2277
2685
|
return;
|
|
2278
2686
|
}
|
|
2279
|
-
if (!waitForFinalTx && eventForCurrentTx?.type === "bridge-started") {
|
|
2280
|
-
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2281
|
-
debugLog(debug, "processing", "state:early-complete", {
|
|
2282
|
-
txHash,
|
|
2283
|
-
event: eventForCurrentTx.type
|
|
2284
|
-
});
|
|
2285
|
-
const context = processingContextRef.current;
|
|
2286
|
-
onDepositCompleteRef.current?.(txHash, void 0, {
|
|
2287
|
-
amount: context.amount,
|
|
2288
|
-
sourceChain: context.sourceChain,
|
|
2289
|
-
sourceToken: context.sourceToken,
|
|
2290
|
-
targetChain: context.targetChain,
|
|
2291
|
-
targetToken: context.targetToken
|
|
2292
|
-
});
|
|
2293
|
-
return;
|
|
2294
|
-
}
|
|
2295
2687
|
if (eventForCurrentTx?.type === "bridge-failed") {
|
|
2296
2688
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
2297
2689
|
setState({
|
|
@@ -2388,7 +2780,6 @@ function ProcessingStep({
|
|
|
2388
2780
|
const isProcessing = state.type === "processing";
|
|
2389
2781
|
const lastEvent = state.lastEvent;
|
|
2390
2782
|
const failureMessage = state.type === "failed" ? state.message : void 0;
|
|
2391
|
-
const isEarlyComplete = !waitForFinalTx && lastEvent?.type === "bridge-started";
|
|
2392
2783
|
const timelineNowMs = phaseTimings.endedAt ?? Date.now();
|
|
2393
2784
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
2394
2785
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
@@ -2411,24 +2802,26 @@ function ProcessingStep({
|
|
|
2411
2802
|
const raw = formatUnits(BigInt(displayAmount), sourceDecimals);
|
|
2412
2803
|
const numeric = Number(raw);
|
|
2413
2804
|
if (!Number.isFinite(numeric)) return raw;
|
|
2414
|
-
return numeric.toLocaleString("en-US", {
|
|
2805
|
+
return numeric.toLocaleString("en-US", {
|
|
2806
|
+
minimumFractionDigits: 2,
|
|
2807
|
+
maximumFractionDigits: 6
|
|
2808
|
+
});
|
|
2415
2809
|
} catch {
|
|
2416
2810
|
return Number(displayAmount).toLocaleString("en-US", {
|
|
2811
|
+
minimumFractionDigits: 2,
|
|
2417
2812
|
maximumFractionDigits: 6
|
|
2418
2813
|
});
|
|
2419
2814
|
}
|
|
2420
2815
|
})();
|
|
2421
|
-
const currentPhaseId = getCurrentPhaseId(state, phaseTimings
|
|
2816
|
+
const currentPhaseId = getCurrentPhaseId(state, phaseTimings);
|
|
2422
2817
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
2423
2818
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
2424
2819
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
2425
2820
|
void delayPhaseId;
|
|
2426
2821
|
void hasEscalatedDelay;
|
|
2427
2822
|
const targetSymbol = (() => {
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
}
|
|
2431
|
-
return providedSourceSymbol ?? "USDC";
|
|
2823
|
+
const resolved = getTargetTokenSymbol(targetToken, targetChain);
|
|
2824
|
+
return resolved !== "Token" ? resolved : providedSourceSymbol ?? "USDC";
|
|
2432
2825
|
})();
|
|
2433
2826
|
const targetTokenIcon = getTokenIcon(targetSymbol);
|
|
2434
2827
|
const sourceChainIcon = getChainIcon(displaySourceChain);
|
|
@@ -2436,134 +2829,418 @@ function ProcessingStep({
|
|
|
2436
2829
|
const sourceTokenIcon = getTokenIcon(sourceSymbol);
|
|
2437
2830
|
const sourceChainName = getChainName(displaySourceChain);
|
|
2438
2831
|
const targetChainName = getChainName(targetChain);
|
|
2439
|
-
const
|
|
2440
|
-
const feeSymbol = quotedFeeSymbol ?? sourceSymbol;
|
|
2832
|
+
const timerText = formatTimer(elapsedSeconds);
|
|
2441
2833
|
const feeSponsored = uiConfig?.feeSponsored ?? false;
|
|
2442
2834
|
const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
|
|
2443
2835
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
2444
|
-
const stateVariant = isComplete ? "success" : isFailed ? "error" : "default";
|
|
2445
|
-
const stateIcon = isComplete ? /* @__PURE__ */ jsx10(CheckIcon, {}) : isFailed ? /* @__PURE__ */ jsx10(CloseIcon, {}) : /* @__PURE__ */ jsx10(WalletIcon, {});
|
|
2446
2836
|
const handleRetry = onRetry ?? onNewDeposit;
|
|
2447
|
-
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
sourceChainIcon && /* @__PURE__ */
|
|
2463
|
-
sourceExplorerUrl && /* @__PURE__ */
|
|
2837
|
+
const headerContent = isComplete ? /* @__PURE__ */ jsxs16("div", { className: "rs-body-header", children: [
|
|
2838
|
+
/* @__PURE__ */ jsx18(SuccessBadge, {}),
|
|
2839
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx18("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
2840
|
+
] }) : isFailed ? /* @__PURE__ */ jsxs16("div", { className: "rs-body-header", children: [
|
|
2841
|
+
/* @__PURE__ */ jsx18(FailedBadge, {}),
|
|
2842
|
+
/* @__PURE__ */ jsx18("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx18("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
2843
|
+
] }) : /* @__PURE__ */ jsx18(BodyHeader, { icon: /* @__PURE__ */ jsx18(WalletIcon, {}), title: stateTitle });
|
|
2844
|
+
return /* @__PURE__ */ jsxs16("div", { className: "rs-screen", children: [
|
|
2845
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2846
|
+
headerContent,
|
|
2847
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-details", children: [
|
|
2848
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2849
|
+
/* @__PURE__ */ jsx18("span", { children: "Source chain" }),
|
|
2850
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2851
|
+
/* @__PURE__ */ jsx18("span", { children: sourceChainName }),
|
|
2852
|
+
sourceChainIcon && /* @__PURE__ */ jsx18("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: sourceChainIcon, alt: "" }) }),
|
|
2853
|
+
sourceExplorerUrl && /* @__PURE__ */ jsx18(
|
|
2464
2854
|
"a",
|
|
2465
2855
|
{
|
|
2466
2856
|
href: sourceExplorerUrl,
|
|
2467
2857
|
target: "_blank",
|
|
2468
2858
|
rel: "noopener noreferrer",
|
|
2469
|
-
className: "rs-
|
|
2859
|
+
className: "rs-review-detail-link",
|
|
2470
2860
|
"aria-label": "View source transaction",
|
|
2471
|
-
children: /* @__PURE__ */
|
|
2861
|
+
children: /* @__PURE__ */ jsx18(ExternalLinkIcon, {})
|
|
2472
2862
|
}
|
|
2473
2863
|
)
|
|
2474
2864
|
] })
|
|
2475
2865
|
] }),
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
/* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
targetChainIcon && /* @__PURE__ */
|
|
2481
|
-
destExplorerUrl && /* @__PURE__ */
|
|
2866
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2867
|
+
/* @__PURE__ */ jsx18("span", { children: "Destination chain" }),
|
|
2868
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2869
|
+
/* @__PURE__ */ jsx18("span", { children: targetChainName }),
|
|
2870
|
+
targetChainIcon && /* @__PURE__ */ jsx18("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: targetChainIcon, alt: "" }) }),
|
|
2871
|
+
destExplorerUrl && /* @__PURE__ */ jsx18(
|
|
2482
2872
|
"a",
|
|
2483
2873
|
{
|
|
2484
2874
|
href: destExplorerUrl,
|
|
2485
2875
|
target: "_blank",
|
|
2486
2876
|
rel: "noopener noreferrer",
|
|
2487
|
-
className: "rs-
|
|
2877
|
+
className: "rs-review-detail-link",
|
|
2488
2878
|
"aria-label": "View destination transaction",
|
|
2489
|
-
children: /* @__PURE__ */
|
|
2879
|
+
children: /* @__PURE__ */ jsx18(ExternalLinkIcon, {})
|
|
2490
2880
|
}
|
|
2491
2881
|
)
|
|
2492
2882
|
] })
|
|
2493
2883
|
] }),
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2885
|
+
/* @__PURE__ */ jsx18("span", { children: isProcessing ? "Time elapsed" : "Total time" }),
|
|
2886
|
+
/* @__PURE__ */ jsx18("span", { className: "rs-review-detail-value", children: /* @__PURE__ */ jsx18(Ticker, { value: timerText }) })
|
|
2497
2887
|
] }),
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2889
|
+
/* @__PURE__ */ jsx18("span", { children: "You send" }),
|
|
2890
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2891
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
2502
2892
|
formattedReceivedAmount,
|
|
2503
2893
|
" ",
|
|
2504
2894
|
sourceSymbol
|
|
2505
2895
|
] }),
|
|
2506
|
-
sourceTokenIcon && /* @__PURE__ */
|
|
2896
|
+
sourceTokenIcon && /* @__PURE__ */ jsx18("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: sourceTokenIcon, alt: "" }) })
|
|
2507
2897
|
] })
|
|
2508
2898
|
] }),
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2900
|
+
/* @__PURE__ */ jsx18("span", { children: "Receive" }),
|
|
2901
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2902
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
2513
2903
|
"~",
|
|
2514
2904
|
formattedReceivedAmount,
|
|
2515
2905
|
" ",
|
|
2516
2906
|
targetSymbol
|
|
2517
2907
|
] }),
|
|
2518
|
-
targetTokenIcon && /* @__PURE__ */
|
|
2908
|
+
targetTokenIcon && /* @__PURE__ */ jsx18("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: targetTokenIcon, alt: "" }) })
|
|
2519
2909
|
] })
|
|
2520
2910
|
] }),
|
|
2521
|
-
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2911
|
+
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2912
|
+
/* @__PURE__ */ jsx18("span", { children: "Balance" }),
|
|
2913
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2524
2914
|
"$",
|
|
2525
2915
|
balanceAfterUsd.toFixed(2)
|
|
2526
2916
|
] })
|
|
2527
2917
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsxs16("div", { className: "rs-review-detail-row", children: [
|
|
2919
|
+
/* @__PURE__ */ jsx18("span", { children: "Fees" }),
|
|
2920
|
+
/* @__PURE__ */ jsxs16("span", { className: "rs-review-detail-value", children: [
|
|
2921
|
+
/* @__PURE__ */ jsx18(
|
|
2532
2922
|
"span",
|
|
2533
2923
|
{
|
|
2534
2924
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
2535
|
-
children:
|
|
2536
|
-
quotedFeeAmount,
|
|
2537
|
-
" ",
|
|
2538
|
-
feeSymbol
|
|
2539
|
-
]
|
|
2925
|
+
children: "$0.04"
|
|
2540
2926
|
}
|
|
2541
2927
|
),
|
|
2542
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsx18(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx18("span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ jsx18(InfoIcon, {}) }) })
|
|
2543
2929
|
] })
|
|
2544
2930
|
] })
|
|
2545
2931
|
] }),
|
|
2546
|
-
isFailed && failureMessage && /* @__PURE__ */
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2932
|
+
isFailed && failureMessage && /* @__PURE__ */ jsx18(Callout, { variant: "error", children: failureMessage }),
|
|
2933
|
+
isProcessing && /* @__PURE__ */ jsx18(
|
|
2934
|
+
Button,
|
|
2935
|
+
{
|
|
2936
|
+
fullWidth: true,
|
|
2937
|
+
disabled: true,
|
|
2938
|
+
loading: true,
|
|
2939
|
+
loadingText: "Submitting transaction\u2026",
|
|
2940
|
+
children: "Submitting transaction\u2026"
|
|
2941
|
+
}
|
|
2942
|
+
),
|
|
2943
|
+
isComplete && /* @__PURE__ */ jsxs16("div", { className: "rs-screen-button-row", children: [
|
|
2944
|
+
onNewDeposit && /* @__PURE__ */ jsxs16(Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
2553
2945
|
"New ",
|
|
2554
2946
|
flowNoun
|
|
2555
2947
|
] }),
|
|
2556
|
-
onClose && /* @__PURE__ */
|
|
2948
|
+
onClose && /* @__PURE__ */ jsx18(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
2557
2949
|
] }),
|
|
2558
|
-
isFailed && /* @__PURE__ */
|
|
2559
|
-
onClose && /* @__PURE__ */
|
|
2560
|
-
handleRetry && /* @__PURE__ */
|
|
2950
|
+
isFailed && /* @__PURE__ */ jsxs16("div", { className: "rs-screen-button-row", children: [
|
|
2951
|
+
onClose && /* @__PURE__ */ jsx18(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
2952
|
+
handleRetry && /* @__PURE__ */ jsx18(Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
2561
2953
|
] })
|
|
2562
2954
|
] }),
|
|
2563
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ jsx18(PoweredBy, {})
|
|
2564
2956
|
] });
|
|
2565
2957
|
}
|
|
2566
2958
|
|
|
2959
|
+
// src/core/safe.ts
|
|
2960
|
+
import {
|
|
2961
|
+
concat,
|
|
2962
|
+
encodeFunctionData,
|
|
2963
|
+
erc20Abi,
|
|
2964
|
+
hashTypedData,
|
|
2965
|
+
pad,
|
|
2966
|
+
parseEventLogs,
|
|
2967
|
+
toHex,
|
|
2968
|
+
zeroAddress
|
|
2969
|
+
} from "viem";
|
|
2970
|
+
var SAFE_ABI = [
|
|
2971
|
+
{
|
|
2972
|
+
type: "function",
|
|
2973
|
+
name: "isOwner",
|
|
2974
|
+
stateMutability: "view",
|
|
2975
|
+
inputs: [{ name: "owner", type: "address" }],
|
|
2976
|
+
outputs: [{ name: "", type: "bool" }]
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
type: "function",
|
|
2980
|
+
name: "nonce",
|
|
2981
|
+
stateMutability: "view",
|
|
2982
|
+
inputs: [],
|
|
2983
|
+
outputs: [{ type: "uint256" }]
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
type: "function",
|
|
2987
|
+
name: "execTransaction",
|
|
2988
|
+
stateMutability: "payable",
|
|
2989
|
+
inputs: [
|
|
2990
|
+
{ name: "to", type: "address" },
|
|
2991
|
+
{ name: "value", type: "uint256" },
|
|
2992
|
+
{ name: "data", type: "bytes" },
|
|
2993
|
+
{ name: "operation", type: "uint8" },
|
|
2994
|
+
{ name: "safeTxGas", type: "uint256" },
|
|
2995
|
+
{ name: "baseGas", type: "uint256" },
|
|
2996
|
+
{ name: "gasPrice", type: "uint256" },
|
|
2997
|
+
{ name: "gasToken", type: "address" },
|
|
2998
|
+
{ name: "refundReceiver", type: "address" },
|
|
2999
|
+
{ name: "signatures", type: "bytes" }
|
|
3000
|
+
],
|
|
3001
|
+
outputs: [{ name: "success", type: "bool" }]
|
|
3002
|
+
},
|
|
3003
|
+
{
|
|
3004
|
+
type: "event",
|
|
3005
|
+
name: "ExecutionSuccess",
|
|
3006
|
+
inputs: [
|
|
3007
|
+
{ name: "txHash", type: "bytes32", indexed: true },
|
|
3008
|
+
{ name: "payment", type: "uint256", indexed: false }
|
|
3009
|
+
],
|
|
3010
|
+
anonymous: false
|
|
3011
|
+
},
|
|
3012
|
+
{
|
|
3013
|
+
type: "event",
|
|
3014
|
+
name: "ExecutionFailure",
|
|
3015
|
+
inputs: [
|
|
3016
|
+
{ name: "txHash", type: "bytes32", indexed: true },
|
|
3017
|
+
{ name: "payment", type: "uint256", indexed: false }
|
|
3018
|
+
],
|
|
3019
|
+
anonymous: false
|
|
3020
|
+
}
|
|
3021
|
+
];
|
|
3022
|
+
async function executeSafeEthTransfer(params) {
|
|
3023
|
+
const {
|
|
3024
|
+
walletClient,
|
|
3025
|
+
publicClient,
|
|
3026
|
+
safeAddress,
|
|
3027
|
+
recipient,
|
|
3028
|
+
amount,
|
|
3029
|
+
chainId
|
|
3030
|
+
} = params;
|
|
3031
|
+
const account = walletClient.account;
|
|
3032
|
+
const chain = walletClient.chain;
|
|
3033
|
+
if (!account || !chain) {
|
|
3034
|
+
throw new Error("Wallet not connected");
|
|
3035
|
+
}
|
|
3036
|
+
if (chain.id !== chainId) {
|
|
3037
|
+
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
3038
|
+
}
|
|
3039
|
+
const isOwner = await publicClient.readContract({
|
|
3040
|
+
address: safeAddress,
|
|
3041
|
+
abi: SAFE_ABI,
|
|
3042
|
+
functionName: "isOwner",
|
|
3043
|
+
args: [account.address]
|
|
3044
|
+
});
|
|
3045
|
+
if (!isOwner) {
|
|
3046
|
+
throw new Error("Connected wallet is not a Safe owner");
|
|
3047
|
+
}
|
|
3048
|
+
const safeTx = {
|
|
3049
|
+
to: recipient,
|
|
3050
|
+
value: amount,
|
|
3051
|
+
data: "0x",
|
|
3052
|
+
operation: 0,
|
|
3053
|
+
safeTxGas: 0n,
|
|
3054
|
+
baseGas: 0n,
|
|
3055
|
+
gasPrice: 0n,
|
|
3056
|
+
gasToken: zeroAddress,
|
|
3057
|
+
refundReceiver: zeroAddress
|
|
3058
|
+
};
|
|
3059
|
+
const signature = concat([
|
|
3060
|
+
pad(account.address, { size: 32 }),
|
|
3061
|
+
pad(toHex(0), { size: 32 }),
|
|
3062
|
+
toHex(1, { size: 1 })
|
|
3063
|
+
]);
|
|
3064
|
+
const txHash = await walletClient.writeContract({
|
|
3065
|
+
account,
|
|
3066
|
+
chain,
|
|
3067
|
+
address: safeAddress,
|
|
3068
|
+
abi: SAFE_ABI,
|
|
3069
|
+
functionName: "execTransaction",
|
|
3070
|
+
args: [
|
|
3071
|
+
safeTx.to,
|
|
3072
|
+
safeTx.value,
|
|
3073
|
+
safeTx.data,
|
|
3074
|
+
safeTx.operation,
|
|
3075
|
+
safeTx.safeTxGas,
|
|
3076
|
+
safeTx.baseGas,
|
|
3077
|
+
safeTx.gasPrice,
|
|
3078
|
+
safeTx.gasToken,
|
|
3079
|
+
safeTx.refundReceiver,
|
|
3080
|
+
signature
|
|
3081
|
+
]
|
|
3082
|
+
});
|
|
3083
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
3084
|
+
hash: txHash
|
|
3085
|
+
});
|
|
3086
|
+
const safeLogs = receipt.logs.filter(
|
|
3087
|
+
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3088
|
+
);
|
|
3089
|
+
const parsed = parseEventLogs({
|
|
3090
|
+
abi: SAFE_ABI,
|
|
3091
|
+
logs: safeLogs,
|
|
3092
|
+
strict: false
|
|
3093
|
+
});
|
|
3094
|
+
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
3095
|
+
if (failed) {
|
|
3096
|
+
throw new Error("Safe transaction failed");
|
|
3097
|
+
}
|
|
3098
|
+
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
3099
|
+
if (!succeeded) {
|
|
3100
|
+
throw new Error("Safe transaction status unavailable");
|
|
3101
|
+
}
|
|
3102
|
+
return { txHash };
|
|
3103
|
+
}
|
|
3104
|
+
async function executeSafeErc20Transfer(params) {
|
|
3105
|
+
const {
|
|
3106
|
+
walletClient,
|
|
3107
|
+
publicClient,
|
|
3108
|
+
safeAddress,
|
|
3109
|
+
tokenAddress,
|
|
3110
|
+
recipient,
|
|
3111
|
+
amount,
|
|
3112
|
+
chainId
|
|
3113
|
+
} = params;
|
|
3114
|
+
const account = walletClient.account;
|
|
3115
|
+
const chain = walletClient.chain;
|
|
3116
|
+
if (!account || !chain) {
|
|
3117
|
+
throw new Error("Wallet not connected");
|
|
3118
|
+
}
|
|
3119
|
+
if (chain.id !== chainId) {
|
|
3120
|
+
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
3121
|
+
}
|
|
3122
|
+
const isOwner = await publicClient.readContract({
|
|
3123
|
+
address: safeAddress,
|
|
3124
|
+
abi: SAFE_ABI,
|
|
3125
|
+
functionName: "isOwner",
|
|
3126
|
+
args: [account.address]
|
|
3127
|
+
});
|
|
3128
|
+
if (!isOwner) {
|
|
3129
|
+
throw new Error("Connected wallet is not a Safe owner");
|
|
3130
|
+
}
|
|
3131
|
+
const data = encodeFunctionData({
|
|
3132
|
+
abi: erc20Abi,
|
|
3133
|
+
functionName: "transfer",
|
|
3134
|
+
args: [recipient, amount]
|
|
3135
|
+
});
|
|
3136
|
+
const safeTx = {
|
|
3137
|
+
to: tokenAddress,
|
|
3138
|
+
value: 0n,
|
|
3139
|
+
data,
|
|
3140
|
+
operation: 0,
|
|
3141
|
+
safeTxGas: 0n,
|
|
3142
|
+
baseGas: 0n,
|
|
3143
|
+
gasPrice: 0n,
|
|
3144
|
+
gasToken: zeroAddress,
|
|
3145
|
+
refundReceiver: zeroAddress
|
|
3146
|
+
};
|
|
3147
|
+
const signature = concat([
|
|
3148
|
+
pad(account.address, { size: 32 }),
|
|
3149
|
+
pad(toHex(0), { size: 32 }),
|
|
3150
|
+
toHex(1, { size: 1 })
|
|
3151
|
+
]);
|
|
3152
|
+
const txHash = await walletClient.writeContract({
|
|
3153
|
+
account,
|
|
3154
|
+
chain,
|
|
3155
|
+
address: safeAddress,
|
|
3156
|
+
abi: SAFE_ABI,
|
|
3157
|
+
functionName: "execTransaction",
|
|
3158
|
+
args: [
|
|
3159
|
+
safeTx.to,
|
|
3160
|
+
safeTx.value,
|
|
3161
|
+
safeTx.data,
|
|
3162
|
+
safeTx.operation,
|
|
3163
|
+
safeTx.safeTxGas,
|
|
3164
|
+
safeTx.baseGas,
|
|
3165
|
+
safeTx.gasPrice,
|
|
3166
|
+
safeTx.gasToken,
|
|
3167
|
+
safeTx.refundReceiver,
|
|
3168
|
+
signature
|
|
3169
|
+
]
|
|
3170
|
+
});
|
|
3171
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
3172
|
+
hash: txHash
|
|
3173
|
+
});
|
|
3174
|
+
const safeLogs = receipt.logs.filter(
|
|
3175
|
+
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3176
|
+
);
|
|
3177
|
+
const parsed = parseEventLogs({
|
|
3178
|
+
abi: SAFE_ABI,
|
|
3179
|
+
logs: safeLogs,
|
|
3180
|
+
strict: false
|
|
3181
|
+
});
|
|
3182
|
+
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
3183
|
+
if (failed) {
|
|
3184
|
+
throw new Error("Safe transaction failed");
|
|
3185
|
+
}
|
|
3186
|
+
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
3187
|
+
if (!succeeded) {
|
|
3188
|
+
throw new Error("Safe transaction status unavailable");
|
|
3189
|
+
}
|
|
3190
|
+
return { txHash };
|
|
3191
|
+
}
|
|
3192
|
+
var SAFE_TX_TYPES = {
|
|
3193
|
+
SafeTx: [
|
|
3194
|
+
{ name: "to", type: "address" },
|
|
3195
|
+
{ name: "value", type: "uint256" },
|
|
3196
|
+
{ name: "data", type: "bytes" },
|
|
3197
|
+
{ name: "operation", type: "uint8" },
|
|
3198
|
+
{ name: "safeTxGas", type: "uint256" },
|
|
3199
|
+
{ name: "baseGas", type: "uint256" },
|
|
3200
|
+
{ name: "gasPrice", type: "uint256" },
|
|
3201
|
+
{ name: "gasToken", type: "address" },
|
|
3202
|
+
{ name: "refundReceiver", type: "address" },
|
|
3203
|
+
{ name: "nonce", type: "uint256" }
|
|
3204
|
+
]
|
|
3205
|
+
};
|
|
3206
|
+
async function buildSafeTransaction(params) {
|
|
3207
|
+
const { publicClient, safeAddress, to, value, data, chainId } = params;
|
|
3208
|
+
const nonce = await publicClient.readContract({
|
|
3209
|
+
address: safeAddress,
|
|
3210
|
+
abi: SAFE_ABI,
|
|
3211
|
+
functionName: "nonce"
|
|
3212
|
+
});
|
|
3213
|
+
const message = {
|
|
3214
|
+
to,
|
|
3215
|
+
value,
|
|
3216
|
+
data,
|
|
3217
|
+
operation: 0,
|
|
3218
|
+
safeTxGas: 0n,
|
|
3219
|
+
baseGas: 0n,
|
|
3220
|
+
gasPrice: 0n,
|
|
3221
|
+
gasToken: zeroAddress,
|
|
3222
|
+
refundReceiver: zeroAddress,
|
|
3223
|
+
nonce
|
|
3224
|
+
};
|
|
3225
|
+
const safeTxHash = hashTypedData({
|
|
3226
|
+
domain: { chainId, verifyingContract: safeAddress },
|
|
3227
|
+
types: SAFE_TX_TYPES,
|
|
3228
|
+
primaryType: "SafeTx",
|
|
3229
|
+
message
|
|
3230
|
+
});
|
|
3231
|
+
return {
|
|
3232
|
+
chainId,
|
|
3233
|
+
safeAddress,
|
|
3234
|
+
safeTxHash,
|
|
3235
|
+
typedData: {
|
|
3236
|
+
domain: { chainId, verifyingContract: safeAddress },
|
|
3237
|
+
types: SAFE_TX_TYPES,
|
|
3238
|
+
primaryType: "SafeTx",
|
|
3239
|
+
message
|
|
3240
|
+
}
|
|
3241
|
+
};
|
|
3242
|
+
}
|
|
3243
|
+
|
|
2567
3244
|
// src/core/public-client.ts
|
|
2568
3245
|
import { createPublicClient, http } from "viem";
|
|
2569
3246
|
var clientCache = /* @__PURE__ */ new Map();
|
|
@@ -2580,19 +3257,68 @@ function getPublicClient(chainId) {
|
|
|
2580
3257
|
return client;
|
|
2581
3258
|
}
|
|
2582
3259
|
|
|
3260
|
+
// src/core/session-owner.ts
|
|
3261
|
+
import { isAddress } from "viem";
|
|
3262
|
+
import {
|
|
3263
|
+
generatePrivateKey,
|
|
3264
|
+
privateKeyToAccount
|
|
3265
|
+
} from "viem/accounts";
|
|
3266
|
+
var STORAGE_PREFIX = "rhinestone:session-owner";
|
|
3267
|
+
function storageKey(eoaAddress) {
|
|
3268
|
+
return `${STORAGE_PREFIX}:${eoaAddress.toLowerCase()}`;
|
|
3269
|
+
}
|
|
3270
|
+
function loadSessionOwnerFromStorage(eoaAddress) {
|
|
3271
|
+
if (typeof window === "undefined") return null;
|
|
3272
|
+
const raw = window.localStorage.getItem(storageKey(eoaAddress));
|
|
3273
|
+
if (!raw) return null;
|
|
3274
|
+
try {
|
|
3275
|
+
const parsed = JSON.parse(raw);
|
|
3276
|
+
if (!parsed.privateKey) return null;
|
|
3277
|
+
const account = privateKeyToAccount(parsed.privateKey);
|
|
3278
|
+
return {
|
|
3279
|
+
privateKey: parsed.privateKey,
|
|
3280
|
+
address: account.address
|
|
3281
|
+
};
|
|
3282
|
+
} catch {
|
|
3283
|
+
return null;
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
function saveSessionOwnerToStorage(eoaAddress, privateKey, address) {
|
|
3287
|
+
if (typeof window === "undefined") return;
|
|
3288
|
+
if (!isAddress(address)) return;
|
|
3289
|
+
const payload = {
|
|
3290
|
+
privateKey,
|
|
3291
|
+
address,
|
|
3292
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3293
|
+
};
|
|
3294
|
+
window.localStorage.setItem(storageKey(eoaAddress), JSON.stringify(payload));
|
|
3295
|
+
}
|
|
3296
|
+
function createSessionOwnerKey() {
|
|
3297
|
+
const privateKey = generatePrivateKey();
|
|
3298
|
+
const account = privateKeyToAccount(privateKey);
|
|
3299
|
+
return {
|
|
3300
|
+
privateKey,
|
|
3301
|
+
account,
|
|
3302
|
+
address: account.address
|
|
3303
|
+
};
|
|
3304
|
+
}
|
|
3305
|
+
function accountFromPrivateKey(privateKey) {
|
|
3306
|
+
return privateKeyToAccount(privateKey);
|
|
3307
|
+
}
|
|
3308
|
+
|
|
2583
3309
|
export {
|
|
2584
3310
|
Modal,
|
|
2585
3311
|
WalletIcon,
|
|
2586
3312
|
ExternalLinkIcon,
|
|
2587
3313
|
CheckIcon,
|
|
3314
|
+
TransferCryptoIcon,
|
|
2588
3315
|
ChevronLeftIcon,
|
|
2589
3316
|
ChevronDownIcon,
|
|
2590
3317
|
CloseIcon,
|
|
2591
|
-
CoinsIcon,
|
|
2592
3318
|
HistoryIcon,
|
|
2593
3319
|
InfoIcon,
|
|
2594
3320
|
CopyIcon,
|
|
2595
|
-
|
|
3321
|
+
ArrowUpRightIcon,
|
|
2596
3322
|
AlertTriangleIcon,
|
|
2597
3323
|
PercentIcon,
|
|
2598
3324
|
ClockIcon,
|
|
@@ -2600,12 +3326,15 @@ export {
|
|
|
2600
3326
|
CircleArrowOutUpLeftIcon,
|
|
2601
3327
|
BodyHeader,
|
|
2602
3328
|
PoweredBy,
|
|
2603
|
-
ConnectStep,
|
|
2604
3329
|
Spinner,
|
|
3330
|
+
ConnectStep,
|
|
3331
|
+
useLatestRef,
|
|
2605
3332
|
Button,
|
|
3333
|
+
Callout,
|
|
2606
3334
|
debugLog,
|
|
2607
3335
|
debugError,
|
|
2608
3336
|
toEvmCaip2,
|
|
3337
|
+
targetChainToCaip2,
|
|
2609
3338
|
parseEvmChainId,
|
|
2610
3339
|
isSolanaCaip2,
|
|
2611
3340
|
getAssetId,
|
|
@@ -2613,19 +3342,23 @@ export {
|
|
|
2613
3342
|
isNativeAsset,
|
|
2614
3343
|
buildSessionDetails,
|
|
2615
3344
|
createDepositService,
|
|
2616
|
-
loadSessionOwnerFromStorage,
|
|
2617
|
-
saveSessionOwnerToStorage,
|
|
2618
|
-
createSessionOwnerKey,
|
|
2619
|
-
accountFromPrivateKey,
|
|
2620
3345
|
currencyFormatter,
|
|
2621
3346
|
tokenFormatter,
|
|
3347
|
+
isUnsupportedChainSwitchError,
|
|
2622
3348
|
formatUserError,
|
|
2623
3349
|
Tooltip,
|
|
2624
3350
|
getEventTxHash,
|
|
2625
3351
|
isDepositEvent,
|
|
2626
3352
|
txRefsMatch,
|
|
2627
|
-
useLatestRef,
|
|
2628
3353
|
ProcessingStep,
|
|
3354
|
+
SAFE_ABI,
|
|
3355
|
+
executeSafeEthTransfer,
|
|
3356
|
+
executeSafeErc20Transfer,
|
|
3357
|
+
buildSafeTransaction,
|
|
2629
3358
|
getPublicClient,
|
|
3359
|
+
loadSessionOwnerFromStorage,
|
|
3360
|
+
saveSessionOwnerToStorage,
|
|
3361
|
+
createSessionOwnerKey,
|
|
3362
|
+
accountFromPrivateKey,
|
|
2630
3363
|
applyTheme
|
|
2631
3364
|
};
|