Api class. Any addon can interact with it without knowing anything about the internals.$balance = \Blatchy\Bankroll\Api::getBalance($userId);
\Blatchy\Bankroll\Api::credit($userId, 500, 'bet_win', 'Won parlay #12', 'parlay_12');
$success = \Blatchy\Bankroll\Api::debit($userId, 100, 'bet_place', 'Placed bet #12', 'bet_12');
if (\Blatchy\Bankroll\Api::canAfford($userId, 250)) { ... }
\Blatchy\Bankroll\Api::transfer($fromUserId, $toUserId, 200, 'Prize payout');
\Blatchy\Bankroll\Api::refund($userId, 100, 'Bet voided', 'bet_12');
echo \Blatchy\Bankroll\Api::format(1250); // → "$1,250"
bet_place — sportsbook bet placedbet_win — sportsbook bet wonbet_loss — sportsbook bet lostbet_push — sportsbook bet pushed/refundedparlay_win / parlay_loss — parlay outcomesarcade_win / arcade_loss — arcade game outcomesblackjack_win / blackjack_loss — casino game outcomesslots_win / slots_loss — slot machine outcomespurchase — item purchasedrefund — refund issuedadmin — manual admin adjustment