be-components 7.4.8 → 7.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ApiOverrides/index.js +4 -0
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/BetRouter/api/index.js +884 -0
- package/lib/commonjs/BetRouter/api/index.js.map +1 -0
- package/lib/commonjs/BetRouter/api/types.js +2 -0
- package/lib/commonjs/BetRouter/api/types.js.map +1 -0
- package/lib/commonjs/BetRouter/components/AccountManager.js +592 -0
- package/lib/commonjs/BetRouter/components/AccountManager.js.map +1 -0
- package/lib/commonjs/BetRouter/components/AdminPortal.js +51 -0
- package/lib/commonjs/BetRouter/components/AdminPortal.js.map +1 -0
- package/lib/commonjs/BetRouter/components/BuyOpportunities.js +550 -0
- package/lib/commonjs/BetRouter/components/BuyOpportunities.js.map +1 -0
- package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js +320 -0
- package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js.map +1 -0
- package/lib/commonjs/BetRouter/components/ContestLiquidity.js +666 -0
- package/lib/commonjs/BetRouter/components/ContestLiquidity.js.map +1 -0
- package/lib/commonjs/BetRouter/components/ContestSelector.js +193 -0
- package/lib/commonjs/BetRouter/components/ContestSelector.js.map +1 -0
- package/lib/commonjs/BetRouter/components/MyOpportunities.js +332 -0
- package/lib/commonjs/BetRouter/components/MyOpportunities.js.map +1 -0
- package/lib/commonjs/BetRouter/components/MyOpportunities.tsx.bak +440 -0
- package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js +545 -0
- package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js.map +1 -0
- package/lib/commonjs/BetRouter/components/OpportunityHistory.js +489 -0
- package/lib/commonjs/BetRouter/components/OpportunityHistory.js.map +1 -0
- package/lib/commonjs/BetRouter/components/PartnerCredentials.js +229 -0
- package/lib/commonjs/BetRouter/components/PartnerCredentials.js.map +1 -0
- package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js +262 -0
- package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/AutoFillView.js +380 -0
- package/lib/commonjs/BetRouter/components/admin/AutoFillView.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/ConfigManager.js +814 -0
- package/lib/commonjs/BetRouter/components/admin/ConfigManager.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/JobManager.js +895 -0
- package/lib/commonjs/BetRouter/components/admin/JobManager.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueContests.js +2844 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueContests.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js +378 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js.map +1 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js +795 -0
- package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
- package/lib/commonjs/BetRouter/index.js +411 -0
- package/lib/commonjs/BetRouter/index.js.map +1 -0
- package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js +312 -0
- package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
- package/lib/commonjs/BetRouter/layouts/DesktopLayout.js +271 -0
- package/lib/commonjs/BetRouter/layouts/DesktopLayout.js.map +1 -0
- package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js +435 -0
- package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
- package/lib/commonjs/BetRouter/layouts/MobileLayout.js +293 -0
- package/lib/commonjs/BetRouter/layouts/MobileLayout.js.map +1 -0
- package/lib/commonjs/BetRouter/types/ADMIN_PORTAL.md +863 -0
- package/lib/commonjs/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
- package/lib/commonjs/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
- package/lib/commonjs/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
- package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
- package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
- package/lib/commonjs/BetRouter/types/README.md +249 -0
- package/lib/commonjs/BetRouter/types/accounts.js +2 -0
- package/lib/commonjs/BetRouter/types/accounts.js.map +1 -0
- package/lib/commonjs/BetRouter/types/api-contracts.js +776 -0
- package/lib/commonjs/BetRouter/types/api-contracts.js.map +1 -0
- package/lib/commonjs/BetRouter/types/config.js +2 -0
- package/lib/commonjs/BetRouter/types/config.js.map +1 -0
- package/lib/commonjs/BetRouter/types/contests.js +2 -0
- package/lib/commonjs/BetRouter/types/contests.js.map +1 -0
- package/lib/commonjs/BetRouter/types/credentials.js +90 -0
- package/lib/commonjs/BetRouter/types/credentials.js.map +1 -0
- package/lib/commonjs/BetRouter/types/index.js +149 -0
- package/lib/commonjs/BetRouter/types/index.js.map +1 -0
- package/lib/commonjs/BetRouter/types/jobs.js +2 -0
- package/lib/commonjs/BetRouter/types/jobs.js.map +1 -0
- package/lib/commonjs/BetRouter/types/leagues.js +2 -0
- package/lib/commonjs/BetRouter/types/leagues.js.map +1 -0
- package/lib/commonjs/BetRouter/types/liquidity.js +2 -0
- package/lib/commonjs/BetRouter/types/liquidity.js.map +1 -0
- package/lib/commonjs/BetRouter/types/markets.js +2 -0
- package/lib/commonjs/BetRouter/types/markets.js.map +1 -0
- package/lib/commonjs/BetRouter/types/opportunities.js +6 -0
- package/lib/commonjs/BetRouter/types/opportunities.js.map +1 -0
- package/lib/commonjs/BetRouter/types/orders.js +2 -0
- package/lib/commonjs/BetRouter/types/orders.js.map +1 -0
- package/lib/commonjs/BetRouter/types/participants.js +2 -0
- package/lib/commonjs/BetRouter/types/participants.js.map +1 -0
- package/lib/commonjs/BetRouter/types/partners.js +2 -0
- package/lib/commonjs/BetRouter/types/partners.js.map +1 -0
- package/lib/commonjs/Charts/README.md +310 -0
- package/lib/commonjs/Charts/adapters/TradeChartAdapter.js +406 -0
- package/lib/commonjs/Charts/adapters/TradeChartAdapter.js.map +1 -0
- package/lib/commonjs/Charts/components/BaseLineChart.js +307 -0
- package/lib/commonjs/Charts/components/BaseLineChart.js.map +1 -0
- package/lib/commonjs/Charts/components/LivePriceChart.js +509 -0
- package/lib/commonjs/Charts/components/LivePriceChart.js.map +1 -0
- package/lib/commonjs/Charts/index.js +126 -0
- package/lib/commonjs/Charts/index.js.map +1 -0
- package/lib/commonjs/Charts/themes/chartTheme.js +141 -0
- package/lib/commonjs/Charts/themes/chartTheme.js.map +1 -0
- package/lib/commonjs/Charts/types.js +2 -0
- package/lib/commonjs/Charts/types.js.map +1 -0
- package/lib/commonjs/Charts/utils/formatters.js +194 -0
- package/lib/commonjs/Charts/utils/formatters.js.map +1 -0
- package/lib/commonjs/Components/Dropdown.js +5 -3
- package/lib/commonjs/Components/Dropdown.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +24 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/index.js +34 -0
- package/lib/commonjs/Components/index.js.map +1 -1
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.d.js +16 -0
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +4 -0
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/BetRouter/api/index.js +873 -0
- package/lib/module/BetRouter/api/index.js.map +1 -0
- package/lib/module/BetRouter/api/types.js +2 -0
- package/lib/module/BetRouter/api/types.js.map +1 -0
- package/lib/module/BetRouter/components/AccountManager.js +584 -0
- package/lib/module/BetRouter/components/AccountManager.js.map +1 -0
- package/lib/module/BetRouter/components/AdminPortal.js +43 -0
- package/lib/module/BetRouter/components/AdminPortal.js.map +1 -0
- package/lib/module/BetRouter/components/BuyOpportunities.js +542 -0
- package/lib/module/BetRouter/components/BuyOpportunities.js.map +1 -0
- package/lib/module/BetRouter/components/BuyOpportunityCard.js +313 -0
- package/lib/module/BetRouter/components/BuyOpportunityCard.js.map +1 -0
- package/lib/module/BetRouter/components/ContestLiquidity.js +658 -0
- package/lib/module/BetRouter/components/ContestLiquidity.js.map +1 -0
- package/lib/module/BetRouter/components/ContestSelector.js +185 -0
- package/lib/module/BetRouter/components/ContestSelector.js.map +1 -0
- package/lib/module/BetRouter/components/MyOpportunities.js +324 -0
- package/lib/module/BetRouter/components/MyOpportunities.js.map +1 -0
- package/lib/module/BetRouter/components/MyOpportunities.tsx.bak +440 -0
- package/lib/module/BetRouter/components/OpportunityDetailModal.js +538 -0
- package/lib/module/BetRouter/components/OpportunityDetailModal.js.map +1 -0
- package/lib/module/BetRouter/components/OpportunityHistory.js +481 -0
- package/lib/module/BetRouter/components/OpportunityHistory.js.map +1 -0
- package/lib/module/BetRouter/components/PartnerCredentials.js +222 -0
- package/lib/module/BetRouter/components/PartnerCredentials.js.map +1 -0
- package/lib/module/BetRouter/components/PlacedOpportunityModal.js +255 -0
- package/lib/module/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
- package/lib/module/BetRouter/components/admin/AutoFillView.js +372 -0
- package/lib/module/BetRouter/components/admin/AutoFillView.js.map +1 -0
- package/lib/module/BetRouter/components/admin/ConfigManager.js +806 -0
- package/lib/module/BetRouter/components/admin/ConfigManager.js.map +1 -0
- package/lib/module/BetRouter/components/admin/JobManager.js +888 -0
- package/lib/module/BetRouter/components/admin/JobManager.js.map +1 -0
- package/lib/module/BetRouter/components/admin/LeagueContests.js +2836 -0
- package/lib/module/BetRouter/components/admin/LeagueContests.js.map +1 -0
- package/lib/module/BetRouter/components/admin/LeagueInfo.js +372 -0
- package/lib/module/BetRouter/components/admin/LeagueInfo.js.map +1 -0
- package/lib/module/BetRouter/components/admin/LeagueParticipants.js +787 -0
- package/lib/module/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
- package/lib/module/BetRouter/index.js +399 -0
- package/lib/module/BetRouter/index.js.map +1 -0
- package/lib/module/BetRouter/layouts/DesktopAdminLayout.js +304 -0
- package/lib/module/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
- package/lib/module/BetRouter/layouts/DesktopLayout.js +263 -0
- package/lib/module/BetRouter/layouts/DesktopLayout.js.map +1 -0
- package/lib/module/BetRouter/layouts/MobileAdminLayout.js +427 -0
- package/lib/module/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
- package/lib/module/BetRouter/layouts/MobileLayout.js +285 -0
- package/lib/module/BetRouter/layouts/MobileLayout.js.map +1 -0
- package/lib/module/BetRouter/types/ADMIN_PORTAL.md +863 -0
- package/lib/module/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
- package/lib/module/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
- package/lib/module/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
- package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
- package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
- package/lib/module/BetRouter/types/README.md +249 -0
- package/lib/module/BetRouter/types/accounts.js +2 -0
- package/lib/module/BetRouter/types/accounts.js.map +1 -0
- package/lib/module/BetRouter/types/api-contracts.js +770 -0
- package/lib/module/BetRouter/types/api-contracts.js.map +1 -0
- package/lib/module/BetRouter/types/config.js +2 -0
- package/lib/module/BetRouter/types/config.js.map +1 -0
- package/lib/module/BetRouter/types/contests.js +2 -0
- package/lib/module/BetRouter/types/contests.js.map +1 -0
- package/lib/module/BetRouter/types/credentials.js +78 -0
- package/lib/module/BetRouter/types/credentials.js.map +1 -0
- package/lib/module/BetRouter/types/index.js +17 -0
- package/lib/module/BetRouter/types/index.js.map +1 -0
- package/lib/module/BetRouter/types/jobs.js +2 -0
- package/lib/module/BetRouter/types/jobs.js.map +1 -0
- package/lib/module/BetRouter/types/leagues.js +2 -0
- package/lib/module/BetRouter/types/leagues.js.map +1 -0
- package/lib/module/BetRouter/types/liquidity.js +2 -0
- package/lib/module/BetRouter/types/liquidity.js.map +1 -0
- package/lib/module/BetRouter/types/markets.js +2 -0
- package/lib/module/BetRouter/types/markets.js.map +1 -0
- package/lib/module/BetRouter/types/opportunities.js +2 -0
- package/lib/module/BetRouter/types/opportunities.js.map +1 -0
- package/lib/module/BetRouter/types/orders.js +2 -0
- package/lib/module/BetRouter/types/orders.js.map +1 -0
- package/lib/module/BetRouter/types/participants.js +2 -0
- package/lib/module/BetRouter/types/participants.js.map +1 -0
- package/lib/module/BetRouter/types/partners.js +2 -0
- package/lib/module/BetRouter/types/partners.js.map +1 -0
- package/lib/module/Charts/README.md +310 -0
- package/lib/module/Charts/adapters/TradeChartAdapter.js +400 -0
- package/lib/module/Charts/adapters/TradeChartAdapter.js.map +1 -0
- package/lib/module/Charts/components/BaseLineChart.js +303 -0
- package/lib/module/Charts/components/BaseLineChart.js.map +1 -0
- package/lib/module/Charts/components/LivePriceChart.js +502 -0
- package/lib/module/Charts/components/LivePriceChart.js.map +1 -0
- package/lib/module/Charts/index.js +36 -0
- package/lib/module/Charts/index.js.map +1 -0
- package/lib/module/Charts/themes/chartTheme.js +134 -0
- package/lib/module/Charts/themes/chartTheme.js.map +1 -0
- package/lib/module/Charts/types.js +2 -0
- package/lib/module/Charts/types.js.map +1 -0
- package/lib/module/Charts/utils/formatters.js +178 -0
- package/lib/module/Charts/utils/formatters.js.map +1 -0
- package/lib/module/Components/Dropdown.js +5 -3
- package/lib/module/Components/Dropdown.js.map +1 -1
- package/lib/module/Components/Icons.js +24 -1
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/index.js +3 -0
- package/lib/module/Components/index.js.map +1 -1
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js +16 -0
- package/lib/module/types.d.js.map +1 -1
- package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts +109 -0
- package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts +16 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts +9 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts +16 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts +11 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts +11 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts +8 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts +14 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts +9 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts +10 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts +11 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts +4 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts +4 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts +4 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts +7 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts +6 -0
- package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/index.d.ts +8 -0
- package/lib/typescript/lib/commonjs/BetRouter/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts +20 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts +20 -0
- package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts +743 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts +56 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts +2 -0
- package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts +87 -0
- package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts +31 -0
- package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts +45 -0
- package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/index.d.ts +95 -0
- package/lib/typescript/lib/commonjs/Charts/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts +106 -0
- package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/types.d.ts +2 -0
- package/lib/typescript/lib/commonjs/Charts/types.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts +24 -0
- package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/Dropdown.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +4 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/BetRouter/api/index.d.ts +108 -0
- package/lib/typescript/lib/module/BetRouter/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/api/types.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/api/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts +16 -0
- package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts +16 -0
- package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
- package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts +11 -0
- package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts +11 -0
- package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts +8 -0
- package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts +15 -0
- package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts +11 -0
- package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts +12 -0
- package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts +4 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts +4 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts +4 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
- package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/index.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts +20 -0
- package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
- package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts +20 -0
- package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts +742 -0
- package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/config.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/config.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/contests.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/contests.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts +55 -0
- package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/index.d.ts +14 -0
- package/lib/typescript/lib/module/BetRouter/types/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/markets.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/markets.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/orders.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/orders.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/participants.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/participants.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetRouter/types/partners.d.ts +2 -0
- package/lib/typescript/lib/module/BetRouter/types/partners.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts +81 -0
- package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts +31 -0
- package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts +41 -0
- package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/index.d.ts +6 -0
- package/lib/typescript/lib/module/Charts/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts +102 -0
- package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/types.d.ts +2 -0
- package/lib/typescript/lib/module/Charts/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/Charts/utils/formatters.d.ts +14 -0
- package/lib/typescript/lib/module/Charts/utils/formatters.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/Dropdown.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/index.d.ts +1 -0
- package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +3 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/BetRouter/api/index.d.ts +115 -0
- package/lib/typescript/src/BetRouter/api/index.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/api/types.d.ts +2 -0
- package/lib/typescript/src/BetRouter/api/types.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/AccountManager.d.ts +18 -0
- package/lib/typescript/src/BetRouter/components/AccountManager.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts +15 -0
- package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts +24 -0
- package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts +19 -0
- package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts +15 -0
- package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts +13 -0
- package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts +16 -0
- package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts +21 -0
- package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts +20 -0
- package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts +12 -0
- package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts +18 -0
- package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts +4 -0
- package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts +4 -0
- package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts +4 -0
- package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts +9 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts +8 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
- package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/index.d.ts +16 -0
- package/lib/typescript/src/BetRouter/index.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts +15 -0
- package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts +44 -0
- package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts +15 -0
- package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts +44 -0
- package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/accounts.d.ts +19 -0
- package/lib/typescript/src/BetRouter/types/accounts.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/api-contracts.d.ts +1071 -0
- package/lib/typescript/src/BetRouter/types/api-contracts.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/config.d.ts +12 -0
- package/lib/typescript/src/BetRouter/types/config.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/contests.d.ts +34 -0
- package/lib/typescript/src/BetRouter/types/contests.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/credentials.d.ts +24 -0
- package/lib/typescript/src/BetRouter/types/credentials.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/index.d.ts +14 -0
- package/lib/typescript/src/BetRouter/types/index.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/jobs.d.ts +35 -0
- package/lib/typescript/src/BetRouter/types/jobs.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/leagues.d.ts +26 -0
- package/lib/typescript/src/BetRouter/types/leagues.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/liquidity.d.ts +14 -0
- package/lib/typescript/src/BetRouter/types/liquidity.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/markets.d.ts +87 -0
- package/lib/typescript/src/BetRouter/types/markets.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/opportunities.d.ts +88 -0
- package/lib/typescript/src/BetRouter/types/opportunities.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/orders.d.ts +34 -0
- package/lib/typescript/src/BetRouter/types/orders.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/participants.d.ts +33 -0
- package/lib/typescript/src/BetRouter/types/participants.d.ts.map +1 -0
- package/lib/typescript/src/BetRouter/types/partners.d.ts +11 -0
- package/lib/typescript/src/BetRouter/types/partners.d.ts.map +1 -0
- package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts +117 -0
- package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
- package/lib/typescript/src/Charts/components/BaseLineChart.d.ts +40 -0
- package/lib/typescript/src/Charts/components/BaseLineChart.d.ts.map +1 -0
- package/lib/typescript/src/Charts/components/LivePriceChart.d.ts +13 -0
- package/lib/typescript/src/Charts/components/LivePriceChart.d.ts.map +1 -0
- package/lib/typescript/src/Charts/index.d.ts +28 -0
- package/lib/typescript/src/Charts/index.d.ts.map +1 -0
- package/lib/typescript/src/Charts/themes/chartTheme.d.ts +78 -0
- package/lib/typescript/src/Charts/themes/chartTheme.d.ts.map +1 -0
- package/lib/typescript/src/Charts/types.d.ts +155 -0
- package/lib/typescript/src/Charts/types.d.ts.map +1 -0
- package/lib/typescript/src/Charts/utils/formatters.d.ts +66 -0
- package/lib/typescript/src/Charts/utils/formatters.d.ts.map +1 -0
- package/lib/typescript/src/Components/Dropdown.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/index.d.ts +1 -0
- package/lib/typescript/src/Components/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/ApiOverrides/index.ts +4 -0
- package/src/BetRouter/api/index.ts +854 -0
- package/src/BetRouter/api/types.ts +0 -0
- package/src/BetRouter/components/AccountManager.tsx +533 -0
- package/src/BetRouter/components/AdminPortal.tsx +44 -0
- package/src/BetRouter/components/BuyOpportunities.tsx +491 -0
- package/src/BetRouter/components/BuyOpportunityCard.tsx +331 -0
- package/src/BetRouter/components/ContestLiquidity.tsx +613 -0
- package/src/BetRouter/components/ContestSelector.tsx +179 -0
- package/src/BetRouter/components/MyOpportunities.tsx +279 -0
- package/src/BetRouter/components/MyOpportunities.tsx.bak +440 -0
- package/src/BetRouter/components/OpportunityDetailModal.tsx +360 -0
- package/src/BetRouter/components/OpportunityHistory.tsx +408 -0
- package/src/BetRouter/components/PartnerCredentials.tsx +212 -0
- package/src/BetRouter/components/PlacedOpportunityModal.tsx +192 -0
- package/src/BetRouter/components/admin/AutoFillView.tsx +275 -0
- package/src/BetRouter/components/admin/ConfigManager.tsx +596 -0
- package/src/BetRouter/components/admin/JobManager.tsx +758 -0
- package/src/BetRouter/components/admin/LeagueContests.tsx +2443 -0
- package/src/BetRouter/components/admin/LeagueInfo.tsx +253 -0
- package/src/BetRouter/components/admin/LeagueParticipants.tsx +662 -0
- package/src/BetRouter/index.tsx +453 -0
- package/src/BetRouter/layouts/DesktopAdminLayout.tsx +348 -0
- package/src/BetRouter/layouts/DesktopLayout.tsx +292 -0
- package/src/BetRouter/layouts/MobileAdminLayout.tsx +387 -0
- package/src/BetRouter/layouts/MobileLayout.tsx +325 -0
- package/src/BetRouter/types/ADMIN_PORTAL.md +863 -0
- package/src/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
- package/src/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
- package/src/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
- package/src/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
- package/src/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
- package/src/BetRouter/types/README.md +249 -0
- package/src/BetRouter/types/accounts.ts +21 -0
- package/src/BetRouter/types/api-contracts.ts +1164 -0
- package/src/BetRouter/types/config.ts +12 -0
- package/src/BetRouter/types/contests.ts +37 -0
- package/src/BetRouter/types/credentials.ts +99 -0
- package/src/BetRouter/types/index.ts +16 -0
- package/src/BetRouter/types/jobs.ts +37 -0
- package/src/BetRouter/types/leagues.ts +29 -0
- package/src/BetRouter/types/liquidity.ts +15 -0
- package/src/BetRouter/types/markets.ts +94 -0
- package/src/BetRouter/types/opportunities.ts +107 -0
- package/src/BetRouter/types/orders.ts +51 -0
- package/src/BetRouter/types/participants.ts +34 -0
- package/src/BetRouter/types/partners.ts +10 -0
- package/src/Charts/README.md +310 -0
- package/src/Charts/adapters/TradeChartAdapter.ts +471 -0
- package/src/Charts/components/BaseLineChart.tsx +311 -0
- package/src/Charts/components/LivePriceChart.tsx +527 -0
- package/src/Charts/index.tsx +62 -0
- package/src/Charts/themes/chartTheme.ts +113 -0
- package/src/Charts/types.ts +160 -0
- package/src/Charts/utils/formatters.ts +182 -0
- package/src/Components/Dropdown.tsx +6 -3
- package/src/Components/Icons.tsx +12 -0
- package/src/Components/index.tsx +4 -0
- package/src/index.tsx +6 -0
- package/src/types.d.ts +410 -2
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Text, View, Button } from '../../Components/Themed';
|
|
3
|
+
import { BetRouterApi } from '../api';
|
|
4
|
+
import { FlatList, TouchableOpacity } from 'react-native';
|
|
5
|
+
import type { OpportunityProps, OpportunitySummaryProps, OpportunityStatusLegProps, RouterOrderProps, RouterPartnerProps } from '../types';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import DateTimePicker from 'react-datetime-picker';
|
|
8
|
+
import 'react-datetime-picker/dist/DateTimePicker.css';
|
|
9
|
+
import 'react-calendar/dist/Calendar.css';
|
|
10
|
+
import 'react-clock/dist/Clock.css';
|
|
11
|
+
import type { MyPlayerProps } from '../../types';
|
|
12
|
+
import DropDown from '../../Components/Dropdown';
|
|
13
|
+
import Pagination from '../../Components/Pagination';
|
|
14
|
+
import { SearchBox, Icons } from '../../Components';
|
|
15
|
+
import moment from 'moment-mini';
|
|
16
|
+
import PlacedOpportunityModal from './PlacedOpportunityModal';
|
|
17
|
+
|
|
18
|
+
type DateRangePreset = 'yesterday' | 'last7' | 'last30' | 'custom';
|
|
19
|
+
type OpportunityHistoryProps = {
|
|
20
|
+
me: MyPlayerProps;
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
insets?: { top: number; bottom: number; left: number; right: number };
|
|
23
|
+
partners?: RouterPartnerProps[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//const ITEMS_PER_PAGE = 5;
|
|
27
|
+
|
|
28
|
+
const OpportunityHistory = ({ me, compact = false, insets, partners = [] }: OpportunityHistoryProps) => {
|
|
29
|
+
const Colors = useColors();
|
|
30
|
+
|
|
31
|
+
const [state, setState] = useState<{
|
|
32
|
+
loading: boolean;
|
|
33
|
+
opportunities: OpportunityProps[];
|
|
34
|
+
opportunitySummary: OpportunitySummaryProps[];
|
|
35
|
+
opportunityStatusLegs: OpportunityStatusLegProps[];
|
|
36
|
+
routerOrders: RouterOrderProps[];
|
|
37
|
+
pages: number;
|
|
38
|
+
currentPage: number;
|
|
39
|
+
searchText: string;
|
|
40
|
+
selectedOpportunity: OpportunityProps | null;
|
|
41
|
+
showDetailModal: boolean;
|
|
42
|
+
}>({
|
|
43
|
+
loading: false,
|
|
44
|
+
opportunities: [],
|
|
45
|
+
opportunitySummary: [],
|
|
46
|
+
opportunityStatusLegs: [],
|
|
47
|
+
routerOrders: [],
|
|
48
|
+
pages: 0,
|
|
49
|
+
currentPage: 0,
|
|
50
|
+
searchText: '',
|
|
51
|
+
selectedOpportunity: null,
|
|
52
|
+
showDetailModal: false
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const [dateRange, setDateRange] = useState<{
|
|
56
|
+
preset: DateRangePreset;
|
|
57
|
+
from: Date;
|
|
58
|
+
to: Date;
|
|
59
|
+
}>({
|
|
60
|
+
preset: 'last30',
|
|
61
|
+
from: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
|
|
62
|
+
to: new Date()
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const [showCustomPicker, setShowCustomPicker] = useState(false);
|
|
66
|
+
|
|
67
|
+
const { loading, opportunities, opportunitySummary, routerOrders, pages, currentPage, searchText, selectedOpportunity, showDetailModal } = state;
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
BetRouterApi.setEnvironment();
|
|
71
|
+
if (!me?.player_id) { return }
|
|
72
|
+
loadOpportunities();
|
|
73
|
+
}, [me?.player_id]);
|
|
74
|
+
|
|
75
|
+
const loadOpportunities = async (page: number = 0, customFrom?: Date, customTo?: Date) => {
|
|
76
|
+
setState(prev => ({ ...prev, loading: true }));
|
|
77
|
+
|
|
78
|
+
const from = customFrom || dateRange.from;
|
|
79
|
+
const to = customTo || dateRange.to;
|
|
80
|
+
const fromTimestamp = Math.floor(from.getTime());
|
|
81
|
+
const toTimestamp = Math.floor(to.getTime());
|
|
82
|
+
|
|
83
|
+
const result = await BetRouterApi.BetRouter.OpportunityApi.getMyPastOpportunities(
|
|
84
|
+
fromTimestamp,
|
|
85
|
+
toTimestamp,
|
|
86
|
+
page
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
setState(prev => ({
|
|
90
|
+
...prev,
|
|
91
|
+
opportunities: result.opportunities,
|
|
92
|
+
opportunitySummary: result.opportunity_summary,
|
|
93
|
+
opportunityStatusLegs: result.opportunity_status_legs,
|
|
94
|
+
routerOrders: result.router_orders,
|
|
95
|
+
pages: result.pages,
|
|
96
|
+
currentPage: page,
|
|
97
|
+
loading: false
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const handleDateRangeChange = (preset: DateRangePreset) => {
|
|
102
|
+
const now = new Date();
|
|
103
|
+
let from: Date;
|
|
104
|
+
const to = now;
|
|
105
|
+
|
|
106
|
+
switch (preset) {
|
|
107
|
+
case 'yesterday':
|
|
108
|
+
from = new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
|
109
|
+
break;
|
|
110
|
+
case 'last7':
|
|
111
|
+
from = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
112
|
+
break;
|
|
113
|
+
case 'custom':
|
|
114
|
+
setShowCustomPicker(true);
|
|
115
|
+
return;
|
|
116
|
+
case 'last30':
|
|
117
|
+
default:
|
|
118
|
+
from = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
setDateRange({ preset, from, to });
|
|
122
|
+
setShowCustomPicker(false);
|
|
123
|
+
loadOpportunities(0, from, to);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const handleApplyDateRange = () => {
|
|
127
|
+
loadOpportunities(0);
|
|
128
|
+
setShowCustomPicker(false);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const handleOpenDetail = (opp: OpportunityProps) => {
|
|
132
|
+
setState({ ...state, selectedOpportunity: opp, showDetailModal: true });
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const handleCloseDetail = () => {
|
|
136
|
+
setState({ ...state, selectedOpportunity: null, showDetailModal: false });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Filter opportunities by search (client-side filter on current page only)
|
|
140
|
+
const filteredOpportunities = opportunities.filter(opp => {
|
|
141
|
+
if (!searchText) return true;
|
|
142
|
+
if (opp.opportunity_type.toLowerCase().includes(searchText.toLowerCase())) return true;
|
|
143
|
+
const oppOrders = routerOrders.filter(order => order.opportunity_id === opp.opportunity_id);
|
|
144
|
+
return oppOrders.some(order => order.title?.toLowerCase().includes(searchText.toLowerCase()));
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Use server-side pagination info
|
|
148
|
+
const totalPages = pages;
|
|
149
|
+
const paginatedOpportunities = filteredOpportunities;
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
const renderOpportunityCard = (data: { item: OpportunityProps, index: number }) => {
|
|
153
|
+
const opp = data.item;
|
|
154
|
+
const isProfitable = (opp.actual_profit || 0) >= 0;
|
|
155
|
+
const oppOrders = routerOrders.filter(order => order.opportunity_id === opp.opportunity_id);
|
|
156
|
+
const firstOrder = oppOrders[0];
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<TouchableOpacity onPress={() => handleOpenDetail(opp)}>
|
|
160
|
+
<View type='row' style={{ padding: 12, borderBottomWidth: 1, borderBottomColor: Colors.borders.light, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
161
|
+
<View transparent style={{ flex: 1, flexDirection: 'row', alignItems: 'center', gap: 12 }}>
|
|
162
|
+
{/* Type & Profit */}
|
|
163
|
+
<View transparent style={{ minWidth: 60 }}>
|
|
164
|
+
<Text theme='h2' size={11} numberOfLines={1}>
|
|
165
|
+
{opp.opportunity_type.toUpperCase()}
|
|
166
|
+
</Text>
|
|
167
|
+
<Text
|
|
168
|
+
theme='h2'
|
|
169
|
+
size={13}
|
|
170
|
+
color={isProfitable ? Colors.text.success : Colors.text.error}
|
|
171
|
+
>
|
|
172
|
+
${(opp.actual_profit || 0).toFixed(2)}
|
|
173
|
+
</Text>
|
|
174
|
+
</View>
|
|
175
|
+
|
|
176
|
+
{/* Info */}
|
|
177
|
+
<View transparent style={{ flex: 1, minWidth: 0 }}>
|
|
178
|
+
{firstOrder && (
|
|
179
|
+
<Text theme='description' size={11} numberOfLines={1}>
|
|
180
|
+
{moment(opp.create_datetime).format('MMM D, h:mm A')}
|
|
181
|
+
</Text>
|
|
182
|
+
)}
|
|
183
|
+
<Text theme='description' size={10} numberOfLines={1}>
|
|
184
|
+
{oppOrders.length} leg{oppOrders.length !== 1 ? 's' : ''}
|
|
185
|
+
</Text>
|
|
186
|
+
</View>
|
|
187
|
+
|
|
188
|
+
{/* Invested */}
|
|
189
|
+
<View transparent style={{ minWidth: 45 }}>
|
|
190
|
+
<Text theme='h2' size={11}>
|
|
191
|
+
${opp.total_bet_amount.toFixed(0)}
|
|
192
|
+
</Text>
|
|
193
|
+
</View>
|
|
194
|
+
|
|
195
|
+
{/* ROI */}
|
|
196
|
+
<View transparent style={{ minWidth: 45 }}>
|
|
197
|
+
<Text theme='h2' size={11}>
|
|
198
|
+
{(opp.actual_roi * 100).toFixed(1)}%
|
|
199
|
+
</Text>
|
|
200
|
+
</View>
|
|
201
|
+
|
|
202
|
+
{/* Status */}
|
|
203
|
+
<View transparent style={{ minWidth: 20 }}>
|
|
204
|
+
<Text theme='h2' size={13}>
|
|
205
|
+
{opp.fill_status === 'all_filled' ? '✓' :
|
|
206
|
+
opp.fill_status === 'partially_filled' ? '⚠' :
|
|
207
|
+
opp.fill_status === 'failed' ? '✗' : '⋯'}
|
|
208
|
+
</Text>
|
|
209
|
+
</View>
|
|
210
|
+
</View>
|
|
211
|
+
|
|
212
|
+
<Icons.ChevronIcon size={16} color={Colors.text.descriptionLight} direction="right" />
|
|
213
|
+
</View>
|
|
214
|
+
</TouchableOpacity>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<View float style={{ flex: compact ? 0 : 1 }}>
|
|
220
|
+
<PlacedOpportunityModal
|
|
221
|
+
visible={showDetailModal}
|
|
222
|
+
opportunity={selectedOpportunity}
|
|
223
|
+
orders={routerOrders}
|
|
224
|
+
partners={partners}
|
|
225
|
+
onClose={handleCloseDetail}
|
|
226
|
+
insets={insets}
|
|
227
|
+
/>
|
|
228
|
+
|
|
229
|
+
<View type='header' style={{ padding: 15, borderTopLeftRadius: 8, borderTopRightRadius: 8 }}>
|
|
230
|
+
<Text theme='h1' style={{ fontSize: 16 }}>Past Opportunities</Text>
|
|
231
|
+
<Text theme='description' style={{ fontSize: 12, marginTop: 3 }}>
|
|
232
|
+
{filteredOpportunities.length} opportunit{filteredOpportunities.length !== 1 ? 'ies' : 'y'}
|
|
233
|
+
</Text>
|
|
234
|
+
</View>
|
|
235
|
+
|
|
236
|
+
<View type='body' style={{ flex: 1 }}>
|
|
237
|
+
{/* Date Range Selector */}
|
|
238
|
+
<View transparent style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: Colors.borders.light }}>
|
|
239
|
+
<DropDown
|
|
240
|
+
selected_value={dateRange.preset === 'yesterday' ? 'Yesterday' :
|
|
241
|
+
dateRange.preset === 'last7' ? 'Last 7 Days' :
|
|
242
|
+
dateRange.preset === 'last30' ? 'Last 30 Days' :
|
|
243
|
+
'Custom Range'}
|
|
244
|
+
dropdown_options={[
|
|
245
|
+
{ value: 'Yesterday', eligible_options: ['Yesterday', 'Last 7 Days', 'Last 30 Days', 'Custom Range'] }
|
|
246
|
+
]}
|
|
247
|
+
onOptionSelect={(option) => {
|
|
248
|
+
if (option === 'Yesterday') handleDateRangeChange('yesterday');
|
|
249
|
+
else if (option === 'Last 7 Days') handleDateRangeChange('last7');
|
|
250
|
+
else if (option === 'Last 30 Days') handleDateRangeChange('last30');
|
|
251
|
+
else if (option === 'Custom Range') handleDateRangeChange('custom');
|
|
252
|
+
}}
|
|
253
|
+
/>
|
|
254
|
+
</View>
|
|
255
|
+
|
|
256
|
+
{/* Custom Date Picker */}
|
|
257
|
+
{showCustomPicker && (
|
|
258
|
+
<View transparent style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: Colors.borders.light }}>
|
|
259
|
+
<View transparent style={{ flexDirection: 'row', gap: 10, marginBottom: 10 }}>
|
|
260
|
+
<View transparent style={{ flex: 1 }}>
|
|
261
|
+
<Text theme='description' size={12} style={{ marginBottom: 5 }}>From</Text>
|
|
262
|
+
<DateTimePicker
|
|
263
|
+
onChange={(date) => setDateRange({ ...dateRange, from: date as Date })}
|
|
264
|
+
value={dateRange.from}
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
<View transparent style={{ flex: 1 }}>
|
|
268
|
+
<Text theme='description' size={12} style={{ marginBottom: 5 }}>To</Text>
|
|
269
|
+
<DateTimePicker
|
|
270
|
+
onChange={(date) => setDateRange({ ...dateRange, to: date as Date })}
|
|
271
|
+
value={dateRange.to}
|
|
272
|
+
/>
|
|
273
|
+
</View>
|
|
274
|
+
</View>
|
|
275
|
+
<Button title="Apply" onPress={handleApplyDateRange} />
|
|
276
|
+
</View>
|
|
277
|
+
)}
|
|
278
|
+
|
|
279
|
+
{/* Search */}
|
|
280
|
+
<View transparent style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: Colors.borders.light }}>
|
|
281
|
+
<SearchBox
|
|
282
|
+
onChange={(text) => setState({ ...state, searchText: text, currentPage: 0 })}
|
|
283
|
+
hide_search_button
|
|
284
|
+
/>
|
|
285
|
+
</View>
|
|
286
|
+
|
|
287
|
+
{/* Overall Statistics */}
|
|
288
|
+
{opportunitySummary.length > 0 && (
|
|
289
|
+
<View transparent style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: Colors.borders.light }}>
|
|
290
|
+
{opportunitySummary.map((summary, idx) => {
|
|
291
|
+
const isProfitable = (summary.actual_profit || 0) >= 0;
|
|
292
|
+
const avgRoi = summary.total_bet_amount > 0
|
|
293
|
+
? ((summary.actual_profit || 0) / summary.total_bet_amount) * 100
|
|
294
|
+
: 0;
|
|
295
|
+
|
|
296
|
+
return (
|
|
297
|
+
<View
|
|
298
|
+
key={idx}
|
|
299
|
+
transparent
|
|
300
|
+
style={{
|
|
301
|
+
padding: 12,
|
|
302
|
+
backgroundColor: Colors.views.header,
|
|
303
|
+
borderRadius: 8,
|
|
304
|
+
marginBottom: idx < opportunitySummary.length - 1 ? 8 : 0,
|
|
305
|
+
borderWidth: 1,
|
|
306
|
+
borderColor: Colors.borders.light
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
<View transparent style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
|
310
|
+
<Text theme='h2' size={14}>
|
|
311
|
+
{summary.opportunity_type?.toUpperCase() || 'OVERALL'}
|
|
312
|
+
</Text>
|
|
313
|
+
<Text
|
|
314
|
+
theme='h2'
|
|
315
|
+
size={16}
|
|
316
|
+
color={isProfitable ? Colors.text.success : Colors.text.error}
|
|
317
|
+
>
|
|
318
|
+
${(summary.actual_profit || 0).toFixed(2)}
|
|
319
|
+
</Text>
|
|
320
|
+
</View>
|
|
321
|
+
|
|
322
|
+
<View transparent style={{ flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap', gap: 12 }}>
|
|
323
|
+
<View transparent>
|
|
324
|
+
<Text theme='description' size={11}>Count</Text>
|
|
325
|
+
<Text theme='h2' size={12} style={{ marginTop: 2 }}>
|
|
326
|
+
{summary.opportunity_count}
|
|
327
|
+
</Text>
|
|
328
|
+
</View>
|
|
329
|
+
|
|
330
|
+
<View transparent>
|
|
331
|
+
<Text theme='description' size={11}>Invested</Text>
|
|
332
|
+
<Text theme='h2' size={12} style={{ marginTop: 2 }}>
|
|
333
|
+
${(summary.total_bet_amount || 0).toFixed(2)}
|
|
334
|
+
</Text>
|
|
335
|
+
</View>
|
|
336
|
+
|
|
337
|
+
<View transparent>
|
|
338
|
+
<Text theme='description' size={11}>Winnings</Text>
|
|
339
|
+
<Text theme='h2' size={12} style={{ marginTop: 2 }}>
|
|
340
|
+
${(summary.total_winnings || 0).toFixed(2)}
|
|
341
|
+
</Text>
|
|
342
|
+
</View>
|
|
343
|
+
|
|
344
|
+
<View transparent>
|
|
345
|
+
<Text theme='description' size={11}>Fees</Text>
|
|
346
|
+
<Text theme='h2' size={12} style={{ marginTop: 2 }}>
|
|
347
|
+
${(summary.total_fees || 0).toFixed(2)}
|
|
348
|
+
</Text>
|
|
349
|
+
</View>
|
|
350
|
+
|
|
351
|
+
<View transparent>
|
|
352
|
+
<Text theme='description' size={11}>Avg ROI</Text>
|
|
353
|
+
<Text theme='h2' size={12} style={{ marginTop: 2 }}>
|
|
354
|
+
{avgRoi.toFixed(1)}%
|
|
355
|
+
</Text>
|
|
356
|
+
</View>
|
|
357
|
+
</View>
|
|
358
|
+
</View>
|
|
359
|
+
);
|
|
360
|
+
})}
|
|
361
|
+
</View>
|
|
362
|
+
)}
|
|
363
|
+
|
|
364
|
+
{/* Pagination */}
|
|
365
|
+
{!loading && opportunities.length > 0 && totalPages > 1 && (
|
|
366
|
+
<View transparent style={{ padding: 10, borderBottomWidth: 1, borderBottomColor: Colors.borders.light }}>
|
|
367
|
+
<Pagination
|
|
368
|
+
offset={currentPage}
|
|
369
|
+
pages={totalPages}
|
|
370
|
+
onNext={() => {
|
|
371
|
+
if ((currentPage + 1) < totalPages) {
|
|
372
|
+
loadOpportunities(currentPage + 1);
|
|
373
|
+
}
|
|
374
|
+
}}
|
|
375
|
+
onPrevious={() => {
|
|
376
|
+
if (currentPage > 0) {
|
|
377
|
+
loadOpportunities(currentPage - 1);
|
|
378
|
+
}
|
|
379
|
+
}}
|
|
380
|
+
onSelectPage={(page) => {
|
|
381
|
+
loadOpportunities(page);
|
|
382
|
+
}}
|
|
383
|
+
/>
|
|
384
|
+
</View>
|
|
385
|
+
)}
|
|
386
|
+
|
|
387
|
+
{/* Opportunity List */}
|
|
388
|
+
{loading ? (
|
|
389
|
+
<View transparent style={{ padding: 20, alignItems: 'center' }}>
|
|
390
|
+
<Text theme='description'>Loading...</Text>
|
|
391
|
+
</View>
|
|
392
|
+
) : paginatedOpportunities.length === 0 ? (
|
|
393
|
+
<View transparent style={{ padding: 20, alignItems: 'center' }}>
|
|
394
|
+
<Text theme='description'>No past opportunities found</Text>
|
|
395
|
+
</View>
|
|
396
|
+
) : (
|
|
397
|
+
<FlatList
|
|
398
|
+
data={paginatedOpportunities}
|
|
399
|
+
keyExtractor={(item) => item.opportunity_id}
|
|
400
|
+
renderItem={renderOpportunityCard}
|
|
401
|
+
/>
|
|
402
|
+
)}
|
|
403
|
+
</View>
|
|
404
|
+
</View>
|
|
405
|
+
);
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
export default OpportunityHistory;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, Text, Button } from "../../Components/Themed";
|
|
3
|
+
import { Modal, TextInput, ScrollView, TouchableOpacity } from 'react-native';
|
|
4
|
+
import { useColors } from '../../constants/useColors';
|
|
5
|
+
import type { AccountPartnerProps, RouterPartnerProps } from '../types';
|
|
6
|
+
import { getRequiredCredentialFields, getCredentialFieldLabels, getCredentialFieldTypes } from '../types/credentials';
|
|
7
|
+
|
|
8
|
+
type PartnerCredentialsProps = {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
accountPartner: AccountPartnerProps;
|
|
11
|
+
partner: RouterPartnerProps;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onUpdate: (partner_id: string, credentials: Record<string, any>) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const PartnerCredentials = ({ visible, accountPartner, partner, onClose, onUpdate }: PartnerCredentialsProps) => {
|
|
17
|
+
const Colors = useColors();
|
|
18
|
+
const [credentials, setCredentials] = useState<Record<string, any>>({});
|
|
19
|
+
const [loading, setLoading] = useState(false);
|
|
20
|
+
const [error, setError] = useState<string | null>(null);
|
|
21
|
+
const [success, setSuccess] = useState(false);
|
|
22
|
+
|
|
23
|
+
// Get credential fields, labels, and types from helper functions
|
|
24
|
+
const credentialFields = getRequiredCredentialFields(partner.name);
|
|
25
|
+
const fieldLabels = getCredentialFieldLabels(partner.name);
|
|
26
|
+
const fieldTypes = getCredentialFieldTypes(partner.name);
|
|
27
|
+
|
|
28
|
+
const handleUpdateCredential = (field: string, value: string) => {
|
|
29
|
+
setCredentials(prev => ({
|
|
30
|
+
...prev,
|
|
31
|
+
[field]: value
|
|
32
|
+
}));
|
|
33
|
+
// Clear error when user types
|
|
34
|
+
if (error) setError(null);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleSave = async () => {
|
|
38
|
+
// Validate all required fields are filled
|
|
39
|
+
const missingFields = credentialFields.filter(field => !credentials[field] || credentials[field].trim() === '');
|
|
40
|
+
if (missingFields.length > 0) {
|
|
41
|
+
setError(`Please fill in all required fields: ${missingFields.map(f => fieldLabels[f]).join(', ')}`);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
setLoading(true);
|
|
47
|
+
setError(null);
|
|
48
|
+
setSuccess(false);
|
|
49
|
+
await onUpdate(accountPartner.partner_id, credentials);
|
|
50
|
+
setSuccess(true);
|
|
51
|
+
// Auto-close after showing success message
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
onClose();
|
|
54
|
+
setSuccess(false);
|
|
55
|
+
setCredentials({});
|
|
56
|
+
}, 1500);
|
|
57
|
+
} catch (e: any) {
|
|
58
|
+
console.error('Error updating credentials:', e);
|
|
59
|
+
setError(e?.response?.data?.message || e?.message || 'Failed to update credentials. Please try again.');
|
|
60
|
+
} finally {
|
|
61
|
+
setLoading(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleClose = () => {
|
|
66
|
+
setCredentials({});
|
|
67
|
+
setError(null);
|
|
68
|
+
setSuccess(false);
|
|
69
|
+
onClose();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Modal
|
|
74
|
+
visible={visible}
|
|
75
|
+
transparent={true}
|
|
76
|
+
animationType="fade"
|
|
77
|
+
onRequestClose={onClose}
|
|
78
|
+
statusBarTranslucent={true}
|
|
79
|
+
>
|
|
80
|
+
<View style={{
|
|
81
|
+
flex: 1,
|
|
82
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
alignItems: 'center'
|
|
85
|
+
}}>
|
|
86
|
+
<TouchableOpacity
|
|
87
|
+
activeOpacity={1}
|
|
88
|
+
style={{
|
|
89
|
+
position: 'absolute',
|
|
90
|
+
top: 0,
|
|
91
|
+
left: 0,
|
|
92
|
+
right: 0,
|
|
93
|
+
bottom: 0
|
|
94
|
+
}}
|
|
95
|
+
onPress={handleClose}
|
|
96
|
+
/>
|
|
97
|
+
<View float style={{
|
|
98
|
+
width: '90%',
|
|
99
|
+
maxWidth: 500,
|
|
100
|
+
maxHeight: '80%',
|
|
101
|
+
borderRadius: 8,
|
|
102
|
+
zIndex: 1
|
|
103
|
+
}}>
|
|
104
|
+
{/* Header */}
|
|
105
|
+
<View type='header' style={{
|
|
106
|
+
padding: 15,
|
|
107
|
+
borderTopLeftRadius: 8,
|
|
108
|
+
borderTopRightRadius: 8,
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'space-between'
|
|
112
|
+
}}>
|
|
113
|
+
<View transparent>
|
|
114
|
+
<Text theme='h1'>Update Credentials</Text>
|
|
115
|
+
<Text theme='description' style={{ marginTop: 3 }}>{partner.name}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
<Button
|
|
118
|
+
type='text'
|
|
119
|
+
title='Close'
|
|
120
|
+
onPress={handleClose}
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
|
|
124
|
+
{/* Body */}
|
|
125
|
+
<ScrollView style={{ maxHeight: 400 }}>
|
|
126
|
+
<View type='body' style={{ padding: 15 }}>
|
|
127
|
+
<Text theme='description' style={{ marginBottom: 15 }}>
|
|
128
|
+
Enter your credentials for {partner.name}. These will be securely encrypted and stored.
|
|
129
|
+
</Text>
|
|
130
|
+
|
|
131
|
+
<Text theme='description' style={{ marginBottom: 15, fontStyle: 'italic' }}>
|
|
132
|
+
Note: You are updating new credentials. Any previously saved credentials will be replaced.
|
|
133
|
+
</Text>
|
|
134
|
+
|
|
135
|
+
{credentialFields.map((field) => {
|
|
136
|
+
const fieldType = fieldTypes[field];
|
|
137
|
+
const isMultiline = fieldType === 'textarea';
|
|
138
|
+
const isSecure = fieldType === 'password';
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<View key={field} transparent style={{ marginBottom: 15 }}>
|
|
142
|
+
<Text style={{ marginBottom: 5, fontWeight: '600' }}>
|
|
143
|
+
{fieldLabels[field] || field.charAt(0).toUpperCase() + field.slice(1).replace(/_/g, ' ')}
|
|
144
|
+
</Text>
|
|
145
|
+
<TextInput
|
|
146
|
+
style={{
|
|
147
|
+
borderWidth: 1,
|
|
148
|
+
borderColor: Colors.borders.input,
|
|
149
|
+
borderRadius: 4,
|
|
150
|
+
padding: 10,
|
|
151
|
+
color: Colors.text.input,
|
|
152
|
+
backgroundColor: Colors.views.input,
|
|
153
|
+
minHeight: isMultiline ? 100 : undefined,
|
|
154
|
+
textAlignVertical: isMultiline ? 'top' : 'center'
|
|
155
|
+
}}
|
|
156
|
+
value={credentials[field] || ''}
|
|
157
|
+
onChangeText={(value) => handleUpdateCredential(field, value)}
|
|
158
|
+
placeholder={`Enter ${fieldLabels[field] || field}`}
|
|
159
|
+
placeholderTextColor={Colors.text.placholder}
|
|
160
|
+
secureTextEntry={isSecure}
|
|
161
|
+
multiline={isMultiline}
|
|
162
|
+
numberOfLines={isMultiline ? 4 : 1}
|
|
163
|
+
autoCapitalize='none'
|
|
164
|
+
autoCorrect={false}
|
|
165
|
+
/>
|
|
166
|
+
</View>
|
|
167
|
+
);
|
|
168
|
+
})}
|
|
169
|
+
|
|
170
|
+
{error && (
|
|
171
|
+
<View transparent style={{ marginTop: 10, padding: 10, borderRadius: 4, backgroundColor: Colors.buttons.background.error }}>
|
|
172
|
+
<Text style={{ color: Colors.text.white }}>{error}</Text>
|
|
173
|
+
</View>
|
|
174
|
+
)}
|
|
175
|
+
|
|
176
|
+
{success && (
|
|
177
|
+
<View transparent style={{ marginTop: 10, padding: 10, borderRadius: 4, backgroundColor: Colors.buttons.background.success }}>
|
|
178
|
+
<Text style={{ color: Colors.text.white, fontWeight: '600' }}>✓ Credentials saved successfully!</Text>
|
|
179
|
+
</View>
|
|
180
|
+
)}
|
|
181
|
+
</View>
|
|
182
|
+
</ScrollView>
|
|
183
|
+
|
|
184
|
+
{/* Footer */}
|
|
185
|
+
<View type='footer' style={{
|
|
186
|
+
padding: 15,
|
|
187
|
+
borderBottomLeftRadius: 8,
|
|
188
|
+
borderBottomRightRadius: 8,
|
|
189
|
+
flexDirection: 'row',
|
|
190
|
+
justifyContent: 'flex-end',
|
|
191
|
+
gap: 10
|
|
192
|
+
}}>
|
|
193
|
+
<Button
|
|
194
|
+
type='text'
|
|
195
|
+
title='Cancel'
|
|
196
|
+
onPress={handleClose}
|
|
197
|
+
disabled={loading || success}
|
|
198
|
+
/>
|
|
199
|
+
<Button
|
|
200
|
+
title={loading ? 'Saving...' : success ? 'Saved!' : 'Save Credentials'}
|
|
201
|
+
onPress={handleSave}
|
|
202
|
+
disabled={loading || success}
|
|
203
|
+
type={success ? 'success' : undefined}
|
|
204
|
+
/>
|
|
205
|
+
</View>
|
|
206
|
+
</View>
|
|
207
|
+
</View>
|
|
208
|
+
</Modal>
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export default PartnerCredentials;
|