@agg-build/ui 1.0.0 → 1.0.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-2QJXRRYP.mjs → chunk-43K4PFBC.mjs} +3 -2
- package/dist/{chunk-I2WBGEWK.mjs → chunk-5ES2VJHO.mjs} +159 -93
- package/dist/{chunk-DMKKNK76.mjs → chunk-BYMLPLEZ.mjs} +791 -583
- package/dist/{chunk-C7T56TJR.mjs → chunk-HD6HBTK2.mjs} +1 -1
- package/dist/{chunk-CGNDMLQL.mjs → chunk-LPNZOX3E.mjs} +123 -52
- package/dist/{chunk-75IGOQ4N.mjs → chunk-WLXYCBZV.mjs} +62 -32
- package/dist/{chunk-6NS7D73S.mjs → chunk-YZNO6IUD.mjs} +740 -521
- package/dist/events.js +196 -93
- package/dist/events.mjs +3 -3
- package/dist/index.js +3396 -2806
- package/dist/index.mjs +13 -7
- package/dist/modals.js +798 -535
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +378 -176
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +713 -531
- package/dist/primitives.mjs +7 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +242 -54
- package/dist/trading.mjs +4 -4
- package/dist/types/deposit/steps/card-payment-pending.d.mts +3 -1
- package/dist/types/deposit/steps/card-payment-pending.d.ts +3 -1
- package/dist/types/deposit/steps/crypto-transfer.d.mts +1 -1
- package/dist/types/deposit/steps/crypto-transfer.d.ts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.mts +57 -0
- package/dist/types/events/item/event-list-item.utils.d.ts +57 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +16 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +16 -1
- package/dist/types/events/market-details/market-details.types.d.mts +8 -0
- package/dist/types/events/market-details/market-details.types.d.ts +8 -0
- package/dist/types/primitives/copy-button/index.d.mts +25 -0
- package/dist/types/primitives/copy-button/index.d.ts +25 -0
- package/dist/types/primitives/index.d.mts +2 -0
- package/dist/types/primitives/index.d.ts +2 -0
- package/dist/types/primitives/toast/index.d.mts +4 -0
- package/dist/types/primitives/toast/index.d.ts +4 -0
- package/dist/types/primitives/toast/toast.types.d.mts +31 -0
- package/dist/types/primitives/toast/toast.types.d.ts +31 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +8 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +8 -0
- package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +4 -7
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +4 -7
- package/dist/types/withdraw/index.d.mts +2 -2
- package/dist/types/withdraw/index.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +6 -3
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +6 -3
- package/dist/types/withdraw/steps/withdraw-success.d.mts +8 -1
- package/dist/types/withdraw/steps/withdraw-success.d.ts +8 -1
- package/dist/types/withdraw/steps/withdraw-success.utils.d.mts +36 -0
- package/dist/types/withdraw/steps/withdraw-success.utils.d.ts +36 -0
- package/dist/types/withdraw/withdraw-modal.types.d.mts +25 -15
- package/dist/types/withdraw/withdraw-modal.types.d.ts +25 -15
- package/package.json +6 -5
|
@@ -15,6 +15,26 @@ export type EventListItemVisibleOutcome = {
|
|
|
15
15
|
title: string;
|
|
16
16
|
};
|
|
17
17
|
export declare const resolveVisibleOutcomes: (venueMarkets: VenueMarket[]) => EventListItemVisibleOutcome[];
|
|
18
|
+
/**
|
|
19
|
+
* Dedupe venue markets while collapsing matched-cluster siblings to a single
|
|
20
|
+
* row. Walks left-to-right; for each market we see, mark its own id AND every
|
|
21
|
+
* `matchedVenueMarkets[].id` as "seen", and skip any later row whose own id
|
|
22
|
+
* already appears in the seen set.
|
|
23
|
+
*
|
|
24
|
+
* Why cluster-aware (not just id): the home card preview and the load-more
|
|
25
|
+
* (`/venue-markets`) endpoint can pick different cluster representatives for
|
|
26
|
+
* the same matched group (one keeps the highest-volume venue, the other keeps
|
|
27
|
+
* the canonical cluster target). When the EventItem component merges the two
|
|
28
|
+
* lists for cross-page rendering, a naive id-only dedup leaves both rows in
|
|
29
|
+
* place and the user sees the same logical market (e.g. "Bayern Munich")
|
|
30
|
+
* twice — once per representative. Tracking sibling ids closes that gap
|
|
31
|
+
* without needing the backend to expose `matchEntry.targetVenueMarketId` on
|
|
32
|
+
* every list shape.
|
|
33
|
+
*
|
|
34
|
+
* Order semantics: first occurrence wins per cluster. Callers should pass
|
|
35
|
+
* the more authoritative list first (e.g. `[...allVenueMarkets, ...lazyLoaded]`
|
|
36
|
+
* if the home-card row is preferred, swap if the lazy-loaded row is preferred).
|
|
37
|
+
*/
|
|
18
38
|
export declare const dedupeVenueMarketsById: (venueMarkets: VenueMarket[]) => VenueMarket[];
|
|
19
39
|
/** Returns the outcome's display text. Prefers `title` (the descriptive
|
|
20
40
|
* human-readable text — e.g. "Trump Wins") when present and non-empty,
|
|
@@ -42,5 +62,42 @@ type DisplayVolumeMarket = {
|
|
|
42
62
|
targetVenueMarket?: DisplayVolumeMarket | null;
|
|
43
63
|
} | null | undefined;
|
|
44
64
|
};
|
|
65
|
+
export type BestMidpointResult = {
|
|
66
|
+
/** Raw midpoint value (0–1 range, not yet clamped). */
|
|
67
|
+
midpoint: number;
|
|
68
|
+
venueMarketId: string;
|
|
69
|
+
venue: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Builds a venue-market-id → spread lookup from the raw midpoint rows returned
|
|
73
|
+
* by `useVenueMarketMidpoints`. Matched sibling rows are included in the map;
|
|
74
|
+
* first-write wins to match the same priority as `midpointsByVenueMarketId`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildSpreadByVenueMarketId(midpointRows: ReadonlyArray<{
|
|
77
|
+
venueMarketId: string;
|
|
78
|
+
spread: number | null;
|
|
79
|
+
matched: ReadonlyArray<{
|
|
80
|
+
venueMarketId: string;
|
|
81
|
+
spread: number | null;
|
|
82
|
+
}>;
|
|
83
|
+
}>): Map<string, number | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Returns the best available midpoint across a market and its matched venue
|
|
86
|
+
* markets. Candidates are collected in declaration order (primary first, then
|
|
87
|
+
* matched in array order) and deduplicated by ID. Among valid (non-null)
|
|
88
|
+
* midpoints, the candidate with the **lowest** YES midpoint wins — this gives
|
|
89
|
+
* the buyer the best available price across venues.
|
|
90
|
+
*
|
|
91
|
+
* The `spreadByVenueMarketId` parameter is accepted for call-site compatibility
|
|
92
|
+
* but is no longer used in the selection logic.
|
|
93
|
+
*/
|
|
94
|
+
export declare function resolveBestMidpointForMarket(market: {
|
|
95
|
+
id: string;
|
|
96
|
+
venue: string;
|
|
97
|
+
matchedVenueMarkets?: ReadonlyArray<{
|
|
98
|
+
id: string;
|
|
99
|
+
venue: string;
|
|
100
|
+
}> | null;
|
|
101
|
+
}, midpointsByVenueMarketId: Map<string, number | null>, spreadByVenueMarketId?: Map<string, number | null>): BestMidpointResult | undefined;
|
|
45
102
|
export declare const resolveDisplayVolume: (eventVolume: number | null | undefined, venueMarkets: ReadonlyArray<DisplayVolumeMarket>) => number | undefined;
|
|
46
103
|
export {};
|
|
@@ -108,8 +108,23 @@ export type EventListItemDetailsGraphSectionProps = {
|
|
|
108
108
|
venueInfo?: EventListItemVenueInfoMap;
|
|
109
109
|
/** Venue markets used to build the chart series. */
|
|
110
110
|
venueMarkets: EventListItemDetailsContentProps["event"]["venueMarkets"];
|
|
111
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* WS+REST merged prices (WS wins) keyed by outcome ID. General-purpose live
|
|
113
|
+
* prices for contexts where per-venue accuracy or availability doesn't matter.
|
|
114
|
+
*/
|
|
112
115
|
livePrices: Map<string, number>;
|
|
116
|
+
/**
|
|
117
|
+
* WS-only prices keyed by outcome ID. Used for chart venue badges so each
|
|
118
|
+
* badge shows its own venue's price rather than the cross-venue best.
|
|
119
|
+
* Falls back to `outcome.price` when a venue has no WS data yet.
|
|
120
|
+
*/
|
|
121
|
+
wsLivePrices: Map<string, number>;
|
|
122
|
+
/**
|
|
123
|
+
* REST cross-venue best prices keyed by outcome ID. Used for the outcome
|
|
124
|
+
* selector switch so it shows the lowest available price across venues rather
|
|
125
|
+
* than the WS price of a single venue.
|
|
126
|
+
*/
|
|
127
|
+
restMidpoints: Map<string, number>;
|
|
113
128
|
/** Override live WS subscriptions for the chart hook.
|
|
114
129
|
* Set to `false` when a parent manages subscriptions centrally. */
|
|
115
130
|
live?: boolean;
|
|
@@ -108,8 +108,23 @@ export type EventListItemDetailsGraphSectionProps = {
|
|
|
108
108
|
venueInfo?: EventListItemVenueInfoMap;
|
|
109
109
|
/** Venue markets used to build the chart series. */
|
|
110
110
|
venueMarkets: EventListItemDetailsContentProps["event"]["venueMarkets"];
|
|
111
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* WS+REST merged prices (WS wins) keyed by outcome ID. General-purpose live
|
|
113
|
+
* prices for contexts where per-venue accuracy or availability doesn't matter.
|
|
114
|
+
*/
|
|
112
115
|
livePrices: Map<string, number>;
|
|
116
|
+
/**
|
|
117
|
+
* WS-only prices keyed by outcome ID. Used for chart venue badges so each
|
|
118
|
+
* badge shows its own venue's price rather than the cross-venue best.
|
|
119
|
+
* Falls back to `outcome.price` when a venue has no WS data yet.
|
|
120
|
+
*/
|
|
121
|
+
wsLivePrices: Map<string, number>;
|
|
122
|
+
/**
|
|
123
|
+
* REST cross-venue best prices keyed by outcome ID. Used for the outcome
|
|
124
|
+
* selector switch so it shows the lowest available price across venues rather
|
|
125
|
+
* than the WS price of a single venue.
|
|
126
|
+
*/
|
|
127
|
+
restMidpoints: Map<string, number>;
|
|
113
128
|
/** Override live WS subscriptions for the chart hook.
|
|
114
129
|
* Set to `false` when a parent manages subscriptions centrally. */
|
|
115
130
|
live?: boolean;
|
|
@@ -71,6 +71,12 @@ export type MarketDetailsWithMarketsProps = MarketDetailsBaseProps & {
|
|
|
71
71
|
* card is not the selected market and therefore isn't on the WS feed.
|
|
72
72
|
*/
|
|
73
73
|
midpointsFallback?: Map<string, number>;
|
|
74
|
+
/**
|
|
75
|
+
* Venue name for each outcome id in `midpointsFallback`. When a matched venue
|
|
76
|
+
* offered a lower YES price, this records that venue so the outcome button
|
|
77
|
+
* shows the correct logo alongside the best price.
|
|
78
|
+
*/
|
|
79
|
+
midpointsFallbackVenues?: Map<string, string>;
|
|
74
80
|
};
|
|
75
81
|
export type MarketDetailsProps = MarketDetailsLoadingProps | MarketDetailsWithMarketsProps;
|
|
76
82
|
export type MarketDetailsContentProps = MarketDetailsBaseProps & {
|
|
@@ -78,6 +84,8 @@ export type MarketDetailsContentProps = MarketDetailsBaseProps & {
|
|
|
78
84
|
venueMarkets: VenueMarket[];
|
|
79
85
|
/** See MarketDetailsWithMarketsProps.midpointsFallback. */
|
|
80
86
|
midpointsFallback?: Map<string, number>;
|
|
87
|
+
/** See MarketDetailsWithMarketsProps.midpointsFallbackVenues. */
|
|
88
|
+
midpointsFallbackVenues?: Map<string, string>;
|
|
81
89
|
};
|
|
82
90
|
export type MarketDetailsListClassNames = Partial<{
|
|
83
91
|
root: string;
|
|
@@ -71,6 +71,12 @@ export type MarketDetailsWithMarketsProps = MarketDetailsBaseProps & {
|
|
|
71
71
|
* card is not the selected market and therefore isn't on the WS feed.
|
|
72
72
|
*/
|
|
73
73
|
midpointsFallback?: Map<string, number>;
|
|
74
|
+
/**
|
|
75
|
+
* Venue name for each outcome id in `midpointsFallback`. When a matched venue
|
|
76
|
+
* offered a lower YES price, this records that venue so the outcome button
|
|
77
|
+
* shows the correct logo alongside the best price.
|
|
78
|
+
*/
|
|
79
|
+
midpointsFallbackVenues?: Map<string, string>;
|
|
74
80
|
};
|
|
75
81
|
export type MarketDetailsProps = MarketDetailsLoadingProps | MarketDetailsWithMarketsProps;
|
|
76
82
|
export type MarketDetailsContentProps = MarketDetailsBaseProps & {
|
|
@@ -78,6 +84,8 @@ export type MarketDetailsContentProps = MarketDetailsBaseProps & {
|
|
|
78
84
|
venueMarkets: VenueMarket[];
|
|
79
85
|
/** See MarketDetailsWithMarketsProps.midpointsFallback. */
|
|
80
86
|
midpointsFallback?: Map<string, number>;
|
|
87
|
+
/** See MarketDetailsWithMarketsProps.midpointsFallbackVenues. */
|
|
88
|
+
midpointsFallbackVenues?: Map<string, string>;
|
|
81
89
|
};
|
|
82
90
|
export type MarketDetailsListClassNames = Partial<{
|
|
83
91
|
root: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CopyButtonProps {
|
|
2
|
+
/** Value written to the clipboard when the button is clicked. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Optional text rendered next to the icon in idle state. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Optional text rendered next to the icon while the copied feedback is showing. */
|
|
7
|
+
copiedLabel?: string;
|
|
8
|
+
/** ARIA label used when no visible text label is rendered. */
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
/** Disables the button (e.g. while the value is loading). */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Wrapper class applied to the underlying button. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Class applied to the icon (size and color). Defaults to `"h-4 w-4"`. */
|
|
15
|
+
iconClassName?: string;
|
|
16
|
+
/** Fires after the value is written to the clipboard. */
|
|
17
|
+
onCopy?: () => void;
|
|
18
|
+
/** How long the copied state is shown, in ms. Defaults to 2000. */
|
|
19
|
+
resetMs?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Button that copies `value` to the clipboard and briefly swaps to a confirmation icon. */
|
|
22
|
+
export declare const CopyButton: {
|
|
23
|
+
({ value, label, copiedLabel, "aria-label": ariaLabel, disabled, className, iconClassName, onCopy, resetMs, }: CopyButtonProps): JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CopyButtonProps {
|
|
2
|
+
/** Value written to the clipboard when the button is clicked. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Optional text rendered next to the icon in idle state. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Optional text rendered next to the icon while the copied feedback is showing. */
|
|
7
|
+
copiedLabel?: string;
|
|
8
|
+
/** ARIA label used when no visible text label is rendered. */
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
/** Disables the button (e.g. while the value is loading). */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Wrapper class applied to the underlying button. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Class applied to the icon (size and color). Defaults to `"h-4 w-4"`. */
|
|
15
|
+
iconClassName?: string;
|
|
16
|
+
/** Fires after the value is written to the clipboard. */
|
|
17
|
+
onCopy?: () => void;
|
|
18
|
+
/** How long the copied state is shown, in ms. Defaults to 2000. */
|
|
19
|
+
resetMs?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Button that copies `value` to the clipboard and briefly swaps to a confirmation icon. */
|
|
22
|
+
export declare const CopyButton: {
|
|
23
|
+
({ value, label, copiedLabel, "aria-label": ariaLabel, disabled, className, iconClassName, onCopy, resetMs, }: CopyButtonProps): JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -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,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;
|
|
@@ -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;
|
|
@@ -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,11 +34,7 @@ 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
39
|
export declare const resolvePlaceOrderSuccessTone: ({ outcomeIndex, tab, }: {
|
|
44
40
|
outcomeIndex: number;
|
|
@@ -52,9 +48,10 @@ export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quo
|
|
|
52
48
|
submittedOrders?: WsOrderSubmitted[];
|
|
53
49
|
}) => PlaceOrderExecutionStepGroup[];
|
|
54
50
|
export declare const groupPlaceOrderFailureSteps: (steps: PlaceOrderFailureStep[]) => PlaceOrderFailureStep[][];
|
|
55
|
-
export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, }: {
|
|
51
|
+
export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, treatPartialAsComplete, }: {
|
|
56
52
|
labels: PlaceOrderTradingLabels;
|
|
57
53
|
summary: PlaceOrderFailureSummary;
|
|
54
|
+
treatPartialAsComplete?: boolean;
|
|
58
55
|
}) => PlaceOrderExecutionStepGroup[];
|
|
59
56
|
export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
|
|
60
57
|
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,11 +34,7 @@ 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
39
|
export declare const resolvePlaceOrderSuccessTone: ({ outcomeIndex, tab, }: {
|
|
44
40
|
outcomeIndex: number;
|
|
@@ -52,9 +48,10 @@ export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quo
|
|
|
52
48
|
submittedOrders?: WsOrderSubmitted[];
|
|
53
49
|
}) => PlaceOrderExecutionStepGroup[];
|
|
54
50
|
export declare const groupPlaceOrderFailureSteps: (steps: PlaceOrderFailureStep[]) => PlaceOrderFailureStep[][];
|
|
55
|
-
export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, }: {
|
|
51
|
+
export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, treatPartialAsComplete, }: {
|
|
56
52
|
labels: PlaceOrderTradingLabels;
|
|
57
53
|
summary: PlaceOrderFailureSummary;
|
|
54
|
+
treatPartialAsComplete?: boolean;
|
|
58
55
|
}) => PlaceOrderExecutionStepGroup[];
|
|
59
56
|
export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
|
|
60
57
|
errorMessage?: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WithdrawModalProps } from "./withdraw-modal.types";
|
|
2
|
-
export type { WithdrawMethod, WithdrawModalProps, WithdrawFlowData } from "./withdraw-modal.types";
|
|
2
|
+
export type { WithdrawMethod, WithdrawModalControlledProps, WithdrawModalProps, WithdrawModalSelfDrivenProps, WithdrawFlowData, WithdrawSummary, } from "./withdraw-modal.types";
|
|
3
3
|
export declare const WithdrawModal: {
|
|
4
|
-
(
|
|
4
|
+
(props: WithdrawModalProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WithdrawModalProps } from "./withdraw-modal.types";
|
|
2
|
-
export type { WithdrawMethod, WithdrawModalProps, WithdrawFlowData } from "./withdraw-modal.types";
|
|
2
|
+
export type { WithdrawMethod, WithdrawModalControlledProps, WithdrawModalProps, WithdrawModalSelfDrivenProps, WithdrawFlowData, WithdrawSummary, } from "./withdraw-modal.types";
|
|
3
3
|
export declare const WithdrawModal: {
|
|
4
|
-
(
|
|
4
|
+
(props: WithdrawModalProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { WithdrawSelectOption } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawAmountStepProps {
|
|
3
3
|
amount: string;
|
|
4
|
-
currency: string;
|
|
5
4
|
destinationWallet: string;
|
|
5
|
+
balanceDisplay: string;
|
|
6
6
|
tokenOptions: WithdrawSelectOption[];
|
|
7
7
|
networkOptions: WithdrawSelectOption[];
|
|
8
8
|
selectedToken: string;
|
|
9
9
|
selectedNetwork: string;
|
|
10
|
+
isConfirming?: boolean;
|
|
11
|
+
error?: string | null;
|
|
10
12
|
onBack: () => void;
|
|
11
13
|
onAmountChange: (amount: string) => void;
|
|
12
|
-
|
|
14
|
+
onDestinationChange: (address: string) => void;
|
|
13
15
|
onTokenChange: (token: string) => void;
|
|
14
16
|
onNetworkChange: (network: string) => void;
|
|
17
|
+
onMaxClick?: () => void;
|
|
15
18
|
onContinue: () => void;
|
|
16
19
|
}
|
|
17
|
-
export declare const WithdrawAmountStep: ({ amount,
|
|
20
|
+
export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, isConfirming, error, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { WithdrawSelectOption } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawAmountStepProps {
|
|
3
3
|
amount: string;
|
|
4
|
-
currency: string;
|
|
5
4
|
destinationWallet: string;
|
|
5
|
+
balanceDisplay: string;
|
|
6
6
|
tokenOptions: WithdrawSelectOption[];
|
|
7
7
|
networkOptions: WithdrawSelectOption[];
|
|
8
8
|
selectedToken: string;
|
|
9
9
|
selectedNetwork: string;
|
|
10
|
+
isConfirming?: boolean;
|
|
11
|
+
error?: string | null;
|
|
10
12
|
onBack: () => void;
|
|
11
13
|
onAmountChange: (amount: string) => void;
|
|
12
|
-
|
|
14
|
+
onDestinationChange: (address: string) => void;
|
|
13
15
|
onTokenChange: (token: string) => void;
|
|
14
16
|
onNetworkChange: (network: string) => void;
|
|
17
|
+
onMaxClick?: () => void;
|
|
15
18
|
onContinue: () => void;
|
|
16
19
|
}
|
|
17
|
-
export declare const WithdrawAmountStep: ({ amount,
|
|
20
|
+
export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, isConfirming, error, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { WithdrawSummary } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawSuccessStepProps {
|
|
3
3
|
summary: WithdrawSummary;
|
|
4
|
+
tokenSymbol: string;
|
|
5
|
+
/**
|
|
6
|
+
* The submitted withdrawal id. When non-null the success step subscribes to
|
|
7
|
+
* `withdrawal_lifecycle` WS events and renders live progress; when null it
|
|
8
|
+
* falls back to the static "submitted" copy.
|
|
9
|
+
*/
|
|
10
|
+
withdrawalId: string | null;
|
|
4
11
|
onDone: () => void;
|
|
5
12
|
onClose: () => void;
|
|
6
13
|
}
|
|
7
|
-
export declare const WithdrawSuccessStep: ({ summary, onDone, onClose, }: WithdrawSuccessStepProps) => JSX.Element;
|
|
14
|
+
export declare const WithdrawSuccessStep: ({ summary, tokenSymbol, withdrawalId, onDone, onClose, }: WithdrawSuccessStepProps) => JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { WithdrawSummary } from "../withdraw-modal.types";
|
|
2
2
|
export interface WithdrawSuccessStepProps {
|
|
3
3
|
summary: WithdrawSummary;
|
|
4
|
+
tokenSymbol: string;
|
|
5
|
+
/**
|
|
6
|
+
* The submitted withdrawal id. When non-null the success step subscribes to
|
|
7
|
+
* `withdrawal_lifecycle` WS events and renders live progress; when null it
|
|
8
|
+
* falls back to the static "submitted" copy.
|
|
9
|
+
*/
|
|
10
|
+
withdrawalId: string | null;
|
|
4
11
|
onDone: () => void;
|
|
5
12
|
onClose: () => void;
|
|
6
13
|
}
|
|
7
|
-
export declare const WithdrawSuccessStep: ({ summary, onDone, onClose, }: WithdrawSuccessStepProps) => JSX.Element;
|
|
14
|
+
export declare const WithdrawSuccessStep: ({ summary, tokenSymbol, withdrawalId, onDone, onClose, }: WithdrawSuccessStepProps) => JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { WsWithdrawalLifecycleLeg, WsWithdrawalLifecycleStatus } from "@agg-build/sdk";
|
|
2
|
+
import type { AggUiLabels } from "@agg-build/hooks";
|
|
3
|
+
/**
|
|
4
|
+
* Visual tone for a single lifecycle step row. Mirrors the place-order
|
|
5
|
+
* success/in-flight timeline so the two flows feel identical to users.
|
|
6
|
+
*/
|
|
7
|
+
export type WithdrawalLifecycleStepStatus = "pending" | "complete" | "warning" | "error";
|
|
8
|
+
export interface WithdrawalLifecycleStep {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
status: WithdrawalLifecycleStepStatus;
|
|
12
|
+
}
|
|
13
|
+
export type WithdrawalLifecycleStepGroup = WithdrawalLifecycleStep[];
|
|
14
|
+
export declare const resolveChainLabel: (chainId: number) => string;
|
|
15
|
+
export interface BuildLifecycleStepsParams {
|
|
16
|
+
pending: boolean;
|
|
17
|
+
status: WsWithdrawalLifecycleStatus | null;
|
|
18
|
+
legs: WsWithdrawalLifecycleLeg[];
|
|
19
|
+
walletFlowLabels: AggUiLabels["withdraw"]["walletFlow"];
|
|
20
|
+
}
|
|
21
|
+
export interface BuildLifecycleStepsResult {
|
|
22
|
+
groups: WithdrawalLifecycleStepGroup[];
|
|
23
|
+
finalStep: WithdrawalLifecycleStep;
|
|
24
|
+
hasDetails: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the timeline groups + final summary row consumed by the success
|
|
28
|
+
* step's collapsible execution timeline. Returns the same shape the
|
|
29
|
+
* place-order flow produces, so the two share visual structure verbatim.
|
|
30
|
+
*
|
|
31
|
+
* - Each leg becomes one row in the first (and only) group.
|
|
32
|
+
* - The final row (always rendered, optionally collapsing the group above)
|
|
33
|
+
* reflects the *top-level* lifecycle status — "Bridging funds across
|
|
34
|
+
* chains…", "Withdrawal complete.", etc.
|
|
35
|
+
*/
|
|
36
|
+
export declare const buildWithdrawalLifecycleSteps: ({ pending, status, legs, walletFlowLabels, }: BuildLifecycleStepsParams) => BuildLifecycleStepsResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { WsWithdrawalLifecycleLeg, WsWithdrawalLifecycleStatus } from "@agg-build/sdk";
|
|
2
|
+
import type { AggUiLabels } from "@agg-build/hooks";
|
|
3
|
+
/**
|
|
4
|
+
* Visual tone for a single lifecycle step row. Mirrors the place-order
|
|
5
|
+
* success/in-flight timeline so the two flows feel identical to users.
|
|
6
|
+
*/
|
|
7
|
+
export type WithdrawalLifecycleStepStatus = "pending" | "complete" | "warning" | "error";
|
|
8
|
+
export interface WithdrawalLifecycleStep {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
status: WithdrawalLifecycleStepStatus;
|
|
12
|
+
}
|
|
13
|
+
export type WithdrawalLifecycleStepGroup = WithdrawalLifecycleStep[];
|
|
14
|
+
export declare const resolveChainLabel: (chainId: number) => string;
|
|
15
|
+
export interface BuildLifecycleStepsParams {
|
|
16
|
+
pending: boolean;
|
|
17
|
+
status: WsWithdrawalLifecycleStatus | null;
|
|
18
|
+
legs: WsWithdrawalLifecycleLeg[];
|
|
19
|
+
walletFlowLabels: AggUiLabels["withdraw"]["walletFlow"];
|
|
20
|
+
}
|
|
21
|
+
export interface BuildLifecycleStepsResult {
|
|
22
|
+
groups: WithdrawalLifecycleStepGroup[];
|
|
23
|
+
finalStep: WithdrawalLifecycleStep;
|
|
24
|
+
hasDetails: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the timeline groups + final summary row consumed by the success
|
|
28
|
+
* step's collapsible execution timeline. Returns the same shape the
|
|
29
|
+
* place-order flow produces, so the two share visual structure verbatim.
|
|
30
|
+
*
|
|
31
|
+
* - Each leg becomes one row in the first (and only) group.
|
|
32
|
+
* - The final row (always rendered, optionally collapsing the group above)
|
|
33
|
+
* reflects the *top-level* lifecycle status — "Bridging funds across
|
|
34
|
+
* chains…", "Withdrawal complete.", etc.
|
|
35
|
+
*/
|
|
36
|
+
export declare const buildWithdrawalLifecycleSteps: ({ pending, status, legs, walletFlowLabels, }: BuildLifecycleStepsParams) => BuildLifecycleStepsResult;
|