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?
options?
Returns
Promise<Wallet>
Example
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?
options?
Returns
Promise<Balance>
Example
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?
options?
Returns
Promise<Page<Transaction>>
Example
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).