@agg-build/ui 4.22.6 → 4.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CKHECAKV.mjs → chunk-7ORC3TUJ.mjs} +398 -239
- package/dist/{chunk-RCO424WO.mjs → chunk-G4KXZ5XX.mjs} +63 -66
- package/dist/{chunk-NV6WT3TN.mjs → chunk-HZXHDH6G.mjs} +153 -45
- package/dist/{chunk-H54RU7NF.mjs → chunk-MDCFCGA3.mjs} +6 -3
- package/dist/{chunk-SGXFMBJM.mjs → chunk-Q5NJCH5O.mjs} +19 -7
- package/dist/{chunk-UXLC3FFY.mjs → chunk-W2LCFCW3.mjs} +1 -1
- package/dist/{chunk-JR2XAAK6.mjs → chunk-YYGS6S7N.mjs} +5 -2
- package/dist/{event-market-J35IWO2I.mjs → event-market-YBWA2HRJ.mjs} +4 -4
- package/dist/events.js +10 -4
- package/dist/events.mjs +2 -2
- package/dist/index.js +2688 -2395
- package/dist/index.mjs +9 -7
- package/dist/modals.js +512 -352
- package/dist/modals.mjs +4 -2
- package/dist/pages.js +2234 -1943
- package/dist/pages.mjs +6 -6
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1139 -874
- package/dist/trading.mjs +2 -2
- package/dist/types/onboarding/index.d.mts +1 -0
- package/dist/types/onboarding/index.d.ts +1 -0
- package/dist/types/onboarding/steps/connect-novig-modal.d.mts +12 -0
- package/dist/types/onboarding/steps/connect-novig-modal.d.ts +12 -0
- package/dist/types/pages/event-market/sports-markets.d.mts +3 -1
- package/dist/types/pages/event-market/sports-markets.d.ts +3 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +1 -2
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +1 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +7 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1127,11 +1127,169 @@ function ConnectProphetxModal({
|
|
|
1127
1127
|
);
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
|
-
// src/onboarding/
|
|
1131
|
-
import {
|
|
1132
|
-
import {
|
|
1130
|
+
// src/onboarding/steps/connect-novig-modal.tsx
|
|
1131
|
+
import { useAppConfig as useAppConfig3, useLabels as useLabels9 } from "@agg-build/hooks";
|
|
1132
|
+
import { Venue as Venue4 } from "@agg-build/sdk";
|
|
1133
1133
|
import * as Dialog5 from "@radix-ui/react-dialog";
|
|
1134
|
+
import { useEffect as useEffect3, useId as useId3, useState as useState6 } from "react";
|
|
1134
1135
|
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1136
|
+
function ConnectNovigModal({
|
|
1137
|
+
open,
|
|
1138
|
+
onOpenChange,
|
|
1139
|
+
onVerify,
|
|
1140
|
+
onDisconnect,
|
|
1141
|
+
allowExistingConnection = false
|
|
1142
|
+
}) {
|
|
1143
|
+
const copy = useLabels9().onboarding.connectNovigModal;
|
|
1144
|
+
const common = useLabels9().common;
|
|
1145
|
+
const { novigExecutionMode, disabledVenues, isLoading } = useAppConfig3();
|
|
1146
|
+
const id = useId3();
|
|
1147
|
+
const [keyId, setKeyId] = useState6("");
|
|
1148
|
+
const [privateKey, setPrivateKey] = useState6("");
|
|
1149
|
+
const [pending, setPending] = useState6(false);
|
|
1150
|
+
const [disconnecting, setDisconnecting] = useState6(false);
|
|
1151
|
+
const [disconnectError, setDisconnectError] = useState6(false);
|
|
1152
|
+
const busy = pending || disconnecting;
|
|
1153
|
+
const [connected, setConnected] = useState6(false);
|
|
1154
|
+
const [error, setError] = useState6(false);
|
|
1155
|
+
useEffect3(() => {
|
|
1156
|
+
if (!open) {
|
|
1157
|
+
setKeyId("");
|
|
1158
|
+
setPrivateKey("");
|
|
1159
|
+
setError(false);
|
|
1160
|
+
setDisconnectError(false);
|
|
1161
|
+
setConnected(false);
|
|
1162
|
+
}
|
|
1163
|
+
}, [open]);
|
|
1164
|
+
if (isLoading || !allowExistingConnection && (novigExecutionMode !== "direct" || disabledVenues.includes(Venue4.novig)))
|
|
1165
|
+
return null;
|
|
1166
|
+
return /* @__PURE__ */ jsx9(
|
|
1167
|
+
Modal,
|
|
1168
|
+
{
|
|
1169
|
+
open,
|
|
1170
|
+
onOpenChange: (value) => {
|
|
1171
|
+
if (!busy) onOpenChange(value);
|
|
1172
|
+
},
|
|
1173
|
+
children: /* @__PURE__ */ jsx9(Modal.Container, { maxWidth: "480px", "aria-label": copy.title, children: /* @__PURE__ */ jsxs9(Modal.Body, { classNames: { root: "relative !p-6" }, children: [
|
|
1174
|
+
/* @__PURE__ */ jsx9(
|
|
1175
|
+
Dialog5.Close,
|
|
1176
|
+
{
|
|
1177
|
+
"aria-label": common.close,
|
|
1178
|
+
disabled: busy,
|
|
1179
|
+
className: "absolute right-4 top-4 cursor-pointer disabled:cursor-not-allowed",
|
|
1180
|
+
children: /* @__PURE__ */ jsx9(Icon, { name: "close", size: "medium" })
|
|
1181
|
+
}
|
|
1182
|
+
),
|
|
1183
|
+
/* @__PURE__ */ jsxs9(
|
|
1184
|
+
"form",
|
|
1185
|
+
{
|
|
1186
|
+
className: "flex flex-col gap-4",
|
|
1187
|
+
onSubmit: (event) => __async(null, null, function* () {
|
|
1188
|
+
event.preventDefault();
|
|
1189
|
+
if (busy || !keyId.trim() || !privateKey.trim()) return;
|
|
1190
|
+
setPending(true);
|
|
1191
|
+
setError(false);
|
|
1192
|
+
try {
|
|
1193
|
+
yield onVerify({ keyId: keyId.trim(), privateKey: privateKey.trim() });
|
|
1194
|
+
setKeyId("");
|
|
1195
|
+
setPrivateKey("");
|
|
1196
|
+
setConnected(true);
|
|
1197
|
+
} catch (e) {
|
|
1198
|
+
setError(true);
|
|
1199
|
+
} finally {
|
|
1200
|
+
setPending(false);
|
|
1201
|
+
}
|
|
1202
|
+
}),
|
|
1203
|
+
children: [
|
|
1204
|
+
/* @__PURE__ */ jsx9(VenueLogo, { venue: Venue4.novig, size: "large" }),
|
|
1205
|
+
/* @__PURE__ */ jsx9(Dialog5.Title, { className: "text-agg-xl font-agg-bold text-agg-foreground", children: copy.title }),
|
|
1206
|
+
/* @__PURE__ */ jsx9(Dialog5.Description, { className: "text-agg-sm text-agg-muted-foreground", children: copy.description }),
|
|
1207
|
+
/* @__PURE__ */ jsx9("p", { className: "text-agg-sm text-agg-muted-foreground", children: copy.fundingNotice }),
|
|
1208
|
+
connected ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1209
|
+
/* @__PURE__ */ jsx9("p", { role: "status", children: copy.connected }),
|
|
1210
|
+
/* @__PURE__ */ jsx9(Button, { type: "button", onClick: () => onOpenChange(false), children: copy.done })
|
|
1211
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1212
|
+
/* @__PURE__ */ jsx9(
|
|
1213
|
+
"a",
|
|
1214
|
+
{
|
|
1215
|
+
className: "text-agg-sm text-agg-primary underline",
|
|
1216
|
+
href: "https://docs.novig.com/api/quickstart",
|
|
1217
|
+
target: "_blank",
|
|
1218
|
+
rel: "noopener noreferrer",
|
|
1219
|
+
children: copy.instructions
|
|
1220
|
+
}
|
|
1221
|
+
),
|
|
1222
|
+
/* @__PURE__ */ jsx9("label", { htmlFor: `${id}-access`, className: "text-agg-sm text-agg-foreground", children: copy.keyId }),
|
|
1223
|
+
/* @__PURE__ */ jsx9(
|
|
1224
|
+
"input",
|
|
1225
|
+
{
|
|
1226
|
+
id: `${id}-access`,
|
|
1227
|
+
type: "password",
|
|
1228
|
+
autoComplete: "off",
|
|
1229
|
+
spellCheck: false,
|
|
1230
|
+
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1231
|
+
value: keyId,
|
|
1232
|
+
onChange: (e) => setKeyId(e.target.value),
|
|
1233
|
+
disabled: busy,
|
|
1234
|
+
required: true
|
|
1235
|
+
}
|
|
1236
|
+
),
|
|
1237
|
+
/* @__PURE__ */ jsx9("label", { htmlFor: `${id}-secret`, className: "text-agg-sm text-agg-foreground", children: copy.privateKey }),
|
|
1238
|
+
/* @__PURE__ */ jsx9(
|
|
1239
|
+
"textarea",
|
|
1240
|
+
{
|
|
1241
|
+
id: `${id}-secret`,
|
|
1242
|
+
rows: 5,
|
|
1243
|
+
autoComplete: "new-password",
|
|
1244
|
+
spellCheck: false,
|
|
1245
|
+
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1246
|
+
value: privateKey,
|
|
1247
|
+
onChange: (e) => setPrivateKey(e.target.value),
|
|
1248
|
+
disabled: busy,
|
|
1249
|
+
required: true
|
|
1250
|
+
}
|
|
1251
|
+
),
|
|
1252
|
+
error ? /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.error }) : null,
|
|
1253
|
+
/* @__PURE__ */ jsx9(Button, { type: "submit", disabled: busy || !keyId.trim() || !privateKey.trim(), children: pending ? copy.verifying : copy.verify })
|
|
1254
|
+
] }),
|
|
1255
|
+
allowExistingConnection && onDisconnect ? /* @__PURE__ */ jsx9(
|
|
1256
|
+
Button,
|
|
1257
|
+
{
|
|
1258
|
+
type: "button",
|
|
1259
|
+
variant: "secondary",
|
|
1260
|
+
disabled: busy,
|
|
1261
|
+
onClick: () => __async(null, null, function* () {
|
|
1262
|
+
setDisconnecting(true);
|
|
1263
|
+
setDisconnectError(false);
|
|
1264
|
+
setError(false);
|
|
1265
|
+
try {
|
|
1266
|
+
yield onDisconnect();
|
|
1267
|
+
setKeyId("");
|
|
1268
|
+
setPrivateKey("");
|
|
1269
|
+
onOpenChange(false);
|
|
1270
|
+
} catch (e) {
|
|
1271
|
+
setDisconnectError(true);
|
|
1272
|
+
} finally {
|
|
1273
|
+
setDisconnecting(false);
|
|
1274
|
+
}
|
|
1275
|
+
}),
|
|
1276
|
+
children: disconnecting ? copy.disconnecting : copy.disconnect
|
|
1277
|
+
}
|
|
1278
|
+
) : null,
|
|
1279
|
+
disconnectError ? /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.disconnectError }) : null
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
] }) })
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
// src/onboarding/index.tsx
|
|
1289
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1290
|
+
import { useLabels as useLabels10 } from "@agg-build/hooks";
|
|
1291
|
+
import * as Dialog6 from "@radix-ui/react-dialog";
|
|
1292
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1135
1293
|
var OnboardingModal = ({
|
|
1136
1294
|
open,
|
|
1137
1295
|
onOpenChange,
|
|
@@ -1142,17 +1300,17 @@ var OnboardingModal = ({
|
|
|
1142
1300
|
connectedOnchain = false
|
|
1143
1301
|
}) => {
|
|
1144
1302
|
var _a;
|
|
1145
|
-
const labels =
|
|
1146
|
-
const [step, setStep] =
|
|
1303
|
+
const labels = useLabels10();
|
|
1304
|
+
const [step, setStep] = useState7(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
1147
1305
|
const stepLabels = {
|
|
1148
1306
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
1149
1307
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
1150
1308
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
1151
1309
|
};
|
|
1152
1310
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
1153
|
-
const [onchainModalOpen, setOnchainModalOpen] =
|
|
1154
|
-
const [onchainConnected, setOnchainConnected] =
|
|
1155
|
-
|
|
1311
|
+
const [onchainModalOpen, setOnchainModalOpen] = useState7(false);
|
|
1312
|
+
const [onchainConnected, setOnchainConnected] = useState7(false);
|
|
1313
|
+
useEffect4(() => {
|
|
1156
1314
|
if (open) {
|
|
1157
1315
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
1158
1316
|
setOnchainConnected(false);
|
|
@@ -1178,19 +1336,19 @@ var OnboardingModal = ({
|
|
|
1178
1336
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
1179
1337
|
setOnchainConnected(true);
|
|
1180
1338
|
}), [onConnectOnchain]);
|
|
1181
|
-
return /* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1340
|
+
/* @__PURE__ */ jsx10(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs10(
|
|
1183
1341
|
Modal.Container,
|
|
1184
1342
|
{
|
|
1185
1343
|
maxWidth: "600px",
|
|
1186
1344
|
"aria-label": resolvedTitle,
|
|
1187
1345
|
classNames: { container: "!rounded-agg-lg" },
|
|
1188
1346
|
children: [
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */
|
|
1192
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */
|
|
1193
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ jsx10(Dialog6.Title, { className: "sr-only", children: resolvedTitle }),
|
|
1348
|
+
/* @__PURE__ */ jsxs10(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
1349
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ jsx10(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
1350
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ jsx10(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
1351
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ jsx10(
|
|
1194
1352
|
ConnectAccountsStep,
|
|
1195
1353
|
{
|
|
1196
1354
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -1202,7 +1360,7 @@ var OnboardingModal = ({
|
|
|
1202
1360
|
]
|
|
1203
1361
|
}
|
|
1204
1362
|
) }),
|
|
1205
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ jsx10(
|
|
1206
1364
|
ConnectOnchainModal,
|
|
1207
1365
|
{
|
|
1208
1366
|
open: onchainModalOpen,
|
|
@@ -1215,7 +1373,7 @@ var OnboardingModal = ({
|
|
|
1215
1373
|
OnboardingModal.displayName = "OnboardingModal";
|
|
1216
1374
|
|
|
1217
1375
|
// src/withdraw/index.tsx
|
|
1218
|
-
import { useEffect as
|
|
1376
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1219
1377
|
import { useWithdrawalLifecycle, useWithdrawFlow } from "@agg-build/hooks/withdraw";
|
|
1220
1378
|
|
|
1221
1379
|
// src/shared/constants.ts
|
|
@@ -1414,22 +1572,22 @@ var mergeSelectOptionsUnique = (base, fill) => {
|
|
|
1414
1572
|
};
|
|
1415
1573
|
|
|
1416
1574
|
// src/withdraw/steps/withdraw-method.tsx
|
|
1417
|
-
import { useLabels as
|
|
1418
|
-
import { Fragment as
|
|
1575
|
+
import { useLabels as useLabels11 } from "@agg-build/hooks";
|
|
1576
|
+
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1419
1577
|
var WithdrawMethodStep = ({
|
|
1420
1578
|
balance,
|
|
1421
1579
|
onSelectMethod
|
|
1422
1580
|
}) => {
|
|
1423
|
-
const labels =
|
|
1424
|
-
return /* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1581
|
+
const labels = useLabels11();
|
|
1582
|
+
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1583
|
+
/* @__PURE__ */ jsx11(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
|
|
1584
|
+
/* @__PURE__ */ jsx11(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-5", children: [
|
|
1585
|
+
/* @__PURE__ */ jsxs11("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
1428
1586
|
labels.withdraw.balancePrefix,
|
|
1429
1587
|
" ",
|
|
1430
1588
|
formatCompactUsd(balance)
|
|
1431
1589
|
] }),
|
|
1432
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsxs11(
|
|
1433
1591
|
"div",
|
|
1434
1592
|
{
|
|
1435
1593
|
className: cn(
|
|
@@ -1446,12 +1604,12 @@ var WithdrawMethodStep = ({
|
|
|
1446
1604
|
}
|
|
1447
1605
|
},
|
|
1448
1606
|
children: [
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1607
|
+
/* @__PURE__ */ jsx11("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ jsx11(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
|
|
1608
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
|
|
1609
|
+
/* @__PURE__ */ jsx11("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
|
|
1610
|
+
/* @__PURE__ */ jsx11("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
|
|
1453
1611
|
] }),
|
|
1454
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsx11("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx11(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
1455
1613
|
]
|
|
1456
1614
|
}
|
|
1457
1615
|
)
|
|
@@ -1460,12 +1618,12 @@ var WithdrawMethodStep = ({
|
|
|
1460
1618
|
};
|
|
1461
1619
|
|
|
1462
1620
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
1463
|
-
import { useLabels as
|
|
1621
|
+
import { useLabels as useLabels13, useWithdrawPreview } from "@agg-build/hooks";
|
|
1464
1622
|
|
|
1465
1623
|
// src/shared/transfer-fee-summary.tsx
|
|
1466
|
-
import { useLabels as
|
|
1467
|
-
import { jsx as
|
|
1468
|
-
var separator = /* @__PURE__ */
|
|
1624
|
+
import { useLabels as useLabels12 } from "@agg-build/hooks";
|
|
1625
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1626
|
+
var separator = /* @__PURE__ */ jsx12("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
|
|
1469
1627
|
var normalizeFeeLabel = (label) => label.replace(/\s*~\s*$/, "");
|
|
1470
1628
|
var TransferFeeSummary = ({
|
|
1471
1629
|
estimate,
|
|
@@ -1473,46 +1631,46 @@ var TransferFeeSummary = ({
|
|
|
1473
1631
|
minDeposit,
|
|
1474
1632
|
eta
|
|
1475
1633
|
}) => {
|
|
1476
|
-
const labels =
|
|
1634
|
+
const labels = useLabels12();
|
|
1477
1635
|
if (!estimate) return null;
|
|
1478
1636
|
if (view === "deposit") {
|
|
1479
|
-
return /* @__PURE__ */
|
|
1480
|
-
minDeposit ? /* @__PURE__ */
|
|
1637
|
+
return /* @__PURE__ */ jsxs12("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
1638
|
+
minDeposit ? /* @__PURE__ */ jsxs12("span", { children: [
|
|
1481
1639
|
labels.deposit.sendCrypto.minDepositPrefix,
|
|
1482
1640
|
" ",
|
|
1483
1641
|
minDeposit
|
|
1484
1642
|
] }) : null,
|
|
1485
1643
|
minDeposit ? separator : null,
|
|
1486
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1487
1645
|
normalizeFeeLabel(labels.deposit.walletFlow.feePrefix),
|
|
1488
1646
|
": ",
|
|
1489
1647
|
estimate.estimatedFees
|
|
1490
1648
|
] }),
|
|
1491
1649
|
eta ? separator : null,
|
|
1492
|
-
eta ? /* @__PURE__ */
|
|
1650
|
+
eta ? /* @__PURE__ */ jsx12("span", { children: eta }) : null
|
|
1493
1651
|
] });
|
|
1494
1652
|
}
|
|
1495
|
-
return /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ jsxs12("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
1654
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1497
1655
|
labels.withdraw.walletFlow.estimatedFees,
|
|
1498
1656
|
": ",
|
|
1499
1657
|
estimate.estimatedFees
|
|
1500
1658
|
] }),
|
|
1501
1659
|
separator,
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1", children: [
|
|
1661
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1504
1662
|
labels.withdraw.walletFlow.networkReserve,
|
|
1505
1663
|
": ",
|
|
1506
1664
|
estimate.networkReserve
|
|
1507
1665
|
] }),
|
|
1508
|
-
/* @__PURE__ */
|
|
1666
|
+
/* @__PURE__ */ jsx12(
|
|
1509
1667
|
Tooltip,
|
|
1510
1668
|
{
|
|
1511
1669
|
"aria-label": labels.withdraw.walletFlow.networkReserveTooltipAria,
|
|
1512
1670
|
size: "medium",
|
|
1513
|
-
content: /* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1671
|
+
content: /* @__PURE__ */ jsxs12("div", { className: "text-center", children: [
|
|
1672
|
+
/* @__PURE__ */ jsx12("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
|
|
1673
|
+
/* @__PURE__ */ jsx12("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
|
|
1516
1674
|
] }),
|
|
1517
1675
|
classNames: {
|
|
1518
1676
|
content: "min-w-96 max-w-none!",
|
|
@@ -1523,7 +1681,7 @@ var TransferFeeSummary = ({
|
|
|
1523
1681
|
)
|
|
1524
1682
|
] }),
|
|
1525
1683
|
separator,
|
|
1526
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1527
1685
|
labels.withdraw.walletFlow.youReceive,
|
|
1528
1686
|
": ",
|
|
1529
1687
|
estimate.youReceive
|
|
@@ -1532,7 +1690,7 @@ var TransferFeeSummary = ({
|
|
|
1532
1690
|
};
|
|
1533
1691
|
|
|
1534
1692
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
1535
|
-
import { Fragment as
|
|
1693
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1536
1694
|
var formatRawTokenAmount = (rawAmount, decimals) => {
|
|
1537
1695
|
if (!rawAmount) return "0";
|
|
1538
1696
|
const raw = BigInt(rawAmount);
|
|
@@ -1578,7 +1736,7 @@ var WithdrawAmountStep = ({
|
|
|
1578
1736
|
onContinue
|
|
1579
1737
|
}) => {
|
|
1580
1738
|
var _a, _b, _c, _d;
|
|
1581
|
-
const labels =
|
|
1739
|
+
const labels = useLabels13();
|
|
1582
1740
|
const SOLANA_CHAIN_ID = "792703809";
|
|
1583
1741
|
const isSolanaDest = selectedNetwork === SOLANA_CHAIN_ID;
|
|
1584
1742
|
const trimmedDestination = destinationWallet.trim();
|
|
@@ -1603,29 +1761,29 @@ var WithdrawAmountStep = ({
|
|
|
1603
1761
|
youReceive: preview.data.receiveAmountRaw != null ? `~${formatRawTokenAmount(preview.data.receiveAmountRaw, destDecimals)} ${selectedToken}` : "\u2014"
|
|
1604
1762
|
} : null;
|
|
1605
1763
|
const shouldShowWithdrawEstimate = Boolean(withdrawEstimate);
|
|
1606
|
-
return /* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
1765
|
+
/* @__PURE__ */ jsx13(
|
|
1608
1766
|
Modal.Header,
|
|
1609
1767
|
{
|
|
1610
1768
|
title: title != null ? title : labels.withdraw.walletFlow.title,
|
|
1611
1769
|
hideBorder: true,
|
|
1612
|
-
leftElement: /* @__PURE__ */
|
|
1770
|
+
leftElement: /* @__PURE__ */ jsx13(
|
|
1613
1771
|
"button",
|
|
1614
1772
|
{
|
|
1615
1773
|
type: "button",
|
|
1616
1774
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1617
1775
|
onClick: onBack,
|
|
1618
1776
|
"aria-label": labels.withdraw.back,
|
|
1619
|
-
children: /* @__PURE__ */
|
|
1777
|
+
children: /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1620
1778
|
}
|
|
1621
1779
|
)
|
|
1622
1780
|
}
|
|
1623
1781
|
),
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ jsx13(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-5", children: [
|
|
1783
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-5", children: [
|
|
1784
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2", children: [
|
|
1785
|
+
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
|
|
1786
|
+
/* @__PURE__ */ jsx13(
|
|
1629
1787
|
"input",
|
|
1630
1788
|
{
|
|
1631
1789
|
type: "text",
|
|
@@ -1642,17 +1800,17 @@ var WithdrawAmountStep = ({
|
|
|
1642
1800
|
}
|
|
1643
1801
|
)
|
|
1644
1802
|
] }),
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1803
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2", children: [
|
|
1804
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
|
|
1805
|
+
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
|
|
1806
|
+
/* @__PURE__ */ jsxs13("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1649
1807
|
labels.withdraw.balancePrefix,
|
|
1650
1808
|
" ",
|
|
1651
1809
|
balanceDisplay
|
|
1652
1810
|
] })
|
|
1653
1811
|
] }),
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
|
|
1813
|
+
/* @__PURE__ */ jsx13(
|
|
1656
1814
|
"input",
|
|
1657
1815
|
{
|
|
1658
1816
|
type: "text",
|
|
@@ -1667,8 +1825,8 @@ var WithdrawAmountStep = ({
|
|
|
1667
1825
|
onChange: (e) => onAmountChange(e.target.value)
|
|
1668
1826
|
}
|
|
1669
1827
|
),
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
onMaxClick ? /* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx13("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
|
|
1829
|
+
onMaxClick ? /* @__PURE__ */ jsx13(
|
|
1672
1830
|
"button",
|
|
1673
1831
|
{
|
|
1674
1832
|
type: "button",
|
|
@@ -1679,10 +1837,10 @@ var WithdrawAmountStep = ({
|
|
|
1679
1837
|
) : null
|
|
1680
1838
|
] })
|
|
1681
1839
|
] }),
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
|
|
1841
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1842
|
+
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
|
|
1843
|
+
/* @__PURE__ */ jsx13(
|
|
1686
1844
|
Select,
|
|
1687
1845
|
{
|
|
1688
1846
|
items: tokenOptions,
|
|
@@ -1693,9 +1851,9 @@ var WithdrawAmountStep = ({
|
|
|
1693
1851
|
}
|
|
1694
1852
|
)
|
|
1695
1853
|
] }),
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1855
|
+
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
|
|
1856
|
+
/* @__PURE__ */ jsx13(
|
|
1699
1857
|
Select,
|
|
1700
1858
|
{
|
|
1701
1859
|
items: networkOptions,
|
|
@@ -1707,47 +1865,47 @@ var WithdrawAmountStep = ({
|
|
|
1707
1865
|
)
|
|
1708
1866
|
] })
|
|
1709
1867
|
] }),
|
|
1710
|
-
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */
|
|
1711
|
-
previewUnviableMessage ? /* @__PURE__ */
|
|
1868
|
+
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ jsx13(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
|
|
1869
|
+
previewUnviableMessage ? /* @__PURE__ */ jsx13("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
|
|
1712
1870
|
] }),
|
|
1713
|
-
/* @__PURE__ */
|
|
1871
|
+
/* @__PURE__ */ jsx13(
|
|
1714
1872
|
Button,
|
|
1715
1873
|
{
|
|
1716
1874
|
variant: isValid && !isConfirming && !previewUnviable && !previewLoading ? "primary" : "secondary",
|
|
1717
1875
|
size: "large",
|
|
1718
1876
|
className: "w-full",
|
|
1719
1877
|
disabled: isDisabled,
|
|
1720
|
-
prefix: previewLoading && !isConfirming ? /* @__PURE__ */
|
|
1878
|
+
prefix: previewLoading && !isConfirming ? /* @__PURE__ */ jsx13(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
|
|
1721
1879
|
onClick: onContinue,
|
|
1722
1880
|
children: isConfirming ? labels.common.loading : previewLoading ? labels.withdraw.walletFlow.calculatingFees : labels.withdraw.walletFlow.confirm
|
|
1723
1881
|
}
|
|
1724
1882
|
),
|
|
1725
|
-
error ? /* @__PURE__ */
|
|
1883
|
+
error ? /* @__PURE__ */ jsx13("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
|
|
1726
1884
|
] }) })
|
|
1727
1885
|
] });
|
|
1728
1886
|
};
|
|
1729
1887
|
|
|
1730
1888
|
// src/withdraw/steps/withdraw-success.tsx
|
|
1731
|
-
import { useLabels as
|
|
1732
|
-
import { jsx as
|
|
1733
|
-
var SummaryRow = ({ label, value }) => /* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
1735
|
-
/* @__PURE__ */
|
|
1889
|
+
import { useLabels as useLabels14, useSdkUiConfig } from "@agg-build/hooks";
|
|
1890
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1891
|
+
var SummaryRow = ({ label, value }) => /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
1892
|
+
/* @__PURE__ */ jsx14("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
1893
|
+
/* @__PURE__ */ jsx14("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
|
|
1736
1894
|
] });
|
|
1737
|
-
var WithdrawCloseButton = ({ onClose, label }) => /* @__PURE__ */
|
|
1895
|
+
var WithdrawCloseButton = ({ onClose, label }) => /* @__PURE__ */ jsx14(
|
|
1738
1896
|
"button",
|
|
1739
1897
|
{
|
|
1740
1898
|
type: "button",
|
|
1741
1899
|
className: "absolute right-8 top-7 flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
1742
1900
|
onClick: onClose,
|
|
1743
1901
|
"aria-label": label,
|
|
1744
|
-
children: /* @__PURE__ */
|
|
1902
|
+
children: /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6" })
|
|
1745
1903
|
}
|
|
1746
1904
|
);
|
|
1747
1905
|
var LoadingGlyph = ({
|
|
1748
1906
|
className,
|
|
1749
1907
|
enableAnimations
|
|
1750
|
-
}) => /* @__PURE__ */
|
|
1908
|
+
}) => /* @__PURE__ */ jsx14(
|
|
1751
1909
|
"span",
|
|
1752
1910
|
{
|
|
1753
1911
|
"aria-hidden": "true",
|
|
@@ -1773,33 +1931,33 @@ var WithdrawLoadingStep = ({
|
|
|
1773
1931
|
lifecycleState,
|
|
1774
1932
|
onClose
|
|
1775
1933
|
}) => {
|
|
1776
|
-
const labels =
|
|
1934
|
+
const labels = useLabels14();
|
|
1777
1935
|
const {
|
|
1778
1936
|
features: { enableAnimations }
|
|
1779
1937
|
} = useSdkUiConfig();
|
|
1780
1938
|
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
1781
1939
|
const activeIndex = loadingActiveIndexFor(lifecycleState);
|
|
1782
1940
|
const loadingSteps = getLoadingSteps(walletFlowLabels);
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1941
|
+
return /* @__PURE__ */ jsx14("div", { className: "relative", children: /* @__PURE__ */ jsx14(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-7", children: [
|
|
1942
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4", children: [
|
|
1943
|
+
/* @__PURE__ */ jsx14("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
|
|
1944
|
+
/* @__PURE__ */ jsx14(
|
|
1787
1945
|
"button",
|
|
1788
1946
|
{
|
|
1789
1947
|
type: "button",
|
|
1790
1948
|
className: "flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
1791
1949
|
onClick: onClose,
|
|
1792
1950
|
"aria-label": labels.common.close,
|
|
1793
|
-
children: /* @__PURE__ */
|
|
1951
|
+
children: /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6" })
|
|
1794
1952
|
}
|
|
1795
1953
|
)
|
|
1796
1954
|
] }),
|
|
1797
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
|
|
1798
1956
|
const isComplete = index < activeIndex;
|
|
1799
1957
|
const isActive = index === activeIndex;
|
|
1800
1958
|
const textClassName = isActive || isComplete ? "text-agg-foreground" : "text-agg-muted-foreground";
|
|
1801
|
-
return /* @__PURE__ */
|
|
1802
|
-
isComplete ? /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-3", children: [
|
|
1960
|
+
isComplete ? /* @__PURE__ */ jsx14(
|
|
1803
1961
|
Icon,
|
|
1804
1962
|
{
|
|
1805
1963
|
name: "check-circle",
|
|
@@ -1808,24 +1966,24 @@ var WithdrawLoadingStep = ({
|
|
|
1808
1966
|
"aria-hidden": "true"
|
|
1809
1967
|
}
|
|
1810
1968
|
) : null,
|
|
1811
|
-
isActive ? /* @__PURE__ */
|
|
1969
|
+
isActive ? /* @__PURE__ */ jsx14(
|
|
1812
1970
|
LoadingGlyph,
|
|
1813
1971
|
{
|
|
1814
1972
|
enableAnimations,
|
|
1815
1973
|
className: "h-4 w-4 shrink-0 text-agg-primary"
|
|
1816
1974
|
}
|
|
1817
1975
|
) : null,
|
|
1818
|
-
!isComplete && !isActive ? /* @__PURE__ */
|
|
1976
|
+
!isComplete && !isActive ? /* @__PURE__ */ jsx14(
|
|
1819
1977
|
"span",
|
|
1820
1978
|
{
|
|
1821
1979
|
"aria-hidden": "true",
|
|
1822
1980
|
className: "h-4 w-4 shrink-0 rounded-full border border-agg-separator"
|
|
1823
1981
|
}
|
|
1824
1982
|
) : null,
|
|
1825
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ jsx14("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
|
|
1826
1984
|
] }, step.id);
|
|
1827
1985
|
}) }),
|
|
1828
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx14("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
|
|
1829
1987
|
] }) }) });
|
|
1830
1988
|
};
|
|
1831
1989
|
var resultCopyFor = ({
|
|
@@ -1860,7 +2018,7 @@ var WithdrawSuccessStep = ({
|
|
|
1860
2018
|
onRetry,
|
|
1861
2019
|
onClose
|
|
1862
2020
|
}) => {
|
|
1863
|
-
const labels =
|
|
2021
|
+
const labels = useLabels14();
|
|
1864
2022
|
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
1865
2023
|
const { title, description } = resultCopyFor({
|
|
1866
2024
|
status: resultStatus,
|
|
@@ -1868,10 +2026,10 @@ var WithdrawSuccessStep = ({
|
|
|
1868
2026
|
labels: walletFlowLabels
|
|
1869
2027
|
});
|
|
1870
2028
|
const isFailed = resultStatus === "failed";
|
|
1871
|
-
return /* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1874
|
-
/* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsx14("div", { className: "relative", children: /* @__PURE__ */ jsxs14(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
|
|
2030
|
+
/* @__PURE__ */ jsx14(WithdrawCloseButton, { onClose, label: labels.common.close }),
|
|
2031
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
|
|
2032
|
+
/* @__PURE__ */ jsx14(
|
|
1875
2033
|
"div",
|
|
1876
2034
|
{
|
|
1877
2035
|
className: cn(
|
|
@@ -1879,12 +2037,12 @@ var WithdrawSuccessStep = ({
|
|
|
1879
2037
|
isFailed ? "bg-agg-error/15" : "bg-agg-success/15"
|
|
1880
2038
|
),
|
|
1881
2039
|
"aria-hidden": "true",
|
|
1882
|
-
children: isFailed ? /* @__PURE__ */
|
|
2040
|
+
children: isFailed ? /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ jsx14(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
|
|
1883
2041
|
}
|
|
1884
2042
|
),
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
/* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
|
|
2044
|
+
/* @__PURE__ */ jsx14("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title }),
|
|
2045
|
+
/* @__PURE__ */ jsx14(
|
|
1888
2046
|
"p",
|
|
1889
2047
|
{
|
|
1890
2048
|
className: "max-w-[400px] text-agg-base leading-agg-6",
|
|
@@ -1893,35 +2051,35 @@ var WithdrawSuccessStep = ({
|
|
|
1893
2051
|
}
|
|
1894
2052
|
)
|
|
1895
2053
|
] }),
|
|
1896
|
-
!isFailed ? /* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
2054
|
+
!isFailed ? /* @__PURE__ */ jsxs14("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
|
|
2055
|
+
/* @__PURE__ */ jsx14(
|
|
1898
2056
|
SummaryRow,
|
|
1899
2057
|
{
|
|
1900
2058
|
label: walletFlowLabels.summary.requestedWithdrawal,
|
|
1901
2059
|
value: requestedWithdrawal
|
|
1902
2060
|
}
|
|
1903
2061
|
),
|
|
1904
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ jsx14(
|
|
1905
2063
|
SummaryRow,
|
|
1906
2064
|
{
|
|
1907
2065
|
label: walletFlowLabels.summary.amountReceived,
|
|
1908
2066
|
value: summary.amountReceived
|
|
1909
2067
|
}
|
|
1910
2068
|
),
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.fees, value: summary.fees }),
|
|
2070
|
+
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.network, value: summary.network }),
|
|
2071
|
+
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
|
|
1914
2072
|
] }) : null,
|
|
1915
|
-
isFailed ? /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
] }) : /* @__PURE__ */
|
|
2073
|
+
isFailed ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-center gap-3", children: [
|
|
2074
|
+
/* @__PURE__ */ jsx14(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
|
|
2075
|
+
/* @__PURE__ */ jsx14(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
|
|
2076
|
+
] }) : /* @__PURE__ */ jsx14(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
|
|
1919
2077
|
] })
|
|
1920
2078
|
] }) });
|
|
1921
2079
|
};
|
|
1922
2080
|
|
|
1923
2081
|
// src/withdraw/index.tsx
|
|
1924
|
-
import { jsx as
|
|
2082
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1925
2083
|
var DEFAULT_TOKEN_DECIMALS = 6;
|
|
1926
2084
|
var TOKEN_DECIMALS_BY_SYMBOL = {
|
|
1927
2085
|
BNB: 18,
|
|
@@ -2004,7 +2162,7 @@ function WithdrawModalSelfDriven({
|
|
|
2004
2162
|
onOpenChange
|
|
2005
2163
|
}) {
|
|
2006
2164
|
const withdrawProps = useWithdrawFlow({ open, onOpenChange });
|
|
2007
|
-
return /* @__PURE__ */
|
|
2165
|
+
return /* @__PURE__ */ jsx15(WithdrawModalControlled, __spreadValues({}, withdrawProps));
|
|
2008
2166
|
}
|
|
2009
2167
|
function WithdrawModalControlled({
|
|
2010
2168
|
open,
|
|
@@ -2021,14 +2179,14 @@ function WithdrawModalControlled({
|
|
|
2021
2179
|
}) {
|
|
2022
2180
|
var _a;
|
|
2023
2181
|
const initialFormStep = transferTarget ? "withdraw-amount" : "method";
|
|
2024
|
-
const [flowState, setFlowState] =
|
|
2182
|
+
const [flowState, setFlowState] = useState8({
|
|
2025
2183
|
status: "form",
|
|
2026
2184
|
formStep: initialFormStep
|
|
2027
2185
|
});
|
|
2028
|
-
const [isConfirming, setIsConfirming] =
|
|
2029
|
-
const [confirmError, setConfirmError] =
|
|
2186
|
+
const [isConfirming, setIsConfirming] = useState8(false);
|
|
2187
|
+
const [confirmError, setConfirmError] = useState8(null);
|
|
2030
2188
|
const { state: withdrawalLifecycleState, reset: resetWithdrawalLifecycle } = useWithdrawalLifecycle(withdrawFlow.withdrawalId);
|
|
2031
|
-
|
|
2189
|
+
useEffect5(() => {
|
|
2032
2190
|
if (!open) {
|
|
2033
2191
|
setFlowState({ status: "form", formStep: initialFormStep });
|
|
2034
2192
|
setIsConfirming(false);
|
|
@@ -2036,7 +2194,7 @@ function WithdrawModalControlled({
|
|
|
2036
2194
|
resetWithdrawalLifecycle();
|
|
2037
2195
|
}
|
|
2038
2196
|
}, [open, resetWithdrawalLifecycle, initialFormStep]);
|
|
2039
|
-
|
|
2197
|
+
useEffect5(() => {
|
|
2040
2198
|
if (flowState.status !== "loading") return;
|
|
2041
2199
|
if (!withdrawalLifecycleState.terminal) return;
|
|
2042
2200
|
if (withdrawalLifecycleState.status === "completed") {
|
|
@@ -2111,15 +2269,15 @@ function WithdrawModalControlled({
|
|
|
2111
2269
|
tokenSymbol: withdrawFlow.selectedToken,
|
|
2112
2270
|
chainId: withdrawFlow.selectedNetwork
|
|
2113
2271
|
});
|
|
2114
|
-
return /* @__PURE__ */
|
|
2115
|
-
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsx15(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs15(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": (_a = transferTarget == null ? void 0 : transferTarget.title) != null ? _a : "Withdraw", children: [
|
|
2273
|
+
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ jsx15(
|
|
2116
2274
|
WithdrawMethodStep,
|
|
2117
2275
|
{
|
|
2118
2276
|
balance: withdrawFlow.balance,
|
|
2119
2277
|
onSelectMethod: () => setFlowState({ status: "form", formStep: "withdraw-amount" })
|
|
2120
2278
|
}
|
|
2121
2279
|
) : null,
|
|
2122
|
-
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */
|
|
2280
|
+
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ jsx15(
|
|
2123
2281
|
WithdrawAmountStep,
|
|
2124
2282
|
{
|
|
2125
2283
|
title: transferTarget == null ? void 0 : transferTarget.title,
|
|
@@ -2147,14 +2305,14 @@ function WithdrawModalControlled({
|
|
|
2147
2305
|
onContinue: handleConfirm
|
|
2148
2306
|
}
|
|
2149
2307
|
) : null,
|
|
2150
|
-
flowState.status === "loading" ? /* @__PURE__ */
|
|
2308
|
+
flowState.status === "loading" ? /* @__PURE__ */ jsx15(
|
|
2151
2309
|
WithdrawLoadingStep,
|
|
2152
2310
|
{
|
|
2153
2311
|
lifecycleState: withdrawalLifecycleState,
|
|
2154
2312
|
onClose: () => handleOpenChange(false)
|
|
2155
2313
|
}
|
|
2156
2314
|
) : null,
|
|
2157
|
-
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */
|
|
2315
|
+
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ jsx15(
|
|
2158
2316
|
WithdrawSuccessStep,
|
|
2159
2317
|
{
|
|
2160
2318
|
summary: terminalSummary,
|
|
@@ -2171,9 +2329,9 @@ function WithdrawModalControlled({
|
|
|
2171
2329
|
}
|
|
2172
2330
|
var WithdrawModal = (props) => {
|
|
2173
2331
|
if (isControlledWithdrawModalProps(props)) {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ jsx15(WithdrawModalControlled, __spreadValues({}, props));
|
|
2175
2333
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ jsx15(WithdrawModalSelfDriven, __spreadValues({}, props));
|
|
2177
2335
|
};
|
|
2178
2336
|
WithdrawModal.displayName = "WithdrawModal";
|
|
2179
2337
|
|
|
@@ -2197,19 +2355,19 @@ var subscribeAggDepositNotification = (handler) => {
|
|
|
2197
2355
|
};
|
|
2198
2356
|
|
|
2199
2357
|
// src/trading/manage-betdex-account-modal.tsx
|
|
2200
|
-
import { useEffect as
|
|
2201
|
-
import { useLabels as
|
|
2202
|
-
import * as
|
|
2358
|
+
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
2359
|
+
import { useLabels as useLabels19 } from "@agg-build/hooks";
|
|
2360
|
+
import * as Dialog7 from "@radix-ui/react-dialog";
|
|
2203
2361
|
|
|
2204
2362
|
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
2205
|
-
import { useState as
|
|
2206
|
-
import { useHostedVenueAccount, useLabels as
|
|
2207
|
-
import { Venue as
|
|
2363
|
+
import { useState as useState11 } from "react";
|
|
2364
|
+
import { useHostedVenueAccount, useLabels as useLabels17 } from "@agg-build/hooks";
|
|
2365
|
+
import { Venue as Venue5 } from "@agg-build/sdk";
|
|
2208
2366
|
|
|
2209
2367
|
// src/pages/user-profile/components/betdex-account-transfers.tsx
|
|
2210
|
-
import { useState as
|
|
2211
|
-
import { useDepositAddresses, useHostedVenueTransfers, useLabels as
|
|
2212
|
-
import { jsx as
|
|
2368
|
+
import { useState as useState9 } from "react";
|
|
2369
|
+
import { useDepositAddresses, useHostedVenueTransfers, useLabels as useLabels15 } from "@agg-build/hooks";
|
|
2370
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2213
2371
|
function hostedWithdrawalRaw(value) {
|
|
2214
2372
|
var _a;
|
|
2215
2373
|
const match = /^([0-9]{1,26})(?:\.([0-9]{1,6}))?$/.exec(value.trim());
|
|
@@ -2229,15 +2387,15 @@ function BetdexAccountTransfers({
|
|
|
2229
2387
|
canDeposit,
|
|
2230
2388
|
onWalletDeposit
|
|
2231
2389
|
}) {
|
|
2232
|
-
const labels =
|
|
2390
|
+
const labels = useLabels15().userProfile.hostedBetdex;
|
|
2233
2391
|
const transfer = useHostedVenueTransfers(accountId, environment);
|
|
2234
|
-
const [showWithdraw, setShowWithdraw] =
|
|
2392
|
+
const [showWithdraw, setShowWithdraw] = useState9(false);
|
|
2235
2393
|
const wallet = useDepositAddresses({
|
|
2236
2394
|
enabled: transfer.isAvailable && environment === "production" && showWithdraw
|
|
2237
2395
|
});
|
|
2238
|
-
const [amount2, setAmount] =
|
|
2239
|
-
const [destination, setDestination] =
|
|
2240
|
-
const [actionError, setActionError] =
|
|
2396
|
+
const [amount2, setAmount] = useState9("");
|
|
2397
|
+
const [destination, setDestination] = useState9("");
|
|
2398
|
+
const [actionError, setActionError] = useState9(false);
|
|
2241
2399
|
const raw = hostedWithdrawalRaw(amount2);
|
|
2242
2400
|
const withinBalance = raw !== null && (availableRaw === void 0 || BigInt(raw) <= BigInt(availableRaw));
|
|
2243
2401
|
const validDestination = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(destination.trim());
|
|
@@ -2248,9 +2406,9 @@ function BetdexAccountTransfers({
|
|
|
2248
2406
|
void work().catch(() => setActionError(true));
|
|
2249
2407
|
};
|
|
2250
2408
|
if (!transfer.isAvailable) return null;
|
|
2251
|
-
return /* @__PURE__ */
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
canDeposit && environment === "production" && onWalletDeposit ? /* @__PURE__ */
|
|
2409
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-3 border-t border-agg-separator pt-3", children: [
|
|
2410
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-2", children: [
|
|
2411
|
+
canDeposit && environment === "production" && onWalletDeposit ? /* @__PURE__ */ jsx16(
|
|
2254
2412
|
Button,
|
|
2255
2413
|
{
|
|
2256
2414
|
type: "button",
|
|
@@ -2265,7 +2423,7 @@ function BetdexAccountTransfers({
|
|
|
2265
2423
|
children: labels.fromWallet
|
|
2266
2424
|
}
|
|
2267
2425
|
) : null,
|
|
2268
|
-
canDeposit ? /* @__PURE__ */
|
|
2426
|
+
canDeposit ? /* @__PURE__ */ jsx16(
|
|
2269
2427
|
Button,
|
|
2270
2428
|
{
|
|
2271
2429
|
type: "button",
|
|
@@ -2278,7 +2436,7 @@ function BetdexAccountTransfers({
|
|
|
2278
2436
|
children: labels.deposit
|
|
2279
2437
|
}
|
|
2280
2438
|
) : null,
|
|
2281
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsx16(
|
|
2282
2440
|
Button,
|
|
2283
2441
|
{
|
|
2284
2442
|
type: "button",
|
|
@@ -2290,11 +2448,11 @@ function BetdexAccountTransfers({
|
|
|
2290
2448
|
}
|
|
2291
2449
|
)
|
|
2292
2450
|
] }),
|
|
2293
|
-
transfer.deposit.data ? /* @__PURE__ */
|
|
2294
|
-
/* @__PURE__ */
|
|
2295
|
-
/* @__PURE__ */
|
|
2451
|
+
transfer.deposit.data ? /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2452
|
+
/* @__PURE__ */ jsx16("p", { className: "text-agg-muted-foreground", children: labels.depositInstructions[environment] }),
|
|
2453
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 text-agg-muted-foreground", children: [
|
|
2296
2454
|
labels.depositAddress,
|
|
2297
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ jsx16(
|
|
2298
2456
|
"input",
|
|
2299
2457
|
{
|
|
2300
2458
|
readOnly: true,
|
|
@@ -2305,20 +2463,20 @@ function BetdexAccountTransfers({
|
|
|
2305
2463
|
)
|
|
2306
2464
|
] })
|
|
2307
2465
|
] }) : null,
|
|
2308
|
-
transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */
|
|
2309
|
-
transfer.request ? /* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2466
|
+
transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */ jsx16("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.transferUnavailable }) : null,
|
|
2467
|
+
transfer.request ? /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2468
|
+
/* @__PURE__ */ jsxs16("p", { children: [
|
|
2311
2469
|
labels.withdrawalAmount,
|
|
2312
2470
|
": ",
|
|
2313
2471
|
amountText(transfer.request.amountRaw)
|
|
2314
2472
|
] }),
|
|
2315
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsxs16("p", { className: "break-all", children: [
|
|
2316
2474
|
labels.withdrawalDestination,
|
|
2317
2475
|
": ",
|
|
2318
2476
|
transfer.request.destinationAddress
|
|
2319
2477
|
] }),
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
terminal ? /* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsx16("p", { role: "status", children: result ? labels.withdrawalStatuses[result.status] : labels.withdrawalUnknown }),
|
|
2479
|
+
terminal ? /* @__PURE__ */ jsx16(
|
|
2322
2480
|
Button,
|
|
2323
2481
|
{
|
|
2324
2482
|
type: "button",
|
|
@@ -2333,7 +2491,7 @@ function BetdexAccountTransfers({
|
|
|
2333
2491
|
},
|
|
2334
2492
|
children: labels.withdrawalNew
|
|
2335
2493
|
}
|
|
2336
|
-
) : /* @__PURE__ */
|
|
2494
|
+
) : /* @__PURE__ */ jsx16(
|
|
2337
2495
|
Button,
|
|
2338
2496
|
{
|
|
2339
2497
|
type: "button",
|
|
@@ -2346,7 +2504,7 @@ function BetdexAccountTransfers({
|
|
|
2346
2504
|
children: result ? labels.withdrawalCheck : labels.withdrawalRetry
|
|
2347
2505
|
}
|
|
2348
2506
|
)
|
|
2349
|
-
] }) : showWithdraw ? /* @__PURE__ */
|
|
2507
|
+
] }) : showWithdraw ? /* @__PURE__ */ jsxs16(
|
|
2350
2508
|
"form",
|
|
2351
2509
|
{
|
|
2352
2510
|
className: "flex flex-col gap-3",
|
|
@@ -2356,9 +2514,9 @@ function BetdexAccountTransfers({
|
|
|
2356
2514
|
run(() => transfer.submit(raw, destination.trim()));
|
|
2357
2515
|
},
|
|
2358
2516
|
children: [
|
|
2359
|
-
/* @__PURE__ */
|
|
2517
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
2360
2518
|
labels.withdrawalAmount,
|
|
2361
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ jsx16(
|
|
2362
2520
|
"input",
|
|
2363
2521
|
{
|
|
2364
2522
|
inputMode: "decimal",
|
|
@@ -2369,7 +2527,7 @@ function BetdexAccountTransfers({
|
|
|
2369
2527
|
}
|
|
2370
2528
|
)
|
|
2371
2529
|
] }),
|
|
2372
|
-
environment === "production" ? /* @__PURE__ */
|
|
2530
|
+
environment === "production" ? /* @__PURE__ */ jsx16(
|
|
2373
2531
|
Button,
|
|
2374
2532
|
{
|
|
2375
2533
|
type: "button",
|
|
@@ -2384,9 +2542,9 @@ function BetdexAccountTransfers({
|
|
|
2384
2542
|
children: labels.toWallet
|
|
2385
2543
|
}
|
|
2386
2544
|
) : null,
|
|
2387
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
2388
2546
|
labels.withdrawalDestination,
|
|
2389
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsx16(
|
|
2390
2548
|
"input",
|
|
2391
2549
|
{
|
|
2392
2550
|
autoComplete: "off",
|
|
@@ -2397,7 +2555,7 @@ function BetdexAccountTransfers({
|
|
|
2397
2555
|
}
|
|
2398
2556
|
)
|
|
2399
2557
|
] }),
|
|
2400
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx16(
|
|
2401
2559
|
Button,
|
|
2402
2560
|
{
|
|
2403
2561
|
type: "submit",
|
|
@@ -2416,9 +2574,9 @@ function BetdexAccountTransfers({
|
|
|
2416
2574
|
}
|
|
2417
2575
|
|
|
2418
2576
|
// src/pages/user-profile/components/betdex-account-activity.tsx
|
|
2419
|
-
import { useState as
|
|
2420
|
-
import { useHostedVenueActivity, useLabels as
|
|
2421
|
-
import { jsx as
|
|
2577
|
+
import { useState as useState10 } from "react";
|
|
2578
|
+
import { useHostedVenueActivity, useLabels as useLabels16 } from "@agg-build/hooks";
|
|
2579
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2422
2580
|
function amount(raw) {
|
|
2423
2581
|
const negative = raw.startsWith("-");
|
|
2424
2582
|
const digits = (negative ? raw.slice(1) : raw).padStart(19, "0");
|
|
@@ -2429,36 +2587,36 @@ function BetdexAccountActivity({
|
|
|
2429
2587
|
accountId,
|
|
2430
2588
|
environment
|
|
2431
2589
|
}) {
|
|
2432
|
-
const labels =
|
|
2433
|
-
const [page, setPage] =
|
|
2590
|
+
const labels = useLabels16().userProfile.hostedBetdex;
|
|
2591
|
+
const [page, setPage] = useState10(0);
|
|
2434
2592
|
const { activity, isAvailable } = useHostedVenueActivity("betdex", page);
|
|
2435
2593
|
if (!isAvailable) return null;
|
|
2436
2594
|
const data = activity.data;
|
|
2437
2595
|
const valid = (data == null ? void 0 : data.accountId) === accountId && data.environment === environment && data.page === page;
|
|
2438
2596
|
const unavailable = activity.isError || !!data && !valid;
|
|
2439
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ jsxs17(
|
|
2440
2598
|
"section",
|
|
2441
2599
|
{
|
|
2442
2600
|
"aria-label": labels.activityTitle,
|
|
2443
2601
|
className: "flex flex-col gap-3 border-t border-agg-separator pt-3",
|
|
2444
2602
|
children: [
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2447
|
-
activity.isPending ? /* @__PURE__ */
|
|
2448
|
-
unavailable ? /* @__PURE__ */
|
|
2449
|
-
valid && !unavailable ? data.items.length ? /* @__PURE__ */
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ jsx17("h4", { className: "agg-type-label text-agg-foreground", children: labels.activityTitle }),
|
|
2604
|
+
/* @__PURE__ */ jsx17("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityDescription }),
|
|
2605
|
+
activity.isPending ? /* @__PURE__ */ jsx17(SkeletonBlock, { className: "h-16 w-full" }) : null,
|
|
2606
|
+
unavailable ? /* @__PURE__ */ jsx17("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.activityUnavailable }) : null,
|
|
2607
|
+
valid && !unavailable ? data.items.length ? /* @__PURE__ */ jsx17("ul", { className: "flex flex-col gap-3 agg-type-caption", children: data.items.map((item) => /* @__PURE__ */ jsxs17("li", { className: "flex flex-col gap-1", children: [
|
|
2608
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex justify-between gap-3 text-agg-foreground", children: [
|
|
2609
|
+
/* @__PURE__ */ jsx17("span", { children: labels.activityCodes[item.code] }),
|
|
2610
|
+
/* @__PURE__ */ jsxs17("span", { className: "break-all tabular-nums", children: [
|
|
2453
2611
|
amount(item.amountRaw),
|
|
2454
2612
|
" ",
|
|
2455
2613
|
data.asset
|
|
2456
2614
|
] })
|
|
2457
2615
|
] }),
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
] }, item.id)) }) : /* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ jsx17("time", { dateTime: item.createdAt, className: "text-agg-muted-foreground", children: new Date(item.createdAt).toLocaleString() })
|
|
2617
|
+
] }, item.id)) }) : /* @__PURE__ */ jsx17("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityEmpty }) : null,
|
|
2618
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap gap-2", children: [
|
|
2619
|
+
/* @__PURE__ */ jsx17(
|
|
2462
2620
|
Button,
|
|
2463
2621
|
{
|
|
2464
2622
|
type: "button",
|
|
@@ -2469,7 +2627,7 @@ function BetdexAccountActivity({
|
|
|
2469
2627
|
children: labels.activityPrevious
|
|
2470
2628
|
}
|
|
2471
2629
|
),
|
|
2472
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ jsx17(
|
|
2473
2631
|
Button,
|
|
2474
2632
|
{
|
|
2475
2633
|
type: "button",
|
|
@@ -2482,7 +2640,7 @@ function BetdexAccountActivity({
|
|
|
2482
2640
|
children: labels.activityNext
|
|
2483
2641
|
}
|
|
2484
2642
|
),
|
|
2485
|
-
/* @__PURE__ */
|
|
2643
|
+
/* @__PURE__ */ jsx17(
|
|
2486
2644
|
Button,
|
|
2487
2645
|
{
|
|
2488
2646
|
type: "button",
|
|
@@ -2502,46 +2660,46 @@ function BetdexAccountActivity({
|
|
|
2502
2660
|
}
|
|
2503
2661
|
|
|
2504
2662
|
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
2505
|
-
import { Fragment as
|
|
2663
|
+
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2506
2664
|
function BetdexAccountCard({
|
|
2507
2665
|
onWalletDeposit
|
|
2508
2666
|
} = {}) {
|
|
2509
2667
|
var _a;
|
|
2510
|
-
const [showActivity, setShowActivity] =
|
|
2511
|
-
const labels =
|
|
2668
|
+
const [showActivity, setShowActivity] = useState11(false);
|
|
2669
|
+
const labels = useLabels17().userProfile.hostedBetdex;
|
|
2512
2670
|
const { account, provision, isAvailable } = useHostedVenueAccount("betdex");
|
|
2513
2671
|
const data = account.data;
|
|
2514
2672
|
if (!isAvailable || (data == null ? void 0 : data.status) === "disabled") return null;
|
|
2515
2673
|
const pending = provision.isPending || (data == null ? void 0 : data.status) === "provisioning";
|
|
2516
2674
|
const canCreate = (data == null ? void 0 : data.status) === "not_created" && data.provisioningEnabled;
|
|
2517
2675
|
const rawLabel = (raw) => formatUsd(Number(raw) / 1e6);
|
|
2518
|
-
return /* @__PURE__ */
|
|
2676
|
+
return /* @__PURE__ */ jsxs18(
|
|
2519
2677
|
"section",
|
|
2520
2678
|
{
|
|
2521
2679
|
"aria-label": labels.title,
|
|
2522
2680
|
className: "flex flex-col gap-3 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5",
|
|
2523
2681
|
children: [
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
2683
|
+
/* @__PURE__ */ jsx18(VenueLogo, { venue: Venue5.betdex, size: "small", className: "size-4" }),
|
|
2684
|
+
/* @__PURE__ */ jsx18("h3", { className: "agg-type-label text-agg-foreground", children: labels.title })
|
|
2527
2685
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
(data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */
|
|
2530
|
-
account.isPending ? /* @__PURE__ */
|
|
2531
|
-
(data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.description }),
|
|
2687
|
+
(data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-warning", children: labels.sandbox }) : null,
|
|
2688
|
+
account.isPending ? /* @__PURE__ */ jsx18(SkeletonBlock, { className: "h-10 w-full" }) : null,
|
|
2689
|
+
(data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */ jsx18("dl", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2532
2690
|
[labels.total, data.balance.totalRaw],
|
|
2533
2691
|
[labels.available, data.balance.availableRaw],
|
|
2534
2692
|
[labels.reserved, data.balance.unmatchedExposureRaw]
|
|
2535
|
-
].map(([label, raw]) => /* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */
|
|
2693
|
+
].map(([label, raw]) => /* @__PURE__ */ jsxs18("div", { className: "flex justify-between gap-3", children: [
|
|
2694
|
+
/* @__PURE__ */ jsx18("dt", { className: "text-agg-muted-foreground", children: label }),
|
|
2695
|
+
/* @__PURE__ */ jsx18("dd", { className: "text-agg-foreground", children: rawLabel(raw) })
|
|
2538
2696
|
] }, label)) }) : null,
|
|
2539
|
-
pending ? /* @__PURE__ */
|
|
2540
|
-
(data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */
|
|
2541
|
-
account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */
|
|
2542
|
-
(data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */
|
|
2543
|
-
provision.isError ? /* @__PURE__ */
|
|
2544
|
-
canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */
|
|
2697
|
+
pending ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioning }) : null,
|
|
2698
|
+
(data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.suspended }) : null,
|
|
2699
|
+
account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.unavailable }) : null,
|
|
2700
|
+
(data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioningUnavailable }) : null,
|
|
2701
|
+
provision.isError ? /* @__PURE__ */ jsx18("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.creationFailed }) : null,
|
|
2702
|
+
canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */ jsx18(
|
|
2545
2703
|
Button,
|
|
2546
2704
|
{
|
|
2547
2705
|
type: "button",
|
|
@@ -2554,7 +2712,7 @@ function BetdexAccountCard({
|
|
|
2554
2712
|
children: (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount
|
|
2555
2713
|
}
|
|
2556
2714
|
) : null,
|
|
2557
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ jsx18(
|
|
2558
2716
|
Button,
|
|
2559
2717
|
{
|
|
2560
2718
|
type: "button",
|
|
@@ -2567,11 +2725,11 @@ function BetdexAccountCard({
|
|
|
2567
2725
|
children: labels.refresh
|
|
2568
2726
|
}
|
|
2569
2727
|
),
|
|
2570
|
-
(data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2728
|
+
(data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2729
|
+
/* @__PURE__ */ jsxs18("details", { className: "group/agg-betdex-funds border-t border-agg-separator pt-3", children: [
|
|
2730
|
+
/* @__PURE__ */ jsxs18("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 text-agg-sm font-agg-bold text-agg-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary [&::-webkit-details-marker]:hidden", children: [
|
|
2573
2731
|
labels.manageFunds,
|
|
2574
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ jsx18(
|
|
2575
2733
|
Icon,
|
|
2576
2734
|
{
|
|
2577
2735
|
name: "chevron-down",
|
|
@@ -2580,7 +2738,7 @@ function BetdexAccountCard({
|
|
|
2580
2738
|
}
|
|
2581
2739
|
)
|
|
2582
2740
|
] }),
|
|
2583
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ jsx18(
|
|
2584
2742
|
BetdexAccountTransfers,
|
|
2585
2743
|
{
|
|
2586
2744
|
accountId: data.accountId,
|
|
@@ -2592,7 +2750,7 @@ function BetdexAccountCard({
|
|
|
2592
2750
|
`transfers:${data.accountId}:${data.environment}`
|
|
2593
2751
|
)
|
|
2594
2752
|
] }),
|
|
2595
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ jsx18(
|
|
2596
2754
|
Button,
|
|
2597
2755
|
{
|
|
2598
2756
|
type: "button",
|
|
@@ -2603,7 +2761,7 @@ function BetdexAccountCard({
|
|
|
2603
2761
|
children: showActivity ? labels.hideActivity : labels.showActivity
|
|
2604
2762
|
}
|
|
2605
2763
|
),
|
|
2606
|
-
showActivity ? /* @__PURE__ */
|
|
2764
|
+
showActivity ? /* @__PURE__ */ jsx18(
|
|
2607
2765
|
BetdexAccountActivity,
|
|
2608
2766
|
{
|
|
2609
2767
|
accountId: data.accountId,
|
|
@@ -2618,15 +2776,15 @@ function BetdexAccountCard({
|
|
|
2618
2776
|
}
|
|
2619
2777
|
|
|
2620
2778
|
// src/pages/user-profile/components/betdex-wallet-deposit.tsx
|
|
2621
|
-
import { useEffect as
|
|
2622
|
-
import { useLabels as
|
|
2779
|
+
import { useEffect as useEffect6 } from "react";
|
|
2780
|
+
import { useLabels as useLabels18 } from "@agg-build/hooks";
|
|
2623
2781
|
import { useWithdrawFlow as useWithdrawFlow2 } from "@agg-build/hooks/withdraw";
|
|
2624
|
-
import { jsx as
|
|
2782
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2625
2783
|
function BetdexWalletDeposit({
|
|
2626
2784
|
address,
|
|
2627
2785
|
onClose
|
|
2628
2786
|
}) {
|
|
2629
|
-
const labels =
|
|
2787
|
+
const labels = useLabels18().userProfile.hostedBetdex;
|
|
2630
2788
|
const flow = useWithdrawFlow2({
|
|
2631
2789
|
open: true,
|
|
2632
2790
|
onOpenChange: (open) => {
|
|
@@ -2634,12 +2792,12 @@ function BetdexWalletDeposit({
|
|
|
2634
2792
|
}
|
|
2635
2793
|
});
|
|
2636
2794
|
const { onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange } = flow;
|
|
2637
|
-
|
|
2795
|
+
useEffect6(() => {
|
|
2638
2796
|
onWithdrawDestinationChange(address);
|
|
2639
2797
|
onWithdrawNetworkChange("792703809");
|
|
2640
2798
|
onWithdrawTokenChange("USDC");
|
|
2641
2799
|
}, [address, onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange]);
|
|
2642
|
-
return /* @__PURE__ */
|
|
2800
|
+
return /* @__PURE__ */ jsx19(
|
|
2643
2801
|
WithdrawModal,
|
|
2644
2802
|
__spreadProps(__spreadValues({}, flow), {
|
|
2645
2803
|
transferTarget: {
|
|
@@ -2653,35 +2811,35 @@ function BetdexWalletDeposit({
|
|
|
2653
2811
|
}
|
|
2654
2812
|
|
|
2655
2813
|
// src/trading/manage-betdex-account-modal.tsx
|
|
2656
|
-
import { Fragment as
|
|
2814
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2657
2815
|
function ManageBetdexAccountModal({
|
|
2658
2816
|
open,
|
|
2659
2817
|
onOpenChange,
|
|
2660
2818
|
userId
|
|
2661
2819
|
}) {
|
|
2662
|
-
const labels =
|
|
2663
|
-
const [fundingTarget, setFundingTarget] =
|
|
2820
|
+
const labels = useLabels19();
|
|
2821
|
+
const [fundingTarget, setFundingTarget] = useState12(
|
|
2664
2822
|
null
|
|
2665
2823
|
);
|
|
2666
2824
|
const currentTarget = (fundingTarget == null ? void 0 : fundingTarget.userId) === userId ? fundingTarget : null;
|
|
2667
|
-
|
|
2825
|
+
useEffect7(() => {
|
|
2668
2826
|
if (!open) setFundingTarget(null);
|
|
2669
2827
|
}, [open]);
|
|
2670
|
-
|
|
2671
|
-
return /* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
|
|
2828
|
+
useEffect7(() => setFundingTarget(null), [userId]);
|
|
2829
|
+
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
2830
|
+
/* @__PURE__ */ jsx20(Modal, { open: open && !currentTarget, onOpenChange, children: /* @__PURE__ */ jsxs19(Modal.Container, { maxWidth: "600px", "aria-label": labels.trading.manageBetdexAccount, children: [
|
|
2831
|
+
/* @__PURE__ */ jsx20(
|
|
2832
|
+
Dialog7.Close,
|
|
2675
2833
|
{
|
|
2676
2834
|
"aria-label": labels.common.close,
|
|
2677
2835
|
className: "absolute right-4 top-4 z-10 flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-muted-foreground hover:bg-agg-quaternary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent",
|
|
2678
|
-
children: /* @__PURE__ */
|
|
2836
|
+
children: /* @__PURE__ */ jsx20(Icon, { name: "close", size: "medium" })
|
|
2679
2837
|
}
|
|
2680
2838
|
),
|
|
2681
|
-
/* @__PURE__ */
|
|
2682
|
-
/* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */
|
|
2684
|
-
open ? /* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsxs19(Modal.Body, { classNames: { root: "!px-5 !py-16" }, children: [
|
|
2840
|
+
/* @__PURE__ */ jsx20(Dialog7.Title, { className: "sr-only", children: labels.trading.manageBetdexAccount }),
|
|
2841
|
+
/* @__PURE__ */ jsx20(Dialog7.Description, { className: "sr-only", children: labels.userProfile.hostedBetdex.description }),
|
|
2842
|
+
open ? /* @__PURE__ */ jsx20(
|
|
2685
2843
|
BetdexAccountCard,
|
|
2686
2844
|
{
|
|
2687
2845
|
onWalletDeposit: userId ? (address) => setFundingTarget({ userId, address }) : void 0
|
|
@@ -2689,7 +2847,7 @@ function ManageBetdexAccountModal({
|
|
|
2689
2847
|
) : null
|
|
2690
2848
|
] })
|
|
2691
2849
|
] }) }),
|
|
2692
|
-
open && currentTarget ? /* @__PURE__ */
|
|
2850
|
+
open && currentTarget ? /* @__PURE__ */ jsx20(
|
|
2693
2851
|
BetdexWalletDeposit,
|
|
2694
2852
|
{
|
|
2695
2853
|
address: currentTarget.address,
|
|
@@ -2711,6 +2869,7 @@ export {
|
|
|
2711
2869
|
ConnectOnchainModal,
|
|
2712
2870
|
ConnectKalshiModal,
|
|
2713
2871
|
ConnectProphetxModal,
|
|
2872
|
+
ConnectNovigModal,
|
|
2714
2873
|
OnboardingModal,
|
|
2715
2874
|
mapNetworksToOptions,
|
|
2716
2875
|
DEFAULT_CURRENCY_OPTIONS,
|