@agg-build/ui 1.2.10 → 1.2.12
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-K23CJ5UP.mjs → chunk-3JXBOU24.mjs} +580 -307
- package/dist/{chunk-5MTIBPDY.mjs → chunk-4WBQTUPW.mjs} +1091 -441
- package/dist/{chunk-5PSAIGOT.mjs → chunk-IBOE7DRY.mjs} +137 -61
- package/dist/{chunk-XKADJNAJ.mjs → chunk-J6WELNCX.mjs} +601 -326
- package/dist/{chunk-7JKGAWU5.mjs → chunk-U55T5BPE.mjs} +1802 -1564
- package/dist/{chunk-QFW5NDJ6.mjs → chunk-X3KCFWXN.mjs} +1312 -1040
- package/dist/{chunk-5MDFM2MX.mjs → chunk-YSW4ULL5.mjs} +1 -1
- package/dist/events.js +2892 -1746
- package/dist/events.mjs +3 -3
- package/dist/index.js +7085 -4956
- package/dist/index.mjs +520 -139
- package/dist/modals.js +3434 -2315
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +4175 -2764
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +1295 -942
- package/dist/primitives.mjs +5 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1677 -1249
- package/dist/trading.mjs +4 -4
- package/dist/types/agg-provider.d.mts +27 -0
- package/dist/types/agg-provider.d.ts +27 -0
- package/dist/types/deposit/deposit-modal.types.d.mts +10 -1
- package/dist/types/deposit/deposit-modal.types.d.ts +10 -1
- package/dist/types/deposit/index.d.mts +1 -1
- package/dist/types/deposit/index.d.ts +1 -1
- package/dist/types/deposit/steps/crypto-transfer.d.mts +1 -2
- package/dist/types/deposit/steps/crypto-transfer.d.ts +1 -2
- package/dist/types/deposit/steps/deposit-method.d.mts +2 -1
- package/dist/types/deposit/steps/deposit-method.d.ts +2 -1
- package/dist/types/events/item/event-list-item.types.d.mts +3 -1
- package/dist/types/events/item/event-list-item.types.d.ts +3 -1
- package/dist/types/events/item/event-list-item.utils.d.mts +26 -2
- package/dist/types/events/item/event-list-item.utils.d.ts +26 -2
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +30 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +30 -1
- package/dist/types/events/list/event-list-tabs.d.mts +6 -1
- package/dist/types/events/list/event-list-tabs.d.ts +6 -1
- package/dist/types/events/market-details/index.d.mts +1 -1
- package/dist/types/events/market-details/index.d.ts +1 -1
- package/dist/types/events/market-details/market-details.types.d.mts +27 -2
- package/dist/types/events/market-details/market-details.types.d.ts +27 -2
- package/dist/types/events/market-details/market-details.utils.d.mts +18 -4
- package/dist/types/events/market-details/market-details.utils.d.ts +18 -4
- package/dist/types/events/market-details/orderbook-aggregation.d.mts +30 -10
- package/dist/types/events/market-details/orderbook-aggregation.d.ts +30 -10
- package/dist/types/events/shared/chart-auto-fallback.d.mts +43 -0
- package/dist/types/events/shared/chart-auto-fallback.d.ts +43 -0
- package/dist/types/events/shared/display-outcome-price.d.mts +14 -0
- package/dist/types/events/shared/display-outcome-price.d.ts +14 -0
- package/dist/types/events/shared/display-outcome-venue.d.mts +30 -0
- package/dist/types/events/shared/display-outcome-venue.d.ts +30 -0
- package/dist/types/events/shared/display-reference-price.d.mts +4 -0
- package/dist/types/events/shared/display-reference-price.d.ts +4 -0
- package/dist/types/events/shared/select-outcome-price.d.mts +21 -0
- package/dist/types/events/shared/select-outcome-price.d.ts +21 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/notifications/agg-notification-events-provider.d.mts +35 -0
- package/dist/types/notifications/agg-notification-events-provider.d.ts +35 -0
- package/dist/types/notifications/agg-toast-provider.d.mts +27 -0
- package/dist/types/notifications/agg-toast-provider.d.ts +27 -0
- package/dist/types/notifications/deposit-notification-events.d.mts +10 -0
- package/dist/types/notifications/deposit-notification-events.d.ts +10 -0
- package/dist/types/notifications/index.d.mts +2 -0
- package/dist/types/notifications/index.d.ts +2 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
- package/dist/types/pages/user-profile/components/positions-value-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/positions-value-card.d.ts +2 -1
- package/dist/types/pages/user-profile/index.d.mts +2 -2
- package/dist/types/pages/user-profile/index.d.ts +2 -2
- package/dist/types/pages/user-profile/user-profile.types.d.mts +54 -1
- package/dist/types/pages/user-profile/user-profile.types.d.ts +54 -1
- package/dist/types/primitives/button/button.types.d.mts +4 -0
- package/dist/types/primitives/button/button.types.d.ts +4 -0
- package/dist/types/primitives/button/index.d.mts +1 -1
- package/dist/types/primitives/button/index.d.ts +1 -1
- package/dist/types/primitives/chart/chart.utils.d.mts +9 -10
- package/dist/types/primitives/chart/chart.utils.d.ts +9 -10
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +24 -0
- package/dist/types/primitives/icon/registry.d.ts +24 -0
- package/dist/types/primitives/icon/svg/circle-xmark.d.mts +5 -0
- package/dist/types/primitives/icon/svg/circle-xmark.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-end-date.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-end-date.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume.d.ts +5 -0
- package/dist/types/primitives/icon/svg/spinner.d.mts +5 -0
- package/dist/types/primitives/icon/svg/spinner.d.ts +5 -0
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +9 -0
- package/dist/types/primitives/select/select.types.d.ts +9 -0
- package/dist/types/primitives/toast/index.d.mts +2 -0
- package/dist/types/primitives/toast/index.d.ts +2 -0
- package/dist/types/primitives/toast/toast.types.d.mts +3 -0
- package/dist/types/primitives/toast/toast.types.d.ts +3 -0
- package/dist/types/primitives/tooltip/tooltip.types.d.mts +1 -0
- package/dist/types/primitives/tooltip/tooltip.types.d.ts +1 -0
- package/dist/types/primitives/typography/index.d.mts +1 -1
- package/dist/types/primitives/typography/index.d.ts +1 -1
- package/dist/types/primitives/typography/typography.types.d.mts +2 -0
- package/dist/types/primitives/typography/typography.types.d.ts +2 -0
- package/dist/types/profile/index.d.mts +1 -1
- package/dist/types/profile/index.d.ts +1 -1
- package/dist/types/profile/profile-modal.constants.d.mts +2 -2
- package/dist/types/profile/profile-modal.constants.d.ts +2 -2
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +2 -17
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +2 -17
- package/dist/types/profile/tabs/trading-access-tab.d.mts +15 -0
- package/dist/types/profile/tabs/trading-access-tab.d.ts +15 -0
- package/dist/types/shared/transfer-fee-summary.d.mts +10 -0
- package/dist/types/shared/transfer-fee-summary.d.ts +10 -0
- package/dist/types/shared/utils.d.mts +3 -0
- package/dist/types/shared/utils.d.ts +3 -0
- package/dist/types/trading/place-order/index.d.mts +1 -1
- package/dist/types/trading/place-order/index.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.execution-steps.d.mts +9 -0
- package/dist/types/trading/place-order/index.place-order.execution-steps.d.ts +9 -0
- package/dist/types/trading/place-order/index.place-order.types.d.mts +15 -2
- package/dist/types/trading/place-order/index.place-order.types.d.ts +15 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +49 -6
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +49 -6
- package/dist/types/withdraw/index.d.mts +1 -1
- package/dist/types/withdraw/index.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-success.d.mts +13 -7
- package/dist/types/withdraw/steps/withdraw-success.d.ts +13 -7
- package/dist/types/withdraw/steps/withdraw-success.utils.d.mts +2 -0
- package/dist/types/withdraw/steps/withdraw-success.utils.d.ts +2 -0
- package/dist/types/withdraw/withdraw-modal.types.d.mts +5 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +5 -0
- package/package.json +3 -3
|
@@ -34,10 +34,11 @@ export type ResolvedMarket = {
|
|
|
34
34
|
export declare const resolveMarketFromVenueMarkets: (venueMarkets: VenueMarket[], marketId: string | undefined) => ResolvedMarket | undefined;
|
|
35
35
|
export declare const resolveDisplayOutcomeLabels: (labels: string[]) => string[];
|
|
36
36
|
export declare const resolveInitialOutcomeLabel: (labels: string[], defaultOutcomeLabel: string | undefined) => string | undefined;
|
|
37
|
-
export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutcomeId, defaultOutcomeLabel, }: {
|
|
37
|
+
export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutcomeId, defaultOutcomeLabel, suppressFallbackWhenSelectedOutcomeOutOfScope, }: {
|
|
38
38
|
venueMarkets: VenueMarket[];
|
|
39
39
|
selectedOutcomeId: string | null | undefined;
|
|
40
40
|
defaultOutcomeLabel: string | undefined;
|
|
41
|
+
suppressFallbackWhenSelectedOutcomeOutOfScope?: boolean;
|
|
41
42
|
}) => {
|
|
42
43
|
outcomeId: string | null;
|
|
43
44
|
outcomeLabel: string | undefined;
|
|
@@ -45,21 +46,34 @@ export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutc
|
|
|
45
46
|
export declare const resolveAverageProbabilityByLabel: (venueMarkets: VenueMarket[], labels: string[]) => Map<string, number | undefined>;
|
|
46
47
|
export declare const formatProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
|
|
47
48
|
export declare const resolveOutcomeTone: (label: string, index: number) => MarketDetailsOrderBookTone;
|
|
48
|
-
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[]) => MarketDetailsHeaderOutcomeItem[];
|
|
49
|
-
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, }: {
|
|
49
|
+
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
+
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, tradableVenues, }: {
|
|
50
51
|
venueMarkets: VenueMarket[];
|
|
51
52
|
volume: number | undefined;
|
|
52
53
|
formatCompactCurrency: (value: number) => string;
|
|
53
54
|
labels: AggUiLabels;
|
|
55
|
+
/**
|
|
56
|
+
* Optional runtime-derived set of venues that have a live orderbook.
|
|
57
|
+
* Forwarded to `getVenueSummary` to filter `venueCount` to only
|
|
58
|
+
* tradeable venues. When omitted the count includes all venues
|
|
59
|
+
* regardless of orderbook availability.
|
|
60
|
+
*/
|
|
61
|
+
tradableVenues?: ReadonlySet<string> | null;
|
|
54
62
|
}) => string;
|
|
55
63
|
export declare const resolveOtherTabRows: (market: ResolvedMarket, labels: AggUiLabels) => MarketDetailsMetaRow[];
|
|
56
|
-
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, }: {
|
|
64
|
+
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, tradableVenues, }: {
|
|
57
65
|
venueMarkets: VenueMarket[];
|
|
58
66
|
marketId: string | undefined;
|
|
59
67
|
title: string | undefined;
|
|
60
68
|
image: string | null | undefined;
|
|
61
69
|
formatCompactCurrency: (value: number) => string;
|
|
62
70
|
labels: AggUiLabels;
|
|
71
|
+
/**
|
|
72
|
+
* Forwarded to `resolveSubtitle` → `getVenueSummary` so the "X venues"
|
|
73
|
+
* subtitle reflects only venues with a live orderbook. Optional;
|
|
74
|
+
* subtitle counts all cluster venues when omitted.
|
|
75
|
+
*/
|
|
76
|
+
tradableVenues?: ReadonlySet<string> | null;
|
|
63
77
|
}) => {
|
|
64
78
|
market: ResolvedMarket;
|
|
65
79
|
primaryVenueMarket: VenueMarket;
|
|
@@ -34,10 +34,11 @@ export type ResolvedMarket = {
|
|
|
34
34
|
export declare const resolveMarketFromVenueMarkets: (venueMarkets: VenueMarket[], marketId: string | undefined) => ResolvedMarket | undefined;
|
|
35
35
|
export declare const resolveDisplayOutcomeLabels: (labels: string[]) => string[];
|
|
36
36
|
export declare const resolveInitialOutcomeLabel: (labels: string[], defaultOutcomeLabel: string | undefined) => string | undefined;
|
|
37
|
-
export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutcomeId, defaultOutcomeLabel, }: {
|
|
37
|
+
export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutcomeId, defaultOutcomeLabel, suppressFallbackWhenSelectedOutcomeOutOfScope, }: {
|
|
38
38
|
venueMarkets: VenueMarket[];
|
|
39
39
|
selectedOutcomeId: string | null | undefined;
|
|
40
40
|
defaultOutcomeLabel: string | undefined;
|
|
41
|
+
suppressFallbackWhenSelectedOutcomeOutOfScope?: boolean;
|
|
41
42
|
}) => {
|
|
42
43
|
outcomeId: string | null;
|
|
43
44
|
outcomeLabel: string | undefined;
|
|
@@ -45,21 +46,34 @@ export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutc
|
|
|
45
46
|
export declare const resolveAverageProbabilityByLabel: (venueMarkets: VenueMarket[], labels: string[]) => Map<string, number | undefined>;
|
|
46
47
|
export declare const formatProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
|
|
47
48
|
export declare const resolveOutcomeTone: (label: string, index: number) => MarketDetailsOrderBookTone;
|
|
48
|
-
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[]) => MarketDetailsHeaderOutcomeItem[];
|
|
49
|
-
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, }: {
|
|
49
|
+
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
+
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, tradableVenues, }: {
|
|
50
51
|
venueMarkets: VenueMarket[];
|
|
51
52
|
volume: number | undefined;
|
|
52
53
|
formatCompactCurrency: (value: number) => string;
|
|
53
54
|
labels: AggUiLabels;
|
|
55
|
+
/**
|
|
56
|
+
* Optional runtime-derived set of venues that have a live orderbook.
|
|
57
|
+
* Forwarded to `getVenueSummary` to filter `venueCount` to only
|
|
58
|
+
* tradeable venues. When omitted the count includes all venues
|
|
59
|
+
* regardless of orderbook availability.
|
|
60
|
+
*/
|
|
61
|
+
tradableVenues?: ReadonlySet<string> | null;
|
|
54
62
|
}) => string;
|
|
55
63
|
export declare const resolveOtherTabRows: (market: ResolvedMarket, labels: AggUiLabels) => MarketDetailsMetaRow[];
|
|
56
|
-
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, }: {
|
|
64
|
+
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, tradableVenues, }: {
|
|
57
65
|
venueMarkets: VenueMarket[];
|
|
58
66
|
marketId: string | undefined;
|
|
59
67
|
title: string | undefined;
|
|
60
68
|
image: string | null | undefined;
|
|
61
69
|
formatCompactCurrency: (value: number) => string;
|
|
62
70
|
labels: AggUiLabels;
|
|
71
|
+
/**
|
|
72
|
+
* Forwarded to `resolveSubtitle` → `getVenueSummary` so the "X venues"
|
|
73
|
+
* subtitle reflects only venues with a live orderbook. Optional;
|
|
74
|
+
* subtitle counts all cluster venues when omitted.
|
|
75
|
+
*/
|
|
76
|
+
tradableVenues?: ReadonlySet<string> | null;
|
|
63
77
|
}) => {
|
|
64
78
|
market: ResolvedMarket;
|
|
65
79
|
primaryVenueMarket: VenueMarket;
|
|
@@ -20,25 +20,45 @@ export type AggregatedOrderbookRows = {
|
|
|
20
20
|
* Pick the eligible outcome on each venue-market that corresponds to the
|
|
21
21
|
* user's selected side.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* refs
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
23
|
+
* Selected-outcome-first (when `selectedOutcomeId` is provided): find
|
|
24
|
+
* that exact outcome in the cluster, emit it, walk its `matchedVenueMarketOutcomes`
|
|
25
|
+
* refs to align siblings by id. **Return immediately** — no fallback to
|
|
26
|
+
* other markets via label. This matches the server-side smart-route CTE
|
|
27
|
+
* which keys off the specific outcome id and does not fall through to
|
|
28
|
+
* label-based discovery. Critical for inversely-framed per-team kalshi
|
|
29
|
+
* binaries where the user's "No" outcome has no MVMO refs (matcher only
|
|
30
|
+
* emits Yes-side rows), but a different market's "No" outcome (e.g.
|
|
31
|
+
* polymarket-No with title "Khamzat Chimaev") DOES have refs pointing
|
|
32
|
+
* to the OPPOSITE semantic side. Falling through to that parent in the
|
|
33
|
+
* label loop emits cross-side outcomes — observed in the orderbook
|
|
34
|
+
* showing 80¢ Chimaev-wins prices when the user clicked the 19¢
|
|
35
|
+
* Strickland-wins side. The selected-outcome short-circuit prevents it.
|
|
36
|
+
*
|
|
37
|
+
* MVMO-first label loop (when `selectedOutcomeId` is null): scan the
|
|
38
|
+
* cluster for any market whose selected-outcome carries MVMO refs and
|
|
39
|
+
* use it as the parent. Walk the refs to align siblings.
|
|
30
40
|
*
|
|
31
41
|
* Label-fallback: for any sibling not covered by an MVMO ref (unmatched
|
|
32
42
|
* markets, or older API responses that pre-date the refs), fall back to
|
|
33
|
-
* label matching so we don't regress on the
|
|
43
|
+
* label matching with anchor-set guard so we don't regress on the
|
|
44
|
+
* historically-correct cases.
|
|
34
45
|
*/
|
|
35
|
-
export declare const collectEligibleVenueOutcomes: ({ venueMarkets, selectedOutcomeLabel, }: {
|
|
46
|
+
export declare const collectEligibleVenueOutcomes: ({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, }: {
|
|
36
47
|
venueMarkets: VenueMarket[];
|
|
37
48
|
selectedOutcomeLabel: string | null | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The exact outcome id the user clicked. When provided AND found in the
|
|
51
|
+
* cluster, the function emits that outcome + only its MVMO siblings, then
|
|
52
|
+
* returns — bypassing the label-based parent-discovery loop. Required to
|
|
53
|
+
* keep inversely-framed-binary surfaces (chart/orderbook) on the same
|
|
54
|
+
* semantic side as the user's selection.
|
|
55
|
+
*/
|
|
56
|
+
selectedOutcomeId?: string | null;
|
|
38
57
|
}) => EligibleVenueOutcome[];
|
|
39
|
-
export declare const collectEligibleVenueOutcomeIds: ({ venueMarkets, selectedOutcomeLabel, }: {
|
|
58
|
+
export declare const collectEligibleVenueOutcomeIds: ({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, }: {
|
|
40
59
|
venueMarkets: VenueMarket[];
|
|
41
60
|
selectedOutcomeLabel: string | null | undefined;
|
|
61
|
+
selectedOutcomeId?: string | null;
|
|
42
62
|
}) => string[];
|
|
43
63
|
export declare const mergeVenueOutcomeOrderbooks: ({ eligibleOutcomes, orderbooksByOutcomeId, }: {
|
|
44
64
|
eligibleOutcomes: EligibleVenueOutcome[];
|
|
@@ -20,25 +20,45 @@ export type AggregatedOrderbookRows = {
|
|
|
20
20
|
* Pick the eligible outcome on each venue-market that corresponds to the
|
|
21
21
|
* user's selected side.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* refs
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
23
|
+
* Selected-outcome-first (when `selectedOutcomeId` is provided): find
|
|
24
|
+
* that exact outcome in the cluster, emit it, walk its `matchedVenueMarketOutcomes`
|
|
25
|
+
* refs to align siblings by id. **Return immediately** — no fallback to
|
|
26
|
+
* other markets via label. This matches the server-side smart-route CTE
|
|
27
|
+
* which keys off the specific outcome id and does not fall through to
|
|
28
|
+
* label-based discovery. Critical for inversely-framed per-team kalshi
|
|
29
|
+
* binaries where the user's "No" outcome has no MVMO refs (matcher only
|
|
30
|
+
* emits Yes-side rows), but a different market's "No" outcome (e.g.
|
|
31
|
+
* polymarket-No with title "Khamzat Chimaev") DOES have refs pointing
|
|
32
|
+
* to the OPPOSITE semantic side. Falling through to that parent in the
|
|
33
|
+
* label loop emits cross-side outcomes — observed in the orderbook
|
|
34
|
+
* showing 80¢ Chimaev-wins prices when the user clicked the 19¢
|
|
35
|
+
* Strickland-wins side. The selected-outcome short-circuit prevents it.
|
|
36
|
+
*
|
|
37
|
+
* MVMO-first label loop (when `selectedOutcomeId` is null): scan the
|
|
38
|
+
* cluster for any market whose selected-outcome carries MVMO refs and
|
|
39
|
+
* use it as the parent. Walk the refs to align siblings.
|
|
30
40
|
*
|
|
31
41
|
* Label-fallback: for any sibling not covered by an MVMO ref (unmatched
|
|
32
42
|
* markets, or older API responses that pre-date the refs), fall back to
|
|
33
|
-
* label matching so we don't regress on the
|
|
43
|
+
* label matching with anchor-set guard so we don't regress on the
|
|
44
|
+
* historically-correct cases.
|
|
34
45
|
*/
|
|
35
|
-
export declare const collectEligibleVenueOutcomes: ({ venueMarkets, selectedOutcomeLabel, }: {
|
|
46
|
+
export declare const collectEligibleVenueOutcomes: ({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, }: {
|
|
36
47
|
venueMarkets: VenueMarket[];
|
|
37
48
|
selectedOutcomeLabel: string | null | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The exact outcome id the user clicked. When provided AND found in the
|
|
51
|
+
* cluster, the function emits that outcome + only its MVMO siblings, then
|
|
52
|
+
* returns — bypassing the label-based parent-discovery loop. Required to
|
|
53
|
+
* keep inversely-framed-binary surfaces (chart/orderbook) on the same
|
|
54
|
+
* semantic side as the user's selection.
|
|
55
|
+
*/
|
|
56
|
+
selectedOutcomeId?: string | null;
|
|
38
57
|
}) => EligibleVenueOutcome[];
|
|
39
|
-
export declare const collectEligibleVenueOutcomeIds: ({ venueMarkets, selectedOutcomeLabel, }: {
|
|
58
|
+
export declare const collectEligibleVenueOutcomeIds: ({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, }: {
|
|
40
59
|
venueMarkets: VenueMarket[];
|
|
41
60
|
selectedOutcomeLabel: string | null | undefined;
|
|
61
|
+
selectedOutcomeId?: string | null;
|
|
42
62
|
}) => string[];
|
|
43
63
|
export declare const mergeVenueOutcomeOrderbooks: ({ eligibleOutcomes, orderbooksByOutcomeId, }: {
|
|
44
64
|
eligibleOutcomes: EligibleVenueOutcome[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChartTimeRange, MarketChartData } from "@agg-build/hooks";
|
|
2
|
+
/**
|
|
3
|
+
* True when the chart payload has no usable bars *inside the visible domain*
|
|
4
|
+
* — i.e. the selected range yielded nothing to plot. A `null`/`undefined`
|
|
5
|
+
* payload (query not yet resolved) is also treated as "no data here" because
|
|
6
|
+
* the fallback decision uses this together with an `isLoading` guard.
|
|
7
|
+
*
|
|
8
|
+
* `liveCandle` counts as data: a market that just started trading inside the
|
|
9
|
+
* current bucket has a single forming candle and no closed bars; the chart
|
|
10
|
+
* should still render that.
|
|
11
|
+
*
|
|
12
|
+
* **Domain filtering**: pass `minTimeSec` (the rolling window's `startTs`) to
|
|
13
|
+
* ignore stale "courtesy" bars the API returns outside the requested window.
|
|
14
|
+
* Without this, a market that last traded 11h ago would surface a single
|
|
15
|
+
* out-of-window bar in `candles`, the chart would filter it out visually,
|
|
16
|
+
* but the emptiness check would think the chart has data — auto-fallback
|
|
17
|
+
* never fires and the user sees an empty plot.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isMarketChartEmpty: (data: MarketChartData | null | undefined, options?: {
|
|
20
|
+
minTimeSec?: number;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Decide whether the chart should auto-switch to the `ALL` range. We do this
|
|
24
|
+
* exactly once per chart subject (the caller's ref guard) so a user who later
|
|
25
|
+
* manually re-picks the empty range isn't fought by a second auto-switch.
|
|
26
|
+
*
|
|
27
|
+
* Bail conditions, in order:
|
|
28
|
+
* - we've already fallen back for this subject
|
|
29
|
+
* - we're already on `ALL` (nothing wider to fall back to)
|
|
30
|
+
* - the query errored — leave the failure surface to the error UI
|
|
31
|
+
* - the query is still loading — wait for a real answer
|
|
32
|
+
* - we have no payload yet — same reasoning
|
|
33
|
+
* Otherwise: fall back iff the payload is empty within the rolling domain.
|
|
34
|
+
*/
|
|
35
|
+
export declare const shouldAutoFallbackToAllRange: ({ chartData, isLoading, error, currentRange, hasAlreadyFallenBack, domainStartTs, }: {
|
|
36
|
+
chartData: MarketChartData | null | undefined;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: unknown;
|
|
39
|
+
currentRange: ChartTimeRange;
|
|
40
|
+
hasAlreadyFallenBack: boolean;
|
|
41
|
+
/** Rolling-window startTs in seconds. Bars older than this are ignored. */
|
|
42
|
+
domainStartTs?: number;
|
|
43
|
+
}) => boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChartTimeRange, MarketChartData } from "@agg-build/hooks";
|
|
2
|
+
/**
|
|
3
|
+
* True when the chart payload has no usable bars *inside the visible domain*
|
|
4
|
+
* — i.e. the selected range yielded nothing to plot. A `null`/`undefined`
|
|
5
|
+
* payload (query not yet resolved) is also treated as "no data here" because
|
|
6
|
+
* the fallback decision uses this together with an `isLoading` guard.
|
|
7
|
+
*
|
|
8
|
+
* `liveCandle` counts as data: a market that just started trading inside the
|
|
9
|
+
* current bucket has a single forming candle and no closed bars; the chart
|
|
10
|
+
* should still render that.
|
|
11
|
+
*
|
|
12
|
+
* **Domain filtering**: pass `minTimeSec` (the rolling window's `startTs`) to
|
|
13
|
+
* ignore stale "courtesy" bars the API returns outside the requested window.
|
|
14
|
+
* Without this, a market that last traded 11h ago would surface a single
|
|
15
|
+
* out-of-window bar in `candles`, the chart would filter it out visually,
|
|
16
|
+
* but the emptiness check would think the chart has data — auto-fallback
|
|
17
|
+
* never fires and the user sees an empty plot.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isMarketChartEmpty: (data: MarketChartData | null | undefined, options?: {
|
|
20
|
+
minTimeSec?: number;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Decide whether the chart should auto-switch to the `ALL` range. We do this
|
|
24
|
+
* exactly once per chart subject (the caller's ref guard) so a user who later
|
|
25
|
+
* manually re-picks the empty range isn't fought by a second auto-switch.
|
|
26
|
+
*
|
|
27
|
+
* Bail conditions, in order:
|
|
28
|
+
* - we've already fallen back for this subject
|
|
29
|
+
* - we're already on `ALL` (nothing wider to fall back to)
|
|
30
|
+
* - the query errored — leave the failure surface to the error UI
|
|
31
|
+
* - the query is still loading — wait for a real answer
|
|
32
|
+
* - we have no payload yet — same reasoning
|
|
33
|
+
* Otherwise: fall back iff the payload is empty within the rolling domain.
|
|
34
|
+
*/
|
|
35
|
+
export declare const shouldAutoFallbackToAllRange: ({ chartData, isLoading, error, currentRange, hasAlreadyFallenBack, domainStartTs, }: {
|
|
36
|
+
chartData: MarketChartData | null | undefined;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: unknown;
|
|
39
|
+
currentRange: ChartTimeRange;
|
|
40
|
+
hasAlreadyFallenBack: boolean;
|
|
41
|
+
/** Rolling-window startTs in seconds. Bars older than this are ignored. */
|
|
42
|
+
domainStartTs?: number;
|
|
43
|
+
}) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PriceSelection } from "./select-outcome-price";
|
|
2
|
+
export declare const getDisplayOutcomePrice: ({ outcomeId, outcomeLabel, selection, bestPrices, bestMidpoint, bestMidpointsByOutcomeId, livePrices, fallbackPrice, }: {
|
|
3
|
+
outcomeId: string | null | undefined;
|
|
4
|
+
outcomeLabel?: string | null | undefined;
|
|
5
|
+
selection?: PriceSelection;
|
|
6
|
+
bestPrices?: ReadonlyMap<string, {
|
|
7
|
+
bestBid?: number;
|
|
8
|
+
bestAsk?: number;
|
|
9
|
+
}> | null | undefined;
|
|
10
|
+
bestMidpoint?: number | null | undefined;
|
|
11
|
+
bestMidpointsByOutcomeId?: ReadonlyMap<string, number> | null | undefined;
|
|
12
|
+
livePrices?: ReadonlyMap<string, number> | null | undefined;
|
|
13
|
+
fallbackPrice?: number | null | undefined;
|
|
14
|
+
}) => number | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PriceSelection } from "./select-outcome-price";
|
|
2
|
+
export declare const getDisplayOutcomePrice: ({ outcomeId, outcomeLabel, selection, bestPrices, bestMidpoint, bestMidpointsByOutcomeId, livePrices, fallbackPrice, }: {
|
|
3
|
+
outcomeId: string | null | undefined;
|
|
4
|
+
outcomeLabel?: string | null | undefined;
|
|
5
|
+
selection?: PriceSelection;
|
|
6
|
+
bestPrices?: ReadonlyMap<string, {
|
|
7
|
+
bestBid?: number;
|
|
8
|
+
bestAsk?: number;
|
|
9
|
+
}> | null | undefined;
|
|
10
|
+
bestMidpoint?: number | null | undefined;
|
|
11
|
+
bestMidpointsByOutcomeId?: ReadonlyMap<string, number> | null | undefined;
|
|
12
|
+
livePrices?: ReadonlyMap<string, number> | null | undefined;
|
|
13
|
+
fallbackPrice?: number | null | undefined;
|
|
14
|
+
}) => number | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const getDisplayOutcomeVenue: ({ outcomeId, outcomeLabel, selection, bestMidpointVenue, bestVenueByOutcomeId, bestPriceVenuesByOutcomeId, fallbackVenue, }: {
|
|
2
|
+
outcomeId: string | null | undefined;
|
|
3
|
+
outcomeLabel?: string | null | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Active trade side. When provided, the venue is sourced from
|
|
6
|
+
* `bestPriceVenuesByOutcomeId` (top-of-book side) to mirror the price the
|
|
7
|
+
* UI is showing. Falls through to the midpoint-driven logic only when no
|
|
8
|
+
* side-specific venue is available.
|
|
9
|
+
*/
|
|
10
|
+
selection?: "buy" | "sell" | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Venue that produced the cluster-wide `bestMidpoint`. Mirrors the
|
|
13
|
+
* "yes" branch of `getDisplayOutcomePrice`: when the price comes from a
|
|
14
|
+
* cluster-level aggregate, the logo must come from the same aggregate.
|
|
15
|
+
* Required to keep logo + price in sync when the matched-sibling map
|
|
16
|
+
* doesn't know which market won.
|
|
17
|
+
*/
|
|
18
|
+
bestMidpointVenue?: string | null | undefined;
|
|
19
|
+
bestVenueByOutcomeId?: ReadonlyMap<string, string> | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Per-outcome venue for the winning side of the top-of-book. Required so
|
|
22
|
+
* the logo follows the price when the cheapest `bestAsk` (buy) or richest
|
|
23
|
+
* `bestBid` (sell) lives on a matched sibling venue.
|
|
24
|
+
*/
|
|
25
|
+
bestPriceVenuesByOutcomeId?: ReadonlyMap<string, {
|
|
26
|
+
bestBidVenue?: string;
|
|
27
|
+
bestAskVenue?: string;
|
|
28
|
+
}> | null | undefined;
|
|
29
|
+
fallbackVenue?: string | null | undefined;
|
|
30
|
+
}) => string | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const getDisplayOutcomeVenue: ({ outcomeId, outcomeLabel, selection, bestMidpointVenue, bestVenueByOutcomeId, bestPriceVenuesByOutcomeId, fallbackVenue, }: {
|
|
2
|
+
outcomeId: string | null | undefined;
|
|
3
|
+
outcomeLabel?: string | null | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Active trade side. When provided, the venue is sourced from
|
|
6
|
+
* `bestPriceVenuesByOutcomeId` (top-of-book side) to mirror the price the
|
|
7
|
+
* UI is showing. Falls through to the midpoint-driven logic only when no
|
|
8
|
+
* side-specific venue is available.
|
|
9
|
+
*/
|
|
10
|
+
selection?: "buy" | "sell" | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Venue that produced the cluster-wide `bestMidpoint`. Mirrors the
|
|
13
|
+
* "yes" branch of `getDisplayOutcomePrice`: when the price comes from a
|
|
14
|
+
* cluster-level aggregate, the logo must come from the same aggregate.
|
|
15
|
+
* Required to keep logo + price in sync when the matched-sibling map
|
|
16
|
+
* doesn't know which market won.
|
|
17
|
+
*/
|
|
18
|
+
bestMidpointVenue?: string | null | undefined;
|
|
19
|
+
bestVenueByOutcomeId?: ReadonlyMap<string, string> | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Per-outcome venue for the winning side of the top-of-book. Required so
|
|
22
|
+
* the logo follows the price when the cheapest `bestAsk` (buy) or richest
|
|
23
|
+
* `bestBid` (sell) lives on a matched sibling venue.
|
|
24
|
+
*/
|
|
25
|
+
bestPriceVenuesByOutcomeId?: ReadonlyMap<string, {
|
|
26
|
+
bestBidVenue?: string;
|
|
27
|
+
bestAskVenue?: string;
|
|
28
|
+
}> | null | undefined;
|
|
29
|
+
fallbackVenue?: string | null | undefined;
|
|
30
|
+
}) => string | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select the most relevant price for an outcome based on buy/sell intent.
|
|
3
|
+
*
|
|
4
|
+
* Precedence:
|
|
5
|
+
* 1. Best bid/ask (if selection intent is provided)
|
|
6
|
+
* 2. Live (WebSocket) price
|
|
7
|
+
* 3. Midpoint from REST
|
|
8
|
+
* 4. Fallback price
|
|
9
|
+
*/
|
|
10
|
+
export type PriceSelection = "buy" | "sell" | undefined;
|
|
11
|
+
export declare const selectOutcomePrice: ({ outcomeId, selection, bestPrices, bestMidpointsByOutcomeId, livePrices, fallbackPrice, }: {
|
|
12
|
+
outcomeId: string | null | undefined;
|
|
13
|
+
selection?: PriceSelection;
|
|
14
|
+
bestPrices?: ReadonlyMap<string, {
|
|
15
|
+
bestBid?: number;
|
|
16
|
+
bestAsk?: number;
|
|
17
|
+
}> | null;
|
|
18
|
+
bestMidpointsByOutcomeId?: ReadonlyMap<string, number> | null;
|
|
19
|
+
livePrices?: ReadonlyMap<string, number> | null;
|
|
20
|
+
fallbackPrice?: number | null;
|
|
21
|
+
}) => number | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select the most relevant price for an outcome based on buy/sell intent.
|
|
3
|
+
*
|
|
4
|
+
* Precedence:
|
|
5
|
+
* 1. Best bid/ask (if selection intent is provided)
|
|
6
|
+
* 2. Live (WebSocket) price
|
|
7
|
+
* 3. Midpoint from REST
|
|
8
|
+
* 4. Fallback price
|
|
9
|
+
*/
|
|
10
|
+
export type PriceSelection = "buy" | "sell" | undefined;
|
|
11
|
+
export declare const selectOutcomePrice: ({ outcomeId, selection, bestPrices, bestMidpointsByOutcomeId, livePrices, fallbackPrice, }: {
|
|
12
|
+
outcomeId: string | null | undefined;
|
|
13
|
+
selection?: PriceSelection;
|
|
14
|
+
bestPrices?: ReadonlyMap<string, {
|
|
15
|
+
bestBid?: number;
|
|
16
|
+
bestAsk?: number;
|
|
17
|
+
}> | null;
|
|
18
|
+
bestMidpointsByOutcomeId?: ReadonlyMap<string, number> | null;
|
|
19
|
+
livePrices?: ReadonlyMap<string, number> | null;
|
|
20
|
+
fallbackPrice?: number | null;
|
|
21
|
+
}) => number | undefined;
|
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToastContextValue } from "../primitives/toast";
|
|
3
|
+
interface AggNotificationEventsProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Toggle off without unmounting (e.g. partner is rendering a marketing page
|
|
7
|
+
* where toasts would be noise). Defaults to `true`. The
|
|
8
|
+
* `features.enableNotifications` flag on `<AggProvider config>` also gates
|
|
9
|
+
* the bridge — if either is `false`, no toasts fire.
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* How many recent deposit rows the bridge keeps in its observation window.
|
|
14
|
+
* The bridge mounts its own lightweight `useUserActivity({ type: "deposit" })`
|
|
15
|
+
* query so it can catch lifecycle transitions even when no other page is
|
|
16
|
+
* rendering the activity feed. Defaults to 25.
|
|
17
|
+
*/
|
|
18
|
+
depositActivityLimit?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global notification bridge. Subscribes to order WS events, withdrawal
|
|
22
|
+
* lifecycle WS events, and the deposit activity feed; turns terminal
|
|
23
|
+
* transitions into toasts via the existing `ToastProvider`. Auto-mounted by
|
|
24
|
+
* `<ToastProvider>` — partners don't need to wire it manually.
|
|
25
|
+
*
|
|
26
|
+
* Bails to a transparent passthrough when no `<AggProvider>` is above it, so
|
|
27
|
+
* a partner using `<ToastProvider>` standalone (e.g. a marketing page) keeps
|
|
28
|
+
* working without hooking into the SDK.
|
|
29
|
+
*
|
|
30
|
+
* Toasts dedupe per `${kind}:${id}:${status}` so reconnect storms and polling
|
|
31
|
+
* overlap don't double-fire, and the dedupe table is cleared on user-id change
|
|
32
|
+
* so signing out / in cannot leak toasts from a prior session.
|
|
33
|
+
*/
|
|
34
|
+
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
35
|
+
export type { ToastContextValue };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToastContextValue } from "../primitives/toast";
|
|
3
|
+
interface AggNotificationEventsProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Toggle off without unmounting (e.g. partner is rendering a marketing page
|
|
7
|
+
* where toasts would be noise). Defaults to `true`. The
|
|
8
|
+
* `features.enableNotifications` flag on `<AggProvider config>` also gates
|
|
9
|
+
* the bridge — if either is `false`, no toasts fire.
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* How many recent deposit rows the bridge keeps in its observation window.
|
|
14
|
+
* The bridge mounts its own lightweight `useUserActivity({ type: "deposit" })`
|
|
15
|
+
* query so it can catch lifecycle transitions even when no other page is
|
|
16
|
+
* rendering the activity feed. Defaults to 25.
|
|
17
|
+
*/
|
|
18
|
+
depositActivityLimit?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global notification bridge. Subscribes to order WS events, withdrawal
|
|
22
|
+
* lifecycle WS events, and the deposit activity feed; turns terminal
|
|
23
|
+
* transitions into toasts via the existing `ToastProvider`. Auto-mounted by
|
|
24
|
+
* `<ToastProvider>` — partners don't need to wire it manually.
|
|
25
|
+
*
|
|
26
|
+
* Bails to a transparent passthrough when no `<AggProvider>` is above it, so
|
|
27
|
+
* a partner using `<ToastProvider>` standalone (e.g. a marketing page) keeps
|
|
28
|
+
* working without hooking into the SDK.
|
|
29
|
+
*
|
|
30
|
+
* Toasts dedupe per `${kind}:${id}:${status}` so reconnect storms and polling
|
|
31
|
+
* overlap don't double-fire, and the dedupe table is cleared on user-id change
|
|
32
|
+
* so signing out / in cannot leak toasts from a prior session.
|
|
33
|
+
*/
|
|
34
|
+
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
35
|
+
export type { ToastContextValue };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ToastProviderProps } from "../primitives/toast";
|
|
3
|
+
export interface AggToastProviderProps extends Omit<ToastProviderProps, "children"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Disable the global notification bridge mounted under the toast viewport.
|
|
7
|
+
* When `true`, `AggToastProvider` behaves like the bare `ToastProvider` —
|
|
8
|
+
* no order/deposit/withdrawal toasts are emitted automatically. Defaults
|
|
9
|
+
* to `false`.
|
|
10
|
+
*/
|
|
11
|
+
disableAggNotifications?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Forwarded to `AggNotificationEventsProvider`. See its prop docs.
|
|
14
|
+
* Defaults to 25.
|
|
15
|
+
*/
|
|
16
|
+
notificationDepositActivityLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Drop-in replacement for `ToastProvider` that also mounts the global Agg
|
|
20
|
+
* notification bridge. Partners using `@agg-build/ui` should prefer this
|
|
21
|
+
* over the raw `ToastProvider` so order/deposit/withdrawal lifecycle events
|
|
22
|
+
* become toasts automatically with no extra wiring.
|
|
23
|
+
*
|
|
24
|
+
* The bridge gracefully no-ops when no `<AggProvider>` is mounted above it,
|
|
25
|
+
* so this provider remains safe to use even on routes that don't run the SDK.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggToastProvider({ children, disableAggNotifications, notificationDepositActivityLimit, ...toastProps }: AggToastProviderProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ToastProviderProps } from "../primitives/toast";
|
|
3
|
+
export interface AggToastProviderProps extends Omit<ToastProviderProps, "children"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Disable the global notification bridge mounted under the toast viewport.
|
|
7
|
+
* When `true`, `AggToastProvider` behaves like the bare `ToastProvider` —
|
|
8
|
+
* no order/deposit/withdrawal toasts are emitted automatically. Defaults
|
|
9
|
+
* to `false`.
|
|
10
|
+
*/
|
|
11
|
+
disableAggNotifications?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Forwarded to `AggNotificationEventsProvider`. See its prop docs.
|
|
14
|
+
* Defaults to 25.
|
|
15
|
+
*/
|
|
16
|
+
notificationDepositActivityLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Drop-in replacement for `ToastProvider` that also mounts the global Agg
|
|
20
|
+
* notification bridge. Partners using `@agg-build/ui` should prefer this
|
|
21
|
+
* over the raw `ToastProvider` so order/deposit/withdrawal lifecycle events
|
|
22
|
+
* become toasts automatically with no extra wiring.
|
|
23
|
+
*
|
|
24
|
+
* The bridge gracefully no-ops when no `<AggProvider>` is mounted above it,
|
|
25
|
+
* so this provider remains safe to use even on routes that don't run the SDK.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggToastProvider({ children, disableAggNotifications, notificationDepositActivityLimit, ...toastProps }: AggToastProviderProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AggDepositNotificationStatus = "completed" | "failed";
|
|
2
|
+
export interface AggDepositNotificationDetail {
|
|
3
|
+
id?: string;
|
|
4
|
+
status: AggDepositNotificationStatus;
|
|
5
|
+
amount?: string;
|
|
6
|
+
tokenSymbol?: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const dispatchAggDepositNotification: (detail: AggDepositNotificationDetail) => void;
|
|
10
|
+
export declare const subscribeAggDepositNotification: (handler: (detail: AggDepositNotificationDetail) => void) => (() => void);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AggDepositNotificationStatus = "completed" | "failed";
|
|
2
|
+
export interface AggDepositNotificationDetail {
|
|
3
|
+
id?: string;
|
|
4
|
+
status: AggDepositNotificationStatus;
|
|
5
|
+
amount?: string;
|
|
6
|
+
tokenSymbol?: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const dispatchAggDepositNotification: (detail: AggDepositNotificationDetail) => void;
|
|
10
|
+
export declare const subscribeAggDepositNotification: (handler: (detail: AggDepositNotificationDetail) => void) => (() => void);
|