code wiki / _hdl_build / nx_adnet_bill.nx
nx_adnet_bill.nx
buildroot/runtime/_hdl_build/nx_adnet_bill.nx
about
nx_adnet_bill.nx -- LIB: CPM/CPC billing math for the sovereign ad network (adnet lane; the June
performance lane nx_ad_bill -- flat fee + capped bonus -- stays separate and untouched). ALL integer
milli-units (no float). HONEST-BILLING LAW (same as nx_ad_bill): a missing rate (<0 sentinel) or a
negative count REFUSES (-1) -- "cannot bill what we cannot price/measure"; default = NO CHARGE.
A period ceiling keeps every bill budgetable (flat cap, operator relationship > quick buck).
Counts come from the daemon's per-AD append-only logs (id-per-line; NO visitor identity by contract).
license_tier: ORIGINAL
dependencies 2 imports · 3 importers
imports: nx_syscalls.nxnx_adnet.nx
imported by: nx_adnet_bill_gate.nxnx_adnet_billv_gate.nxnx_adnet_invoice.nx
structs
| none |
consts
| none |
functions
| 12 | func anb_total_milli(imps: i64, clicks: i64, cpm_milli: i64, cpc_milli: i64) -> i64 |
| 23 | func anb_capped(total_milli: i64, cap_milli: i64) -> i64 |
| 31 | func anb_count(logbuf: *u8, llen: i64, ad_id: *u8) -> i64 |
| 35 | func anb_catd(dst: *u8, off: i64, v: i64) -> i64 |
| 49 | func anb_invoice_line(ad_id: *u8, imps: i64, clicks: i64, cpm_milli: i64, cpc_milli: i64, cap_milli: i64, out: *u8, cap: i64) -> i64 |
| 89 | func anb_deliv_permille(served: i64, viewable: i64) -> i64 |
| 98 | func anb_invoice_line_v(ad_id: *u8, served: i64, viewable: i64, clicks: i64, cpm_milli: i64, cpc_milli: i64, cap_milli: i64, out: *u8, cap: i64) -> i64 |