2026-05-23 09:23:12 -05:00

3.8 KiB

Client Bank Usage Guide

The client bank addon opens the bank and ATM browser UI, forwards banking requests to the server bank addon, and pushes account updates back into the browser.

Open Bank UI

Open full bank mode:

call forge_client_bank_fnc_openUI;

Open ATM mode:

[true] call forge_client_bank_fnc_openUI;

The open function creates RscBank, sets the bridge mode to bank or atm, loads ui/_site/index.html, and routes browser events through forge_client_bank_fnc_handleUIEvents.

Bridge and Repository

forge_client_bank_fnc_initRepository tracks account load and cached account state.

forge_client_bank_fnc_initUIBridge owns:

  • active browser control tracking
  • bank/ATM mode
  • browser ready handling
  • account hydrate and sync responses
  • deposit, withdrawal, transfer, earnings deposit, credit repayment, and PIN requests
  • browser notice delivery

Browser Events

<th>
  Client behavior
</th>
<td>
  Mark browser ready and request hydrate from the server.
</td>
<td>
  Request fresh bank hydrate data.
</td>
<td>
  Forward deposit amount to the server.
</td>
<td>
  Forward withdrawal amount to the server.
</td>
<td>
  Forward target, source field, and amount.
</td>
<td>
  Request earnings deposit.
</td>
<td>
  Request credit-line repayment.
</td>
<td>
  Forward PIN validation request.
</td>
<td>
  Dispose bridge screen state and close the display.
</td>
Event
bank::ready
bank::refresh
bank::deposit::request
bank::withdraw::request
bank::transfer::request
bank::depositEarnings::request
bank::repayCreditLine::request
bank::pin::request
bank::close

Browser Response Events

The bridge sends:

<th>
  Purpose
</th>
<td>
  Full session/account payload.
</td>
<td>
  Account patch or sync data.
</td>
<td>
  UI-visible notice payload.
</td>
Event
bank::hydrate
bank::sync
bank::notice

Request Flow

Example deposit flow:

  1. Browser sends bank::deposit::request with an amount.
  2. Client bridge calls the server bank request event.
  3. Server bank addon validates the request and calls bank hot-state logic.
  4. Server response is caught by the client post-init event handlers.
  5. Client bridge sends bank::sync or bank::notice back to the browser.

Authoritative State

Balances, PIN authorization, transfers, checkout charges, credit lines, and persistence are server-owned. The client should only display account data and request mutations through server events.