Scorum
Functions
Betting

Wallet Betting API. More...

Functions

annotated_signed_transaction scorum::wallet::wallet_api::create_game (uuid_type uuid, account_name_type moderator, const std::string &json_metadata, fc::time_point_sec start_time, uint32_t auto_resolve_delay_sec, game_type game, const std::vector< market_type > &markets, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::cancel_game (uuid_type uuid, account_name_type moderator, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::update_game_markets (uuid_type uuid, account_name_type moderator, const std::vector< market_type > &markets, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::update_game_start_time (uuid_type uuid, account_name_type moderator, fc::time_point_sec start_time, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::post_game_results (uuid_type uuid, account_name_type moderator, const std::vector< wincase_type > &wincases, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::post_bet (uuid_type uuid, account_name_type better, uuid_type game_uuid, wincase_type wincase, odds_input odds, asset stake, bool is_live, bool broadcast)
 
annotated_signed_transaction scorum::wallet::wallet_api::cancel_pending_bets (account_name_type better, const std::vector< uuid_type > &bet_uuids, bool broadcast)
 
std::vector< game_api_objectscorum::wallet::wallet_api::get_games_by_status (const fc::flat_set< game_status > &filter) const
 
std::vector< game_api_objectscorum::wallet::wallet_api::get_games_by_uuids (const std::vector< uuid_type > &uuids) const
 
std::vector< game_api_objectscorum::wallet::wallet_api::lookup_games_by_id (game_id_type from, uint32_t limit) const
 
std::vector< matched_bet_api_objectscorum::wallet::wallet_api::lookup_matched_bets (matched_bet_id_type from, int64_t limit) const
 
std::vector< pending_bet_api_objectscorum::wallet::wallet_api::lookup_pending_bets (pending_bet_id_type from, int64_t limit) const
 
std::vector< matched_bet_api_objectscorum::wallet::wallet_api::get_matched_bets (const std::vector< uuid_type > &uuids) const
 
std::vector< pending_bet_api_objectscorum::wallet::wallet_api::get_pending_bets (const std::vector< uuid_type > &uuids) const
 
betting_property_api_object scorum::wallet::wallet_api::get_betting_properties () const
 
std::vector< matched_bet_api_objectscorum::wallet::wallet_api::get_game_returns (const uuid_type &game_uuid) const
 
std::vector< winner_api_objectscorum::wallet::wallet_api::get_game_winners (const uuid_type &game_uuid) const
 
std::vector< matched_bet_api_objectscorum::wallet::wallet_api::get_game_matched_bets (const uuid_type &uuid) const
 
std::vector< pending_bet_api_objectscorum::wallet::wallet_api::get_game_pending_bets (const uuid_type &uuid) const
 

Detailed Description

Wallet Betting API.

Function Documentation

◆ cancel_game()

annotated_signed_transaction scorum::wallet::wallet_api::cancel_game ( uuid_type  uuid,
account_name_type  moderator,
bool  broadcast 
)

Cancel game (return all bets to owners)

Parameters
uuidgame UUID
moderatorbetting moderator
broadcasttrue if you wish to broadcast the transaction

Definition at line 3249 of file wallet.cpp.

◆ cancel_pending_bets()

annotated_signed_transaction scorum::wallet::wallet_api::cancel_pending_bets ( account_name_type  better,
const std::vector< uuid_type > &  bet_uuids,
bool  broadcast 
)

Cancel pending bets list

Parameters
betterowner
bet_uuidsUUIDs of bets which are being cancelled
broadcasttrue if you wish to broadcast the transaction

Definition at line 3366 of file wallet.cpp.

◆ create_game()

annotated_signed_transaction scorum::wallet::wallet_api::create_game ( uuid_type  uuid,
account_name_type  moderator,
const std::string &  json_metadata,
fc::time_point_sec  start_time,
uint32_t  auto_resolve_delay_sec,
game_type  game,
const std::vector< market_type > &  markets,
bool  broadcast 
)

Create betting game

Parameters
uuidgame UUID
moderatorbetting moderator
json_metadataJSON metadata
start_timetime when game should start
auto_resolve_delay_secdelay starting from start_time after expiration of which (if game results weren't posted) game will be cancelled
gametype of game (soccer, hockey, etc.)
marketsbetting markets for this particular game
broadcasttrue if you wish to broadcast the transaction

Definition at line 3218 of file wallet.cpp.

◆ get_betting_properties()

betting_property_api_object scorum::wallet::wallet_api::get_betting_properties ( ) const

Return betting properties

Returns
betting property api object

Definition at line 3441 of file wallet.cpp.

◆ get_game_matched_bets()

std::vector< matched_bet_api_object > scorum::wallet::wallet_api::get_game_matched_bets ( const uuid_type uuid) const

Returns matched bets for game

Parameters
uuidGame UUID
Returns
array of matched_bet_api_object's

Definition at line 3462 of file wallet.cpp.

◆ get_game_pending_bets()

std::vector< pending_bet_api_object > scorum::wallet::wallet_api::get_game_pending_bets ( const uuid_type uuid) const

This method get list of pending bets

Parameters
uuidGame UUID
Returns
array of pending_bet_api_object's

Definition at line 3469 of file wallet.cpp.

◆ get_game_returns()

std::vector< matched_bet_api_object > scorum::wallet::wallet_api::get_game_returns ( const uuid_type game_uuid) const

Returns bets with draw status

Parameters
game_uuidGame UUID
Returns
array of matched_bet_object's

Definition at line 3448 of file wallet.cpp.

◆ get_game_winners()

std::vector< winner_api_object > scorum::wallet::wallet_api::get_game_winners ( const uuid_type game_uuid) const

Returns all winners for particular game

Parameters
game_uuidGame UUID
Returns
array of winner_api_object's

Definition at line 3455 of file wallet.cpp.

◆ get_games_by_status()

std::vector< game_api_object > scorum::wallet::wallet_api::get_games_by_status ( const fc::flat_set< game_status > &  filter) const

Returns games

Parameters
filter[created, started, finished]
Returns
array of game_api_object's

Definition at line 3392 of file wallet.cpp.

◆ get_games_by_uuids()

std::vector< game_api_object > scorum::wallet::wallet_api::get_games_by_uuids ( const std::vector< uuid_type > &  uuids) const

Returns games

Parameters
uuidsUUIDs of games to return
Returns
array of game_api_object's

Definition at line 3399 of file wallet.cpp.

◆ get_matched_bets()

std::vector< matched_bet_api_object > scorum::wallet::wallet_api::get_matched_bets ( const std::vector< uuid_type > &  uuids) const

Returns matched bets

Parameters
uuidsThe vector of UUIDs of pending bets which form matched bets
Returns
array of matched_bet_api_object's

Definition at line 3427 of file wallet.cpp.

◆ get_pending_bets()

std::vector< pending_bet_api_object > scorum::wallet::wallet_api::get_pending_bets ( const std::vector< uuid_type > &  uuids) const

Return pending bets

Parameters
uuidsThe vector of UUIDs of pending bets which should be returned
Returns
array of pending_bet_api_object's

Definition at line 3434 of file wallet.cpp.

◆ lookup_games_by_id()

std::vector< game_api_object > scorum::wallet::wallet_api::lookup_games_by_id ( game_id_type  from,
uint32_t  limit 
) const

Returns games

Parameters
fromlower bound game id
limitquery limit
Returns
array of game_api_object's

Definition at line 3406 of file wallet.cpp.

◆ lookup_matched_bets()

std::vector< matched_bet_api_object > scorum::wallet::wallet_api::lookup_matched_bets ( matched_bet_id_type  from,
int64_t  limit 
) const

Returns matched bets

Parameters
fromlower bound bet id
limitquery limit
Returns
array of matched_bet_api_object's

Definition at line 3413 of file wallet.cpp.

◆ lookup_pending_bets()

std::vector< pending_bet_api_object > scorum::wallet::wallet_api::lookup_pending_bets ( pending_bet_id_type  from,
int64_t  limit 
) const

Return pending bets

Parameters
fromlower bound bet id
limitquery limit
Returns
array of pending_bet_api_object's

Definition at line 3420 of file wallet.cpp.

◆ post_bet()

annotated_signed_transaction scorum::wallet::wallet_api::post_bet ( uuid_type  uuid,
account_name_type  better,
uuid_type  game_uuid,
wincase_type  wincase,
odds_input  odds,
asset  stake,
bool  is_live,
bool  broadcast 
)

Create bet

Parameters
uuidbet UUID
betterowner for new bet
game_uuidgame UUID which is specified during game creation
wincasewincase for bet
oddsrational coefficient that define potential result (p). p = odds * stake
stakeamount in SCR to bet
is_livespecify is bet live or not
broadcasttrue if you wish to broadcast the transaction

Definition at line 3337 of file wallet.cpp.

◆ post_game_results()

annotated_signed_transaction scorum::wallet::wallet_api::post_game_results ( uuid_type  uuid,
account_name_type  moderator,
const std::vector< wincase_type > &  wincases,
bool  broadcast 
)

Post game results (provide won wincases)

Parameters
uuidgame UUID
moderatorbetting moderator
wincaseswon wincases
broadcasttrue if you wish to broadcast the transaction

Definition at line 3314 of file wallet.cpp.

◆ update_game_markets()

annotated_signed_transaction scorum::wallet::wallet_api::update_game_markets ( uuid_type  uuid,
account_name_type  moderator,
const std::vector< market_type > &  markets,
bool  broadcast 
)

Update betting markets for the game

Parameters
uuidgame UUID
moderatorbetting moderator
marketsnew betting markets for this game
broadcasttrue if you wish to broadcast the transaction

Definition at line 3268 of file wallet.cpp.

◆ update_game_start_time()

annotated_signed_transaction scorum::wallet::wallet_api::update_game_start_time ( uuid_type  uuid,
account_name_type  moderator,
fc::time_point_sec  start_time,
bool  broadcast 
)

Update game start time

Parameters
uuidgame UUID
moderatorbetting moderator
start_timegame new start time
broadcasttrue if you wish to broadcast the transaction

Definition at line 3291 of file wallet.cpp.