be-components 7.4.0 → 7.4.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/CreateEngagement/index.js +3 -0
- package/lib/commonjs/CreateEngagement/index.js.map +1 -1
- package/lib/commonjs/FlashMarket/api/index.js +61 -0
- package/lib/commonjs/FlashMarket/api/index.js.map +1 -1
- package/lib/commonjs/FlashMarket/components/ManageFlashMarket.js +55 -81
- package/lib/commonjs/FlashMarket/components/ManageFlashMarket.js.map +1 -1
- package/lib/commonjs/MyAction/api/index.js +580 -0
- package/lib/commonjs/MyAction/api/index.js.map +1 -0
- package/lib/commonjs/MyAction/components/BracketRow.js +67 -0
- package/lib/commonjs/MyAction/components/BracketRow.js.map +1 -0
- package/lib/commonjs/MyAction/components/CompetitionRow.js +68 -0
- package/lib/commonjs/MyAction/components/CompetitionRow.js.map +1 -0
- package/lib/commonjs/MyAction/components/ContestStatRow.js +265 -0
- package/lib/commonjs/MyAction/components/ContestStatRow.js.map +1 -0
- package/lib/commonjs/MyAction/components/FlashRow.js +131 -0
- package/lib/commonjs/MyAction/components/FlashRow.js.map +1 -0
- package/lib/commonjs/MyAction/components/ParlayRow.js +236 -0
- package/lib/commonjs/MyAction/components/ParlayRow.js.map +1 -0
- package/lib/commonjs/MyAction/components/SquaresRow.js +83 -0
- package/lib/commonjs/MyAction/components/SquaresRow.js.map +1 -0
- package/lib/commonjs/MyAction/index.js +354 -0
- package/lib/commonjs/MyAction/index.js.map +1 -0
- package/lib/commonjs/PartnerPortal/components/EmbedManager.js +42 -0
- package/lib/commonjs/PartnerPortal/components/EmbedManager.js.map +1 -1
- package/lib/commonjs/PartnerPortal/components/StringSelector.js +90 -0
- package/lib/commonjs/PartnerPortal/components/StringSelector.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/module/CreateEngagement/index.js +3 -0
- package/lib/module/CreateEngagement/index.js.map +1 -1
- package/lib/module/FlashMarket/api/index.js +61 -0
- package/lib/module/FlashMarket/api/index.js.map +1 -1
- package/lib/module/FlashMarket/components/ManageFlashMarket.js +55 -81
- package/lib/module/FlashMarket/components/ManageFlashMarket.js.map +1 -1
- package/lib/module/MyAction/api/index.js +573 -0
- package/lib/module/MyAction/api/index.js.map +1 -0
- package/lib/module/MyAction/components/BracketRow.js +60 -0
- package/lib/module/MyAction/components/BracketRow.js.map +1 -0
- package/lib/module/MyAction/components/CompetitionRow.js +61 -0
- package/lib/module/MyAction/components/CompetitionRow.js.map +1 -0
- package/lib/module/MyAction/components/ContestStatRow.js +258 -0
- package/lib/module/MyAction/components/ContestStatRow.js.map +1 -0
- package/lib/module/MyAction/components/FlashRow.js +124 -0
- package/lib/module/MyAction/components/FlashRow.js.map +1 -0
- package/lib/module/MyAction/components/ParlayRow.js +229 -0
- package/lib/module/MyAction/components/ParlayRow.js.map +1 -0
- package/lib/module/MyAction/components/SquaresRow.js +76 -0
- package/lib/module/MyAction/components/SquaresRow.js.map +1 -0
- package/lib/module/MyAction/index.js +344 -0
- package/lib/module/MyAction/index.js.map +1 -0
- package/lib/module/PartnerPortal/components/EmbedManager.js +42 -0
- package/lib/module/PartnerPortal/components/EmbedManager.js.map +1 -1
- package/lib/module/PartnerPortal/components/StringSelector.js +83 -0
- package/lib/module/PartnerPortal/components/StringSelector.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js.map +1 -1
- package/lib/typescript/lib/commonjs/CreateEngagement/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/components/ManageFlashMarket.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MyAction/api/index.d.ts +110 -0
- package/lib/typescript/lib/commonjs/MyAction/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/BracketRow.d.ts +8 -0
- package/lib/typescript/lib/commonjs/MyAction/components/BracketRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/CompetitionRow.d.ts +9 -0
- package/lib/typescript/lib/commonjs/MyAction/components/CompetitionRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/ContestStatRow.d.ts +15 -0
- package/lib/typescript/lib/commonjs/MyAction/components/ContestStatRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/FlashRow.d.ts +10 -0
- package/lib/typescript/lib/commonjs/MyAction/components/FlashRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/ParlayRow.d.ts +15 -0
- package/lib/typescript/lib/commonjs/MyAction/components/ParlayRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/components/SquaresRow.d.ts +8 -0
- package/lib/typescript/lib/commonjs/MyAction/components/SquaresRow.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MyAction/index.d.ts +7 -0
- package/lib/typescript/lib/commonjs/MyAction/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/PartnerPortal/components/StringSelector.d.ts +8 -0
- package/lib/typescript/lib/commonjs/PartnerPortal/components/StringSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/CreateEngagement/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/lib/module/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/components/ManageFlashMarket.d.ts.map +1 -1
- package/lib/typescript/lib/module/MyAction/api/index.d.ts +110 -0
- package/lib/typescript/lib/module/MyAction/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/BracketRow.d.ts +8 -0
- package/lib/typescript/lib/module/MyAction/components/BracketRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/CompetitionRow.d.ts +9 -0
- package/lib/typescript/lib/module/MyAction/components/CompetitionRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/ContestStatRow.d.ts +15 -0
- package/lib/typescript/lib/module/MyAction/components/ContestStatRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/FlashRow.d.ts +10 -0
- package/lib/typescript/lib/module/MyAction/components/FlashRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/ParlayRow.d.ts +15 -0
- package/lib/typescript/lib/module/MyAction/components/ParlayRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/components/SquaresRow.d.ts +8 -0
- package/lib/typescript/lib/module/MyAction/components/SquaresRow.d.ts.map +1 -0
- package/lib/typescript/lib/module/MyAction/index.d.ts +7 -0
- package/lib/typescript/lib/module/MyAction/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/PartnerPortal/components/StringSelector.d.ts +8 -0
- package/lib/typescript/lib/module/PartnerPortal/components/StringSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +2 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/CreateEngagement/index.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/src/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/components/ManageFlashMarket.d.ts.map +1 -1
- package/lib/typescript/src/MyAction/api/index.d.ts +103 -0
- package/lib/typescript/src/MyAction/api/index.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/BracketRow.d.ts +10 -0
- package/lib/typescript/src/MyAction/components/BracketRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/CompetitionRow.d.ts +15 -0
- package/lib/typescript/src/MyAction/components/CompetitionRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/ContestStatRow.d.ts +18 -0
- package/lib/typescript/src/MyAction/components/ContestStatRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/FlashRow.d.ts +12 -0
- package/lib/typescript/src/MyAction/components/FlashRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/ParlayRow.d.ts +18 -0
- package/lib/typescript/src/MyAction/components/ParlayRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/components/SquaresRow.d.ts +10 -0
- package/lib/typescript/src/MyAction/components/SquaresRow.d.ts.map +1 -0
- package/lib/typescript/src/MyAction/index.d.ts +14 -0
- package/lib/typescript/src/MyAction/index.d.ts.map +1 -0
- package/lib/typescript/src/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/lib/typescript/src/PartnerPortal/components/StringSelector.d.ts +10 -0
- package/lib/typescript/src/PartnerPortal/components/StringSelector.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/CreateEngagement/index.tsx +4 -1
- package/src/FlashMarket/api/index.ts +72 -0
- package/src/FlashMarket/components/ManageFlashMarket.tsx +10 -0
- package/src/MyAction/api/index.ts +393 -0
- package/src/MyAction/components/BracketRow.tsx +34 -0
- package/src/MyAction/components/CompetitionRow.tsx +39 -0
- package/src/MyAction/components/ContestStatRow.tsx +153 -0
- package/src/MyAction/components/FlashRow.tsx +74 -0
- package/src/MyAction/components/ParlayRow.tsx +137 -0
- package/src/MyAction/components/SquaresRow.tsx +55 -0
- package/src/MyAction/index.tsx +316 -0
- package/src/PartnerPortal/components/EmbedManager.tsx +20 -0
- package/src/PartnerPortal/components/StringSelector.tsx +55 -0
- package/src/index.tsx +2 -0
- package/src/types.d.ts +12 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StringSelectorOptionProps } from "../../types";
|
|
3
|
+
type StringSelectorProps = {
|
|
4
|
+
active_value?: string;
|
|
5
|
+
options: StringSelectorOptionProps[];
|
|
6
|
+
onSelectOption: (option: StringSelectorOptionProps | undefined) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const StringSelector: ({ active_value, options, onSelectOption }: StringSelectorProps) => React.JSX.Element;
|
|
9
|
+
export default StringSelector;
|
|
10
|
+
//# sourceMappingURL=StringSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringSelector.d.ts","sourceRoot":"","sources":["../../../../../src/PartnerPortal/components/StringSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAM7D,KAAK,mBAAmB,GAAG;IACvB,YAAY,CAAC,EAAC,MAAM,CAAC;IACrB,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACrC,cAAc,EAAC,CAAC,MAAM,EAAC,yBAAyB,GAAG,SAAS,KAAK,IAAI,CAAA;CACxE,CAAA;AACD,QAAA,MAAM,cAAc,GAAI,2CAA0C,mBAAmB,sBAwCpF,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -66,5 +66,6 @@ import EmbedManager from './PartnerPortal/components/EmbedManager';
|
|
|
66
66
|
import CreateEmbed from './PartnerPortal/components/CreateEmbed';
|
|
67
67
|
import ReferralCodeManager from './PartnerPortal/components/ReferralCodeManager';
|
|
68
68
|
import FlashCampaignManager from './PartnerPortal/components/FlashCampaignManager';
|
|
69
|
-
|
|
69
|
+
import MyAction from './MyAction';
|
|
70
|
+
export { Authenticator, Observer, MyAction, CreateEmbed, ReferralCodeManager, CreateEngagement, DiscordConnectionManager, BEEventApi, FlashCampaignManager, EmbedManager, RankingsCard, ManageFlashMarket, BELinkApi, PartnerPortal, SquaresManager, GuideView, BetMatch, ManageFilter, Ticker, Premium, CreateGroupWizard, LeaderboardCard, GroupComponent, LocationTracker, BEClarity, FlashMarket, ContactsCard, PlayerRecommender, GolfScoreboard, ContactsSelector, Campaign, BEPostHog, ManageBracketCompetitionForm, NotificationModule, FlashHolder, useNotifications, ClaritySmartEvents, ProfileManager, CompetitionManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Share, Checkout, MarketComponents, EventComponents, PollCampaign, PollCampaignApi, PollApi, MarketMaker, CompetitionModule, SeasonManager, CreateCompetitionForm, CreateSeasonForm, SeasonModule, AdminCompetitionList, AdServer, Leaderboard, AdProvider, BracketRoom, SquaresModule, SocketManager, PromotedOrder, EngageModule, CompetitionCard, SquaresCompetitionCard, BracketCompetitionCard, SeasonCard };
|
|
70
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,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W,MAAM,wCAAwC,CAAC;AACjE,OAAO,mBAAmB,MAAM,gDAAgD,CAAC;AACjF,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AACnF,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,4BAA4B,EAC5B,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACX,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "be-components",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.2",
|
|
4
4
|
"description": "Components for BettorEdge Apps",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typecheck": "tsc --noEmit",
|
|
33
33
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
34
34
|
"clean": "del-cli lib",
|
|
35
|
-
"prepare": "NODE_OPTIONS='--max-old-space-size=
|
|
35
|
+
"prepare": "NODE_OPTIONS='--max-old-space-size=6000' bob build",
|
|
36
36
|
"release": "release-it"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"@paypal/react-paypal-js": "^8.3.0",
|
|
173
173
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
174
174
|
"@react-native-community/datetimepicker": "^8.4.5",
|
|
175
|
-
"@react-native-community/slider": "
|
|
175
|
+
"@react-native-community/slider": "^5.0.1",
|
|
176
176
|
"@react-spring/web": "^9.7.3",
|
|
177
177
|
"@types/uuid": "^9.0.8",
|
|
178
178
|
"axios": "^1.6.8",
|
|
@@ -106,7 +106,10 @@ const CreateEngagement = ({ float, player, bracket_id, flash_campaign_id, init_e
|
|
|
106
106
|
groups: my_grups.groups,
|
|
107
107
|
companies: my_comps.companies,
|
|
108
108
|
loading:false
|
|
109
|
-
})
|
|
109
|
+
});
|
|
110
|
+
if(act_company?.company_image?.url){
|
|
111
|
+
setDraftImage(act_company.company_image)
|
|
112
|
+
}
|
|
110
113
|
}
|
|
111
114
|
const errors = CreateEngagementHelpers.isStepValid(active_step, active_engagment, draft_competition, draft_squares, draft_flash, draft_bracket_competition);
|
|
112
115
|
|
|
@@ -116,6 +116,78 @@ export const FlashMarketHelpers = {
|
|
|
116
116
|
if(!parimutuel_odds){ return 0 }
|
|
117
117
|
return stake / parimutuel_odds
|
|
118
118
|
},
|
|
119
|
+
updatePollOptionProbability: (
|
|
120
|
+
changingOptionId: string,
|
|
121
|
+
newProbability: number,
|
|
122
|
+
allOptions: PollOptionProps[]
|
|
123
|
+
): PollOptionProps[] => {
|
|
124
|
+
const total = 1;
|
|
125
|
+
const minProb = 0.001; // minimum probability for unlocked options
|
|
126
|
+
|
|
127
|
+
// Clone and update changing option
|
|
128
|
+
const updatedOptions = allOptions.map(o =>
|
|
129
|
+
o.poll_option_id === changingOptionId
|
|
130
|
+
? { ...o, initial_odds: newProbability }
|
|
131
|
+
: { ...o }
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const lockedOptions = updatedOptions.filter(o => o.probability_locked);
|
|
135
|
+
const unlockedOptions = updatedOptions.filter(
|
|
136
|
+
o => !o.probability_locked && o.poll_option_id !== changingOptionId
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const lockedSum = lockedOptions.reduce(
|
|
140
|
+
(sum, o) => sum + (o.initial_odds ?? 0),
|
|
141
|
+
0
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const changedOption = updatedOptions.find(o => o.poll_option_id === changingOptionId);
|
|
145
|
+
if (!changedOption) return updatedOptions;
|
|
146
|
+
|
|
147
|
+
const oldProb = changedOption.initial_odds ?? 0;
|
|
148
|
+
//const delta = newProbability - oldProb; // positive if increasing, negative if decreasing
|
|
149
|
+
|
|
150
|
+
// Calculate the maximum allowed increase for the changing option
|
|
151
|
+
const maxForChanged = total - lockedSum - unlockedOptions.length * minProb;
|
|
152
|
+
changedOption.initial_odds = Math.min(Math.max(minProb, newProbability), maxForChanged);
|
|
153
|
+
|
|
154
|
+
const adjustedDelta = changedOption.initial_odds - oldProb;
|
|
155
|
+
|
|
156
|
+
// Remaining probability to redistribute among unlocked options
|
|
157
|
+
let remaining = total - lockedSum - changedOption.initial_odds;
|
|
158
|
+
|
|
159
|
+
if (unlockedOptions.length === 0) return updatedOptions;
|
|
160
|
+
|
|
161
|
+
// Redistribute probabilities
|
|
162
|
+
const finalOptions = updatedOptions.map(o => {
|
|
163
|
+
if (o.probability_locked || o.poll_option_id === changingOptionId) return o;
|
|
164
|
+
|
|
165
|
+
if (adjustedDelta < 0) {
|
|
166
|
+
// Changing option decreased → distribute evenly to others
|
|
167
|
+
const evenly = remaining / unlockedOptions.length;
|
|
168
|
+
return { ...o, initial_odds: Math.max(minProb, evenly) };
|
|
169
|
+
} else {
|
|
170
|
+
// Changing option increased → reduce proportionally
|
|
171
|
+
const sumUnlocked = unlockedOptions.reduce((sum, u) => sum + (u.initial_odds ?? 0), 0);
|
|
172
|
+
const proportion = (o.initial_odds ?? 0) / sumUnlocked;
|
|
173
|
+
const newOdds = Math.max(minProb, proportion * remaining);
|
|
174
|
+
return { ...o, initial_odds: newOdds };
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Fix rounding errors
|
|
179
|
+
const currentSum = finalOptions.reduce((sum, o) => sum + (o.initial_odds ?? 0), 0);
|
|
180
|
+
const roundingError = total - currentSum;
|
|
181
|
+
|
|
182
|
+
if (roundingError !== 0) {
|
|
183
|
+
const target = finalOptions.find(o => !o.probability_locked && o.poll_option_id !== changingOptionId);
|
|
184
|
+
if (target) {
|
|
185
|
+
target.initial_odds = Math.max(minProb, (target.initial_odds ?? 0) + roundingError);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return finalOptions;
|
|
190
|
+
},
|
|
119
191
|
isNewValid: (options:PollOptionProps[], summaries:PollSummaryProps[], poll?:PollProps) => {
|
|
120
192
|
let errors:string[] = []
|
|
121
193
|
if(!poll){ return ['Waiting for market'] }
|
|
@@ -181,6 +181,15 @@ const ManageFlashMarket = ({ float, header_style, player, onClose, poll_id, onFo
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
const handleChangeProbability = (option:PollOptionProps, probability:number) => {
|
|
184
|
+
|
|
185
|
+
const final_options = FlashMarketHelpers.updatePollOptionProbability(option.poll_option_id, probability, [ ...real_options ]);
|
|
186
|
+
setFlashState({
|
|
187
|
+
...flash_state,
|
|
188
|
+
probability_changed: true,
|
|
189
|
+
poll_options: poll_options.filter(po => !final_options.find(fo => fo.poll_option_id == po.poll_option_id)).concat(final_options)
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
/*
|
|
184
193
|
if(option.probability_locked){ return }
|
|
185
194
|
if(probability < 0){ return }
|
|
186
195
|
if(probability > 1){ return }
|
|
@@ -249,6 +258,7 @@ const ManageFlashMarket = ({ float, header_style, player, onClose, poll_id, onFo
|
|
|
249
258
|
probability_changed: true,
|
|
250
259
|
poll_options: poll_options.filter(po => !final_options.find(fo => fo.poll_option_id == po.poll_option_id)).concat(final_options)
|
|
251
260
|
});
|
|
261
|
+
*/
|
|
252
262
|
}
|
|
253
263
|
|
|
254
264
|
const renderOptions = (data:{ item:PollOptionProps, index:number }) => {
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import moment, { type Moment } from "moment-mini";
|
|
2
|
+
import { APIOverrides } from "../../ApiOverrides";
|
|
3
|
+
import type { ActionListProps, AthleteProps, BracketCompetitionProps, CompetitionPayoutTypeProps, CompetitionPlayerBracketProps, CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionSeasonPlayerProps, CompetitionSeasonProps, CompetitionSeasonResultProps, CompetitionTypeProps, EventProps, LeagueProps, MatchProps, OrderProps, OrderStatsProps, ParlayPositionProps, ParlayProps, PlayerBracketProps, PollOptionProps, PollProps, PollResponseProps, SquaresCompetitionProps, TeamProps, TournamentProps } from "../../types";
|
|
4
|
+
import axios from 'axios';
|
|
5
|
+
import { MarketComponentHelpers } from "../../MarketComponents/api";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
let EVENT_SVC_API = '';
|
|
9
|
+
let MK_SVC_API = '';
|
|
10
|
+
let AUTH_SVC_API = '';
|
|
11
|
+
let TP_SVC_API = '';
|
|
12
|
+
|
|
13
|
+
export const MyActionApi = {
|
|
14
|
+
setEnvironment: () => {
|
|
15
|
+
const endpoints = APIOverrides.getEndpoints();
|
|
16
|
+
EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
|
|
17
|
+
MK_SVC_API = endpoints['MK_SVC_API'] as string;
|
|
18
|
+
AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
19
|
+
TP_SVC_API = endpoints['TP_SVC_API'] as string;
|
|
20
|
+
},
|
|
21
|
+
ContestApi: {
|
|
22
|
+
getLeagues:async():Promise<LeagueProps[]> => {
|
|
23
|
+
try {
|
|
24
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues`);
|
|
25
|
+
return resp.data.leagues
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return []
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
getTournamentsByIds: async(tournament_ids:string[]):Promise<TournamentProps[]> => {
|
|
31
|
+
try {
|
|
32
|
+
if(tournament_ids.length == 0){ return [] }
|
|
33
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/tournaments/bulk/get`, { attribute:'tournament_id', values: tournament_ids });
|
|
34
|
+
return resp.data.tournaments
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return []
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
getEventsByIds: async(event_ids:string[]):Promise<EventProps[]> => {
|
|
40
|
+
try {
|
|
41
|
+
if(event_ids.length == 0){ return [] }
|
|
42
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/events/bulk/get`, { attribute:'event_id', values: event_ids });
|
|
43
|
+
return resp.data.events
|
|
44
|
+
} catch (e) {
|
|
45
|
+
return []
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
getMatchesByIds: async(match_ids:string[]):Promise<MatchProps[]> => {
|
|
49
|
+
try {
|
|
50
|
+
if(match_ids.length == 0){ return [] }
|
|
51
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/matches/bulk/get`, { attribute:'match_id', values: match_ids });
|
|
52
|
+
return resp.data.matches
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return []
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
getMatchesByTournamentId: async(tournament_id:string):Promise<MatchProps[]> => {
|
|
58
|
+
try {
|
|
59
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/matches/tournament/${tournament_id}`);
|
|
60
|
+
return resp.data.matches
|
|
61
|
+
} catch (e) {
|
|
62
|
+
return []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
getAthletesByIds : async(athlete_ids:string[]):Promise<AthleteProps[]> => {
|
|
66
|
+
if(athlete_ids.length == 0){ return [] }
|
|
67
|
+
try {
|
|
68
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/athletes/bulk/get`, { attribute: 'athlete_id', values: athlete_ids })
|
|
69
|
+
return resp.data.athletes
|
|
70
|
+
} catch (e) {
|
|
71
|
+
return []
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
getTeamsByIds: async(team_ids:string[]):Promise<TeamProps[]> => {
|
|
75
|
+
if(team_ids.length == 0){ return [] }
|
|
76
|
+
try {
|
|
77
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/teams/bulk/get`, { attribute:'team_id', values: team_ids })
|
|
78
|
+
return resp.data.teams
|
|
79
|
+
} catch (e) {
|
|
80
|
+
return []
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
OrderApi: {
|
|
85
|
+
getMyAction: async():Promise<{orders: OrderProps[], parlays:ParlayProps[], parlay_positions:ParlayPositionProps[], parlay_orders:OrderProps[]}> => {
|
|
86
|
+
try {
|
|
87
|
+
const resp = await axios.get(`${MK_SVC_API}/v1/orders/action/me`);
|
|
88
|
+
return resp.data
|
|
89
|
+
} catch (e) {
|
|
90
|
+
return { orders: [], parlay_orders: [], parlay_positions: [], parlays: [] }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
FlashApi: {
|
|
95
|
+
getMyFlashAction: async():Promise<{ polls:PollProps[], poll_responses:PollResponseProps[], poll_options:PollOptionProps[] }> => {
|
|
96
|
+
try {
|
|
97
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v2/pm/action/me`);
|
|
98
|
+
console.log(resp.data)
|
|
99
|
+
return resp.data
|
|
100
|
+
} catch (e) {
|
|
101
|
+
return { polls:[], poll_responses:[], poll_options: [] }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
EngagementApi: {
|
|
106
|
+
getCompetitionOptions: async():Promise<{competition_types:CompetitionTypeProps[], competition_result_types:CompetitionResultTypeProps[], competition_payout_types:CompetitionPayoutTypeProps[]}> => {
|
|
107
|
+
try {
|
|
108
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/options`)
|
|
109
|
+
return resp.data
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return { competition_payout_types:[], competition_result_types:[], competition_types:[] }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
getMyActiveSquaresCompetitions:async():Promise<{ squares_competitions:SquaresCompetitionProps[] }> => {
|
|
115
|
+
try {
|
|
116
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/squares/me/active`);
|
|
117
|
+
return resp.data
|
|
118
|
+
} catch (error) {
|
|
119
|
+
return { squares_competitions: [] }
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
getMyActiveCompetitions:async():Promise<{ competitions:CompetitionProps[], competition_players:CompetitionPlayerProps[], competition_records:CompetitionRecordProps[], competition_results:CompetitionResultProps[] }> => {
|
|
124
|
+
try {
|
|
125
|
+
const resp = await axios.get(`${TP_SVC_API}/v2/competitions/me/active`);
|
|
126
|
+
return resp.data
|
|
127
|
+
} catch (e) {
|
|
128
|
+
return { competitions: [], competition_players:[], competition_records:[], competition_results:[] }
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
getMyActiveSeasons:async():Promise<{ competition_seasons:CompetitionSeasonProps[], competition_season_players:CompetitionSeasonPlayerProps[], competition_season_results:CompetitionSeasonResultProps[] }> => {
|
|
133
|
+
try {
|
|
134
|
+
const resp = await axios.get(`${TP_SVC_API}/v2/competitions/seasons/me/active`);
|
|
135
|
+
return resp.data
|
|
136
|
+
} catch (e) {
|
|
137
|
+
return { competition_seasons:[], competition_season_players:[], competition_season_results:[] }
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
getMyActiveBracketCompetitions:async():Promise<{ bracket_competitions:BracketCompetitionProps[], competition_player_brackets:CompetitionPlayerBracketProps[], player_brackets:PlayerBracketProps[] }> => {
|
|
141
|
+
try {
|
|
142
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/brackets/me/active`);
|
|
143
|
+
return resp.data
|
|
144
|
+
} catch (e) {
|
|
145
|
+
return { bracket_competitions:[], competition_player_brackets:[], player_brackets:[] }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
getMyActiveAdminBracketCompetitions: async() => {
|
|
149
|
+
try {
|
|
150
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/brackets/admin/active`);
|
|
151
|
+
return resp.data.bracket_competitions
|
|
152
|
+
} catch (e) {
|
|
153
|
+
return []
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
export const MyActionHelpers = {
|
|
161
|
+
sortAction: (orders:OrderProps[], parlays:ParlayProps[], parlay_orders:OrderProps[], polls:PollProps[], competitions:CompetitionProps[], squares_competitions:SquaresCompetitionProps[], bracket_competitions:BracketCompetitionProps[]) => {
|
|
162
|
+
//Lets set up an array of data types
|
|
163
|
+
let action_types:ActionListProps[] = []
|
|
164
|
+
//Go through orders and we will group these into contests
|
|
165
|
+
let contests = [ ...new Set(orders.map(o => `${o.event_type}:${o.event_id}`)) ]
|
|
166
|
+
//Go through orders
|
|
167
|
+
contests.map(c => {
|
|
168
|
+
let event_id = c.split(':')[1]
|
|
169
|
+
let event_type = c.split(':')[0] as 'team'|'tournament'|'match'|undefined
|
|
170
|
+
if(!event_id || !event_type){ return }
|
|
171
|
+
let c_orders = orders.filter(o => o.event_id == event_id && o.event_type == event_type)
|
|
172
|
+
let expire_time = c_orders[0]?.expire_datetime
|
|
173
|
+
action_types.push({ id:event_id, contest_type:event_type, action_datetime: moment(expire_time), type: 'contest', orders: c_orders });
|
|
174
|
+
})
|
|
175
|
+
parlays.map(p => {
|
|
176
|
+
const p_orders = parlay_orders.filter(po => po.parlay_id == p.parlay_id);
|
|
177
|
+
action_types.push({ id: p.parlay_id, type:'parlay', action_datetime:moment(p.create_datetime), orders: p_orders});
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
polls.map(p => {
|
|
181
|
+
action_types.push({ id: p.poll_id, action_datetime: moment(p.end_datetime), type:'flash', orders:[] })
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
competitions.map(c => {
|
|
185
|
+
action_types.push({ id: c.competition_id, type:'competition', action_datetime:moment(c.scheduled_datetime), orders:[] });
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
squares_competitions.map(sc => {
|
|
189
|
+
action_types.push({ id: sc.sq_comp_id, type:'squares', action_datetime:moment(sc.begin_datetime), orders:[] });
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
bracket_competitions.map(bc => {
|
|
193
|
+
action_types.push({ id:bc.bracket_competition_id, type:'bracket', action_datetime: moment(bc.scheduled_datetime), orders: [] });
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
return action_types.sort((a,b) => moment(b.action_datetime).unix() - moment(a.action_datetime).unix());
|
|
197
|
+
},
|
|
198
|
+
getContestsFromOrders: (orders:OrderProps[]) => {
|
|
199
|
+
let event_ids = [ ...new Set(orders.filter(o => o.event_type == 'team').map(o => o.event_id))]
|
|
200
|
+
let tournament_ids = [ ...new Set(orders.filter(o => o.event_type == 'tournament').map(o => o.event_id))]
|
|
201
|
+
let match_ids = [ ...new Set(orders.filter(o => o.event_type == 'match').map(o => o.event_id))]
|
|
202
|
+
|
|
203
|
+
//Now lets grab all the athletes and teams that are needed as well
|
|
204
|
+
let athlete_ids = [ ...new Set(orders.filter(o => o.side_type == 'athlete').map(o => o.side_id)) ]
|
|
205
|
+
let team_ids = [ ...new Set(orders.filter(o => o.side_type == 'team').map(o => o.side_id)) ]
|
|
206
|
+
|
|
207
|
+
return { event_ids, tournament_ids, match_ids, athlete_ids, team_ids }
|
|
208
|
+
},
|
|
209
|
+
getContestsByIds: async(event_ids:string[], tournament_ids:string[], match_ids:string[], athlete_ids:string[], team_ids:string[]) => {
|
|
210
|
+
const events = await MyActionApi.ContestApi.getEventsByIds(event_ids);
|
|
211
|
+
const tournaments = await MyActionApi.ContestApi.getTournamentsByIds(tournament_ids);
|
|
212
|
+
const matches = await MyActionApi.ContestApi.getMatchesByIds(match_ids);
|
|
213
|
+
const athletes = await MyActionApi.ContestApi.getAthletesByIds(athlete_ids);
|
|
214
|
+
const teams = await MyActionApi.ContestApi.getTeamsByIds(team_ids);
|
|
215
|
+
return { events, tournaments, matches, athletes, teams }
|
|
216
|
+
},
|
|
217
|
+
getContestDetails: (contest_type:string, event?:EventProps, tournament?:TournamentProps, match?:MatchProps):{ contest_title:string, scheduled_datetime:Moment } => {
|
|
218
|
+
switch(contest_type){
|
|
219
|
+
case 'team':
|
|
220
|
+
if(!event){ return { contest_title: '', scheduled_datetime: moment() } }
|
|
221
|
+
return { contest_title: event.event_title, scheduled_datetime: moment(event.scheduled_datetime) }
|
|
222
|
+
case 'tournament':
|
|
223
|
+
if(!tournament){ return { contest_title: '', scheduled_datetime: moment() } }
|
|
224
|
+
return { contest_title: tournament.tournament_name, scheduled_datetime: moment(tournament.scheduled_datetime) }
|
|
225
|
+
case 'match':
|
|
226
|
+
if(!match){ return { contest_title: '', scheduled_datetime: moment() } }
|
|
227
|
+
return { contest_title: match.match_title, scheduled_datetime: moment(match.scheduled_datetime) }
|
|
228
|
+
default: return { contest_title: '', scheduled_datetime: moment() }
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
calcAllOrderStats: (orders:OrderProps[], parlay_positions?:ParlayPositionProps[], flash_responses?:PollResponseProps[]):OrderStatsProps => {
|
|
232
|
+
let open_order_count = 0, open_amt = 0, potential_winnings = 0, called_amt = 0, commission = 0;
|
|
233
|
+
let resolved_stake = 0, original_stake = 0, delayed_cash = 0, winnings = 0, net_winnings = 0, unresolved_stake = 0, resolved_potential_winnings = 0, unresolved_potential_winnings = 0, unresolved_potential_net_winnings = 0, num_trades = 0, cash_rcvd = 0;
|
|
234
|
+
let unique_order_titles = [ ...new Set(orders.map(o => o.title)) ]
|
|
235
|
+
let result_ind:string|undefined = undefined
|
|
236
|
+
let order_ids:string[] = []
|
|
237
|
+
let open_orders:string[] = []
|
|
238
|
+
let wins = 0, losses = 0, draws = 0;
|
|
239
|
+
console.log(flash_responses)
|
|
240
|
+
orders.map(o => {
|
|
241
|
+
let commission_pct = 0
|
|
242
|
+
if(o.commission_pct){ commission_pct = o.commission_pct }
|
|
243
|
+
order_ids.push(o.order_id)
|
|
244
|
+
if(o.status === 'approved'){
|
|
245
|
+
open_orders.push(o.order_id)
|
|
246
|
+
open_amt += o.open_amt
|
|
247
|
+
open_order_count += 1
|
|
248
|
+
potential_winnings += o.potential_winnings
|
|
249
|
+
called_amt += o.called_amt
|
|
250
|
+
}
|
|
251
|
+
if(!o.positions){ return }
|
|
252
|
+
o.positions.map(p => {
|
|
253
|
+
if(!p){ return }
|
|
254
|
+
num_trades += 1
|
|
255
|
+
cash_rcvd += p.cash_rcvd
|
|
256
|
+
if(!p.result_ind){
|
|
257
|
+
delayed_cash += p.delayed_cash
|
|
258
|
+
unresolved_stake += p.stake
|
|
259
|
+
unresolved_potential_winnings += p.potential_winnings
|
|
260
|
+
unresolved_potential_net_winnings += (p.potential_winnings - ((p.potential_winnings - p.stake) * commission_pct))
|
|
261
|
+
|
|
262
|
+
} else {
|
|
263
|
+
resolved_stake += p.stake
|
|
264
|
+
original_stake += p.original_stake
|
|
265
|
+
winnings += p.winnings
|
|
266
|
+
net_winnings += p.net_winnings
|
|
267
|
+
result_ind = p.result_ind
|
|
268
|
+
commission += p.commission
|
|
269
|
+
resolved_potential_winnings += p.potential_winnings
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
if(result_ind == 'win'){ wins += 1 }
|
|
273
|
+
if(result_ind == 'lose'){ losses += 1 }
|
|
274
|
+
if(result_ind == 'draw'){ draws += 1 }
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
if(parlay_positions && parlay_positions.length > 0){
|
|
278
|
+
parlay_positions.map(pp => {
|
|
279
|
+
if(!pp.result_ind){
|
|
280
|
+
unresolved_stake += pp.stake
|
|
281
|
+
original_stake += pp.stake
|
|
282
|
+
unresolved_potential_winnings += pp.potential_winnings
|
|
283
|
+
unresolved_potential_net_winnings += (pp.potential_winnings - ((pp.potential_winnings - pp.stake) * pp.commission_pct))
|
|
284
|
+
} else {
|
|
285
|
+
resolved_stake += pp.stake
|
|
286
|
+
original_stake += pp.stake
|
|
287
|
+
winnings += pp.winnings
|
|
288
|
+
net_winnings += pp.net_winnings
|
|
289
|
+
commission += pp.commission
|
|
290
|
+
resolved_potential_winnings += pp.potential_winnings
|
|
291
|
+
}
|
|
292
|
+
if(pp.result_ind == 'win'){ wins += 1 }
|
|
293
|
+
if(pp.result_ind == 'lose'){ losses += 1 }
|
|
294
|
+
if(pp.result_ind == 'draw'){ draws += 1 }
|
|
295
|
+
})
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
let unresolved_position_probability = unresolved_stake / unresolved_potential_winnings
|
|
299
|
+
let resolved_position_probability = resolved_stake / resolved_potential_winnings
|
|
300
|
+
let unresolved_position_odds = MarketComponentHelpers.calcAmericanOddsFromProbability(unresolved_position_probability)
|
|
301
|
+
let resolved_position_odds = MarketComponentHelpers.calcAmericanOddsFromProbability(resolved_position_probability)
|
|
302
|
+
let offer_probability = open_amt / potential_winnings
|
|
303
|
+
let offer_odds = MarketComponentHelpers.calcAmericanOddsFromProbability(offer_probability)
|
|
304
|
+
let earnings = winnings + cash_rcvd - original_stake
|
|
305
|
+
let net_earnings = net_winnings + cash_rcvd - original_stake
|
|
306
|
+
let roi = earnings / resolved_stake
|
|
307
|
+
return {
|
|
308
|
+
stat_id: 'ALL',
|
|
309
|
+
unresolved_stake,
|
|
310
|
+
earnings,
|
|
311
|
+
resolved_stake,
|
|
312
|
+
original_stake,
|
|
313
|
+
net_earnings,
|
|
314
|
+
roi,
|
|
315
|
+
wins,
|
|
316
|
+
losses,
|
|
317
|
+
commission,
|
|
318
|
+
net_winnings,
|
|
319
|
+
unresolved_potential_net_winnings,
|
|
320
|
+
unique_order_titles,
|
|
321
|
+
draws,
|
|
322
|
+
unresolved_position_odds,
|
|
323
|
+
resolved_position_odds,
|
|
324
|
+
result_ind,
|
|
325
|
+
delayed_cash,
|
|
326
|
+
unresolved_potential_winnings,
|
|
327
|
+
resolved_potential_winnings,
|
|
328
|
+
resolved_position_probability,
|
|
329
|
+
unresolved_position_probability,
|
|
330
|
+
num_trades,
|
|
331
|
+
cash_rcvd,
|
|
332
|
+
winnings,
|
|
333
|
+
player_id: orders[0]?.player_id??'0',
|
|
334
|
+
event_id: 'ALL',
|
|
335
|
+
event_type: 'ALL',
|
|
336
|
+
open_amt, potential_winnings, called_amt, offer_odds, offer_probability,
|
|
337
|
+
orders: order_ids,
|
|
338
|
+
open_orders
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
getDetailsForOrder: (order:OrderProps, events:EventProps[], tournaments:TournamentProps[], matches:MatchProps[], athletes:AthleteProps[], teams:TeamProps[], leagues:LeagueProps[]) => {
|
|
342
|
+
let event = order.event_type == 'team' ? events.find(e => e.event_id == order.event_id) : undefined
|
|
343
|
+
let tournament = order.event_type == 'tournament' ? tournaments.find(t => t.tournament_id == order.event_id) : undefined
|
|
344
|
+
let match = order.event_type == 'match' ? matches.find(m => m.match_id == order.event_id) : undefined
|
|
345
|
+
let match_tournament = tournaments.find(t => t.tournament_id == match?.tournament_id)
|
|
346
|
+
let deets = MyActionHelpers.getContestDetails(order.event_type, event, tournament, match);
|
|
347
|
+
let athlete = order.side_type == 'athlete' ? athletes.find(a => a.athlete_id == order.side_id) : undefined
|
|
348
|
+
let team = order.side_type == 'team' ? teams.find(t => t.team_id == order.side_id) : undefined
|
|
349
|
+
let league = event ? leagues.find(l => l.league_id == event.league_id) : tournament ? leagues.find(l => l.league_id == tournament.league_id) : match_tournament ? leagues.find(l => l.league_id == match_tournament.league_id) : undefined
|
|
350
|
+
return { event, tournament, match, athlete, team, contest_title: deets.contest_title, scheduled_datetime: deets.scheduled_datetime, league }
|
|
351
|
+
},
|
|
352
|
+
aggregatePositions: (parlay:ParlayProps, pp:ParlayPositionProps[]) => {
|
|
353
|
+
let stake = 0, potential_winnings = 0, winnings = 0, net_winnings = 0, offer_side = parlay.offer_side, commission = 0, status = 'inprogress'
|
|
354
|
+
let result_ind = pp[0]?.result_ind
|
|
355
|
+
pp.map(p => {
|
|
356
|
+
stake += p.stake
|
|
357
|
+
commission += p.commission
|
|
358
|
+
net_winnings += p.net_winnings
|
|
359
|
+
winnings += p.winnings
|
|
360
|
+
result_ind = p.result_ind
|
|
361
|
+
potential_winnings += p.potential_winnings
|
|
362
|
+
if(p.side == 'maker'){ offer_side = 'maker' }
|
|
363
|
+
if(p.status != 'inprogress'){ status = 'closed' }
|
|
364
|
+
});
|
|
365
|
+
let earnings = winnings - stake
|
|
366
|
+
return { stake, potential_winnings, earnings, winnings, commission, status, net_winnings , offer_side, result_ind}
|
|
367
|
+
},
|
|
368
|
+
getActionStats: (orders:OrderProps[], parlays:ParlayProps[], parlay_positions:ParlayPositionProps[], competitions:CompetitionProps[], squares_competitions:SquaresCompetitionProps[], bracket_competitions:BracketCompetitionProps[]) => {
|
|
369
|
+
let risk = 0
|
|
370
|
+
console.log(parlays)
|
|
371
|
+
orders.map(o => {
|
|
372
|
+
if(!o.positions || !o.positions[0]){ return }
|
|
373
|
+
o.positions.map(p => {
|
|
374
|
+
risk += p.stake
|
|
375
|
+
})
|
|
376
|
+
});
|
|
377
|
+
competitions.map(c => {
|
|
378
|
+
risk += parseFloat(c.buy_in as string)
|
|
379
|
+
});
|
|
380
|
+
squares_competitions.map(sc => {
|
|
381
|
+
console.log(sc);
|
|
382
|
+
risk += 0
|
|
383
|
+
});
|
|
384
|
+
bracket_competitions.map(bc => {
|
|
385
|
+
risk += bc.buy_in
|
|
386
|
+
});
|
|
387
|
+
parlay_positions.map(pp => {
|
|
388
|
+
risk += pp.stake
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
return { risk }
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from "../../Components/Themed"
|
|
3
|
+
import type { BracketCompetitionProps } from "../../types"
|
|
4
|
+
import { useColors } from '../../constants/useColors';
|
|
5
|
+
import { Icons } from '../../Components';
|
|
6
|
+
|
|
7
|
+
type BracketRowProps = {
|
|
8
|
+
market_type:'FOR_MONEY'|'FREE',
|
|
9
|
+
bracket_competition:BracketCompetitionProps,
|
|
10
|
+
width:number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const BracketRow = ({ market_type, bracket_competition, width }:BracketRowProps) => {
|
|
14
|
+
const Colors = useColors();
|
|
15
|
+
const cl = market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View>
|
|
19
|
+
<View type='row' style={{ padding:10, borderBottomWidth:1, borderColor:Colors.borders.light, flexWrap:'wrap' }}>
|
|
20
|
+
<Icons.BracketIcon size={22} color={Colors.text.h1} />
|
|
21
|
+
<View transparent style={{ borderRadius:0, padding:0, borderLeftWidth:1, borderColor:Colors.borders.light, flexGrow:1, marginLeft:6, paddingLeft:6, minWidth:75 }}>
|
|
22
|
+
<Text theme='h1' style={{ maxWidth:width * 0.55 }}>{bracket_competition.competition_name}</Text>
|
|
23
|
+
<Text theme='light' style={{ marginTop:3 }} color={Colors.text.action}>{}</Text>
|
|
24
|
+
</View>
|
|
25
|
+
<View style={{ margin:5, minWidth:40, justifyContent:'center', alignItems:'center' }}>
|
|
26
|
+
<Text theme='h1'>{cl}{(bracket_competition.buy_in as number).toFixed(2)}</Text>
|
|
27
|
+
<Text theme='light'>Risk</Text>
|
|
28
|
+
</View>
|
|
29
|
+
</View>
|
|
30
|
+
</View>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default BracketRow
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from "../../Components/Themed"
|
|
3
|
+
import type { CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionTypeProps } from "../../types"
|
|
4
|
+
import { useColors } from '../../constants/useColors';
|
|
5
|
+
import { Icons } from '../../Components';
|
|
6
|
+
|
|
7
|
+
type CompetitionRowProps = {
|
|
8
|
+
market_type:'FOR_MONEY'|'FREE',
|
|
9
|
+
competition:CompetitionProps,
|
|
10
|
+
competition_type:CompetitionTypeProps,
|
|
11
|
+
competition_result_type:CompetitionResultTypeProps,
|
|
12
|
+
competition_player:CompetitionPlayerProps,
|
|
13
|
+
competition_result:CompetitionResultProps,
|
|
14
|
+
competition_record:CompetitionRecordProps,
|
|
15
|
+
width:number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const CompetitionRow = ({ market_type, competition, competition_record, width }:CompetitionRowProps) => {
|
|
19
|
+
const Colors = useColors();
|
|
20
|
+
const cl = market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<View>
|
|
24
|
+
<View type='row' style={{ padding:10, borderBottomWidth:1, borderColor:Colors.borders.light, flexWrap:'wrap' }}>
|
|
25
|
+
<Icons.PickEmIcon size={22} color={Colors.text.h1} />
|
|
26
|
+
<View transparent style={{ borderRadius:0, padding:0, borderLeftWidth:1, borderColor:Colors.borders.light, flexGrow:1, marginLeft:6, paddingLeft:6, minWidth:75 }}>
|
|
27
|
+
<Text theme='h1' style={{ maxWidth:width * 0.55 }}>{competition.competition_name}</Text>
|
|
28
|
+
<Text theme='light' style={{ marginTop:3 }} color={Colors.text.action}>{competition_record.wins} - {competition_record.losses}</Text>
|
|
29
|
+
</View>
|
|
30
|
+
<View style={{ margin:5, minWidth:40, justifyContent:'center', alignItems:'center' }}>
|
|
31
|
+
<Text theme='h1'>{cl}{(competition.buy_in as number).toFixed(2)}</Text>
|
|
32
|
+
<Text theme='light'>Risk</Text>
|
|
33
|
+
</View>
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default CompetitionRow
|