@agg-build/ui 4.18.2 → 4.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/chunk-CKHECAKV.mjs +2724 -0
- package/dist/{chunk-NSQQ62QK.mjs → chunk-DONMO42Q.mjs} +1 -1
- package/dist/{chunk-RFMA5ABT.mjs → chunk-KRYMEFPL.mjs} +505 -44
- package/dist/{chunk-5YHKIJ23.mjs → chunk-NV6WT3TN.mjs} +481 -826
- package/dist/{chunk-47CCGQH6.mjs → chunk-UXLC3FFY.mjs} +451 -1349
- package/dist/{event-market-2BAMDM5I.mjs → event-market-UREM3ZE7.mjs} +3 -3
- package/dist/index.js +21879 -21136
- package/dist/index.mjs +16 -8
- package/dist/modals.js +898 -335
- package/dist/modals.mjs +5 -5
- package/dist/pages.js +3270 -1629
- package/dist/pages.mjs +12 -4
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1746 -643
- package/dist/trading.mjs +2 -2
- package/dist/types/pages/index.d.mts +1 -0
- package/dist/types/pages/index.d.ts +1 -0
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.mts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.ts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.mts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.ts +7 -0
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.mts +3 -0
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.ts +3 -0
- package/dist/types/pages/leaderboard/components/segmented-control.d.mts +18 -0
- package/dist/types/pages/leaderboard/components/segmented-control.d.ts +18 -0
- package/dist/types/pages/leaderboard/index.d.mts +28 -0
- package/dist/types/pages/leaderboard/index.d.ts +28 -0
- package/dist/types/pages/leaderboard/leaderboard.constants.d.mts +8 -0
- package/dist/types/pages/leaderboard/leaderboard.constants.d.ts +8 -0
- package/dist/types/pages/leaderboard/leaderboard.types.d.mts +11 -0
- package/dist/types/pages/leaderboard/leaderboard.types.d.ts +11 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +6 -0
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +6 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +2 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +2 -4
- package/dist/types/profile/tabs/trading-access-tab.d.mts +2 -1
- package/dist/types/profile/tabs/trading-access-tab.d.ts +2 -1
- package/dist/types/shared/pnl-format.d.mts +20 -0
- package/dist/types/shared/pnl-format.d.ts +20 -0
- package/dist/types/trading/manage-betdex-account-modal.d.mts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +2 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +3 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +3 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
- package/dist/chunk-ROA5K67W.mjs +0 -1237
- /package/dist/types/{pages/user-profile/components → shared}/default-avatar.d.mts +0 -0
- /package/dist/types/{pages/user-profile/components → shared}/default-avatar.d.ts +0 -0
package/dist/trading.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useClaimWinnings,
|
|
15
15
|
useResolvedMarketClaim,
|
|
16
16
|
venueRequiresSharedKyc
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NV6WT3TN.mjs";
|
|
18
18
|
import {
|
|
19
19
|
SETTLEMENT_SECTION_ID,
|
|
20
20
|
Settlement,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resolveDifferenceIconClassName,
|
|
34
34
|
useEventTradingContext
|
|
35
35
|
} from "./chunk-WOCZ4TVT.mjs";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-CKHECAKV.mjs";
|
|
37
37
|
import "./chunk-XZVGHKMW.mjs";
|
|
38
38
|
export {
|
|
39
39
|
FundKalshiModal,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./home";
|
|
2
2
|
export * from "./event-market";
|
|
3
3
|
export * from "./user-profile";
|
|
4
|
+
export * from "./leaderboard";
|
|
4
5
|
export { DEPOSIT_MODAL_OPEN_EVENT, WITHDRAW_MODAL_OPEN_EVENT, requestAggDepositModalOpen, requestAggWithdrawModalOpen, } from "../shared/deposit-modal-events";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./home";
|
|
2
2
|
export * from "./event-market";
|
|
3
3
|
export * from "./user-profile";
|
|
4
|
+
export * from "./leaderboard";
|
|
4
5
|
export { DEPOSIT_MODAL_OPEN_EVENT, WITHDRAW_MODAL_OPEN_EVENT, requestAggDepositModalOpen, requestAggWithdrawModalOpen, } from "../shared/deposit-modal-events";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LeaderboardMetric } from "../leaderboard.types";
|
|
2
|
+
export interface LeaderboardHeaderRowProps {
|
|
3
|
+
metric: LeaderboardMetric;
|
|
4
|
+
onMetricChange: (metric: LeaderboardMetric) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Column captions; hidden on phones where each cell carries its own caption. */
|
|
7
|
+
export declare function LeaderboardHeaderRow({ metric, onMetricChange, }: LeaderboardHeaderRowProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LeaderboardMetric } from "../leaderboard.types";
|
|
2
|
+
export interface LeaderboardHeaderRowProps {
|
|
3
|
+
metric: LeaderboardMetric;
|
|
4
|
+
onMetricChange: (metric: LeaderboardMetric) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Column captions; hidden on phones where each cell carries its own caption. */
|
|
7
|
+
export declare function LeaderboardHeaderRow({ metric, onMetricChange, }: LeaderboardHeaderRowProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LeaderboardRow } from "../leaderboard.types";
|
|
2
|
+
export interface LeaderboardRowViewProps {
|
|
3
|
+
row: LeaderboardRow;
|
|
4
|
+
isCurrentUser: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function LeaderboardRowView({ row, isCurrentUser, className, }: LeaderboardRowViewProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LeaderboardRow } from "../leaderboard.types";
|
|
2
|
+
export interface LeaderboardRowViewProps {
|
|
3
|
+
row: LeaderboardRow;
|
|
4
|
+
isCurrentUser: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function LeaderboardRowView({ row, isCurrentUser, className, }: LeaderboardRowViewProps): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SegmentedControlItem<T extends string> {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SegmentedControlProps<T extends string> {
|
|
6
|
+
/** Accessible group name, e.g. "Period". */
|
|
7
|
+
label: string;
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
items: SegmentedControlItem<T>[];
|
|
11
|
+
className?: string;
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Bordered segmented toggle — the same shell as the profile page's position
|
|
16
|
+
* filters (`rounded-agg-sm border`, 1px dividers, pressed item filled).
|
|
17
|
+
*/
|
|
18
|
+
export declare function SegmentedControl<T extends string>({ label, value, onChange, items, className, itemClassName, }: SegmentedControlProps<T>): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SegmentedControlItem<T extends string> {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SegmentedControlProps<T extends string> {
|
|
6
|
+
/** Accessible group name, e.g. "Period". */
|
|
7
|
+
label: string;
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
items: SegmentedControlItem<T>[];
|
|
11
|
+
className?: string;
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Bordered segmented toggle — the same shell as the profile page's position
|
|
16
|
+
* filters (`rounded-agg-sm border`, 1px dividers, pressed item filled).
|
|
17
|
+
*/
|
|
18
|
+
export declare function SegmentedControl<T extends string>({ label, value, onChange, items, className, itemClassName, }: SegmentedControlProps<T>): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LeaderboardClassNames, LeaderboardMetric, LeaderboardPeriod, LeaderboardRow } from "./leaderboard.types";
|
|
2
|
+
export type { LeaderboardClassNames, LeaderboardMetric, LeaderboardPeriod, LeaderboardRow, } from "./leaderboard.types";
|
|
3
|
+
export { LEADERBOARD_DEFAULT_METRIC, LEADERBOARD_DEFAULT_PERIOD, LEADERBOARD_METRICS, } from "./leaderboard.constants";
|
|
4
|
+
export interface LeaderboardPageProps {
|
|
5
|
+
/** Rows to render. When absent the page fetches via `useLeaderboard`. */
|
|
6
|
+
rows?: LeaderboardRow[];
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
error?: unknown;
|
|
9
|
+
hasNextPage?: boolean;
|
|
10
|
+
isLoadingMore?: boolean;
|
|
11
|
+
onLoadMore?: () => void;
|
|
12
|
+
/** Controlled period; uncontrolled state is used when absent. */
|
|
13
|
+
period?: LeaderboardPeriod;
|
|
14
|
+
onPeriodChange?: (period: LeaderboardPeriod) => void;
|
|
15
|
+
metric?: LeaderboardMetric;
|
|
16
|
+
onMetricChange?: (metric: LeaderboardMetric) => void;
|
|
17
|
+
/** Row to mark as "you". Defaults to the signed-in user. */
|
|
18
|
+
currentUserId?: string;
|
|
19
|
+
/** Shown in the subtitle as "Top traders on {appName}". */
|
|
20
|
+
appName?: string;
|
|
21
|
+
onError?: (error: Error) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
classNames?: LeaderboardClassNames;
|
|
24
|
+
}
|
|
25
|
+
export declare function LeaderboardPage(props: LeaderboardPageProps): JSX.Element;
|
|
26
|
+
export declare namespace LeaderboardPage {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LeaderboardClassNames, LeaderboardMetric, LeaderboardPeriod, LeaderboardRow } from "./leaderboard.types";
|
|
2
|
+
export type { LeaderboardClassNames, LeaderboardMetric, LeaderboardPeriod, LeaderboardRow, } from "./leaderboard.types";
|
|
3
|
+
export { LEADERBOARD_DEFAULT_METRIC, LEADERBOARD_DEFAULT_PERIOD, LEADERBOARD_METRICS, } from "./leaderboard.constants";
|
|
4
|
+
export interface LeaderboardPageProps {
|
|
5
|
+
/** Rows to render. When absent the page fetches via `useLeaderboard`. */
|
|
6
|
+
rows?: LeaderboardRow[];
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
error?: unknown;
|
|
9
|
+
hasNextPage?: boolean;
|
|
10
|
+
isLoadingMore?: boolean;
|
|
11
|
+
onLoadMore?: () => void;
|
|
12
|
+
/** Controlled period; uncontrolled state is used when absent. */
|
|
13
|
+
period?: LeaderboardPeriod;
|
|
14
|
+
onPeriodChange?: (period: LeaderboardPeriod) => void;
|
|
15
|
+
metric?: LeaderboardMetric;
|
|
16
|
+
onMetricChange?: (metric: LeaderboardMetric) => void;
|
|
17
|
+
/** Row to mark as "you". Defaults to the signed-in user. */
|
|
18
|
+
currentUserId?: string;
|
|
19
|
+
/** Shown in the subtitle as "Top traders on {appName}". */
|
|
20
|
+
appName?: string;
|
|
21
|
+
onError?: (error: Error) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
classNames?: LeaderboardClassNames;
|
|
24
|
+
}
|
|
25
|
+
export declare function LeaderboardPage(props: LeaderboardPageProps): JSX.Element;
|
|
26
|
+
export declare namespace LeaderboardPage {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LeaderboardMetric, LeaderboardPeriod } from "./leaderboard.types";
|
|
2
|
+
export declare const LEADERBOARD_DEFAULT_PERIOD: LeaderboardPeriod;
|
|
3
|
+
export declare const LEADERBOARD_DEFAULT_METRIC: LeaderboardMetric;
|
|
4
|
+
export declare const LEADERBOARD_METRICS: readonly LeaderboardMetric[];
|
|
5
|
+
/** Ranks that get the emphasised chip. */
|
|
6
|
+
export declare const LEADERBOARD_TOP_RANKS = 3;
|
|
7
|
+
/** Shared grid template: rank | identity | trades | volume | P&L. */
|
|
8
|
+
export declare const LEADERBOARD_GRID_CLASS = "grid grid-cols-[36px_minmax(0,1fr)] grid-rows-[auto_auto] gap-x-3 gap-y-2 sm:grid-cols-[48px_minmax(0,1fr)_88px_128px_128px] sm:grid-rows-1 sm:gap-x-3 sm:gap-y-0";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LeaderboardMetric, LeaderboardPeriod } from "./leaderboard.types";
|
|
2
|
+
export declare const LEADERBOARD_DEFAULT_PERIOD: LeaderboardPeriod;
|
|
3
|
+
export declare const LEADERBOARD_DEFAULT_METRIC: LeaderboardMetric;
|
|
4
|
+
export declare const LEADERBOARD_METRICS: readonly LeaderboardMetric[];
|
|
5
|
+
/** Ranks that get the emphasised chip. */
|
|
6
|
+
export declare const LEADERBOARD_TOP_RANKS = 3;
|
|
7
|
+
/** Shared grid template: rank | identity | trades | volume | P&L. */
|
|
8
|
+
export declare const LEADERBOARD_GRID_CLASS = "grid grid-cols-[36px_minmax(0,1fr)] grid-rows-[auto_auto] gap-x-3 gap-y-2 sm:grid-cols-[48px_minmax(0,1fr)_88px_128px_128px] sm:grid-rows-1 sm:gap-x-3 sm:gap-y-0";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LeaderboardMetric, LeaderboardRow } from "@agg-build/sdk";
|
|
2
|
+
import type { LeaderboardPeriod } from "@agg-build/hooks";
|
|
3
|
+
export type { LeaderboardMetric, LeaderboardRow, LeaderboardPeriod };
|
|
4
|
+
export interface LeaderboardClassNames {
|
|
5
|
+
root?: string;
|
|
6
|
+
header?: string;
|
|
7
|
+
toolbar?: string;
|
|
8
|
+
list?: string;
|
|
9
|
+
row?: string;
|
|
10
|
+
footer?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LeaderboardMetric, LeaderboardRow } from "@agg-build/sdk";
|
|
2
|
+
import type { LeaderboardPeriod } from "@agg-build/hooks";
|
|
3
|
+
export type { LeaderboardMetric, LeaderboardRow, LeaderboardPeriod };
|
|
4
|
+
export interface LeaderboardClassNames {
|
|
5
|
+
root?: string;
|
|
6
|
+
header?: string;
|
|
7
|
+
toolbar?: string;
|
|
8
|
+
list?: string;
|
|
9
|
+
row?: string;
|
|
10
|
+
footer?: string;
|
|
11
|
+
}
|
|
@@ -14,6 +14,7 @@ type AvailableBalanceCardProps = {
|
|
|
14
14
|
reservedValueLabel?: string;
|
|
15
15
|
/** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
|
|
16
16
|
kalshiValueLabel?: string;
|
|
17
|
+
betdexValueLabel?: string;
|
|
17
18
|
chains: ChainRow[];
|
|
18
19
|
isLoading?: boolean;
|
|
19
20
|
className?: string;
|
|
@@ -26,7 +27,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
|
|
|
26
27
|
export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
|
|
27
28
|
export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
|
|
28
29
|
export declare const AvailableBalanceCard: {
|
|
29
|
-
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
30
|
+
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, betdexValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
30
31
|
displayName: string;
|
|
31
32
|
};
|
|
32
33
|
export {};
|
|
@@ -14,6 +14,7 @@ type AvailableBalanceCardProps = {
|
|
|
14
14
|
reservedValueLabel?: string;
|
|
15
15
|
/** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
|
|
16
16
|
kalshiValueLabel?: string;
|
|
17
|
+
betdexValueLabel?: string;
|
|
17
18
|
chains: ChainRow[];
|
|
18
19
|
isLoading?: boolean;
|
|
19
20
|
className?: string;
|
|
@@ -26,7 +27,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
|
|
|
26
27
|
export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
|
|
27
28
|
export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
|
|
28
29
|
export declare const AvailableBalanceCard: {
|
|
29
|
-
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
30
|
+
({ label, valueLabel, reservedValueLabel, kalshiValueLabel, betdexValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
|
|
30
31
|
displayName: string;
|
|
31
32
|
};
|
|
32
33
|
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/** Hosted venue cash must never be presented as a signing-wallet chain balance. */
|
|
2
|
-
export declare function BetdexAccountCard(
|
|
2
|
+
export declare function BetdexAccountCard({ onWalletDeposit, }?: {
|
|
3
|
+
onWalletDeposit?: (address: string) => void;
|
|
4
|
+
}): JSX.Element | null;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/** Hosted venue cash must never be presented as a signing-wallet chain balance. */
|
|
2
|
-
export declare function BetdexAccountCard(
|
|
2
|
+
export declare function BetdexAccountCard({ onWalletDeposit, }?: {
|
|
3
|
+
onWalletDeposit?: (address: string) => void;
|
|
4
|
+
}): JSX.Element | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare function hostedWithdrawalRaw(value: string): string | null;
|
|
2
|
-
export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, }: {
|
|
2
|
+
export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, onWalletDeposit, }: {
|
|
3
3
|
accountId: string;
|
|
4
4
|
environment: "production" | "sandbox";
|
|
5
5
|
availableRaw?: string;
|
|
6
6
|
canDeposit: boolean;
|
|
7
|
+
onWalletDeposit?: (address: string) => void;
|
|
7
8
|
}): JSX.Element | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare function hostedWithdrawalRaw(value: string): string | null;
|
|
2
|
-
export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, }: {
|
|
2
|
+
export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, onWalletDeposit, }: {
|
|
3
3
|
accountId: string;
|
|
4
4
|
environment: "production" | "sandbox";
|
|
5
5
|
availableRaw?: string;
|
|
6
6
|
canDeposit: boolean;
|
|
7
|
+
onWalletDeposit?: (address: string) => void;
|
|
7
8
|
}): JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Move the user's managed cash through the normal bridge/withdrawal pipeline
|
|
2
|
+
* to their verified BETDEX deposit address. Only confirmation submits money. */
|
|
3
|
+
export declare function BetdexWalletDeposit({ address, onClose, }: {
|
|
4
|
+
address: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Move the user's managed cash through the normal bridge/withdrawal pipeline
|
|
2
|
+
* to their verified BETDEX deposit address. Only confirmation submits money. */
|
|
3
|
+
export declare function BetdexWalletDeposit({ address, onClose, }: {
|
|
4
|
+
address: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}): JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { formatCurrency, formatSignedCurrency, getPositionTone, type PositionTone } from "../../shared/pnl-format";
|
|
1
2
|
import type { UserProfilePosition } from "./user-profile.types";
|
|
3
|
+
export { formatCurrency, formatSignedCurrency, getPositionTone, type PositionTone };
|
|
2
4
|
export type PositionStatus = "open" | "won_unclaimed" | "won_claimed" | "lost" | "sold";
|
|
3
5
|
export type PositionBucket = "active" | "closed";
|
|
4
|
-
export type PositionTone = "positive" | "negative" | "neutral";
|
|
5
6
|
export type PositionValueDisplay = {
|
|
6
7
|
primaryLabel: string;
|
|
7
8
|
deltaLabel: string;
|
|
@@ -43,8 +44,6 @@ export type PositionViewModelFormatters = {
|
|
|
43
44
|
/** Receives a dollar amount. */
|
|
44
45
|
formatCurrency?: (value: number) => string;
|
|
45
46
|
};
|
|
46
|
-
export declare const formatCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
47
|
-
export declare const formatSignedCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
48
47
|
export declare const formatPriceCents: (value: number | null | undefined, formatPrice?: (value: number) => string) => string;
|
|
49
48
|
export declare const formatSignedPercent: (value: number | null | undefined) => string;
|
|
50
49
|
export declare const resolvePositionStatus: (position: UserProfilePosition) => PositionStatus;
|
|
@@ -61,5 +60,4 @@ export declare const getPnlValue: (position: UserProfilePosition, value: number
|
|
|
61
60
|
export declare const getPnlPercent: (position: UserProfilePosition, pnlValue: number | null) => number | null;
|
|
62
61
|
export declare const getFinalPnlValue: (position: UserProfilePosition, value: number | null) => number | null;
|
|
63
62
|
export declare const getFinalPnlPercent: (position: UserProfilePosition, pnlValue: number | null) => number | null;
|
|
64
|
-
export declare const getPositionTone: (value: number | null | undefined) => PositionTone;
|
|
65
63
|
export declare const toPositionRowViewModel: (position: UserProfilePosition, labels?: PositionViewModelLabels, formatters?: PositionViewModelFormatters) => PositionRowViewModel;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { formatCurrency, formatSignedCurrency, getPositionTone, type PositionTone } from "../../shared/pnl-format";
|
|
1
2
|
import type { UserProfilePosition } from "./user-profile.types";
|
|
3
|
+
export { formatCurrency, formatSignedCurrency, getPositionTone, type PositionTone };
|
|
2
4
|
export type PositionStatus = "open" | "won_unclaimed" | "won_claimed" | "lost" | "sold";
|
|
3
5
|
export type PositionBucket = "active" | "closed";
|
|
4
|
-
export type PositionTone = "positive" | "negative" | "neutral";
|
|
5
6
|
export type PositionValueDisplay = {
|
|
6
7
|
primaryLabel: string;
|
|
7
8
|
deltaLabel: string;
|
|
@@ -43,8 +44,6 @@ export type PositionViewModelFormatters = {
|
|
|
43
44
|
/** Receives a dollar amount. */
|
|
44
45
|
formatCurrency?: (value: number) => string;
|
|
45
46
|
};
|
|
46
|
-
export declare const formatCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
47
|
-
export declare const formatSignedCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
48
47
|
export declare const formatPriceCents: (value: number | null | undefined, formatPrice?: (value: number) => string) => string;
|
|
49
48
|
export declare const formatSignedPercent: (value: number | null | undefined) => string;
|
|
50
49
|
export declare const resolvePositionStatus: (position: UserProfilePosition) => PositionStatus;
|
|
@@ -61,5 +60,4 @@ export declare const getPnlValue: (position: UserProfilePosition, value: number
|
|
|
61
60
|
export declare const getPnlPercent: (position: UserProfilePosition, pnlValue: number | null) => number | null;
|
|
62
61
|
export declare const getFinalPnlValue: (position: UserProfilePosition, value: number | null) => number | null;
|
|
63
62
|
export declare const getFinalPnlPercent: (position: UserProfilePosition, pnlValue: number | null) => number | null;
|
|
64
|
-
export declare const getPositionTone: (value: number | null | undefined) => PositionTone;
|
|
65
63
|
export declare const toPositionRowViewModel: (position: UserProfilePosition, labels?: PositionViewModelLabels, formatters?: PositionViewModelFormatters) => PositionRowViewModel;
|
|
@@ -7,11 +7,12 @@ interface VenueAccountInfo {
|
|
|
7
7
|
export interface TradingAccessTabProps {
|
|
8
8
|
venueAccounts?: VenueAccountInfo[] | null;
|
|
9
9
|
onConnectKalshi?: () => void;
|
|
10
|
+
onConfigureBetdex?: () => void;
|
|
10
11
|
onDisconnectKalshi?: () => void;
|
|
11
12
|
onKycError?: (error: Error) => void;
|
|
12
13
|
}
|
|
13
14
|
export declare const TradingAccessTab: {
|
|
14
|
-
({ venueAccounts, onConnectKalshi, onDisconnectKalshi, }: TradingAccessTabProps): JSX.Element;
|
|
15
|
+
({ venueAccounts, onConnectKalshi, onDisconnectKalshi, onConfigureBetdex, }: TradingAccessTabProps): JSX.Element;
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
|
@@ -7,11 +7,12 @@ interface VenueAccountInfo {
|
|
|
7
7
|
export interface TradingAccessTabProps {
|
|
8
8
|
venueAccounts?: VenueAccountInfo[] | null;
|
|
9
9
|
onConnectKalshi?: () => void;
|
|
10
|
+
onConfigureBetdex?: () => void;
|
|
10
11
|
onDisconnectKalshi?: () => void;
|
|
11
12
|
onKycError?: (error: Error) => void;
|
|
12
13
|
}
|
|
13
14
|
export declare const TradingAccessTab: {
|
|
14
|
-
({ venueAccounts, onConnectKalshi, onDisconnectKalshi, }: TradingAccessTabProps): JSX.Element;
|
|
15
|
+
({ venueAccounts, onConnectKalshi, onDisconnectKalshi, onConfigureBetdex, }: TradingAccessTabProps): JSX.Element;
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PositionTone = "positive" | "negative" | "neutral";
|
|
2
|
+
export declare const MISSING_VALUE_LABEL = "\u2014";
|
|
3
|
+
export declare const isFiniteNumber: (value: number | null | undefined) => value is number;
|
|
4
|
+
export declare const formatCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
5
|
+
/** Magnitudes below this render as "<$0.01" instead of a misleading "$0.00" when `markNegligible` is set. */
|
|
6
|
+
export declare const NEGLIGIBLE_CURRENCY_THRESHOLD = 0.005;
|
|
7
|
+
export interface SignedCurrencyOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Render a non-zero value that would round to $0.00 as `+<$0.01` / `-<$0.01`
|
|
10
|
+
* so dust (fractional-share settlements, rounding residue) reads as
|
|
11
|
+
* negligible rather than as exactly zero. Exact 0 still renders `$0.00`.
|
|
12
|
+
*/
|
|
13
|
+
markNegligible?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const formatSignedCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string, options?: SignedCurrencyOptions) => string;
|
|
16
|
+
/** Unsigned counterpart for volume: a positive value below half a cent reads `<$0.01`. */
|
|
17
|
+
export declare const formatCurrencyMarkingNegligible: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
18
|
+
export declare const getPositionTone: (value: number | null | undefined) => PositionTone;
|
|
19
|
+
/** Token class for a P&L tone; mirrors position-row.tsx's mapping. */
|
|
20
|
+
export declare const toneClassName: (tone: PositionTone) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PositionTone = "positive" | "negative" | "neutral";
|
|
2
|
+
export declare const MISSING_VALUE_LABEL = "\u2014";
|
|
3
|
+
export declare const isFiniteNumber: (value: number | null | undefined) => value is number;
|
|
4
|
+
export declare const formatCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
5
|
+
/** Magnitudes below this render as "<$0.01" instead of a misleading "$0.00" when `markNegligible` is set. */
|
|
6
|
+
export declare const NEGLIGIBLE_CURRENCY_THRESHOLD = 0.005;
|
|
7
|
+
export interface SignedCurrencyOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Render a non-zero value that would round to $0.00 as `+<$0.01` / `-<$0.01`
|
|
10
|
+
* so dust (fractional-share settlements, rounding residue) reads as
|
|
11
|
+
* negligible rather than as exactly zero. Exact 0 still renders `$0.00`.
|
|
12
|
+
*/
|
|
13
|
+
markNegligible?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const formatSignedCurrency: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string, options?: SignedCurrencyOptions) => string;
|
|
16
|
+
/** Unsigned counterpart for volume: a positive value below half a cent reads `<$0.01`. */
|
|
17
|
+
export declare const formatCurrencyMarkingNegligible: (value: number | null | undefined, formatCurrencyOverride?: (value: number) => string) => string;
|
|
18
|
+
export declare const getPositionTone: (value: number | null | undefined) => PositionTone;
|
|
19
|
+
/** Token class for a P&L tone; mirrors position-row.tsx's mapping. */
|
|
20
|
+
export declare const toneClassName: (tone: PositionTone) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Reuse the account controls without treating hosted cash as wallet cash. */
|
|
2
|
-
export declare function ManageBetdexAccountModal({ open, onOpenChange, }: {
|
|
2
|
+
export declare function ManageBetdexAccountModal({ open, onOpenChange, userId, }: {
|
|
3
3
|
open: boolean;
|
|
4
|
+
userId?: string;
|
|
4
5
|
onOpenChange: (open: boolean) => void;
|
|
5
6
|
}): JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Reuse the account controls without treating hosted cash as wallet cash. */
|
|
2
|
-
export declare function ManageBetdexAccountModal({ open, onOpenChange, }: {
|
|
2
|
+
export declare function ManageBetdexAccountModal({ open, onOpenChange, userId, }: {
|
|
3
3
|
open: boolean;
|
|
4
|
+
userId?: string;
|
|
4
5
|
onOpenChange: (open: boolean) => void;
|
|
5
6
|
}): JSX.Element;
|
|
@@ -248,6 +248,7 @@ export type BuildLiveRouteCardsParams = {
|
|
|
248
248
|
tradeSide: PlaceOrderTab;
|
|
249
249
|
eventVenues?: TradingVenue[];
|
|
250
250
|
geoBlockedVenues?: ReadonlySet<string>;
|
|
251
|
+
betdexFundingRequired?: boolean;
|
|
251
252
|
};
|
|
252
253
|
export type ResolvePlaceOrderQuoteStatusParams = {
|
|
253
254
|
amount: number;
|
|
@@ -248,6 +248,7 @@ export type BuildLiveRouteCardsParams = {
|
|
|
248
248
|
tradeSide: PlaceOrderTab;
|
|
249
249
|
eventVenues?: TradingVenue[];
|
|
250
250
|
geoBlockedVenues?: ReadonlySet<string>;
|
|
251
|
+
betdexFundingRequired?: boolean;
|
|
251
252
|
};
|
|
252
253
|
export type ResolvePlaceOrderQuoteStatusParams = {
|
|
253
254
|
amount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VenueMarket, VenueSellQuoteRequest } from "@agg-build/hooks";
|
|
2
|
-
import type
|
|
2
|
+
import { type AggClient, type SmartRouteResponse, type WsOrderSubmitted } from "@agg-build/sdk";
|
|
3
3
|
import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
|
|
4
4
|
import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderLimitVenueOption, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
|
|
5
5
|
/** Quote identity follows spendable funds and reservations, not the clock of an
|
|
@@ -111,7 +111,7 @@ export declare const sanitizePlaceOrderAmount: (value: number) => number;
|
|
|
111
111
|
export declare const getTradingRoutePriceLabel: (value: number) => string;
|
|
112
112
|
export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
|
|
113
113
|
export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, tradeSide, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
|
|
114
|
-
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
114
|
+
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, betdexFundingRequired, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
115
115
|
/**
|
|
116
116
|
* Default route-card pick when the user hasn't selected one (or their selection
|
|
117
117
|
* disappeared from the list). Normally the first available card wins, but when
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VenueMarket, VenueSellQuoteRequest } from "@agg-build/hooks";
|
|
2
|
-
import type
|
|
2
|
+
import { type AggClient, type SmartRouteResponse, type WsOrderSubmitted } from "@agg-build/sdk";
|
|
3
3
|
import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
|
|
4
4
|
import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderLimitVenueOption, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
|
|
5
5
|
/** Quote identity follows spendable funds and reservations, not the clock of an
|
|
@@ -111,7 +111,7 @@ export declare const sanitizePlaceOrderAmount: (value: number) => number;
|
|
|
111
111
|
export declare const getTradingRoutePriceLabel: (value: number) => string;
|
|
112
112
|
export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
|
|
113
113
|
export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, tradeSide, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
|
|
114
|
-
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
114
|
+
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, betdexFundingRequired, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
115
115
|
/**
|
|
116
116
|
* Default route-card pick when the user hasn't selected one (or their selection
|
|
117
117
|
* disappeared from the list). Normally the first available card wins, but when
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { WithdrawSelectOption } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawAmountStepProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
fixedDestination?: boolean;
|
|
3
5
|
amount: string;
|
|
4
6
|
destinationWallet: string;
|
|
5
7
|
balanceDisplay: string;
|
|
@@ -26,4 +28,4 @@ export interface WithdrawAmountStepProps {
|
|
|
26
28
|
onMaxClick?: () => void;
|
|
27
29
|
onContinue: () => void;
|
|
28
30
|
}
|
|
29
|
-
export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
31
|
+
export declare const WithdrawAmountStep: ({ title, fixedDestination, amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { WithdrawSelectOption } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawAmountStepProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
fixedDestination?: boolean;
|
|
3
5
|
amount: string;
|
|
4
6
|
destinationWallet: string;
|
|
5
7
|
balanceDisplay: string;
|
|
@@ -26,4 +28,4 @@ export interface WithdrawAmountStepProps {
|
|
|
26
28
|
onMaxClick?: () => void;
|
|
27
29
|
onContinue: () => void;
|
|
28
30
|
}
|
|
29
|
-
export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
31
|
+
export declare const WithdrawAmountStep: ({ title, fixedDestination, amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
@@ -63,6 +63,14 @@ export interface WithdrawModalControlledProps {
|
|
|
63
63
|
onOpenChange: (open: boolean) => void;
|
|
64
64
|
/** Controlled state for the withdraw flow. */
|
|
65
65
|
withdrawFlow: WithdrawFlowData;
|
|
66
|
+
/** Optional fixed recipient for an owned venue-account transfer. Uses the
|
|
67
|
+
* same preview, bridge, confirmation and withdrawal lifecycle as normal. */
|
|
68
|
+
transferTarget?: {
|
|
69
|
+
title: string;
|
|
70
|
+
address: string;
|
|
71
|
+
chainId: string;
|
|
72
|
+
tokenSymbol: string;
|
|
73
|
+
};
|
|
66
74
|
/** Called when the recipient address input changes. */
|
|
67
75
|
onWithdrawDestinationChange: (address: string) => void;
|
|
68
76
|
/** Called when the withdraw amount changes. */
|
|
@@ -63,6 +63,14 @@ export interface WithdrawModalControlledProps {
|
|
|
63
63
|
onOpenChange: (open: boolean) => void;
|
|
64
64
|
/** Controlled state for the withdraw flow. */
|
|
65
65
|
withdrawFlow: WithdrawFlowData;
|
|
66
|
+
/** Optional fixed recipient for an owned venue-account transfer. Uses the
|
|
67
|
+
* same preview, bridge, confirmation and withdrawal lifecycle as normal. */
|
|
68
|
+
transferTarget?: {
|
|
69
|
+
title: string;
|
|
70
|
+
address: string;
|
|
71
|
+
chainId: string;
|
|
72
|
+
tokenSymbol: string;
|
|
73
|
+
};
|
|
66
74
|
/** Called when the recipient address input changes. */
|
|
67
75
|
onWithdrawDestinationChange: (address: string) => void;
|
|
68
76
|
/** Called when the withdraw amount changes. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"liveline": "^0.0.7",
|
|
101
101
|
"react": "^18.0.0 || ^19.0.0",
|
|
102
102
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
103
|
-
"@agg-build/hooks": "^4.
|
|
104
|
-
"@agg-build/sdk": "^4.
|
|
103
|
+
"@agg-build/hooks": "^4.19.1",
|
|
104
|
+
"@agg-build/sdk": "^4.19.1"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"@number-flow/react": "^0.6.0",
|