nx_offer_ledger.nx
buildroot/runtime/nx_offer_ledger.nx
about
nx_offer_ledger.nx -- licensing outreach / offer tracker. For each
TO_ACQUIRE target (a person/host we want to license), record the agent/contact
and track the offer through a state machine:
open -> PENDING --send--> SENT --accept--> ACCEPTED
\----------------decline---> DECLINED
On ACCEPTED the caller closes the loop: reclassify the host OWNED
(nx_fetch_rights) + mint a grant (nx_rights_ledger) so the talent becomes
product-usable. Respectful + legal: nothing is product-usable until a real
accepted offer + license exists. Mirrors the nx_rights_ledger pattern.
contact_ref is an id into a contacts store (name/email/agent details = a
later rung); here it just carries the link.
license_tier: ORIGINAL
dependencies 2 imports · 3 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_offer_ledger_gate.nxnx_offer_ledger_store.nxnx_offer_ledger_store_gate.nx
structs
| 31 | struct NxOffer |
| 40 | struct NxOfferLedger |
consts
| 20 | const NX_OF_PENDING: nx_int = 0 |
| 21 | const NX_OF_SENT: nx_int = 1 |
| 22 | const NX_OF_ACCEPTED: nx_int = 2 |
| 23 | const NX_OF_DECLINED: nx_int = 3 |
| 24 | const NX_OF_N: nx_int = 4 |
| 26 | const NX_OF_OK: nx_int = 0 |
| 27 | const NX_OF_ERR_FULL: nx_int = 1 |
| 28 | const NX_OF_ERR_NOT_FOUND: nx_int = 2 |
| 29 | const NX_OF_ERR_BAD_TRANSITION: nx_int = 3 |
| 46 | const NX_OF_BYTES: nx_size = 48 |
functions
| 48 | func nx_offer_ledger_new(capacity: nx_size) -> *NxOfferLedger |
| 56 | func _of_at(l: *NxOfferLedger, idx: nx_size) -> *NxOffer |
| 60 | func _of_find(l: *NxOfferLedger, offer_id: nx_int) -> nx_int |
| 71 | func nx_offer_open(l: *NxOfferLedger, offer_id: nx_int, target_bk: nx_int, contact_ref: nx_int, now_us: nx_size) -> nx_int |
| 85 | func nx_offer_send(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int |
| 95 | func nx_offer_accept(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int |
| 106 | func nx_offer_decline(l: *NxOfferLedger, offer_id: nx_int, now_us: nx_size) -> nx_int |
| 117 | func nx_offer_state(l: *NxOfferLedger, offer_id: nx_int) -> nx_int |
| 125 | func nx_offer_is_accepted(l: *NxOfferLedger, target_bk: nx_int) -> nx_int |
| 137 | func nx_offer_count_by_state(l: *NxOfferLedger, state: nx_int) -> nx_int |