nx_porkbun_domain.nx
buildroot/runtime/nx_porkbun_domain.nx
about
nx_porkbun_domain.nx -- Porkbun DOMAIN lifecycle client: pricing / availability / SSL-bundle
retrieve / REGISTER (purchase). Completes the existing Porkbun family (nx_acme_porkbun = DNS
records; nx_acme_issue = ACME cert issuance; this = the domain PURCHASE + golive side).
Composes nx_acme_http's nx_acme_req transport (TLS 1.3 with the proven 1.2 fallback that
api.porkbun.com needs) + nx_acme_porkbun's pk_* builders/checkers. Creds come from the sovereign
vault decrypt output (line1=apikey, line2=secretapikey; NEVER printed, NEVER hardcoded).
SPEND SAFETY BY CONSTRUCTION (the register path):
R1 the endpoint must be VERIFIED against banked documentation bytes on disk
(knowledge/library/pb_api_docs.txt must contain the endpoint path) -- an unverified
spend endpoint REFUSES before any network I/O (assumption-free APIs, rule 4).
R2 creds file must load (both lines nonempty).
R3 the caller must pass the LITERAL token confirm-spend (no default-yes anywhere).
R4 a price quote (cents) and a spend CAP (cents) are required; quote>cap REFUSES.
R5 only after R1-R4 does the request go out; the raw response is printed for the operator.
CLI modes:
docs -- bank the API documentation page (GET over the 1.2-capable
transport) -> knowledge/library/pb_api_docs.txt
pricing -- keyless POST /pricing/get (public price list)
ping <credfile> -- authed POST /ping (read-only; prints yourIp body)
check <domain> <credfile> -- POST /domain/checkDomain/<domain> (availability+price)
ssl <domain> <credfile> <outfile> -- POST /ssl/retrieve/<domain>; bundle SAVED 0600, never printed
register <domain> <credfile> <price_cents> <cap_cents> confirm-spend
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_acme_porkbun.nxnx_itoa_lib.nx
imported by: nx_golive.nxnx_porkbun_domain_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 27 | const PBD_MAGIC_4194304: i64 = 4194304 |
| 28 | const PBD_MAGIC_2048: i64 = 2048 |
| 29 | const PBD_MAGIC_1200: i64 = 1200 |
| 30 | const PBD_MAGIC_1048576: i64 = 1048576 |
| 32 | const PBD_RESP_CAP: i64 = 262144 |
| 33 | const PBD_DOCS_PATH: *u8 = "knowledge/library/pb_api_docs.txt\x00" |
| 34 | const PBD_SPEC_PATH: *u8 = "knowledge/library/pb_api_spec.txt\x00" |
functions
| 36 | func pbd_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 41 | func pbd_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 42 | func pbd_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 43 | func pbd_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 50 | func pbd_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 64 | func pbd_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 77 | func pbd_store() -> *TrustStore |
| 83 | func pbd_creds(path: *u8, ak_off: *i64, ak_len: *i64, sk_off: *i64, sk_len: *i64, raw: *u8) -> i64 |
| 104 | func pbd_show(resp: *u8, total: i64, maxbody: i64) -> i64 |
| 126 | func pbd_pricing(store: *TrustStore, now: i64, resp: *u8, rn: *i64) -> i64 |
| 133 | func pbd_ping(raw: *u8, ao: i64, an: i64, so: i64, sn2: i64, store: *TrustStore, now: i64, resp: *u8, rn: *i64) -> i64 |
| 141 | func pbd_check(raw: *u8, ao: i64, an: i64, so: i64, sn2: i64, dom: *u8, store: *TrustStore, now: i64, resp: *u8, rn: *i64) -> i64 |
| 152 | func pbd_ssl(raw: *u8, ao: i64, an: i64, so: i64, sn2: i64, dom: *u8, store: *TrustStore, now: i64, resp: *u8, rn: *i64) -> i64 |
| 165 | func pbd_register_wall(docs_ok: i64, creds_ok: i64, confirm_ok: i64, quote_cents: i64, cap_cents: i64) -> i64 |
| 177 | func pbd_docs_has_create(buf: *u8, cap: i64) -> i64 |
| 183 | func pbd_putn(dst: *u8, off: i64, v: i64) -> i64 |
| 195 | func main(argc: i64, argv: *i64) -> i64 |