@agg-build/ui 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{chunk-2UKDQ7WP.mjs → chunk-3OI2ZLLT.mjs} +94 -39
  2. package/dist/{chunk-4CM4F4S6.mjs → chunk-C5M2OOM3.mjs} +1 -1
  3. package/dist/{chunk-2ZS3BPSF.mjs → chunk-DXF2LMNN.mjs} +132 -81
  4. package/dist/{chunk-RWOF44TC.mjs → chunk-R6FBYAY5.mjs} +239 -183
  5. package/dist/{chunk-RF2EPYLN.mjs → chunk-Y6PVXAUQ.mjs} +27 -77
  6. package/dist/{chunk-R3U6YXSQ.mjs → chunk-YAEA6EDG.mjs} +31 -18
  7. package/dist/{chunk-HH7L3KLS.mjs → chunk-YMVD6Q2A.mjs} +1 -1
  8. package/dist/events.js +497 -462
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2116 -1990
  11. package/dist/index.mjs +9 -7
  12. package/dist/modals.js +278 -171
  13. package/dist/modals.mjs +5 -3
  14. package/dist/pages.js +1557 -1487
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +137 -86
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +28 -15
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/list/category-sidebar.d.mts +33 -0
  23. package/dist/types/events/list/category-sidebar.d.ts +33 -0
  24. package/dist/types/events/list/event-list-tabs.d.mts +2 -0
  25. package/dist/types/events/list/event-list-tabs.d.ts +2 -0
  26. package/dist/types/events/list/index.d.mts +1 -0
  27. package/dist/types/events/list/index.d.ts +1 -0
  28. package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
  29. package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
  30. package/dist/types/pages/user-profile/index.d.mts +1 -1
  31. package/dist/types/pages/user-profile/index.d.ts +1 -1
  32. package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -0
  33. package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -0
  34. package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
  35. package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
  36. package/dist/types/withdraw/index.d.mts +9 -1
  37. package/dist/types/withdraw/index.d.ts +9 -1
  38. package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
  39. package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
  40. package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
  41. package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
  42. package/package.json +3 -3
