BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/mrdoge-ui/mrdoge-conflict-adapter

Conflict Adapter (Mr. Doge SDK)

mrdoge-ui/mrdoge-conflict-adapter
FreeUtility

Flags mutually incompatible picks (Match Result vs Double Chance, Over/Under threshold overlap, BTTS vs low Totals) for disabledIds or conflictingPickIds.

Install it

npx shadcn@latest add https://mrdoge.co/r/mrdoge-conflict-adapter.json

Source

lib/mrdoge-adapters/conflicts.tsmrdoge.co/r/mrdoge-conflict-adapter.json · first 6 KB
1import type { Market } from "@mrdoge/protocol"
2import type { BetSlipPick } from "@/registry/mrdoge-ui/bet-slip/bet-slip"
3
4export interface ConflictCandidate {
5 id: string
6 matchId: string
7 /** Market sysname, e.g. "SOCCER_UNDER_OVER". */
8 betType: string
9 /** Outcome code, e.g. "O", "1X". */
10 code: string
11 /** Parsed Over/Under threshold; only set when `code` is "O"/"U". */
12 threshold?: number
13}
14
15const MATCH_RESULT_TYPES = ["SOCCER_MATCH_RESULT", "SOCCER_MATCH_RESULT_PRELIVE"]
16const DOUBLE_CHANCE = "SOCCER_DOUBLE_CHANCE"
17const TOTALS = ["SOCCER_UNDER_OVER", "SOCCER_UNDER_OVER_PRELIVE"]
18const BTTS = ["SOCCER_BOTH_TEAMS_TO_SCORE", "SOCCER_BOTH_TEAMS_TO_SCORE_PRELIVE"]
19const BTTS_YES_CODES = ["Y", "GG"]
20
21// Over/Under outcomes only carry a generic "O"/"U" code, no threshold in
22// it. The threshold lives in the caption instead ("Over 1.5", "Under
23// 1.5"), so that's what has to be parsed to compare thresholds.
24function parseThreshold(caption: string | null | undefined): number | undefined {
25 const match = caption?.match(/[\d.]+/)
26 const value = match ? parseFloat(match[0]) : NaN
27 return Number.isNaN(value) ? undefined : value
28}
29
30/**
31 * Flattens every line of every market for one match into conflict
32 * candidates, parsing an Over/Under threshold from the caption where
33 * applicable.
34 */
35export function toConflictCandidates(matchId: string, markets: Market[]): ConflictCandidate[] {
36 const candidates: ConflictCandidate[] = []
37 for (const market of markets) {
38 for (const line of market.lines) {
39 const isTotals = line.code.startsWith("O") || line.code.startsWith("U")
40 candidates.push({
41 id: line.id,
42 matchId,
43 betType: market.betType,
44 code: line.code,
45 threshold: isTotals ? parseThreshold(line.caption) : undefined,
46 })
47 }
48 }
49 return candidates
50}
51
52// Pairwise incompatibility check: the three rule families this adapter
53// knows about. Symmetric: conflicts(a, b) === conflicts(b, a).
54function conflicts(a: ConflictCandidate, b: ConflictCandidate): boolean {
55 if (a.matchId !== b.matchId) return false
56
57 // Double Chance is just two of Match Result's three outcomes combined:
58 // the two markets describe overlapping information about the same
59 // result, not independent events. Even a "compatible" pair (Home win +
60 // "Home or Away") is a wasted leg, not a real parlay combination, so
61 // any Match Result selection blocks the entire Double Chance market and
62// … truncated

What it pulls in

npm packages

  • @mrdoge/protocol

Other registry items

  • bet-slip

Files it writes

  • lib/mrdoge-adapters/conflicts.ts

Facts

Registry
mrdoge-ui
Type
registry:lib
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

mrdoge.co mrdogeco/docs on GitHub Raw registry item This item as JSON

More from mrdoge-ui

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Bet Slip Adapter (Mr. Doge SDK)mrdoge-bet-slip-adaptermrdoge-uiUtilitiesFree1 dep
Mr. Doge Clientmrdoge-clientmrdoge-uiUtilitiesFree1 dep
Match Card Adapter (Mr. Doge SDK)mrdoge-match-card-adaptermrdoge-uiUtilitiesFree1 dep
Match Highlight Adapter (Mr. Doge SDK)mrdoge-match-highlight-adaptermrdoge-uiUtilitiesFree1 dep
Match Timeline Adapter (Mr. Doge SDK)mrdoge-match-timeline-adaptermrdoge-uiUtilitiesFree1 dep
Odds Selector Adapter (Mr. Doge SDK)mrdoge-odds-selector-adaptermrdoge-uiUtilitiesFree1 dep
Stats List Adapter (Mr. Doge SDK)mrdoge-stats-list-adaptermrdoge-uiUtilitiesFree1 dep
Rate Limitrate-limitmrdoge-uiUtilitiesFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex