@agg-build/ui 1.0.0 → 1.0.2

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 (104) hide show
  1. package/dist/{chunk-75IGOQ4N.mjs → chunk-3IY2GA2D.mjs} +69 -45
  2. package/dist/{chunk-I2WBGEWK.mjs → chunk-4ILR2YH3.mjs} +319 -344
  3. package/dist/{chunk-C7T56TJR.mjs → chunk-PEVG67XU.mjs} +369 -19
  4. package/dist/{chunk-6NS7D73S.mjs → chunk-TLGQ4LID.mjs} +1556 -1204
  5. package/dist/{chunk-DMKKNK76.mjs → chunk-WFS772A3.mjs} +800 -592
  6. package/dist/{chunk-CGNDMLQL.mjs → chunk-XDZLCWUZ.mjs} +511 -899
  7. package/dist/{chunk-2QJXRRYP.mjs → chunk-YSCHNVBZ.mjs} +3 -2
  8. package/dist/events.js +2081 -1673
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +4890 -4318
  11. package/dist/index.mjs +195 -118
  12. package/dist/modals.js +1568 -1242
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +3007 -2904
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +1507 -1207
  17. package/dist/primitives.mjs +13 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +3920 -3734
  21. package/dist/trading.mjs +10 -12
  22. package/dist/types/deposit/steps/card-payment-pending.d.mts +3 -1
  23. package/dist/types/deposit/steps/card-payment-pending.d.ts +3 -1
  24. package/dist/types/deposit/steps/crypto-transfer.d.mts +1 -1
  25. package/dist/types/deposit/steps/crypto-transfer.d.ts +1 -1
  26. package/dist/types/events/item/event-list-item.utils.d.mts +57 -0
  27. package/dist/types/events/item/event-list-item.utils.d.ts +57 -0
  28. package/dist/types/events/item-details/event-list-item-details.types.d.mts +16 -1
  29. package/dist/types/events/item-details/event-list-item-details.types.d.ts +16 -1
  30. package/dist/types/events/item-details/settlement-summary.d.mts +6 -2
  31. package/dist/types/events/item-details/settlement-summary.d.ts +6 -2
  32. package/dist/types/events/list/event-list.types.d.mts +1 -1
  33. package/dist/types/events/list/event-list.types.d.ts +1 -1
  34. package/dist/types/events/list/event-list.utils.d.mts +1 -1
  35. package/dist/types/events/list/event-list.utils.d.ts +1 -1
  36. package/dist/types/events/market-details/market-details.types.d.mts +8 -0
  37. package/dist/types/events/market-details/market-details.types.d.ts +8 -0
  38. package/dist/types/pages/event-market/event-market.types.d.mts +1 -3
  39. package/dist/types/pages/event-market/event-market.types.d.ts +1 -3
  40. package/dist/types/primitives/copy-button/index.d.mts +25 -0
  41. package/dist/types/primitives/copy-button/index.d.ts +25 -0
  42. package/dist/types/primitives/icon/index.d.mts +3 -1
  43. package/dist/types/primitives/icon/index.d.ts +3 -1
  44. package/dist/types/primitives/icon/registry.d.mts +8 -0
  45. package/dist/types/primitives/icon/registry.d.ts +8 -0
  46. package/dist/types/primitives/icon/svg/apps.d.mts +5 -0
  47. package/dist/types/primitives/icon/svg/apps.d.ts +5 -0
  48. package/dist/types/primitives/icon/svg/circle-overlap.d.mts +5 -0
  49. package/dist/types/primitives/icon/svg/circle-overlap.d.ts +5 -0
  50. package/dist/types/primitives/index.d.mts +2 -0
  51. package/dist/types/primitives/index.d.ts +2 -0
  52. package/dist/types/primitives/select/index.d.mts +1 -1
  53. package/dist/types/primitives/select/index.d.ts +1 -1
  54. package/dist/types/primitives/select/select.types.d.mts +1 -1
  55. package/dist/types/primitives/select/select.types.d.ts +1 -1
  56. package/dist/types/primitives/select/select.utils.d.mts +0 -1
  57. package/dist/types/primitives/select/select.utils.d.ts +0 -1
  58. package/dist/types/primitives/skeleton/index.d.mts +2 -1
  59. package/dist/types/primitives/skeleton/index.d.ts +2 -1
  60. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +4 -0
  61. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +4 -0
  62. package/dist/types/primitives/toast/index.d.mts +4 -0
  63. package/dist/types/primitives/toast/index.d.ts +4 -0
  64. package/dist/types/primitives/toast/toast.types.d.mts +31 -0
  65. package/dist/types/primitives/toast/toast.types.d.ts +31 -0
  66. package/dist/types/primitives/typography/index.d.mts +1 -1
  67. package/dist/types/primitives/typography/index.d.ts +1 -1
  68. package/dist/types/primitives/typography/typography.types.d.mts +3 -1
  69. package/dist/types/primitives/typography/typography.types.d.ts +3 -1
  70. package/dist/types/shared/utils.d.mts +3 -1
  71. package/dist/types/shared/utils.d.ts +3 -1
  72. package/dist/types/trading/index.d.mts +0 -1
  73. package/dist/types/trading/index.d.ts +0 -1
  74. package/dist/types/trading/place-order/index.place-order.constants.d.mts +8 -0
  75. package/dist/types/trading/place-order/index.place-order.constants.d.ts +8 -0
  76. package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -1
  77. package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -1
  78. package/dist/types/trading/place-order/index.place-order.utils.d.mts +4 -11
  79. package/dist/types/trading/place-order/index.place-order.utils.d.ts +4 -11
  80. package/dist/types/trading/settlement/index.d.mts +9 -6
  81. package/dist/types/trading/settlement/index.d.ts +9 -6
  82. package/dist/types/trading/settlement/settlement-text-renderer.d.mts +8 -0
  83. package/dist/types/trading/settlement/settlement-text-renderer.d.ts +8 -0
  84. package/dist/types/trading/settlement/settlement-text.utils.d.mts +36 -0
  85. package/dist/types/trading/settlement/settlement-text.utils.d.ts +36 -0
  86. package/dist/types/trading/types.d.mts +0 -19
  87. package/dist/types/trading/types.d.ts +0 -19
  88. package/dist/types/trading/utils.d.mts +0 -1
  89. package/dist/types/trading/utils.d.ts +0 -1
  90. package/dist/types/withdraw/index.d.mts +2 -2
  91. package/dist/types/withdraw/index.d.ts +2 -2
  92. package/dist/types/withdraw/steps/withdraw-amount.d.mts +6 -3
  93. package/dist/types/withdraw/steps/withdraw-amount.d.ts +6 -3
  94. package/dist/types/withdraw/steps/withdraw-success.d.mts +8 -1
  95. package/dist/types/withdraw/steps/withdraw-success.d.ts +8 -1
  96. package/dist/types/withdraw/steps/withdraw-success.utils.d.mts +36 -0
  97. package/dist/types/withdraw/steps/withdraw-success.utils.d.ts +36 -0
  98. package/dist/types/withdraw/withdraw-modal.types.d.mts +25 -15
  99. package/dist/types/withdraw/withdraw-modal.types.d.ts +25 -15
  100. package/package.json +6 -5
  101. package/dist/types/primitives/card/card.constants.d.mts +0 -4
  102. package/dist/types/primitives/card/card.constants.d.ts +0 -4
  103. package/dist/types/trading/settlement/settlement-details.utils.d.mts +0 -7
  104. package/dist/types/trading/settlement/settlement-details.utils.d.ts +0 -7
