This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk / WalletApi

WalletApi ​

The player's balance and statement. All methods require login.

Methods ​

get() ​

get(params?, options?): Promise<Wallet>

Wallet balances.

Parameters ​

params? ​

NoParams

options? ​

CallOptions

Returns ​

Promise<Wallet>

Example ​

ts
const wallet = await enginex.wallet.get()
formatMoney(wallet.realBalance, config.currency) // 'R$ 1.500,00'

Throws ​

UNAUTHENTICATED without a session; VALIDATION_ERROR, also in 'warn', with money or currency outside the format.


getBalance() ​

getBalance(params?, options?): Promise<Balance>

Balance, with the withdrawals in progress in pendingWithdrawals.

Parameters ​

params? ​

NoParams

options? ​

CallOptions

Returns ​

Promise<Balance>

Example ​

ts
const { realBalance, pendingWithdrawals } = await enginex.wallet.getBalance()

Throws ​

UNAUTHENTICATED without a session; VALIDATION_ERROR, also in 'warn', with money or currency outside the format.


listTransactions() ​

listTransactions(input?, options?): Promise<Page<Transaction>>

Paginated statement, from most recent to oldest.

Parameters ​

input? ​

ListTransactionsInput

options? ​

CallOptions

Returns ​

Promise<Page<Transaction>>

Example ​

ts
const page = await enginex.wallet.listTransactions({ page: 1, perPage: 20, category: 'financial' })
page.items.forEach((tx) => console.log(tx.type, tx.amount))

Throws ​

INVALID_ARGUMENT for an unknown category; UNAUTHENTICATED without a session; VALIDATION_ERROR, also in 'warn', with money or currency outside the format (on any item: the whole page rejects).