@agg-build/ui 1.2.3 → 1.2.4
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-XCECYRTH.mjs → chunk-6FVYER7E.mjs} +3 -3
- package/dist/{chunk-TBKDLNOE.mjs → chunk-ISAU6HX5.mjs} +1 -1
- package/dist/{chunk-5FXMHTVR.mjs → chunk-OFFJNHAG.mjs} +1 -1
- package/dist/{chunk-E45WOOMN.mjs → chunk-P2OOA3U3.mjs} +2 -2
- package/dist/{chunk-34L7ZKJW.mjs → chunk-PALIVBG3.mjs} +1 -2
- package/dist/{chunk-Q2BRDVBU.mjs → chunk-UCH7MMRN.mjs} +50 -41
- package/dist/{chunk-XUYPM4LM.mjs → chunk-VH3DMH77.mjs} +46 -34
- package/dist/events.js +1 -2
- package/dist/events.mjs +3 -3
- package/dist/index.js +211 -185
- package/dist/index.mjs +7 -7
- package/dist/modals.js +751 -740
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +44 -33
- package/dist/pages.mjs +6 -6
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.mjs +4 -4
- package/dist/types/shared/constants.d.mts +3 -2
- package/dist/types/shared/constants.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5686,8 +5686,7 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
5686
5686
|
value: import_sdk2.Venue.hyperliquid,
|
|
5687
5687
|
label: labels.venues.hyperliquid,
|
|
5688
5688
|
venueLogo: import_sdk2.Venue.hyperliquid,
|
|
5689
|
-
venues: [import_sdk2.Venue.hyperliquid]
|
|
5690
|
-
isComingSoon: true
|
|
5689
|
+
venues: [import_sdk2.Venue.hyperliquid]
|
|
5691
5690
|
}
|
|
5692
5691
|
];
|
|
5693
5692
|
};
|
|
@@ -19950,18 +19949,20 @@ var formatChainIdLabel = (chainId) => {
|
|
|
19950
19949
|
|
|
19951
19950
|
// src/pages/user-profile/components/available-balance-card.tsx
|
|
19952
19951
|
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
19953
|
-
var
|
|
19954
|
-
|
|
19955
|
-
"
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
"137":
|
|
19960
|
-
"324":
|
|
19961
|
-
// zkSync (
|
|
19962
|
-
"
|
|
19963
|
-
"
|
|
19964
|
-
"
|
|
19952
|
+
var BASE_URL = "https://assets.snagsolutions.io";
|
|
19953
|
+
var CHAIN_ID_TO_ICON_URL = {
|
|
19954
|
+
"1": `${BASE_URL}/public/prediction-markets/logos/ETH.svg`,
|
|
19955
|
+
"10": `${BASE_URL}/public/prediction-markets/logos/ETH.svg`,
|
|
19956
|
+
// Optimism
|
|
19957
|
+
"56": `${BASE_URL}/public/prediction-markets/logos/BNB.svg`,
|
|
19958
|
+
"137": `${BASE_URL}/public/prediction-markets/logos/Polygon.svg`,
|
|
19959
|
+
"324": `${BASE_URL}/public/web/icons/chains/zksync/colored.svg`,
|
|
19960
|
+
// zkSync (no new logo)
|
|
19961
|
+
"747": `${BASE_URL}/public/prediction-markets/logos/Flow.svg`,
|
|
19962
|
+
"8453": `${BASE_URL}/public/prediction-markets/logos/Base.svg`,
|
|
19963
|
+
"42161": `${BASE_URL}/public/prediction-markets/logos/Arbitrum.svg`,
|
|
19964
|
+
"2741": `${BASE_URL}/public/prediction-markets/logos/Abstract.svg`,
|
|
19965
|
+
"792703809": `${BASE_URL}/public/prediction-markets/logos/Solana.svg`
|
|
19965
19966
|
};
|
|
19966
19967
|
var CHAIN_VENUE_MAP = {
|
|
19967
19968
|
"137": ["polymarket"],
|
|
@@ -19971,17 +19972,19 @@ var CHAIN_VENUE_MAP = {
|
|
|
19971
19972
|
"56": ["limitless", "opinion"]
|
|
19972
19973
|
// BNB
|
|
19973
19974
|
};
|
|
19974
|
-
var
|
|
19975
|
-
if (key &&
|
|
19975
|
+
var chainIconUrl = (label2, key) => {
|
|
19976
|
+
if (key && CHAIN_ID_TO_ICON_URL[key]) return CHAIN_ID_TO_ICON_URL[key];
|
|
19976
19977
|
const k = label2.trim().toLowerCase();
|
|
19977
|
-
if (k.includes("polygon")) return "
|
|
19978
|
-
if (k.includes("solana")) return "
|
|
19979
|
-
if (k.includes("base")) return "
|
|
19980
|
-
if (k.includes("arbitrum")) return "
|
|
19981
|
-
if (k.includes("
|
|
19982
|
-
if (k.includes("
|
|
19983
|
-
if (k.includes("
|
|
19984
|
-
if (k.includes("
|
|
19978
|
+
if (k.includes("polygon")) return CHAIN_ID_TO_ICON_URL["137"];
|
|
19979
|
+
if (k.includes("solana")) return CHAIN_ID_TO_ICON_URL["792703809"];
|
|
19980
|
+
if (k.includes("base")) return CHAIN_ID_TO_ICON_URL["8453"];
|
|
19981
|
+
if (k.includes("arbitrum")) return CHAIN_ID_TO_ICON_URL["42161"];
|
|
19982
|
+
if (k.includes("bnb")) return CHAIN_ID_TO_ICON_URL["56"];
|
|
19983
|
+
if (k.includes("flow")) return CHAIN_ID_TO_ICON_URL["747"];
|
|
19984
|
+
if (k.includes("abstract")) return CHAIN_ID_TO_ICON_URL["2741"];
|
|
19985
|
+
if (k.includes("optimism")) return CHAIN_ID_TO_ICON_URL["10"];
|
|
19986
|
+
if (k.includes("zksync")) return CHAIN_ID_TO_ICON_URL["324"];
|
|
19987
|
+
if (k.includes("ethereum") || k.includes("eth")) return CHAIN_ID_TO_ICON_URL["1"];
|
|
19985
19988
|
return void 0;
|
|
19986
19989
|
};
|
|
19987
19990
|
var AvailableBalanceCard = ({
|
|
@@ -20033,7 +20036,7 @@ var AvailableBalanceCard = ({
|
|
|
20033
20036
|
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: "Balance by network" }),
|
|
20034
20037
|
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { role: "list", className: "agg-balance-list flex flex-col gap-3 w-full", children: chains.map((row) => {
|
|
20035
20038
|
var _a;
|
|
20036
|
-
const
|
|
20039
|
+
const iconUrl = chainIconUrl(row.label, row.key);
|
|
20037
20040
|
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
|
|
20038
20041
|
"div",
|
|
20039
20042
|
{
|
|
@@ -20041,7 +20044,15 @@ var AvailableBalanceCard = ({
|
|
|
20041
20044
|
className: "agg-balance-row flex items-center justify-between self-stretch gap-3 w-full",
|
|
20042
20045
|
children: [
|
|
20043
20046
|
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
20044
|
-
|
|
20047
|
+
iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "overflow-clip flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
20048
|
+
"img",
|
|
20049
|
+
{
|
|
20050
|
+
src: iconUrl,
|
|
20051
|
+
alt: "",
|
|
20052
|
+
"aria-hidden": true,
|
|
20053
|
+
className: "size-full object-contain"
|
|
20054
|
+
}
|
|
20055
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: row.label.slice(0, 2).toUpperCase() }),
|
|
20045
20056
|
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: row.label })
|
|
20046
20057
|
] }),
|
|
20047
20058
|
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "w-[100px] shrink-0 whitespace-nowrap text-right tabular-nums font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground", children: row.balance.toLocaleString("en-US", {
|
|
@@ -20074,24 +20085,24 @@ var AvailableBalanceCard = ({
|
|
|
20074
20085
|
className: "agg-balance-trigger flex min-h-[20px] min-w-[20px] items-center gap-1 rounded-[6px] border-0 bg-agg-secondary-hover p-1.5",
|
|
20075
20086
|
children: [
|
|
20076
20087
|
(chains.slice(0, 4).length > 0 ? chains.slice(0, 4) : [{ key: "placeholder", label: "", balance: 0, accountCount: 0 }]).map((row) => {
|
|
20077
|
-
const
|
|
20078
|
-
return
|
|
20088
|
+
const iconUrl = chainIconUrl(row.label, row.key);
|
|
20089
|
+
return iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
20079
20090
|
"span",
|
|
20080
20091
|
{
|
|
20081
|
-
className: "relative
|
|
20082
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
20092
|
+
className: "overflow-clip relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary",
|
|
20093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("img", { src: iconUrl, alt: row.label, className: "size-full object-contain" })
|
|
20083
20094
|
},
|
|
20084
20095
|
`icon-${row.key}`
|
|
20085
20096
|
) : /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
20086
20097
|
"span",
|
|
20087
20098
|
{
|
|
20088
|
-
className: "relative
|
|
20099
|
+
className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary text-[10px] leading-3 text-agg-muted-foreground",
|
|
20089
20100
|
children: row.label ? row.label.slice(0, 2).toUpperCase() : ""
|
|
20090
20101
|
},
|
|
20091
20102
|
`icon-${row.key}`
|
|
20092
20103
|
);
|
|
20093
20104
|
}),
|
|
20094
|
-
chains.length > 4 ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("span", { className: "relative
|
|
20105
|
+
chains.length > 4 ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("span", { className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary font-agg-sans text-[10px] leading-3 text-agg-muted-foreground", children: [
|
|
20095
20106
|
"+",
|
|
20096
20107
|
chains.length - 4
|
|
20097
20108
|
] }) : null
|
|
@@ -22240,7 +22251,7 @@ var UserProfilePage = ({
|
|
|
22240
22251
|
const currentPriceCents = typeof displayCurrentPrice === "number" ? Math.round(displayCurrentPrice * 100) : null;
|
|
22241
22252
|
const pnlPrefix = (displayPnlValue != null ? displayPnlValue : 0) >= 0 ? "+" : "";
|
|
22242
22253
|
const pnlPercent = displayPnlPercent == null ? null : displayPnlPercent.toFixed(2);
|
|
22243
|
-
const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId)
|
|
22254
|
+
const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId) : [];
|
|
22244
22255
|
return {
|
|
22245
22256
|
id: `${group.targetMarketId}-${outcome.label}-${(_a2 = outcome.title) != null ? _a2 : ""}`,
|
|
22246
22257
|
eventId,
|
|
@@ -22471,40 +22482,51 @@ var UserProfilePage = ({
|
|
|
22471
22482
|
UserProfilePage.displayName = "UserProfilePage";
|
|
22472
22483
|
|
|
22473
22484
|
// src/deposit/index.tsx
|
|
22474
|
-
var
|
|
22485
|
+
var import_react40 = require("react");
|
|
22475
22486
|
var import_hooks69 = require("@agg-build/hooks");
|
|
22476
22487
|
var import_deposit = require("@agg-build/hooks/deposit");
|
|
22477
22488
|
|
|
22478
22489
|
// src/shared/constants.ts
|
|
22479
|
-
var import_react38 = __toESM(require("react"));
|
|
22480
22490
|
var USDC = {
|
|
22481
22491
|
value: "USDC",
|
|
22482
22492
|
label: "USDC",
|
|
22483
22493
|
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdc.svg"
|
|
22484
22494
|
};
|
|
22485
22495
|
var SUPPORTED_NETWORKS = [
|
|
22496
|
+
{
|
|
22497
|
+
value: "abstract",
|
|
22498
|
+
label: "Abstract",
|
|
22499
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Abstract.svg",
|
|
22500
|
+
tokens: [USDC]
|
|
22501
|
+
},
|
|
22486
22502
|
{
|
|
22487
22503
|
value: "arbitrum",
|
|
22488
22504
|
label: "Arbitrum One",
|
|
22489
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22505
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Arbitrum.svg",
|
|
22490
22506
|
tokens: [USDC]
|
|
22491
22507
|
},
|
|
22492
22508
|
{
|
|
22493
22509
|
value: "base",
|
|
22494
22510
|
label: "Base",
|
|
22495
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22511
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Base.svg",
|
|
22496
22512
|
tokens: [USDC]
|
|
22497
22513
|
},
|
|
22498
22514
|
{
|
|
22499
22515
|
value: "bnb",
|
|
22500
22516
|
label: "BNB Chain",
|
|
22501
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22517
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/BNB.svg",
|
|
22518
|
+
tokens: [USDC]
|
|
22519
|
+
},
|
|
22520
|
+
{
|
|
22521
|
+
value: "flow",
|
|
22522
|
+
label: "Flow",
|
|
22523
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Flow.svg",
|
|
22502
22524
|
tokens: [USDC]
|
|
22503
22525
|
},
|
|
22504
22526
|
{
|
|
22505
22527
|
value: "mainnet",
|
|
22506
22528
|
label: "Ethereum",
|
|
22507
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22529
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/ETH.svg",
|
|
22508
22530
|
tokens: [USDC]
|
|
22509
22531
|
},
|
|
22510
22532
|
{
|
|
@@ -22516,13 +22538,13 @@ var SUPPORTED_NETWORKS = [
|
|
|
22516
22538
|
{
|
|
22517
22539
|
value: "polygon",
|
|
22518
22540
|
label: "Polygon Mainnet",
|
|
22519
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22541
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Polygon.svg",
|
|
22520
22542
|
tokens: [USDC]
|
|
22521
22543
|
},
|
|
22522
22544
|
{
|
|
22523
22545
|
value: "solana",
|
|
22524
22546
|
label: "Solana",
|
|
22525
|
-
iconUrl: "https://assets.snagsolutions.io/public/
|
|
22547
|
+
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Solana.svg",
|
|
22526
22548
|
tokens: [USDC]
|
|
22527
22549
|
},
|
|
22528
22550
|
{
|
|
@@ -22533,15 +22555,11 @@ var SUPPORTED_NETWORKS = [
|
|
|
22533
22555
|
}
|
|
22534
22556
|
];
|
|
22535
22557
|
var mapNetworksToOptions = () => {
|
|
22536
|
-
return SUPPORTED_NETWORKS.map((n) => {
|
|
22537
|
-
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
iconUrl: n.iconUrl,
|
|
22542
|
-
icon: Component2 ? import_react38.default.createElement(Component2) : void 0
|
|
22543
|
-
};
|
|
22544
|
-
});
|
|
22558
|
+
return SUPPORTED_NETWORKS.map((n) => ({
|
|
22559
|
+
value: n.value,
|
|
22560
|
+
label: n.label,
|
|
22561
|
+
iconUrl: n.iconUrl
|
|
22562
|
+
}));
|
|
22545
22563
|
};
|
|
22546
22564
|
var DEFAULT_CURRENCY_OPTIONS = [
|
|
22547
22565
|
{
|
|
@@ -22596,27 +22614,19 @@ var CHAIN_ID_TO_SLUG = {
|
|
|
22596
22614
|
"56": "bnb",
|
|
22597
22615
|
"137": "polygon",
|
|
22598
22616
|
"324": "zksync",
|
|
22617
|
+
"747": "flow",
|
|
22599
22618
|
"8453": "base",
|
|
22600
22619
|
"42161": "arbitrum",
|
|
22620
|
+
"2741": "abstract",
|
|
22601
22621
|
"792703809": "solana"
|
|
22602
22622
|
};
|
|
22603
|
-
var CHAIN_ICON_COMPONENTS = {
|
|
22604
|
-
mainnet: EthereumIcon,
|
|
22605
|
-
polygon: PolygonIcon,
|
|
22606
|
-
base: BaseIcon,
|
|
22607
|
-
arbitrum: ArbitrumIcon,
|
|
22608
|
-
solana: SolanaIcon,
|
|
22609
|
-
bnb: BnbIcon
|
|
22610
|
-
};
|
|
22611
22623
|
var withNetworkIcons = (options) => {
|
|
22612
22624
|
const bySlug = new Map(SUPPORTED_NETWORKS.map((n) => [n.value, n.iconUrl]));
|
|
22613
22625
|
return options.map((o) => {
|
|
22614
|
-
var _a, _b
|
|
22626
|
+
var _a, _b;
|
|
22615
22627
|
const slug = (_a = CHAIN_ID_TO_SLUG[o.value]) != null ? _a : o.value;
|
|
22616
|
-
const Component2 = CHAIN_ICON_COMPONENTS[slug];
|
|
22617
22628
|
return __spreadProps(__spreadValues({}, o), {
|
|
22618
|
-
iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug)
|
|
22619
|
-
icon: (_c = o.icon) != null ? _c : Component2 ? import_react38.default.createElement(Component2) : void 0
|
|
22629
|
+
iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug)
|
|
22620
22630
|
});
|
|
22621
22631
|
});
|
|
22622
22632
|
};
|
|
@@ -22639,13 +22649,29 @@ var mergeSelectOptionsUnique = (base, fill) => {
|
|
|
22639
22649
|
};
|
|
22640
22650
|
|
|
22641
22651
|
// src/deposit/deposit-modal.constants.ts
|
|
22642
|
-
var
|
|
22652
|
+
var BASE_URL2 = "https://assets.snagsolutions.io";
|
|
22643
22653
|
var CARD_NETWORK_OPTIONS = [
|
|
22644
|
-
{
|
|
22645
|
-
|
|
22646
|
-
|
|
22647
|
-
|
|
22648
|
-
|
|
22654
|
+
{
|
|
22655
|
+
value: "ethereum",
|
|
22656
|
+
label: "Ethereum",
|
|
22657
|
+
iconUrl: `${BASE_URL2}/public/prediction-markets/logos/ETH.svg`
|
|
22658
|
+
},
|
|
22659
|
+
{
|
|
22660
|
+
value: "arbitrum",
|
|
22661
|
+
label: "Arbitrum",
|
|
22662
|
+
iconUrl: `${BASE_URL2}/public/prediction-markets/logos/Arbitrum.svg`
|
|
22663
|
+
},
|
|
22664
|
+
{ value: "base", label: "Base", iconUrl: `${BASE_URL2}/public/prediction-markets/logos/Base.svg` },
|
|
22665
|
+
{
|
|
22666
|
+
value: "solana",
|
|
22667
|
+
label: "Solana",
|
|
22668
|
+
iconUrl: `${BASE_URL2}/public/prediction-markets/logos/Solana.svg`
|
|
22669
|
+
},
|
|
22670
|
+
{
|
|
22671
|
+
value: "polygon",
|
|
22672
|
+
label: "Polygon",
|
|
22673
|
+
iconUrl: `${BASE_URL2}/public/prediction-markets/logos/Polygon.svg`
|
|
22674
|
+
}
|
|
22649
22675
|
];
|
|
22650
22676
|
var NETWORK_TO_CURRENCY_CODE = {
|
|
22651
22677
|
ethereum: "USDC",
|
|
@@ -22758,7 +22784,7 @@ var DepositMethodStep = ({
|
|
|
22758
22784
|
|
|
22759
22785
|
// src/deposit/steps/card-deposit.tsx
|
|
22760
22786
|
var import_hooks61 = require("@agg-build/hooks");
|
|
22761
|
-
var
|
|
22787
|
+
var import_react38 = require("react");
|
|
22762
22788
|
var import_jsx_runtime154 = require("react/jsx-runtime");
|
|
22763
22789
|
var CardDepositStep = ({
|
|
22764
22790
|
amount,
|
|
@@ -22776,8 +22802,8 @@ var CardDepositStep = ({
|
|
|
22776
22802
|
onContinue
|
|
22777
22803
|
}) => {
|
|
22778
22804
|
const labels = (0, import_hooks61.useLabels)();
|
|
22779
|
-
const [localAmount, setLocalAmount] = (0,
|
|
22780
|
-
(0,
|
|
22805
|
+
const [localAmount, setLocalAmount] = (0, import_react38.useState)(amount);
|
|
22806
|
+
(0, import_react38.useEffect)(() => {
|
|
22781
22807
|
setLocalAmount(amount);
|
|
22782
22808
|
}, [amount]);
|
|
22783
22809
|
const numericAmount = Number(localAmount) || 0;
|
|
@@ -23447,7 +23473,7 @@ var CardPurchaseSuccessStep = ({
|
|
|
23447
23473
|
|
|
23448
23474
|
// src/deposit/steps/wallet-processing.tsx
|
|
23449
23475
|
var import_hooks67 = require("@agg-build/hooks");
|
|
23450
|
-
var
|
|
23476
|
+
var import_react39 = require("react");
|
|
23451
23477
|
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
23452
23478
|
var WalletProcessingStep = ({
|
|
23453
23479
|
steps,
|
|
@@ -23455,7 +23481,7 @@ var WalletProcessingStep = ({
|
|
|
23455
23481
|
onComplete
|
|
23456
23482
|
}) => {
|
|
23457
23483
|
const labels = (0, import_hooks67.useLabels)();
|
|
23458
|
-
(0,
|
|
23484
|
+
(0, import_react39.useEffect)(() => {
|
|
23459
23485
|
const allDone = steps.length > 0 && steps.every((s) => s.status === "complete");
|
|
23460
23486
|
if (allDone) {
|
|
23461
23487
|
onComplete();
|
|
@@ -23625,28 +23651,28 @@ function DepositModalControlled({
|
|
|
23625
23651
|
const { walletActions } = (0, import_hooks69.useAggUiConfig)();
|
|
23626
23652
|
const labels = (0, import_hooks69.useLabels)();
|
|
23627
23653
|
const defaultMethod = isWeb3User ? "wallet" : "crypto";
|
|
23628
|
-
const [step, setStep] = (0,
|
|
23654
|
+
const [step, setStep] = (0, import_react40.useState)(
|
|
23629
23655
|
() => pendingCardPurchaseSummary ? "card-success" : "method"
|
|
23630
23656
|
);
|
|
23631
|
-
const [highlightedMethod, setHighlightedMethod] = (0,
|
|
23632
|
-
const walletSubmitInFlightRef = (0,
|
|
23633
|
-
const [isWalletSubmitting, setIsWalletSubmitting] = (0,
|
|
23634
|
-
const [cardProviders, setCardProviders] = (0,
|
|
23635
|
-
const [quotesLoading, setQuotesLoading] = (0,
|
|
23636
|
-
const [quotesError, setQuotesError] = (0,
|
|
23637
|
-
const [sessionError, setSessionError] = (0,
|
|
23638
|
-
const [pendingProviderName, setPendingProviderName] = (0,
|
|
23639
|
-
const [pendingProviderWalletAddress, setPendingProviderWalletAddress] = (0,
|
|
23640
|
-
(0,
|
|
23657
|
+
const [highlightedMethod, setHighlightedMethod] = (0, import_react40.useState)(defaultMethod);
|
|
23658
|
+
const walletSubmitInFlightRef = (0, import_react40.useRef)(false);
|
|
23659
|
+
const [isWalletSubmitting, setIsWalletSubmitting] = (0, import_react40.useState)(false);
|
|
23660
|
+
const [cardProviders, setCardProviders] = (0, import_react40.useState)([]);
|
|
23661
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react40.useState)(false);
|
|
23662
|
+
const [quotesError, setQuotesError] = (0, import_react40.useState)(null);
|
|
23663
|
+
const [sessionError, setSessionError] = (0, import_react40.useState)(null);
|
|
23664
|
+
const [pendingProviderName, setPendingProviderName] = (0, import_react40.useState)("");
|
|
23665
|
+
const [pendingProviderWalletAddress, setPendingProviderWalletAddress] = (0, import_react40.useState)("");
|
|
23666
|
+
(0, import_react40.useEffect)(() => {
|
|
23641
23667
|
if (pendingCardPurchaseSummary) {
|
|
23642
23668
|
clearPendingCardSession();
|
|
23643
23669
|
setStep("card-success");
|
|
23644
23670
|
}
|
|
23645
23671
|
}, [pendingCardPurchaseSummary]);
|
|
23646
|
-
const [walletChainId, setWalletChainId] = (0,
|
|
23647
|
-
const [walletToken, setWalletToken] = (0,
|
|
23648
|
-
const [sendChainId, setSendChainId] = (0,
|
|
23649
|
-
const [sendToken, setSendToken] = (0,
|
|
23672
|
+
const [walletChainId, setWalletChainId] = (0, import_react40.useState)("");
|
|
23673
|
+
const [walletToken, setWalletToken] = (0, import_react40.useState)("");
|
|
23674
|
+
const [sendChainId, setSendChainId] = (0, import_react40.useState)("");
|
|
23675
|
+
const [sendToken, setSendToken] = (0, import_react40.useState)("");
|
|
23650
23676
|
const {
|
|
23651
23677
|
isReady,
|
|
23652
23678
|
isTimedOut,
|
|
@@ -23654,14 +23680,14 @@ function DepositModalControlled({
|
|
|
23654
23680
|
supportedChains,
|
|
23655
23681
|
getAddress
|
|
23656
23682
|
} = (0, import_hooks69.useDepositAddresses)({ enabled: open });
|
|
23657
|
-
const fallbackNetworkOptions = (0,
|
|
23658
|
-
const networkOptions = (0,
|
|
23683
|
+
const fallbackNetworkOptions = (0, import_react40.useMemo)(() => mapNetworksToOptions(), []);
|
|
23684
|
+
const networkOptions = (0, import_react40.useMemo)(() => {
|
|
23659
23685
|
if (!(supportedChains == null ? void 0 : supportedChains.length)) return fallbackNetworkOptions;
|
|
23660
23686
|
return withNetworkIcons(
|
|
23661
23687
|
supportedChains.map((c) => ({ value: String(c.chainId), label: c.name }))
|
|
23662
23688
|
);
|
|
23663
23689
|
}, [supportedChains, fallbackNetworkOptions]);
|
|
23664
|
-
const walletNetworkOptions = (0,
|
|
23690
|
+
const walletNetworkOptions = (0, import_react40.useMemo)(() => {
|
|
23665
23691
|
if (!(supportedChains == null ? void 0 : supportedChains.length) || !connectedWalletKind) return networkOptions;
|
|
23666
23692
|
const filtered = supportedChains.filter(
|
|
23667
23693
|
(c) => connectedWalletKind === "solana" ? import_deposit.SVM_CHAIN_IDS.has(c.chainId) : !import_deposit.SVM_CHAIN_IDS.has(c.chainId)
|
|
@@ -23669,17 +23695,17 @@ function DepositModalControlled({
|
|
|
23669
23695
|
if (filtered.length === 0) return networkOptions;
|
|
23670
23696
|
return withNetworkIcons(filtered.map((c) => ({ value: String(c.chainId), label: c.name })));
|
|
23671
23697
|
}, [supportedChains, networkOptions, connectedWalletKind]);
|
|
23672
|
-
const walletTokenOptions = (0,
|
|
23698
|
+
const walletTokenOptions = (0, import_react40.useMemo)(() => {
|
|
23673
23699
|
const chain = supportedChains == null ? void 0 : supportedChains.find((c) => String(c.chainId) === walletChainId);
|
|
23674
23700
|
if (!chain) return withTokenIcons(DEFAULT_CURRENCY_OPTIONS);
|
|
23675
23701
|
return withTokenIcons(chain.tokens.map((t) => ({ value: t.symbol, label: t.symbol })));
|
|
23676
23702
|
}, [supportedChains, walletChainId]);
|
|
23677
|
-
const sendTokenOptions = (0,
|
|
23703
|
+
const sendTokenOptions = (0, import_react40.useMemo)(() => {
|
|
23678
23704
|
const chain = supportedChains == null ? void 0 : supportedChains.find((c) => String(c.chainId) === sendChainId);
|
|
23679
23705
|
if (!chain) return withTokenIcons(DEFAULT_CURRENCY_OPTIONS);
|
|
23680
23706
|
return withTokenIcons(chain.tokens.map((t) => ({ value: t.symbol, label: t.symbol })));
|
|
23681
23707
|
}, [supportedChains, sendChainId]);
|
|
23682
|
-
(0,
|
|
23708
|
+
(0, import_react40.useEffect)(() => {
|
|
23683
23709
|
if (walletNetworkOptions.length > 0) {
|
|
23684
23710
|
if (!walletChainId || !walletNetworkOptions.some((o) => o.value === walletChainId)) {
|
|
23685
23711
|
const preferred = initialWalletChainId && walletNetworkOptions.some((o) => o.value === initialWalletChainId) ? initialWalletChainId : walletNetworkOptions[0].value;
|
|
@@ -23687,25 +23713,25 @@ function DepositModalControlled({
|
|
|
23687
23713
|
}
|
|
23688
23714
|
}
|
|
23689
23715
|
}, [walletNetworkOptions, walletChainId, initialWalletChainId]);
|
|
23690
|
-
(0,
|
|
23716
|
+
(0, import_react40.useEffect)(() => {
|
|
23691
23717
|
if (networkOptions.length > 0) {
|
|
23692
23718
|
if (!sendChainId || !networkOptions.some((o) => o.value === sendChainId)) {
|
|
23693
23719
|
setSendChainId(networkOptions[0].value);
|
|
23694
23720
|
}
|
|
23695
23721
|
}
|
|
23696
23722
|
}, [networkOptions, sendChainId]);
|
|
23697
|
-
(0,
|
|
23723
|
+
(0, import_react40.useEffect)(() => {
|
|
23698
23724
|
if (walletTokenOptions.length > 0) setWalletToken(walletTokenOptions[0].value);
|
|
23699
23725
|
}, [walletTokenOptions]);
|
|
23700
|
-
(0,
|
|
23726
|
+
(0, import_react40.useEffect)(() => {
|
|
23701
23727
|
if (sendTokenOptions.length > 0) setSendToken(sendTokenOptions[0].value);
|
|
23702
23728
|
}, [sendTokenOptions]);
|
|
23703
|
-
(0,
|
|
23729
|
+
(0, import_react40.useEffect)(() => {
|
|
23704
23730
|
if (walletChainId) {
|
|
23705
23731
|
onWalletNetworkChange == null ? void 0 : onWalletNetworkChange(walletChainId);
|
|
23706
23732
|
}
|
|
23707
23733
|
}, [walletChainId, onWalletNetworkChange]);
|
|
23708
|
-
(0,
|
|
23734
|
+
(0, import_react40.useEffect)(() => {
|
|
23709
23735
|
if (walletToken) {
|
|
23710
23736
|
onWalletTokenChange == null ? void 0 : onWalletTokenChange(walletToken);
|
|
23711
23737
|
}
|
|
@@ -23724,7 +23750,7 @@ function DepositModalControlled({
|
|
|
23724
23750
|
fromWallet: walletFlow.walletLabel,
|
|
23725
23751
|
gasFee: ""
|
|
23726
23752
|
}, walletFlow.successSummary);
|
|
23727
|
-
(0,
|
|
23753
|
+
(0, import_react40.useEffect)(() => {
|
|
23728
23754
|
if (step === "wallet-processing" && !isWalletSubmitting && walletFlow.transactionStatus === "settled") {
|
|
23729
23755
|
setStep("wallet-success");
|
|
23730
23756
|
}
|
|
@@ -24050,7 +24076,7 @@ var DepositModal = (props) => {
|
|
|
24050
24076
|
DepositModal.displayName = "DepositModal";
|
|
24051
24077
|
|
|
24052
24078
|
// src/withdraw/index.tsx
|
|
24053
|
-
var
|
|
24079
|
+
var import_react42 = require("react");
|
|
24054
24080
|
var import_withdraw2 = require("@agg-build/hooks/withdraw");
|
|
24055
24081
|
|
|
24056
24082
|
// src/withdraw/steps/withdraw-method.tsx
|
|
@@ -24240,7 +24266,7 @@ var WithdrawAmountStep = ({
|
|
|
24240
24266
|
};
|
|
24241
24267
|
|
|
24242
24268
|
// src/withdraw/steps/withdraw-success.tsx
|
|
24243
|
-
var
|
|
24269
|
+
var import_react41 = require("react");
|
|
24244
24270
|
var import_hooks72 = require("@agg-build/hooks");
|
|
24245
24271
|
var import_withdraw = require("@agg-build/hooks/withdraw");
|
|
24246
24272
|
|
|
@@ -24374,7 +24400,7 @@ var WithdrawSuccessStep = ({
|
|
|
24374
24400
|
features: { enableAnimations }
|
|
24375
24401
|
} = (0, import_hooks72.useSdkUiConfig)();
|
|
24376
24402
|
const { state } = (0, import_withdraw.useWithdrawalLifecycle)(withdrawalId);
|
|
24377
|
-
const [isTimelineExpanded, setIsTimelineExpanded] = (0,
|
|
24403
|
+
const [isTimelineExpanded, setIsTimelineExpanded] = (0, import_react41.useState)(true);
|
|
24378
24404
|
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
24379
24405
|
const { groups, finalStep, hasDetails } = buildWithdrawalLifecycleSteps({
|
|
24380
24406
|
pending: state.pending,
|
|
@@ -24382,7 +24408,7 @@ var WithdrawSuccessStep = ({
|
|
|
24382
24408
|
legs: state.legs,
|
|
24383
24409
|
walletFlowLabels
|
|
24384
24410
|
});
|
|
24385
|
-
(0,
|
|
24411
|
+
(0, import_react41.useEffect)(() => {
|
|
24386
24412
|
if (!state.terminal) return;
|
|
24387
24413
|
if (state.status !== "completed") return;
|
|
24388
24414
|
const timer = window.setTimeout(() => onClose(), 1500);
|
|
@@ -24574,10 +24600,10 @@ function WithdrawModalControlled({
|
|
|
24574
24600
|
onSelectWithdrawProvider,
|
|
24575
24601
|
onDoneWithdraw
|
|
24576
24602
|
}) {
|
|
24577
|
-
const [step, setStep] = (0,
|
|
24578
|
-
const [isConfirming, setIsConfirming] = (0,
|
|
24579
|
-
const [confirmError, setConfirmError] = (0,
|
|
24580
|
-
(0,
|
|
24603
|
+
const [step, setStep] = (0, import_react42.useState)("method");
|
|
24604
|
+
const [isConfirming, setIsConfirming] = (0, import_react42.useState)(false);
|
|
24605
|
+
const [confirmError, setConfirmError] = (0, import_react42.useState)(null);
|
|
24606
|
+
(0, import_react42.useEffect)(() => {
|
|
24581
24607
|
if (!open) {
|
|
24582
24608
|
setStep("method");
|
|
24583
24609
|
setIsConfirming(false);
|
|
@@ -24660,7 +24686,7 @@ var WithdrawModal = (props) => {
|
|
|
24660
24686
|
WithdrawModal.displayName = "WithdrawModal";
|
|
24661
24687
|
|
|
24662
24688
|
// src/onboarding/index.tsx
|
|
24663
|
-
var
|
|
24689
|
+
var import_react47 = require("react");
|
|
24664
24690
|
var import_hooks78 = require("@agg-build/hooks");
|
|
24665
24691
|
var Dialog6 = __toESM(require("@radix-ui/react-dialog"));
|
|
24666
24692
|
|
|
@@ -24680,7 +24706,7 @@ var ONBOARDING_STEPS = {
|
|
|
24680
24706
|
var ONCHAIN_VENUES = [import_sdk19.Venue.polymarket, import_sdk19.Venue.opinion, import_sdk19.Venue.predict];
|
|
24681
24707
|
|
|
24682
24708
|
// src/onboarding/steps/how-it-works.tsx
|
|
24683
|
-
var
|
|
24709
|
+
var import_react43 = require("react");
|
|
24684
24710
|
var import_hooks73 = require("@agg-build/hooks");
|
|
24685
24711
|
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
24686
24712
|
var defaultIcons = {
|
|
@@ -24691,10 +24717,10 @@ var defaultIcons = {
|
|
|
24691
24717
|
};
|
|
24692
24718
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
24693
24719
|
const labels = (0, import_hooks73.useLabels)();
|
|
24694
|
-
const scrollRef = (0,
|
|
24695
|
-
const [showTopGradient, setShowTopGradient] = (0,
|
|
24696
|
-
const [showBottomGradient, setShowBottomGradient] = (0,
|
|
24697
|
-
const handleScroll = (0,
|
|
24720
|
+
const scrollRef = (0, import_react43.useRef)(null);
|
|
24721
|
+
const [showTopGradient, setShowTopGradient] = (0, import_react43.useState)(false);
|
|
24722
|
+
const [showBottomGradient, setShowBottomGradient] = (0, import_react43.useState)(true);
|
|
24723
|
+
const handleScroll = (0, import_react43.useCallback)(() => {
|
|
24698
24724
|
const el = scrollRef.current;
|
|
24699
24725
|
if (!el) return;
|
|
24700
24726
|
setShowTopGradient(el.scrollTop > 0);
|
|
@@ -24763,20 +24789,20 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
24763
24789
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
24764
24790
|
|
|
24765
24791
|
// src/onboarding/steps/profile-setup.tsx
|
|
24766
|
-
var
|
|
24792
|
+
var import_react44 = require("react");
|
|
24767
24793
|
var import_hooks74 = require("@agg-build/hooks");
|
|
24768
24794
|
var import_jsx_runtime169 = require("react/jsx-runtime");
|
|
24769
24795
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
24770
24796
|
const labels = (0, import_hooks74.useLabels)();
|
|
24771
|
-
const [username, setUsername] = (0,
|
|
24772
|
-
const [avatarFile, setAvatarFile] = (0,
|
|
24773
|
-
const [avatarPreview, setAvatarPreview] = (0,
|
|
24774
|
-
const fileInputRef = (0,
|
|
24775
|
-
const handleAvatarClick = (0,
|
|
24797
|
+
const [username, setUsername] = (0, import_react44.useState)("");
|
|
24798
|
+
const [avatarFile, setAvatarFile] = (0, import_react44.useState)();
|
|
24799
|
+
const [avatarPreview, setAvatarPreview] = (0, import_react44.useState)();
|
|
24800
|
+
const fileInputRef = (0, import_react44.useRef)(null);
|
|
24801
|
+
const handleAvatarClick = (0, import_react44.useCallback)(() => {
|
|
24776
24802
|
var _a;
|
|
24777
24803
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
24778
24804
|
}, []);
|
|
24779
|
-
const handleFileChange = (0,
|
|
24805
|
+
const handleFileChange = (0, import_react44.useCallback)((e) => {
|
|
24780
24806
|
var _a;
|
|
24781
24807
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
24782
24808
|
if (!file) return;
|
|
@@ -24788,7 +24814,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
24788
24814
|
};
|
|
24789
24815
|
reader.readAsDataURL(file);
|
|
24790
24816
|
}, []);
|
|
24791
|
-
const handleContinue = (0,
|
|
24817
|
+
const handleContinue = (0, import_react44.useCallback)(() => {
|
|
24792
24818
|
onContinue({
|
|
24793
24819
|
username,
|
|
24794
24820
|
avatarFile,
|
|
@@ -25030,7 +25056,7 @@ ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
|
25030
25056
|
|
|
25031
25057
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
25032
25058
|
var import_sdk21 = require("@agg-build/sdk");
|
|
25033
|
-
var
|
|
25059
|
+
var import_react45 = require("react");
|
|
25034
25060
|
var import_hooks76 = require("@agg-build/hooks");
|
|
25035
25061
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
25036
25062
|
var import_jsx_runtime171 = require("react/jsx-runtime");
|
|
@@ -25040,15 +25066,15 @@ var ConnectKalshiModal = ({
|
|
|
25040
25066
|
onVerify
|
|
25041
25067
|
}) => {
|
|
25042
25068
|
const labels = (0, import_hooks76.useLabels)();
|
|
25043
|
-
const [apiKeyId, setApiKeyId] = (0,
|
|
25044
|
-
const [privateKey, setPrivateKey] = (0,
|
|
25045
|
-
const [verifying, setVerifying] = (0,
|
|
25046
|
-
const [error, setError] = (0,
|
|
25069
|
+
const [apiKeyId, setApiKeyId] = (0, import_react45.useState)("");
|
|
25070
|
+
const [privateKey, setPrivateKey] = (0, import_react45.useState)("");
|
|
25071
|
+
const [verifying, setVerifying] = (0, import_react45.useState)(false);
|
|
25072
|
+
const [error, setError] = (0, import_react45.useState)();
|
|
25047
25073
|
const canVerify = apiKeyId.trim().length > 0 && privateKey.trim().length > 0;
|
|
25048
|
-
const handleCancel = (0,
|
|
25074
|
+
const handleCancel = (0, import_react45.useCallback)(() => {
|
|
25049
25075
|
onOpenChange(false);
|
|
25050
25076
|
}, [onOpenChange]);
|
|
25051
|
-
const handleVerify = (0,
|
|
25077
|
+
const handleVerify = (0, import_react45.useCallback)(() => __async(null, null, function* () {
|
|
25052
25078
|
if (!canVerify || verifying) return;
|
|
25053
25079
|
setVerifying(true);
|
|
25054
25080
|
setError(void 0);
|
|
@@ -25077,7 +25103,7 @@ var ConnectKalshiModal = ({
|
|
|
25077
25103
|
privateKey,
|
|
25078
25104
|
verifying
|
|
25079
25105
|
]);
|
|
25080
|
-
const handleOpenChange = (0,
|
|
25106
|
+
const handleOpenChange = (0, import_react45.useCallback)(
|
|
25081
25107
|
(value) => {
|
|
25082
25108
|
if (value) {
|
|
25083
25109
|
setApiKeyId("");
|
|
@@ -25280,7 +25306,7 @@ var ConnectKalshiModal = ({
|
|
|
25280
25306
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
25281
25307
|
|
|
25282
25308
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
25283
|
-
var
|
|
25309
|
+
var import_react46 = require("react");
|
|
25284
25310
|
var import_hooks77 = require("@agg-build/hooks");
|
|
25285
25311
|
var Dialog5 = __toESM(require("@radix-ui/react-dialog"));
|
|
25286
25312
|
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
@@ -25290,12 +25316,12 @@ var ConnectOnchainModal = ({
|
|
|
25290
25316
|
onConnect
|
|
25291
25317
|
}) => {
|
|
25292
25318
|
const labels = (0, import_hooks77.useLabels)();
|
|
25293
|
-
const [connecting, setConnecting] = (0,
|
|
25294
|
-
const [error, setError] = (0,
|
|
25295
|
-
const handleCancel = (0,
|
|
25319
|
+
const [connecting, setConnecting] = (0, import_react46.useState)(false);
|
|
25320
|
+
const [error, setError] = (0, import_react46.useState)();
|
|
25321
|
+
const handleCancel = (0, import_react46.useCallback)(() => {
|
|
25296
25322
|
onOpenChange(false);
|
|
25297
25323
|
}, [onOpenChange]);
|
|
25298
|
-
const handleConnect = (0,
|
|
25324
|
+
const handleConnect = (0, import_react46.useCallback)(() => __async(null, null, function* () {
|
|
25299
25325
|
if (connecting) return;
|
|
25300
25326
|
setConnecting(true);
|
|
25301
25327
|
setError(void 0);
|
|
@@ -25310,7 +25336,7 @@ var ConnectOnchainModal = ({
|
|
|
25310
25336
|
setConnecting(false);
|
|
25311
25337
|
}
|
|
25312
25338
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
25313
|
-
const handleOpenChange = (0,
|
|
25339
|
+
const handleOpenChange = (0, import_react46.useCallback)(
|
|
25314
25340
|
(value) => {
|
|
25315
25341
|
if (value) {
|
|
25316
25342
|
setError(void 0);
|
|
@@ -25402,48 +25428,48 @@ var OnboardingModal = ({
|
|
|
25402
25428
|
}) => {
|
|
25403
25429
|
var _a;
|
|
25404
25430
|
const labels = (0, import_hooks78.useLabels)();
|
|
25405
|
-
const [step, setStep] = (0,
|
|
25431
|
+
const [step, setStep] = (0, import_react47.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
25406
25432
|
const stepLabels = {
|
|
25407
25433
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
25408
25434
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
25409
25435
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
25410
25436
|
};
|
|
25411
25437
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
25412
|
-
const [kalshiModalOpen, setKalshiModalOpen] = (0,
|
|
25413
|
-
const [kalshiConnected, setKalshiConnected] = (0,
|
|
25414
|
-
const [onchainModalOpen, setOnchainModalOpen] = (0,
|
|
25415
|
-
const [onchainConnected, setOnchainConnected] = (0,
|
|
25416
|
-
(0,
|
|
25438
|
+
const [kalshiModalOpen, setKalshiModalOpen] = (0, import_react47.useState)(false);
|
|
25439
|
+
const [kalshiConnected, setKalshiConnected] = (0, import_react47.useState)(false);
|
|
25440
|
+
const [onchainModalOpen, setOnchainModalOpen] = (0, import_react47.useState)(false);
|
|
25441
|
+
const [onchainConnected, setOnchainConnected] = (0, import_react47.useState)(false);
|
|
25442
|
+
(0, import_react47.useEffect)(() => {
|
|
25417
25443
|
if (open) {
|
|
25418
25444
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
25419
25445
|
setKalshiConnected(false);
|
|
25420
25446
|
setOnchainConnected(false);
|
|
25421
25447
|
}
|
|
25422
25448
|
}, [open]);
|
|
25423
|
-
const handleHowItWorksContinue = (0,
|
|
25449
|
+
const handleHowItWorksContinue = (0, import_react47.useCallback)(() => {
|
|
25424
25450
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
25425
25451
|
}, []);
|
|
25426
|
-
const handleProfileContinue = (0,
|
|
25452
|
+
const handleProfileContinue = (0, import_react47.useCallback)(
|
|
25427
25453
|
(data) => {
|
|
25428
25454
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
25429
25455
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
25430
25456
|
},
|
|
25431
25457
|
[onProfileSubmit]
|
|
25432
25458
|
);
|
|
25433
|
-
const handleConnectContinue = (0,
|
|
25459
|
+
const handleConnectContinue = (0, import_react47.useCallback)(() => {
|
|
25434
25460
|
onComplete == null ? void 0 : onComplete();
|
|
25435
25461
|
}, [onComplete]);
|
|
25436
|
-
const handleOpenOnchainModal = (0,
|
|
25462
|
+
const handleOpenOnchainModal = (0, import_react47.useCallback)(() => {
|
|
25437
25463
|
setOnchainModalOpen(true);
|
|
25438
25464
|
}, []);
|
|
25439
|
-
const handleOnchainConnect = (0,
|
|
25465
|
+
const handleOnchainConnect = (0, import_react47.useCallback)(() => __async(null, null, function* () {
|
|
25440
25466
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
25441
25467
|
setOnchainConnected(true);
|
|
25442
25468
|
}), [onConnectOnchain]);
|
|
25443
|
-
const handleOpenKalshiModal = (0,
|
|
25469
|
+
const handleOpenKalshiModal = (0, import_react47.useCallback)(() => {
|
|
25444
25470
|
setKalshiModalOpen(true);
|
|
25445
25471
|
}, []);
|
|
25446
|
-
const handleKalshiVerify = (0,
|
|
25472
|
+
const handleKalshiVerify = (0, import_react47.useCallback)(
|
|
25447
25473
|
(credentials) => __async(null, null, function* () {
|
|
25448
25474
|
yield onConnectKalshi == null ? void 0 : onConnectKalshi(credentials);
|
|
25449
25475
|
setKalshiConnected(true);
|
|
@@ -25498,7 +25524,7 @@ OnboardingModal.displayName = "OnboardingModal";
|
|
|
25498
25524
|
|
|
25499
25525
|
// src/profile/index.tsx
|
|
25500
25526
|
var import_sdk22 = require("@agg-build/sdk");
|
|
25501
|
-
var
|
|
25527
|
+
var import_react50 = require("react");
|
|
25502
25528
|
var import_hooks81 = require("@agg-build/hooks");
|
|
25503
25529
|
|
|
25504
25530
|
// src/profile/profile-modal.constants.ts
|
|
@@ -25516,7 +25542,7 @@ var PROFILE_TAB_ITEMS = [
|
|
|
25516
25542
|
];
|
|
25517
25543
|
|
|
25518
25544
|
// src/profile/tabs/about-tab.tsx
|
|
25519
|
-
var
|
|
25545
|
+
var import_react48 = require("react");
|
|
25520
25546
|
var import_hooks79 = require("@agg-build/hooks");
|
|
25521
25547
|
var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
25522
25548
|
var AboutTab = ({
|
|
@@ -25529,12 +25555,12 @@ var AboutTab = ({
|
|
|
25529
25555
|
avatarError: _avatarError
|
|
25530
25556
|
}) => {
|
|
25531
25557
|
const labels = (0, import_hooks79.useLabels)();
|
|
25532
|
-
const fileInputRef = (0,
|
|
25533
|
-
const handleAvatarClick = (0,
|
|
25558
|
+
const fileInputRef = (0, import_react48.useRef)(null);
|
|
25559
|
+
const handleAvatarClick = (0, import_react48.useCallback)(() => {
|
|
25534
25560
|
var _a;
|
|
25535
25561
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
25536
25562
|
}, []);
|
|
25537
|
-
const handleFileChange = (0,
|
|
25563
|
+
const handleFileChange = (0, import_react48.useCallback)(
|
|
25538
25564
|
(e) => {
|
|
25539
25565
|
var _a;
|
|
25540
25566
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
@@ -25648,7 +25674,7 @@ var AboutTab = ({
|
|
|
25648
25674
|
AboutTab.displayName = "AboutTab";
|
|
25649
25675
|
|
|
25650
25676
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
25651
|
-
var
|
|
25677
|
+
var import_react49 = require("react");
|
|
25652
25678
|
var import_hooks80 = require("@agg-build/hooks");
|
|
25653
25679
|
var import_jsx_runtime175 = require("react/jsx-runtime");
|
|
25654
25680
|
var SectionTitle = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
@@ -25685,13 +25711,13 @@ var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runti
|
|
|
25685
25711
|
var TRADING_ACCESS_VENUES = ["kalshi", "polymarket", "opinion", "predict"];
|
|
25686
25712
|
var VerifyIdentityButton = ({ onError }) => {
|
|
25687
25713
|
const client = (0, import_hooks80.useAggClient)();
|
|
25688
|
-
const [isInitiating, setIsInitiating] = (0,
|
|
25689
|
-
const [needsDepositAddress, setNeedsDepositAddress] = (0,
|
|
25714
|
+
const [isInitiating, setIsInitiating] = (0, import_react49.useState)(false);
|
|
25715
|
+
const [needsDepositAddress, setNeedsDepositAddress] = (0, import_react49.useState)(false);
|
|
25690
25716
|
const { isReady, isTimedOut } = (0, import_hooks80.useDepositAddresses)({
|
|
25691
25717
|
enabled: needsDepositAddress,
|
|
25692
25718
|
poll: true
|
|
25693
25719
|
});
|
|
25694
|
-
(0,
|
|
25720
|
+
(0, import_react49.useEffect)(() => {
|
|
25695
25721
|
if (!isInitiating || !isReady) return;
|
|
25696
25722
|
const redirectUri = window.location.href;
|
|
25697
25723
|
client.initiateKyc("kalshi", redirectUri).then((res) => {
|
|
@@ -25705,14 +25731,14 @@ var VerifyIdentityButton = ({ onError }) => {
|
|
|
25705
25731
|
setNeedsDepositAddress(false);
|
|
25706
25732
|
});
|
|
25707
25733
|
}, [isReady, isInitiating, client, onError]);
|
|
25708
|
-
(0,
|
|
25734
|
+
(0, import_react49.useEffect)(() => {
|
|
25709
25735
|
if (isTimedOut && isInitiating) {
|
|
25710
25736
|
setIsInitiating(false);
|
|
25711
25737
|
setNeedsDepositAddress(false);
|
|
25712
25738
|
onError == null ? void 0 : onError(new Error("Deposit address provisioning timed out"));
|
|
25713
25739
|
}
|
|
25714
25740
|
}, [isTimedOut, isInitiating, onError]);
|
|
25715
|
-
const handleClick = (0,
|
|
25741
|
+
const handleClick = (0, import_react49.useCallback)(() => {
|
|
25716
25742
|
setIsInitiating(true);
|
|
25717
25743
|
setNeedsDepositAddress(true);
|
|
25718
25744
|
}, []);
|
|
@@ -25877,18 +25903,18 @@ var ProfileModal = ({
|
|
|
25877
25903
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
25878
25904
|
const client = (0, import_hooks81.useAggClient)();
|
|
25879
25905
|
const { user, startAuth } = (0, import_hooks81.useAggAuthState)();
|
|
25880
|
-
const [activeTab, setActiveTab] = (0,
|
|
25906
|
+
const [activeTab, setActiveTab] = (0, import_react50.useState)(PROFILE_TAB_KEYS.ABOUT);
|
|
25881
25907
|
const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
|
|
25882
|
-
const [draftUsername, setDraftUsername] = (0,
|
|
25883
|
-
const [draftAvatarFile, setDraftAvatarFile] = (0,
|
|
25884
|
-
const [draftAvatarPreview, setDraftAvatarPreview] = (0,
|
|
25885
|
-
const [isSaving, setIsSaving] = (0,
|
|
25886
|
-
const [avatarTypeError, setAvatarTypeError] = (0,
|
|
25887
|
-
(0,
|
|
25908
|
+
const [draftUsername, setDraftUsername] = (0, import_react50.useState)(resolvedInitialUsername);
|
|
25909
|
+
const [draftAvatarFile, setDraftAvatarFile] = (0, import_react50.useState)();
|
|
25910
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react50.useState)();
|
|
25911
|
+
const [isSaving, setIsSaving] = (0, import_react50.useState)(false);
|
|
25912
|
+
const [avatarTypeError, setAvatarTypeError] = (0, import_react50.useState)(null);
|
|
25913
|
+
(0, import_react50.useEffect)(() => {
|
|
25888
25914
|
var _a2;
|
|
25889
25915
|
setDraftUsername((_a2 = username != null ? username : user == null ? void 0 : user.username) != null ? _a2 : "");
|
|
25890
25916
|
}, [username, user == null ? void 0 : user.username]);
|
|
25891
|
-
const handleOpenChange = (0,
|
|
25917
|
+
const handleOpenChange = (0, import_react50.useCallback)(
|
|
25892
25918
|
(isOpen) => {
|
|
25893
25919
|
var _a2;
|
|
25894
25920
|
if (!isOpen) {
|
|
@@ -25912,7 +25938,7 @@ var ProfileModal = ({
|
|
|
25912
25938
|
setDraftAvatarPreview
|
|
25913
25939
|
]
|
|
25914
25940
|
);
|
|
25915
|
-
const handleDraftAvatarChange = (0,
|
|
25941
|
+
const handleDraftAvatarChange = (0, import_react50.useCallback)(
|
|
25916
25942
|
(file, preview) => {
|
|
25917
25943
|
const ACCEPTED_AVATAR_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
|
|
25918
25944
|
if (file && !ACCEPTED_AVATAR_TYPES.includes(file.type)) {
|
|
@@ -25927,7 +25953,7 @@ var ProfileModal = ({
|
|
|
25927
25953
|
);
|
|
25928
25954
|
const originalUsername = (_b = username != null ? username : user == null ? void 0 : user.username) != null ? _b : "";
|
|
25929
25955
|
const hasChanges = draftUsername !== originalUsername || draftAvatarFile !== void 0;
|
|
25930
|
-
const handleSave = (0,
|
|
25956
|
+
const handleSave = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
25931
25957
|
var _a2, _b2;
|
|
25932
25958
|
setIsSaving(true);
|
|
25933
25959
|
try {
|
|
@@ -25972,7 +25998,7 @@ var ProfileModal = ({
|
|
|
25972
25998
|
onSave,
|
|
25973
25999
|
originalUsername
|
|
25974
26000
|
]);
|
|
25975
|
-
const handleCancel = (0,
|
|
26001
|
+
const handleCancel = (0, import_react50.useCallback)(() => {
|
|
25976
26002
|
handleOpenChange(false);
|
|
25977
26003
|
}, [handleOpenChange]);
|
|
25978
26004
|
const isAccountConnected = (providers) => {
|
|
@@ -26016,7 +26042,7 @@ var ProfileModal = ({
|
|
|
26016
26042
|
if (typeof window === "undefined") return;
|
|
26017
26043
|
((_a2 = window.top) != null ? _a2 : window).location.assign(url);
|
|
26018
26044
|
};
|
|
26019
|
-
const handleConnectTwitter = (0,
|
|
26045
|
+
const handleConnectTwitter = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26020
26046
|
const result = yield startAuth({
|
|
26021
26047
|
provider: "twitter",
|
|
26022
26048
|
redirectUrl: resolveRedirectUrl()
|
|
@@ -26026,7 +26052,7 @@ var ProfileModal = ({
|
|
|
26026
26052
|
navigateTopWindow(result.url);
|
|
26027
26053
|
}
|
|
26028
26054
|
}), [onConnectTwitter, startAuth]);
|
|
26029
|
-
const handleConnectGoogle = (0,
|
|
26055
|
+
const handleConnectGoogle = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26030
26056
|
const result = yield startAuth({
|
|
26031
26057
|
provider: "google",
|
|
26032
26058
|
redirectUrl: resolveRedirectUrl()
|
|
@@ -26036,7 +26062,7 @@ var ProfileModal = ({
|
|
|
26036
26062
|
navigateTopWindow(result.url);
|
|
26037
26063
|
}
|
|
26038
26064
|
}), [onConnectGoogle, startAuth]);
|
|
26039
|
-
const handleConnectApple = (0,
|
|
26065
|
+
const handleConnectApple = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26040
26066
|
const result = yield startAuth({
|
|
26041
26067
|
provider: "apple",
|
|
26042
26068
|
redirectUrl: resolveRedirectUrl()
|
|
@@ -26046,22 +26072,22 @@ var ProfileModal = ({
|
|
|
26046
26072
|
navigateTopWindow(result.url);
|
|
26047
26073
|
}
|
|
26048
26074
|
}), [onConnectApple, startAuth]);
|
|
26049
|
-
const handleDisconnectTwitter = (0,
|
|
26075
|
+
const handleDisconnectTwitter = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26050
26076
|
yield client.disconnectAccount("twitter");
|
|
26051
26077
|
yield client.getCurrentUser();
|
|
26052
26078
|
onDisconnectTwitter == null ? void 0 : onDisconnectTwitter();
|
|
26053
26079
|
}), [client, onDisconnectTwitter]);
|
|
26054
|
-
const handleDisconnectGoogle = (0,
|
|
26080
|
+
const handleDisconnectGoogle = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26055
26081
|
yield client.disconnectAccount("google");
|
|
26056
26082
|
yield client.getCurrentUser();
|
|
26057
26083
|
onDisconnectGoogle == null ? void 0 : onDisconnectGoogle();
|
|
26058
26084
|
}), [client, onDisconnectGoogle]);
|
|
26059
|
-
const handleDisconnectApple = (0,
|
|
26085
|
+
const handleDisconnectApple = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26060
26086
|
yield client.disconnectAccount("apple");
|
|
26061
26087
|
yield client.getCurrentUser();
|
|
26062
26088
|
onDisconnectApple == null ? void 0 : onDisconnectApple();
|
|
26063
26089
|
}), [client, onDisconnectApple]);
|
|
26064
|
-
const handleConnectEmail = (0,
|
|
26090
|
+
const handleConnectEmail = (0, import_react50.useCallback)(() => __async(null, null, function* () {
|
|
26065
26091
|
var _a2;
|
|
26066
26092
|
const typedEmail = typeof window !== "undefined" ? (_a2 = window.prompt("Enter your email to receive a magic link")) == null ? void 0 : _a2.trim() : void 0;
|
|
26067
26093
|
if (!typedEmail) return;
|
|
@@ -26072,7 +26098,7 @@ var ProfileModal = ({
|
|
|
26072
26098
|
});
|
|
26073
26099
|
onConnectEmail == null ? void 0 : onConnectEmail();
|
|
26074
26100
|
}), [onConnectEmail, startAuth]);
|
|
26075
|
-
const handleDisconnectWallet = (0,
|
|
26101
|
+
const handleDisconnectWallet = (0, import_react50.useCallback)(
|
|
26076
26102
|
(wallet) => __async(null, null, function* () {
|
|
26077
26103
|
const normalizedChain = wallet.chain.toLowerCase();
|
|
26078
26104
|
const provider = normalizedChain === "solana" || normalizedChain === "svm" ? "solana_wallet" : "wallet";
|
|
@@ -26082,7 +26108,7 @@ var ProfileModal = ({
|
|
|
26082
26108
|
}),
|
|
26083
26109
|
[client, onDisconnectWallet]
|
|
26084
26110
|
);
|
|
26085
|
-
const providerActionMap = (0,
|
|
26111
|
+
const providerActionMap = (0, import_react50.useMemo)(
|
|
26086
26112
|
() => ({
|
|
26087
26113
|
twitter: {
|
|
26088
26114
|
connect: () => {
|
|
@@ -26124,7 +26150,7 @@ var ProfileModal = ({
|
|
|
26124
26150
|
handleDisconnectTwitter
|
|
26125
26151
|
]
|
|
26126
26152
|
);
|
|
26127
|
-
const resolvedWallets = (0,
|
|
26153
|
+
const resolvedWallets = (0, import_react50.useMemo)(() => {
|
|
26128
26154
|
var _a2, _b2;
|
|
26129
26155
|
if (wallets) return wallets;
|
|
26130
26156
|
return (_b2 = (_a2 = user == null ? void 0 : user.wallets) == null ? void 0 : _a2.map((wallet) => {
|
|
@@ -26136,7 +26162,7 @@ var ProfileModal = ({
|
|
|
26136
26162
|
};
|
|
26137
26163
|
})) != null ? _b2 : [];
|
|
26138
26164
|
}, [user == null ? void 0 : user.wallets, wallets]);
|
|
26139
|
-
const resolvedExchanges = (0,
|
|
26165
|
+
const resolvedExchanges = (0, import_react50.useMemo)(() => {
|
|
26140
26166
|
var _a2, _b2;
|
|
26141
26167
|
if (exchanges !== void 0) return exchanges;
|
|
26142
26168
|
const walletAccount = (_a2 = user == null ? void 0 : user.accounts) == null ? void 0 : _a2.find(
|
|
@@ -26147,7 +26173,7 @@ var ProfileModal = ({
|
|
|
26147
26173
|
const displayAddress = (_b2 = shortenAddress(addr)) != null ? _b2 : addr;
|
|
26148
26174
|
return EVM_WALLET_VENUES.map((venue) => ({ venue, displayAddress, verified: false }));
|
|
26149
26175
|
}, [exchanges, user == null ? void 0 : user.accounts]);
|
|
26150
|
-
const handleDisconnectExchange = (0,
|
|
26176
|
+
const handleDisconnectExchange = (0, import_react50.useCallback)(
|
|
26151
26177
|
(venue) => __async(null, null, function* () {
|
|
26152
26178
|
if (exchanges !== void 0) {
|
|
26153
26179
|
onDisconnectExchangeProp == null ? void 0 : onDisconnectExchangeProp(venue);
|
|
@@ -26304,7 +26330,7 @@ ProfileModal.displayName = "ProfileModal";
|
|
|
26304
26330
|
|
|
26305
26331
|
// src/geo-block-modal/index.tsx
|
|
26306
26332
|
var import_hooks82 = require("@agg-build/hooks");
|
|
26307
|
-
var
|
|
26333
|
+
var import_react51 = require("react");
|
|
26308
26334
|
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
26309
26335
|
var GeoBlockModal = ({
|
|
26310
26336
|
open,
|
|
@@ -26313,7 +26339,7 @@ var GeoBlockModal = ({
|
|
|
26313
26339
|
classNames
|
|
26314
26340
|
}) => {
|
|
26315
26341
|
const labels = (0, import_hooks82.useLabels)();
|
|
26316
|
-
const handleConfirm = (0,
|
|
26342
|
+
const handleConfirm = (0, import_react51.useCallback)(() => {
|
|
26317
26343
|
onConfirm == null ? void 0 : onConfirm();
|
|
26318
26344
|
onOpenChange(false);
|
|
26319
26345
|
}, [onConfirm, onOpenChange]);
|