@agg-build/ui 1.2.9 → 1.2.11

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 (100) hide show
  1. package/dist/{chunk-PFOSEY46.mjs → chunk-3ZSNHGAB.mjs} +835 -401
  2. package/dist/{chunk-5PSAIGOT.mjs → chunk-54PCEK6G.mjs} +137 -61
  3. package/dist/{chunk-7JKGAWU5.mjs → chunk-ENAGASVU.mjs} +1538 -1369
  4. package/dist/{chunk-K23CJ5UP.mjs → chunk-J7K2U44E.mjs} +481 -258
  5. package/dist/{chunk-5MDFM2MX.mjs → chunk-NWJHFGBZ.mjs} +1 -1
  6. package/dist/{chunk-QFW5NDJ6.mjs → chunk-SJLHOAKK.mjs} +1001 -1015
  7. package/dist/{chunk-PYKD4W4T.mjs → chunk-YP75TIY6.mjs} +601 -326
  8. package/dist/events.js +2038 -1559
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +5417 -4261
  11. package/dist/index.mjs +56 -50
  12. package/dist/modals.js +3262 -2384
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +3677 -2709
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +992 -918
  17. package/dist/primitives.mjs +5 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +1360 -1129
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/deposit/deposit-modal.types.d.mts +10 -1
  23. package/dist/types/deposit/deposit-modal.types.d.ts +10 -1
  24. package/dist/types/deposit/index.d.mts +1 -1
  25. package/dist/types/deposit/index.d.ts +1 -1
  26. package/dist/types/deposit/steps/crypto-transfer.d.mts +1 -2
  27. package/dist/types/deposit/steps/crypto-transfer.d.ts +1 -2
  28. package/dist/types/deposit/steps/deposit-method.d.mts +2 -1
  29. package/dist/types/deposit/steps/deposit-method.d.ts +2 -1
  30. package/dist/types/events/item/event-list-item.types.d.mts +3 -1
  31. package/dist/types/events/item/event-list-item.types.d.ts +3 -1
  32. package/dist/types/events/item/event-list-item.utils.d.mts +26 -2
  33. package/dist/types/events/item/event-list-item.utils.d.ts +26 -2
  34. package/dist/types/events/item-details/event-list-item-details.types.d.mts +30 -1
  35. package/dist/types/events/item-details/event-list-item-details.types.d.ts +30 -1
  36. package/dist/types/events/market-details/index.d.mts +1 -1
  37. package/dist/types/events/market-details/index.d.ts +1 -1
  38. package/dist/types/events/market-details/market-details.types.d.mts +27 -2
  39. package/dist/types/events/market-details/market-details.types.d.ts +27 -2
  40. package/dist/types/events/market-details/market-details.utils.d.mts +18 -4
  41. package/dist/types/events/market-details/market-details.utils.d.ts +18 -4
  42. package/dist/types/events/market-details/orderbook-aggregation.d.mts +38 -2
  43. package/dist/types/events/market-details/orderbook-aggregation.d.ts +38 -2
  44. package/dist/types/events/shared/chart-auto-fallback.d.mts +43 -0
  45. package/dist/types/events/shared/chart-auto-fallback.d.ts +43 -0
  46. package/dist/types/events/shared/display-outcome-price.d.mts +14 -0
  47. package/dist/types/events/shared/display-outcome-price.d.ts +14 -0
  48. package/dist/types/events/shared/display-outcome-venue.d.mts +30 -0
  49. package/dist/types/events/shared/display-outcome-venue.d.ts +30 -0
  50. package/dist/types/events/shared/display-reference-price.d.mts +4 -0
  51. package/dist/types/events/shared/display-reference-price.d.ts +4 -0
  52. package/dist/types/events/shared/select-outcome-price.d.mts +21 -0
  53. package/dist/types/events/shared/select-outcome-price.d.ts +21 -0
  54. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
  55. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
  56. package/dist/types/pages/user-profile/components/positions-value-card.d.mts +2 -1
  57. package/dist/types/pages/user-profile/components/positions-value-card.d.ts +2 -1
  58. package/dist/types/pages/user-profile/index.d.mts +2 -2
  59. package/dist/types/pages/user-profile/index.d.ts +2 -2
  60. package/dist/types/pages/user-profile/user-profile.types.d.mts +54 -1
  61. package/dist/types/pages/user-profile/user-profile.types.d.ts +54 -1
  62. package/dist/types/primitives/chart/chart.utils.d.mts +9 -10
  63. package/dist/types/primitives/chart/chart.utils.d.ts +9 -10
  64. package/dist/types/primitives/icon/index.d.mts +2 -1
  65. package/dist/types/primitives/icon/index.d.ts +2 -1
  66. package/dist/types/primitives/icon/registry.d.mts +8 -0
  67. package/dist/types/primitives/icon/registry.d.ts +8 -0
  68. package/dist/types/primitives/icon/svg/circle-xmark.d.mts +5 -0
  69. package/dist/types/primitives/icon/svg/circle-xmark.d.ts +5 -0
  70. package/dist/types/primitives/icon/svg/spinner.d.mts +5 -0
  71. package/dist/types/primitives/icon/svg/spinner.d.ts +5 -0
  72. package/dist/types/primitives/toast/index.d.mts +2 -0
  73. package/dist/types/primitives/toast/index.d.ts +2 -0
  74. package/dist/types/primitives/tooltip/tooltip.types.d.mts +1 -0
  75. package/dist/types/primitives/tooltip/tooltip.types.d.ts +1 -0
  76. package/dist/types/primitives/typography/index.d.mts +1 -1
  77. package/dist/types/primitives/typography/index.d.ts +1 -1
  78. package/dist/types/primitives/typography/typography.types.d.mts +2 -0
  79. package/dist/types/primitives/typography/typography.types.d.ts +2 -0
  80. package/dist/types/shared/transfer-fee-summary.d.mts +10 -0
  81. package/dist/types/shared/transfer-fee-summary.d.ts +10 -0
  82. package/dist/types/shared/utils.d.mts +3 -0
  83. package/dist/types/shared/utils.d.ts +3 -0
  84. package/dist/types/trading/place-order/index.d.mts +1 -1
  85. package/dist/types/trading/place-order/index.d.ts +1 -1
  86. package/dist/types/trading/place-order/index.place-order.execution-steps.d.mts +9 -0
  87. package/dist/types/trading/place-order/index.place-order.execution-steps.d.ts +9 -0
  88. package/dist/types/trading/place-order/index.place-order.types.d.mts +15 -2
  89. package/dist/types/trading/place-order/index.place-order.types.d.ts +15 -2
  90. package/dist/types/trading/place-order/index.place-order.utils.d.mts +49 -6
  91. package/dist/types/trading/place-order/index.place-order.utils.d.ts +49 -6
  92. package/dist/types/withdraw/index.d.mts +1 -1
  93. package/dist/types/withdraw/index.d.ts +1 -1
  94. package/dist/types/withdraw/steps/withdraw-success.d.mts +13 -7
  95. package/dist/types/withdraw/steps/withdraw-success.d.ts +13 -7
  96. package/dist/types/withdraw/steps/withdraw-success.utils.d.mts +2 -0
  97. package/dist/types/withdraw/steps/withdraw-success.utils.d.ts +2 -0
  98. package/dist/types/withdraw/withdraw-modal.types.d.mts +5 -0
  99. package/dist/types/withdraw/withdraw-modal.types.d.ts +5 -0
  100. package/package.json +3 -3
