forked from anssip/ultrabet-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote-schema.graphql
201 lines (177 loc) · 4.29 KB
/
remote-schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# This file was generated. Do not edit manually.
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
type Bet {
betOptions: [BetOption]
createdAt: String!
id: ID!
potentialWinnings: Float!
stake: Float!
status: BetStatus!
user: User
}
type BetOption {
bet: Bet!
id: Int!
marketOption: MarketOption!
status: BetStatus
}
"An Event represents a sports match or competition on which users can place bets."
type Event {
awayTeamName: String!
"Is this event completed?"
completed: Boolean!
"The id of the event in the source system."
externalId: String
homeTeamName: String!
id: ID!
"Is this event currently live?"
isLive: Boolean!
markets(source: String): [Market]
name: String!
result: EventResult
scoreUpdates: [ScoreUpdate]
sport: Sport!
startTime: String!
}
"""
A Market represents a specific betting opportunity within an event.
It's usually associated with one aspect of the event that users can bet on.
A single event can have multiple markets. Some common examples of markets
include Moneyline, Point Spread, and Totals (Over/Under).
"""
type Market {
event: Event
id: ID!
"Is this Market available for live betting?"
isLive: Boolean!
"""
When was this Market last updated? Used to track when the odds were last
updated during live betting.
"""
lastUpdated: String
name: String!
options: [MarketOption]
"What is the source or bookmaker that provides the odds for this Market?"
source: String!
}
"""
A MarketOption represents a specific choice or outcome within a market
that users can bet on. Each market typically has two or more options to choose from.
"""
type MarketOption {
id: ID!
"""
When was this Market last updated? Used to track when the odds were last
updated during live betting.
"""
lastUpdated: String
market: Market
name: String!
odds: Float!
}
" Mutations"
type Mutation {
" should be available for admins only:"
createEvent(name: String!, sport: String!, startTime: String!): Event
createMarket(eventId: ID!, name: String!): Market
createMarketOption(marketId: ID!, name: String!, odds: Float!): MarketOption
createUser(email: String!, username: String!): User
depositFunds(amount: Float!, userId: ID!): Wallet
"Places a bet on the provided market options."
placeBet(betType: BetType!, marketOptions: [ID!]!, stake: Float!): Bet
"Place multiple single bets, one for each option provided."
placeSingleBets(options: [BetOptionInput!]!): [Bet]
updateResult(eventId: ID!): Event
withdrawFunds(amount: Float!, userId: ID!): Wallet
}
" Queries"
type Query {
getBet(id: ID!): Bet
getEvent(id: ID!): Event
getMarket(id: ID!): Market
listBets: [Bet]
listEvents: [Event]
listLiveEvents: [Event]
listLiveMarkets(eventId: ID!): [Market]
listMarkets(eventId: ID!): [Market]
me: User
}
type ScoreUpdate {
event: Event!
id: ID!
name: String!
score: String!
timestamp: String!
}
type Sport {
"Is this sport in season at the moment?"
active: Boolean!
description: String!
group: String!
"Does this sport have outright markets?"
hasOutrights: Boolean!
id: ID!
key: String!
title: String!
}
type Subscription {
eventScoresUpdated: [Event]
eventStatusUpdated: [Event]
liveMarketOptionsUpdated: [MarketOption]
}
type Transaction {
amount: Float!
createdAt: String!
id: ID!
transactionType: TransactionType!
wallet: Wallet
}
type User {
bets: [Bet]
email: String
externalId: String
id: ID!
username: String
wallet: Wallet
}
type Wallet {
balance: Float!
id: ID!
transactions: [Transaction]
user: User
}
enum BetStatus {
CANCELED
LOST
PENDING
WON
}
"https://chat.openai.com/share/92b7bc9f-6fc6-4f57-9a4e-f217270ad271"
enum BetType {
PARLAY
SINGLE
" same as long bet or accumulator"
SYSTEM
}
enum EventResult {
AWAY_TEAM_WIN
DRAW
HOME_TEAM_WIN
}
enum TransactionType {
BET_PLACED
BET_REFUNDED
BET_WON
DEPOSIT
WITHDRAWAL
}
"A slightly refined version of RFC-3339 compliant DateTime Scalar"
scalar DateTime
input BetOptionInput {
marketOptionId: ID!
stake: Float!
}