@@ -0,0 +1,33 @@
1
+ import type { Category } from "@agg-build/sdk";
2
+ import type { SubcategoryPathEntry } from "./event-list.utils";
3
+ export type CategorySidebarLabels = {
4
+ subcategoriesAll: string;
5
+ };
6
+ export type CategorySidebarToggleParams = {
7
+ entry: SubcategoryPathEntry;
8
+ depth: number;
9
+ hasKnownChildren: boolean;
10
+ isExpanded: boolean;
11
+ isSelected: boolean;
12
+ };
13
+ export type CategorySidebarProps = {
14
+ /** Root category whose direct children populate the sidebar. */
15
+ baseCategoryId: string | null;
16
+ /** Children of each category, keyed by parent ID. */
17
+ childrenByParentId: ReadonlyMap<string, readonly Category[]>;
18
+ /** Drill path beneath the root (depth-0 = first child of baseCategoryId). */
19
+ categoryPath: readonly SubcategoryPathEntry[];
20
+ /** Categories that are selected but explicitly collapsed. */
21
+ collapsedCategoryIds: ReadonlySet<string>;
22
+ /** Event count shown on the "All" row (total for the root category). */
23
+ totalEventCount: number;
24
+ labels: CategorySidebarLabels;
25
+ /** Called when the "All" row is clicked. */
26
+ onSelectAll: () => void;
27
+ /** Called when any category row is clicked. */
28
+ onToggleCategory: (params: CategorySidebarToggleParams) => void;
29
+ };
30
+ export declare const CategorySidebar: {
31
+ ({ baseCategoryId, childrenByParentId, categoryPath, collapsedCategoryIds, totalEventCount, labels, onSelectAll, onToggleCategory, }: CategorySidebarProps): JSX.Element;
32
+ displayName: string;
33
+ };
@@ -0,0 +1,33 @@
1
+ import type { Category } from "@agg-build/sdk";
2
+ import type { SubcategoryPathEntry } from "./event-list.utils";
3
+ export type CategorySidebarLabels = {
4
+ subcategoriesAll: string;
5
+ };
6
+ export type CategorySidebarToggleParams = {
7
+ entry: SubcategoryPathEntry;
8
+ depth: number;
9
+ hasKnownChildren: boolean;
10
+ isExpanded: boolean;
11
+ isSelected: boolean;
12
+ };
13
+ export type CategorySidebarProps = {
14
+ /** Root category whose direct children populate the sidebar. */
15
+ baseCategoryId: string | null;
16
+ /** Children of each category, keyed by parent ID. */
17
+ childrenByParentId: ReadonlyMap<string, readonly Category[]>;
18
+ /** Drill path beneath the root (depth-0 = first child of baseCategoryId). */
19
+ categoryPath: readonly SubcategoryPathEntry[];
20
+ /** Categories that are selected but explicitly collapsed. */
21
+ collapsedCategoryIds: ReadonlySet<string>;
22
+ /** Event count shown on the "All" row (total for the root category). */
23
+ totalEventCount: number;
24
+ labels: CategorySidebarLabels;
25
+ /** Called when the "All" row is clicked. */
26
+ onSelectAll: () => void;
27
+ /** Called when any category row is clicked. */
28
+ onToggleCategory: (params: CategorySidebarToggleParams) => void;
29
+ };
30
+ export declare const CategorySidebar: {
31
+ ({ baseCategoryId, childrenByParentId, categoryPath, collapsedCategoryIds, totalEventCount, labels, onSelectAll, onToggleCategory, }: CategorySidebarProps): JSX.Element;
32
+ displayName: string;
33
+ };
@@ -1,6 +1,8 @@
1
1
  import { type MutableRefObject } from "react";
2
2
  import { type TabsOverflowBehavior } from "../../primitives/tabs";
3
3
  import type { EventListTab, EventListTabValue } from "./event-list.types";
4
+ export { useHorizontalScrollState } from "../../shared/use-horizontal-scroll-state";
5
+ export type { UseHorizontalScrollStateResult } from "../../shared/use-horizontal-scroll-state";
4
6
  export type EventListTabsProps = {
5
7
  /** Override the canonical tab list. Disabled-venue filtering is still applied. */
6
8
  tabs?: EventListTab[];
@@ -1,6 +1,8 @@
1
1
  import { type MutableRefObject } from "react";
2
2
  import { type TabsOverflowBehavior } from "../../primitives/tabs";
3
3
  import type { EventListTab, EventListTabValue } from "./event-list.types";
4
+ export { useHorizontalScrollState } from "../../shared/use-horizontal-scroll-state";
5
+ export type { UseHorizontalScrollStateResult } from "../../shared/use-horizontal-scroll-state";
4
6
  export type EventListTabsProps = {
5
7
  /** Override the canonical tab list. Disabled-venue filtering is still applied. */
6
8
  tabs?: EventListTab[];
@@ -1,4 +1,5 @@
1
1
  import type { EventListProps } from "./event-list.types";
2
+ export type { CategorySidebarLabels, CategorySidebarProps } from "./category-sidebar";
2
3
  export type { EventListProps, EventListStateRef } from "./event-list.types";
3
4
  export declare const EventList: {
4
5
  ({ title, limit, maxVisibleItems, search, categoryIds, onCategoryRootChange, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { EventListProps } from "./event-list.types";
2
+ export type { CategorySidebarLabels, CategorySidebarProps } from "./category-sidebar";
2
3
  export type { EventListProps, EventListStateRef } from "./event-list.types";
3
4
  export declare const EventList: {
4
5
  ({ title, limit, maxVisibleItems, search, categoryIds, onCategoryRootChange, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
@@ -44,6 +44,7 @@ export type EventMarketPageBaseProps = {
44
44
  defaultOutcomeId?: string;
45
45
  /** Whether to render the place-order panel. */
46
46
  showPlaceOrder?: boolean;
47
+ executionMode?: "live" | "paper";
47
48
  /** Optional resolved-event claim summary shown inside the read-only order panel. */
48
49
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
49
50
  /** Class name overrides for page layout slots. */
@@ -44,6 +44,7 @@ export type EventMarketPageBaseProps = {
44
44
  defaultOutcomeId?: string;
45
45
  /** Whether to render the place-order panel. */
46
46
  showPlaceOrder?: boolean;
47
+ executionMode?: "live" | "paper";
47
48
  /** Optional resolved-event claim summary shown inside the read-only order panel. */
48
49
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
49
50
  /** Class name overrides for page layout slots. */
@@ -3,7 +3,7 @@ export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance
3
3
  export { USER_PROFILE_TAB_ACTIVITY, USER_PROFILE_TAB_OPEN_ORDERS, USER_PROFILE_TAB_POSITIONS, } from "./user-profile.constants";
4
4
  export type { UserProfileTabValue } from "./user-profile.constants";
5
5
  export declare const UserProfilePage: {
6
- ({ user, balanceChainsOverride, venueBalances: _venueBalances, balance, activePositions, closedPositions, activities, onEditProfile, onDeposit, onWithdraw, openOrders, initialPositionFilter, tab, onTabChange, onPositionClick, getPositionHref, onClaim, claimingPositionKeys, onClaimResult, onClaimSubmitError, onActivityClick, getActivityHref, onOpenOrderClick, onCancelOrder, cancellingOrderIds, isLoadingPositions, isLoadingActivities, isLoadingOpenOrders, positionsError, activitiesError, openOrdersError, hasMoreActivePositions, isLoadingMoreActivePositions, onLoadMoreActivePositions, hasMoreClosedPositions, isLoadingMoreClosedPositions, onLoadMoreClosedPositions, onPositionFilterChange: onPositionFilterChangeProp, hasMoreActivities, isLoadingMoreActivities, onLoadMoreActivities, hasMoreOpenOrders, isLoadingMoreOpenOrders, onLoadMoreOpenOrders, classNames, onError, }: UserProfilePageProps & {
6
+ ({ user, balanceChainsOverride, venueBalances: _venueBalances, balance, activePositions, closedPositions, activities, executionMode, onEditProfile, onDeposit, onWithdraw, openOrders, initialPositionFilter, tab, onTabChange, onPositionClick, getPositionHref, onClaim, claimingPositionKeys, onClaimResult, onClaimSubmitError, onActivityClick, getActivityHref, onOpenOrderClick, onCancelOrder, cancellingOrderIds, isLoadingPositions, isLoadingActivities, isLoadingOpenOrders, positionsError, activitiesError, openOrdersError, hasMoreActivePositions, isLoadingMoreActivePositions, onLoadMoreActivePositions, hasMoreClosedPositions, isLoadingMoreClosedPositions, onLoadMoreClosedPositions, onPositionFilterChange: onPositionFilterChangeProp, hasMoreActivities, isLoadingMoreActivities, onLoadMoreActivities, hasMoreOpenOrders, isLoadingMoreOpenOrders, onLoadMoreOpenOrders, classNames, onError, }: UserProfilePageProps & {
7
7
  onError?: (error: Error) => void;
8
8
  }): JSX.Element;
9
9
  displayName: string;
@@ -3,7 +3,7 @@ export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance
3
3
  export { USER_PROFILE_TAB_ACTIVITY, USER_PROFILE_TAB_OPEN_ORDERS, USER_PROFILE_TAB_POSITIONS, } from "./user-profile.constants";
4
4
  export type { UserProfileTabValue } from "./user-profile.constants";
5
5
  export declare const UserProfilePage: {
6
- ({ user, balanceChainsOverride, venueBalances: _venueBalances, balance, activePositions, closedPositions, activities, onEditProfile, onDeposit, onWithdraw, openOrders, initialPositionFilter, tab, onTabChange, onPositionClick, getPositionHref, onClaim, claimingPositionKeys, onClaimResult, onClaimSubmitError, onActivityClick, getActivityHref, onOpenOrderClick, onCancelOrder, cancellingOrderIds, isLoadingPositions, isLoadingActivities, isLoadingOpenOrders, positionsError, activitiesError, openOrdersError, hasMoreActivePositions, isLoadingMoreActivePositions, onLoadMoreActivePositions, hasMoreClosedPositions, isLoadingMoreClosedPositions, onLoadMoreClosedPositions, onPositionFilterChange: onPositionFilterChangeProp, hasMoreActivities, isLoadingMoreActivities, onLoadMoreActivities, hasMoreOpenOrders, isLoadingMoreOpenOrders, onLoadMoreOpenOrders, classNames, onError, }: UserProfilePageProps & {
6
+ ({ user, balanceChainsOverride, venueBalances: _venueBalances, balance, activePositions, closedPositions, activities, executionMode, onEditProfile, onDeposit, onWithdraw, openOrders, initialPositionFilter, tab, onTabChange, onPositionClick, getPositionHref, onClaim, claimingPositionKeys, onClaimResult, onClaimSubmitError, onActivityClick, getActivityHref, onOpenOrderClick, onCancelOrder, cancellingOrderIds, isLoadingPositions, isLoadingActivities, isLoadingOpenOrders, positionsError, activitiesError, openOrdersError, hasMoreActivePositions, isLoadingMoreActivePositions, onLoadMoreActivePositions, hasMoreClosedPositions, isLoadingMoreClosedPositions, onLoadMoreClosedPositions, onPositionFilterChange: onPositionFilterChangeProp, hasMoreActivities, isLoadingMoreActivities, onLoadMoreActivities, hasMoreOpenOrders, isLoadingMoreOpenOrders, onLoadMoreOpenOrders, classNames, onError, }: UserProfilePageProps & {
7
7
  onError?: (error: Error) => void;
8
8
  }): JSX.Element;
9
9
  displayName: string;
@@ -286,6 +286,7 @@ export interface UserProfilePageProps {
286
286
  openOrders?: UserProfileOpenOrder[];
287
287
  /** Activity items */
288
288
  activities?: UserProfileActivity[];
289
+ executionMode?: "live" | "paper";
289
290
  /** Called when the user clicks "Edit" on the user info card */
290
291
  onEditProfile?: () => void;
291
292
  /** Called when the user clicks "Deposit" */
@@ -286,6 +286,7 @@ export interface UserProfilePageProps {
286
286
  openOrders?: UserProfileOpenOrder[];
287
287
  /** Activity items */
288
288
  activities?: UserProfileActivity[];
289
+ executionMode?: "live" | "paper";
289
290
  /** Called when the user clicks "Edit" on the user info card */
290
291
  onEditProfile?: () => void;
291
292
  /** Called when the user clicks "Deposit" */
@@ -0,0 +1,15 @@
1
+ import { type MutableRefObject } from "react";
2
+ export type UseHorizontalScrollStateResult<T extends HTMLElement = HTMLElement> = {
3
+ containerRef: MutableRefObject<T | null>;
4
+ canScrollLeft: boolean;
5
+ canScrollRight: boolean;
6
+ /** Call after content changes that alter overflow without triggering scroll/resize. */
7
+ update: () => void;
8
+ };
9
+ /**
10
+ * Tracks whether a horizontally scrollable container can scroll further left
11
+ * or right. Attaches a passive scroll listener and a ResizeObserver. Call
12
+ * `update()` after programmatic content mutations that may change overflow
13
+ * without emitting a native scroll or resize event.
14
+ */
15
+ export declare const useHorizontalScrollState: <T extends HTMLElement = HTMLElement>() => UseHorizontalScrollStateResult<T>;
@@ -0,0 +1,15 @@
1
+ import { type MutableRefObject } from "react";
2
+ export type UseHorizontalScrollStateResult<T extends HTMLElement = HTMLElement> = {
3
+ containerRef: MutableRefObject<T | null>;
4
+ canScrollLeft: boolean;
5
+ canScrollRight: boolean;
6
+ /** Call after content changes that alter overflow without triggering scroll/resize. */
7
+ update: () => void;
8
+ };
9
+ /**
10
+ * Tracks whether a horizontally scrollable container can scroll further left
11
+ * or right. Attaches a passive scroll listener and a ResizeObserver. Call
12
+ * `update()` after programmatic content mutations that may change overflow
13
+ * without emitting a native scroll or resize event.
14
+ */
15
+ export declare const useHorizontalScrollState: <T extends HTMLElement = HTMLElement>() => UseHorizontalScrollStateResult<T>;
@@ -1,5 +1,13 @@
1
- import type { WithdrawModalProps } from "./withdraw-modal.types";
1
+ import type { WithdrawModalProps, WithdrawSummary } from "./withdraw-modal.types";
2
2
  export type { WithdrawMethod, WithdrawModalControlledProps, WithdrawModalProps, WithdrawModalSelfDrivenProps, WithdrawFlowData, WithdrawFeeEstimate, WithdrawSummary, } from "./withdraw-modal.types";
3
+ export declare const buildTerminalSummary: ({ fallbackSummary, lifecycleCompletedAmountRaw, lifecycleRequestedAmountRaw, lifecycleFeeRaw, tokenSymbol, chainId, }: {
4
+ fallbackSummary: WithdrawSummary;
5
+ lifecycleCompletedAmountRaw: string | null;
6
+ lifecycleRequestedAmountRaw: string | null;
7
+ lifecycleFeeRaw: string | null;
8
+ tokenSymbol: string;
9
+ chainId: string;
10
+ }) => WithdrawSummary;
3
11
  export declare const WithdrawModal: {
4
12
  (props: WithdrawModalProps): JSX.Element;
5
13
  displayName: string;
@@ -1,5 +1,13 @@
1
- import type { WithdrawModalProps } from "./withdraw-modal.types";
1
+ import type { WithdrawModalProps, WithdrawSummary } from "./withdraw-modal.types";
2
2
  export type { WithdrawMethod, WithdrawModalControlledProps, WithdrawModalProps, WithdrawModalSelfDrivenProps, WithdrawFlowData, WithdrawFeeEstimate, WithdrawSummary, } from "./withdraw-modal.types";
3
+ export declare const buildTerminalSummary: ({ fallbackSummary, lifecycleCompletedAmountRaw, lifecycleRequestedAmountRaw, lifecycleFeeRaw, tokenSymbol, chainId, }: {
4
+ fallbackSummary: WithdrawSummary;
5
+ lifecycleCompletedAmountRaw: string | null;
6
+ lifecycleRequestedAmountRaw: string | null;
7
+ lifecycleFeeRaw: string | null;
8
+ tokenSymbol: string;
9
+ chainId: string;
10
+ }) => WithdrawSummary;
3
11
  export declare const WithdrawModal: {
4
12
  (props: WithdrawModalProps): JSX.Element;
5
13
  displayName: string;
@@ -7,8 +7,17 @@ export interface WithdrawAmountStepProps {
7
7
  networkOptions: WithdrawSelectOption[];
8
8
  selectedToken: string;
9
9
  selectedNetwork: string;
10
+ /** Decimals for the destination token on the selected chain (e.g. 18 for USDC on BNB, 6 elsewhere). */
11
+ destDecimals: number;
10
12
  isConfirming?: boolean;
11
13
  error?: string | null;
14
+ /**
15
+ * When `true`, the preview request includes `max:true` so the backend caps
16
+ * the withdrawal to the deliverable maximum rather than returning unviable.
17
+ * Should only be set after the user clicks Max — manual over-amounts must
18
+ * still show the unviable state.
19
+ */
20
+ max?: boolean;
12
21
  onBack: () => void;
13
22
  onAmountChange: (amount: string) => void;
14
23
  onDestinationChange: (address: string) => void;
@@ -17,4 +26,4 @@ export interface WithdrawAmountStepProps {
17
26
  onMaxClick?: () => void;
18
27
  onContinue: () => void;
19
28
  }
20
- export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, isConfirming, error, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
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;
@@ -7,8 +7,17 @@ export interface WithdrawAmountStepProps {
7
7
  networkOptions: WithdrawSelectOption[];
8
8
  selectedToken: string;
9
9
  selectedNetwork: string;
10
+ /** Decimals for the destination token on the selected chain (e.g. 18 for USDC on BNB, 6 elsewhere). */
11
+ destDecimals: number;
10
12
  isConfirming?: boolean;
11
13
  error?: string | null;
14
+ /**
15
+ * When `true`, the preview request includes `max:true` so the backend caps
16
+ * the withdrawal to the deliverable maximum rather than returning unviable.
17
+ * Should only be set after the user clicks Max — manual over-amounts must
18
+ * still show the unviable state.
19
+ */
20
+ max?: boolean;
12
21
  onBack: () => void;
13
22
  onAmountChange: (amount: string) => void;
14
23
  onDestinationChange: (address: string) => void;
@@ -17,4 +26,4 @@ export interface WithdrawAmountStepProps {
17
26
  onMaxClick?: () => void;
18
27
  onContinue: () => void;
19
28
  }
20
- export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, isConfirming, error, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
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;
@@ -8,6 +8,8 @@ export interface WithdrawSelectOption {
8
8
  value: string;
9
9
  label: string;
10
10
  iconUrl?: string;
11
+ /** When true, the option is shown but not selectable (e.g. a chain that can't receive the entered address). */
12
+ disabled?: boolean;
11
13
  }
12
14
  export interface WithdrawProviderOption {
13
15
  id: string;
@@ -46,6 +48,12 @@ export interface WithdrawFlowData {
46
48
  * `withdrawal_lifecycle` WS events.
47
49
  */
48
50
  withdrawalId: string | null;
51
+ /**
52
+ * True when the user clicked Max — the backend should apply its own cap
53
+ * rather than rejecting an over-balance request. Reset to false when the
54
+ * user manually edits the amount field afterward.
55
+ */
56
+ isMax: boolean;
49
57
  }
50
58
  export type WithdrawMethod = "wallet";
51
59
  export interface WithdrawModalControlledProps {
@@ -8,6 +8,8 @@ export interface WithdrawSelectOption {
8
8
  value: string;
9
9
  label: string;
10
10
  iconUrl?: string;
11
+ /** When true, the option is shown but not selectable (e.g. a chain that can't receive the entered address). */
12
+ disabled?: boolean;
11
13
  }
12
14
  export interface WithdrawProviderOption {
13
15
  id: string;
@@ -46,6 +48,12 @@ export interface WithdrawFlowData {
46
48
  * `withdrawal_lifecycle` WS events.
47
49
  */
48
50
  withdrawalId: string | null;
51
+ /**
52
+ * True when the user clicked Max — the backend should apply its own cap
53
+ * rather than rejecting an over-balance request. Reset to false when the
54
+ * user manually edits the amount field afterward.
55
+ */
56
+ isMax: boolean;
49
57
  }
50
58
  export type WithdrawMethod = "wallet";
51
59
  export interface WithdrawModalControlledProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
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": "^2.0.0",
104
- "@agg-build/sdk": "^2.0.0"
103
+ "@agg-build/hooks": "^2.1.0",
104
+ "@agg-build/sdk": "^2.1.0"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",