Skip to content

Instantly share code, notes, and snippets.

@dbernazal
Last active June 7, 2023 21:21
Show Gist options
  • Save dbernazal/42edb54781708c604e12d14330663c3b to your computer and use it in GitHub Desktop.
Save dbernazal/42edb54781708c604e12d14330663c3b to your computer and use it in GitHub Desktop.
# yaml-language-server: $schema=https://raw.githubusercontent.com/asyncapi/spec-json-schemas/c03428dcb043156d254f2387183bb71bacdb1fa3/schemas/2.6.0-without-%24id.json
asyncapi: "2.6.0"
info:
title: Simplebet Gaming
version: 0.0.1
description: The backend that powers the Betr mobile applications
servers:
staging_f2p:
url: wss://betr-f2p.staging.simplebet.io/socket/websocket
protocol: wss
staging_rmb:
url: wss://betr-rmb.staging.simplebet.io/socket/websocket
protocol: wss
prod_f2p:
url: wss://betr-f2p.simplebet.io/socket/websocket
protocol: wss
prod_oh_rmb:
url: wss://betr-rmb.oh.simplebet.io/socket/websocket
protocol: wss
channels:
schedule:
subscribe:
operationId: ScheduleChannelSub
message:
oneOf:
- messageId: ScheduleChannel_join
title: Join the Schedule Channel
payload:
type: object
properties:
leagues:
type: array
items:
$ref: "#/components/schemas/League"
x-reply:
status: ok
response:
type: object
properties:
schedule:
type: array
items:
$ref: "#/components/schemas/Match"
- messageId: ScheduleChannel_subscribe
title: Subscribe to a set of leagues.
payload:
type: object
properties:
leagues:
type: array
items:
$ref: "#/components/schemas/League"
x-reply:
status: ok
response:
type: object
properties:
schedule:
type: array
items:
$ref: "#/components/schemas/Match"
- messageId: ScheduleChannel_unsubscribe
title: Unsubscribe to a set of leagues.
payload:
type: object
properties:
leagues:
type: array
items:
$ref: "#/components/schemas/League"
x-reply:
status: ok
publish:
operationId: scheduleChannelPub
message:
oneOf:
- messageId: ScheduleChannel_schedule_update
payload:
type: object
properties:
schedule:
$ref: "#/components/schemas/Match"
match:{match_id}:
parameters:
match_id:
description: Match ID
schema:
$ref: "#/components/schemas/UUID"
subscribe:
operationId: matchChannelSub
message:
oneOf:
- messageId: MatchChannel_join
title: Join the Match Channel
x-reply:
oneOf:
- status: ok
response:
$ref: "#/components/schemas/Match"
- status: error
response:
type: object
reason:
type: string
enum: ["match not found"]
- messageId: MatchChannel_subscribe
title: subscribe
payload:
type: object
properties:
match_id:
$ref: "#/components/schemas/UUID"
x-reply:
status: ok
- messageId: MatchChannel_unsubscribe
title: unsubscribe
payload:
type: object
properties:
match_id:
$ref: "#/components/schemas/UUID"
x-reply:
status: ok
publish:
operationId: MatchChannelPub
message:
oneOf:
- messageId: MatchChannel_match_update
payload:
type: object
properties:
league:
$ref: "#/components/schemas/League"
match:
$ref: "#/components/schemas/Match"
- messageId: MatchChannel_period_changed
payload:
type: object
properties:
league:
$ref: "#/components/schemas/League"
match:
$ref: "#/components/schemas/Match"
- messageId: MatchChannel_match_ended
payload:
type: object
properties:
match_id:
$ref: "#/components/schemas/UUID"
market:{market_id}:
parameters:
market_id:
description: Market ID
schema:
type: string
format: uuid
subscribe:
operationId: marketChannelSub
message:
oneOf:
- messageId: MarketChannel_join
title: Join the Market Channel
x-reply:
oneOf:
- status: ok
response:
type: object
properties:
markets:
type: array
items:
$ref: "#/components/schemas/Market"
- status: error
response:
type: object
properties:
reason:
type: string
enum: [ "match not found" ]
publish:
operationId: marketChannelPub
message:
messageId: MarketChannel_update
title: market_update
payload:
type: object
properties:
sport:
type: string
enum: [ baseball, basketball, football ]
market:
$ref: "#/components/schemas/Market"
user:{user_id}:
parameters:
user_id:
description: User ID
schema:
$ref: "#/components/schemas/UUID"
subscribe:
operationId: UserChannelSub
message:
oneOf:
- messageId: UserChannel_join
title: Join the user Channel
payload:
type: object
properties:
version:
type: string
enum:
- v3
- v4
token:
type: string
nullable: true
- messageId: UserChannel_write_session_event
payload:
type: object
properties:
user_id:
$ref: "#/components/schemas/UUID"
value:
type: string
expires_in:
type: string
format: seconds
x-reply:
oneOf:
- status: ok
response:
type: object
properties:
event:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
name:
type: string
value:
type: string
expires_at:
$ref: "#/components/schemas/ISO8601Timestamp"
user_id:
$ref: "#/components/schemas/UUID"
- status: error
response:
type: object
properties:
errors:
type: array
items:
$ref: "#/components/schemas/Error"
- messageId: UserChannel_get_session_events
x-reply:
status: ok
response:
type: object
properties:
events:
type: array
items:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
name:
type: string
value:
type: string
expires_at:
$ref: "#/components/schemas/ISO8601Timestamp"
user_id:
$ref: "#/components/schemas/UUID"
- messageId: UserChannel_get_token
payload:
type: object
properties:
type:
type: string
enum: [prizeout_session]
x-reply:
status: ok
response:
type: object
properties:
type:
type: string
enum: [prizeout_session]
token:
type: string
- messageId: UserChannel_get_maxed_out_markets
payload:
type: object
properties:
match_uuid:
$ref: "#/components/schemas/UUID"
wallet_id:
$ref: "#/components/schemas/UUID"
x-reply:
status: ok
response:
type: object
properties:
maxed_out_markets:
type: array
items:
type: object
properties:
wallet_id:
$ref: "#/components/schemas/UUID"
market_uuid:
$ref: "#/components/schemas/UUID"
match_uuid:
$ref: "#/components/schemas/UUID"
user_id:
$ref: "#/components/schemas/UUID"
selections:
type: array
items:
$ref: "#/components/schemas/UUID"
updated_at:
$ref: "#/components/schemas/ISO8601Timestamp"
inserted_at:
$ref: "#/components/schemas/ISO8601Timestamp"
publish:
operationId: UserChannelPub
message:
oneOf:
- messageId: UserChannel_wallet_update
payload:
type: object
properties:
amount:
type: integer
nullable: true
balance:
type: integer
cash_balance:
type: integer
bonus_balance:
type: integer
id:
$ref: "#/components/schemas/UUID"
last_updated:
$ref: "#/components/schemas/ISO8601Timestamp"
reason:
type: string
nullable: true
- messageId: UserChannel_maxed_out_market
payload:
type: object
properties:
wallet_id:
$ref: "#/components/schemas/UUID"
market_uuid:
$ref: "#/components/schemas/UUID"
match_uuid:
$ref: "#/components/schemas/UUID"
- messageId: UserChannel_bets_resolved
payload:
type: object
properties:
bets:
type: array
items:
$ref: "#/components/schemas/Bet"
- messageId: UserChannel_bet_resulted
payload:
type: object
properties:
bets:
$ref: "#/components/schemas/Bet"
- messageId: UserChannel_delayed_bet_placed
payload:
type: object
properties:
properties:
amount:
type: integer
user_id:
$ref: "#/components/schemas/UUID"
bet_id:
$ref: "#/components/schemas/UUID"
market_name:
type: string
error:
type: object
nullable: true
- messageId: UserChannel_session_event
payload:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
name:
type: string
value:
type: string
expires_at:
$ref: "#/components/schemas/ISO8601Timestamp"
user_id:
$ref: "#/components/schemas/UUID"
- messageId: UserChannel_user_update
payload:
properties:
id:
$ref: "#/components/schemas/UUID"
username:
type: string
external_id:
$ref: "#/components/schemas/UUID"
- messageId: UserChannel_session_terminated
payload:
type: object
properties:
reasons:
type: string
enum: [time_limit_exceeded]
message:
type: string
enum: ["Your daily time limit has been exceeded."]
components:
schemas:
Error:
type: object
properties:
name:
type: string
message:
type: string
reason:
oneOf:
- type: string
- type: array
items:
type: string
Match:
type: object
properties:
id:
$ref: "#/components/schemas/UUID"
home_team:
$ref: "#/components/schemas/Team"
away_team:
$ref: "#/components/schemas/Team"
featured:
type: boolean
start_time:
$ref: "#/components/schemas/ISO8601Timestamp"
away_team_score:
type: integer
home_team_score:
type: integer
league:
type: string
status:
type: string
network:
type: string
period:
type: integer
prize_summary:
type: string
sport_data:
$ref: "#/components/schemas/SportData"
Team:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
name:
type: string
abbrv:
type: string
league:
type: string
logo:
type: string
logo_alt:
type: string
official_logo:
type: string
color_hex_primary:
type: string
color_hex_secondary:
type: string
short_name:
type: string
metadata:
type: object
properties:
conference:
type: object
properties:
abbreviation:
type: string
name:
type: string
slug:
type: string
ap_ranking:
type: integer
city:
type: string
League:
type: string
enum: [nfl, cbb, nba, cfb, mlb]
PlayerEntityDetails:
type: object
properties:
type:
type: string
enum: [player]
label:
type: string
abbrv:
type: string
uuid:
$ref: "#/components/schemas/UUID"
id:
$ref: "#/components/schemas/UUID"
league:
$ref: "#/components/schemas/League"
image:
type: string
team_id:
$ref: "#/components/schemas/UUID"
SportData:
oneOf:
- type: object
properties:
league:
type: string
enum: [nfl, cfb]
match_drive_number:
type: integer
play_number:
type: integer
team_drive_number:
type: integer
distance:
type: integer
down:
type: integer
field_side:
type: string
possession:
type: string
yardline:
type: integer
game_clock:
type: integer
- type: object
properties:
league:
type: string
enum: [mlb]
balls:
type: integer
batter:
$ref: "#/components/schemas/PlayerEntityDetails"
pitcher:
$ref: "#/components/schemas/PlayerEntityDetails"
inning:
type: integer
outs:
type: integer
pitch_number:
type: integer
batter_plate_appearance_number:
type: integer
bases:
type: array
items:
type: boolean
strikes:
type: integer
market_inning_half:
type: string
pitcher_name:
type: string
market_inning:
type: integer
- type: object
properties:
game_clock:
type: integer
league:
type: string
enum: [nba, cbb]
possession:
type: string
team_fouls:
type: object
properties:
away_total:
type: integer
away_two_minute:
type: integer
home_total:
type: integer
home_two_minute:
type: integer
player_stats:
type: object
additionalProperties:
type: object
properties:
quarter_points:
type: integer
ISO8601Timestamp:
type: string
format: "iso8601-datetime"
Decimal:
type: string
format: decimal
UUID:
type: string
format: uuid
MatchStateMeta:
type: object
properties:
away_team_score:
type: integer
home_team_score:
type: integer
league:
type: string
period:
type: integer
sport_data:
type: string
game_clock:
type: string
league:
type: string
possession:
type: string
team_fouls:
type: string
away_total:
type: integer
home_total:
type: integer
uuid:
$ref: "#/components/schemas/UUID"
Bet:
type: object
description: Rendering of a bet
properties:
amount:
type: integer
description: Amount wagered in cents
coefficient:
$ref: "#/components/schemas/Decimal"
contest_id:
$ref: "#/components/schemas/UUID"
nullable: true
entity:
oneOf:
- $ref: "#/components/schemas/PlayerEntityDetails"
- $ref: "#/components/schemas/TeamEntityDetails"
- $ref: "#/components/schemas/MatchEntityDetails"
id:
$ref: "#/components/schemas/UUID"
inserted_at:
$ref: "#/components/schemas/ISO8601Timestamp"
selection_line:
$ref: "#/components/schemas/Decimal"
nullable: true
match_state_meta:
$ref: "#/components/schemas/MatchStateMeta"
current_match_details:
type: object
properties:
home_team:
type: object
properties:
abbrv:
type: string
score:
type: integer
nullable: true
away_team:
type: object
properties:
abbrv:
type: string
score:
type: integer
nullable: true
game_clock:
type: integer
nullable: true
league:
$ref: "#/components/schemas/League"
period:
type: integer
nullable: true
status:
type: string
enum: [prematch, active, ended]
winning_line:
$ref: "#/components/schemas/Decimal"
nullable: true
line:
type: string
nullable: true
market_category:
type: string
market_helper_image:
type: string
market_id:
$ref: "#/components/schemas/UUID"
market_image:
type: string
market_name:
type: string
market_title:
type: string
market_uuid:
$ref: "#/components/schemas/UUID"
match_id:
$ref: "#/components/schemas/UUID"
match_uuid:
$ref: "#/components/schemas/UUID"
payout:
type: integer
period:
type: integer
probability:
$ref: "#/components/schemas/Decimal"
result_history:
type: array
items:
type: object
properties:
winning_line:
type: string
nullable: true
status:
type: string
enum: [win, loss, void]
winning_selection_code:
type: string
nullable: true
description: The winning selection's label
id:
$ref: "#/components/schemas/UUID"
bet_id:
$ref: "#/components/schemas/UUID"
inserted_at:
$ref: "#/components/schemas/ISO8601Timestamp"
updated_at:
$ref: "#/components/schemas/ISO8601Timestamp"
selection_code:
type: string
description: The selection code chosen for the bet
selection_id:
$ref: "#/components/schemas/UUID"
selection_outcome_code:
type: string
description: The winning selection code on the market
selection_outcome_title:
type: string
description: The label suitable to be shown to the user for the winning selection on the market
selection_title:
type: string
description: The label suitable to be shown to the user for the selection chosen for the bet
selection_uuid:
$ref: "#/components/schemas/UUID"
short_selection_outcome_title:
type: string
short_selection_title:
type: string
status:
type: string
enum: [pending, open, win, loss, void]
status_reason:
type: string
nullable: true
updated_at:
$ref: "#/components/schemas/ISO8601Timestamp"
Market:
type: object
properties:
uuid:
$ref: "#/components/schemas/UUID"
match_uuid:
$ref: "#/components/schemas/UUID"
line:
type: string
market_category:
type: string
market_name:
type: string
market_title:
type: string
status:
type: string
enum:
- enabled
- suspended
- resulted
- reresulted
- void
- pending_result
market_status_reason:
type: string
timeframe_label:
type: string
enum:
- at_bat
- on_deck
- in_the_hole
timeframe_status:
type: string
enum:
- compeleted
- live
- upcoming
period:
type: integer
selections:
type: array
items:
type: object
properties:
code:
type: string
coefficient:
$ref: "#/components/schemas/Decimal"
probability:
$ref: "#/components/schemas/Decimal"
status:
type: string
enum:
- suspended
- enabled
- pending
- win
- loss
- void
title:
type: string
uuid:
$ref: "#/components/schemas/UUID"
entity_ids:
type: array
items:
$ref: "#/components/schemas/UUID"
line:
type: string
max_bet_limit:
type: integer
nullable: true
entities:
type: array
items:
oneOf:
- $ref: "#/components/schemas/PlayerEntityDetails"
- $ref: "#/components/schemas/TeamEntityDetails"
- $ref: "#/components/schemas/MatchEntityDetails"
sport_data:
$ref: "#/components/schemas/SportData"
TeamEntityDetails:
type: object
properties:
type:
type: string
enum: [team]
label:
type: string
abbrv:
type: string
uuid:
$ref: "#/components/schemas/UUID"
id:
$ref: "#/components/schemas/UUID"
league:
$ref: "#/components/schemas/League"
image:
type: string
team_id:
$ref: "#/components/schemas/UUID"
franchise_name:
type: string
primary_color:
type: string
secondary_color:
type: string
alt_image:
type: string
city:
type: string
MatchEntityDetails:
type: object
properties:
type:
type: string
enum: [match]
label:
type: string
league:
$ref: "#/components/schemas/League"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment