@agg-build/ui 4.26.1 → 4.27.0
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/event-trading-state.utils-B3my25Re.mjs +789 -0
- package/dist/event-trading-state.utils-s4DEc4iA.js +921 -0
- package/dist/events.js +23 -17658
- package/dist/events.mjs +3 -50
- package/dist/index.js +811 -47152
- package/dist/index.mjs +584 -1204
- package/dist/list-D8v2SmY1.js +6989 -0
- package/dist/list-DD7roCVl.mjs +6838 -0
- package/dist/manage-betdex-account-modal-21ZVLsz0.js +2390 -0
- package/dist/manage-betdex-account-modal-D2vKHird.mjs +2294 -0
- package/dist/modals-BReGwJzz.mjs +2993 -0
- package/dist/modals-CSexQO1C.js +3077 -0
- package/dist/modals.js +24 -11810
- package/dist/modals.mjs +3 -49
- package/dist/pages-CMlCYngA.mjs +7846 -0
- package/dist/pages-xvAzj6c2.js +7955 -0
- package/dist/pages.js +25 -42391
- package/dist/pages.mjs +3 -57
- package/dist/primitives-CqxNeV7H.js +9930 -0
- package/dist/primitives-Dz5aF8ma.mjs +8928 -0
- package/dist/primitives.js +102 -11079
- package/dist/primitives.mjs +1 -204
- package/dist/trading-CDkNdjGx.mjs +7086 -0
- package/dist/trading-CXsZFd3l.js +7217 -0
- package/dist/trading.js +39 -18215
- package/dist/trading.mjs +3 -68
- package/dist/types/agg-provider.d.mts +1 -1
- package/dist/types/agg-provider.d.ts +1 -1
- package/dist/types/auth/connect-button-view/index.d.mts +4 -5
- package/dist/types/auth/connect-button-view/index.d.ts +4 -5
- package/dist/types/deposit/components/DepositQRCode.d.mts +2 -2
- package/dist/types/deposit/components/DepositQRCode.d.ts +2 -2
- package/dist/types/deposit/index.d.mts +4 -4
- package/dist/types/deposit/index.d.ts +4 -4
- package/dist/types/deposit/steps/card-deposit.d.mts +1 -1
- package/dist/types/deposit/steps/card-deposit.d.ts +1 -1
- package/dist/types/deposit/steps/card-payment-pending.d.mts +1 -1
- package/dist/types/deposit/steps/card-payment-pending.d.ts +1 -1
- package/dist/types/deposit/steps/card-provider.d.mts +1 -1
- package/dist/types/deposit/steps/card-provider.d.ts +1 -1
- package/dist/types/deposit/steps/card-purchase-success.d.mts +1 -1
- package/dist/types/deposit/steps/card-purchase-success.d.ts +1 -1
- package/dist/types/deposit/steps/card-widget.d.mts +1 -1
- package/dist/types/deposit/steps/card-widget.d.ts +1 -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/deposit/steps/deposit-method.d.mts +2 -1
- package/dist/types/deposit/steps/deposit-method.d.ts +2 -1
- package/dist/types/deposit/steps/venue-selection.d.mts +1 -1
- package/dist/types/deposit/steps/venue-selection.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-form.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-form.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-processing.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-processing.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-success.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-success.d.ts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
- package/dist/types/events/item/index.d.mts +8 -8
- package/dist/types/events/item/index.d.ts +8 -8
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.mts +1 -1
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.ts +1 -1
- package/dist/types/events/item-details/event-markets-chart.d.mts +1 -1
- package/dist/types/events/item-details/event-markets-chart.d.ts +1 -1
- package/dist/types/events/item-details/event-markets-chart.utils.d.mts +1 -1
- package/dist/types/events/item-details/event-markets-chart.utils.d.ts +1 -1
- package/dist/types/events/item-details/index.d.mts +4 -4
- package/dist/types/events/item-details/index.d.ts +4 -4
- package/dist/types/events/item-details/settlement-summary.d.mts +4 -4
- package/dist/types/events/item-details/settlement-summary.d.ts +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +4 -4
- package/dist/types/events/list/category-sidebar.d.ts +4 -4
- package/dist/types/events/list/event-list-tabs.d.mts +4 -8
- package/dist/types/events/list/event-list-tabs.d.ts +4 -8
- package/dist/types/events/list/event-list-venue-strip.d.mts +4 -11
- package/dist/types/events/list/event-list-venue-strip.d.ts +4 -11
- package/dist/types/events/list/index.d.mts +4 -4
- package/dist/types/events/list/index.d.ts +4 -4
- package/dist/types/events/market-details/index.d.mts +8 -8
- package/dist/types/events/market-details/index.d.ts +8 -8
- package/dist/types/events/market-details/market-details-graph-panel.d.mts +4 -14
- package/dist/types/events/market-details/market-details-graph-panel.d.ts +4 -14
- package/dist/types/events/market-details/market-details-outcome-button.d.mts +4 -4
- package/dist/types/events/market-details/market-details-outcome-button.d.ts +4 -4
- package/dist/types/events/market-details/orderbook-aggregation.d.mts +3 -1
- package/dist/types/events/market-details/orderbook-aggregation.d.ts +3 -1
- package/dist/types/events/market-details/use-visible-market-streams.d.mts +1 -1
- package/dist/types/events/market-details/use-visible-market-streams.d.ts +1 -1
- package/dist/types/events/orderbook/index.d.mts +4 -4
- package/dist/types/events/orderbook/index.d.ts +4 -4
- package/dist/types/events/orderbook/orderbook-with-states.d.mts +4 -4
- package/dist/types/events/orderbook/orderbook-with-states.d.ts +4 -4
- package/dist/types/events/shared/chart-source-caption.d.mts +1 -1
- package/dist/types/events/shared/chart-source-caption.d.ts +1 -1
- package/dist/types/events/shared/sports-live-score.d.mts +4 -4
- package/dist/types/events/shared/sports-live-score.d.ts +4 -4
- package/dist/types/events/shared/use-chart-orderbook.d.mts +3 -3
- package/dist/types/events/shared/use-chart-orderbook.d.ts +3 -3
- package/dist/types/geo-block-banner/index.d.mts +4 -4
- package/dist/types/geo-block-banner/index.d.ts +4 -4
- package/dist/types/geo-block-modal/index.d.mts +4 -4
- package/dist/types/geo-block-modal/index.d.ts +4 -4
- package/dist/types/kyc/shared-kyc-modal.d.mts +4 -4
- package/dist/types/kyc/shared-kyc-modal.d.ts +4 -4
- package/dist/types/notifications/agg-notification-events-provider.d.mts +1 -1
- package/dist/types/notifications/agg-notification-events-provider.d.ts +1 -1
- package/dist/types/notifications/agg-toast-provider.d.mts +1 -1
- package/dist/types/notifications/agg-toast-provider.d.ts +1 -1
- package/dist/types/onboarding/index.d.mts +4 -4
- package/dist/types/onboarding/index.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-accounts.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-accounts.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-novig-modal.d.mts +1 -1
- package/dist/types/onboarding/steps/connect-novig-modal.d.ts +1 -1
- package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-prophetx-modal.d.mts +1 -1
- package/dist/types/onboarding/steps/connect-prophetx-modal.d.ts +1 -1
- package/dist/types/onboarding/steps/how-it-works.d.mts +4 -4
- package/dist/types/onboarding/steps/how-it-works.d.ts +4 -4
- package/dist/types/onboarding/steps/profile-setup.d.mts +4 -4
- package/dist/types/onboarding/steps/profile-setup.d.ts +4 -4
- package/dist/types/pages/event-market/event-market.shared.d.mts +4 -4
- package/dist/types/pages/event-market/event-market.shared.d.ts +4 -4
- package/dist/types/pages/event-market/event-market.types.d.mts +2 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +2 -0
- package/dist/types/pages/event-market/event-open-orders.d.mts +8 -27
- package/dist/types/pages/event-market/event-open-orders.d.ts +8 -27
- package/dist/types/pages/event-market/index.d.mts +6 -6
- package/dist/types/pages/event-market/index.d.ts +6 -6
- package/dist/types/pages/event-market/sports-event-market-page.d.mts +6 -6
- package/dist/types/pages/event-market/sports-event-market-page.d.ts +6 -6
- package/dist/types/pages/event-market/sports-line-rail.d.mts +2 -1
- package/dist/types/pages/event-market/sports-line-rail.d.ts +2 -1
- package/dist/types/pages/event-market/sports-market-card.d.mts +4 -4
- package/dist/types/pages/event-market/sports-market-card.d.ts +4 -4
- package/dist/types/pages/event-market/sports-markets.d.mts +4 -4
- package/dist/types/pages/event-market/sports-markets.d.ts +4 -4
- package/dist/types/pages/home/index.d.mts +6 -6
- package/dist/types/pages/home/index.d.ts +6 -6
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/segmented-control.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/segmented-control.d.ts +1 -1
- package/dist/types/pages/leaderboard/index.d.mts +1 -1
- package/dist/types/pages/leaderboard/index.d.ts +1 -1
- package/dist/types/pages/user-profile/components/activity-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/activity-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/balance-display.d.mts +4 -4
- package/dist/types/pages/user-profile/components/balance-display.d.ts +4 -4
- package/dist/types/pages/user-profile/components/balances-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/balances-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/betdex-account-activity.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-activity.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +1 -1
- package/dist/types/pages/user-profile/components/empty-state.d.mts +4 -4
- package/dist/types/pages/user-profile/components/empty-state.d.ts +4 -4
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.mts +4 -4
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.ts +4 -4
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/position-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/position-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +4 -4
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +4 -4
- package/dist/types/pages/user-profile/components/positions-value-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/positions-value-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/user-info-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/user-info-card.d.ts +4 -4
- package/dist/types/pages/user-profile/index.d.mts +6 -6
- package/dist/types/pages/user-profile/index.d.ts +6 -6
- package/dist/types/paper-trading/paper-onboarding-modal.d.mts +4 -14
- package/dist/types/paper-trading/paper-onboarding-modal.d.ts +4 -14
- package/dist/types/paper-trading/paper-trading-badge.d.mts +4 -16
- package/dist/types/paper-trading/paper-trading-badge.d.ts +4 -16
- package/dist/types/paper-trading/paper-trading-onboarding.d.mts +4 -12
- package/dist/types/paper-trading/paper-trading-onboarding.d.ts +4 -12
- package/dist/types/primitives/agg-logo/agg-logo.utils.d.mts +1 -1
- package/dist/types/primitives/agg-logo/agg-logo.utils.d.ts +1 -1
- package/dist/types/primitives/agg-logo/index.d.mts +4 -5
- package/dist/types/primitives/agg-logo/index.d.ts +4 -5
- package/dist/types/primitives/autocomplete-select/index.d.mts +4 -5
- package/dist/types/primitives/autocomplete-select/index.d.ts +4 -5
- package/dist/types/primitives/badge/index.d.mts +1 -1
- package/dist/types/primitives/badge/index.d.ts +1 -1
- package/dist/types/primitives/button/button.types.d.mts +2 -2
- package/dist/types/primitives/button/button.types.d.ts +2 -2
- package/dist/types/primitives/button/index.d.mts +4 -5
- package/dist/types/primitives/button/index.d.ts +4 -5
- package/dist/types/primitives/calendar/index.d.mts +4 -4
- package/dist/types/primitives/calendar/index.d.ts +4 -4
- package/dist/types/primitives/card/index.d.mts +4 -5
- package/dist/types/primitives/card/index.d.ts +4 -5
- package/dist/types/primitives/chart/chart-type-switch.d.mts +4 -5
- package/dist/types/primitives/chart/chart-type-switch.d.ts +4 -5
- package/dist/types/primitives/chart/index.d.mts +4 -5
- package/dist/types/primitives/chart/index.d.ts +4 -5
- package/dist/types/primitives/chart/probability-chart.d.mts +2 -2
- package/dist/types/primitives/chart/probability-chart.d.ts +2 -2
- package/dist/types/primitives/chart/probability-live-tail.d.mts +1 -1
- package/dist/types/primitives/chart/probability-live-tail.d.ts +1 -1
- package/dist/types/primitives/conditional-wrapper.d.mts +6 -7
- package/dist/types/primitives/conditional-wrapper.d.ts +6 -7
- package/dist/types/primitives/copy-button/index.d.mts +4 -5
- package/dist/types/primitives/copy-button/index.d.ts +4 -5
- package/dist/types/primitives/currency-input/index.d.mts +4 -5
- package/dist/types/primitives/currency-input/index.d.ts +4 -5
- package/dist/types/primitives/footer/agg-build-logo.d.mts +12 -15
- package/dist/types/primitives/footer/agg-build-logo.d.ts +12 -15
- package/dist/types/primitives/footer/index.d.mts +4 -6
- package/dist/types/primitives/footer/index.d.ts +4 -6
- package/dist/types/primitives/header/index.d.mts +4 -6
- package/dist/types/primitives/header/index.d.ts +4 -6
- package/dist/types/primitives/icon/index.d.mts +4 -5
- package/dist/types/primitives/icon/index.d.ts +4 -5
- package/dist/types/primitives/icon/registry.d.mts +180 -351
- package/dist/types/primitives/icon/registry.d.ts +180 -351
- package/dist/types/primitives/icon/svg/activity-chart.d.mts +4 -4
- package/dist/types/primitives/icon/svg/activity-chart.d.ts +4 -4
- package/dist/types/primitives/icon/svg/activity.d.mts +4 -4
- package/dist/types/primitives/icon/svg/activity.d.ts +4 -4
- package/dist/types/primitives/icon/svg/apple.d.mts +4 -4
- package/dist/types/primitives/icon/svg/apple.d.ts +4 -4
- package/dist/types/primitives/icon/svg/apps.d.mts +4 -4
- package/dist/types/primitives/icon/svg/apps.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arbitrum.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arbitrum.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrow-right.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrow-right.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +4 -4
- package/dist/types/primitives/icon/svg/badge-check-thin.d.mts +4 -4
- package/dist/types/primitives/icon/svg/badge-check-thin.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bank.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bank.d.ts +4 -4
- package/dist/types/primitives/icon/svg/base.d.mts +4 -4
- package/dist/types/primitives/icon/svg/base.d.ts +4 -4
- package/dist/types/primitives/icon/svg/best-prices.d.mts +4 -4
- package/dist/types/primitives/icon/svg/best-prices.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bnb.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bnb.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bolt.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bolt.d.ts +4 -4
- package/dist/types/primitives/icon/svg/calendar.d.mts +1 -1
- package/dist/types/primitives/icon/svg/calendar.d.ts +1 -1
- package/dist/types/primitives/icon/svg/chart-candlestick.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chart-candlestick.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chart-line.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chart-line.d.ts +4 -4
- package/dist/types/primitives/icon/svg/check-badge.d.mts +4 -4
- package/dist/types/primitives/icon/svg/check-badge.d.ts +4 -4
- package/dist/types/primitives/icon/svg/check-circle.d.mts +4 -4
- package/dist/types/primitives/icon/svg/check-circle.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-down-thin.d.mts +4 -5
- package/dist/types/primitives/icon/svg/chevron-down-thin.d.ts +4 -5
- package/dist/types/primitives/icon/svg/chevron-down.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-down.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-left.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-left.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-right.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-right.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/circle-overlap.d.mts +4 -4
- package/dist/types/primitives/icon/svg/circle-overlap.d.ts +4 -4
- package/dist/types/primitives/icon/svg/circle-xmark.d.mts +4 -4
- package/dist/types/primitives/icon/svg/circle-xmark.d.ts +4 -4
- package/dist/types/primitives/icon/svg/close.d.mts +4 -4
- package/dist/types/primitives/icon/svg/close.d.ts +4 -4
- package/dist/types/primitives/icon/svg/copy.d.mts +4 -4
- package/dist/types/primitives/icon/svg/copy.d.ts +4 -4
- package/dist/types/primitives/icon/svg/create-account.d.mts +4 -4
- package/dist/types/primitives/icon/svg/create-account.d.ts +4 -4
- package/dist/types/primitives/icon/svg/credit-card.d.mts +4 -4
- package/dist/types/primitives/icon/svg/credit-card.d.ts +4 -4
- package/dist/types/primitives/icon/svg/cross-circle.d.mts +4 -4
- package/dist/types/primitives/icon/svg/cross-circle.d.ts +4 -4
- package/dist/types/primitives/icon/svg/disconnect.d.mts +4 -4
- package/dist/types/primitives/icon/svg/disconnect.d.ts +4 -4
- package/dist/types/primitives/icon/svg/discord.d.mts +4 -4
- package/dist/types/primitives/icon/svg/discord.d.ts +4 -4
- package/dist/types/primitives/icon/svg/document.d.mts +4 -4
- package/dist/types/primitives/icon/svg/document.d.ts +4 -4
- package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +4 -4
- package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +4 -4
- package/dist/types/primitives/icon/svg/download.d.mts +4 -4
- package/dist/types/primitives/icon/svg/download.d.ts +4 -4
- package/dist/types/primitives/icon/svg/email.d.mts +4 -4
- package/dist/types/primitives/icon/svg/email.d.ts +4 -4
- package/dist/types/primitives/icon/svg/error-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/error-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/ethereum.d.mts +4 -4
- package/dist/types/primitives/icon/svg/ethereum.d.ts +4 -4
- package/dist/types/primitives/icon/svg/external-link.d.mts +4 -4
- package/dist/types/primitives/icon/svg/external-link.d.ts +4 -4
- package/dist/types/primitives/icon/svg/gift-bonus.d.mts +4 -4
- package/dist/types/primitives/icon/svg/gift-bonus.d.ts +4 -4
- package/dist/types/primitives/icon/svg/google.d.mts +4 -4
- package/dist/types/primitives/icon/svg/google.d.ts +4 -4
- package/dist/types/primitives/icon/svg/hourglass-start.d.mts +4 -4
- package/dist/types/primitives/icon/svg/hourglass-start.d.ts +4 -4
- package/dist/types/primitives/icon/svg/image.d.mts +4 -4
- package/dist/types/primitives/icon/svg/image.d.ts +4 -4
- package/dist/types/primitives/icon/svg/info.d.mts +4 -4
- package/dist/types/primitives/icon/svg/info.d.ts +4 -4
- package/dist/types/primitives/icon/svg/internet-security.d.mts +4 -4
- package/dist/types/primitives/icon/svg/internet-security.d.ts +4 -4
- package/dist/types/primitives/icon/svg/link-accounts.d.mts +4 -4
- package/dist/types/primitives/icon/svg/link-accounts.d.ts +4 -4
- package/dist/types/primitives/icon/svg/lock.d.mts +4 -4
- package/dist/types/primitives/icon/svg/lock.d.ts +4 -4
- package/dist/types/primitives/icon/svg/minus.d.mts +1 -1
- package/dist/types/primitives/icon/svg/minus.d.ts +1 -1
- package/dist/types/primitives/icon/svg/paper-buying-power.d.mts +4 -10
- package/dist/types/primitives/icon/svg/paper-buying-power.d.ts +4 -10
- package/dist/types/primitives/icon/svg/paper-earnings.d.mts +4 -10
- package/dist/types/primitives/icon/svg/paper-earnings.d.ts +4 -10
- package/dist/types/primitives/icon/svg/paper-mode.d.mts +4 -4
- package/dist/types/primitives/icon/svg/paper-mode.d.ts +4 -4
- package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-plane.d.mts +4 -4
- package/dist/types/primitives/icon/svg/paper-plane.d.ts +4 -4
- package/dist/types/primitives/icon/svg/pencil.d.mts +4 -4
- package/dist/types/primitives/icon/svg/pencil.d.ts +4 -4
- package/dist/types/primitives/icon/svg/play-square.d.mts +4 -4
- package/dist/types/primitives/icon/svg/play-square.d.ts +4 -4
- package/dist/types/primitives/icon/svg/plus.d.mts +1 -1
- package/dist/types/primitives/icon/svg/plus.d.ts +1 -1
- package/dist/types/primitives/icon/svg/polygon.d.mts +4 -4
- package/dist/types/primitives/icon/svg/polygon.d.ts +4 -4
- package/dist/types/primitives/icon/svg/profile-about-tab.d.mts +4 -5
- package/dist/types/primitives/icon/svg/profile-about-tab.d.ts +4 -5
- package/dist/types/primitives/icon/svg/profile-accounts-wallets-tab.d.mts +4 -5
- package/dist/types/primitives/icon/svg/profile-accounts-wallets-tab.d.ts +4 -5
- package/dist/types/primitives/icon/svg/profile.d.mts +4 -4
- package/dist/types/primitives/icon/svg/profile.d.ts +4 -4
- package/dist/types/primitives/icon/svg/quotes-warning.d.mts +4 -5
- package/dist/types/primitives/icon/svg/quotes-warning.d.ts +4 -5
- package/dist/types/primitives/icon/svg/recenter.d.mts +4 -4
- package/dist/types/primitives/icon/svg/recenter.d.ts +4 -4
- package/dist/types/primitives/icon/svg/revenue-alt.d.mts +4 -4
- package/dist/types/primitives/icon/svg/revenue-alt.d.ts +4 -4
- package/dist/types/primitives/icon/svg/search.d.mts +4 -4
- package/dist/types/primitives/icon/svg/search.d.ts +4 -4
- package/dist/types/primitives/icon/svg/shield-trust.d.mts +4 -4
- package/dist/types/primitives/icon/svg/shield-trust.d.ts +4 -4
- package/dist/types/primitives/icon/svg/solana.d.mts +4 -4
- package/dist/types/primitives/icon/svg/solana.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-end-date.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-end-date.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sparkles-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sparkles-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/spinner.d.mts +4 -4
- package/dist/types/primitives/icon/svg/spinner.d.ts +4 -4
- package/dist/types/primitives/icon/svg/stay-in-control.d.mts +4 -4
- package/dist/types/primitives/icon/svg/stay-in-control.d.ts +4 -4
- package/dist/types/primitives/icon/svg/success-check.d.mts +4 -4
- package/dist/types/primitives/icon/svg/success-check.d.ts +4 -4
- package/dist/types/primitives/icon/svg/telegram.d.mts +4 -4
- package/dist/types/primitives/icon/svg/telegram.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-down.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-down.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/twitter.d.mts +4 -4
- package/dist/types/primitives/icon/svg/twitter.d.ts +4 -4
- package/dist/types/primitives/icon/svg/upload.d.mts +4 -4
- package/dist/types/primitives/icon/svg/upload.d.ts +4 -4
- package/dist/types/primitives/icon/svg/usdc.d.mts +4 -4
- package/dist/types/primitives/icon/svg/usdc.d.ts +4 -4
- package/dist/types/primitives/icon/svg/user-trust.d.mts +4 -4
- package/dist/types/primitives/icon/svg/user-trust.d.ts +4 -4
- package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +1 -1
- package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +1 -1
- package/dist/types/primitives/icon/svg/wallet-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/wallet-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/wallet.d.mts +4 -4
- package/dist/types/primitives/icon/svg/wallet.d.ts +4 -4
- package/dist/types/primitives/icon/svg/warning-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/warning-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/warning.d.mts +4 -4
- package/dist/types/primitives/icon/svg/warning.d.ts +4 -4
- package/dist/types/primitives/inline-alert/index.d.mts +4 -5
- package/dist/types/primitives/inline-alert/index.d.ts +4 -5
- package/dist/types/primitives/loading-icon/index.d.mts +4 -5
- package/dist/types/primitives/loading-icon/index.d.ts +4 -5
- package/dist/types/primitives/modal/index.d.mts +12 -9
- package/dist/types/primitives/modal/index.d.ts +12 -9
- package/dist/types/primitives/number-value.d.mts +4 -4
- package/dist/types/primitives/number-value.d.ts +4 -4
- package/dist/types/primitives/remote-image/index.d.mts +4 -5
- package/dist/types/primitives/remote-image/index.d.ts +4 -5
- package/dist/types/primitives/search/index.d.mts +4 -5
- package/dist/types/primitives/search/index.d.ts +4 -5
- package/dist/types/primitives/search/search-empty-icon.d.mts +4 -4
- package/dist/types/primitives/search/search-empty-icon.d.ts +4 -4
- package/dist/types/primitives/select/index.d.mts +4 -5
- package/dist/types/primitives/select/index.d.ts +4 -5
- package/dist/types/primitives/skeleton/index.d.mts +4 -5
- package/dist/types/primitives/skeleton/index.d.ts +4 -5
- package/dist/types/primitives/skeleton/skeleton-block.d.mts +4 -4
- package/dist/types/primitives/skeleton/skeleton-block.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +4 -10
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +4 -10
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +5 -5
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +5 -5
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +8 -8
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +8 -8
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-overview-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-overview-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-positions-activity-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-positions-activity-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/state-message/index.d.mts +4 -5
- package/dist/types/primitives/state-message/index.d.ts +4 -5
- package/dist/types/primitives/switch-button/index.d.mts +4 -5
- package/dist/types/primitives/switch-button/index.d.ts +4 -5
- package/dist/types/primitives/tabs/index.d.mts +4 -5
- package/dist/types/primitives/tabs/index.d.ts +4 -5
- package/dist/types/primitives/toast/index.d.mts +1 -1
- package/dist/types/primitives/toast/index.d.ts +1 -1
- package/dist/types/primitives/tooltip/index.d.mts +4 -5
- package/dist/types/primitives/tooltip/index.d.ts +4 -5
- package/dist/types/primitives/typography/index.d.mts +4 -5
- package/dist/types/primitives/typography/index.d.ts +4 -5
- package/dist/types/primitives/typography/typography.types.d.mts +1 -1
- package/dist/types/primitives/typography/typography.types.d.ts +1 -1
- package/dist/types/primitives/venue-logo/index.d.mts +4 -5
- package/dist/types/primitives/venue-logo/index.d.ts +4 -5
- package/dist/types/primitives/venue-logo/svg/default-venue.d.mts +1 -1
- package/dist/types/primitives/venue-logo/svg/default-venue.d.ts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-betdex.d.mts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-betdex.d.ts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-hyperliquid.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-hyperliquid.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-myriad.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-myriad.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-novig.d.mts +4 -23
- package/dist/types/primitives/venue-logo/svg/logo-novig.d.ts +4 -23
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.mts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.ts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-predict.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-predict.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-prophetx.d.mts +4 -26
- package/dist/types/primitives/venue-logo/svg/logo-prophetx.d.ts +4 -26
- package/dist/types/primitives/venue-logo/svg/logo-tiprun.d.mts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-tiprun.d.ts +4 -5
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +1 -1
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +1 -1
- package/dist/types/profile/index.d.mts +4 -4
- package/dist/types/profile/index.d.ts +4 -4
- package/dist/types/profile/tabs/about-tab.d.mts +4 -4
- package/dist/types/profile/tabs/about-tab.d.ts +4 -4
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +4 -4
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +4 -4
- package/dist/types/profile/tabs/trading-access-tab.d.mts +4 -4
- package/dist/types/profile/tabs/trading-access-tab.d.ts +4 -4
- package/dist/types/shared/default-avatar.d.mts +4 -4
- package/dist/types/shared/default-avatar.d.ts +4 -4
- package/dist/types/shared/open-orders.d.mts +1 -1
- package/dist/types/shared/open-orders.d.ts +1 -1
- package/dist/types/shared/react-inert.d.mts +1 -0
- package/dist/types/shared/react-inert.d.ts +1 -0
- package/dist/types/shared/transfer-fee-summary.d.mts +1 -1
- package/dist/types/shared/transfer-fee-summary.d.ts +1 -1
- package/dist/types/trading/fund-kalshi-modal.d.mts +4 -4
- package/dist/types/trading/fund-kalshi-modal.d.ts +4 -4
- package/dist/types/trading/manage-betdex-account-modal.d.mts +1 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +1 -1
- package/dist/types/trading/place-order/index.d.mts +4 -4
- package/dist/types/trading/place-order/index.d.ts +4 -4
- package/dist/types/trading/place-order/index.place-order.execution-view.d.mts +6 -6
- package/dist/types/trading/place-order/index.place-order.execution-view.d.ts +6 -6
- package/dist/types/trading/place-order/index.place-order.failure.d.mts +4 -4
- package/dist/types/trading/place-order/index.place-order.failure.d.ts +4 -4
- package/dist/types/trading/place-order/index.place-order.success.d.mts +4 -4
- package/dist/types/trading/place-order/index.place-order.success.d.ts +4 -4
- package/dist/types/trading/settlement/index.d.mts +4 -4
- package/dist/types/trading/settlement/index.d.ts +4 -4
- package/dist/types/trading/settlement/settlement-details.d.mts +4 -4
- package/dist/types/trading/settlement/settlement-details.d.ts +4 -4
- package/dist/types/trading/settlement/settlement-text-renderer.d.mts +4 -4
- package/dist/types/trading/settlement/settlement-text-renderer.d.ts +4 -4
- package/dist/types/withdraw/index.d.mts +4 -4
- package/dist/types/withdraw/index.d.ts +4 -4
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-method.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-method.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-provider.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-provider.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-success.d.mts +2 -2
- package/dist/types/withdraw/steps/withdraw-success.d.ts +2 -2
- package/package.json +9 -8
- package/dist/chunk-6CZNJSRL.mjs +0 -3551
- package/dist/chunk-7G2GTWAS.mjs +0 -5189
- package/dist/chunk-7ORC3TUJ.mjs +0 -2883
- package/dist/chunk-EJXA32MG.mjs +0 -2377
- package/dist/chunk-JH4B3ZHQ.mjs +0 -1
- package/dist/chunk-KN7JN7F5.mjs +0 -8303
- package/dist/chunk-PN5HEBFC.mjs +0 -5789
- package/dist/chunk-W2LCFCW3.mjs +0 -2879
- package/dist/chunk-WOCZ4TVT.mjs +0 -1645
- package/dist/chunk-XZVGHKMW.mjs +0 -11426
- package/dist/event-market-A276CAYG.mjs +0 -21
package/dist/chunk-7ORC3TUJ.mjs
DELETED
|
@@ -1,2883 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
AGG_TERMS_OF_SERVICE_URL,
|
|
4
|
-
BestPricesIcon,
|
|
5
|
-
Button,
|
|
6
|
-
CheckCircleIcon,
|
|
7
|
-
ChevronLeftIcon,
|
|
8
|
-
ChevronRightIcon,
|
|
9
|
-
CloseIcon,
|
|
10
|
-
CreateAccountIcon,
|
|
11
|
-
Icon,
|
|
12
|
-
InlineAlert,
|
|
13
|
-
LinkAccountsIcon,
|
|
14
|
-
LoadingIcon,
|
|
15
|
-
Modal,
|
|
16
|
-
ProfileIcon,
|
|
17
|
-
RemoteImage,
|
|
18
|
-
Select,
|
|
19
|
-
SkeletonBlock,
|
|
20
|
-
StayInControlIcon,
|
|
21
|
-
SuccessCheckIcon,
|
|
22
|
-
Tooltip,
|
|
23
|
-
Typography,
|
|
24
|
-
VenueLogo,
|
|
25
|
-
WalletIcon,
|
|
26
|
-
WarningIcon,
|
|
27
|
-
__async,
|
|
28
|
-
__spreadProps,
|
|
29
|
-
__spreadValues,
|
|
30
|
-
cn,
|
|
31
|
-
formatCompactUsd,
|
|
32
|
-
formatUsd,
|
|
33
|
-
getMotionClassName
|
|
34
|
-
} from "./chunk-XZVGHKMW.mjs";
|
|
35
|
-
|
|
36
|
-
// src/geo-block-banner/index.tsx
|
|
37
|
-
import { useLabels } from "@agg-build/hooks";
|
|
38
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
39
|
-
var GeoBlockBanner = ({
|
|
40
|
-
venue,
|
|
41
|
-
termsUrl = AGG_TERMS_OF_SERVICE_URL,
|
|
42
|
-
className
|
|
43
|
-
}) => {
|
|
44
|
-
const labels = useLabels();
|
|
45
|
-
const message = venue ? labels.trading.geoBlockVenueMessage(venue) : labels.trading.geoBlockGenericMessage;
|
|
46
|
-
return /* @__PURE__ */ jsxs(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: cn("flex items-center gap-5 rounded-agg-lg bg-agg-secondary-hover p-3", className),
|
|
50
|
-
role: "status",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ jsxs("p", { className: "min-w-0 flex-1 text-agg-xs leading-agg-4 text-agg-foreground", children: [
|
|
53
|
-
message,
|
|
54
|
-
/* @__PURE__ */ jsx("a", { href: termsUrl, className: "underline", target: "_blank", rel: "noreferrer noopener", children: labels.trading.geoBlockTermsLink }),
|
|
55
|
-
labels.trading.geoBlockMessageSuffix
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ jsx(Icon, { name: "internet-security", className: "h-6 w-6 shrink-0 text-agg-muted-foreground" })
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
GeoBlockBanner.displayName = "GeoBlockBanner";
|
|
63
|
-
|
|
64
|
-
// src/kyc/shared-kyc-modal.tsx
|
|
65
|
-
import { useLabels as useLabels2 } from "@agg-build/hooks";
|
|
66
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
67
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
68
|
-
var SharedKycModal = ({
|
|
69
|
-
open,
|
|
70
|
-
state = "initial",
|
|
71
|
-
errorMessage,
|
|
72
|
-
onOpenChange,
|
|
73
|
-
onStartVerification
|
|
74
|
-
}) => {
|
|
75
|
-
const labels = useLabels2();
|
|
76
|
-
const modalLabels = labels.trading.sharedKyc.modal;
|
|
77
|
-
const isInitiating = state === "initiating";
|
|
78
|
-
const handleOpenChange = (nextOpen) => {
|
|
79
|
-
if (isInitiating && !nextOpen) return;
|
|
80
|
-
onOpenChange(nextOpen);
|
|
81
|
-
};
|
|
82
|
-
return /* @__PURE__ */ jsx2(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs2(
|
|
83
|
-
Modal.Container,
|
|
84
|
-
{
|
|
85
|
-
maxWidth: "420px",
|
|
86
|
-
"aria-label": modalLabels.ariaLabel,
|
|
87
|
-
classNames: { container: "!rounded-agg-2xl" },
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ jsx2("div", { className: "flex h-14 shrink-0 items-center justify-end px-5", children: /* @__PURE__ */ jsx2(
|
|
90
|
-
Dialog.Close,
|
|
91
|
-
{
|
|
92
|
-
"aria-label": labels.common.close,
|
|
93
|
-
disabled: isInitiating,
|
|
94
|
-
className: "flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-foreground hover:bg-agg-secondary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
95
|
-
children: /* @__PURE__ */ jsx2(Icon, { name: "close", size: "small", "aria-hidden": "true" })
|
|
96
|
-
}
|
|
97
|
-
) }),
|
|
98
|
-
/* @__PURE__ */ jsx2(Modal.Body, { classNames: { root: "!px-8 !pb-9 !pt-0" }, children: state === "success" ? /* @__PURE__ */ jsxs2(
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
className: "flex flex-col items-center gap-6 text-center",
|
|
102
|
-
role: "status",
|
|
103
|
-
"aria-live": "polite",
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ jsx2("div", { className: "flex size-12 items-center justify-center rounded-agg-full border border-agg-success bg-agg-success/10 text-agg-success", children: /* @__PURE__ */ jsx2(Icon, { name: "success-check", className: "size-5", "aria-hidden": "true" }) }),
|
|
106
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-2", children: [
|
|
107
|
-
/* @__PURE__ */ jsx2(Dialog.Title, { children: /* @__PURE__ */ jsx2(Typography, { as: "span", variant: "body-large-strong", children: modalLabels.successTitle }) }),
|
|
108
|
-
/* @__PURE__ */ jsx2(Dialog.Description, { children: /* @__PURE__ */ jsx2(Typography, { as: "span", variant: "label", className: "text-pretty text-agg-foreground", children: modalLabels.successDescription }) })
|
|
109
|
-
] }),
|
|
110
|
-
/* @__PURE__ */ jsx2(Button, { variant: "secondary", size: "large", onClick: () => handleOpenChange(false), children: modalLabels.done })
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
) : /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-6 text-center", children: [
|
|
114
|
-
/* @__PURE__ */ jsx2(
|
|
115
|
-
Icon,
|
|
116
|
-
{
|
|
117
|
-
name: "user-trust",
|
|
118
|
-
className: "h-12! w-12! text-agg-muted-foreground",
|
|
119
|
-
"aria-hidden": "true"
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-2", children: [
|
|
123
|
-
/* @__PURE__ */ jsx2(Dialog.Title, { children: /* @__PURE__ */ jsx2(Typography, { as: "span", variant: "body-large-strong", children: state === "pending" ? modalLabels.pendingTitle : modalLabels.title }) }),
|
|
124
|
-
/* @__PURE__ */ jsx2(Dialog.Description, { children: /* @__PURE__ */ jsx2(Typography, { as: "span", variant: "label", className: "text-pretty text-agg-foreground", children: state === "pending" ? modalLabels.pendingDescription : modalLabels.freeDescription }) })
|
|
125
|
-
] }),
|
|
126
|
-
state === "error" || state === "pending" && errorMessage ? /* @__PURE__ */ jsx2(
|
|
127
|
-
InlineAlert,
|
|
128
|
-
{
|
|
129
|
-
tone: "error",
|
|
130
|
-
variant: "surface",
|
|
131
|
-
message: errorMessage || modalLabels.error
|
|
132
|
-
}
|
|
133
|
-
) : null,
|
|
134
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-4", children: [
|
|
135
|
-
/* @__PURE__ */ jsx2(
|
|
136
|
-
Button,
|
|
137
|
-
{
|
|
138
|
-
variant: "primary",
|
|
139
|
-
size: "large",
|
|
140
|
-
isLoading: isInitiating,
|
|
141
|
-
disabled: isInitiating,
|
|
142
|
-
"aria-label": state === "pending" ? modalLabels.checkStatus : modalLabels.startVerification,
|
|
143
|
-
onClick: onStartVerification,
|
|
144
|
-
children: state === "pending" ? modalLabels.checkStatus : modalLabels.startVerification
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ jsx2(
|
|
148
|
-
Button,
|
|
149
|
-
{
|
|
150
|
-
variant: "tertiary",
|
|
151
|
-
size: "large",
|
|
152
|
-
disabled: isInitiating,
|
|
153
|
-
onClick: () => handleOpenChange(false),
|
|
154
|
-
children: modalLabels.doItLater
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
] })
|
|
158
|
-
] }) })
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
) });
|
|
162
|
-
};
|
|
163
|
-
SharedKycModal.displayName = "SharedKycModal";
|
|
164
|
-
|
|
165
|
-
// src/onboarding/steps/how-it-works.tsx
|
|
166
|
-
import { useCallback, useRef, useState } from "react";
|
|
167
|
-
import { useLabels as useLabels3 } from "@agg-build/hooks";
|
|
168
|
-
|
|
169
|
-
// src/onboarding/onboarding-modal.constants.ts
|
|
170
|
-
import { isVenueActive, Venue } from "@agg-build/sdk";
|
|
171
|
-
var HOW_IT_WORKS_FEATURE_KEYS = [
|
|
172
|
-
"createAccount",
|
|
173
|
-
"linkAccounts",
|
|
174
|
-
"bestPrices",
|
|
175
|
-
"stayInControl"
|
|
176
|
-
];
|
|
177
|
-
var ONBOARDING_STEPS = {
|
|
178
|
-
HOW_IT_WORKS: 0,
|
|
179
|
-
PROFILE_SETUP: 1,
|
|
180
|
-
CONNECT_ACCOUNTS: 2
|
|
181
|
-
};
|
|
182
|
-
var ONCHAIN_VENUES = [
|
|
183
|
-
Venue.polymarket,
|
|
184
|
-
Venue.opinion,
|
|
185
|
-
Venue.predict,
|
|
186
|
-
Venue.pred
|
|
187
|
-
].filter(isVenueActive);
|
|
188
|
-
|
|
189
|
-
// src/onboarding/steps/how-it-works.tsx
|
|
190
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
191
|
-
var defaultIcons = {
|
|
192
|
-
createAccount: /* @__PURE__ */ jsx3(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
193
|
-
linkAccounts: /* @__PURE__ */ jsx3(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
194
|
-
bestPrices: /* @__PURE__ */ jsx3(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
195
|
-
stayInControl: /* @__PURE__ */ jsx3(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
196
|
-
};
|
|
197
|
-
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
198
|
-
const labels = useLabels3();
|
|
199
|
-
const scrollRef = useRef(null);
|
|
200
|
-
const [showTopGradient, setShowTopGradient] = useState(false);
|
|
201
|
-
const [showBottomGradient, setShowBottomGradient] = useState(true);
|
|
202
|
-
const handleScroll = useCallback(() => {
|
|
203
|
-
const el = scrollRef.current;
|
|
204
|
-
if (!el) return;
|
|
205
|
-
setShowTopGradient(el.scrollTop > 0);
|
|
206
|
-
setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
|
|
207
|
-
}, []);
|
|
208
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
|
|
209
|
-
/* @__PURE__ */ jsx3("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
|
|
210
|
-
/* @__PURE__ */ jsxs3("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
|
|
211
|
-
/* @__PURE__ */ jsx3(
|
|
212
|
-
"div",
|
|
213
|
-
{
|
|
214
|
-
ref: scrollRef,
|
|
215
|
-
onScroll: handleScroll,
|
|
216
|
-
className: "flex flex-col gap-4 overflow-y-auto sm:overflow-visible h-full",
|
|
217
|
-
children: HOW_IT_WORKS_FEATURE_KEYS.map((featureKey) => {
|
|
218
|
-
var _a;
|
|
219
|
-
const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
|
|
220
|
-
const feature = labels.onboarding.howItWorks.features[featureKey];
|
|
221
|
-
return /* @__PURE__ */ jsxs3(
|
|
222
|
-
"div",
|
|
223
|
-
{
|
|
224
|
-
className: cn(
|
|
225
|
-
"flex items-center gap-4 py-4 px-5 sm:px-4",
|
|
226
|
-
"rounded-agg-md",
|
|
227
|
-
"bg-agg-secondary-hover"
|
|
228
|
-
),
|
|
229
|
-
children: [
|
|
230
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
|
|
231
|
-
/* @__PURE__ */ jsx3("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
|
|
232
|
-
/* @__PURE__ */ jsx3("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
|
|
233
|
-
] }),
|
|
234
|
-
icon ? /* @__PURE__ */ jsx3("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
|
|
235
|
-
]
|
|
236
|
-
},
|
|
237
|
-
featureKey
|
|
238
|
-
);
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
),
|
|
242
|
-
/* @__PURE__ */ jsx3(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
className: cn(
|
|
246
|
-
"pointer-events-none absolute inset-x-0 top-0 h-20",
|
|
247
|
-
"bg-gradient-to-b from-agg-secondary to-transparent",
|
|
248
|
-
"sm:hidden transition-opacity",
|
|
249
|
-
showTopGradient ? "opacity-100" : "opacity-0"
|
|
250
|
-
)
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
/* @__PURE__ */ jsx3(
|
|
254
|
-
"div",
|
|
255
|
-
{
|
|
256
|
-
className: cn(
|
|
257
|
-
"pointer-events-none absolute inset-x-0 bottom-0 h-20",
|
|
258
|
-
"bg-gradient-to-t from-agg-secondary to-transparent",
|
|
259
|
-
"sm:hidden transition-opacity",
|
|
260
|
-
showBottomGradient ? "opacity-100" : "opacity-0"
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
)
|
|
264
|
-
] }),
|
|
265
|
-
/* @__PURE__ */ jsx3(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
|
|
266
|
-
] });
|
|
267
|
-
};
|
|
268
|
-
HowItWorksStep.displayName = "HowItWorksStep";
|
|
269
|
-
|
|
270
|
-
// src/onboarding/steps/profile-setup.tsx
|
|
271
|
-
import { useCallback as useCallback2, useRef as useRef2, useState as useState2 } from "react";
|
|
272
|
-
import { useLabels as useLabels4 } from "@agg-build/hooks";
|
|
273
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
274
|
-
var ProfileSetupStep = ({ onContinue }) => {
|
|
275
|
-
const labels = useLabels4();
|
|
276
|
-
const [username, setUsername] = useState2("");
|
|
277
|
-
const [avatarFile, setAvatarFile] = useState2();
|
|
278
|
-
const [avatarPreview, setAvatarPreview] = useState2();
|
|
279
|
-
const fileInputRef = useRef2(null);
|
|
280
|
-
const handleAvatarClick = useCallback2(() => {
|
|
281
|
-
var _a;
|
|
282
|
-
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
283
|
-
}, []);
|
|
284
|
-
const handleFileChange = useCallback2((e) => {
|
|
285
|
-
var _a;
|
|
286
|
-
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
287
|
-
if (!file) return;
|
|
288
|
-
setAvatarFile(file);
|
|
289
|
-
const reader = new FileReader();
|
|
290
|
-
reader.onload = (event) => {
|
|
291
|
-
var _a2;
|
|
292
|
-
setAvatarPreview((_a2 = event.target) == null ? void 0 : _a2.result);
|
|
293
|
-
};
|
|
294
|
-
reader.readAsDataURL(file);
|
|
295
|
-
}, []);
|
|
296
|
-
const handleContinue = useCallback2(() => {
|
|
297
|
-
onContinue({
|
|
298
|
-
username,
|
|
299
|
-
avatarFile,
|
|
300
|
-
avatarPreview
|
|
301
|
-
});
|
|
302
|
-
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
303
|
-
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-7", children: [
|
|
304
|
-
/* @__PURE__ */ jsx4("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
305
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
306
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex justify-center", children: [
|
|
307
|
-
/* @__PURE__ */ jsxs4(
|
|
308
|
-
"button",
|
|
309
|
-
{
|
|
310
|
-
type: "button",
|
|
311
|
-
onClick: handleAvatarClick,
|
|
312
|
-
className: cn(
|
|
313
|
-
"group relative flex items-center justify-center",
|
|
314
|
-
"h-[80px] w-[80px]",
|
|
315
|
-
"rounded-agg-full",
|
|
316
|
-
"bg-agg-secondary-hover",
|
|
317
|
-
!avatarPreview && "hover:bg-agg-tertiary",
|
|
318
|
-
"transition-colors cursor-pointer",
|
|
319
|
-
"overflow-hidden"
|
|
320
|
-
),
|
|
321
|
-
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
322
|
-
children: [
|
|
323
|
-
!avatarPreview ? /* @__PURE__ */ jsx4(
|
|
324
|
-
"svg",
|
|
325
|
-
{
|
|
326
|
-
"aria-hidden": true,
|
|
327
|
-
viewBox: "0 0 80 80",
|
|
328
|
-
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
329
|
-
children: /* @__PURE__ */ jsx4(
|
|
330
|
-
"circle",
|
|
331
|
-
{
|
|
332
|
-
cx: "40",
|
|
333
|
-
cy: "40",
|
|
334
|
-
r: "39.5",
|
|
335
|
-
fill: "none",
|
|
336
|
-
stroke: "currentColor",
|
|
337
|
-
strokeWidth: "1",
|
|
338
|
-
strokeDasharray: "8 8"
|
|
339
|
-
}
|
|
340
|
-
)
|
|
341
|
-
}
|
|
342
|
-
) : null,
|
|
343
|
-
avatarPreview ? /* @__PURE__ */ jsx4(
|
|
344
|
-
RemoteImage,
|
|
345
|
-
{
|
|
346
|
-
src: avatarPreview,
|
|
347
|
-
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
348
|
-
className: "h-full w-full object-cover"
|
|
349
|
-
}
|
|
350
|
-
) : /* @__PURE__ */ jsx4(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
),
|
|
354
|
-
/* @__PURE__ */ jsx4(
|
|
355
|
-
"input",
|
|
356
|
-
{
|
|
357
|
-
ref: fileInputRef,
|
|
358
|
-
type: "file",
|
|
359
|
-
accept: "image/*",
|
|
360
|
-
onChange: handleFileChange,
|
|
361
|
-
className: "hidden",
|
|
362
|
-
"aria-hidden": "true"
|
|
363
|
-
}
|
|
364
|
-
)
|
|
365
|
-
] }),
|
|
366
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
367
|
-
/* @__PURE__ */ jsx4(
|
|
368
|
-
"label",
|
|
369
|
-
{
|
|
370
|
-
htmlFor: "onboarding-username",
|
|
371
|
-
className: "text-agg-sm font-agg-bold text-agg-foreground",
|
|
372
|
-
children: labels.onboarding.profileSetup.usernameLabel
|
|
373
|
-
}
|
|
374
|
-
),
|
|
375
|
-
/* @__PURE__ */ jsx4(
|
|
376
|
-
"input",
|
|
377
|
-
{
|
|
378
|
-
id: "onboarding-username",
|
|
379
|
-
type: "text",
|
|
380
|
-
value: username,
|
|
381
|
-
onChange: (e) => setUsername(e.target.value),
|
|
382
|
-
placeholder: labels.onboarding.profileSetup.usernamePlaceholder,
|
|
383
|
-
className: cn(
|
|
384
|
-
"w-full px-3 py-2.5",
|
|
385
|
-
"rounded-[4px]",
|
|
386
|
-
"border border-agg-separator",
|
|
387
|
-
"bg-agg-secondary text-agg-foreground",
|
|
388
|
-
"placeholder:text-agg-muted-foreground",
|
|
389
|
-
"outline-none",
|
|
390
|
-
"hover:bg-agg-secondary-hover",
|
|
391
|
-
"focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
|
|
392
|
-
"transition-colors",
|
|
393
|
-
"text-agg-sm sm:text-agg-base"
|
|
394
|
-
)
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
] })
|
|
398
|
-
] }),
|
|
399
|
-
/* @__PURE__ */ jsx4(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
400
|
-
] });
|
|
401
|
-
};
|
|
402
|
-
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
403
|
-
|
|
404
|
-
// src/onboarding/steps/connect-accounts.tsx
|
|
405
|
-
import { useLabels as useLabels5 } from "@agg-build/hooks";
|
|
406
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
407
|
-
var OnchainVenueLogos = () => {
|
|
408
|
-
return /* @__PURE__ */ jsx5("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsx5("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ jsx5(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
409
|
-
};
|
|
410
|
-
var VenueCard = ({
|
|
411
|
-
logos,
|
|
412
|
-
title,
|
|
413
|
-
mobileTitle,
|
|
414
|
-
description,
|
|
415
|
-
mobileDescription,
|
|
416
|
-
onConnect,
|
|
417
|
-
connected = false
|
|
418
|
-
}) => {
|
|
419
|
-
const labels = useLabels5();
|
|
420
|
-
const action = connected ? /* @__PURE__ */ jsx5(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx5(
|
|
421
|
-
Button,
|
|
422
|
-
{
|
|
423
|
-
variant: "tertiary",
|
|
424
|
-
size: "large",
|
|
425
|
-
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
426
|
-
onClick: onConnect,
|
|
427
|
-
children: labels.onboarding.connectAccounts.connect
|
|
428
|
-
}
|
|
429
|
-
);
|
|
430
|
-
const mobileAction = connected ? /* @__PURE__ */ jsx5(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx5(
|
|
431
|
-
Button,
|
|
432
|
-
{
|
|
433
|
-
variant: "tertiary",
|
|
434
|
-
size: "medium",
|
|
435
|
-
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
436
|
-
onClick: onConnect,
|
|
437
|
-
suffix: /* @__PURE__ */ jsx5(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
438
|
-
children: labels.onboarding.connectAccounts.connectAccount
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
return /* @__PURE__ */ jsxs5(
|
|
442
|
-
"div",
|
|
443
|
-
{
|
|
444
|
-
className: cn(
|
|
445
|
-
"rounded-agg-md p-5 transition-colors",
|
|
446
|
-
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
447
|
-
),
|
|
448
|
-
children: [
|
|
449
|
-
/* @__PURE__ */ jsxs5("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
450
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-5", children: [
|
|
451
|
-
/* @__PURE__ */ jsx5("div", { className: "shrink-0", children: logos }),
|
|
452
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-[2px]", children: [
|
|
453
|
-
/* @__PURE__ */ jsx5("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title }),
|
|
454
|
-
/* @__PURE__ */ jsx5("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
455
|
-
] })
|
|
456
|
-
] }),
|
|
457
|
-
/* @__PURE__ */ jsx5("div", { className: "shrink-0", children: action })
|
|
458
|
-
] }),
|
|
459
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
460
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-3", children: [
|
|
461
|
-
/* @__PURE__ */ jsx5("div", { className: "shrink-0", children: logos }),
|
|
462
|
-
/* @__PURE__ */ jsx5("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title })
|
|
463
|
-
] }),
|
|
464
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-start gap-2", children: [
|
|
465
|
-
/* @__PURE__ */ jsx5("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
466
|
-
mobileAction
|
|
467
|
-
] })
|
|
468
|
-
] })
|
|
469
|
-
]
|
|
470
|
-
}
|
|
471
|
-
);
|
|
472
|
-
};
|
|
473
|
-
var ConnectAccountsStep = ({
|
|
474
|
-
onConnectOnchain,
|
|
475
|
-
onContinue,
|
|
476
|
-
connectedOnchain = false
|
|
477
|
-
}) => {
|
|
478
|
-
const labels = useLabels5();
|
|
479
|
-
const canContinue = connectedOnchain;
|
|
480
|
-
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-6", children: [
|
|
481
|
-
/* @__PURE__ */ jsx5("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
482
|
-
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsx5(
|
|
483
|
-
VenueCard,
|
|
484
|
-
{
|
|
485
|
-
logos: /* @__PURE__ */ jsx5(OnchainVenueLogos, {}),
|
|
486
|
-
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
487
|
-
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
488
|
-
ONCHAIN_VENUES.length - 1
|
|
489
|
-
),
|
|
490
|
-
description: labels.onboarding.connectAccounts.onchainDescription,
|
|
491
|
-
mobileDescription: labels.onboarding.connectAccounts.onchainMobileDescription,
|
|
492
|
-
onConnect: onConnectOnchain,
|
|
493
|
-
connected: connectedOnchain
|
|
494
|
-
}
|
|
495
|
-
) }),
|
|
496
|
-
/* @__PURE__ */ jsx5(
|
|
497
|
-
Button,
|
|
498
|
-
{
|
|
499
|
-
variant: "primary",
|
|
500
|
-
size: "large",
|
|
501
|
-
className: "w-full",
|
|
502
|
-
onClick: onContinue,
|
|
503
|
-
disabled: !canContinue,
|
|
504
|
-
children: labels.onboarding.connectAccounts.continue
|
|
505
|
-
}
|
|
506
|
-
)
|
|
507
|
-
] });
|
|
508
|
-
};
|
|
509
|
-
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
510
|
-
|
|
511
|
-
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
512
|
-
import { useCallback as useCallback3, useState as useState3 } from "react";
|
|
513
|
-
import { useLabels as useLabels6 } from "@agg-build/hooks";
|
|
514
|
-
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
515
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
516
|
-
var ConnectOnchainModal = ({
|
|
517
|
-
open,
|
|
518
|
-
onOpenChange,
|
|
519
|
-
onConnect
|
|
520
|
-
}) => {
|
|
521
|
-
const labels = useLabels6();
|
|
522
|
-
const [connecting, setConnecting] = useState3(false);
|
|
523
|
-
const [error, setError] = useState3();
|
|
524
|
-
const handleCancel = useCallback3(() => {
|
|
525
|
-
onOpenChange(false);
|
|
526
|
-
}, [onOpenChange]);
|
|
527
|
-
const handleConnect = useCallback3(() => __async(null, null, function* () {
|
|
528
|
-
if (connecting) return;
|
|
529
|
-
setConnecting(true);
|
|
530
|
-
setError(void 0);
|
|
531
|
-
try {
|
|
532
|
-
yield onConnect();
|
|
533
|
-
onOpenChange(false);
|
|
534
|
-
} catch (err) {
|
|
535
|
-
setError(
|
|
536
|
-
err instanceof Error ? err.message : labels.onboarding.connectOnchainModal.fallbackError
|
|
537
|
-
);
|
|
538
|
-
} finally {
|
|
539
|
-
setConnecting(false);
|
|
540
|
-
}
|
|
541
|
-
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
542
|
-
const handleOpenChange = useCallback3(
|
|
543
|
-
(value) => {
|
|
544
|
-
if (value) {
|
|
545
|
-
setError(void 0);
|
|
546
|
-
setConnecting(false);
|
|
547
|
-
}
|
|
548
|
-
onOpenChange(value);
|
|
549
|
-
},
|
|
550
|
-
[onOpenChange]
|
|
551
|
-
);
|
|
552
|
-
return /* @__PURE__ */ jsx6(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs6(
|
|
553
|
-
Modal.Container,
|
|
554
|
-
{
|
|
555
|
-
maxWidth: "600px",
|
|
556
|
-
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
557
|
-
classNames: { container: "!rounded-agg-lg" },
|
|
558
|
-
children: [
|
|
559
|
-
/* @__PURE__ */ jsx6(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
560
|
-
/* @__PURE__ */ jsx6(
|
|
561
|
-
Modal.Header,
|
|
562
|
-
{
|
|
563
|
-
hideClose: false,
|
|
564
|
-
hideBorder: true,
|
|
565
|
-
classNames: {
|
|
566
|
-
root: "!min-h-0",
|
|
567
|
-
container: "!py-[18px] !px-8"
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
),
|
|
571
|
-
/* @__PURE__ */ jsx6(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
572
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
573
|
-
/* @__PURE__ */ jsx6("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
574
|
-
/* @__PURE__ */ jsx6("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
575
|
-
] }),
|
|
576
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
577
|
-
/* @__PURE__ */ jsx6("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
578
|
-
/* @__PURE__ */ jsx6("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-[6px]", children: [
|
|
579
|
-
index > 0 && /* @__PURE__ */ jsx6("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
580
|
-
/* @__PURE__ */ jsx6(VenueLogo, { venue, size: "medium" }),
|
|
581
|
-
/* @__PURE__ */ jsx6("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
582
|
-
] }, venue)) })
|
|
583
|
-
] }),
|
|
584
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
585
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
586
|
-
error ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
587
|
-
/* @__PURE__ */ jsx6(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
588
|
-
/* @__PURE__ */ jsx6("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
589
|
-
] }) : null,
|
|
590
|
-
/* @__PURE__ */ jsx6(
|
|
591
|
-
Button,
|
|
592
|
-
{
|
|
593
|
-
variant: "primary",
|
|
594
|
-
size: "large",
|
|
595
|
-
onClick: handleConnect,
|
|
596
|
-
isLoading: connecting,
|
|
597
|
-
children: labels.onboarding.connectOnchainModal.connect
|
|
598
|
-
}
|
|
599
|
-
)
|
|
600
|
-
] }),
|
|
601
|
-
/* @__PURE__ */ jsx6(
|
|
602
|
-
Button,
|
|
603
|
-
{
|
|
604
|
-
variant: "tertiary",
|
|
605
|
-
size: "medium",
|
|
606
|
-
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
607
|
-
onClick: handleCancel,
|
|
608
|
-
children: labels.onboarding.connectOnchainModal.cancel
|
|
609
|
-
}
|
|
610
|
-
)
|
|
611
|
-
] })
|
|
612
|
-
] }) })
|
|
613
|
-
]
|
|
614
|
-
}
|
|
615
|
-
) });
|
|
616
|
-
};
|
|
617
|
-
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
618
|
-
|
|
619
|
-
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
620
|
-
import { getVenueAvailabilityState, useAppConfig, useLabels as useLabels7 } from "@agg-build/hooks";
|
|
621
|
-
import { Venue as Venue2 } from "@agg-build/sdk";
|
|
622
|
-
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
623
|
-
import { useCallback as useCallback4, useEffect, useId, useMemo, useRef as useRef3, useState as useState4 } from "react";
|
|
624
|
-
import { z } from "zod";
|
|
625
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
626
|
-
var kalshiCredentialsSchema = z.object({
|
|
627
|
-
apiKeyId: z.string().trim().min(1),
|
|
628
|
-
privateKey: z.string().trim().min(1)
|
|
629
|
-
});
|
|
630
|
-
var getSafeConnectionError = ({
|
|
631
|
-
apiKeyId,
|
|
632
|
-
error,
|
|
633
|
-
fallback,
|
|
634
|
-
privateKey
|
|
635
|
-
}) => {
|
|
636
|
-
if (!(error instanceof Error) || !error.message.trim()) return fallback;
|
|
637
|
-
return [apiKeyId, privateKey].filter(Boolean).reduce(
|
|
638
|
-
(message, sensitiveValue) => message.split(sensitiveValue).join("[redacted]"),
|
|
639
|
-
error.message
|
|
640
|
-
).trim();
|
|
641
|
-
};
|
|
642
|
-
var CloseButton = ({
|
|
643
|
-
className,
|
|
644
|
-
disabled
|
|
645
|
-
}) => {
|
|
646
|
-
const labels = useLabels7();
|
|
647
|
-
return /* @__PURE__ */ jsx7(
|
|
648
|
-
Dialog3.Close,
|
|
649
|
-
{
|
|
650
|
-
"aria-label": labels.common.close,
|
|
651
|
-
disabled,
|
|
652
|
-
className: cn(
|
|
653
|
-
"z-30 flex size-6 cursor-pointer items-center justify-center rounded-agg-full",
|
|
654
|
-
"text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
655
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent",
|
|
656
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
657
|
-
className
|
|
658
|
-
),
|
|
659
|
-
children: /* @__PURE__ */ jsx7(Icon, { name: "close", size: "medium", className: "!text-agg-foreground" })
|
|
660
|
-
}
|
|
661
|
-
);
|
|
662
|
-
};
|
|
663
|
-
var ConnectKalshiModal = ({
|
|
664
|
-
open,
|
|
665
|
-
onOpenChange,
|
|
666
|
-
onVerify
|
|
667
|
-
}) => {
|
|
668
|
-
const labels = useLabels7();
|
|
669
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig();
|
|
670
|
-
const apiKeyInputRef = useRef3(null);
|
|
671
|
-
const errorId = useId();
|
|
672
|
-
const [apiKeyId, setApiKeyId] = useState4("");
|
|
673
|
-
const [privateKey, setPrivateKey] = useState4("");
|
|
674
|
-
const [isVerifying, setIsVerifying] = useState4(false);
|
|
675
|
-
const [isConnected, setIsConnected] = useState4(false);
|
|
676
|
-
const [error, setError] = useState4();
|
|
677
|
-
const availabilityState = getVenueAvailabilityState({
|
|
678
|
-
venueId: Venue2.kalshi,
|
|
679
|
-
disabledVenues,
|
|
680
|
-
isConfigLoading: isAppConfigLoading
|
|
681
|
-
});
|
|
682
|
-
const parsedCredentials = useMemo(
|
|
683
|
-
() => kalshiCredentialsSchema.safeParse({ apiKeyId, privateKey }),
|
|
684
|
-
[apiKeyId, privateKey]
|
|
685
|
-
);
|
|
686
|
-
useEffect(() => {
|
|
687
|
-
if (!open) return;
|
|
688
|
-
setApiKeyId("");
|
|
689
|
-
setPrivateKey("");
|
|
690
|
-
setError(void 0);
|
|
691
|
-
setIsVerifying(false);
|
|
692
|
-
setIsConnected(false);
|
|
693
|
-
}, [open]);
|
|
694
|
-
const handleOpenAutoFocus = useCallback4((event) => {
|
|
695
|
-
var _a;
|
|
696
|
-
event.preventDefault();
|
|
697
|
-
(_a = apiKeyInputRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
698
|
-
}, []);
|
|
699
|
-
const handleOpenChange = useCallback4(
|
|
700
|
-
(nextOpen) => {
|
|
701
|
-
if (isVerifying && !nextOpen) return;
|
|
702
|
-
onOpenChange(nextOpen);
|
|
703
|
-
},
|
|
704
|
-
[isVerifying, onOpenChange]
|
|
705
|
-
);
|
|
706
|
-
const handleVerify = useCallback4(() => __async(null, null, function* () {
|
|
707
|
-
if (!parsedCredentials.success || isVerifying || isConnected) return;
|
|
708
|
-
const credentials = parsedCredentials.data;
|
|
709
|
-
setIsVerifying(true);
|
|
710
|
-
setError(void 0);
|
|
711
|
-
try {
|
|
712
|
-
yield onVerify(credentials);
|
|
713
|
-
setApiKeyId("");
|
|
714
|
-
setPrivateKey("");
|
|
715
|
-
setIsConnected(true);
|
|
716
|
-
} catch (verificationError) {
|
|
717
|
-
setError(
|
|
718
|
-
getSafeConnectionError(__spreadProps(__spreadValues({}, credentials), {
|
|
719
|
-
error: verificationError,
|
|
720
|
-
fallback: labels.onboarding.connectKalshiModal.fallbackError
|
|
721
|
-
}))
|
|
722
|
-
);
|
|
723
|
-
} finally {
|
|
724
|
-
setIsVerifying(false);
|
|
725
|
-
}
|
|
726
|
-
}), [
|
|
727
|
-
isConnected,
|
|
728
|
-
isVerifying,
|
|
729
|
-
labels.onboarding.connectKalshiModal.fallbackError,
|
|
730
|
-
onVerify,
|
|
731
|
-
parsedCredentials
|
|
732
|
-
]);
|
|
733
|
-
const handleSubmit = useCallback4(
|
|
734
|
-
(event) => {
|
|
735
|
-
event.preventDefault();
|
|
736
|
-
void handleVerify();
|
|
737
|
-
},
|
|
738
|
-
[handleVerify]
|
|
739
|
-
);
|
|
740
|
-
if (availabilityState === "hidden") return null;
|
|
741
|
-
return /* @__PURE__ */ jsx7(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx7(
|
|
742
|
-
Modal.Container,
|
|
743
|
-
{
|
|
744
|
-
maxWidth: isConnected ? "480px" : "600px",
|
|
745
|
-
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
746
|
-
classNames: {
|
|
747
|
-
container: "!rounded-t-agg-xl !rounded-b-none md:!rounded-agg-2xl"
|
|
748
|
-
},
|
|
749
|
-
onOpenAutoFocus: isConnected ? void 0 : handleOpenAutoFocus,
|
|
750
|
-
children: isConnected ? /* @__PURE__ */ jsxs7(Modal.Body, { classNames: { root: "relative !px-5 !py-8 md:!px-10 md:!py-12" }, children: [
|
|
751
|
-
/* @__PURE__ */ jsx7(CloseButton, { className: "absolute right-5 top-5 md:right-8 md:top-8" }),
|
|
752
|
-
/* @__PURE__ */ jsxs7(
|
|
753
|
-
"div",
|
|
754
|
-
{
|
|
755
|
-
className: "flex flex-col items-center gap-8 text-center",
|
|
756
|
-
role: "status",
|
|
757
|
-
"aria-live": "polite",
|
|
758
|
-
children: [
|
|
759
|
-
/* @__PURE__ */ jsx7("div", { className: "flex size-[60px] items-center justify-center rounded-agg-full bg-agg-success/15", children: /* @__PURE__ */ jsx7(Icon, { name: "success-check", className: "size-6 text-agg-success", "aria-hidden": "true" }) }),
|
|
760
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-3", children: [
|
|
761
|
-
/* @__PURE__ */ jsx7(Dialog3.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.title }),
|
|
762
|
-
/* @__PURE__ */ jsx7(Dialog3.Description, { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.description })
|
|
763
|
-
] }),
|
|
764
|
-
/* @__PURE__ */ jsx7(Button, { variant: "secondary", size: "large", onClick: () => handleOpenChange(false), children: labels.onboarding.connectKalshiModal.success.done })
|
|
765
|
-
]
|
|
766
|
-
}
|
|
767
|
-
)
|
|
768
|
-
] }) : /* @__PURE__ */ jsxs7("form", { className: "flex min-h-0 flex-1 flex-col", onSubmit: handleSubmit, children: [
|
|
769
|
-
/* @__PURE__ */ jsx7(
|
|
770
|
-
Modal.Body,
|
|
771
|
-
{
|
|
772
|
-
classNames: { root: "relative !px-5 !pb-6 !pt-5 md:!px-10 md:!pb-0 md:!pt-12" },
|
|
773
|
-
children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-6 md:items-center md:gap-0", children: [
|
|
774
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex w-full flex-col md:contents", children: [
|
|
775
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3 md:contents", children: [
|
|
776
|
-
/* @__PURE__ */ jsx7(
|
|
777
|
-
VenueLogo,
|
|
778
|
-
{
|
|
779
|
-
venue: Venue2.kalshi,
|
|
780
|
-
variant: "logo",
|
|
781
|
-
size: "large",
|
|
782
|
-
className: "!size-10 md:!mb-8 md:!size-[60px]"
|
|
783
|
-
}
|
|
784
|
-
),
|
|
785
|
-
/* @__PURE__ */ jsx7(Dialog3.Title, { className: "text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground md:mb-4 md:text-center md:text-agg-2xl md:leading-agg-8", children: labels.onboarding.connectKalshiModal.title }),
|
|
786
|
-
/* @__PURE__ */ jsx7(
|
|
787
|
-
CloseButton,
|
|
788
|
-
{
|
|
789
|
-
disabled: isVerifying,
|
|
790
|
-
className: "ml-auto shrink-0 md:absolute md:right-8 md:top-8 md:ml-0"
|
|
791
|
-
}
|
|
792
|
-
)
|
|
793
|
-
] }),
|
|
794
|
-
/* @__PURE__ */ jsx7(Dialog3.Description, { className: "mt-3 text-agg-sm leading-agg-5 text-agg-foreground md:mb-8 md:mt-0 md:text-center md:text-agg-base md:leading-agg-6", children: labels.onboarding.connectKalshiModal.description })
|
|
795
|
-
] }),
|
|
796
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex w-full flex-col gap-4", children: [
|
|
797
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
798
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", children: [
|
|
799
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
800
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
801
|
-
] }),
|
|
802
|
-
/* @__PURE__ */ jsxs7("div", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
803
|
-
/* @__PURE__ */ jsx7("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
804
|
-
/* @__PURE__ */ jsxs7("p", { children: [
|
|
805
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
806
|
-
" ",
|
|
807
|
-
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
808
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
809
|
-
" ",
|
|
810
|
-
/* @__PURE__ */ jsx7(
|
|
811
|
-
"a",
|
|
812
|
-
{
|
|
813
|
-
href: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl,
|
|
814
|
-
target: "_blank",
|
|
815
|
-
rel: "noreferrer",
|
|
816
|
-
className: "cursor-pointer underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
817
|
-
children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl
|
|
818
|
-
}
|
|
819
|
-
)
|
|
820
|
-
] }),
|
|
821
|
-
/* @__PURE__ */ jsxs7("p", { children: [
|
|
822
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
823
|
-
" ",
|
|
824
|
-
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
825
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
826
|
-
] }),
|
|
827
|
-
/* @__PURE__ */ jsxs7("p", { children: [
|
|
828
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
829
|
-
" ",
|
|
830
|
-
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
831
|
-
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
832
|
-
] }),
|
|
833
|
-
/* @__PURE__ */ jsx7("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
834
|
-
] }),
|
|
835
|
-
/* @__PURE__ */ jsxs7("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
836
|
-
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
837
|
-
/* @__PURE__ */ jsx7("br", {}),
|
|
838
|
-
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
839
|
-
] })
|
|
840
|
-
] }),
|
|
841
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
842
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", children: [
|
|
843
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
844
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
845
|
-
] }),
|
|
846
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
847
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
|
|
848
|
-
/* @__PURE__ */ jsx7(
|
|
849
|
-
"label",
|
|
850
|
-
{
|
|
851
|
-
htmlFor: "kalshi-api-key-id",
|
|
852
|
-
className: "text-agg-sm font-agg-bold text-agg-foreground",
|
|
853
|
-
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
854
|
-
}
|
|
855
|
-
),
|
|
856
|
-
/* @__PURE__ */ jsx7(
|
|
857
|
-
"input",
|
|
858
|
-
{
|
|
859
|
-
ref: apiKeyInputRef,
|
|
860
|
-
id: "kalshi-api-key-id",
|
|
861
|
-
type: "text",
|
|
862
|
-
autoComplete: "off",
|
|
863
|
-
value: apiKeyId,
|
|
864
|
-
onChange: (event) => setApiKeyId(event.target.value),
|
|
865
|
-
placeholder: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdPlaceholder,
|
|
866
|
-
disabled: isVerifying,
|
|
867
|
-
"aria-invalid": !!error,
|
|
868
|
-
"aria-describedby": error ? errorId : void 0,
|
|
869
|
-
className: cn(
|
|
870
|
-
"h-10 w-full rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5",
|
|
871
|
-
"text-agg-base text-agg-foreground placeholder:text-agg-muted-foreground",
|
|
872
|
-
"outline-none transition-colors focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
|
|
873
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
874
|
-
)
|
|
875
|
-
}
|
|
876
|
-
)
|
|
877
|
-
] }),
|
|
878
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
|
|
879
|
-
/* @__PURE__ */ jsx7(
|
|
880
|
-
"label",
|
|
881
|
-
{
|
|
882
|
-
htmlFor: "kalshi-private-key",
|
|
883
|
-
className: "text-agg-sm font-agg-bold text-agg-foreground",
|
|
884
|
-
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
885
|
-
}
|
|
886
|
-
),
|
|
887
|
-
/* @__PURE__ */ jsx7(
|
|
888
|
-
"textarea",
|
|
889
|
-
{
|
|
890
|
-
id: "kalshi-private-key",
|
|
891
|
-
autoComplete: "off",
|
|
892
|
-
value: privateKey,
|
|
893
|
-
onChange: (event) => setPrivateKey(event.target.value),
|
|
894
|
-
placeholder: labels.onboarding.connectKalshiModal.stepTwo.privateKeyPlaceholder,
|
|
895
|
-
rows: 3,
|
|
896
|
-
disabled: isVerifying,
|
|
897
|
-
"aria-invalid": !!error,
|
|
898
|
-
"aria-describedby": error ? errorId : void 0,
|
|
899
|
-
className: cn(
|
|
900
|
-
"w-full resize-none rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5",
|
|
901
|
-
"text-agg-base text-agg-foreground placeholder:text-agg-muted-foreground",
|
|
902
|
-
"outline-none transition-colors focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
|
|
903
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
904
|
-
)
|
|
905
|
-
}
|
|
906
|
-
)
|
|
907
|
-
] })
|
|
908
|
-
] })
|
|
909
|
-
] }),
|
|
910
|
-
error ? /* @__PURE__ */ jsxs7(
|
|
911
|
-
"div",
|
|
912
|
-
{
|
|
913
|
-
id: errorId,
|
|
914
|
-
className: "flex items-center gap-2 md:justify-center",
|
|
915
|
-
role: "alert",
|
|
916
|
-
"aria-live": "assertive",
|
|
917
|
-
children: [
|
|
918
|
-
/* @__PURE__ */ jsx7(Icon, { name: "warning", size: "small", className: "size-3.5 text-agg-error" }),
|
|
919
|
-
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
920
|
-
]
|
|
921
|
-
}
|
|
922
|
-
) : null
|
|
923
|
-
] })
|
|
924
|
-
}
|
|
925
|
-
),
|
|
926
|
-
/* @__PURE__ */ jsxs7(
|
|
927
|
-
Modal.Footer,
|
|
928
|
-
{
|
|
929
|
-
classNames: {
|
|
930
|
-
root: "relative !h-auto !gap-3 !p-4 md:!justify-center md:!border-0 md:!px-10 md:!pb-12 md:!pt-8"
|
|
931
|
-
},
|
|
932
|
-
children: [
|
|
933
|
-
/* @__PURE__ */ jsx7(
|
|
934
|
-
"div",
|
|
935
|
-
{
|
|
936
|
-
"aria-hidden": "true",
|
|
937
|
-
className: "pointer-events-none absolute inset-x-0 -top-[60px] h-[60px] bg-gradient-to-b from-transparent to-agg-secondary md:hidden"
|
|
938
|
-
}
|
|
939
|
-
),
|
|
940
|
-
/* @__PURE__ */ jsx7(
|
|
941
|
-
Button,
|
|
942
|
-
{
|
|
943
|
-
variant: "secondary",
|
|
944
|
-
size: "large",
|
|
945
|
-
className: "shrink-0",
|
|
946
|
-
onClick: () => handleOpenChange(false),
|
|
947
|
-
disabled: isVerifying,
|
|
948
|
-
children: labels.onboarding.connectKalshiModal.actions.cancel
|
|
949
|
-
}
|
|
950
|
-
),
|
|
951
|
-
/* @__PURE__ */ jsx7(
|
|
952
|
-
Button,
|
|
953
|
-
{
|
|
954
|
-
type: "submit",
|
|
955
|
-
variant: "primary",
|
|
956
|
-
size: "large",
|
|
957
|
-
className: "flex-1 md:flex-none",
|
|
958
|
-
disabled: !parsedCredentials.success || isVerifying,
|
|
959
|
-
isLoading: isVerifying,
|
|
960
|
-
children: labels.onboarding.connectKalshiModal.actions.verifyConnection
|
|
961
|
-
}
|
|
962
|
-
)
|
|
963
|
-
]
|
|
964
|
-
}
|
|
965
|
-
)
|
|
966
|
-
] })
|
|
967
|
-
}
|
|
968
|
-
) });
|
|
969
|
-
};
|
|
970
|
-
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
971
|
-
|
|
972
|
-
// src/onboarding/steps/connect-prophetx-modal.tsx
|
|
973
|
-
import { useAppConfig as useAppConfig2, useLabels as useLabels8 } from "@agg-build/hooks";
|
|
974
|
-
import { Venue as Venue3 } from "@agg-build/sdk";
|
|
975
|
-
import * as Dialog4 from "@radix-ui/react-dialog";
|
|
976
|
-
import { useEffect as useEffect2, useId as useId2, useState as useState5 } from "react";
|
|
977
|
-
import { Fragment, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
978
|
-
function ConnectProphetxModal({
|
|
979
|
-
open,
|
|
980
|
-
onOpenChange,
|
|
981
|
-
onVerify,
|
|
982
|
-
onDisconnect,
|
|
983
|
-
allowExistingConnection = false
|
|
984
|
-
}) {
|
|
985
|
-
const copy = useLabels8().onboarding.connectProphetxModal;
|
|
986
|
-
const common = useLabels8().common;
|
|
987
|
-
const { prophetxExecutionMode, disabledVenues, isLoading } = useAppConfig2();
|
|
988
|
-
const id = useId2();
|
|
989
|
-
const [accessKey, setAccessKey] = useState5("");
|
|
990
|
-
const [secretKey, setSecretKey] = useState5("");
|
|
991
|
-
const [pending, setPending] = useState5(false);
|
|
992
|
-
const [disconnecting, setDisconnecting] = useState5(false);
|
|
993
|
-
const [disconnectError, setDisconnectError] = useState5(false);
|
|
994
|
-
const busy = pending || disconnecting;
|
|
995
|
-
const [connected, setConnected] = useState5(false);
|
|
996
|
-
const [error, setError] = useState5(false);
|
|
997
|
-
useEffect2(() => {
|
|
998
|
-
if (!open) {
|
|
999
|
-
setAccessKey("");
|
|
1000
|
-
setSecretKey("");
|
|
1001
|
-
setError(false);
|
|
1002
|
-
setDisconnectError(false);
|
|
1003
|
-
setConnected(false);
|
|
1004
|
-
}
|
|
1005
|
-
}, [open]);
|
|
1006
|
-
if (isLoading || !allowExistingConnection && (prophetxExecutionMode !== "direct" || disabledVenues.includes(Venue3.prophetx)))
|
|
1007
|
-
return null;
|
|
1008
|
-
return /* @__PURE__ */ jsx8(
|
|
1009
|
-
Modal,
|
|
1010
|
-
{
|
|
1011
|
-
open,
|
|
1012
|
-
onOpenChange: (value) => {
|
|
1013
|
-
if (!busy) onOpenChange(value);
|
|
1014
|
-
},
|
|
1015
|
-
children: /* @__PURE__ */ jsx8(Modal.Container, { maxWidth: "480px", "aria-label": copy.title, children: /* @__PURE__ */ jsxs8(Modal.Body, { classNames: { root: "relative !p-6" }, children: [
|
|
1016
|
-
/* @__PURE__ */ jsx8(
|
|
1017
|
-
Dialog4.Close,
|
|
1018
|
-
{
|
|
1019
|
-
"aria-label": common.close,
|
|
1020
|
-
disabled: busy,
|
|
1021
|
-
className: "absolute right-4 top-4 cursor-pointer disabled:cursor-not-allowed",
|
|
1022
|
-
children: /* @__PURE__ */ jsx8(Icon, { name: "close", size: "medium" })
|
|
1023
|
-
}
|
|
1024
|
-
),
|
|
1025
|
-
/* @__PURE__ */ jsxs8(
|
|
1026
|
-
"form",
|
|
1027
|
-
{
|
|
1028
|
-
className: "flex flex-col gap-4",
|
|
1029
|
-
onSubmit: (event) => __async(null, null, function* () {
|
|
1030
|
-
event.preventDefault();
|
|
1031
|
-
if (busy || !accessKey.trim() || !secretKey.trim()) return;
|
|
1032
|
-
setPending(true);
|
|
1033
|
-
setError(false);
|
|
1034
|
-
try {
|
|
1035
|
-
yield onVerify({ accessKey: accessKey.trim(), secretKey: secretKey.trim() });
|
|
1036
|
-
setAccessKey("");
|
|
1037
|
-
setSecretKey("");
|
|
1038
|
-
setConnected(true);
|
|
1039
|
-
} catch (e) {
|
|
1040
|
-
setError(true);
|
|
1041
|
-
} finally {
|
|
1042
|
-
setPending(false);
|
|
1043
|
-
}
|
|
1044
|
-
}),
|
|
1045
|
-
children: [
|
|
1046
|
-
/* @__PURE__ */ jsx8(VenueLogo, { venue: Venue3.prophetx, size: "large" }),
|
|
1047
|
-
/* @__PURE__ */ jsx8(Dialog4.Title, { className: "text-agg-xl font-agg-bold text-agg-foreground", children: copy.title }),
|
|
1048
|
-
/* @__PURE__ */ jsx8(Dialog4.Description, { className: "text-agg-sm text-agg-muted-foreground", children: copy.description }),
|
|
1049
|
-
/* @__PURE__ */ jsx8("p", { className: "text-agg-sm text-agg-muted-foreground", children: copy.fundingNotice }),
|
|
1050
|
-
connected ? /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1051
|
-
/* @__PURE__ */ jsx8("p", { role: "status", children: copy.connected }),
|
|
1052
|
-
/* @__PURE__ */ jsx8(Button, { type: "button", onClick: () => onOpenChange(false), children: copy.done })
|
|
1053
|
-
] }) : /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1054
|
-
/* @__PURE__ */ jsx8(
|
|
1055
|
-
"a",
|
|
1056
|
-
{
|
|
1057
|
-
className: "text-agg-sm text-agg-primary underline",
|
|
1058
|
-
href: "https://www.prophetx.co",
|
|
1059
|
-
target: "_blank",
|
|
1060
|
-
rel: "noopener noreferrer",
|
|
1061
|
-
children: copy.instructions
|
|
1062
|
-
}
|
|
1063
|
-
),
|
|
1064
|
-
/* @__PURE__ */ jsx8("label", { htmlFor: `${id}-access`, className: "text-agg-sm text-agg-foreground", children: copy.accessKey }),
|
|
1065
|
-
/* @__PURE__ */ jsx8(
|
|
1066
|
-
"input",
|
|
1067
|
-
{
|
|
1068
|
-
id: `${id}-access`,
|
|
1069
|
-
type: "password",
|
|
1070
|
-
autoComplete: "off",
|
|
1071
|
-
spellCheck: false,
|
|
1072
|
-
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1073
|
-
value: accessKey,
|
|
1074
|
-
onChange: (e) => setAccessKey(e.target.value),
|
|
1075
|
-
disabled: busy,
|
|
1076
|
-
required: true
|
|
1077
|
-
}
|
|
1078
|
-
),
|
|
1079
|
-
/* @__PURE__ */ jsx8("label", { htmlFor: `${id}-secret`, className: "text-agg-sm text-agg-foreground", children: copy.secretKey }),
|
|
1080
|
-
/* @__PURE__ */ jsx8(
|
|
1081
|
-
"input",
|
|
1082
|
-
{
|
|
1083
|
-
id: `${id}-secret`,
|
|
1084
|
-
type: "password",
|
|
1085
|
-
autoComplete: "new-password",
|
|
1086
|
-
spellCheck: false,
|
|
1087
|
-
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1088
|
-
value: secretKey,
|
|
1089
|
-
onChange: (e) => setSecretKey(e.target.value),
|
|
1090
|
-
disabled: busy,
|
|
1091
|
-
required: true
|
|
1092
|
-
}
|
|
1093
|
-
),
|
|
1094
|
-
error ? /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.error }) : null,
|
|
1095
|
-
/* @__PURE__ */ jsx8(Button, { type: "submit", disabled: busy || !accessKey.trim() || !secretKey.trim(), children: pending ? copy.verifying : copy.verify })
|
|
1096
|
-
] }),
|
|
1097
|
-
allowExistingConnection && onDisconnect ? /* @__PURE__ */ jsx8(
|
|
1098
|
-
Button,
|
|
1099
|
-
{
|
|
1100
|
-
type: "button",
|
|
1101
|
-
variant: "secondary",
|
|
1102
|
-
disabled: busy,
|
|
1103
|
-
onClick: () => __async(null, null, function* () {
|
|
1104
|
-
setDisconnecting(true);
|
|
1105
|
-
setDisconnectError(false);
|
|
1106
|
-
setError(false);
|
|
1107
|
-
try {
|
|
1108
|
-
yield onDisconnect();
|
|
1109
|
-
setAccessKey("");
|
|
1110
|
-
setSecretKey("");
|
|
1111
|
-
onOpenChange(false);
|
|
1112
|
-
} catch (e) {
|
|
1113
|
-
setDisconnectError(true);
|
|
1114
|
-
} finally {
|
|
1115
|
-
setDisconnecting(false);
|
|
1116
|
-
}
|
|
1117
|
-
}),
|
|
1118
|
-
children: disconnecting ? copy.disconnecting : copy.disconnect
|
|
1119
|
-
}
|
|
1120
|
-
) : null,
|
|
1121
|
-
disconnectError ? /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.disconnectError }) : null
|
|
1122
|
-
]
|
|
1123
|
-
}
|
|
1124
|
-
)
|
|
1125
|
-
] }) })
|
|
1126
|
-
}
|
|
1127
|
-
);
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
// src/onboarding/steps/connect-novig-modal.tsx
|
|
1131
|
-
import { useAppConfig as useAppConfig3, useLabels as useLabels9 } from "@agg-build/hooks";
|
|
1132
|
-
import { Venue as Venue4 } from "@agg-build/sdk";
|
|
1133
|
-
import * as Dialog5 from "@radix-ui/react-dialog";
|
|
1134
|
-
import { useEffect as useEffect3, useId as useId3, useState as useState6 } from "react";
|
|
1135
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1136
|
-
function ConnectNovigModal({
|
|
1137
|
-
open,
|
|
1138
|
-
onOpenChange,
|
|
1139
|
-
onVerify,
|
|
1140
|
-
onDisconnect,
|
|
1141
|
-
allowExistingConnection = false
|
|
1142
|
-
}) {
|
|
1143
|
-
const copy = useLabels9().onboarding.connectNovigModal;
|
|
1144
|
-
const common = useLabels9().common;
|
|
1145
|
-
const { novigExecutionMode, disabledVenues, isLoading } = useAppConfig3();
|
|
1146
|
-
const id = useId3();
|
|
1147
|
-
const [keyId, setKeyId] = useState6("");
|
|
1148
|
-
const [privateKey, setPrivateKey] = useState6("");
|
|
1149
|
-
const [pending, setPending] = useState6(false);
|
|
1150
|
-
const [disconnecting, setDisconnecting] = useState6(false);
|
|
1151
|
-
const [disconnectError, setDisconnectError] = useState6(false);
|
|
1152
|
-
const busy = pending || disconnecting;
|
|
1153
|
-
const [connected, setConnected] = useState6(false);
|
|
1154
|
-
const [error, setError] = useState6(false);
|
|
1155
|
-
useEffect3(() => {
|
|
1156
|
-
if (!open) {
|
|
1157
|
-
setKeyId("");
|
|
1158
|
-
setPrivateKey("");
|
|
1159
|
-
setError(false);
|
|
1160
|
-
setDisconnectError(false);
|
|
1161
|
-
setConnected(false);
|
|
1162
|
-
}
|
|
1163
|
-
}, [open]);
|
|
1164
|
-
if (isLoading || !allowExistingConnection && (novigExecutionMode !== "direct" || disabledVenues.includes(Venue4.novig)))
|
|
1165
|
-
return null;
|
|
1166
|
-
return /* @__PURE__ */ jsx9(
|
|
1167
|
-
Modal,
|
|
1168
|
-
{
|
|
1169
|
-
open,
|
|
1170
|
-
onOpenChange: (value) => {
|
|
1171
|
-
if (!busy) onOpenChange(value);
|
|
1172
|
-
},
|
|
1173
|
-
children: /* @__PURE__ */ jsx9(Modal.Container, { maxWidth: "480px", "aria-label": copy.title, children: /* @__PURE__ */ jsxs9(Modal.Body, { classNames: { root: "relative !p-6" }, children: [
|
|
1174
|
-
/* @__PURE__ */ jsx9(
|
|
1175
|
-
Dialog5.Close,
|
|
1176
|
-
{
|
|
1177
|
-
"aria-label": common.close,
|
|
1178
|
-
disabled: busy,
|
|
1179
|
-
className: "absolute right-4 top-4 cursor-pointer disabled:cursor-not-allowed",
|
|
1180
|
-
children: /* @__PURE__ */ jsx9(Icon, { name: "close", size: "medium" })
|
|
1181
|
-
}
|
|
1182
|
-
),
|
|
1183
|
-
/* @__PURE__ */ jsxs9(
|
|
1184
|
-
"form",
|
|
1185
|
-
{
|
|
1186
|
-
className: "flex flex-col gap-4",
|
|
1187
|
-
onSubmit: (event) => __async(null, null, function* () {
|
|
1188
|
-
event.preventDefault();
|
|
1189
|
-
if (busy || !keyId.trim() || !privateKey.trim()) return;
|
|
1190
|
-
setPending(true);
|
|
1191
|
-
setError(false);
|
|
1192
|
-
try {
|
|
1193
|
-
yield onVerify({ keyId: keyId.trim(), privateKey: privateKey.trim() });
|
|
1194
|
-
setKeyId("");
|
|
1195
|
-
setPrivateKey("");
|
|
1196
|
-
setConnected(true);
|
|
1197
|
-
} catch (e) {
|
|
1198
|
-
setError(true);
|
|
1199
|
-
} finally {
|
|
1200
|
-
setPending(false);
|
|
1201
|
-
}
|
|
1202
|
-
}),
|
|
1203
|
-
children: [
|
|
1204
|
-
/* @__PURE__ */ jsx9(VenueLogo, { venue: Venue4.novig, size: "large" }),
|
|
1205
|
-
/* @__PURE__ */ jsx9(Dialog5.Title, { className: "text-agg-xl font-agg-bold text-agg-foreground", children: copy.title }),
|
|
1206
|
-
/* @__PURE__ */ jsx9(Dialog5.Description, { className: "text-agg-sm text-agg-muted-foreground", children: copy.description }),
|
|
1207
|
-
/* @__PURE__ */ jsx9("p", { className: "text-agg-sm text-agg-muted-foreground", children: copy.fundingNotice }),
|
|
1208
|
-
connected ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1209
|
-
/* @__PURE__ */ jsx9("p", { role: "status", children: copy.connected }),
|
|
1210
|
-
/* @__PURE__ */ jsx9(Button, { type: "button", onClick: () => onOpenChange(false), children: copy.done })
|
|
1211
|
-
] }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1212
|
-
/* @__PURE__ */ jsx9(
|
|
1213
|
-
"a",
|
|
1214
|
-
{
|
|
1215
|
-
className: "text-agg-sm text-agg-primary underline",
|
|
1216
|
-
href: "https://docs.novig.com/api/quickstart",
|
|
1217
|
-
target: "_blank",
|
|
1218
|
-
rel: "noopener noreferrer",
|
|
1219
|
-
children: copy.instructions
|
|
1220
|
-
}
|
|
1221
|
-
),
|
|
1222
|
-
/* @__PURE__ */ jsx9("label", { htmlFor: `${id}-access`, className: "text-agg-sm text-agg-foreground", children: copy.keyId }),
|
|
1223
|
-
/* @__PURE__ */ jsx9(
|
|
1224
|
-
"input",
|
|
1225
|
-
{
|
|
1226
|
-
id: `${id}-access`,
|
|
1227
|
-
type: "password",
|
|
1228
|
-
autoComplete: "off",
|
|
1229
|
-
spellCheck: false,
|
|
1230
|
-
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1231
|
-
value: keyId,
|
|
1232
|
-
onChange: (e) => setKeyId(e.target.value),
|
|
1233
|
-
disabled: busy,
|
|
1234
|
-
required: true
|
|
1235
|
-
}
|
|
1236
|
-
),
|
|
1237
|
-
/* @__PURE__ */ jsx9("label", { htmlFor: `${id}-secret`, className: "text-agg-sm text-agg-foreground", children: copy.privateKey }),
|
|
1238
|
-
/* @__PURE__ */ jsx9(
|
|
1239
|
-
"textarea",
|
|
1240
|
-
{
|
|
1241
|
-
id: `${id}-secret`,
|
|
1242
|
-
rows: 5,
|
|
1243
|
-
autoComplete: "new-password",
|
|
1244
|
-
spellCheck: false,
|
|
1245
|
-
className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
|
|
1246
|
-
value: privateKey,
|
|
1247
|
-
onChange: (e) => setPrivateKey(e.target.value),
|
|
1248
|
-
disabled: busy,
|
|
1249
|
-
required: true
|
|
1250
|
-
}
|
|
1251
|
-
),
|
|
1252
|
-
error ? /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.error }) : null,
|
|
1253
|
-
/* @__PURE__ */ jsx9(Button, { type: "submit", disabled: busy || !keyId.trim() || !privateKey.trim(), children: pending ? copy.verifying : copy.verify })
|
|
1254
|
-
] }),
|
|
1255
|
-
allowExistingConnection && onDisconnect ? /* @__PURE__ */ jsx9(
|
|
1256
|
-
Button,
|
|
1257
|
-
{
|
|
1258
|
-
type: "button",
|
|
1259
|
-
variant: "secondary",
|
|
1260
|
-
disabled: busy,
|
|
1261
|
-
onClick: () => __async(null, null, function* () {
|
|
1262
|
-
setDisconnecting(true);
|
|
1263
|
-
setDisconnectError(false);
|
|
1264
|
-
setError(false);
|
|
1265
|
-
try {
|
|
1266
|
-
yield onDisconnect();
|
|
1267
|
-
setKeyId("");
|
|
1268
|
-
setPrivateKey("");
|
|
1269
|
-
onOpenChange(false);
|
|
1270
|
-
} catch (e) {
|
|
1271
|
-
setDisconnectError(true);
|
|
1272
|
-
} finally {
|
|
1273
|
-
setDisconnecting(false);
|
|
1274
|
-
}
|
|
1275
|
-
}),
|
|
1276
|
-
children: disconnecting ? copy.disconnecting : copy.disconnect
|
|
1277
|
-
}
|
|
1278
|
-
) : null,
|
|
1279
|
-
disconnectError ? /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.disconnectError }) : null
|
|
1280
|
-
]
|
|
1281
|
-
}
|
|
1282
|
-
)
|
|
1283
|
-
] }) })
|
|
1284
|
-
}
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
// src/onboarding/index.tsx
|
|
1289
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1290
|
-
import { useLabels as useLabels10 } from "@agg-build/hooks";
|
|
1291
|
-
import * as Dialog6 from "@radix-ui/react-dialog";
|
|
1292
|
-
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1293
|
-
var OnboardingModal = ({
|
|
1294
|
-
open,
|
|
1295
|
-
onOpenChange,
|
|
1296
|
-
onProfileSubmit,
|
|
1297
|
-
onConnectOnchain,
|
|
1298
|
-
onComplete,
|
|
1299
|
-
howItWorksIcons,
|
|
1300
|
-
connectedOnchain = false
|
|
1301
|
-
}) => {
|
|
1302
|
-
var _a;
|
|
1303
|
-
const labels = useLabels10();
|
|
1304
|
-
const [step, setStep] = useState7(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
1305
|
-
const stepLabels = {
|
|
1306
|
-
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
1307
|
-
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
1308
|
-
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
1309
|
-
};
|
|
1310
|
-
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
1311
|
-
const [onchainModalOpen, setOnchainModalOpen] = useState7(false);
|
|
1312
|
-
const [onchainConnected, setOnchainConnected] = useState7(false);
|
|
1313
|
-
useEffect4(() => {
|
|
1314
|
-
if (open) {
|
|
1315
|
-
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
1316
|
-
setOnchainConnected(false);
|
|
1317
|
-
}
|
|
1318
|
-
}, [open]);
|
|
1319
|
-
const handleHowItWorksContinue = useCallback5(() => {
|
|
1320
|
-
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
1321
|
-
}, []);
|
|
1322
|
-
const handleProfileContinue = useCallback5(
|
|
1323
|
-
(data) => {
|
|
1324
|
-
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
1325
|
-
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
1326
|
-
},
|
|
1327
|
-
[onProfileSubmit]
|
|
1328
|
-
);
|
|
1329
|
-
const handleConnectContinue = useCallback5(() => {
|
|
1330
|
-
onComplete == null ? void 0 : onComplete();
|
|
1331
|
-
}, [onComplete]);
|
|
1332
|
-
const handleOpenOnchainModal = useCallback5(() => {
|
|
1333
|
-
setOnchainModalOpen(true);
|
|
1334
|
-
}, []);
|
|
1335
|
-
const handleOnchainConnect = useCallback5(() => __async(null, null, function* () {
|
|
1336
|
-
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
1337
|
-
setOnchainConnected(true);
|
|
1338
|
-
}), [onConnectOnchain]);
|
|
1339
|
-
return /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1340
|
-
/* @__PURE__ */ jsx10(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs10(
|
|
1341
|
-
Modal.Container,
|
|
1342
|
-
{
|
|
1343
|
-
maxWidth: "600px",
|
|
1344
|
-
"aria-label": resolvedTitle,
|
|
1345
|
-
classNames: { container: "!rounded-agg-lg" },
|
|
1346
|
-
children: [
|
|
1347
|
-
/* @__PURE__ */ jsx10(Dialog6.Title, { className: "sr-only", children: resolvedTitle }),
|
|
1348
|
-
/* @__PURE__ */ jsxs10(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
1349
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ jsx10(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
1350
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ jsx10(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
1351
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ jsx10(
|
|
1352
|
-
ConnectAccountsStep,
|
|
1353
|
-
{
|
|
1354
|
-
onConnectOnchain: handleOpenOnchainModal,
|
|
1355
|
-
onContinue: handleConnectContinue,
|
|
1356
|
-
connectedOnchain: connectedOnchain || onchainConnected
|
|
1357
|
-
}
|
|
1358
|
-
)
|
|
1359
|
-
] })
|
|
1360
|
-
]
|
|
1361
|
-
}
|
|
1362
|
-
) }),
|
|
1363
|
-
/* @__PURE__ */ jsx10(
|
|
1364
|
-
ConnectOnchainModal,
|
|
1365
|
-
{
|
|
1366
|
-
open: onchainModalOpen,
|
|
1367
|
-
onOpenChange: setOnchainModalOpen,
|
|
1368
|
-
onConnect: handleOnchainConnect
|
|
1369
|
-
}
|
|
1370
|
-
)
|
|
1371
|
-
] });
|
|
1372
|
-
};
|
|
1373
|
-
OnboardingModal.displayName = "OnboardingModal";
|
|
1374
|
-
|
|
1375
|
-
// src/withdraw/index.tsx
|
|
1376
|
-
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1377
|
-
import { useWithdrawalLifecycle, useWithdrawFlow } from "@agg-build/hooks/withdraw";
|
|
1378
|
-
|
|
1379
|
-
// src/shared/constants.ts
|
|
1380
|
-
var USDC = {
|
|
1381
|
-
value: "USDC",
|
|
1382
|
-
label: "USDC",
|
|
1383
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdc.svg"
|
|
1384
|
-
};
|
|
1385
|
-
var SUPPORTED_NETWORKS = [
|
|
1386
|
-
{
|
|
1387
|
-
value: "abstract",
|
|
1388
|
-
label: "Abstract",
|
|
1389
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Abstract.svg",
|
|
1390
|
-
tokens: [USDC]
|
|
1391
|
-
},
|
|
1392
|
-
{
|
|
1393
|
-
value: "arbitrum",
|
|
1394
|
-
label: "Arbitrum One",
|
|
1395
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Arbitrum.svg",
|
|
1396
|
-
tokens: [USDC]
|
|
1397
|
-
},
|
|
1398
|
-
{
|
|
1399
|
-
value: "base",
|
|
1400
|
-
label: "Base",
|
|
1401
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Base.svg",
|
|
1402
|
-
tokens: [USDC]
|
|
1403
|
-
},
|
|
1404
|
-
{
|
|
1405
|
-
value: "bnb",
|
|
1406
|
-
label: "BNB Chain",
|
|
1407
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/BNB.svg",
|
|
1408
|
-
tokens: [USDC]
|
|
1409
|
-
},
|
|
1410
|
-
{
|
|
1411
|
-
value: "flow",
|
|
1412
|
-
label: "Flow",
|
|
1413
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Flow.svg",
|
|
1414
|
-
tokens: [USDC]
|
|
1415
|
-
},
|
|
1416
|
-
{
|
|
1417
|
-
value: "hyperliquid",
|
|
1418
|
-
label: "Hyperliquid",
|
|
1419
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/hyperliquid.png",
|
|
1420
|
-
tokens: [USDC]
|
|
1421
|
-
},
|
|
1422
|
-
{
|
|
1423
|
-
value: "mainnet",
|
|
1424
|
-
label: "Ethereum",
|
|
1425
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/ETH.svg",
|
|
1426
|
-
tokens: [USDC]
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
value: "optimism",
|
|
1430
|
-
label: "Optimism",
|
|
1431
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/optimism/colored.svg",
|
|
1432
|
-
tokens: [USDC]
|
|
1433
|
-
},
|
|
1434
|
-
{
|
|
1435
|
-
value: "polygon",
|
|
1436
|
-
label: "Polygon Mainnet",
|
|
1437
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Polygon.svg",
|
|
1438
|
-
tokens: [USDC]
|
|
1439
|
-
},
|
|
1440
|
-
{
|
|
1441
|
-
value: "solana",
|
|
1442
|
-
label: "Solana",
|
|
1443
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Solana.svg",
|
|
1444
|
-
tokens: [USDC]
|
|
1445
|
-
},
|
|
1446
|
-
{
|
|
1447
|
-
value: "zksync",
|
|
1448
|
-
label: "zkSync Era",
|
|
1449
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/zksync/colored.svg",
|
|
1450
|
-
tokens: [USDC]
|
|
1451
|
-
}
|
|
1452
|
-
];
|
|
1453
|
-
var mapNetworksToOptions = () => {
|
|
1454
|
-
return SUPPORTED_NETWORKS.map((n) => ({
|
|
1455
|
-
value: n.value,
|
|
1456
|
-
label: n.label,
|
|
1457
|
-
iconUrl: n.iconUrl
|
|
1458
|
-
}));
|
|
1459
|
-
};
|
|
1460
|
-
var USDC_ICON_URL = "https://assets.snagsolutions.io/public/web/icons/usdc.svg";
|
|
1461
|
-
var DEFAULT_CURRENCY_OPTIONS = [
|
|
1462
|
-
{
|
|
1463
|
-
value: "USDC",
|
|
1464
|
-
label: "USDC",
|
|
1465
|
-
iconUrl: USDC_ICON_URL
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
value: "USDC.e",
|
|
1469
|
-
label: "USDC.e",
|
|
1470
|
-
iconUrl: USDC_ICON_URL
|
|
1471
|
-
},
|
|
1472
|
-
{
|
|
1473
|
-
value: "USDH",
|
|
1474
|
-
label: "USDH",
|
|
1475
|
-
iconUrl: USDC_ICON_URL
|
|
1476
|
-
},
|
|
1477
|
-
{
|
|
1478
|
-
value: "pUSD",
|
|
1479
|
-
label: "pUSD",
|
|
1480
|
-
iconUrl: USDC_ICON_URL
|
|
1481
|
-
},
|
|
1482
|
-
{
|
|
1483
|
-
value: "USDT",
|
|
1484
|
-
label: "USDT",
|
|
1485
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdt.svg"
|
|
1486
|
-
},
|
|
1487
|
-
{
|
|
1488
|
-
value: "USDT",
|
|
1489
|
-
label: "USDT",
|
|
1490
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdt.svg"
|
|
1491
|
-
},
|
|
1492
|
-
// Add commonly-used tokens with icons. These can be overridden by props.
|
|
1493
|
-
{
|
|
1494
|
-
value: "ARB",
|
|
1495
|
-
label: "ARB",
|
|
1496
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/arb.svg"
|
|
1497
|
-
},
|
|
1498
|
-
{
|
|
1499
|
-
value: "BNB",
|
|
1500
|
-
label: "BNB",
|
|
1501
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/bnb.svg"
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
value: "BTC",
|
|
1505
|
-
label: "BTC",
|
|
1506
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/btc.svg"
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
value: "MATIC",
|
|
1510
|
-
label: "MATIC",
|
|
1511
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/matic.svg"
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
value: "ETH",
|
|
1515
|
-
label: "ETH",
|
|
1516
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/eth.svg"
|
|
1517
|
-
},
|
|
1518
|
-
{
|
|
1519
|
-
value: "SOL",
|
|
1520
|
-
label: "SOL",
|
|
1521
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/sol.svg"
|
|
1522
|
-
},
|
|
1523
|
-
{
|
|
1524
|
-
value: "OP",
|
|
1525
|
-
label: "OP",
|
|
1526
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/op.svg"
|
|
1527
|
-
}
|
|
1528
|
-
];
|
|
1529
|
-
var withTokenIcons = (options) => {
|
|
1530
|
-
const byValue = new Map(DEFAULT_CURRENCY_OPTIONS.map((o) => [o.value, o.iconUrl]));
|
|
1531
|
-
return options.map((o) => o.iconUrl ? o : __spreadProps(__spreadValues({}, o), { iconUrl: byValue.get(o.value) }));
|
|
1532
|
-
};
|
|
1533
|
-
var CHAIN_ID_TO_SLUG = {
|
|
1534
|
-
"1": "mainnet",
|
|
1535
|
-
"10": "optimism",
|
|
1536
|
-
"56": "bnb",
|
|
1537
|
-
"137": "polygon",
|
|
1538
|
-
"324": "zksync",
|
|
1539
|
-
"747": "flow",
|
|
1540
|
-
"1337": "hyperliquid",
|
|
1541
|
-
"8453": "base",
|
|
1542
|
-
"42161": "arbitrum",
|
|
1543
|
-
"2741": "abstract",
|
|
1544
|
-
"792703809": "solana"
|
|
1545
|
-
};
|
|
1546
|
-
var withNetworkIcons = (options) => {
|
|
1547
|
-
const bySlug = new Map(SUPPORTED_NETWORKS.map((n) => [n.value, n.iconUrl]));
|
|
1548
|
-
return options.map((o) => {
|
|
1549
|
-
var _a, _b;
|
|
1550
|
-
const slug = (_a = CHAIN_ID_TO_SLUG[o.value]) != null ? _a : o.value;
|
|
1551
|
-
return __spreadProps(__spreadValues({}, o), {
|
|
1552
|
-
iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug)
|
|
1553
|
-
});
|
|
1554
|
-
});
|
|
1555
|
-
};
|
|
1556
|
-
var mergeSelectOptionsUnique = (base, fill) => {
|
|
1557
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1558
|
-
const out = [];
|
|
1559
|
-
for (const opt of base != null ? base : []) {
|
|
1560
|
-
if (!seen.has(opt.value)) {
|
|
1561
|
-
out.push(opt);
|
|
1562
|
-
seen.add(opt.value);
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
for (const opt of fill) {
|
|
1566
|
-
if (!seen.has(opt.value)) {
|
|
1567
|
-
out.push(opt);
|
|
1568
|
-
seen.add(opt.value);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
return out;
|
|
1572
|
-
};
|
|
1573
|
-
|
|
1574
|
-
// src/withdraw/steps/withdraw-method.tsx
|
|
1575
|
-
import { useLabels as useLabels11 } from "@agg-build/hooks";
|
|
1576
|
-
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1577
|
-
var WithdrawMethodStep = ({
|
|
1578
|
-
balance,
|
|
1579
|
-
onSelectMethod
|
|
1580
|
-
}) => {
|
|
1581
|
-
const labels = useLabels11();
|
|
1582
|
-
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1583
|
-
/* @__PURE__ */ jsx11(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
|
|
1584
|
-
/* @__PURE__ */ jsx11(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-5", children: [
|
|
1585
|
-
/* @__PURE__ */ jsxs11("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
1586
|
-
labels.withdraw.balancePrefix,
|
|
1587
|
-
" ",
|
|
1588
|
-
formatCompactUsd(balance)
|
|
1589
|
-
] }),
|
|
1590
|
-
/* @__PURE__ */ jsxs11(
|
|
1591
|
-
"div",
|
|
1592
|
-
{
|
|
1593
|
-
className: cn(
|
|
1594
|
-
"flex items-center gap-3 sm:gap-4 rounded-xl border border-agg-separator bg-agg-secondary p-3 sm:p-4",
|
|
1595
|
-
"hover:bg-agg-secondary-hover transition-colors cursor-pointer"
|
|
1596
|
-
),
|
|
1597
|
-
role: "button",
|
|
1598
|
-
tabIndex: 0,
|
|
1599
|
-
onClick: () => onSelectMethod("wallet"),
|
|
1600
|
-
onKeyDown: (e) => {
|
|
1601
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1602
|
-
e.preventDefault();
|
|
1603
|
-
onSelectMethod("wallet");
|
|
1604
|
-
}
|
|
1605
|
-
},
|
|
1606
|
-
children: [
|
|
1607
|
-
/* @__PURE__ */ jsx11("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ jsx11(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
|
|
1608
|
-
/* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
|
|
1609
|
-
/* @__PURE__ */ jsx11("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
|
|
1610
|
-
/* @__PURE__ */ jsx11("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
|
|
1611
|
-
] }),
|
|
1612
|
-
/* @__PURE__ */ jsx11("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx11(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
1613
|
-
]
|
|
1614
|
-
}
|
|
1615
|
-
)
|
|
1616
|
-
] }) })
|
|
1617
|
-
] });
|
|
1618
|
-
};
|
|
1619
|
-
|
|
1620
|
-
// src/withdraw/steps/withdraw-amount.tsx
|
|
1621
|
-
import { useLabels as useLabels13, useWithdrawPreview } from "@agg-build/hooks";
|
|
1622
|
-
|
|
1623
|
-
// src/shared/transfer-fee-summary.tsx
|
|
1624
|
-
import { useLabels as useLabels12 } from "@agg-build/hooks";
|
|
1625
|
-
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1626
|
-
var separator = /* @__PURE__ */ jsx12("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
|
|
1627
|
-
var normalizeFeeLabel = (label) => label.replace(/\s*~\s*$/, "");
|
|
1628
|
-
var TransferFeeSummary = ({
|
|
1629
|
-
estimate,
|
|
1630
|
-
view,
|
|
1631
|
-
minDeposit,
|
|
1632
|
-
eta
|
|
1633
|
-
}) => {
|
|
1634
|
-
const labels = useLabels12();
|
|
1635
|
-
if (!estimate) return null;
|
|
1636
|
-
if (view === "deposit") {
|
|
1637
|
-
return /* @__PURE__ */ jsxs12("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
1638
|
-
minDeposit ? /* @__PURE__ */ jsxs12("span", { children: [
|
|
1639
|
-
labels.deposit.sendCrypto.minDepositPrefix,
|
|
1640
|
-
" ",
|
|
1641
|
-
minDeposit
|
|
1642
|
-
] }) : null,
|
|
1643
|
-
minDeposit ? separator : null,
|
|
1644
|
-
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1645
|
-
normalizeFeeLabel(labels.deposit.walletFlow.feePrefix),
|
|
1646
|
-
": ",
|
|
1647
|
-
estimate.estimatedFees
|
|
1648
|
-
] }),
|
|
1649
|
-
eta ? separator : null,
|
|
1650
|
-
eta ? /* @__PURE__ */ jsx12("span", { children: eta }) : null
|
|
1651
|
-
] });
|
|
1652
|
-
}
|
|
1653
|
-
return /* @__PURE__ */ jsxs12("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
1654
|
-
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1655
|
-
labels.withdraw.walletFlow.estimatedFees,
|
|
1656
|
-
": ",
|
|
1657
|
-
estimate.estimatedFees
|
|
1658
|
-
] }),
|
|
1659
|
-
separator,
|
|
1660
|
-
/* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1", children: [
|
|
1661
|
-
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1662
|
-
labels.withdraw.walletFlow.networkReserve,
|
|
1663
|
-
": ",
|
|
1664
|
-
estimate.networkReserve
|
|
1665
|
-
] }),
|
|
1666
|
-
/* @__PURE__ */ jsx12(
|
|
1667
|
-
Tooltip,
|
|
1668
|
-
{
|
|
1669
|
-
"aria-label": labels.withdraw.walletFlow.networkReserveTooltipAria,
|
|
1670
|
-
size: "medium",
|
|
1671
|
-
content: /* @__PURE__ */ jsxs12("div", { className: "text-center", children: [
|
|
1672
|
-
/* @__PURE__ */ jsx12("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
|
|
1673
|
-
/* @__PURE__ */ jsx12("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
|
|
1674
|
-
] }),
|
|
1675
|
-
classNames: {
|
|
1676
|
-
content: "min-w-96 max-w-none!",
|
|
1677
|
-
arrow: "[&_polygon]:fill-agg-background",
|
|
1678
|
-
icon: "text-agg-foreground! h-3! w-3!"
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
)
|
|
1682
|
-
] }),
|
|
1683
|
-
separator,
|
|
1684
|
-
/* @__PURE__ */ jsxs12("span", { children: [
|
|
1685
|
-
labels.withdraw.walletFlow.youReceive,
|
|
1686
|
-
": ",
|
|
1687
|
-
estimate.youReceive
|
|
1688
|
-
] })
|
|
1689
|
-
] });
|
|
1690
|
-
};
|
|
1691
|
-
|
|
1692
|
-
// src/withdraw/steps/withdraw-amount.tsx
|
|
1693
|
-
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1694
|
-
var formatRawTokenAmount = (rawAmount, decimals) => {
|
|
1695
|
-
if (!rawAmount) return "0";
|
|
1696
|
-
const raw = BigInt(rawAmount);
|
|
1697
|
-
const divisor = BigInt(`1${"0".repeat(decimals)}`);
|
|
1698
|
-
const whole = raw / divisor;
|
|
1699
|
-
const remainder = raw % divisor;
|
|
1700
|
-
if (remainder === BigInt(0)) return whole.toString();
|
|
1701
|
-
return `${whole.toString()}.${remainder.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
1702
|
-
};
|
|
1703
|
-
var parseTokenAmountToRaw = (amount2, decimals) => {
|
|
1704
|
-
const normalizedAmount = amount2.trim();
|
|
1705
|
-
if (!normalizedAmount || !/^\d*(?:\.\d*)?$/.test(normalizedAmount)) return null;
|
|
1706
|
-
const [wholePart = "0", fractionalPart = ""] = normalizedAmount.split(".");
|
|
1707
|
-
if (fractionalPart.length > decimals) return null;
|
|
1708
|
-
const normalizedWhole = wholePart === "" ? "0" : wholePart;
|
|
1709
|
-
const normalizedFraction = fractionalPart.padEnd(decimals, "0");
|
|
1710
|
-
try {
|
|
1711
|
-
return `${BigInt(normalizedWhole)}${normalizedFraction}`.replace(/^0+(?=\d)/, "");
|
|
1712
|
-
} catch (e) {
|
|
1713
|
-
return null;
|
|
1714
|
-
}
|
|
1715
|
-
};
|
|
1716
|
-
var WithdrawAmountStep = ({
|
|
1717
|
-
title,
|
|
1718
|
-
fixedDestination = false,
|
|
1719
|
-
amount: amount2,
|
|
1720
|
-
destinationWallet,
|
|
1721
|
-
balanceDisplay,
|
|
1722
|
-
tokenOptions,
|
|
1723
|
-
networkOptions,
|
|
1724
|
-
selectedToken,
|
|
1725
|
-
selectedNetwork,
|
|
1726
|
-
destDecimals,
|
|
1727
|
-
isConfirming = false,
|
|
1728
|
-
error,
|
|
1729
|
-
max = false,
|
|
1730
|
-
onBack,
|
|
1731
|
-
onAmountChange,
|
|
1732
|
-
onDestinationChange,
|
|
1733
|
-
onTokenChange,
|
|
1734
|
-
onNetworkChange,
|
|
1735
|
-
onMaxClick,
|
|
1736
|
-
onContinue
|
|
1737
|
-
}) => {
|
|
1738
|
-
var _a, _b, _c, _d;
|
|
1739
|
-
const labels = useLabels13();
|
|
1740
|
-
const SOLANA_CHAIN_ID = "792703809";
|
|
1741
|
-
const isSolanaDest = selectedNetwork === SOLANA_CHAIN_ID;
|
|
1742
|
-
const trimmedDestination = destinationWallet.trim();
|
|
1743
|
-
const isValidAddress = isSolanaDest ? /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(trimmedDestination) : /^0x[a-fA-F0-9]{40}$/.test(trimmedDestination);
|
|
1744
|
-
const isValid = Number(amount2) > 0 && isValidAddress;
|
|
1745
|
-
const amountRaw = amount2 && Number(amount2) > 0 ? parseTokenAmountToRaw(amount2, destDecimals) : null;
|
|
1746
|
-
const destinationChainId = Number(selectedNetwork) || null;
|
|
1747
|
-
const preview = useWithdrawPreview({
|
|
1748
|
-
amountRaw,
|
|
1749
|
-
tokenSymbol: selectedToken || null,
|
|
1750
|
-
destinationChainId,
|
|
1751
|
-
destinationAddress: trimmedDestination || null,
|
|
1752
|
-
max
|
|
1753
|
-
});
|
|
1754
|
-
const previewUnviable = ((_a = preview.data) == null ? void 0 : _a.pricingStatus) === "unviable";
|
|
1755
|
-
const previewUnviableMessage = previewUnviable ? ((_b = preview.data) == null ? void 0 : _b.maxDeliverableRaw) != null && BigInt(preview.data.maxDeliverableRaw) > BigInt(0) ? `Amount exceeds your withdrawable balance. Max: ~${formatRawTokenAmount(preview.data.maxDeliverableRaw, destDecimals)} ${selectedToken}` : (_d = (_c = preview.data) == null ? void 0 : _c.unviableReason) != null ? _d : "This amount can't be withdrawn right now." : null;
|
|
1756
|
-
const previewLoading = preview.isFetching;
|
|
1757
|
-
const isDisabled = !isValid || isConfirming || previewUnviable || previewLoading;
|
|
1758
|
-
const withdrawEstimate = preview.data && preview.data.pricingStatus === "quoted" ? {
|
|
1759
|
-
estimatedFees: preview.data.feeRaw != null ? `~${formatRawTokenAmount(preview.data.feeRaw, destDecimals)} ${selectedToken}` : "\u2014",
|
|
1760
|
-
networkReserve: preview.data.networkFeeRaw != null ? `~${formatRawTokenAmount(preview.data.networkFeeRaw, destDecimals)} ${selectedToken}` : "\u2014",
|
|
1761
|
-
youReceive: preview.data.receiveAmountRaw != null ? `~${formatRawTokenAmount(preview.data.receiveAmountRaw, destDecimals)} ${selectedToken}` : "\u2014"
|
|
1762
|
-
} : null;
|
|
1763
|
-
const shouldShowWithdrawEstimate = Boolean(withdrawEstimate);
|
|
1764
|
-
return /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
1765
|
-
/* @__PURE__ */ jsx13(
|
|
1766
|
-
Modal.Header,
|
|
1767
|
-
{
|
|
1768
|
-
title: title != null ? title : labels.withdraw.walletFlow.title,
|
|
1769
|
-
hideBorder: true,
|
|
1770
|
-
leftElement: /* @__PURE__ */ jsx13(
|
|
1771
|
-
"button",
|
|
1772
|
-
{
|
|
1773
|
-
type: "button",
|
|
1774
|
-
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1775
|
-
onClick: onBack,
|
|
1776
|
-
"aria-label": labels.withdraw.back,
|
|
1777
|
-
children: /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1778
|
-
}
|
|
1779
|
-
)
|
|
1780
|
-
}
|
|
1781
|
-
),
|
|
1782
|
-
/* @__PURE__ */ jsx13(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-5", children: [
|
|
1783
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-5", children: [
|
|
1784
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2", children: [
|
|
1785
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
|
|
1786
|
-
/* @__PURE__ */ jsx13(
|
|
1787
|
-
"input",
|
|
1788
|
-
{
|
|
1789
|
-
type: "text",
|
|
1790
|
-
"aria-label": labels.withdraw.walletFlow.recipientAddressLabel,
|
|
1791
|
-
className: cn(
|
|
1792
|
-
"agg-type-body w-full h-10 rounded border border-agg-separator bg-agg-secondary px-3 outline-none",
|
|
1793
|
-
"text-agg-foreground placeholder:text-agg-muted-foreground",
|
|
1794
|
-
"focus:border-agg-primary transition-colors"
|
|
1795
|
-
),
|
|
1796
|
-
placeholder: isSolanaDest ? "FwR3..." : "0x971d...",
|
|
1797
|
-
value: destinationWallet,
|
|
1798
|
-
readOnly: fixedDestination,
|
|
1799
|
-
onChange: (e) => onDestinationChange(e.target.value)
|
|
1800
|
-
}
|
|
1801
|
-
)
|
|
1802
|
-
] }),
|
|
1803
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2", children: [
|
|
1804
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
|
|
1805
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
|
|
1806
|
-
/* @__PURE__ */ jsxs13("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1807
|
-
labels.withdraw.balancePrefix,
|
|
1808
|
-
" ",
|
|
1809
|
-
balanceDisplay
|
|
1810
|
-
] })
|
|
1811
|
-
] }),
|
|
1812
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
|
|
1813
|
-
/* @__PURE__ */ jsx13(
|
|
1814
|
-
"input",
|
|
1815
|
-
{
|
|
1816
|
-
type: "text",
|
|
1817
|
-
inputMode: "decimal",
|
|
1818
|
-
"aria-label": labels.withdraw.walletFlow.amountLabel,
|
|
1819
|
-
className: cn(
|
|
1820
|
-
"agg-type-body flex-1 min-w-0 bg-transparent outline-none",
|
|
1821
|
-
Number(amount2) > 0 ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
1822
|
-
),
|
|
1823
|
-
placeholder: "0.00",
|
|
1824
|
-
value: amount2,
|
|
1825
|
-
onChange: (e) => onAmountChange(e.target.value)
|
|
1826
|
-
}
|
|
1827
|
-
),
|
|
1828
|
-
/* @__PURE__ */ jsx13("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
|
|
1829
|
-
onMaxClick ? /* @__PURE__ */ jsx13(
|
|
1830
|
-
"button",
|
|
1831
|
-
{
|
|
1832
|
-
type: "button",
|
|
1833
|
-
className: "agg-type-label-strong text-agg-primary hover:opacity-80 transition-opacity cursor-pointer shrink-0",
|
|
1834
|
-
onClick: onMaxClick,
|
|
1835
|
-
children: labels.withdraw.walletFlow.max
|
|
1836
|
-
}
|
|
1837
|
-
) : null
|
|
1838
|
-
] })
|
|
1839
|
-
] }),
|
|
1840
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
|
|
1841
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1842
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
|
|
1843
|
-
/* @__PURE__ */ jsx13(
|
|
1844
|
-
Select,
|
|
1845
|
-
{
|
|
1846
|
-
items: tokenOptions,
|
|
1847
|
-
disabled: fixedDestination,
|
|
1848
|
-
value: selectedToken,
|
|
1849
|
-
onChange: onTokenChange,
|
|
1850
|
-
ariaLabel: labels.withdraw.walletFlow.tokenLabel
|
|
1851
|
-
}
|
|
1852
|
-
)
|
|
1853
|
-
] }),
|
|
1854
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1855
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
|
|
1856
|
-
/* @__PURE__ */ jsx13(
|
|
1857
|
-
Select,
|
|
1858
|
-
{
|
|
1859
|
-
items: networkOptions,
|
|
1860
|
-
disabled: fixedDestination,
|
|
1861
|
-
value: selectedNetwork,
|
|
1862
|
-
onChange: onNetworkChange,
|
|
1863
|
-
ariaLabel: labels.withdraw.walletFlow.networkLabel
|
|
1864
|
-
}
|
|
1865
|
-
)
|
|
1866
|
-
] })
|
|
1867
|
-
] }),
|
|
1868
|
-
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ jsx13(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
|
|
1869
|
-
previewUnviableMessage ? /* @__PURE__ */ jsx13("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
|
|
1870
|
-
] }),
|
|
1871
|
-
/* @__PURE__ */ jsx13(
|
|
1872
|
-
Button,
|
|
1873
|
-
{
|
|
1874
|
-
variant: isValid && !isConfirming && !previewUnviable && !previewLoading ? "primary" : "secondary",
|
|
1875
|
-
size: "large",
|
|
1876
|
-
className: "w-full",
|
|
1877
|
-
disabled: isDisabled,
|
|
1878
|
-
prefix: previewLoading && !isConfirming ? /* @__PURE__ */ jsx13(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
|
|
1879
|
-
onClick: onContinue,
|
|
1880
|
-
children: isConfirming ? labels.common.loading : previewLoading ? labels.withdraw.walletFlow.calculatingFees : labels.withdraw.walletFlow.confirm
|
|
1881
|
-
}
|
|
1882
|
-
),
|
|
1883
|
-
error ? /* @__PURE__ */ jsx13("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
|
|
1884
|
-
] }) })
|
|
1885
|
-
] });
|
|
1886
|
-
};
|
|
1887
|
-
|
|
1888
|
-
// src/withdraw/steps/withdraw-success.tsx
|
|
1889
|
-
import { useLabels as useLabels14, useSdkUiConfig } from "@agg-build/hooks";
|
|
1890
|
-
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1891
|
-
var SummaryRow = ({ label, value }) => /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
1892
|
-
/* @__PURE__ */ jsx14("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
1893
|
-
/* @__PURE__ */ jsx14("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
|
|
1894
|
-
] });
|
|
1895
|
-
var WithdrawCloseButton = ({ onClose, label }) => /* @__PURE__ */ jsx14(
|
|
1896
|
-
"button",
|
|
1897
|
-
{
|
|
1898
|
-
type: "button",
|
|
1899
|
-
className: "absolute right-8 top-7 flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
1900
|
-
onClick: onClose,
|
|
1901
|
-
"aria-label": label,
|
|
1902
|
-
children: /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6" })
|
|
1903
|
-
}
|
|
1904
|
-
);
|
|
1905
|
-
var LoadingGlyph = ({
|
|
1906
|
-
className,
|
|
1907
|
-
enableAnimations
|
|
1908
|
-
}) => /* @__PURE__ */ jsx14(
|
|
1909
|
-
"span",
|
|
1910
|
-
{
|
|
1911
|
-
"aria-hidden": "true",
|
|
1912
|
-
className: cn(
|
|
1913
|
-
"inline-block rounded-full border-2 border-current border-r-transparent",
|
|
1914
|
-
getMotionClassName(enableAnimations, "animate-spin"),
|
|
1915
|
-
className
|
|
1916
|
-
)
|
|
1917
|
-
}
|
|
1918
|
-
);
|
|
1919
|
-
var loadingActiveIndexFor = (state) => {
|
|
1920
|
-
if (state.status === "transferring") return 2;
|
|
1921
|
-
if (state.status === "bridging") return 1;
|
|
1922
|
-
return 0;
|
|
1923
|
-
};
|
|
1924
|
-
var getLoadingSteps = (labels) => [
|
|
1925
|
-
{ id: "preparing", label: labels.lifecycle.loadingSteps.preparing },
|
|
1926
|
-
{ id: "bridging", label: labels.lifecycle.loadingSteps.bridging },
|
|
1927
|
-
{ id: "sending", label: labels.lifecycle.loadingSteps.sending },
|
|
1928
|
-
{ id: "confirming", label: labels.lifecycle.loadingSteps.confirming }
|
|
1929
|
-
];
|
|
1930
|
-
var WithdrawLoadingStep = ({
|
|
1931
|
-
lifecycleState,
|
|
1932
|
-
onClose
|
|
1933
|
-
}) => {
|
|
1934
|
-
const labels = useLabels14();
|
|
1935
|
-
const {
|
|
1936
|
-
features: { enableAnimations }
|
|
1937
|
-
} = useSdkUiConfig();
|
|
1938
|
-
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
1939
|
-
const activeIndex = loadingActiveIndexFor(lifecycleState);
|
|
1940
|
-
const loadingSteps = getLoadingSteps(walletFlowLabels);
|
|
1941
|
-
return /* @__PURE__ */ jsx14("div", { className: "relative", children: /* @__PURE__ */ jsx14(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-7", children: [
|
|
1942
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between gap-4", children: [
|
|
1943
|
-
/* @__PURE__ */ jsx14("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
|
|
1944
|
-
/* @__PURE__ */ jsx14(
|
|
1945
|
-
"button",
|
|
1946
|
-
{
|
|
1947
|
-
type: "button",
|
|
1948
|
-
className: "flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
1949
|
-
onClick: onClose,
|
|
1950
|
-
"aria-label": labels.common.close,
|
|
1951
|
-
children: /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6" })
|
|
1952
|
-
}
|
|
1953
|
-
)
|
|
1954
|
-
] }),
|
|
1955
|
-
/* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
|
|
1956
|
-
const isComplete = index < activeIndex;
|
|
1957
|
-
const isActive = index === activeIndex;
|
|
1958
|
-
const textClassName = isActive || isComplete ? "text-agg-foreground" : "text-agg-muted-foreground";
|
|
1959
|
-
return /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-3", children: [
|
|
1960
|
-
isComplete ? /* @__PURE__ */ jsx14(
|
|
1961
|
-
Icon,
|
|
1962
|
-
{
|
|
1963
|
-
name: "check-circle",
|
|
1964
|
-
size: "small",
|
|
1965
|
-
className: "h-4 w-4 shrink-0 text-agg-primary",
|
|
1966
|
-
"aria-hidden": "true"
|
|
1967
|
-
}
|
|
1968
|
-
) : null,
|
|
1969
|
-
isActive ? /* @__PURE__ */ jsx14(
|
|
1970
|
-
LoadingGlyph,
|
|
1971
|
-
{
|
|
1972
|
-
enableAnimations,
|
|
1973
|
-
className: "h-4 w-4 shrink-0 text-agg-primary"
|
|
1974
|
-
}
|
|
1975
|
-
) : null,
|
|
1976
|
-
!isComplete && !isActive ? /* @__PURE__ */ jsx14(
|
|
1977
|
-
"span",
|
|
1978
|
-
{
|
|
1979
|
-
"aria-hidden": "true",
|
|
1980
|
-
className: "h-4 w-4 shrink-0 rounded-full border border-agg-separator"
|
|
1981
|
-
}
|
|
1982
|
-
) : null,
|
|
1983
|
-
/* @__PURE__ */ jsx14("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
|
|
1984
|
-
] }, step.id);
|
|
1985
|
-
}) }),
|
|
1986
|
-
/* @__PURE__ */ jsx14("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
|
|
1987
|
-
] }) }) });
|
|
1988
|
-
};
|
|
1989
|
-
var resultCopyFor = ({
|
|
1990
|
-
status,
|
|
1991
|
-
tokenSymbol,
|
|
1992
|
-
labels
|
|
1993
|
-
}) => {
|
|
1994
|
-
if (status === "failed") {
|
|
1995
|
-
return {
|
|
1996
|
-
title: labels.successTitleFailed,
|
|
1997
|
-
description: labels.successDescriptionFailed(tokenSymbol)
|
|
1998
|
-
};
|
|
1999
|
-
}
|
|
2000
|
-
if (status === "partial_success") {
|
|
2001
|
-
return {
|
|
2002
|
-
title: labels.successTitlePartial,
|
|
2003
|
-
description: labels.successDescriptionPartial(tokenSymbol)
|
|
2004
|
-
};
|
|
2005
|
-
}
|
|
2006
|
-
return {
|
|
2007
|
-
title: labels.successTitleCompleted,
|
|
2008
|
-
description: labels.successDescriptionCompleted(tokenSymbol)
|
|
2009
|
-
};
|
|
2010
|
-
};
|
|
2011
|
-
var WithdrawSuccessStep = ({
|
|
2012
|
-
summary,
|
|
2013
|
-
tokenSymbol,
|
|
2014
|
-
requestedWithdrawal,
|
|
2015
|
-
resultStatus,
|
|
2016
|
-
errorMessage,
|
|
2017
|
-
onDone,
|
|
2018
|
-
onRetry,
|
|
2019
|
-
onClose
|
|
2020
|
-
}) => {
|
|
2021
|
-
const labels = useLabels14();
|
|
2022
|
-
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
2023
|
-
const { title, description } = resultCopyFor({
|
|
2024
|
-
status: resultStatus,
|
|
2025
|
-
tokenSymbol,
|
|
2026
|
-
labels: walletFlowLabels
|
|
2027
|
-
});
|
|
2028
|
-
const isFailed = resultStatus === "failed";
|
|
2029
|
-
return /* @__PURE__ */ jsx14("div", { className: "relative", children: /* @__PURE__ */ jsxs14(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
|
|
2030
|
-
/* @__PURE__ */ jsx14(WithdrawCloseButton, { onClose, label: labels.common.close }),
|
|
2031
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
|
|
2032
|
-
/* @__PURE__ */ jsx14(
|
|
2033
|
-
"div",
|
|
2034
|
-
{
|
|
2035
|
-
className: cn(
|
|
2036
|
-
"flex h-[60px] w-[60px] items-center justify-center rounded-full",
|
|
2037
|
-
isFailed ? "bg-agg-error/15" : "bg-agg-success/15"
|
|
2038
|
-
),
|
|
2039
|
-
"aria-hidden": "true",
|
|
2040
|
-
children: isFailed ? /* @__PURE__ */ jsx14(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ jsx14(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
|
|
2041
|
-
}
|
|
2042
|
-
),
|
|
2043
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
|
|
2044
|
-
/* @__PURE__ */ jsx14("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title }),
|
|
2045
|
-
/* @__PURE__ */ jsx14(
|
|
2046
|
-
"p",
|
|
2047
|
-
{
|
|
2048
|
-
className: "max-w-[400px] text-agg-base leading-agg-6",
|
|
2049
|
-
"data-withdraw-result-status": resultStatus,
|
|
2050
|
-
children: errorMessage && isFailed ? errorMessage : description
|
|
2051
|
-
}
|
|
2052
|
-
)
|
|
2053
|
-
] }),
|
|
2054
|
-
!isFailed ? /* @__PURE__ */ jsxs14("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
|
|
2055
|
-
/* @__PURE__ */ jsx14(
|
|
2056
|
-
SummaryRow,
|
|
2057
|
-
{
|
|
2058
|
-
label: walletFlowLabels.summary.requestedWithdrawal,
|
|
2059
|
-
value: requestedWithdrawal
|
|
2060
|
-
}
|
|
2061
|
-
),
|
|
2062
|
-
/* @__PURE__ */ jsx14(
|
|
2063
|
-
SummaryRow,
|
|
2064
|
-
{
|
|
2065
|
-
label: walletFlowLabels.summary.amountReceived,
|
|
2066
|
-
value: summary.amountReceived
|
|
2067
|
-
}
|
|
2068
|
-
),
|
|
2069
|
-
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.fees, value: summary.fees }),
|
|
2070
|
-
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.network, value: summary.network }),
|
|
2071
|
-
/* @__PURE__ */ jsx14(SummaryRow, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
|
|
2072
|
-
] }) : null,
|
|
2073
|
-
isFailed ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-center gap-3", children: [
|
|
2074
|
-
/* @__PURE__ */ jsx14(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
|
|
2075
|
-
/* @__PURE__ */ jsx14(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
|
|
2076
|
-
] }) : /* @__PURE__ */ jsx14(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
|
|
2077
|
-
] })
|
|
2078
|
-
] }) });
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
// src/withdraw/index.tsx
|
|
2082
|
-
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2083
|
-
var DEFAULT_TOKEN_DECIMALS = 6;
|
|
2084
|
-
var TOKEN_DECIMALS_BY_SYMBOL = {
|
|
2085
|
-
BNB: 18,
|
|
2086
|
-
ETH: 18,
|
|
2087
|
-
MATIC: 18,
|
|
2088
|
-
POL: 18,
|
|
2089
|
-
WETH: 18,
|
|
2090
|
-
USDC: 6,
|
|
2091
|
-
USDT: 6
|
|
2092
|
-
};
|
|
2093
|
-
var TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL = {
|
|
2094
|
-
"56": {
|
|
2095
|
-
USDC: 18,
|
|
2096
|
-
USDT: 18
|
|
2097
|
-
}
|
|
2098
|
-
};
|
|
2099
|
-
var getTokenDecimals = (tokenSymbol, chainId) => {
|
|
2100
|
-
var _a;
|
|
2101
|
-
const normalizedSymbol = tokenSymbol.trim().toUpperCase();
|
|
2102
|
-
const normalizedChainId = chainId == null ? void 0 : chainId.trim();
|
|
2103
|
-
if (normalizedChainId) {
|
|
2104
|
-
const chainDecimals = TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL[normalizedChainId];
|
|
2105
|
-
const chainTokenDecimals = chainDecimals == null ? void 0 : chainDecimals[normalizedSymbol];
|
|
2106
|
-
if (chainTokenDecimals != null) return chainTokenDecimals;
|
|
2107
|
-
}
|
|
2108
|
-
return (_a = TOKEN_DECIMALS_BY_SYMBOL[normalizedSymbol]) != null ? _a : DEFAULT_TOKEN_DECIMALS;
|
|
2109
|
-
};
|
|
2110
|
-
var formatRawTokenAmount2 = (rawAmount, decimals) => {
|
|
2111
|
-
const raw = BigInt(rawAmount);
|
|
2112
|
-
const divisor = BigInt(`1${"0".repeat(decimals)}`);
|
|
2113
|
-
const whole = raw / divisor;
|
|
2114
|
-
const remainder = raw % divisor;
|
|
2115
|
-
if (remainder === BigInt(0)) return whole.toString();
|
|
2116
|
-
return `${whole.toString()}.${remainder.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
2117
|
-
};
|
|
2118
|
-
var formatLifecycleTokenAmount = ({
|
|
2119
|
-
rawAmount,
|
|
2120
|
-
tokenSymbol,
|
|
2121
|
-
chainId
|
|
2122
|
-
}) => `${formatRawTokenAmount2(rawAmount, getTokenDecimals(tokenSymbol, chainId))} ${tokenSymbol}`;
|
|
2123
|
-
var buildTerminalSummary = ({
|
|
2124
|
-
fallbackSummary,
|
|
2125
|
-
lifecycleCompletedAmountRaw,
|
|
2126
|
-
lifecycleRequestedAmountRaw,
|
|
2127
|
-
lifecycleFeeRaw,
|
|
2128
|
-
tokenSymbol,
|
|
2129
|
-
chainId
|
|
2130
|
-
}) => {
|
|
2131
|
-
if (!lifecycleCompletedAmountRaw) return fallbackSummary;
|
|
2132
|
-
const amountReceived = formatLifecycleTokenAmount({
|
|
2133
|
-
rawAmount: lifecycleCompletedAmountRaw,
|
|
2134
|
-
tokenSymbol,
|
|
2135
|
-
chainId
|
|
2136
|
-
});
|
|
2137
|
-
let feeRaw = lifecycleFeeRaw;
|
|
2138
|
-
if (feeRaw == null && lifecycleRequestedAmountRaw) {
|
|
2139
|
-
try {
|
|
2140
|
-
const r = BigInt(lifecycleRequestedAmountRaw);
|
|
2141
|
-
const c = BigInt(lifecycleCompletedAmountRaw);
|
|
2142
|
-
feeRaw = (r > c ? r - c : BigInt(0)).toString();
|
|
2143
|
-
} catch (e) {
|
|
2144
|
-
feeRaw = null;
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
return __spreadValues(__spreadProps(__spreadValues({}, fallbackSummary), {
|
|
2148
|
-
amountReceived
|
|
2149
|
-
}), feeRaw != null ? {
|
|
2150
|
-
fees: formatLifecycleTokenAmount({
|
|
2151
|
-
rawAmount: feeRaw,
|
|
2152
|
-
tokenSymbol,
|
|
2153
|
-
chainId
|
|
2154
|
-
})
|
|
2155
|
-
} : {});
|
|
2156
|
-
};
|
|
2157
|
-
function isControlledWithdrawModalProps(props) {
|
|
2158
|
-
return "withdrawFlow" in props;
|
|
2159
|
-
}
|
|
2160
|
-
function WithdrawModalSelfDriven({
|
|
2161
|
-
open,
|
|
2162
|
-
onOpenChange
|
|
2163
|
-
}) {
|
|
2164
|
-
const withdrawProps = useWithdrawFlow({ open, onOpenChange });
|
|
2165
|
-
return /* @__PURE__ */ jsx15(WithdrawModalControlled, __spreadValues({}, withdrawProps));
|
|
2166
|
-
}
|
|
2167
|
-
function WithdrawModalControlled({
|
|
2168
|
-
open,
|
|
2169
|
-
onOpenChange,
|
|
2170
|
-
withdrawFlow,
|
|
2171
|
-
transferTarget,
|
|
2172
|
-
onWithdrawDestinationChange,
|
|
2173
|
-
onWithdrawAmountChange,
|
|
2174
|
-
onWithdrawTokenChange,
|
|
2175
|
-
onWithdrawNetworkChange,
|
|
2176
|
-
onMaxClick,
|
|
2177
|
-
onSelectWithdrawProvider,
|
|
2178
|
-
onDoneWithdraw
|
|
2179
|
-
}) {
|
|
2180
|
-
var _a;
|
|
2181
|
-
const initialFormStep = transferTarget ? "withdraw-amount" : "method";
|
|
2182
|
-
const [flowState, setFlowState] = useState8({
|
|
2183
|
-
status: "form",
|
|
2184
|
-
formStep: initialFormStep
|
|
2185
|
-
});
|
|
2186
|
-
const [isConfirming, setIsConfirming] = useState8(false);
|
|
2187
|
-
const [confirmError, setConfirmError] = useState8(null);
|
|
2188
|
-
const { state: withdrawalLifecycleState, reset: resetWithdrawalLifecycle } = useWithdrawalLifecycle(withdrawFlow.withdrawalId);
|
|
2189
|
-
useEffect5(() => {
|
|
2190
|
-
if (!open) {
|
|
2191
|
-
setFlowState({ status: "form", formStep: initialFormStep });
|
|
2192
|
-
setIsConfirming(false);
|
|
2193
|
-
setConfirmError(null);
|
|
2194
|
-
resetWithdrawalLifecycle();
|
|
2195
|
-
}
|
|
2196
|
-
}, [open, resetWithdrawalLifecycle, initialFormStep]);
|
|
2197
|
-
useEffect5(() => {
|
|
2198
|
-
if (flowState.status !== "loading") return;
|
|
2199
|
-
if (!withdrawalLifecycleState.terminal) return;
|
|
2200
|
-
if (withdrawalLifecycleState.status === "completed") {
|
|
2201
|
-
setFlowState({ status: "success" });
|
|
2202
|
-
return;
|
|
2203
|
-
}
|
|
2204
|
-
if (withdrawalLifecycleState.status === "partial") {
|
|
2205
|
-
setFlowState({ status: "partial_success" });
|
|
2206
|
-
return;
|
|
2207
|
-
}
|
|
2208
|
-
if (withdrawalLifecycleState.status === "failed") {
|
|
2209
|
-
setFlowState({
|
|
2210
|
-
status: "failed",
|
|
2211
|
-
errorMessage: withdrawalLifecycleState.errorMessage
|
|
2212
|
-
});
|
|
2213
|
-
}
|
|
2214
|
-
}, [
|
|
2215
|
-
flowState.status,
|
|
2216
|
-
withdrawalLifecycleState.errorMessage,
|
|
2217
|
-
withdrawalLifecycleState.status,
|
|
2218
|
-
withdrawalLifecycleState.terminal
|
|
2219
|
-
]);
|
|
2220
|
-
const handleOpenChange = (isOpen) => {
|
|
2221
|
-
if (!isOpen) {
|
|
2222
|
-
setFlowState({ status: "form", formStep: initialFormStep });
|
|
2223
|
-
setIsConfirming(false);
|
|
2224
|
-
setConfirmError(null);
|
|
2225
|
-
resetWithdrawalLifecycle();
|
|
2226
|
-
}
|
|
2227
|
-
onOpenChange(isOpen);
|
|
2228
|
-
};
|
|
2229
|
-
const handleBack = () => {
|
|
2230
|
-
if (transferTarget) {
|
|
2231
|
-
handleOpenChange(false);
|
|
2232
|
-
return;
|
|
2233
|
-
}
|
|
2234
|
-
setConfirmError(null);
|
|
2235
|
-
setFlowState({ status: "form", formStep: initialFormStep });
|
|
2236
|
-
};
|
|
2237
|
-
const handleRetry = () => {
|
|
2238
|
-
setConfirmError(null);
|
|
2239
|
-
setIsConfirming(false);
|
|
2240
|
-
resetWithdrawalLifecycle();
|
|
2241
|
-
setFlowState({ status: "form", formStep: "withdraw-amount" });
|
|
2242
|
-
};
|
|
2243
|
-
const handleConfirm = () => __async(null, null, function* () {
|
|
2244
|
-
if (isConfirming || transferTarget && (withdrawFlow.destinationWallet !== transferTarget.address || withdrawFlow.selectedNetwork !== transferTarget.chainId || withdrawFlow.selectedToken !== transferTarget.tokenSymbol))
|
|
2245
|
-
return;
|
|
2246
|
-
setFlowState({ status: "loading" });
|
|
2247
|
-
setIsConfirming(true);
|
|
2248
|
-
setConfirmError(null);
|
|
2249
|
-
try {
|
|
2250
|
-
yield onSelectWithdrawProvider("wallet");
|
|
2251
|
-
} catch (err) {
|
|
2252
|
-
const errorMessage = err instanceof Error ? err.message : "Withdrawal failed. Please try again.";
|
|
2253
|
-
setConfirmError(errorMessage);
|
|
2254
|
-
setFlowState({ status: "failed", errorMessage });
|
|
2255
|
-
} finally {
|
|
2256
|
-
setIsConfirming(false);
|
|
2257
|
-
}
|
|
2258
|
-
});
|
|
2259
|
-
const withdrawTokenOptions = withTokenIcons(withdrawFlow.tokenOptions);
|
|
2260
|
-
const withdrawNetworkOptions = withNetworkIcons(withdrawFlow.networkOptions);
|
|
2261
|
-
const requestedWithdrawal = `${withdrawFlow.amount} ${withdrawFlow.selectedToken}`.trim();
|
|
2262
|
-
const modalMaxWidth = flowState.status === "form" && flowState.formStep === "method" ? "600px" : "480px";
|
|
2263
|
-
const resultStatus = flowState.status;
|
|
2264
|
-
const terminalSummary = buildTerminalSummary({
|
|
2265
|
-
fallbackSummary: withdrawFlow.purchaseSummary,
|
|
2266
|
-
lifecycleCompletedAmountRaw: withdrawalLifecycleState.completedAmountRaw,
|
|
2267
|
-
lifecycleRequestedAmountRaw: withdrawalLifecycleState.requestedAmountRaw,
|
|
2268
|
-
lifecycleFeeRaw: withdrawalLifecycleState.feeRaw,
|
|
2269
|
-
tokenSymbol: withdrawFlow.selectedToken,
|
|
2270
|
-
chainId: withdrawFlow.selectedNetwork
|
|
2271
|
-
});
|
|
2272
|
-
return /* @__PURE__ */ jsx15(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs15(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": (_a = transferTarget == null ? void 0 : transferTarget.title) != null ? _a : "Withdraw", children: [
|
|
2273
|
-
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ jsx15(
|
|
2274
|
-
WithdrawMethodStep,
|
|
2275
|
-
{
|
|
2276
|
-
balance: withdrawFlow.balance,
|
|
2277
|
-
onSelectMethod: () => setFlowState({ status: "form", formStep: "withdraw-amount" })
|
|
2278
|
-
}
|
|
2279
|
-
) : null,
|
|
2280
|
-
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ jsx15(
|
|
2281
|
-
WithdrawAmountStep,
|
|
2282
|
-
{
|
|
2283
|
-
title: transferTarget == null ? void 0 : transferTarget.title,
|
|
2284
|
-
fixedDestination: !!transferTarget,
|
|
2285
|
-
amount: withdrawFlow.amount,
|
|
2286
|
-
destinationWallet: withdrawFlow.destinationWallet,
|
|
2287
|
-
balanceDisplay: withdrawFlow.balanceDisplay,
|
|
2288
|
-
tokenOptions: withdrawTokenOptions,
|
|
2289
|
-
networkOptions: withdrawNetworkOptions,
|
|
2290
|
-
selectedToken: withdrawFlow.selectedToken,
|
|
2291
|
-
selectedNetwork: withdrawFlow.selectedNetwork,
|
|
2292
|
-
destDecimals: getTokenDecimals(
|
|
2293
|
-
withdrawFlow.selectedToken,
|
|
2294
|
-
withdrawFlow.selectedNetwork
|
|
2295
|
-
),
|
|
2296
|
-
isConfirming,
|
|
2297
|
-
error: confirmError,
|
|
2298
|
-
max: withdrawFlow.isMax,
|
|
2299
|
-
onBack: handleBack,
|
|
2300
|
-
onAmountChange: onWithdrawAmountChange,
|
|
2301
|
-
onDestinationChange: onWithdrawDestinationChange,
|
|
2302
|
-
onTokenChange: onWithdrawTokenChange,
|
|
2303
|
-
onNetworkChange: onWithdrawNetworkChange,
|
|
2304
|
-
onMaxClick,
|
|
2305
|
-
onContinue: handleConfirm
|
|
2306
|
-
}
|
|
2307
|
-
) : null,
|
|
2308
|
-
flowState.status === "loading" ? /* @__PURE__ */ jsx15(
|
|
2309
|
-
WithdrawLoadingStep,
|
|
2310
|
-
{
|
|
2311
|
-
lifecycleState: withdrawalLifecycleState,
|
|
2312
|
-
onClose: () => handleOpenChange(false)
|
|
2313
|
-
}
|
|
2314
|
-
) : null,
|
|
2315
|
-
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ jsx15(
|
|
2316
|
-
WithdrawSuccessStep,
|
|
2317
|
-
{
|
|
2318
|
-
summary: terminalSummary,
|
|
2319
|
-
tokenSymbol: withdrawFlow.selectedToken,
|
|
2320
|
-
requestedWithdrawal,
|
|
2321
|
-
resultStatus,
|
|
2322
|
-
errorMessage: flowState.status === "failed" ? flowState.errorMessage : null,
|
|
2323
|
-
onDone: onDoneWithdraw,
|
|
2324
|
-
onRetry: handleRetry,
|
|
2325
|
-
onClose: () => handleOpenChange(false)
|
|
2326
|
-
}
|
|
2327
|
-
) : null
|
|
2328
|
-
] }) });
|
|
2329
|
-
}
|
|
2330
|
-
var WithdrawModal = (props) => {
|
|
2331
|
-
if (isControlledWithdrawModalProps(props)) {
|
|
2332
|
-
return /* @__PURE__ */ jsx15(WithdrawModalControlled, __spreadValues({}, props));
|
|
2333
|
-
}
|
|
2334
|
-
return /* @__PURE__ */ jsx15(WithdrawModalSelfDriven, __spreadValues({}, props));
|
|
2335
|
-
};
|
|
2336
|
-
WithdrawModal.displayName = "WithdrawModal";
|
|
2337
|
-
|
|
2338
|
-
// src/notifications/deposit-notification-events.ts
|
|
2339
|
-
var AGG_DEPOSIT_NOTIFICATION_EVENT = "agg:deposit-notification";
|
|
2340
|
-
var dispatchAggDepositNotification = (detail) => {
|
|
2341
|
-
if (typeof window === "undefined") return;
|
|
2342
|
-
window.dispatchEvent(new CustomEvent(AGG_DEPOSIT_NOTIFICATION_EVENT, { detail }));
|
|
2343
|
-
};
|
|
2344
|
-
var subscribeAggDepositNotification = (handler) => {
|
|
2345
|
-
if (typeof window === "undefined") return () => {
|
|
2346
|
-
};
|
|
2347
|
-
const handleDepositNotification = (event) => {
|
|
2348
|
-
if (!(event instanceof CustomEvent)) return;
|
|
2349
|
-
handler(event.detail);
|
|
2350
|
-
};
|
|
2351
|
-
window.addEventListener(AGG_DEPOSIT_NOTIFICATION_EVENT, handleDepositNotification);
|
|
2352
|
-
return () => {
|
|
2353
|
-
window.removeEventListener(AGG_DEPOSIT_NOTIFICATION_EVENT, handleDepositNotification);
|
|
2354
|
-
};
|
|
2355
|
-
};
|
|
2356
|
-
|
|
2357
|
-
// src/trading/manage-betdex-account-modal.tsx
|
|
2358
|
-
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
2359
|
-
import { useLabels as useLabels19 } from "@agg-build/hooks";
|
|
2360
|
-
import * as Dialog7 from "@radix-ui/react-dialog";
|
|
2361
|
-
|
|
2362
|
-
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
2363
|
-
import { useState as useState11 } from "react";
|
|
2364
|
-
import { useHostedVenueAccount, useLabels as useLabels17 } from "@agg-build/hooks";
|
|
2365
|
-
import { Venue as Venue5 } from "@agg-build/sdk";
|
|
2366
|
-
|
|
2367
|
-
// src/pages/user-profile/components/betdex-account-transfers.tsx
|
|
2368
|
-
import { useState as useState9 } from "react";
|
|
2369
|
-
import { useDepositAddresses, useHostedVenueTransfers, useLabels as useLabels15 } from "@agg-build/hooks";
|
|
2370
|
-
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2371
|
-
function hostedWithdrawalRaw(value) {
|
|
2372
|
-
var _a;
|
|
2373
|
-
const match = /^([0-9]{1,26})(?:\.([0-9]{1,6}))?$/.exec(value.trim());
|
|
2374
|
-
if (!match) return null;
|
|
2375
|
-
const raw = BigInt(match[1]) * BigInt(1e6) + BigInt(((_a = match[2]) != null ? _a : "").padEnd(6, "0"));
|
|
2376
|
-
return raw > BigInt(0) ? raw.toString() : null;
|
|
2377
|
-
}
|
|
2378
|
-
var amountText = (raw) => {
|
|
2379
|
-
const value = BigInt(raw);
|
|
2380
|
-
const fraction = (value % BigInt(1e6)).toString().padStart(6, "0").replace(/0+$/, "");
|
|
2381
|
-
return (value / BigInt(1e6)).toString() + (fraction ? "." + fraction : "");
|
|
2382
|
-
};
|
|
2383
|
-
function BetdexAccountTransfers({
|
|
2384
|
-
accountId,
|
|
2385
|
-
environment,
|
|
2386
|
-
availableRaw,
|
|
2387
|
-
canDeposit,
|
|
2388
|
-
onWalletDeposit
|
|
2389
|
-
}) {
|
|
2390
|
-
const labels = useLabels15().userProfile.hostedBetdex;
|
|
2391
|
-
const transfer = useHostedVenueTransfers(accountId, environment);
|
|
2392
|
-
const [showWithdraw, setShowWithdraw] = useState9(false);
|
|
2393
|
-
const wallet = useDepositAddresses({
|
|
2394
|
-
enabled: transfer.isAvailable && environment === "production" && showWithdraw
|
|
2395
|
-
});
|
|
2396
|
-
const [amount2, setAmount] = useState9("");
|
|
2397
|
-
const [destination, setDestination] = useState9("");
|
|
2398
|
-
const [actionError, setActionError] = useState9(false);
|
|
2399
|
-
const raw = hostedWithdrawalRaw(amount2);
|
|
2400
|
-
const withinBalance = raw !== null && (availableRaw === void 0 || BigInt(raw) <= BigInt(availableRaw));
|
|
2401
|
-
const validDestination = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(destination.trim());
|
|
2402
|
-
const result = transfer.withdrawal.data;
|
|
2403
|
-
const terminal = (result == null ? void 0 : result.status) === "confirmed" || (result == null ? void 0 : result.status) === "failed";
|
|
2404
|
-
const run = (work) => {
|
|
2405
|
-
setActionError(false);
|
|
2406
|
-
void work().catch(() => setActionError(true));
|
|
2407
|
-
};
|
|
2408
|
-
if (!transfer.isAvailable) return null;
|
|
2409
|
-
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-3 border-t border-agg-separator pt-3", children: [
|
|
2410
|
-
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-2", children: [
|
|
2411
|
-
canDeposit && environment === "production" && onWalletDeposit ? /* @__PURE__ */ jsx16(
|
|
2412
|
-
Button,
|
|
2413
|
-
{
|
|
2414
|
-
type: "button",
|
|
2415
|
-
variant: "secondary",
|
|
2416
|
-
size: "small",
|
|
2417
|
-
disabled: transfer.deposit.isPending,
|
|
2418
|
-
isLoading: transfer.deposit.isPending,
|
|
2419
|
-
onClick: () => run(() => __async(null, null, function* () {
|
|
2420
|
-
const response = yield transfer.deposit.mutateAsync();
|
|
2421
|
-
onWalletDeposit(response.result.address);
|
|
2422
|
-
})),
|
|
2423
|
-
children: labels.fromWallet
|
|
2424
|
-
}
|
|
2425
|
-
) : null,
|
|
2426
|
-
canDeposit ? /* @__PURE__ */ jsx16(
|
|
2427
|
-
Button,
|
|
2428
|
-
{
|
|
2429
|
-
type: "button",
|
|
2430
|
-
variant: "secondary",
|
|
2431
|
-
size: "small",
|
|
2432
|
-
"aria-label": labels.deposit,
|
|
2433
|
-
isLoading: transfer.deposit.isPending,
|
|
2434
|
-
disabled: transfer.deposit.isPending,
|
|
2435
|
-
onClick: () => run(() => transfer.deposit.mutateAsync()),
|
|
2436
|
-
children: labels.deposit
|
|
2437
|
-
}
|
|
2438
|
-
) : null,
|
|
2439
|
-
/* @__PURE__ */ jsx16(
|
|
2440
|
-
Button,
|
|
2441
|
-
{
|
|
2442
|
-
type: "button",
|
|
2443
|
-
variant: "secondary",
|
|
2444
|
-
size: "small",
|
|
2445
|
-
"aria-expanded": showWithdraw || !!transfer.request,
|
|
2446
|
-
onClick: () => setShowWithdraw((value) => !value),
|
|
2447
|
-
children: labels.withdraw
|
|
2448
|
-
}
|
|
2449
|
-
)
|
|
2450
|
-
] }),
|
|
2451
|
-
transfer.deposit.data ? /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2452
|
-
/* @__PURE__ */ jsx16("p", { className: "text-agg-muted-foreground", children: labels.depositInstructions[environment] }),
|
|
2453
|
-
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 text-agg-muted-foreground", children: [
|
|
2454
|
-
labels.depositAddress,
|
|
2455
|
-
/* @__PURE__ */ jsx16(
|
|
2456
|
-
"input",
|
|
2457
|
-
{
|
|
2458
|
-
readOnly: true,
|
|
2459
|
-
value: transfer.deposit.data.address,
|
|
2460
|
-
onFocus: (event) => event.currentTarget.select(),
|
|
2461
|
-
className: "w-full rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
2462
|
-
}
|
|
2463
|
-
)
|
|
2464
|
-
] })
|
|
2465
|
-
] }) : null,
|
|
2466
|
-
transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */ jsx16("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.transferUnavailable }) : null,
|
|
2467
|
-
transfer.request ? /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2468
|
-
/* @__PURE__ */ jsxs16("p", { children: [
|
|
2469
|
-
labels.withdrawalAmount,
|
|
2470
|
-
": ",
|
|
2471
|
-
amountText(transfer.request.amountRaw)
|
|
2472
|
-
] }),
|
|
2473
|
-
/* @__PURE__ */ jsxs16("p", { className: "break-all", children: [
|
|
2474
|
-
labels.withdrawalDestination,
|
|
2475
|
-
": ",
|
|
2476
|
-
transfer.request.destinationAddress
|
|
2477
|
-
] }),
|
|
2478
|
-
/* @__PURE__ */ jsx16("p", { role: "status", children: result ? labels.withdrawalStatuses[result.status] : labels.withdrawalUnknown }),
|
|
2479
|
-
terminal ? /* @__PURE__ */ jsx16(
|
|
2480
|
-
Button,
|
|
2481
|
-
{
|
|
2482
|
-
type: "button",
|
|
2483
|
-
variant: "tertiary",
|
|
2484
|
-
size: "small",
|
|
2485
|
-
onClick: () => {
|
|
2486
|
-
transfer.clear();
|
|
2487
|
-
setAmount("");
|
|
2488
|
-
setDestination("");
|
|
2489
|
-
setActionError(false);
|
|
2490
|
-
setShowWithdraw(false);
|
|
2491
|
-
},
|
|
2492
|
-
children: labels.withdrawalNew
|
|
2493
|
-
}
|
|
2494
|
-
) : /* @__PURE__ */ jsx16(
|
|
2495
|
-
Button,
|
|
2496
|
-
{
|
|
2497
|
-
type: "button",
|
|
2498
|
-
variant: "tertiary",
|
|
2499
|
-
size: "small",
|
|
2500
|
-
"aria-label": result ? labels.withdrawalCheck : labels.withdrawalRetry,
|
|
2501
|
-
isLoading: transfer.withdrawal.isPending,
|
|
2502
|
-
disabled: transfer.withdrawal.isPending,
|
|
2503
|
-
onClick: () => run(transfer.check),
|
|
2504
|
-
children: result ? labels.withdrawalCheck : labels.withdrawalRetry
|
|
2505
|
-
}
|
|
2506
|
-
)
|
|
2507
|
-
] }) : showWithdraw ? /* @__PURE__ */ jsxs16(
|
|
2508
|
-
"form",
|
|
2509
|
-
{
|
|
2510
|
-
className: "flex flex-col gap-3",
|
|
2511
|
-
onSubmit: (event) => {
|
|
2512
|
-
event.preventDefault();
|
|
2513
|
-
if (!raw || !withinBalance || !validDestination || !transfer.ready) return;
|
|
2514
|
-
run(() => transfer.submit(raw, destination.trim()));
|
|
2515
|
-
},
|
|
2516
|
-
children: [
|
|
2517
|
-
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
2518
|
-
labels.withdrawalAmount,
|
|
2519
|
-
/* @__PURE__ */ jsx16(
|
|
2520
|
-
"input",
|
|
2521
|
-
{
|
|
2522
|
-
inputMode: "decimal",
|
|
2523
|
-
autoComplete: "off",
|
|
2524
|
-
value: amount2,
|
|
2525
|
-
onChange: (event) => setAmount(event.target.value),
|
|
2526
|
-
className: "rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
2527
|
-
}
|
|
2528
|
-
)
|
|
2529
|
-
] }),
|
|
2530
|
-
environment === "production" ? /* @__PURE__ */ jsx16(
|
|
2531
|
-
Button,
|
|
2532
|
-
{
|
|
2533
|
-
type: "button",
|
|
2534
|
-
variant: "secondary",
|
|
2535
|
-
size: "small",
|
|
2536
|
-
disabled: !wallet.isReady || !wallet.svmAddress || wallet.isError,
|
|
2537
|
-
isLoading: wallet.isLoading,
|
|
2538
|
-
onClick: () => {
|
|
2539
|
-
if (wallet.isReady && wallet.svmAddress && !wallet.isError)
|
|
2540
|
-
setDestination(wallet.svmAddress);
|
|
2541
|
-
},
|
|
2542
|
-
children: labels.toWallet
|
|
2543
|
-
}
|
|
2544
|
-
) : null,
|
|
2545
|
-
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
2546
|
-
labels.withdrawalDestination,
|
|
2547
|
-
/* @__PURE__ */ jsx16(
|
|
2548
|
-
"input",
|
|
2549
|
-
{
|
|
2550
|
-
autoComplete: "off",
|
|
2551
|
-
spellCheck: false,
|
|
2552
|
-
value: destination,
|
|
2553
|
-
onChange: (event) => setDestination(event.target.value),
|
|
2554
|
-
className: "rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
2555
|
-
}
|
|
2556
|
-
)
|
|
2557
|
-
] }),
|
|
2558
|
-
/* @__PURE__ */ jsx16(
|
|
2559
|
-
Button,
|
|
2560
|
-
{
|
|
2561
|
-
type: "submit",
|
|
2562
|
-
variant: "primary",
|
|
2563
|
-
size: "small",
|
|
2564
|
-
"aria-label": labels.withdrawalSubmit,
|
|
2565
|
-
disabled: !withinBalance || !validDestination || !transfer.ready || transfer.withdrawal.isPending,
|
|
2566
|
-
isLoading: transfer.withdrawal.isPending,
|
|
2567
|
-
children: labels.withdrawalSubmit
|
|
2568
|
-
}
|
|
2569
|
-
)
|
|
2570
|
-
]
|
|
2571
|
-
}
|
|
2572
|
-
) : null
|
|
2573
|
-
] });
|
|
2574
|
-
}
|
|
2575
|
-
|
|
2576
|
-
// src/pages/user-profile/components/betdex-account-activity.tsx
|
|
2577
|
-
import { useState as useState10 } from "react";
|
|
2578
|
-
import { useHostedVenueActivity, useLabels as useLabels16 } from "@agg-build/hooks";
|
|
2579
|
-
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2580
|
-
function amount(raw) {
|
|
2581
|
-
const negative = raw.startsWith("-");
|
|
2582
|
-
const digits = (negative ? raw.slice(1) : raw).padStart(19, "0");
|
|
2583
|
-
const fraction = digits.slice(-18).replace(/0+$/, "");
|
|
2584
|
-
return `${negative ? "-" : "+"}${digits.slice(0, -18)}${fraction ? `.${fraction}` : ""}`;
|
|
2585
|
-
}
|
|
2586
|
-
function BetdexAccountActivity({
|
|
2587
|
-
accountId,
|
|
2588
|
-
environment
|
|
2589
|
-
}) {
|
|
2590
|
-
const labels = useLabels16().userProfile.hostedBetdex;
|
|
2591
|
-
const [page, setPage] = useState10(0);
|
|
2592
|
-
const { activity, isAvailable } = useHostedVenueActivity("betdex", page);
|
|
2593
|
-
if (!isAvailable) return null;
|
|
2594
|
-
const data = activity.data;
|
|
2595
|
-
const valid = (data == null ? void 0 : data.accountId) === accountId && data.environment === environment && data.page === page;
|
|
2596
|
-
const unavailable = activity.isError || !!data && !valid;
|
|
2597
|
-
return /* @__PURE__ */ jsxs17(
|
|
2598
|
-
"section",
|
|
2599
|
-
{
|
|
2600
|
-
"aria-label": labels.activityTitle,
|
|
2601
|
-
className: "flex flex-col gap-3 border-t border-agg-separator pt-3",
|
|
2602
|
-
children: [
|
|
2603
|
-
/* @__PURE__ */ jsx17("h4", { className: "agg-type-label text-agg-foreground", children: labels.activityTitle }),
|
|
2604
|
-
/* @__PURE__ */ jsx17("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityDescription }),
|
|
2605
|
-
activity.isPending ? /* @__PURE__ */ jsx17(SkeletonBlock, { className: "h-16 w-full" }) : null,
|
|
2606
|
-
unavailable ? /* @__PURE__ */ jsx17("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.activityUnavailable }) : null,
|
|
2607
|
-
valid && !unavailable ? data.items.length ? /* @__PURE__ */ jsx17("ul", { className: "flex flex-col gap-3 agg-type-caption", children: data.items.map((item) => /* @__PURE__ */ jsxs17("li", { className: "flex flex-col gap-1", children: [
|
|
2608
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex justify-between gap-3 text-agg-foreground", children: [
|
|
2609
|
-
/* @__PURE__ */ jsx17("span", { children: labels.activityCodes[item.code] }),
|
|
2610
|
-
/* @__PURE__ */ jsxs17("span", { className: "break-all tabular-nums", children: [
|
|
2611
|
-
amount(item.amountRaw),
|
|
2612
|
-
" ",
|
|
2613
|
-
data.asset
|
|
2614
|
-
] })
|
|
2615
|
-
] }),
|
|
2616
|
-
/* @__PURE__ */ jsx17("time", { dateTime: item.createdAt, className: "text-agg-muted-foreground", children: new Date(item.createdAt).toLocaleString() })
|
|
2617
|
-
] }, item.id)) }) : /* @__PURE__ */ jsx17("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityEmpty }) : null,
|
|
2618
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap gap-2", children: [
|
|
2619
|
-
/* @__PURE__ */ jsx17(
|
|
2620
|
-
Button,
|
|
2621
|
-
{
|
|
2622
|
-
type: "button",
|
|
2623
|
-
variant: "tertiary",
|
|
2624
|
-
size: "small",
|
|
2625
|
-
disabled: activity.isFetching || page === 0,
|
|
2626
|
-
onClick: () => setPage((value) => Math.max(0, value - 1)),
|
|
2627
|
-
children: labels.activityPrevious
|
|
2628
|
-
}
|
|
2629
|
-
),
|
|
2630
|
-
/* @__PURE__ */ jsx17(
|
|
2631
|
-
Button,
|
|
2632
|
-
{
|
|
2633
|
-
type: "button",
|
|
2634
|
-
variant: "tertiary",
|
|
2635
|
-
size: "small",
|
|
2636
|
-
disabled: activity.isFetching || unavailable || !valid || data.nextPage === null,
|
|
2637
|
-
onClick: () => {
|
|
2638
|
-
if (valid && data.nextPage !== null) setPage(data.nextPage);
|
|
2639
|
-
},
|
|
2640
|
-
children: labels.activityNext
|
|
2641
|
-
}
|
|
2642
|
-
),
|
|
2643
|
-
/* @__PURE__ */ jsx17(
|
|
2644
|
-
Button,
|
|
2645
|
-
{
|
|
2646
|
-
type: "button",
|
|
2647
|
-
variant: "tertiary",
|
|
2648
|
-
size: "small",
|
|
2649
|
-
disabled: activity.isFetching,
|
|
2650
|
-
onClick: () => {
|
|
2651
|
-
void activity.refetch();
|
|
2652
|
-
},
|
|
2653
|
-
children: labels.activityRefresh
|
|
2654
|
-
}
|
|
2655
|
-
)
|
|
2656
|
-
] })
|
|
2657
|
-
]
|
|
2658
|
-
}
|
|
2659
|
-
);
|
|
2660
|
-
}
|
|
2661
|
-
|
|
2662
|
-
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
2663
|
-
import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2664
|
-
function BetdexAccountCard({
|
|
2665
|
-
onWalletDeposit
|
|
2666
|
-
} = {}) {
|
|
2667
|
-
var _a;
|
|
2668
|
-
const [showActivity, setShowActivity] = useState11(false);
|
|
2669
|
-
const labels = useLabels17().userProfile.hostedBetdex;
|
|
2670
|
-
const { account, provision, isAvailable } = useHostedVenueAccount("betdex");
|
|
2671
|
-
const data = account.data;
|
|
2672
|
-
if (!isAvailable || (data == null ? void 0 : data.status) === "disabled") return null;
|
|
2673
|
-
const pending = provision.isPending || (data == null ? void 0 : data.status) === "provisioning";
|
|
2674
|
-
const canCreate = (data == null ? void 0 : data.status) === "not_created" && data.provisioningEnabled;
|
|
2675
|
-
const rawLabel = (raw) => formatUsd(Number(raw) / 1e6);
|
|
2676
|
-
return /* @__PURE__ */ jsxs18(
|
|
2677
|
-
"section",
|
|
2678
|
-
{
|
|
2679
|
-
"aria-label": labels.title,
|
|
2680
|
-
className: "flex flex-col gap-3 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5",
|
|
2681
|
-
children: [
|
|
2682
|
-
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
2683
|
-
/* @__PURE__ */ jsx18(VenueLogo, { venue: Venue5.betdex, size: "small", className: "size-4" }),
|
|
2684
|
-
/* @__PURE__ */ jsx18("h3", { className: "agg-type-label text-agg-foreground", children: labels.title })
|
|
2685
|
-
] }),
|
|
2686
|
-
/* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.description }),
|
|
2687
|
-
(data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-warning", children: labels.sandbox }) : null,
|
|
2688
|
-
account.isPending ? /* @__PURE__ */ jsx18(SkeletonBlock, { className: "h-10 w-full" }) : null,
|
|
2689
|
-
(data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */ jsx18("dl", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
2690
|
-
[labels.total, data.balance.totalRaw],
|
|
2691
|
-
[labels.available, data.balance.availableRaw],
|
|
2692
|
-
[labels.reserved, data.balance.unmatchedExposureRaw]
|
|
2693
|
-
].map(([label, raw]) => /* @__PURE__ */ jsxs18("div", { className: "flex justify-between gap-3", children: [
|
|
2694
|
-
/* @__PURE__ */ jsx18("dt", { className: "text-agg-muted-foreground", children: label }),
|
|
2695
|
-
/* @__PURE__ */ jsx18("dd", { className: "text-agg-foreground", children: rawLabel(raw) })
|
|
2696
|
-
] }, label)) }) : null,
|
|
2697
|
-
pending ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioning }) : null,
|
|
2698
|
-
(data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.suspended }) : null,
|
|
2699
|
-
account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */ jsx18("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.unavailable }) : null,
|
|
2700
|
-
(data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */ jsx18("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioningUnavailable }) : null,
|
|
2701
|
-
provision.isError ? /* @__PURE__ */ jsx18("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.creationFailed }) : null,
|
|
2702
|
-
canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */ jsx18(
|
|
2703
|
-
Button,
|
|
2704
|
-
{
|
|
2705
|
-
type: "button",
|
|
2706
|
-
"aria-label": (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount,
|
|
2707
|
-
variant: "secondary",
|
|
2708
|
-
size: "small",
|
|
2709
|
-
isLoading: provision.isPending,
|
|
2710
|
-
disabled: provision.isPending || account.isError,
|
|
2711
|
-
onClick: () => provision.mutate(),
|
|
2712
|
-
children: (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount
|
|
2713
|
-
}
|
|
2714
|
-
) : null,
|
|
2715
|
-
/* @__PURE__ */ jsx18(
|
|
2716
|
-
Button,
|
|
2717
|
-
{
|
|
2718
|
-
type: "button",
|
|
2719
|
-
variant: "tertiary",
|
|
2720
|
-
size: "small",
|
|
2721
|
-
disabled: account.isFetching || provision.isPending,
|
|
2722
|
-
onClick: () => {
|
|
2723
|
-
void account.refetch();
|
|
2724
|
-
},
|
|
2725
|
-
children: labels.refresh
|
|
2726
|
-
}
|
|
2727
|
-
),
|
|
2728
|
-
(data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2729
|
-
/* @__PURE__ */ jsxs18("details", { className: "group/agg-betdex-funds border-t border-agg-separator pt-3", children: [
|
|
2730
|
-
/* @__PURE__ */ jsxs18("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 text-agg-sm font-agg-bold text-agg-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary [&::-webkit-details-marker]:hidden", children: [
|
|
2731
|
-
labels.manageFunds,
|
|
2732
|
-
/* @__PURE__ */ jsx18(
|
|
2733
|
-
Icon,
|
|
2734
|
-
{
|
|
2735
|
-
name: "chevron-down",
|
|
2736
|
-
size: "small",
|
|
2737
|
-
className: "transition-transform group-open/agg-betdex-funds:rotate-180"
|
|
2738
|
-
}
|
|
2739
|
-
)
|
|
2740
|
-
] }),
|
|
2741
|
-
/* @__PURE__ */ jsx18(
|
|
2742
|
-
BetdexAccountTransfers,
|
|
2743
|
-
{
|
|
2744
|
-
accountId: data.accountId,
|
|
2745
|
-
environment: data.environment,
|
|
2746
|
-
availableRaw: data.balanceStatus === "available" ? (_a = data.balance) == null ? void 0 : _a.availableRaw : void 0,
|
|
2747
|
-
canDeposit: data.status === "active",
|
|
2748
|
-
onWalletDeposit
|
|
2749
|
-
},
|
|
2750
|
-
`transfers:${data.accountId}:${data.environment}`
|
|
2751
|
-
)
|
|
2752
|
-
] }),
|
|
2753
|
-
/* @__PURE__ */ jsx18(
|
|
2754
|
-
Button,
|
|
2755
|
-
{
|
|
2756
|
-
type: "button",
|
|
2757
|
-
variant: "tertiary",
|
|
2758
|
-
size: "small",
|
|
2759
|
-
"aria-expanded": showActivity,
|
|
2760
|
-
onClick: () => setShowActivity((shown) => !shown),
|
|
2761
|
-
children: showActivity ? labels.hideActivity : labels.showActivity
|
|
2762
|
-
}
|
|
2763
|
-
),
|
|
2764
|
-
showActivity ? /* @__PURE__ */ jsx18(
|
|
2765
|
-
BetdexAccountActivity,
|
|
2766
|
-
{
|
|
2767
|
-
accountId: data.accountId,
|
|
2768
|
-
environment: data.environment
|
|
2769
|
-
},
|
|
2770
|
-
`${data.accountId}:${data.environment}`
|
|
2771
|
-
) : null
|
|
2772
|
-
] }) : null
|
|
2773
|
-
]
|
|
2774
|
-
}
|
|
2775
|
-
);
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
// src/pages/user-profile/components/betdex-wallet-deposit.tsx
|
|
2779
|
-
import { useEffect as useEffect6 } from "react";
|
|
2780
|
-
import { useLabels as useLabels18 } from "@agg-build/hooks";
|
|
2781
|
-
import { useWithdrawFlow as useWithdrawFlow2 } from "@agg-build/hooks/withdraw";
|
|
2782
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2783
|
-
function BetdexWalletDeposit({
|
|
2784
|
-
address,
|
|
2785
|
-
onClose
|
|
2786
|
-
}) {
|
|
2787
|
-
const labels = useLabels18().userProfile.hostedBetdex;
|
|
2788
|
-
const flow = useWithdrawFlow2({
|
|
2789
|
-
open: true,
|
|
2790
|
-
onOpenChange: (open) => {
|
|
2791
|
-
if (!open) onClose();
|
|
2792
|
-
}
|
|
2793
|
-
});
|
|
2794
|
-
const { onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange } = flow;
|
|
2795
|
-
useEffect6(() => {
|
|
2796
|
-
onWithdrawDestinationChange(address);
|
|
2797
|
-
onWithdrawNetworkChange("792703809");
|
|
2798
|
-
onWithdrawTokenChange("USDC");
|
|
2799
|
-
}, [address, onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange]);
|
|
2800
|
-
return /* @__PURE__ */ jsx19(
|
|
2801
|
-
WithdrawModal,
|
|
2802
|
-
__spreadProps(__spreadValues({}, flow), {
|
|
2803
|
-
transferTarget: {
|
|
2804
|
-
title: labels.transferToBetdex,
|
|
2805
|
-
address,
|
|
2806
|
-
chainId: "792703809",
|
|
2807
|
-
tokenSymbol: "USDC"
|
|
2808
|
-
}
|
|
2809
|
-
})
|
|
2810
|
-
);
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
|
-
// src/trading/manage-betdex-account-modal.tsx
|
|
2814
|
-
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2815
|
-
function ManageBetdexAccountModal({
|
|
2816
|
-
open,
|
|
2817
|
-
onOpenChange,
|
|
2818
|
-
userId
|
|
2819
|
-
}) {
|
|
2820
|
-
const labels = useLabels19();
|
|
2821
|
-
const [fundingTarget, setFundingTarget] = useState12(
|
|
2822
|
-
null
|
|
2823
|
-
);
|
|
2824
|
-
const currentTarget = (fundingTarget == null ? void 0 : fundingTarget.userId) === userId ? fundingTarget : null;
|
|
2825
|
-
useEffect7(() => {
|
|
2826
|
-
if (!open) setFundingTarget(null);
|
|
2827
|
-
}, [open]);
|
|
2828
|
-
useEffect7(() => setFundingTarget(null), [userId]);
|
|
2829
|
-
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
2830
|
-
/* @__PURE__ */ jsx20(Modal, { open: open && !currentTarget, onOpenChange, children: /* @__PURE__ */ jsxs19(Modal.Container, { maxWidth: "600px", "aria-label": labels.trading.manageBetdexAccount, children: [
|
|
2831
|
-
/* @__PURE__ */ jsx20(
|
|
2832
|
-
Dialog7.Close,
|
|
2833
|
-
{
|
|
2834
|
-
"aria-label": labels.common.close,
|
|
2835
|
-
className: "absolute right-4 top-4 z-10 flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-muted-foreground hover:bg-agg-quaternary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent",
|
|
2836
|
-
children: /* @__PURE__ */ jsx20(Icon, { name: "close", size: "medium" })
|
|
2837
|
-
}
|
|
2838
|
-
),
|
|
2839
|
-
/* @__PURE__ */ jsxs19(Modal.Body, { classNames: { root: "!px-5 !py-16" }, children: [
|
|
2840
|
-
/* @__PURE__ */ jsx20(Dialog7.Title, { className: "sr-only", children: labels.trading.manageBetdexAccount }),
|
|
2841
|
-
/* @__PURE__ */ jsx20(Dialog7.Description, { className: "sr-only", children: labels.userProfile.hostedBetdex.description }),
|
|
2842
|
-
open ? /* @__PURE__ */ jsx20(
|
|
2843
|
-
BetdexAccountCard,
|
|
2844
|
-
{
|
|
2845
|
-
onWalletDeposit: userId ? (address) => setFundingTarget({ userId, address }) : void 0
|
|
2846
|
-
}
|
|
2847
|
-
) : null
|
|
2848
|
-
] })
|
|
2849
|
-
] }) }),
|
|
2850
|
-
open && currentTarget ? /* @__PURE__ */ jsx20(
|
|
2851
|
-
BetdexWalletDeposit,
|
|
2852
|
-
{
|
|
2853
|
-
address: currentTarget.address,
|
|
2854
|
-
onClose: () => setFundingTarget(null)
|
|
2855
|
-
},
|
|
2856
|
-
currentTarget.userId
|
|
2857
|
-
) : null
|
|
2858
|
-
] });
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
export {
|
|
2862
|
-
dispatchAggDepositNotification,
|
|
2863
|
-
subscribeAggDepositNotification,
|
|
2864
|
-
GeoBlockBanner,
|
|
2865
|
-
SharedKycModal,
|
|
2866
|
-
HowItWorksStep,
|
|
2867
|
-
ProfileSetupStep,
|
|
2868
|
-
ConnectAccountsStep,
|
|
2869
|
-
ConnectOnchainModal,
|
|
2870
|
-
ConnectKalshiModal,
|
|
2871
|
-
ConnectProphetxModal,
|
|
2872
|
-
ConnectNovigModal,
|
|
2873
|
-
OnboardingModal,
|
|
2874
|
-
mapNetworksToOptions,
|
|
2875
|
-
DEFAULT_CURRENCY_OPTIONS,
|
|
2876
|
-
withTokenIcons,
|
|
2877
|
-
withNetworkIcons,
|
|
2878
|
-
mergeSelectOptionsUnique,
|
|
2879
|
-
TransferFeeSummary,
|
|
2880
|
-
buildTerminalSummary,
|
|
2881
|
-
WithdrawModal,
|
|
2882
|
-
ManageBetdexAccountModal
|
|
2883
|
-
};
|