Skip to content

Accounts & ledger ​

Every account lives at one of the lore banks and has a number with the bank's prefix (LS-48 1192). Every money movement is a row in the ledger (bank_transactions) with a reference (TX-…), the signed amount and the balance after it. Statements, the Bank app, the ATM and the counter all read the same rows.

Account types ​

Type Who Notes
checking One per character, created on the first login at Config.Accounts.defaultBank (Maze Bank) Is the framework bank on esx / qbx / qb (below)
personal More personal accounts, also at other banks Opened in the app or at a branch
savings Savings accounts Daily interest (interest.savings of the bank, % per real day, up to Config.Interest.maxBalance)
shared Several members with roles Members are invited by phone number (app) or added at the counter
business / society / faction Job accounts Created on first use for the job, see Job accounts
government The city's account (fines, taxes) Created on the first start (Config.Accounts.government)

A character may own up to Config.Accounts.maxOwned accounts (6, checking included); a shared account has at most maxMembers members (6, owner included). An account is closed only when it is empty, and never the checking or a job account.

The checking account is the framework bank ​

On es_extended, qbx_core and qb-core the checking account's balance is the framework's bank money:

  • Reads go to the framework (getMoney online, the stored money offline).
  • Writes go through the framework (addMoney / removeMoney, offline the stored money) and np_banking still writes the ledger row. np_hud's money chip and every other script stay correct.
  • Other scripts that change the bank (paychecks, shops, admin menus) fire the framework's money-change events. np_banking reconciles them into external rows (Config.Ledger.recordExternal), so statements stay complete. Its own writes are suppressed while they run, so nothing is counted twice.
  • Offline changes are synced at the next login as a sync row.
  • Other scripts can still take bank money even when the checking account is frozen in np_banking.

Standalone (no framework) has no framework bank: the checking account keeps its own balance, and there is no cash.

Roles and limits ​

Role May
owner Everything: spend, see, add / remove members, set limits, rename, close
spend Spend, up to the member's daily limit (limit_daily, per 24 h)
view See the balance and the transactions

On job accounts the boss (framework isBoss) is always owner, even with an older member row. A member row (per-employee limit, set by the boss in the app's business mode) wins over the grade. Otherwise employees from Config.Accounts.societies.spendGrade on are spend, below it view; with spendGrade = false only the boss spends.

Server code acting for the bank passes trusted = true and skips the role check. The Charge export checks the actor's role on personal and shared accounts and trusts the caller on job accounts (np_payments applies its own faction rules there).

Job accounts ​

lua
societies = {
  autoCreate = true, ignore = { 'unemployed', 'unemployed2' }, defaultBank = 'lombank', spendGrade = false,
  jobs = {
    police = { label = 'LSPD', type = 'faction', bank = 'union' },
    sheriff = { label = 'BCSO', type = 'faction', bank = 'blaine' },
    ambulance = { label = 'EMS', type = 'faction', bank = 'union' },
    mechanic = { label = 'Mechanic', type = 'business' },
  },
},

A job listed in jobs gets that label, type and bank. Any other job gets a business account at defaultBank on first use (GetSocietyAccount(job), a payment to the job, the boss opening it at the Lombank counter), unless it's in ignore or autoCreate is off. Bosses manage employee limits, company cards and payroll in the Bank app and at the Lombank counter.

On ESX, Config.Accounts.esxSociety = 'migrate' copies every society_<job> balance of esx_addonaccount once. See Installation → ESX societies.

With np_faction

np_faction keeps its faction money here: a faction's operating account is this society account of its job, and extra accounts (payroll, evidence, budgets) are further job accounts of type faction or business (np_faction → Configuration → Bank). While np_faction runs, the roles on job accounts follow its permission nodes (bank.manage → owner, bank.spend → spend, other members view) for every job a player holds. np_faction can also migrate the old society money: run only one of the two imports, see np_faction → Installation.

Transfers ​

  • Same bank: at once.
  • Between banks: the money leaves now and arrives after Config.Banks.transferDelayMinutes (60). Until then it is a pending transfer (np_banking:server:transferQueued, then transferReleased).
  • Instant between banks: the sender bank's fees.instantPercent (at least instantMin) as a fee row.
  • Paying a payment request between banks arrives at once without the fee (Config.Phone.requests.skipDelay).

When the second side of a move fails, the first side is refunded with a refund row. Cash deposits and withdrawals give the cash or the money back.

Standing orders ​

Created in the Bank app (Payments → Standing orders) or at the Lombank counter as payroll: from an account the character may spend from, to a phone number or an account, every intervalDays. The server tick runs them; np_phone shows a Live Activity in the Dynamic Island Config.Phone.island.leadMinutes (120) before one runs.

Transaction types ​

Rows carry a type: payment (charge default), deposit (credit default), transfer, withdrawal, fee, interest, salary, refund, external, sync, opening, card, atm, cheque, loan, savings, standing_order, staff, … plus reason, merchant, category, location, the card and the counterparty when they apply. See the tx shape.

Locks and money rules ​

  • Whole dollars, integers. Amounts must be positive whole numbers up to Config.MaxAmount; fractions are refused, never rounded.
  • Locks: every account a move touches is locked (all or nothing). A call waits up to Config.Ledger.lockWaitMs (2000 ms), then answers busy.
  • Events after locks: np_banking:server:transaction fires after the locks are released, for every row (including external rows).
  • Server authority: clients only send intents. Amounts, roles, positions, items and limits are checked on the server.

Credit score ​

Every character has a score (Config.Credit: start 600, range 300–850). Loans read it; paid instalments raise it, missed instalments, defaults and fraud flags lower it. Bands: excellent ≥ 750, good ≥ 670, fair ≥ 580, else poor. The Savings tab of the app and the loans desk show it.

Fraud rules ​

Simple velocity rules on outgoing money per account (Config.Fraud): more than maxOutgoing (12) outgoing transactions or more than maxAmount ($250,000) out within windowSeconds (600) flags the account. A flag fires np_banking:server:fraudFlagged, notifies the owner, goes to the audit log and costs 15 credit score points. With autoFreeze = true the account is also frozen until staff unfreeze it. Refunds, external rows, interest, fees and staff moves don't count. A withdrawal with a cloned card flags the victim's account at once (rule cloned_card). Resources can add rules with NpBank.Fraud.addRule inside np_banking.

Separately, the Bank app warns the holder when their card is used by someone else more than Config.Phone.push.farAwayMeters (250 m) away, with a Freeze button. See Bank app.

Error codes ​

Lower-case strings, with texts in shared/locales/<lang>/core.lua (keys error.<code>):

invalid_amount, not_found, closed, frozen, funds, busy, limit, not_allowed, same_account, offline, failed, card_unknown, card_blocked, card_frozen, card_expired, pin_required, not_ready, …