NUI contract ​
The contract between the Lua client, the three web pages (web/) and the server RPCs behind them. You only need this
page to change the UI or build your own front end (for example a staff screen); other resources use the
exports.
The UI is server-authoritative: it only sends intents. Every method acts for the calling character only, and amounts, roles, positions, items and limits are checked on the server.
Three pages, one envelope ​
| Page | Loaded as | Lua → page | Page → Lua |
|---|---|---|---|
index.html |
ui_page, full screen: branch counter, robbery minigames and HUD, fallback toasts / prompts / progress |
SendNUIMessage({ action, data }) |
NUI callback rpc |
atm.html |
DUI on the ATM prop, 800×600, ?bank=<id> |
SendDuiMessage(dui, json.encode({ action, data })) |
NUI callback rpc (atm.*) |
phone.html |
np_phone app iframe | np_phone app messages | np_phone app RPCs (phone.rpc(name)), forwarded to the same handlers |
All pages share web/src/lib: messages are { action, data }, and the rpc callback takes { method, params } and
answers { ok: true, data } | { ok: false, error }. Outside FiveM (npm run dev) the same rpc() answers from mocks.
index.html ​
| Action | Data |
|---|---|
screen:open |
{ id, data, focus = false | 'keys' | 'full' }: open a screen (branch, heist_hud, robbery_hack, robbery_sync, robbery_thermite, robbery_drill, …) |
screen:update |
{ id, data } |
screen:close |
{ id } |
toast |
Fallback toast (no np_hud) |
prompt:show / prompt:hide |
Fallback interaction prompt |
progress:start / progress:cancel |
Fallback progress bar |
Client-local methods (answered on the client, not the server): ui.close { id }, progress.done { id, cancelled }.
Server pushes reach the page through the net event np_banking:nui (action, data). Escape closes the top focused
screen.
atm.html ​
The server pushes the screen as np_banking:atm:view with a public part and a private part; the client forwards it to
the DUI with SendDuiMessage. Players nearby get only the public part on a passive second DUI: PIN digits never leave
the user's DUI, only their count. The client turns the mouse into a 3D cursor on the prop's screen (screen position →
UV on the projected quad → SendDuiMouseMove / Down / Up / Wheel).
RPC transport ​
Client → np_banking:rpc (reqId, method, params) → server → np_banking:rpcResult (reqId, ok, data | code).
-- server side of a method (inside np_banking)
NpBank.rpc.register('atm.withdraw', function(src, p, ctx) ... return result end, {
schema = { amount = 'amount', receipt = 'bool?' }, -- cleaned params; unknown fields are dropped
cooldown = 1000, -- ms per player and method
admin = 'np_banking.audit', -- np_admin node (true = 'np_banking.admin')
})
- Params are validated by schema. A bad field answers
invalid_params:<field>. - Handlers answer a value or an error code.
- A token bucket per player limits the rate (
Config.Rpc: 8 per second, burst 16). - The np_phone app RPCs are forwarded with the same schemas and roles, without the rate limit.
RPC methods ​
Core ​
| Method | Params | Returns |
|---|---|---|
bank.boot |
— | { banks, locale, currency, pinLength, transferDelayMinutes, strings } |
bank.accounts |
— | Account[] |
bank.account |
{ account } |
Account + transactions; owners also members, cards, standingOrders |
bank.transactions |
{ account, limit?, before? } |
tx[] |
bank.lookup |
{ number } |
{ number, label, bank, bankLabel, type } (never the owner) |
bank.transfer |
{ from, to (number) | toAccount (id), amount, note?, instant? } |
{ ref, pending, releaseAt?, fee, balance } |
bank.cards |
— | Card[] |
bank.card.freeze |
{ card, frozen } |
Card |
bank.card.block |
{ card } |
Card (reported stolen) |
bank.card.pin |
{ card, pin, old? } |
true (old required once a PIN is set) |
bank.card.limit |
{ card, limit } |
Card (account owner; up to the tier's limit) |
bank.card.contactless |
{ card, on } |
Card |
bank.members |
{ account } |
members |
bank.member.add |
{ account, target (server id), role = 'spend'|'view', limit? } |
member (shared accounts, owner only) |
bank.member.set |
{ account, identifier, role?, limit?, noLimit? } |
member |
bank.member.remove |
{ account, identifier } |
true (owner, or the member themselves) |
bank.shared.create |
{ label, bank?, type? = 'shared'|'personal'|'savings' } |
Account |
bank.account.rename |
{ account, label } |
true |
bank.account.close |
{ account } |
true (empty, not checking / job) |
admin.audit |
{ account (id | number), limit? } |
{ account, transactions, audit } (node np_banking.audit; the view is logged) |
admin.freeze |
{ account, frozen, reason? } |
true (node np_banking.freeze) |
admin.money |
{ target? (server id) | account?, amount, give, reason? } |
{ ref } (node np_banking.money) |
ATM ​
The ATM DUI calls these; every handler acts on the caller's own session at the ATM they stand at.
| Method | Params | Returns |
|---|---|---|
atm.open |
{ model, coords, location? } |
{ view, private? } (the screen; no session while the ATM is broken / hacked or used by someone else: atm_busy) |
atm.insert |
{ card? } | { phone = true } |
{ view, private } (card from the inventory, or the phone as a contactless card) |
atm.pin |
{ pin } |
{ view, private } (Config.Cards.maxTries wrong PINs: card blocked and kept) |
atm.nav |
{ screen = 'menu'|'withdraw'|'deposit'|'transfer'|'statement'|'changepin'|'pin'|'insert', count? } |
{ view, private } (count = PIN digits typed, mirrored to bystanders) |
atm.balance |
— | { view, private } with private.balance |
atm.withdraw |
{ amount, receipt? } |
{ view, private }; cash comes out after atm.take |
atm.deposit |
{ amount, receipt? } |
{ view, private } |
atm.transfer |
{ to (number), amount, note? } |
{ view, private, transfer } (bank.transfer) |
atm.lookup |
{ number } |
like bank.lookup |
atm.statement |
{ print? } |
{ view, private } with the last rows (printed as a receipt item) |
atm.changePin |
{ pin } |
{ view, private } |
atm.returnCard |
— | { view, private? } |
atm.take |
{ what = 'card'|'cash' } |
{ view, private? } (card first, then cash) |
atm.close |
— | true |
atm.admin |
{ atm, action = 'restock'|'repair'|'break'|'empty', amount? } |
GetAtm shape (node np_banking.atm) |
Phone ​
The np_phone Bank app calls them through its app RPCs (bank.<name> inside np_phone, forwarded with
NpBank.rpc.invoke, so the same schemas and roles apply).
| Method | Params | Returns |
|---|---|---|
phone.boot |
— | { me, banks, currency, locale, pinLength, transferDelayMinutes, maxAmount, boss, job?, lowBalance, requests } |
phone.prefs |
{ streamer } |
true (streamer mode hides amounts in pushes; display only) |
phone.overview |
— | { accounts, total, week = { points, delta }, recent, banks, requests } |
phone.transactions |
{ account?, before?, limit?, filter? = 'all'|'in'|'out'|'card'|'transfer', search? } |
{ items, before, hasMore, account } |
phone.lookup |
{ query (phone or account number) } |
{ kind = 'phone'|'account', phone?, name?, number, label, bank, bankLabel, type, self } |
phone.transfer |
{ from, phone? | to? | toAccount?, amount, note?, instant? } |
like bank.transfer + to |
phone.qr |
{ account, amount? } |
{ payload, number, label, bank, name, amount? } |
phone.request |
{ phone, amount, note?, account? } |
the request (mail with a Pay button + push + chat message to the payer) |
phone.requests |
— | { incoming, outgoing } |
phone.request.pay |
{ id, from? } |
{ ref, amount, pending } |
phone.request.cancel |
{ id } |
true |
phone.request.decline |
{ id } |
true |
phone.cards |
— | the caller's cards and the cards on accounts they own (Card + accountLabel, tierLabel, tierLimit, contactlessMax, spentToday, own) |
phone.shared |
{ account } |
{ account, role, members, items } |
phone.shared.invite |
{ account, phone, role = 'spend'|'view', limit? } |
member |
phone.orders |
— | standing orders of accounts the caller may spend from |
phone.order.create |
{ from, phone? | to? | toAccount?, amount, label, intervalDays, firstInDays? } |
the order |
phone.order.cancel |
{ id } |
true |
phone.savings |
— | { credit, accounts, deposits?, loans?, branch } (deposits / loans from the branch module) |
phone.statement |
{ account, month? (months back) } |
{ month, opening, closing, moneyIn, moneyOut, count, byType, items, ... } |
phone.statement.mail |
{ account, month? } |
{ mail } (np_phone Mail) |
phone.business |
— | { boss = false } | { boss = true, account, employees, cards, items } (job bosses) |
phone.business.limit |
{ account?, identifier, role?, limit?, noLimit? } |
member (per-employee daily limit on the job account) |
Branch ​
Counter actions need a counter session (branch.ticket, served by the NPC or a player teller) at the location,
still standing at the counter; many need an ID (np_identification). Client-only methods (branch.client.*) are not
listed.
| Method | Params | Returns |
|---|---|---|
branch.ticket |
{ branch, hour? } |
{ served, ticket, open? (counter state) } | { served = false, ticket, ahead } |
branch.open |
— | the counter payload |
branch.state |
— | the counter state (every service the location offers) |
branch.leave |
— | true |
branch.summary |
— | GetBranchSummary of the caller (no counter needed) |
branch.nearby |
— | { { id, name } } players next to the caller |
branch.tellers |
— | { [branch] = teller name } |
branch.teller.duty |
{ branch, on } |
true (Config.Branch tellers, at the console) |
branch.teller.queue |
— | teller state |
branch.teller.call |
— | teller state (serves the next customer) |
branch.teller.decide |
{ loan, approve, note? } |
teller state (loan approval, same bank) |
branch.account.open |
{ type = 'personal'|'savings'|'shared', label? } |
Account |
branch.account.rename |
{ account, label } |
true |
branch.account.close |
{ account } |
true |
branch.account.coowner |
{ account, target (server id, next to the caller) } |
member |
branch.box.rent |
{ size = 'S'|'M'|'L', account } |
Box (+ key item) |
branch.box.open |
{ box } |
opens the stash (key + ID + holder, at the vault) |
branch.box.key |
{ box, account, target? } |
Box (another key, optionally to a co-holder) |
branch.box.holder.remove |
{ box, identifier } |
Box |
branch.box.rekey |
{ box, account } |
Box (old keys stop working) |
branch.box.upgrade |
{ box, size, account } |
Box |
branch.box.pay |
{ box, account } |
Box (owed rent) |
branch.box.release |
{ box } |
true |
branch.box.find |
{ number } |
{ id, label, size, holder, ... } |
branch.box.mine |
{ branch } |
Box[] |
branch.box.warrant |
{ box, reference? } |
Box (police jobs, audited) |
branch.box.staff |
{ box } |
Box (node np_banking.branch) |
branch.deposit.open |
{ product, amount, account } |
Deposit |
branch.deposit.withdraw |
{ deposit, amount? } |
payout |
branch.loan.quote |
{ kind, amount, weeks } |
quote (rate, instalment, max, reason?) |
branch.loan.apply |
{ kind, amount, weeks, account, collateral? } |
Loan (pending while a teller must approve) |
branch.loan.repay |
{ loan, account, amount? } |
Loan |
branch.loan.cancel |
{ loan } |
true |
branch.card.order |
{ account, tier?, pin? } |
card |
branch.card.replace |
{ card, pin? } |
card (Config.Cards.replaceFee) |
branch.card.upgrade |
{ card, tier, pin? } |
card |
branch.card.retrieve |
{ card } |
card (kept by an ATM) |
branch.card.pin |
{ card, pin } |
card (with an ID) |
branch.cheque.issue |
{ account, amount, payee? } |
cheque (+ bank_cheque item) |
branch.cheque.cash |
{ cheque, account? } |
cheque (to = 'account'|'cash') |
branch.cheque.void |
{ cheque } |
cheque |
branch.gold.buy |
{ account, count } |
{ count, total, price, ref } |
branch.gold.sell |
{ account, count } |
{ count, total, price, ref } |
branch.cash.deposit |
{ account, amount } |
{ ref, balance, cash } |
branch.cash.withdraw |
{ account, amount } |
{ ref, balance, cash } (over the large-cash threshold: a notice first) |
branch.cash.notice |
{ account, amount } |
notice |
branch.cash.collect |
{ notice } |
{ ref, amount, cash } |
branch.cash.cancel |
{ notice } |
true |
branch.business.open |
{ label? } |
Account (job bosses) |
branch.business.statement |
— | the job account's statement |
branch.payroll.add |
{ to (number), amount, intervalDays, label? } |
payroll (standing orders of the job account) |
branch.payroll.remove |
{ id } |
payroll |
Robbery ​
Every step is started and finished on the server: positions, items, police on duty, cooldowns and minigame answers are checked here; the client never reports success.
| Method | Params | Returns |
|---|---|---|
robbery.begin |
{ heist, stage, option?, target? } |
action { token, kind, label, icon, duration, minigame?, meta? } |
robbery.finish |
{ token, answer? } |
the step's result (loot, doors, next stage) |
robbery.cancel |
— | true |
robbery.keycard |
{ heist } |
{ item } (hostage keycard, once) |
robbery.tracker.remove |
— | { removed = true } (GPS tracker in a loot bag) |
robbery.world |
— | { active, doors } (late joiners) |
robbery.state |
— | the caller's heist HUD state | false |
robbery.atm.begin |
{ kind = 'skimmer'|'inspect'|'jackpot'|'ripout'|'blow'|'grab', atm?, model?, coords?, vehicle? } |
action or result |
robbery.atm.progress |
{ progress } |
true (glitch screen bystanders see; cosmetic) |
robbery.atm.pull |
— | { ripped, net, coords } (vehicle pulled the ATM off) |
robbery.atm.cut |
— | action (angle grinder at a hideout) |
robbery.inside.disable |
{ location } |
{ location, untilAt } (player teller holds the silent alarm) |
robbery.admin.list |
— | { robberies, cooldowns } (node np_banking.robbery.reset or .end) |
robbery.admin.reset |
{ scope? } |
{ cleared } (node np_banking.robbery.reset) |
robbery.admin.end |
{ heist } |
true (node np_banking.robbery.end) |