@@ -65,6 +65,8 @@ export interface UserProfilePosition {
65
65
  title: string;
66
66
  /** Outcome name for the pill only, e.g. "Yes" (no price). */
67
67
  outcomeLabel: string;
68
+ /** Resolved winning outcome name shown in closed position rows, e.g. "No". */
69
+ resolutionLabel?: string | null;
68
70
  /** Per-venue position sizes with logos below the pill. */
69
71
  venueShareBreakdown: UserProfilePositionVenueShare[];
70
72
  /** Total shares/contracts represented by this row. */
@@ -130,6 +132,10 @@ export interface UserProfileTradeActivity {
130
132
  isFailed?: boolean;
131
133
  /** Whether the row should use error-colored text because the activity has an error. */
132
134
  hasError?: boolean;
135
+ /** Error message for the activity. */
136
+ errorMessage?: string;
137
+ /** Normalized lifecycle status driving row tone. Defaults to "completed". */
138
+ status?: UserProfileActivityStatus;
133
139
  /** Activity type, e.g. "Buy", "Sell" */
134
140
  type: string;
135
141
  /** Market thumbnail image URL */
@@ -147,6 +153,14 @@ export interface UserProfileTradeActivity {
147
153
  /** Time label, e.g. "3d ago" */
148
154
  timeLabel: string;
149
155
  }
156
+ /**
157
+ * Normalized UI state for activity rows. Backend statuses collapse into
158
+ * one of four buckets so row tone, status icons, titles, and amounts stay
159
+ * aligned. Unknown statuses fall back to "completed" — a stale row at rest
160
+ * is the safer default than a sticky spinner.
161
+ */
162
+ export type UserProfileActivityStatus = "completed" | "pending" | "failed" | "canceled";
163
+ export type UserProfileTransferStatus = UserProfileActivityStatus;
150
164
  /** Non-trade activity row: withdrawal / deposit / bridge / user_op. */
151
165
  export interface UserProfileTransferActivity {
152
166
  kind: "withdrawal" | "deposit" | "bridge" | "user_op";
@@ -155,6 +169,10 @@ export interface UserProfileTransferActivity {
155
169
  isFailed?: boolean;
156
170
  /** Whether the row should use error-colored text because the activity has an error. */
157
171
  hasError?: boolean;
172
+ /** Error message for the activity. */
173
+ errorMessage?: string;
174
+ /** Normalized status driving icon, title, and amount rendering. Defaults to "completed". */
175
+ status?: UserProfileTransferStatus;
158
176
  /** Header label, e.g. "Withdraw", "Deposit", "Bridge", "Wallet op". */
159
177
  type: string;
160
178
  /** Title, e.g. "Withdraw USDC". */
@@ -254,8 +272,43 @@ export interface UserProfilePageProps {
254
272
  getPositionHref?: (position: UserProfilePosition) => string | undefined;
255
273
  /** Called when the user claims a closed winning position. */
256
274
  onClaim?: (position: UserProfilePosition) => Promise<void> | void;
257
- /** Map of claim key (marketId or position id) to loading state while claim is in-flight. */
275
+ /**
276
+ * Map of claim key (marketId or position id) to loading state while claim is in-flight.
277
+ *
278
+ * Passing this prop overrides the internal lifecycle-driven spinner (the page derives
279
+ * spinner state from the in-flight redeem's WS lifecycle when this prop is omitted).
280
+ * Partners who own the claim flow via `onClaim` typically pass their own state here;
281
+ * partners who let the page own the flow should omit this prop.
282
+ */
258
283
  claimingPositionKeys?: Record<string, boolean>;
284
+ /**
285
+ * Called once per redeem when its lifecycle reaches terminal (every expected leg
286
+ * confirmed or failed on chain). Receives the same `claimKey` that
287
+ * `claimingPositionKeys` uses (i.e. `position.marketId ?? position.id`) plus a
288
+ * summary of the terminal lifecycle state. Use this to fire one-shot success/failure
289
+ * toasts.
290
+ *
291
+ * NOT fired for synchronous submit failures (network errors, `RedeemRejectedError`)
292
+ * — those go through `onClaimSubmitError`.
293
+ *
294
+ * Only fired when the internal claim path is used (i.e. when the caller does NOT
295
+ * pass an `onClaim` prop). Callers that own the claim flow via `onClaim` are
296
+ * responsible for their own toasting.
297
+ */
298
+ onClaimResult?: (claimKey: string, lifecycle: {
299
+ allConfirmed: boolean;
300
+ anyFailed: boolean;
301
+ errorMessage: string | null;
302
+ }) => void;
303
+ /**
304
+ * Called when the redeem mutation itself rejects — i.e. transport error, validation
305
+ * error, or `RedeemRejectedError` (all legs ineligible/rejected at submit time). The
306
+ * redeem never enters the WS lifecycle in these cases, so `onClaimResult` does NOT
307
+ * fire.
308
+ *
309
+ * Only fired when the internal claim path is used.
310
+ */
311
+ onClaimSubmitError?: (claimKey: string, error: Error) => void;
259
312
  /** Called when an activity row is clicked */
260
313
  onActivityClick?: (activity: UserProfileActivity) => void;
261
314
  /** Optional href for an activity row (enables ctrl/cmd/middle-click to open in a new tab). */
@@ -15,17 +15,16 @@ export declare const padSparseCandles: (candles: CandlePoint[], intervalSeconds?
15
15
  export declare const resolveCandleWidthSeconds: (points: LineChartPoint[], fallback?: number) => number | undefined;
16
16
  export declare const resolveWindowSeconds: (normalizedSeries: LineChartSeries[]) => number;
17
17
  /**
18
- * Liveline is a real-time chart that anchors its visible window to
19
- * `Date.now()`. Historical data that ended well before "now" falls outside
20
- * the visible region, causing liveline to draw "No data". Additionally,
21
- * liveline's multi-series render path requires `visible.length >= 2` per
22
- * series inside the window.
18
+ * Renderer-only fallback. Liveline anchors its visible window to `Date.now()`
19
+ * and refuses to draw fewer than 2 points per series, so this helper:
20
+ * - extends a series forward to "now" (projecting the last known value)
21
+ * when the tail is older than 5 minutes, and
22
+ * - pads single-point series with a duplicate shifted 5m back.
23
23
  *
24
- * This helper extends every series so that data reaches up to "now", ensuring
25
- * the points always fall inside the liveline visible window. It also guarantees
26
- * at least 2 points per series (the minimum liveline requires).
27
- *
28
- * The returned series should be used for both `data` and `series` props.
24
+ * **It is a fallback only.** The real-time pipeline keeps the chart fresh by
25
+ * (a) ticking the rolling window's `nowSec`, (b) backfilling via REST refetch
26
+ * at each candle bucket, and (c) promoting closed WS live candles into the
27
+ * cached history. When those are working, `extendSeriesToNow` is a no-op.
29
28
  */
30
29
  export declare const extendSeriesToNow: (series: LineChartSeries[]) => LineChartSeries[];
31
30
  export declare const resolveLatestValue: (points: LineChartPoint[]) => number;
@@ -15,17 +15,16 @@ export declare const padSparseCandles: (candles: CandlePoint[], intervalSeconds?
15
15
  export declare const resolveCandleWidthSeconds: (points: LineChartPoint[], fallback?: number) => number | undefined;
16
16
  export declare const resolveWindowSeconds: (normalizedSeries: LineChartSeries[]) => number;
17
17
  /**
18
- * Liveline is a real-time chart that anchors its visible window to
19
- * `Date.now()`. Historical data that ended well before "now" falls outside
20
- * the visible region, causing liveline to draw "No data". Additionally,
21
- * liveline's multi-series render path requires `visible.length >= 2` per
22
- * series inside the window.
18
+ * Renderer-only fallback. Liveline anchors its visible window to `Date.now()`
19
+ * and refuses to draw fewer than 2 points per series, so this helper:
20
+ * - extends a series forward to "now" (projecting the last known value)
21
+ * when the tail is older than 5 minutes, and
22
+ * - pads single-point series with a duplicate shifted 5m back.
23
23
  *
24
- * This helper extends every series so that data reaches up to "now", ensuring
25
- * the points always fall inside the liveline visible window. It also guarantees
26
- * at least 2 points per series (the minimum liveline requires).
27
- *
28
- * The returned series should be used for both `data` and `series` props.
24
+ * **It is a fallback only.** The real-time pipeline keeps the chart fresh by
25
+ * (a) ticking the rolling window's `nowSec`, (b) backfilling via REST refetch
26
+ * at each candle bucket, and (c) promoting closed WS live candles into the
27
+ * cached history. When those are working, `extendSeriesToNow` is a no-op.
29
28
  */
30
29
  export declare const extendSeriesToNow: (series: LineChartSeries[]) => LineChartSeries[];
31
30
  export declare const resolveLatestValue: (points: LineChartPoint[]) => number;
@@ -14,6 +14,7 @@ import { CheckCircleIcon } from "./svg/check-circle";
14
14
  import { ChartCandlestickIcon } from "./svg/chart-candlestick";
15
15
  import { ChartLineIcon } from "./svg/chart-line";
16
16
  import { CircleOverlapIcon } from "./svg/circle-overlap";
17
+ import { CircleXmarkIcon } from "./svg/circle-xmark";
17
18
  import { ChevronDownIcon } from "./svg/chevron-down";
18
19
  import { ChevronLeftIcon } from "./svg/chevron-left";
19
20
  import { ChevronRightIcon } from "./svg/chevron-right";
@@ -69,4 +70,4 @@ export declare const Icon: {
69
70
  ({ name, color, size, className, style, ...props }: IconProps): JSX.Element | null;
70
71
  displayName: string;
71
72
  };
72
- export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, 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, };
73
+ 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, 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, };
@@ -14,6 +14,7 @@ import { CheckCircleIcon } from "./svg/check-circle";
14
14
  import { ChartCandlestickIcon } from "./svg/chart-candlestick";
15
15
  import { ChartLineIcon } from "./svg/chart-line";
16
16
  import { CircleOverlapIcon } from "./svg/circle-overlap";
17
+ import { CircleXmarkIcon } from "./svg/circle-xmark";
17
18
  import { ChevronDownIcon } from "./svg/chevron-down";
18
19
  import { ChevronLeftIcon } from "./svg/chevron-left";
19
20
  import { ChevronRightIcon } from "./svg/chevron-right";
@@ -69,4 +70,4 @@ export declare const Icon: {
69
70
  ({ name, color, size, className, style, ...props }: IconProps): JSX.Element | null;
70
71
  displayName: string;
71
72
  };
72
- export { ActivityChartIcon, AppleIcon, AppsIcon, BadgeCheckThinIcon, ArbitrumIcon, ArrowRightIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BaseIcon, BestPricesIcon, BnbIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, CircleOverlapIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, 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, };
73
+ 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, 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, };
@@ -80,6 +80,10 @@ export declare const iconRegistry: {
80
80
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
81
81
  displayName: string;
82
82
  };
83
+ readonly "circle-xmark": {
84
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
85
+ displayName: string;
86
+ };
83
87
  readonly "chevron-down": {
84
88
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
85
89
  displayName: string;
@@ -232,6 +236,10 @@ export declare const iconRegistry: {
232
236
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
233
237
  displayName: string;
234
238
  };
239
+ readonly spinner: {
240
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
241
+ displayName: string;
242
+ };
235
243
  readonly "stay-in-control": {
236
244
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
237
245
  displayName: string;
@@ -80,6 +80,10 @@ export declare const iconRegistry: {
80
80
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
81
81
  displayName: string;
82
82
  };
83
+ readonly "circle-xmark": {
84
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
85
+ displayName: string;
86
+ };
83
87
  readonly "chevron-down": {
84
88
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
85
89
  displayName: string;
@@ -232,6 +236,10 @@ export declare const iconRegistry: {
232
236
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
233
237
  displayName: string;
234
238
  };
239
+ readonly spinner: {
240
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
241
+ displayName: string;
242
+ };
235
243
  readonly "stay-in-control": {
236
244
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
237
245
  displayName: string;
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const CircleXmarkIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const CircleXmarkIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const SpinnerIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const SpinnerIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -2,3 +2,5 @@ import type { ToastContextValue, ToastProviderProps } from "./toast.types";
2
2
  export type { ToastContextValue, ToastEntry, ToastOptions, ToastProviderProps, ToastSwipeDirection, ToastTone, } from "./toast.types";
3
3
  export declare function ToastProvider({ children, defaultDurationMs, swipeDirection, swipeThreshold, viewportClassName, }: ToastProviderProps): JSX.Element;
4
4
  export declare function useToast(): ToastContextValue;
5
+ /** Like {@link useToast}, but returns `null` when no `<ToastProvider>` is mounted. */
6
+ export declare function useOptionalToast(): ToastContextValue | null;
@@ -2,3 +2,5 @@ import type { ToastContextValue, ToastProviderProps } from "./toast.types";
2
2
  export type { ToastContextValue, ToastEntry, ToastOptions, ToastProviderProps, ToastSwipeDirection, ToastTone, } from "./toast.types";
3
3
  export declare function ToastProvider({ children, defaultDurationMs, swipeDirection, swipeThreshold, viewportClassName, }: ToastProviderProps): JSX.Element;
4
4
  export declare function useToast(): ToastContextValue;
5
+ /** Like {@link useToast}, but returns `null` when no `<ToastProvider>` is mounted. */
6
+ export declare function useOptionalToast(): ToastContextValue | null;
@@ -5,6 +5,7 @@ export type TooltipClassNames = {
5
5
  content?: string;
6
6
  trigger?: string;
7
7
  arrow?: string;
8
+ icon?: string;
8
9
  };
9
10
  export interface TooltipProps {
10
11
  /** Content rendered inside the tooltip surface. */
@@ -5,6 +5,7 @@ export type TooltipClassNames = {
5
5
  content?: string;
6
6
  trigger?: string;
7
7
  arrow?: string;
8
+ icon?: string;
8
9
  };
9
10
  export interface TooltipProps {
10
11
  /** Content rendered inside the tooltip surface. */
@@ -3,6 +3,6 @@ export type { LegacyTypographyVariant, TokenTypographyVariant, TypographyProps,
3
3
  export { typographyVariants } from "./typography.constants";
4
4
  /** Renders semantic text content using the selected typography variant styles. */
5
5
  export declare const Typography: {
6
- ({ as: Component, variant, className, children, }: TypographyProps): JSX.Element;
6
+ ({ as: Component, variant, className, children, "aria-label": ariaLabel, }: TypographyProps): JSX.Element;
7
7
  displayName: string;
8
8
  };
@@ -3,6 +3,6 @@ export type { LegacyTypographyVariant, TokenTypographyVariant, TypographyProps,
3
3
  export { typographyVariants } from "./typography.constants";
4
4
  /** Renders semantic text content using the selected typography variant styles. */
5
5
  export declare const Typography: {
6
- ({ as: Component, variant, className, children, }: TypographyProps): JSX.Element;
6
+ ({ as: Component, variant, className, children, "aria-label": ariaLabel, }: TypographyProps): JSX.Element;
7
7
  displayName: string;
8
8
  };
@@ -11,4 +11,6 @@ export type TypographyProps = {
11
11
  className?: string;
12
12
  /** Content rendered inside the typography element. */
13
13
  children: ReactNode;
14
+ /** Accessible label forwarded to the underlying element. */
15
+ "aria-label"?: string;
14
16
  };
@@ -11,4 +11,6 @@ export type TypographyProps = {
11
11
  className?: string;
12
12
  /** Content rendered inside the typography element. */
13
13
  children: ReactNode;
14
+ /** Accessible label forwarded to the underlying element. */
15
+ "aria-label"?: string;
14
16
  };
@@ -0,0 +1,10 @@
1
+ import { type WithdrawFeeEstimate } from "@agg-build/hooks";
2
+ type TransferFeeSummaryView = "deposit" | "withdraw";
3
+ export interface TransferFeeSummaryProps {
4
+ estimate: WithdrawFeeEstimate | null;
5
+ view: TransferFeeSummaryView;
6
+ minDeposit?: string;
7
+ eta?: string;
8
+ }
9
+ export declare const TransferFeeSummary: ({ estimate, view, minDeposit, eta, }: TransferFeeSummaryProps) => JSX.Element | null;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type WithdrawFeeEstimate } from "@agg-build/hooks";
2
+ type TransferFeeSummaryView = "deposit" | "withdraw";
3
+ export interface TransferFeeSummaryProps {
4
+ estimate: WithdrawFeeEstimate | null;
5
+ view: TransferFeeSummaryView;
6
+ minDeposit?: string;
7
+ eta?: string;
8
+ }
9
+ export declare const TransferFeeSummary: ({ estimate, view, minDeposit, eta, }: TransferFeeSummaryProps) => JSX.Element | null;
10
+ export {};
@@ -17,5 +17,8 @@ type FormatUsdOptions = {
17
17
  export declare const formatUsd: (value: number, options?: FormatUsdOptions) => string;
18
18
  /** Compact USD format (e.g. 127.8 → "$127.8", 50 → "$50"). */
19
19
  export declare const formatCompactUsd: (amount: number) => string;
20
+ export declare const formatTokenAmount: (amount: number, symbol: string, options?: {
21
+ maximumFractionDigits?: number;
22
+ }) => string;
20
23
  /** Format a raw numeric string for the amount input (adds locale grouping). */
21
24
  export declare const formatAmountDisplay: (value: string) => string;
@@ -17,5 +17,8 @@ type FormatUsdOptions = {
17
17
  export declare const formatUsd: (value: number, options?: FormatUsdOptions) => string;
18
18
  /** Compact USD format (e.g. 127.8 → "$127.8", 50 → "$50"). */
19
19
  export declare const formatCompactUsd: (amount: number) => string;
20
+ export declare const formatTokenAmount: (amount: number, symbol: string, options?: {
21
+ maximumFractionDigits?: number;
22
+ }) => string;
20
23
  /** Format a raw numeric string for the amount input (adds locale grouping). */
21
24
  export declare const formatAmountDisplay: (value: string) => string;
@@ -5,6 +5,6 @@ export { PlaceOrderSuccessView } from "./index.place-order.success";
5
5
  export type { PlaceOrderSuccessViewProps } from "./index.place-order.success";
6
6
  export type { PlaceOrderClassNames, PlaceOrderExecutionSummary, PlaceOrderResolvedClaimSummary, PlaceOrderTradingLabels, } from "./index.place-order.types";
7
7
  export declare const PlaceOrder: {
8
- ({ className, classNames, eventTradingState, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, chainBalancesOverride, onAmountChange, onClose, onOutcomeChange, onPrimaryAction, onSlippageChange, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, }: PlaceOrderProps): JSX.Element;
8
+ ({ className, classNames, eventTradingState, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, chainBalancesOverride, onAmountChange, onClose, onOutcomeChange, onPrimaryAction, onSlippageChange, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, midpointsResult, }: PlaceOrderProps): JSX.Element;
9
9
  displayName: string;
10
10
  };
@@ -5,6 +5,6 @@ export { PlaceOrderSuccessView } from "./index.place-order.success";
5
5
  export type { PlaceOrderSuccessViewProps } from "./index.place-order.success";
6
6
  export type { PlaceOrderClassNames, PlaceOrderExecutionSummary, PlaceOrderResolvedClaimSummary, PlaceOrderTradingLabels, } from "./index.place-order.types";
7
7
  export declare const PlaceOrder: {
8
- ({ className, classNames, eventTradingState, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, chainBalancesOverride, onAmountChange, onClose, onOutcomeChange, onPrimaryAction, onSlippageChange, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, }: PlaceOrderProps): JSX.Element;
8
+ ({ className, classNames, eventTradingState, isLoading, isPrimaryActionDisabled, isPrimaryActionLoading, chainBalancesOverride, onAmountChange, onClose, onOutcomeChange, onPrimaryAction, onSlippageChange, onTabChange, onSuccess, onError, onExecutionStateChange, resolvedClaim, midpointsResult, }: PlaceOrderProps): JSX.Element;
9
9
  displayName: string;
10
10
  };
@@ -48,6 +48,15 @@ type PhaseTimelineEntry = NormalizedExecutionPhase & {
48
48
  * A merged entry is `allCompleted` only when every underlying sequence has
49
49
  * finished — so a single in-flight `bridge-submit` keeps the merged
50
50
  * "submitting" row pending even if `bridge-fetch-quote` already completed.
51
+ *
52
+ * Post-pass: the DAG only emits `step_completed` for a subset of sequences
53
+ * (record-state steps, position-reserve, etc.) — sub-steps like
54
+ * `polymarket-deposit-wallet-submit` and `wait` never report completion
55
+ * individually. That means a merged "submitting" block can stay
56
+ * `allCompleted=false` forever even after the executor has moved on to a
57
+ * later block. To preserve the "only the last visible row is pending"
58
+ * invariant, force-complete any block that has any later block with at
59
+ * least one completed sequence.
51
60
  */
52
61
  export declare const buildPhaseTimeline: (dag: DagStepProgress) => PhaseTimelineEntry[];
53
62
  export type BuildSubmissionDisplayRowsArgs = {
@@ -48,6 +48,15 @@ type PhaseTimelineEntry = NormalizedExecutionPhase & {
48
48
  * A merged entry is `allCompleted` only when every underlying sequence has
49
49
  * finished — so a single in-flight `bridge-submit` keeps the merged
50
50
  * "submitting" row pending even if `bridge-fetch-quote` already completed.
51
+ *
52
+ * Post-pass: the DAG only emits `step_completed` for a subset of sequences
53
+ * (record-state steps, position-reserve, etc.) — sub-steps like
54
+ * `polymarket-deposit-wallet-submit` and `wait` never report completion
55
+ * individually. That means a merged "submitting" block can stay
56
+ * `allCompleted=false` forever even after the executor has moved on to a
57
+ * later block. To preserve the "only the last visible row is pending"
58
+ * invariant, force-complete any block that has any later block with at
59
+ * least one completed sequence.
51
60
  */
52
61
  export declare const buildPhaseTimeline: (dag: DagStepProgress) => PhaseTimelineEntry[];
53
62
  export type BuildSubmissionDisplayRowsArgs = {
@@ -1,4 +1,4 @@
1
- import type { AggUiLabels, DagStepProgress, EventTradingState, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
1
+ import type { AggUiLabels, DagStepProgress, EventTradingState, UseMidpointsResult, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
2
2
  import type { SmartRouteResponse } from "@agg-build/sdk";
3
3
  import type { PlaceOrderRoutingRow, PlaceOrderStatus, PlaceOrderTab, TradingVenue } from "../types";
4
4
  export type PlaceOrderProps = {
@@ -38,6 +38,8 @@ export type PlaceOrderProps = {
38
38
  onExecutionStateChange?: (state: PlaceOrderSubmissionProgressState) => void;
39
39
  /** Optional resolved-event claim summary shown in read-only state. */
40
40
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
41
+ /** Pre-fetched midpoint data (best price included) passed from parent. Optional for backward compatibility. */
42
+ midpointsResult?: UseMidpointsResult;
41
43
  };
42
44
  export type PlaceOrderResolvedClaimSummary = {
43
45
  /** Resolution date label, e.g. "Mar 21, 2026". */
@@ -91,7 +93,7 @@ export type PlaceOrderOutcomeClassNameParams = {
91
93
  isActive: boolean;
92
94
  isPositive: boolean;
93
95
  };
94
- export type PlaceOrderOutcomeLabelValue = Pick<VenueMarketOutcome, "id" | "label">;
96
+ export type PlaceOrderOutcomeLabelValue = Pick<VenueMarketOutcome, "id" | "label" | "title">;
95
97
  export type PlaceOrderVenueOutcome = Pick<VenueMarketOutcome, "id" | "label" | "price"> & {
96
98
  title?: string | null;
97
99
  };
@@ -120,6 +122,17 @@ export type PlaceOrderTerminalOrderEvent = {
120
122
  event: "filled" | "partial_fill" | "failed";
121
123
  filledAmountRaw?: string;
122
124
  remainingAmountRaw?: string;
125
+ /** Actual shares + payout received, 6-decimal atomic. Populated by the
126
+ * venue's finalize handler on filled/partial_fill and used to override
127
+ * the stale quote estimate in the execution summary. */
128
+ actualSharesRaw?: string;
129
+ actualToWinRaw?: string;
130
+ /** Quote-time shares + payout, 6-decimal atomic. */
131
+ quotedSharesRaw?: string;
132
+ quotedToWinRaw?: string;
133
+ /** Avg execution price as a numeric string (e.g. "0.087"). */
134
+ executionPriceRaw?: string;
135
+ quotedPriceRaw?: string;
123
136
  errorReason?: string;
124
137
  timestamp: number;
125
138
  };
@@ -1,4 +1,4 @@
1
- import type { AggUiLabels, DagStepProgress, EventTradingState, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
1
+ import type { AggUiLabels, DagStepProgress, EventTradingState, UseMidpointsResult, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
2
2
  import type { SmartRouteResponse } from "@agg-build/sdk";
3
3
  import type { PlaceOrderRoutingRow, PlaceOrderStatus, PlaceOrderTab, TradingVenue } from "../types";
4
4
  export type PlaceOrderProps = {
@@ -38,6 +38,8 @@ export type PlaceOrderProps = {
38
38
  onExecutionStateChange?: (state: PlaceOrderSubmissionProgressState) => void;
39
39
  /** Optional resolved-event claim summary shown in read-only state. */
40
40
  resolvedClaim?: PlaceOrderResolvedClaimSummary;
41
+ /** Pre-fetched midpoint data (best price included) passed from parent. Optional for backward compatibility. */
42
+ midpointsResult?: UseMidpointsResult;
41
43
  };
42
44
  export type PlaceOrderResolvedClaimSummary = {
43
45
  /** Resolution date label, e.g. "Mar 21, 2026". */
@@ -91,7 +93,7 @@ export type PlaceOrderOutcomeClassNameParams = {
91
93
  isActive: boolean;
92
94
  isPositive: boolean;
93
95
  };
94
- export type PlaceOrderOutcomeLabelValue = Pick<VenueMarketOutcome, "id" | "label">;
96
+ export type PlaceOrderOutcomeLabelValue = Pick<VenueMarketOutcome, "id" | "label" | "title">;
95
97
  export type PlaceOrderVenueOutcome = Pick<VenueMarketOutcome, "id" | "label" | "price"> & {
96
98
  title?: string | null;
97
99
  };
@@ -120,6 +122,17 @@ export type PlaceOrderTerminalOrderEvent = {
120
122
  event: "filled" | "partial_fill" | "failed";
121
123
  filledAmountRaw?: string;
122
124
  remainingAmountRaw?: string;
125
+ /** Actual shares + payout received, 6-decimal atomic. Populated by the
126
+ * venue's finalize handler on filled/partial_fill and used to override
127
+ * the stale quote estimate in the execution summary. */
128
+ actualSharesRaw?: string;
129
+ actualToWinRaw?: string;
130
+ /** Quote-time shares + payout, 6-decimal atomic. */
131
+ quotedSharesRaw?: string;
132
+ quotedToWinRaw?: string;
133
+ /** Avg execution price as a numeric string (e.g. "0.087"). */
134
+ executionPriceRaw?: string;
135
+ quotedPriceRaw?: string;
123
136
  errorReason?: string;
124
137
  timestamp: number;
125
138
  };
@@ -49,18 +49,61 @@ export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ la
49
49
  summary: PlaceOrderFailureSummary;
50
50
  treatPartialAsComplete?: boolean;
51
51
  }) => PlaceOrderExecutionStepGroup[];
52
- export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
52
+ export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, labels, }: {
53
53
  errorMessage?: string | null;
54
54
  fallbackMessage: string;
55
+ labels?: Pick<PlaceOrderTradingLabels, "quoteBalanceMismatch">;
55
56
  }) => string;
56
57
  /**
57
- * Sum filled + partially-filled amounts (1e6-atomic) across terminal events
58
- * and subtract from the originally-requested amount. Works for both buy
59
- * (USD remainder) and sell (share remainder) — the executor uses the same
60
- * 1e6 atomic convention for `filledAmountRaw` in both directions.
58
+ * Resolves the actual execution economics from terminal WS events, overriding
59
+ * the stale quote estimate after a `partial_fill` (or `filled`) event arrives.
60
+ *
61
+ * Returns the same shape as the relevant fields on `SmartRouteResponse`
62
+ * (`rawExecCost` = USD side, `totalFilled` = shares side) so call sites can
63
+ * swap the quote estimate for actuals without restructuring.
64
+ *
65
+ * Per-side semantics (matches `polymarket-finalize` / `kalshi-finalize`):
66
+ * - BUY: `filledAmountRaw` is USD spent (6dp atomic). Shares received come
67
+ * from `actualSharesRaw` if present, else derived from filled ÷ price.
68
+ * - SELL: `actualSharesRaw` is the authoritative share count (always set by
69
+ * `OrderExecutionService`). USD payout is `actualSharesRaw ×
70
+ * executionPriceRaw`; `filledAmountRaw` is venue-specific (USD on
71
+ * Polymarket, shares on Kalshi) so we don't rely on it here.
72
+ * - `actualToWinRaw` mirrors `actualSharesRaw` (binary outcome: 1 share = $1
73
+ * if it resolves YES) — it's NOT the realized sell payout.
74
+ *
75
+ * Execution-price precedence: `executionPriceRaw` → submittedOrders.price →
76
+ * quote fill avgPrice for the same venue → quote-wide vwap.
77
+ *
78
+ * When no fill data is present (`hasActualFillData === false`), callers should
79
+ * fall back to the quote estimate.
80
+ */
81
+ export type PlaceOrderActualEconomics = {
82
+ hasActualFillData: boolean;
83
+ actualRawExecCost: number;
84
+ actualTotalFilled: number;
85
+ avgExecutionPrice: number;
86
+ };
87
+ export declare const resolveActualExecutionEconomics: ({ quoteData, tradeSide, terminalOrderEvents, submittedOrders, }: {
88
+ quoteData: SmartRouteResponse | null | undefined;
89
+ tradeSide: PlaceOrderTab;
90
+ terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
91
+ submittedOrders?: WsOrderSubmitted[];
92
+ }) => PlaceOrderActualEconomics;
93
+ /**
94
+ * Compute the unfilled remainder of an order from terminal WS events.
95
+ *
96
+ * `originalAmount` is in the same units as the user's input field:
97
+ * - BUY: USD requested → subtract `filledAmountRaw` (USD) per event.
98
+ * - SELL: shares requested → subtract `actualSharesRaw` (shares) per event.
99
+ * For sells we never subtract `filledAmountRaw` because its unit is
100
+ * venue-specific (USD on Polymarket, shares on Kalshi) — mixing
101
+ * units corrupts the "Retry remaining" amount and the auto-skip
102
+ * threshold. `actualSharesRaw` is always shares.
61
103
  */
62
- export declare const getPlaceOrderUnfilledRemaining: ({ originalAmount, terminalOrderEvents, }: {
104
+ export declare const getPlaceOrderUnfilledRemaining: ({ originalAmount, tradeSide, terminalOrderEvents, }: {
63
105
  originalAmount: number;
106
+ tradeSide: PlaceOrderTab;
64
107
  terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
65
108
  }) => number;
66
109
  export declare const buildPlaceOrderFailureSummary: ({ actionLabel, canRetryRemaining, errorMessage, eventImage, eventSubtitle, eventTitle, labels, orderId, quoteData, submittedOrders, terminalOrderEvents, }: {