Skip to content

Latest commit

 

History

History
469 lines (165 loc) · 7.77 KB

README.md

File metadata and controls

469 lines (165 loc) · 7.77 KB

Contract-Interaction

Index

Interfaces

Functions


Functions

«Const» changeBet

changeBet(betEvent: string, outcomeIndex: number): Promise.<boolean>

Defined in ethereum/contract-interaction.ts:248

Allows a user to change a bet that they have placed.

Parameters:

Param Type Description
betEvent string Address of the Betting contract.
outcomeIndex number Index of the outcome that the user is changing their bet to.

Returns: Promise.<boolean> Boolean indicating if the method was successful.


«Const» getAllClubs

getAllClubs(): string[]

Defined in ethereum/contract-interaction.ts:377

Returns an array of club names used by the contracts.

Returns: string[] An array with club names that are in our system.


«Const» getAllClubsFull

getAllClubsFull(): string[]

Defined in ethereum/contract-interaction.ts:404

Returns an array of fulllength club names that are in our system.

Returns: string[] An array with club names that are in our system.


«Const» getAvailableBets

getAvailableBets(): Promise.<string[]>

Defined in ethereum/contract-interaction.ts:278

Returns an array of bets for which the event is not over.

Returns: Promise.<string[]> Array of bets for which the event is not over.


«Const» getAvailableBetsFromList

getAvailableBetsFromList(betEvents: string[]): Promise.<string[]>

Defined in ethereum/contract-interaction.ts:308

Returns an array of bets for which the event is not over from a list contract addresses.

Parameters:

Param Type Description
betEvents string[] Array of addresses of Betting contracts.

Returns: Promise.<string[]> Array of bets for which the event is not over.


«Const» getBetInfo

getBetInfo(betEvent: string): Promise.<IBetInfo>

Defined in ethereum/contract-interaction.ts:322

Returns information about a bet event.

Parameters:

Param Type Description
betEvent string Address of the Betting contract.

Returns: Promise.<IBetInfo> Information about a match that a bet is a available for.


«Const» getFullClubName

getFullClubName(club: string): string

Defined in ethereum/contract-interaction.ts:456

Get full club name (for display & crests)

Parameters:

Param Type Description
club string contract club name

Returns: string full name of club


«Const» getGamesByClub

getGamesByClub(club: string): Promise.<string[]>

Defined in ethereum/contract-interaction.ts:432

Returns an array of bets for a specific club.

Parameters:

Param Type Description
club string The name of the club.

Returns: Promise.<string[]> An array of the bets for a specific club.


«Const» getPastBets

getPastBets(): Promise.<string[]>

Defined in ethereum/contract-interaction.ts:292

Returns an array of bets for which the event is over.

Returns: Promise.<string[]> Array of bets for which the event is over.


«Const» getPlacedBets

getPlacedBets(): Promise.<string[]>

Defined in ethereum/contract-interaction.ts:264

Returns an array of the bet objects for bets placed by a user.

Returns: Promise.<string[]> Array of addresses of Betting contracts that user placed bet on.


«Const» getUserAccount

getUserAccount(): Promise.<string>

Defined in ethereum/contract-interaction.ts:364

Returns the address of the users account.

Returns: Promise.<string> The address of the users account.


«Const» getUserBetInfo

getUserBetInfo(betEvent: string): Promise.<IUserBetInfo>

Defined in ethereum/contract-interaction.ts:336

Returns information about a bet a user placed.

Parameters:

Param Type Description
betEvent string Address of the Betting contract.

Returns: Promise.<IUserBetInfo> Information about a bet that a user has placed.


«Const» isUserLoggedIn

isUserLoggedIn(): Promise.<boolean>

Defined in ethereum/contract-interaction.ts:349

Used to check if a user is logged in.

Returns: Promise.<boolean> A boolean signifying if a user is logged in or not.


«Const» placeBet

placeBet(betEvent: string, outcomeIndex: number, value: string): Promise.<boolean>

Defined in ethereum/contract-interaction.ts:227

Allows a user to place a bet.

Parameters:

Param Type Description
betEvent string Address of the Betting contract.
outcomeIndex number Index of the outcome that the user is betting on.
value string Amount of Ether the user is betting.

Returns: Promise.<boolean> Boolean indicating if the method was successful.