@agg-build/ui 4.19.0 → 4.19.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.
Files changed (38) hide show
  1. package/dist/chunk-CKHECAKV.mjs +2724 -0
  2. package/dist/{chunk-NSQQ62QK.mjs → chunk-DONMO42Q.mjs} +1 -1
  3. package/dist/{chunk-GT3DCFIT.mjs → chunk-KRYMEFPL.mjs} +16 -8
  4. package/dist/{chunk-5YHKIJ23.mjs → chunk-NV6WT3TN.mjs} +481 -826
  5. package/dist/{chunk-47CCGQH6.mjs → chunk-UXLC3FFY.mjs} +451 -1349
  6. package/dist/{event-market-2BAMDM5I.mjs → event-market-UREM3ZE7.mjs} +3 -3
  7. package/dist/index.js +21902 -21626
  8. package/dist/index.mjs +8 -8
  9. package/dist/modals.js +898 -335
  10. package/dist/modals.mjs +5 -5
  11. package/dist/pages.js +2857 -1683
  12. package/dist/pages.mjs +4 -4
  13. package/dist/styles.css +1 -1
  14. package/dist/tailwind.css +1 -1
  15. package/dist/trading.js +1746 -643
  16. package/dist/trading.mjs +2 -2
  17. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
  18. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
  19. package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +3 -1
  20. package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +3 -1
  21. package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +2 -1
  22. package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +2 -1
  23. package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +6 -0
  24. package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +6 -0
  25. package/dist/types/profile/tabs/trading-access-tab.d.mts +2 -1
  26. package/dist/types/profile/tabs/trading-access-tab.d.ts +2 -1
  27. package/dist/types/trading/manage-betdex-account-modal.d.mts +2 -1
  28. package/dist/types/trading/manage-betdex-account-modal.d.ts +2 -1
  29. package/dist/types/trading/place-order/index.place-order.types.d.mts +1 -0
  30. package/dist/types/trading/place-order/index.place-order.types.d.ts +1 -0
  31. package/dist/types/trading/place-order/index.place-order.utils.d.mts +2 -2
  32. package/dist/types/trading/place-order/index.place-order.utils.d.ts +2 -2
  33. package/dist/types/withdraw/steps/withdraw-amount.d.mts +3 -1
  34. package/dist/types/withdraw/steps/withdraw-amount.d.ts +3 -1
  35. package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
  36. package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
  37. package/package.json +3 -3
  38. package/dist/chunk-ROA5K67W.mjs +0 -1237
package/dist/trading.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  useClaimWinnings,
15
15
  useResolvedMarketClaim,
16
16
  venueRequiresSharedKyc
17
- } from "./chunk-5YHKIJ23.mjs";
17
+ } from "./chunk-NV6WT3TN.mjs";
18
18
  import {
19
19
  SETTLEMENT_SECTION_ID,
20
20
  Settlement,
@@ -33,7 +33,7 @@ import {
33
33
  resolveDifferenceIconClassName,
34
34
  useEventTradingContext
35
35
  } from "./chunk-WOCZ4TVT.mjs";
36
- import "./chunk-ROA5K67W.mjs";
36
+ import "./chunk-CKHECAKV.mjs";
37
37
  import "./chunk-XZVGHKMW.mjs";
38
38
  export {
39
39
  FundKalshiModal,
@@ -14,6 +14,7 @@ type AvailableBalanceCardProps = {
14
14
  reservedValueLabel?: string;
15
15
  /** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
16
16
  kalshiValueLabel?: string;
17
+ betdexValueLabel?: string;
17
18
  chains: ChainRow[];
18
19
  isLoading?: boolean;
19
20
  className?: string;
@@ -26,7 +27,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
26
27
  export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
27
28
  export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
28
29
  export declare const AvailableBalanceCard: {
29
- ({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
30
+ ({ label, valueLabel, reservedValueLabel, kalshiValueLabel, betdexValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
30
31
  displayName: string;
31
32
  };
32
33
  export {};
@@ -14,6 +14,7 @@ type AvailableBalanceCardProps = {
14
14
  reservedValueLabel?: string;
15
15
  /** Kalshi cash balance. Kalshi holds funds off-chain, so it gets its own row. */
16
16
  kalshiValueLabel?: string;
17
+ betdexValueLabel?: string;
17
18
  chains: ChainRow[];
18
19
  isLoading?: boolean;
19
20
  className?: string;
@@ -26,7 +27,7 @@ export declare const venueLogosForChain: (chainId: string | number) => VenueLogo
26
27
  export declare const isVenueBalanceChain: (chainId: string | number) => boolean;
27
28
  export declare const chainIconUrl: (label: string, key?: string) => string | undefined;
28
29
  export declare const AvailableBalanceCard: {
29
- ({ label, valueLabel, reservedValueLabel, kalshiValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
30
+ ({ label, valueLabel, reservedValueLabel, kalshiValueLabel, betdexValueLabel, chains, isLoading, className, onManage, manageButtonRef, }: AvailableBalanceCardProps): JSX.Element;
30
31
  displayName: string;
31
32
  };
32
33
  export {};
@@ -1,2 +1,4 @@
1
1
  /** Hosted venue cash must never be presented as a signing-wallet chain balance. */
2
- export declare function BetdexAccountCard(): JSX.Element | null;
2
+ export declare function BetdexAccountCard({ onWalletDeposit, }?: {
3
+ onWalletDeposit?: (address: string) => void;
4
+ }): JSX.Element | null;
@@ -1,2 +1,4 @@
1
1
  /** Hosted venue cash must never be presented as a signing-wallet chain balance. */
2
- export declare function BetdexAccountCard(): JSX.Element | null;
2
+ export declare function BetdexAccountCard({ onWalletDeposit, }?: {
3
+ onWalletDeposit?: (address: string) => void;
4
+ }): JSX.Element | null;
@@ -1,7 +1,8 @@
1
1
  export declare function hostedWithdrawalRaw(value: string): string | null;
2
- export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, }: {
2
+ export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, onWalletDeposit, }: {
3
3
  accountId: string;
4
4
  environment: "production" | "sandbox";
5
5
  availableRaw?: string;
6
6
  canDeposit: boolean;
7
+ onWalletDeposit?: (address: string) => void;
7
8
  }): JSX.Element | null;
@@ -1,7 +1,8 @@
1
1
  export declare function hostedWithdrawalRaw(value: string): string | null;
2
- export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, }: {
2
+ export declare function BetdexAccountTransfers({ accountId, environment, availableRaw, canDeposit, onWalletDeposit, }: {
3
3
  accountId: string;
4
4
  environment: "production" | "sandbox";
5
5
  availableRaw?: string;
6
6
  canDeposit: boolean;
7
+ onWalletDeposit?: (address: string) => void;
7
8
  }): JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ /** Move the user's managed cash through the normal bridge/withdrawal pipeline
2
+ * to their verified BETDEX deposit address. Only confirmation submits money. */
3
+ export declare function BetdexWalletDeposit({ address, onClose, }: {
4
+ address: string;
5
+ onClose: () => void;
6
+ }): JSX.Element;
@@ -0,0 +1,6 @@
1
+ /** Move the user's managed cash through the normal bridge/withdrawal pipeline
2
+ * to their verified BETDEX deposit address. Only confirmation submits money. */
3
+ export declare function BetdexWalletDeposit({ address, onClose, }: {
4
+ address: string;
5
+ onClose: () => void;
6
+ }): JSX.Element;
@@ -7,11 +7,12 @@ interface VenueAccountInfo {
7
7
  export interface TradingAccessTabProps {
8
8
  venueAccounts?: VenueAccountInfo[] | null;
9
9
  onConnectKalshi?: () => void;
10
+ onConfigureBetdex?: () => void;
10
11
  onDisconnectKalshi?: () => void;
11
12
  onKycError?: (error: Error) => void;
12
13
  }
13
14
  export declare const TradingAccessTab: {
14
- ({ venueAccounts, onConnectKalshi, onDisconnectKalshi, }: TradingAccessTabProps): JSX.Element;
15
+ ({ venueAccounts, onConnectKalshi, onDisconnectKalshi, onConfigureBetdex, }: TradingAccessTabProps): JSX.Element;
15
16
  displayName: string;
16
17
  };
17
18
  export {};
@@ -7,11 +7,12 @@ interface VenueAccountInfo {
7
7
  export interface TradingAccessTabProps {
8
8
  venueAccounts?: VenueAccountInfo[] | null;
9
9
  onConnectKalshi?: () => void;
10
+ onConfigureBetdex?: () => void;
10
11
  onDisconnectKalshi?: () => void;
11
12
  onKycError?: (error: Error) => void;
12
13
  }
13
14
  export declare const TradingAccessTab: {
14
- ({ venueAccounts, onConnectKalshi, onDisconnectKalshi, }: TradingAccessTabProps): JSX.Element;
15
+ ({ venueAccounts, onConnectKalshi, onDisconnectKalshi, onConfigureBetdex, }: TradingAccessTabProps): JSX.Element;
15
16
  displayName: string;
16
17
  };
17
18
  export {};
@@ -1,5 +1,6 @@
1
1
  /** Reuse the account controls without treating hosted cash as wallet cash. */
2
- export declare function ManageBetdexAccountModal({ open, onOpenChange, }: {
2
+ export declare function ManageBetdexAccountModal({ open, onOpenChange, userId, }: {
3
3
  open: boolean;
4
+ userId?: string;
4
5
  onOpenChange: (open: boolean) => void;
5
6
  }): JSX.Element;
@@ -1,5 +1,6 @@
1
1
  /** Reuse the account controls without treating hosted cash as wallet cash. */
2
- export declare function ManageBetdexAccountModal({ open, onOpenChange, }: {
2
+ export declare function ManageBetdexAccountModal({ open, onOpenChange, userId, }: {
3
3
  open: boolean;
4
+ userId?: string;
4
5
  onOpenChange: (open: boolean) => void;
5
6
  }): JSX.Element;
@@ -248,6 +248,7 @@ export type BuildLiveRouteCardsParams = {
248
248
  tradeSide: PlaceOrderTab;
249
249
  eventVenues?: TradingVenue[];
250
250
  geoBlockedVenues?: ReadonlySet<string>;
251
+ betdexFundingRequired?: boolean;
251
252
  };
252
253
  export type ResolvePlaceOrderQuoteStatusParams = {
253
254
  amount: number;
@@ -248,6 +248,7 @@ export type BuildLiveRouteCardsParams = {
248
248
  tradeSide: PlaceOrderTab;
249
249
  eventVenues?: TradingVenue[];
250
250
  geoBlockedVenues?: ReadonlySet<string>;
251
+ betdexFundingRequired?: boolean;
251
252
  };
252
253
  export type ResolvePlaceOrderQuoteStatusParams = {
253
254
  amount: number;
@@ -1,5 +1,5 @@
1
1
  import type { VenueMarket, VenueSellQuoteRequest } from "@agg-build/hooks";
2
- import type { AggClient, SmartRouteResponse, WsOrderSubmitted } from "@agg-build/sdk";
2
+ import { type AggClient, type SmartRouteResponse, type WsOrderSubmitted } from "@agg-build/sdk";
3
3
  import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
4
4
  import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderLimitVenueOption, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
5
5
  /** Quote identity follows spendable funds and reservations, not the clock of an
@@ -111,7 +111,7 @@ export declare const sanitizePlaceOrderAmount: (value: number) => number;
111
111
  export declare const getTradingRoutePriceLabel: (value: number) => string;
112
112
  export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
113
113
  export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, tradeSide, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
114
- export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
114
+ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, betdexFundingRequired, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
115
115
  /**
116
116
  * Default route-card pick when the user hasn't selected one (or their selection
117
117
  * disappeared from the list). Normally the first available card wins, but when
@@ -1,5 +1,5 @@
1
1
  import type { VenueMarket, VenueSellQuoteRequest } from "@agg-build/hooks";
2
- import type { AggClient, SmartRouteResponse, WsOrderSubmitted } from "@agg-build/sdk";
2
+ import { type AggClient, type SmartRouteResponse, type WsOrderSubmitted } from "@agg-build/sdk";
3
3
  import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
4
4
  import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderLimitVenueOption, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
5
5
  /** Quote identity follows spendable funds and reservations, not the clock of an
@@ -111,7 +111,7 @@ export declare const sanitizePlaceOrderAmount: (value: number) => number;
111
111
  export declare const getTradingRoutePriceLabel: (value: number) => string;
112
112
  export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
113
113
  export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, tradeSide, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
114
- export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
114
+ export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, betdexFundingRequired, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
115
115
  /**
116
116
  * Default route-card pick when the user hasn't selected one (or their selection
117
117
  * disappeared from the list). Normally the first available card wins, but when
@@ -1,5 +1,7 @@
1
1
  import type { WithdrawSelectOption } from "../withdraw-modal.types";
2
2
  export interface WithdrawAmountStepProps {
3
+ title?: string;
4
+ fixedDestination?: boolean;
3
5
  amount: string;
4
6
  destinationWallet: string;
5
7
  balanceDisplay: string;
@@ -26,4 +28,4 @@ export interface WithdrawAmountStepProps {
26
28
  onMaxClick?: () => void;
27
29
  onContinue: () => void;
28
30
  }
29
- export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
31
+ export declare const WithdrawAmountStep: ({ title, fixedDestination, amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
@@ -1,5 +1,7 @@
1
1
  import type { WithdrawSelectOption } from "../withdraw-modal.types";
2
2
  export interface WithdrawAmountStepProps {
3
+ title?: string;
4
+ fixedDestination?: boolean;
3
5
  amount: string;
4
6
  destinationWallet: string;
5
7
  balanceDisplay: string;
@@ -26,4 +28,4 @@ export interface WithdrawAmountStepProps {
26
28
  onMaxClick?: () => void;
27
29
  onContinue: () => void;
28
30
  }
29
- export declare const WithdrawAmountStep: ({ amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
31
+ export declare const WithdrawAmountStep: ({ title, fixedDestination, amount, destinationWallet, balanceDisplay, tokenOptions, networkOptions, selectedToken, selectedNetwork, destDecimals, isConfirming, error, max, onBack, onAmountChange, onDestinationChange, onTokenChange, onNetworkChange, onMaxClick, onContinue, }: WithdrawAmountStepProps) => JSX.Element;
@@ -63,6 +63,14 @@ export interface WithdrawModalControlledProps {
63
63
  onOpenChange: (open: boolean) => void;
64
64
  /** Controlled state for the withdraw flow. */
65
65
  withdrawFlow: WithdrawFlowData;
66
+ /** Optional fixed recipient for an owned venue-account transfer. Uses the
67
+ * same preview, bridge, confirmation and withdrawal lifecycle as normal. */
68
+ transferTarget?: {
69
+ title: string;
70
+ address: string;
71
+ chainId: string;
72
+ tokenSymbol: string;
73
+ };
66
74
  /** Called when the recipient address input changes. */
67
75
  onWithdrawDestinationChange: (address: string) => void;
68
76
  /** Called when the withdraw amount changes. */
@@ -63,6 +63,14 @@ export interface WithdrawModalControlledProps {
63
63
  onOpenChange: (open: boolean) => void;
64
64
  /** Controlled state for the withdraw flow. */
65
65
  withdrawFlow: WithdrawFlowData;
66
+ /** Optional fixed recipient for an owned venue-account transfer. Uses the
67
+ * same preview, bridge, confirmation and withdrawal lifecycle as normal. */
68
+ transferTarget?: {
69
+ title: string;
70
+ address: string;
71
+ chainId: string;
72
+ tokenSymbol: string;
73
+ };
66
74
  /** Called when the recipient address input changes. */
67
75
  onWithdrawDestinationChange: (address: string) => void;
68
76
  /** Called when the withdraw amount changes. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -100,8 +100,8 @@
100
100
  "liveline": "^0.0.7",
101
101
  "react": "^18.0.0 || ^19.0.0",
102
102
  "react-dom": "^18.0.0 || ^19.0.0",
103
- "@agg-build/hooks": "^4.19.0",
104
- "@agg-build/sdk": "^4.19.0"
103
+ "@agg-build/hooks": "^4.19.1",
104
+ "@agg-build/sdk": "^4.19.1"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",