Documentation ¶
Index ¶
- Constants
- Variables
- func AddOwner(scid, addr string)
- func AutoBook(amt, pre, src uint64, n, abv, scid, addr, book_tx string) (tx string)
- func AutoPredict(p int, amt, src uint64, scid, addr, pre_tx string) (tx string)
- func CancelInitiatedBet(scid string, b int)
- func CheckActiveGames(scid string) bool
- func CheckActivePrediction(scid string) bool
- func CheckBetContractOwners(contracts map[string]string)
- func CheckPredictionStatus()
- func ConfirmAction(i int, teamA, teamB string, d *dreams.AppObject)
- func Disconnected()
- func DreamsMenuIntro() (entries map[string][]string)
- func EndPrediction(scid string, price int) (tx string)
- func EndSports(scid, num, team string) (tx string)
- func FetchPredictionFinal(scid string) (txid string)
- func GetActiveGames()
- func GetBaseball(date, league string)
- func GetBasketball(date, league string)
- func GetBook(scid string) (info string)
- func GetCurrentMonth(league string)
- func GetCurrentWeek(league string)
- func GetFootball(date, league string)
- func GetGameEnd(date, game, league string)
- func GetHockey(date, league string)
- func GetMma(date, league string)
- func GetMmaResults(label *widget.Label, league string)
- func GetMmaWinner(game, league, game_date string, diff int) (win string, fighter string)
- func GetPredictCode(pub int) string
- func GetPrediction(scid string) (info string)
- func GetScores(label *widget.Label, league string)
- func GetSoccer(date, league string)
- func GetSportsAmt(scid, n string) uint64
- func GetSportsCode(pub int) string
- func GetSportsFinals(scid string) (text string)
- func GetSportsTeams(scid, n string) (string, string)
- func GetWinner(game, league, game_date string, diff int) (win string, team_name string, a_score string, b_score string)
- func LayoutPredictItems(d *dreams.AppObject) *fyne.Container
- func LayoutSportsItems(d *dreams.AppObject) *fyne.Container
- func MakeIntegratedAddr(print bool)
- func P_initResults(p, amt, eA, c, to, u, d, r, f, m string, ta, tb, tc int) (info string)
- func P_no_initResults(fr, tx, r, m string) (info string)
- func PickTeam(scid, multi, n string, a uint64, pick int) (tx string)
- func PopulatePredictions(contracts map[string]string)
- func PopulateSports(contracts map[string]string)
- func PostPrediction(scid string, price int) (tx string)
- func PredictConnectedBox() fyne.Widget
- func PredictHigher(scid, addr string) (tx string)
- func PredictLower(scid, addr string) (tx string)
- func PredictionContractEntry() fyne.Widget
- func PredictionFavorites() fyne.CanvasObject
- func PredictionListings(d *dreams.AppObject) fyne.CanvasObject
- func PredictionOwned() fyne.CanvasObject
- func PredictionRefresh(p *dreams.ContainerStack, d *dreams.AppObject)
- func PredictionRefund(scid, tic string)
- func RemoveOwner(scid string, num int)
- func RunService(start uint64, payouts, transfers bool)
- func S_Results(g, gN, l, min, eA, c, tA, tB, tAV, tBV, total string, a, b uint64) (info string)
- func ServiceIndicator() (ind menu.DreamsIndicator)
- func ServiceRefund(amt, src uint64, scid, addr, msg, refund_tx string) (tx string)
- func SetPrediction(end, mark int, amt, dep uint64, scid, predict, feed string)
- func SetPredictionInfo(scid string)
- func SetPredictionPrices(d bool)
- func SetPrintColors(os string)
- func SetSports(end int, amt, dep uint64, scid, league, game, feed string) (tx string)
- func SetSportsInfo(scid string)
- func ShowPredictionControls()
- func SportsConnectedBox() fyne.Widget
- func SportsContractEntry() fyne.Widget
- func SportsFavorites() fyne.CanvasObject
- func SportsListings(d *dreams.AppObject) fyne.CanvasObject
- func SportsOwned() fyne.CanvasObject
- func SportsPayouts() fyne.CanvasObject
- func SportsRefund(scid, tic, n string)
- func StartApp()
- func TrimTeamA(s string) string
- func TrimTeamB(s string) string
- func UploadBetContract(c bool, pub int)
- func ValidBetContract(scid string) bool
- func VarUpdate(scid string, ta, tb, tc, l, hl int)
- func VerifyBetSigner(scid string) bool
- func Version() semver.Version
- func WinningTeam(teams, winner string) string
Constants ¶
const ( PredictSCID = "eaa62b220fa1c411785f43c0c08ec59c761261cb58a0ccedc5b358e5ed2d2c95" PPredictSCID = "e5e49c9a6dc1c0dc8a94429a01bf758e705de49487cbd0b3e3550648d2460cdf" SportsSCID = "ad11377c29a863523c1cc50a33ca13e861cc146a7c0496da58deaa1973e0a39f" PSportsSCID = "fffdc4ea6d157880841feab335ab4755edcde4e60fec2fff661009b16f44fa94" )
const PAYLOAD_FORMAT = uint64(1728000)
block height of last payload format change
Variables ¶
var Imported bool
var P dreams.ContainerStack
var Predict predictObjects
var PrintColor printColors
var S dreams.ContainerStack
var Service service
var Sports sportsItems
Functions ¶
func AddOwner ¶
func AddOwner(scid, addr string)
Owner can add new co-owner to bet SC
- addr of new co-owner
func AutoBook ¶
dService sports book by received tx
- amt to send
- pre is what team
- n is the game number
- addr of placed bet and to send reply message
- src, abv and tx used in reply message
func AutoPredict ¶
dService prediction place by received tx
- amt to send
- p is what prediction
- addr of placed bet and to send reply message
- src and pre_tx used in reply message
func CancelInitiatedBet ¶
Owner cancel for initiated bet for dSports and dPrediction contracts
- b defines sports or prediction log print
func CheckActivePrediction ¶
Check if dPrediction is live on SCID
func CheckBetContractOwners ¶
Scan all bet contracts to verify if owner
- Pass contracts from db store, can be nil arg
func ConfirmAction ¶
dSports and dPrediction action confirmation
- i defines the action to be confirmed
- teamA, teamB needed only for dSports confirmations
func DreamsMenuIntro ¶
func FetchPredictionFinal ¶
Get dPrediction final TXID
func GetBaseball ¶
func GetBaseball(date, league string)
Gets baseball games for selected league and adds to options selection
- date GetCurrentWeek()
func GetBasketball ¶
func GetBasketball(date, league string)
Gets basketball games for selected league and adds to options selection
- date GetCurrentWeek()
func GetCurrentMonth ¶
func GetCurrentMonth(league string)
Gets the games of league for following month
func GetCurrentWeek ¶
func GetCurrentWeek(league string)
Gets the games of league for following week
func GetFootball ¶
func GetFootball(date, league string)
Gets football games for selected league and adds to options selection
- date GetCurrentWeek()
func GetGameEnd ¶
func GetGameEnd(date, game, league string)
Find and display the end time of selected game
func GetMma ¶
func GetMma(date, league string)
Gets mma matches for selected league and adds to options selection
- date GetCurrentMonth()
func GetPredictCode ¶
Get dPrediction SC code for public and private SC
- pub 1 defines private SC, else public
func GetPrediction ¶
Gets dPrediction data from SCID and return formatted info string
func GetSoccer ¶
func GetSoccer(date, league string)
Gets hockey games for selected league and adds to options selection
- date GetCurrentWeek()
func GetSportsAmt ¶
func GetSportsCode ¶
Get dSports SC code for public and private SC
- pub 1 defines private SC, else public
func GetSportsFinals ¶ added in v0.3.1
func GetSportsTeams ¶
Get current dSports game teams
func GetWinner ¶
func GetWinner(game, league, game_date string, diff int) (win string, team_name string, a_score string, b_score string)
Gets and returns the winner of game
- league defines api prefix
func LayoutPredictItems ¶
dPrediction tab layout
func LayoutSportsItems ¶
dSports tab layout
func MakeIntegratedAddr ¶
func MakeIntegratedAddr(print bool)
Prepare and display all integrated addresses for live dSports or dPrediction contract owned by wallet
- print for debug
func P_initResults ¶
Formats initialized dPrediction info string
- p defines prediction
- amt is Dero value
- eA is prediction end time
- c is number of current predictions
- to is current total prediction Dero pot value
- u is higher predictions
- d is lower predictions
- r is total completed prediction rounds
- f is prediction feed
- m is prediction mark
- ta, tb, tc are current contract time frames
func P_no_initResults ¶
Formats non-initialized dPrediction info string
- fr is the un-split result string
- tx is the previous payout TXID
- r is total completed prediction rounds
- m is prediction mark
func PickTeam ¶
Book sports team on dSports SC
- multi defines 1x, 3x or 5x the minimum
- n is the game number
- a is amount to book
- pick is team to book
func PopulatePredictions ¶
Populate all dReams dPrediction contracts
- Pass contracts from db store, can be nil arg
func PopulateSports ¶
Populate all dReams dSports contracts
- Pass contracts from db store, can be nil arg
func PredictConnectedBox ¶
func PredictConnectedBox() fyne.Widget
Check box for dPrediction SCID
- Hides prediction controls on disconnect
func PredictHigher ¶
Place higher prediction to SC
- addr only needed if dService is placing prediction
func PredictionContractEntry ¶
func PredictionContractEntry() fyne.Widget
Entry for dPrediction SCID
- Bound to Predict.Settings.SCID
- Checks for valid SCID on changed
func PredictionFavorites ¶
func PredictionFavorites() fyne.CanvasObject
List object for populating favorite dPrediction contracts, with remove favorite control
func PredictionListings ¶
List object for populating public dPrediction contracts, with rating and add favorite controls
- Pass tab for action confirmation reset
func PredictionOwned ¶
func PredictionOwned() fyne.CanvasObject
List object for populating owned dPrediction contracts
func PredictionRefresh ¶
func PredictionRefresh(p *dreams.ContainerStack, d *dreams.AppObject)
Refresh all dPrediction objects
func PredictionRefund ¶
func PredictionRefund(scid, tic string)
User can refund a void dPrediction payout from SC
- tic is the prediction id string
func RunService ¶
Main dService routine
- start defines service starting height
- payouts, transfers for service params
func S_Results ¶
Formats dSports info string
- g is game name
- gN is game number
- l is league
- min is minimum Dero wager
- eA is game end time
- c is current number of picks
- tA, tB are team names of A and B
- tAV, tBV is total picks for A or B
- total is current game Dero pot total
- a, b are current contract time frames
func ServiceIndicator ¶
func ServiceIndicator() (ind menu.DreamsIndicator)
Ui indictor when dService is running
func ServiceRefund ¶
dService refund if bet void
- amt to send
- addr to send refund to
- src, msg and refund_tx used in reply message
func SetPrediction ¶
Owner sets up a dPrediction prediction
- end is unix ending time
- mark can be predefined or passed as 0 if mark is to be posted live
- amt of single prediction
- dep allows owner to add a initial deposit
- predict is name of what is being predicted
- feed defines where price api data is sourced from
func SetPredictionPrices ¶
func SetPredictionPrices(d bool)
Update price feed for dPrediction display
func SetSports ¶
Owner sets a dSports game
- end is unix ending time
- amt of single prediction
- dep allows owner to add a initial deposit
- game is name of game, formatted TEAM--TEAM
- feed defines where price api data is sourced from
func ShowPredictionControls ¶
func ShowPredictionControls()
When called, enable and show dPrediction controls
func SportsConnectedBox ¶
func SportsConnectedBox() fyne.Widget
Check box for dSports SCID
- Hides sports controls on disconnect
func SportsContractEntry ¶
func SportsContractEntry() fyne.Widget
Entry for dPrediction SCID
- Bound to Sports.Contract.SCID
- Checks for valid SCID on changed
func SportsFavorites ¶
func SportsFavorites() fyne.CanvasObject
List object for populating favorite dSports contracts, with remove favorite control
func SportsListings ¶
List object for populating public dSports contracts, with rating and add favorite controls
- Pass tab for action confirmation reset
func SportsOwned ¶
func SportsOwned() fyne.CanvasObject
List object for populating owned dSports contracts
func SportsRefund ¶
func SportsRefund(scid, tic, n string)
User can refund a void dSports payout from SC
- tic is the bet id string
- n is the game number
func UploadBetContract ¶
Install new bet SC
- c defines dSports or dPrediction contract
- pub defines public or private contract
func ValidBetContract ¶
Check dSports/dPrediction SC for dev address
func VarUpdate ¶
Owner update for bet SC vars
- ta, tb, tc are contracts time limits. Only ta, tb needed for dSports
- l is the max bet limit per initialized bet
- hl is the max amount of games that can be ran at once
func VerifyBetSigner ¶
Verify if wallet is a co owner on bet contract
func WinningTeam ¶
Format winning team name from dSports final result string
Types ¶
This section is empty.