@agg-build/ui 2.0.0 → 2.1.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/dist/{chunk-RF2EPYLN.mjs → chunk-IQT4I5B4.mjs} +405 -318
- package/dist/{chunk-RWOF44TC.mjs → chunk-NK57KMYN.mjs} +239 -183
- package/dist/{chunk-HH7L3KLS.mjs → chunk-RPXRTXCY.mjs} +1 -1
- package/dist/{chunk-4CM4F4S6.mjs → chunk-TERG43WW.mjs} +1 -1
- package/dist/{chunk-2UKDQ7WP.mjs → chunk-WU2C3C6K.mjs} +94 -39
- package/dist/{chunk-R3U6YXSQ.mjs → chunk-XHDGSRG7.mjs} +36 -21
- package/dist/{chunk-2ZS3BPSF.mjs → chunk-YJO6LMRT.mjs} +906 -827
- package/dist/events.js +1376 -1314
- package/dist/events.mjs +3 -3
- package/dist/index.js +3701 -3408
- package/dist/index.mjs +13 -7
- package/dist/modals.js +1117 -983
- package/dist/modals.mjs +5 -3
- package/dist/pages.js +2664 -2429
- package/dist/pages.mjs +8 -6
- package/dist/primitives.js +912 -832
- package/dist/primitives.mjs +3 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +554 -510
- package/dist/trading.mjs +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +33 -0
- package/dist/types/events/list/category-sidebar.d.ts +33 -0
- package/dist/types/events/list/event-list-tabs.d.mts +2 -0
- package/dist/types/events/list/event-list-tabs.d.ts +2 -0
- package/dist/types/events/list/index.d.mts +1 -0
- package/dist/types/events/list/index.d.ts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
- package/dist/types/pages/user-profile/index.d.mts +2 -1
- package/dist/types/pages/user-profile/index.d.ts +2 -1
- package/dist/types/pages/user-profile/transaction-explorer.d.mts +1 -0
- package/dist/types/pages/user-profile/transaction-explorer.d.ts +1 -0
- package/dist/types/pages/user-profile/user-profile.types.d.mts +9 -2
- package/dist/types/pages/user-profile/user-profile.types.d.ts +9 -2
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +4 -0
- package/dist/types/primitives/icon/registry.d.ts +4 -0
- package/dist/types/primitives/icon/svg/paper-mode.d.mts +5 -0
- package/dist/types/primitives/icon/svg/paper-mode.d.ts +5 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
- package/dist/types/withdraw/index.d.mts +9 -1
- package/dist/types/withdraw/index.d.ts +9 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -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/trading.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SettlementDetails,
|
|
7
7
|
parseAmount,
|
|
8
8
|
parseVenue
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XHDGSRG7.mjs";
|
|
10
10
|
import {
|
|
11
11
|
SETTLEMENT_SECTION_ID,
|
|
12
12
|
Settlement,
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
getTradingValueLabel,
|
|
22
22
|
getTradingVenueLabel,
|
|
23
23
|
useEventTradingContext
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-TERG43WW.mjs";
|
|
25
|
+
import "./chunk-RPXRTXCY.mjs";
|
|
26
|
+
import "./chunk-YJO6LMRT.mjs";
|
|
27
27
|
export {
|
|
28
28
|
PlaceOrder,
|
|
29
29
|
PlaceOrderFailureView,
|
|
@@ -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. */
|
|
@@ -2,8 +2,9 @@ import type { UserProfilePageProps } from "./user-profile.types";
|
|
|
2
2
|
export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
|
|
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
|
+
export { buildAggTxExplorerHref } from "./transaction-explorer";
|
|
5
6
|
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 & {
|
|
7
|
+
({ 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
8
|
onError?: (error: Error) => void;
|
|
8
9
|
}): JSX.Element;
|
|
9
10
|
displayName: string;
|
|
@@ -2,8 +2,9 @@ import type { UserProfilePageProps } from "./user-profile.types";
|
|
|
2
2
|
export type { UserProfileActivity, UserProfileActivityStatus, UserProfileBalance, UserProfileConnectedExchange, UserProfileConnectedWallet, UserProfileInfo, UserProfilePageClassNames, UserProfilePageProps, UserProfilePosition, UserProfilePositionFilter, UserProfilePositionVenueShare, UserProfileSocialLink, UserProfileTransferStatus, UserProfileVenueBalance, } from "./user-profile.types";
|
|
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
|
+
export { buildAggTxExplorerHref } from "./transaction-explorer";
|
|
5
6
|
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 & {
|
|
7
|
+
({ 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
8
|
onError?: (error: Error) => void;
|
|
8
9
|
}): JSX.Element;
|
|
9
10
|
displayName: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildAggTxExplorerHref: (chainId: string | number | null | undefined, txHash: string | null | undefined) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildAggTxExplorerHref: (chainId: string | number | null | undefined, txHash: string | null | undefined) => string | undefined;
|
|
@@ -156,6 +156,10 @@ export interface UserProfileTradeActivity {
|
|
|
156
156
|
export interface UserProfileRedeemActivity {
|
|
157
157
|
kind: "redeem";
|
|
158
158
|
id: string;
|
|
159
|
+
/** Chain ID used to build an explorer link for the redeem transaction. */
|
|
160
|
+
chainId?: string;
|
|
161
|
+
/** Transaction hash used to build an explorer link for the redeem transaction. */
|
|
162
|
+
txHash?: string;
|
|
159
163
|
/** Whether the activity failed and should render in a degraded state. */
|
|
160
164
|
isFailed?: boolean;
|
|
161
165
|
/** Whether the row should use error-colored text because the activity has an error. */
|
|
@@ -191,6 +195,10 @@ export type UserProfileTransferStatus = UserProfileActivityStatus;
|
|
|
191
195
|
export interface UserProfileTransferActivity {
|
|
192
196
|
kind: "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
193
197
|
id: string;
|
|
198
|
+
/** Chain ID used to build an explorer link for the activity transaction. */
|
|
199
|
+
chainId?: string;
|
|
200
|
+
/** Transaction hash used to build an explorer link for the activity transaction. */
|
|
201
|
+
txHash?: string;
|
|
194
202
|
/** Whether the activity failed and should render in a degraded state. */
|
|
195
203
|
isFailed?: boolean;
|
|
196
204
|
/** Whether the row should use error-colored text because the activity has an error. */
|
|
@@ -211,8 +219,6 @@ export interface UserProfileTransferActivity {
|
|
|
211
219
|
timeLabel: string;
|
|
212
220
|
/** Deposit source — determines the icon in the thumbnail square. Only set when kind is "deposit". */
|
|
213
221
|
depositSource?: "wallet" | "crypto" | "card";
|
|
214
|
-
/** Chain ID for chain-aware deposit icons. */
|
|
215
|
-
chainId?: string | number;
|
|
216
222
|
}
|
|
217
223
|
export type UserProfileActivity = UserProfileTradeActivity | UserProfileRedeemActivity | UserProfileTransferActivity;
|
|
218
224
|
export interface UserProfileOpenOrder {
|
|
@@ -286,6 +292,7 @@ export interface UserProfilePageProps {
|
|
|
286
292
|
openOrders?: UserProfileOpenOrder[];
|
|
287
293
|
/** Activity items */
|
|
288
294
|
activities?: UserProfileActivity[];
|
|
295
|
+
executionMode?: "live" | "paper";
|
|
289
296
|
/** Called when the user clicks "Edit" on the user info card */
|
|
290
297
|
onEditProfile?: () => void;
|
|
291
298
|
/** Called when the user clicks "Deposit" */
|
|
@@ -156,6 +156,10 @@ export interface UserProfileTradeActivity {
|
|
|
156
156
|
export interface UserProfileRedeemActivity {
|
|
157
157
|
kind: "redeem";
|
|
158
158
|
id: string;
|
|
159
|
+
/** Chain ID used to build an explorer link for the redeem transaction. */
|
|
160
|
+
chainId?: string;
|
|
161
|
+
/** Transaction hash used to build an explorer link for the redeem transaction. */
|
|
162
|
+
txHash?: string;
|
|
159
163
|
/** Whether the activity failed and should render in a degraded state. */
|
|
160
164
|
isFailed?: boolean;
|
|
161
165
|
/** Whether the row should use error-colored text because the activity has an error. */
|
|
@@ -191,6 +195,10 @@ export type UserProfileTransferStatus = UserProfileActivityStatus;
|
|
|
191
195
|
export interface UserProfileTransferActivity {
|
|
192
196
|
kind: "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
193
197
|
id: string;
|
|
198
|
+
/** Chain ID used to build an explorer link for the activity transaction. */
|
|
199
|
+
chainId?: string;
|
|
200
|
+
/** Transaction hash used to build an explorer link for the activity transaction. */
|
|
201
|
+
txHash?: string;
|
|
194
202
|
/** Whether the activity failed and should render in a degraded state. */
|
|
195
203
|
isFailed?: boolean;
|
|
196
204
|
/** Whether the row should use error-colored text because the activity has an error. */
|
|
@@ -211,8 +219,6 @@ export interface UserProfileTransferActivity {
|
|
|
211
219
|
timeLabel: string;
|
|
212
220
|
/** Deposit source — determines the icon in the thumbnail square. Only set when kind is "deposit". */
|
|
213
221
|
depositSource?: "wallet" | "crypto" | "card";
|
|
214
|
-
/** Chain ID for chain-aware deposit icons. */
|
|
215
|
-
chainId?: string | number;
|
|
216
222
|
}
|
|
217
223
|
export type UserProfileActivity = UserProfileTradeActivity | UserProfileRedeemActivity | UserProfileTransferActivity;
|
|
218
224
|
export interface UserProfileOpenOrder {
|
|
@@ -286,6 +292,7 @@ export interface UserProfilePageProps {
|
|
|
286
292
|
openOrders?: UserProfileOpenOrder[];
|
|
287
293
|
/** Activity items */
|
|
288
294
|
activities?: UserProfileActivity[];
|
|
295
|
+
executionMode?: "live" | "paper";
|
|
289
296
|
/** Called when the user clicks "Edit" on the user info card */
|
|
290
297
|
onEditProfile?: () => void;
|
|
291
298
|
/** Called when the user clicks "Deposit" */
|
|
@@ -38,6 +38,7 @@ import { InfoIcon } from "./svg/info";
|
|
|
38
38
|
import { iconNames } from "./registry";
|
|
39
39
|
import { LinkAccountsIcon } from "./svg/link-accounts";
|
|
40
40
|
import { LockIcon } from "./svg/lock";
|
|
41
|
+
import { PaperModeIcon } from "./svg/paper-mode";
|
|
41
42
|
import { PencilIcon } from "./svg/pencil";
|
|
42
43
|
import { PlaySquareIcon } from "./svg/play-square";
|
|
43
44
|
import { PolygonIcon } from "./svg/polygon";
|
|
@@ -71,4 +72,4 @@ export declare const Icon: {
|
|
|
71
72
|
({ name, color, size, className, style, ...props }: IconProps): JSX.Element | null;
|
|
72
73
|
displayName: string;
|
|
73
74
|
};
|
|
74
|
-
export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, CircleXmarkIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GiftBonusIcon, GoogleIcon, HourglassStartIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, LockIcon, PencilIcon, PlaySquareIcon, PolygonIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, SparklesFilledIcon, StayInControlIcon, SuccessCheckIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, UserTrustIcon, UsdcIcon, PaperPlaneIcon, WalletAvatarIcon, WalletFilledIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
|
|
75
|
+
export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, CircleXmarkIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GiftBonusIcon, GoogleIcon, HourglassStartIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, LockIcon, PaperModeIcon, PencilIcon, PlaySquareIcon, PolygonIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, SparklesFilledIcon, StayInControlIcon, SuccessCheckIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, UserTrustIcon, UsdcIcon, PaperPlaneIcon, WalletAvatarIcon, WalletFilledIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
|
|
@@ -38,6 +38,7 @@ import { InfoIcon } from "./svg/info";
|
|
|
38
38
|
import { iconNames } from "./registry";
|
|
39
39
|
import { LinkAccountsIcon } from "./svg/link-accounts";
|
|
40
40
|
import { LockIcon } from "./svg/lock";
|
|
41
|
+
import { PaperModeIcon } from "./svg/paper-mode";
|
|
41
42
|
import { PencilIcon } from "./svg/pencil";
|
|
42
43
|
import { PlaySquareIcon } from "./svg/play-square";
|
|
43
44
|
import { PolygonIcon } from "./svg/polygon";
|
|
@@ -71,4 +72,4 @@ export declare const Icon: {
|
|
|
71
72
|
({ name, color, size, className, style, ...props }: IconProps): JSX.Element | null;
|
|
72
73
|
displayName: string;
|
|
73
74
|
};
|
|
74
|
-
export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, CircleXmarkIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GiftBonusIcon, GoogleIcon, HourglassStartIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, LockIcon, PencilIcon, PlaySquareIcon, PolygonIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, SparklesFilledIcon, StayInControlIcon, SuccessCheckIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, UserTrustIcon, UsdcIcon, PaperPlaneIcon, WalletAvatarIcon, WalletFilledIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
|
|
75
|
+
export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, CircleXmarkIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GiftBonusIcon, GoogleIcon, HourglassStartIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, LockIcon, PaperModeIcon, PencilIcon, PlaySquareIcon, PolygonIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, SparklesFilledIcon, StayInControlIcon, SuccessCheckIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, UserTrustIcon, UsdcIcon, PaperPlaneIcon, WalletAvatarIcon, WalletFilledIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
|
|
@@ -188,6 +188,10 @@ export declare const iconRegistry: {
|
|
|
188
188
|
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
189
189
|
displayName: string;
|
|
190
190
|
};
|
|
191
|
+
readonly "paper-mode": {
|
|
192
|
+
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
193
|
+
displayName: string;
|
|
194
|
+
};
|
|
191
195
|
readonly pencil: {
|
|
192
196
|
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
193
197
|
displayName: string;
|
|
@@ -188,6 +188,10 @@ export declare const iconRegistry: {
|
|
|
188
188
|
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
189
189
|
displayName: string;
|
|
190
190
|
};
|
|
191
|
+
readonly "paper-mode": {
|
|
192
|
+
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
193
|
+
displayName: string;
|
|
194
|
+
};
|
|
191
195
|
readonly pencil: {
|
|
192
196
|
({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
|
|
193
197
|
displayName: string;
|
|
@@ -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.
|
|
3
|
+
"version": "2.1.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": "^2.
|
|
104
|
-
"@agg-build/sdk": "^2.
|
|
103
|
+
"@agg-build/hooks": "^2.1.1",
|
|
104
|
+
"@agg-build/sdk": "^2.1.0"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"@number-flow/react": "^0.6.0",
|