v0.8.2
Interface: ServerTransportModule
Interface for handling server-side transport operations like player balances and bets. This module enables communication with external systems for financial transactions.
Table of contents
Methods
Methods
createBet
⸠createBet(player
, amount
, metadata?
): Promise
<string
>
Create a bet for a player
Parameters
Name | Type | Description |
---|---|---|
player | Player | The player making the bet |
amount | number | The amount of the bet |
metadata? | Record <string , any > | Any additional information about the bet |
Returns
Promise
<string
>
A promise that resolves to a bet ID if successful
getPlayerBalance
⸠getPlayerBalance(player
): Promise
<number
>
Get the current balance for a player
Parameters
Name | Type | Description |
---|---|---|
player | Player | The player to check balance for |
Returns
Promise
<number
>
A promise that resolves to the playerâs balance
markBetLost
⸠markBetLost(betId
, metadata?
): Promise
<boolean
>
Mark a bet as lost
Parameters
Name | Type | Description |
---|---|---|
betId | string | The ID of the bet to mark as lost |
metadata? | Record <string , any > | Any additional information about the loss |
Returns
Promise
<boolean
>
A promise that resolves to true if successful
markBetWon
⸠markBetWon(betId
, winAmount
, metadata?
): Promise
<boolean
>
Mark a bet as won and award the player
Parameters
Name | Type | Description |
---|---|---|
betId | string | The ID of the bet to mark as won |
winAmount | number | The amount the player won |
metadata? | Record <string , any > | Any additional information about the win |
Returns
Promise
<boolean
>
A promise that resolves to true if successful