@@ -5,6 +5,7 @@ export * from "./badge";
5
5
  export * from "./button";
6
6
  export * from "./card";
7
7
  export * from "./chart";
8
+ export * from "./copy-button";
8
9
  export * from "./currency-input";
9
10
  export * from "./footer";
10
11
  export * from "./header";
@@ -20,6 +21,7 @@ export * from "./skeleton";
20
21
  export * from "./state-message";
21
22
  export * from "./switch-button";
22
23
  export * from "./tabs";
24
+ export * from "./toast";
23
25
  export * from "./tooltip";
24
26
  export * from "./typography";
25
27
  export * from "./venue-logo";
@@ -1,6 +1,6 @@
1
1
  import type { SelectProps } from "./select.types";
2
2
  export type { SelectItem, SelectProps } from "./select.types";
3
- /** Renders a native select or custom icon-aware dropdown depending on available item icons. */
3
+ /** Renders a custom select trigger and portaled listbox. */
4
4
  export declare const Select: {
5
5
  <TValue extends string = string>({ items, value, onChange, ariaLabel, className, triggerClassName, disabled, }: SelectProps<TValue>): JSX.Element;
6
6
  displayName: string;
@@ -1,6 +1,6 @@
1
1
  import type { SelectProps } from "./select.types";
2
2
  export type { SelectItem, SelectProps } from "./select.types";
3
- /** Renders a native select or custom icon-aware dropdown depending on available item icons. */
3
+ /** Renders a custom select trigger and portaled listbox. */
4
4
  export declare const Select: {
5
5
  <TValue extends string = string>({ items, value, onChange, ariaLabel, className, triggerClassName, disabled, }: SelectProps<TValue>): JSX.Element;
6
6
  displayName: string;
@@ -18,7 +18,7 @@ export type SelectProps<TValue extends string = string> = {
18
18
  ariaLabel?: string;
19
19
  /** Custom class name applied to the select root. */
20
20
  className?: string;
21
- /** Extra classes for the trigger (`<select>` or `<button>`), e.g. corner radius. */
21
+ /** Extra classes for the trigger button, e.g. corner radius. */
22
22
  triggerClassName?: string;
23
23
  /** Whether the select should block user interaction. */
24
24
  disabled?: boolean;
@@ -18,7 +18,7 @@ export type SelectProps<TValue extends string = string> = {
18
18
  ariaLabel?: string;
19
19
  /** Custom class name applied to the select root. */
20
20
  className?: string;
21
- /** Extra classes for the trigger (`<select>` or `<button>`), e.g. corner radius. */
21
+ /** Extra classes for the trigger button, e.g. corner radius. */
22
22
  triggerClassName?: string;
23
23
  /** Whether the select should block user interaction. */
24
24
  disabled?: boolean;
@@ -1,7 +1,6 @@
1
1
  import type { SelectItem } from "./select.types";
2
2
  /** Utility helpers for resolving select UI state from items and selected value. */
3
3
  export declare const resolveHasEnabledItems: <TValue extends string>(items: SelectItem<TValue>[]) => boolean;
4
- export declare const resolveHasAnyIcon: <TValue extends string>(items: SelectItem<TValue>[]) => boolean;
5
4
  export declare const resolveSelectedItem: <TValue extends string>(items: SelectItem<TValue>[], value: TValue) => SelectItem<TValue> | undefined;
6
5
  export declare const resolveIsSelectDisabled: ({ disabled, items, }: {
7
6
  disabled: boolean;
@@ -1,7 +1,6 @@
1
1
  import type { SelectItem } from "./select.types";
2
2
  /** Utility helpers for resolving select UI state from items and selected value. */
3
3
  export declare const resolveHasEnabledItems: <TValue extends string>(items: SelectItem<TValue>[]) => boolean;
4
- export declare const resolveHasAnyIcon: <TValue extends string>(items: SelectItem<TValue>[]) => boolean;
5
4
  export declare const resolveSelectedItem: <TValue extends string>(items: SelectItem<TValue>[], value: TValue) => SelectItem<TValue> | undefined;
6
5
  export declare const resolveIsSelectDisabled: ({ disabled, items, }: {
7
6
  disabled: boolean;
@@ -1,5 +1,6 @@
1
+ import { PlaceOrderRouteCardSkeleton } from "./views/place-order-skeleton-view";
1
2
  import { skeletonViews, type SkeletonProps } from "./skeleton.types";
2
- export { skeletonViews };
3
+ export { skeletonViews, PlaceOrderRouteCardSkeleton };
3
4
  export type { SkeletonProps, SkeletonView } from "./skeleton.types";
4
5
  /** Renders the requested skeleton placeholder surface for loading UI states. */
5
6
  export declare const Skeleton: {
@@ -1,5 +1,6 @@
1
+ import { PlaceOrderRouteCardSkeleton } from "./views/place-order-skeleton-view";
1
2
  import { skeletonViews, type SkeletonProps } from "./skeleton.types";
2
- export { skeletonViews };
3
+ export { skeletonViews, PlaceOrderRouteCardSkeleton };
3
4
  export type { SkeletonProps, SkeletonView } from "./skeleton.types";
4
5
  /** Renders the requested skeleton placeholder surface for loading UI states. */
5
6
  export declare const Skeleton: {
@@ -1,4 +1,8 @@
1
1
  import type { SkeletonViewProps } from "../skeleton.types";
2
+ export declare const PlaceOrderRouteCardSkeleton: {
3
+ (): JSX.Element;
4
+ displayName: string;
5
+ };
2
6
  export declare const PlaceOrderSkeletonView: {
3
7
  ({ className, ariaLabel, }: SkeletonViewProps): JSX.Element;
4
8
  displayName: string;
@@ -1,4 +1,8 @@
1
1
  import type { SkeletonViewProps } from "../skeleton.types";
2
+ export declare const PlaceOrderRouteCardSkeleton: {
3
+ (): JSX.Element;
4
+ displayName: string;
5
+ };
2
6
  export declare const PlaceOrderSkeletonView: {
3
7
  ({ className, ariaLabel, }: SkeletonViewProps): JSX.Element;
4
8
  displayName: string;
@@ -0,0 +1,4 @@
1
+ import type { ToastContextValue, ToastProviderProps } from "./toast.types";
2
+ export type { ToastContextValue, ToastEntry, ToastOptions, ToastProviderProps, ToastSwipeDirection, ToastTone, } from "./toast.types";
3
+ export declare function ToastProvider({ children, defaultDurationMs, swipeDirection, swipeThreshold, viewportClassName, }: ToastProviderProps): JSX.Element;
4
+ export declare function useToast(): ToastContextValue;
@@ -0,0 +1,4 @@
1
+ import type { ToastContextValue, ToastProviderProps } from "./toast.types";
2
+ export type { ToastContextValue, ToastEntry, ToastOptions, ToastProviderProps, ToastSwipeDirection, ToastTone, } from "./toast.types";
3
+ export declare function ToastProvider({ children, defaultDurationMs, swipeDirection, swipeThreshold, viewportClassName, }: ToastProviderProps): JSX.Element;
4
+ export declare function useToast(): ToastContextValue;
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ export type ToastTone = "info" | "success" | "warning" | "error";
3
+ export interface ToastOptions {
4
+ tone?: ToastTone;
5
+ title?: string;
6
+ /** Auto-dismiss duration in ms. Pass `Infinity` (or `0`) to require manual dismissal. Defaults to 5000. */
7
+ durationMs?: number;
8
+ }
9
+ export interface ToastEntry {
10
+ id: number;
11
+ message: string;
12
+ tone: ToastTone;
13
+ title?: string;
14
+ durationMs: number;
15
+ }
16
+ export interface ToastContextValue {
17
+ toast: (message: string, options?: ToastOptions) => number;
18
+ dismiss: (id: number) => void;
19
+ }
20
+ export type ToastSwipeDirection = "right" | "left" | "up" | "down";
21
+ export interface ToastProviderProps {
22
+ children: ReactNode;
23
+ /** Default auto-dismiss duration applied when a toast doesn't override it. Defaults to 5000ms. */
24
+ defaultDurationMs?: number;
25
+ /** Swipe gesture direction for dismissal. Defaults to "right". */
26
+ swipeDirection?: ToastSwipeDirection;
27
+ /** Distance in pixels the user must swipe to dismiss. Defaults to 50. */
28
+ swipeThreshold?: number;
29
+ /** Tailwind classes applied to the toast viewport (positioning container). */
30
+ viewportClassName?: string;
31
+ }
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ export type ToastTone = "info" | "success" | "warning" | "error";
3
+ export interface ToastOptions {
4
+ tone?: ToastTone;
5
+ title?: string;
6
+ /** Auto-dismiss duration in ms. Pass `Infinity` (or `0`) to require manual dismissal. Defaults to 5000. */
7
+ durationMs?: number;
8
+ }
9
+ export interface ToastEntry {
10
+ id: number;
11
+ message: string;
12
+ tone: ToastTone;
13
+ title?: string;
14
+ durationMs: number;
15
+ }
16
+ export interface ToastContextValue {
17
+ toast: (message: string, options?: ToastOptions) => number;
18
+ dismiss: (id: number) => void;
19
+ }
20
+ export type ToastSwipeDirection = "right" | "left" | "up" | "down";
21
+ export interface ToastProviderProps {
22
+ children: ReactNode;
23
+ /** Default auto-dismiss duration applied when a toast doesn't override it. Defaults to 5000ms. */
24
+ defaultDurationMs?: number;
25
+ /** Swipe gesture direction for dismissal. Defaults to "right". */
26
+ swipeDirection?: ToastSwipeDirection;
27
+ /** Distance in pixels the user must swipe to dismiss. Defaults to 50. */
28
+ swipeThreshold?: number;
29
+ /** Tailwind classes applied to the toast viewport (positioning container). */
30
+ viewportClassName?: string;
31
+ }
@@ -1,5 +1,5 @@
1
1
  import type { TypographyProps } from "./typography.types";
2
- export type { TypographyProps, TypographyVariant } from "./typography.types";
2
+ export type { LegacyTypographyVariant, TokenTypographyVariant, TypographyProps, TypographyVariant, } from "./typography.types";
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: {
@@ -1,5 +1,5 @@
1
1
  import type { TypographyProps } from "./typography.types";
2
- export type { TypographyProps, TypographyVariant } from "./typography.types";
2
+ export type { LegacyTypographyVariant, TokenTypographyVariant, TypographyProps, TypographyVariant, } from "./typography.types";
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: {
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
- export type TypographyVariant = "display" | "heading" | "title" | "title-strong" | "body-large" | "body-large-strong" | "body" | "body-strong" | "label" | "label-strong" | "label-caps" | "caption" | "caption-strong" | "caption-caps" | "overline";
2
+ export type LegacyTypographyVariant = "display" | "heading" | "title" | "title-strong" | "body-large" | "body-large-strong" | "body" | "body-strong" | "label" | "label-strong" | "label-caps" | "caption" | "caption-strong" | "caption-caps" | "overline";
3
+ export type TokenTypographyVariant = "text-3xl" | "text-2xl" | "text-xl" | "text-xl-bold" | "text-lg" | "text-lg-bold" | "text-base" | "text-base-bold" | "text-sm" | "text-sm-bold" | "text-sm-caps" | "text-xs" | "text-xs-bold" | "text-xs-caps" | "text-2xs-caps";
4
+ export type TypographyVariant = LegacyTypographyVariant | TokenTypographyVariant;
3
5
  export type TypographyProps = {
4
6
  /** HTML element or custom intrinsic tag used for rendering. */
5
7
  as?: keyof JSX.IntrinsicElements;
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
- export type TypographyVariant = "display" | "heading" | "title" | "title-strong" | "body-large" | "body-large-strong" | "body" | "body-strong" | "label" | "label-strong" | "label-caps" | "caption" | "caption-strong" | "caption-caps" | "overline";
2
+ export type LegacyTypographyVariant = "display" | "heading" | "title" | "title-strong" | "body-large" | "body-large-strong" | "body" | "body-strong" | "label" | "label-strong" | "label-caps" | "caption" | "caption-strong" | "caption-caps" | "overline";
3
+ export type TokenTypographyVariant = "text-3xl" | "text-2xl" | "text-xl" | "text-xl-bold" | "text-lg" | "text-lg-bold" | "text-base" | "text-base-bold" | "text-sm" | "text-sm-bold" | "text-sm-caps" | "text-xs" | "text-xs-bold" | "text-xs-caps" | "text-2xs-caps";
4
+ export type TypographyVariant = LegacyTypographyVariant | TokenTypographyVariant;
3
5
  export type TypographyProps = {
4
6
  /** HTML element or custom intrinsic tag used for rendering. */
5
7
  as?: keyof JSX.IntrinsicElements;
@@ -7,7 +7,9 @@ export declare const getMotionClassName: (enabled: boolean, ...values: ClassValu
7
7
  export declare const getScrollBehavior: (enabled: boolean) => "auto" | "smooth";
8
8
  export declare const isValidDateValue: (value: unknown) => value is Date;
9
9
  export declare const toDate: (value: string | Date | undefined) => Date | null;
10
- export declare const shortenAddress: (value: string) => string;
10
+ export declare const shortenAddress: (value: string | null | undefined, options?: {
11
+ chain?: string;
12
+ }) => string | undefined;
11
13
  export declare const formatUsd: (value: number) => string;
12
14
  /** Compact USD format (e.g. 127.8 → "$127.8", 50 → "$50"). */
13
15
  export declare const formatCompactUsd: (amount: number) => string;
@@ -7,7 +7,9 @@ export declare const getMotionClassName: (enabled: boolean, ...values: ClassValu
7
7
  export declare const getScrollBehavior: (enabled: boolean) => "auto" | "smooth";
8
8
  export declare const isValidDateValue: (value: unknown) => value is Date;
9
9
  export declare const toDate: (value: string | Date | undefined) => Date | null;
10
- export declare const shortenAddress: (value: string) => string;
10
+ export declare const shortenAddress: (value: string | null | undefined, options?: {
11
+ chain?: string;
12
+ }) => string | undefined;
11
13
  export declare const formatUsd: (value: number) => string;
12
14
  /** Compact USD format (e.g. 127.8 → "$127.8", 50 → "$50"). */
13
15
  export declare const formatCompactUsd: (amount: number) => string;
@@ -2,6 +2,5 @@ export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./settlement";
4
4
  export * from "./settlement/settlement-details";
5
- export * from "./settlement/settlement-details.utils";
6
5
  export * from "./place-order";
7
6
  export * from "./trading-context";
@@ -2,6 +2,5 @@ export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./settlement";
4
4
  export * from "./settlement/settlement-details";
5
- export * from "./settlement/settlement-details.utils";
6
5
  export * from "./place-order";
7
6
  export * from "./trading-context";
@@ -1,9 +1,17 @@
1
1
  import type { PlaceOrderResultTone } from "./index.place-order.types";
2
+ /** Default amount pre-filled on mount so an initial quote is fetched immediately. */
3
+ export declare const PLACE_ORDER_DEFAULT_AMOUNT = 20;
2
4
  /**
3
5
  * Order minimum is 1$ in all venues
4
6
  * This will prevent from retrying partially filled order
5
7
  */
6
8
  export declare const MIN_BUY_ORDER_AMOUNT = 1;
9
+ /**
10
+ * Sell-side minimum: venues won't accept a sell smaller than 1 outcome-token
11
+ * share, so a partial-fill retry whose remainder is below this floor would be
12
+ * rejected. Used to gate the "Retry remaining" action on the sell flow.
13
+ */
14
+ export declare const MIN_SELL_ORDER_SHARES = 1;
7
15
  export declare const DEFAULT_SLIPPAGE_VALUE = "0.5";
8
16
  export declare const DEFAULT_SLIPPAGE_MINIMUM = 0.5;
9
17
  export declare const HIGH_SLIPPAGE_THRESHOLD = 10;
@@ -1,9 +1,17 @@
1
1
  import type { PlaceOrderResultTone } from "./index.place-order.types";
2
+ /** Default amount pre-filled on mount so an initial quote is fetched immediately. */
3
+ export declare const PLACE_ORDER_DEFAULT_AMOUNT = 20;
2
4
  /**
3
5
  * Order minimum is 1$ in all venues
4
6
  * This will prevent from retrying partially filled order
5
7
  */
6
8
  export declare const MIN_BUY_ORDER_AMOUNT = 1;
9
+ /**
10
+ * Sell-side minimum: venues won't accept a sell smaller than 1 outcome-token
11
+ * share, so a partial-fill retry whose remainder is below this floor would be
12
+ * rejected. Used to gate the "Retry remaining" action on the sell flow.
13
+ */
14
+ export declare const MIN_SELL_ORDER_SHARES = 1;
7
15
  export declare const DEFAULT_SLIPPAGE_VALUE = "0.5";
8
16
  export declare const DEFAULT_SLIPPAGE_MINIMUM = 0.5;
9
17
  export declare const HIGH_SLIPPAGE_THRESHOLD = 10;
@@ -151,6 +151,12 @@ export type ResolvePlaceOrderQuoteResultParams = {
151
151
  quoteData: SmartRouteResponse | null;
152
152
  tradeSide: PlaceOrderTab;
153
153
  };
154
+ export type BuildLiveRouteCardsParams = {
155
+ labels: PlaceOrderTradingLabels;
156
+ quoteData: SmartRouteResponse;
157
+ tradeSide: PlaceOrderTab;
158
+ eventVenues?: TradingVenue[];
159
+ };
154
160
  export type ResolvePlaceOrderQuoteStatusParams = {
155
161
  amount: number;
156
162
  labels: PlaceOrderTradingLabels;
@@ -173,7 +179,6 @@ export type PlaceOrderExecutionSummary = {
173
179
  eventDateLabel?: string;
174
180
  eventImage?: string | null;
175
181
  actionLabel?: string;
176
- actionTone?: "positive" | "negative";
177
182
  amountLabel?: string;
178
183
  toWinLabel?: string;
179
184
  potentialReturnLabel?: string;
@@ -151,6 +151,12 @@ export type ResolvePlaceOrderQuoteResultParams = {
151
151
  quoteData: SmartRouteResponse | null;
152
152
  tradeSide: PlaceOrderTab;
153
153
  };
154
+ export type BuildLiveRouteCardsParams = {
155
+ labels: PlaceOrderTradingLabels;
156
+ quoteData: SmartRouteResponse;
157
+ tradeSide: PlaceOrderTab;
158
+ eventVenues?: TradingVenue[];
159
+ };
154
160
  export type ResolvePlaceOrderQuoteStatusParams = {
155
161
  amount: number;
156
162
  labels: PlaceOrderTradingLabels;
@@ -173,7 +179,6 @@ export type PlaceOrderExecutionSummary = {
173
179
  eventDateLabel?: string;
174
180
  eventImage?: string | null;
175
181
  actionLabel?: string;
176
- actionTone?: "positive" | "negative";
177
182
  amountLabel?: string;
178
183
  toWinLabel?: string;
179
184
  potentialReturnLabel?: string;
@@ -1,6 +1,6 @@
1
1
  import type { SmartRouteResponse, WsOrderSubmitted } from "@agg-build/sdk";
2
2
  import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
3
- import type { PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
3
+ import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
4
4
  export declare const extractGeoBlockedVenues: (warnings: SmartRouteResponse["warnings"]) => Set<string>;
5
5
  /** Pure helpers for PlaceOrder view-model shaping, formatting, and keyboard logic. */
6
6
  export declare const getPlaceOrderContainerClassName: () => string;
@@ -34,16 +34,8 @@ export declare const resolvePlaceOrderQuoteResult: ({ labels, quoteData, tradeSi
34
34
  export declare const sanitizePlaceOrderAmount: (value: number) => number;
35
35
  export declare const getTradingRoutePriceLabel: (value: number) => string;
36
36
  export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
37
- export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, }: {
38
- labels: PlaceOrderTradingLabels;
39
- quoteData: SmartRouteResponse;
40
- tradeSide: PlaceOrderTab;
41
- }) => PlaceOrderRouteCard[];
37
+ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
42
38
  export declare const resolveExecutionVenueFromQuote: (quoteData: SmartRouteResponse | null) => TradingVenue | undefined;
43
- export declare const resolvePlaceOrderSuccessTone: ({ outcomeIndex, tab, }: {
44
- outcomeIndex: number;
45
- tab: PlaceOrderTab;
46
- }) => "positive" | "negative";
47
39
  export declare const getPlaceOrderPotentialReturn: (quoteData: SmartRouteResponse | null | undefined) => number;
48
40
  export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quoteData, submittedOrders, }: {
49
41
  labels: PlaceOrderTradingLabels;
@@ -52,9 +44,10 @@ export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quo
52
44
  submittedOrders?: WsOrderSubmitted[];
53
45
  }) => PlaceOrderExecutionStepGroup[];
54
46
  export declare const groupPlaceOrderFailureSteps: (steps: PlaceOrderFailureStep[]) => PlaceOrderFailureStep[][];
55
- export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, }: {
47
+ export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, treatPartialAsComplete, }: {
56
48
  labels: PlaceOrderTradingLabels;
57
49
  summary: PlaceOrderFailureSummary;
50
+ treatPartialAsComplete?: boolean;
58
51
  }) => PlaceOrderExecutionStepGroup[];
59
52
  export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
60
53
  errorMessage?: string | null;
@@ -1,6 +1,6 @@
1
1
  import type { SmartRouteResponse, WsOrderSubmitted } from "@agg-build/sdk";
2
2
  import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
3
- import type { PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
3
+ import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
4
4
  export declare const extractGeoBlockedVenues: (warnings: SmartRouteResponse["warnings"]) => Set<string>;
5
5
  /** Pure helpers for PlaceOrder view-model shaping, formatting, and keyboard logic. */
6
6
  export declare const getPlaceOrderContainerClassName: () => string;
@@ -34,16 +34,8 @@ export declare const resolvePlaceOrderQuoteResult: ({ labels, quoteData, tradeSi
34
34
  export declare const sanitizePlaceOrderAmount: (value: number) => number;
35
35
  export declare const getTradingRoutePriceLabel: (value: number) => string;
36
36
  export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
37
- export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, }: {
38
- labels: PlaceOrderTradingLabels;
39
- quoteData: SmartRouteResponse;
40
- tradeSide: PlaceOrderTab;
41
- }) => PlaceOrderRouteCard[];
37
+ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
42
38
  export declare const resolveExecutionVenueFromQuote: (quoteData: SmartRouteResponse | null) => TradingVenue | undefined;
43
- export declare const resolvePlaceOrderSuccessTone: ({ outcomeIndex, tab, }: {
44
- outcomeIndex: number;
45
- tab: PlaceOrderTab;
46
- }) => "positive" | "negative";
47
39
  export declare const getPlaceOrderPotentialReturn: (quoteData: SmartRouteResponse | null | undefined) => number;
48
40
  export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quoteData, submittedOrders, }: {
49
41
  labels: PlaceOrderTradingLabels;
@@ -52,9 +44,10 @@ export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quo
52
44
  submittedOrders?: WsOrderSubmitted[];
53
45
  }) => PlaceOrderExecutionStepGroup[];
54
46
  export declare const groupPlaceOrderFailureSteps: (steps: PlaceOrderFailureStep[]) => PlaceOrderFailureStep[][];
55
- export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, }: {
47
+ export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, treatPartialAsComplete, }: {
56
48
  labels: PlaceOrderTradingLabels;
57
49
  summary: PlaceOrderFailureSummary;
50
+ treatPartialAsComplete?: boolean;
58
51
  }) => PlaceOrderExecutionStepGroup[];
59
52
  export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
60
53
  errorMessage?: string | null;
@@ -1,12 +1,15 @@
1
- import type { SettlementViewModel, TradingVenue } from "../types";
2
- export type SettlementProps = SettlementViewModel & {
1
+ export declare const SETTLEMENT_SECTION_ID = "agg-settlement-section";
2
+ export type SettlementProps = {
3
3
  className?: string;
4
- expandedVenue?: TradingVenue | null;
4
+ id?: string;
5
+ sectionLabel?: string;
6
+ question?: string;
7
+ eventDescription?: string | null;
8
+ marketDescription?: string | null;
9
+ primaryRules?: string | null;
5
10
  isLoading?: boolean;
6
- onExpandedVenueChange?: (venue: TradingVenue | null) => void;
7
- onShowMore?: (venue: TradingVenue) => void;
8
11
  };
9
12
  export declare const Settlement: {
10
- ({ sectionLabel, question, differencesTitle, differences, venues, expandedVenue, isLoading, onExpandedVenueChange, onShowMore, className, }: SettlementProps): JSX.Element;
13
+ ({ className, id, sectionLabel, question, eventDescription, marketDescription, primaryRules, isLoading, }: SettlementProps): JSX.Element;
11
14
  displayName: string;
12
15
  };
@@ -1,12 +1,15 @@
1
- import type { SettlementViewModel, TradingVenue } from "../types";
2
- export type SettlementProps = SettlementViewModel & {
1
+ export declare const SETTLEMENT_SECTION_ID = "agg-settlement-section";
2
+ export type SettlementProps = {
3
3
  className?: string;
4
- expandedVenue?: TradingVenue | null;
4
+ id?: string;
5
+ sectionLabel?: string;
6
+ question?: string;
7
+ eventDescription?: string | null;
8
+ marketDescription?: string | null;
9
+ primaryRules?: string | null;
5
10
  isLoading?: boolean;
6
- onExpandedVenueChange?: (venue: TradingVenue | null) => void;
7
- onShowMore?: (venue: TradingVenue) => void;
8
11
  };
9
12
  export declare const Settlement: {
10
- ({ sectionLabel, question, differencesTitle, differences, venues, expandedVenue, isLoading, onExpandedVenueChange, onShowMore, className, }: SettlementProps): JSX.Element;
13
+ ({ className, id, sectionLabel, question, eventDescription, marketDescription, primaryRules, isLoading, }: SettlementProps): JSX.Element;
11
14
  displayName: string;
12
15
  };
@@ -0,0 +1,8 @@
1
+ export type SettlementTextRendererProps = {
2
+ content: string;
3
+ className?: string;
4
+ };
5
+ export declare const SettlementTextRenderer: {
6
+ ({ content, className, }: SettlementTextRendererProps): JSX.Element | null;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,8 @@
1
+ export type SettlementTextRendererProps = {
2
+ content: string;
3
+ className?: string;
4
+ };
5
+ export declare const SettlementTextRenderer: {
6
+ ({ content, className, }: SettlementTextRendererProps): JSX.Element | null;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Helpers used only by the Settlement / SettlementSummary surface to parse and
3
+ * normalize settlement-related text (event description, market description,
4
+ * primary rules). Not intended for use elsewhere.
5
+ */
6
+ export type SettlementBlock = {
7
+ kind: "paragraph";
8
+ lines: string[];
9
+ } | {
10
+ kind: "list";
11
+ items: string[];
12
+ };
13
+ export declare const parseSettlementBlocks: (input: string) => SettlementBlock[];
14
+ /**
15
+ * Returns the first non-empty paragraph from the input — used by
16
+ * SettlementSummary to show only a teaser of the event description.
17
+ */
18
+ export declare const getFirstSettlementParagraph: (input: string | null | undefined) => string;
19
+ /** Lower-cased, whitespace-collapsed form used for dedup comparisons. */
20
+ export declare const normalizeSettlementForCompare: (input: string) => string;
21
+ export type SettlementSourceInput = {
22
+ eventDescription?: string | null;
23
+ marketDescription?: string | null;
24
+ primaryRules?: string | null;
25
+ };
26
+ export type SettlementSourceKey = "eventDescription" | "marketDescription" | "primaryRules";
27
+ export type SettlementSourceBlock = {
28
+ key: SettlementSourceKey;
29
+ content: string;
30
+ };
31
+ /**
32
+ * Produces the ordered list of non-empty settlement blocks for the Settlement
33
+ * section, dropping any source whose normalized text is identical to a block
34
+ * already included.
35
+ */
36
+ export declare const dedupeSettlementSources: (sources: SettlementSourceInput) => SettlementSourceBlock[];
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Helpers used only by the Settlement / SettlementSummary surface to parse and
3
+ * normalize settlement-related text (event description, market description,
4
+ * primary rules). Not intended for use elsewhere.
5
+ */
6
+ export type SettlementBlock = {
7
+ kind: "paragraph";
8
+ lines: string[];
9
+ } | {
10
+ kind: "list";
11
+ items: string[];
12
+ };
13
+ export declare const parseSettlementBlocks: (input: string) => SettlementBlock[];
14
+ /**
15
+ * Returns the first non-empty paragraph from the input — used by
16
+ * SettlementSummary to show only a teaser of the event description.
17
+ */
18
+ export declare const getFirstSettlementParagraph: (input: string | null | undefined) => string;
19
+ /** Lower-cased, whitespace-collapsed form used for dedup comparisons. */
20
+ export declare const normalizeSettlementForCompare: (input: string) => string;
21
+ export type SettlementSourceInput = {
22
+ eventDescription?: string | null;
23
+ marketDescription?: string | null;
24
+ primaryRules?: string | null;
25
+ };
26
+ export type SettlementSourceKey = "eventDescription" | "marketDescription" | "primaryRules";
27
+ export type SettlementSourceBlock = {
28
+ key: SettlementSourceKey;
29
+ content: string;
30
+ };
31
+ /**
32
+ * Produces the ordered list of non-empty settlement blocks for the Settlement
33
+ * section, dropping any source whose normalized text is identical to a block
34
+ * already included.
35
+ */
36
+ export declare const dedupeSettlementSources: (sources: SettlementSourceInput) => SettlementSourceBlock[];
@@ -4,25 +4,6 @@ export type TradingVenue = Venue;
4
4
  export declare const parseVenue: (v: unknown) => import("@agg-build/sdk").SafeParseResult<Venue>;
5
5
  /** safeParse-compatible finite non-negative number check. */
6
6
  export declare const parseAmount: (v: unknown) => import("@agg-build/sdk").SafeParseResult<number>;
7
- export interface SettlementVenueItem {
8
- marketId: string;
9
- venue: TradingVenue;
10
- label?: string;
11
- description: string;
12
- showMoreLabel?: string;
13
- }
14
- export interface SettlementViewModel {
15
- sectionLabel?: string;
16
- question?: string;
17
- differencesTitle?: string;
18
- differences?: string[];
19
- venues: SettlementVenueItem[];
20
- }
21
- export interface SettlementSection {
22
- key: string;
23
- label: string;
24
- venues: SettlementVenueItem[];
25
- }
26
7
  export type PlaceOrderTab = "buy" | "sell";
27
8
  export type PlaceOrderStatusTone = "warning" | "error";
28
9
  export type PlaceOrderStatusPlacement = "above-action" | "below-action";
@@ -4,25 +4,6 @@ export type TradingVenue = Venue;
4
4
  export declare const parseVenue: (v: unknown) => import("@agg-build/sdk").SafeParseResult<Venue>;
5
5
  /** safeParse-compatible finite non-negative number check. */
6
6
  export declare const parseAmount: (v: unknown) => import("@agg-build/sdk").SafeParseResult<number>;
7
- export interface SettlementVenueItem {
8
- marketId: string;
9
- venue: TradingVenue;
10
- label?: string;
11
- description: string;
12
- showMoreLabel?: string;
13
- }
14
- export interface SettlementViewModel {
15
- sectionLabel?: string;
16
- question?: string;
17
- differencesTitle?: string;
18
- differences?: string[];
19
- venues: SettlementVenueItem[];
20
- }
21
- export interface SettlementSection {
22
- key: string;
23
- label: string;
24
- venues: SettlementVenueItem[];
25
- }
26
7
  export type PlaceOrderTab = "buy" | "sell";
27
8
  export type PlaceOrderStatusTone = "warning" | "error";
28
9
  export type PlaceOrderStatusPlacement = "above-action" | "below-action";
@@ -1,6 +1,5 @@
1
1
  import type { TradingVenue } from "./types";
2
2
  export declare const defaultSettlementSectionLabel: string;
3
- export declare const defaultSettlementDifferencesTitle: string;
4
3
  export declare const defaultTradingDisclaimer: string;
5
4
  export declare const getTradingDateLabel: (value: string | Date) => string;
6
5
  export declare const getTradingVenueLabel: (venue: TradingVenue | undefined, label?: string) => string;