Skip to main content

mCasino.api.exchange

Game

mCasino Exchange API

Types​

ExchangeType​

interface ExchangeType {
name: number--

Name

enabled: () → boolean--

Checks if the currency is enabled

format: (amount: number) → string--

Formats a number into the currency

get: (ply: Player) → number--

Returns the amount of currency the player has

set: (
ply: Player,
amount: number
) → ()--

Adds the amount of currency the player has (SERVER)

depositRate: (amount: number) → number--

Multiplies the amount * deposit rate

withdrawRate: (amount?: number) → number--

Divides the amount / withdraw rate, if no amount is specified it should return the withdraw rate

}

Exchange Type

Functions​

promptDeposit​

This item only works when running on the client. Client
mCasino.api.exchange.promptDeposit(
currencyId: string,
currencyData: ExchangeType
) → ()

Prompts the user to deposit the given currency

promptWithdraw​

This item only works when running on the client. Client
mCasino.api.exchange.promptWithdraw(
currencyId: string,
currencyData: ExchangeType
) → ()

Prompts the user to withdraw the given currency

interact​

This item only works when running on the client. Client
mCasino.api.exchange.interact(
currencyId: string,
amount: number,
isDeposit: boolean
) → ()

Attempts to exchange the currency for the local user, this does not check balances

withdrawItem​

This item only works when running on the client. Client
mCasino.api.exchange.withdrawItem(itemId: string) → ()

Attempts to withdraw an item, prompts the user to confirm and does balance check

getTypes​

mCasino.api.exchange.getTypes() → {ExchangeType}

Returns the exchange currencies available