zklicensing 0.1.0-beta.2 → 0.1.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/README.md +417 -201
  2. package/build/agent.d.ts +371 -0
  3. package/build/agent.d.ts.map +1 -0
  4. package/build/agent.js +553 -0
  5. package/build/agent.js.map +1 -0
  6. package/build/agentActions.d.ts +841 -0
  7. package/build/agentActions.d.ts.map +1 -0
  8. package/build/agentActions.js +581 -0
  9. package/build/agentActions.js.map +1 -0
  10. package/build/agentRecord.d.ts +83 -0
  11. package/build/agentRecord.d.ts.map +1 -0
  12. package/build/agentRecord.js +69 -0
  13. package/build/agentRecord.js.map +1 -0
  14. package/build/agentVendor.d.ts +220 -0
  15. package/build/agentVendor.d.ts.map +1 -0
  16. package/build/agentVendor.js +306 -0
  17. package/build/agentVendor.js.map +1 -0
  18. package/build/appsLookup.d.ts +14 -0
  19. package/build/appsLookup.d.ts.map +1 -0
  20. package/build/appsLookup.js +12 -0
  21. package/build/appsLookup.js.map +1 -0
  22. package/build/archiveBootstrap.d.ts +31 -5
  23. package/build/archiveBootstrap.d.ts.map +1 -0
  24. package/build/archiveBootstrap.js +140 -47
  25. package/build/archiveBootstrap.js.map +1 -0
  26. package/build/atomicJson.d.ts +5 -0
  27. package/build/atomicJson.d.ts.map +1 -0
  28. package/build/atomicJson.js +55 -0
  29. package/build/atomicJson.js.map +1 -0
  30. package/build/bindClient.d.ts +85 -0
  31. package/build/bindClient.d.ts.map +1 -0
  32. package/build/bindClient.js +187 -0
  33. package/build/bindClient.js.map +1 -0
  34. package/build/buyClient.d.ts +27 -4
  35. package/build/buyClient.d.ts.map +1 -0
  36. package/build/buyClient.js +72 -26
  37. package/build/buyClient.js.map +1 -0
  38. package/build/chainHead.d.ts +61 -0
  39. package/build/chainHead.d.ts.map +1 -0
  40. package/build/chainHead.js +88 -0
  41. package/build/chainHead.js.map +1 -0
  42. package/build/compactMerkleMap.d.ts +72 -0
  43. package/build/compactMerkleMap.d.ts.map +1 -0
  44. package/build/compactMerkleMap.js +224 -0
  45. package/build/compactMerkleMap.js.map +1 -0
  46. package/build/contractInterface.d.ts +191 -51
  47. package/build/contractInterface.d.ts.map +1 -0
  48. package/build/contractInterface.js +234 -43
  49. package/build/contractInterface.js.map +1 -0
  50. package/build/contractTypes.d.ts +9 -0
  51. package/build/contractTypes.d.ts.map +1 -0
  52. package/build/contractTypes.js +28 -0
  53. package/build/contractTypes.js.map +1 -0
  54. package/build/countryStats.d.ts +12 -3
  55. package/build/countryStats.d.ts.map +1 -0
  56. package/build/countryStats.js +87 -23
  57. package/build/countryStats.js.map +1 -0
  58. package/build/deployClient.d.ts +138 -24
  59. package/build/deployClient.d.ts.map +1 -0
  60. package/build/deployClient.js +91 -31
  61. package/build/deployClient.js.map +1 -0
  62. package/build/deviceIdentity.d.ts +68 -0
  63. package/build/deviceIdentity.d.ts.map +1 -0
  64. package/build/deviceIdentity.js +209 -0
  65. package/build/deviceIdentity.js.map +1 -0
  66. package/build/freezeClient.d.ts +26 -6
  67. package/build/freezeClient.d.ts.map +1 -0
  68. package/build/freezeClient.js +30 -6
  69. package/build/freezeClient.js.map +1 -0
  70. package/build/generationClient.d.ts +6 -3
  71. package/build/generationClient.d.ts.map +1 -0
  72. package/build/generationClient.js +25 -38
  73. package/build/generationClient.js.map +1 -0
  74. package/build/holderSecret.d.ts +70 -0
  75. package/build/holderSecret.d.ts.map +1 -0
  76. package/build/holderSecret.js +76 -0
  77. package/build/holderSecret.js.map +1 -0
  78. package/build/index.d.ts +38 -38
  79. package/build/index.d.ts.map +1 -0
  80. package/build/index.js +97 -121
  81. package/build/index.js.map +1 -0
  82. package/build/keysClient.d.ts +142 -0
  83. package/build/keysClient.d.ts.map +1 -0
  84. package/build/keysClient.js +109 -0
  85. package/build/keysClient.js.map +1 -0
  86. package/build/licenseLeaf.d.ts +76 -0
  87. package/build/licenseLeaf.d.ts.map +1 -0
  88. package/build/licenseLeaf.js +189 -0
  89. package/build/licenseLeaf.js.map +1 -0
  90. package/build/licenseRecord.d.ts +68 -5
  91. package/build/licenseRecord.d.ts.map +1 -0
  92. package/build/licenseRecord.js +26 -1
  93. package/build/licenseRecord.js.map +1 -0
  94. package/build/licenseStore.d.ts +81 -4
  95. package/build/licenseStore.d.ts.map +1 -0
  96. package/build/licenseStore.js +400 -30
  97. package/build/licenseStore.js.map +1 -0
  98. package/build/licenseTrustless.d.ts +43 -0
  99. package/build/licenseTrustless.d.ts.map +1 -0
  100. package/build/licenseTrustless.js +180 -0
  101. package/build/licenseTrustless.js.map +1 -0
  102. package/build/manifestVerify.d.ts +29 -1
  103. package/build/manifestVerify.d.ts.map +1 -0
  104. package/build/manifestVerify.js +46 -4
  105. package/build/manifestVerify.js.map +1 -0
  106. package/build/minaPriceHistory.d.ts +9 -0
  107. package/build/minaPriceHistory.d.ts.map +1 -0
  108. package/build/minaPriceHistory.js +152 -0
  109. package/build/minaPriceHistory.js.map +1 -0
  110. package/build/onChainRoot.d.ts +60 -0
  111. package/build/onChainRoot.d.ts.map +1 -0
  112. package/build/onChainRoot.js +74 -0
  113. package/build/onChainRoot.js.map +1 -0
  114. package/build/ownershipLicenseHash.d.ts +25 -0
  115. package/build/ownershipLicenseHash.d.ts.map +1 -0
  116. package/build/ownershipLicenseHash.js +29 -0
  117. package/build/ownershipLicenseHash.js.map +1 -0
  118. package/build/ownershipSignature.d.ts +153 -0
  119. package/build/ownershipSignature.d.ts.map +1 -0
  120. package/build/ownershipSignature.js +297 -0
  121. package/build/ownershipSignature.js.map +1 -0
  122. package/build/permitCheckFlow.d.ts +155 -0
  123. package/build/permitCheckFlow.d.ts.map +1 -0
  124. package/build/permitCheckFlow.js +196 -0
  125. package/build/permitCheckFlow.js.map +1 -0
  126. package/build/permitDescribe.d.ts +124 -0
  127. package/build/permitDescribe.d.ts.map +1 -0
  128. package/build/permitDescribe.js +324 -0
  129. package/build/permitDescribe.js.map +1 -0
  130. package/build/permitInterface.d.ts +85 -0
  131. package/build/permitInterface.d.ts.map +1 -0
  132. package/build/permitInterface.js +121 -0
  133. package/build/permitInterface.js.map +1 -0
  134. package/build/permitMessages.d.ts +313 -0
  135. package/build/permitMessages.d.ts.map +1 -0
  136. package/build/permitMessages.js +462 -0
  137. package/build/permitMessages.js.map +1 -0
  138. package/build/permitProof.d.ts +108 -0
  139. package/build/permitProof.d.ts.map +1 -0
  140. package/build/permitProof.js +202 -0
  141. package/build/permitProof.js.map +1 -0
  142. package/build/permitRegistryRebuild.d.ts +166 -0
  143. package/build/permitRegistryRebuild.d.ts.map +1 -0
  144. package/build/permitRegistryRebuild.js +347 -0
  145. package/build/permitRegistryRebuild.js.map +1 -0
  146. package/build/permitTree.d.ts +88 -0
  147. package/build/permitTree.d.ts.map +1 -0
  148. package/build/permitTree.js +230 -0
  149. package/build/permitTree.js.map +1 -0
  150. package/build/permitsClient.d.ts +680 -0
  151. package/build/permitsClient.d.ts.map +1 -0
  152. package/build/permitsClient.js +597 -0
  153. package/build/permitsClient.js.map +1 -0
  154. package/build/proveErrors.d.ts +50 -0
  155. package/build/proveErrors.d.ts.map +1 -0
  156. package/build/proveErrors.js +76 -0
  157. package/build/proveErrors.js.map +1 -0
  158. package/build/receipt.d.ts +95 -0
  159. package/build/receipt.d.ts.map +1 -0
  160. package/build/receipt.js +84 -0
  161. package/build/receipt.js.map +1 -0
  162. package/build/refundClient.d.ts +7 -12
  163. package/build/refundClient.d.ts.map +1 -0
  164. package/build/refundClient.js +52 -21
  165. package/build/refundClient.js.map +1 -0
  166. package/build/registryTrustVerify.d.ts +78 -0
  167. package/build/registryTrustVerify.d.ts.map +1 -0
  168. package/build/registryTrustVerify.js +129 -0
  169. package/build/registryTrustVerify.js.map +1 -0
  170. package/build/releaseClient.d.ts +26 -0
  171. package/build/releaseClient.d.ts.map +1 -0
  172. package/build/releaseClient.js +65 -0
  173. package/build/releaseClient.js.map +1 -0
  174. package/build/renewClient.d.ts +28 -2
  175. package/build/renewClient.d.ts.map +1 -0
  176. package/build/renewClient.js +31 -27
  177. package/build/renewClient.js.map +1 -0
  178. package/build/seatName.d.ts +8 -0
  179. package/build/seatName.d.ts.map +1 -0
  180. package/build/seatName.js +136 -0
  181. package/build/seatName.js.map +1 -0
  182. package/build/slotConstants.d.ts +15 -0
  183. package/build/slotConstants.d.ts.map +1 -0
  184. package/build/slotConstants.js +17 -0
  185. package/build/slotConstants.js.map +1 -0
  186. package/build/statsClient.d.ts +61 -7
  187. package/build/statsClient.d.ts.map +1 -0
  188. package/build/statsClient.js +44 -5
  189. package/build/statsClient.js.map +1 -0
  190. package/build/successorChain.d.ts +35 -0
  191. package/build/successorChain.d.ts.map +1 -0
  192. package/build/successorChain.js +69 -0
  193. package/build/successorChain.js.map +1 -0
  194. package/build/taxId.d.ts +44 -0
  195. package/build/taxId.d.ts.map +1 -0
  196. package/build/taxId.js +212 -0
  197. package/build/taxId.js.map +1 -0
  198. package/build/trustAnchorVerify.d.ts +49 -0
  199. package/build/trustAnchorVerify.d.ts.map +1 -0
  200. package/build/trustAnchorVerify.js +432 -0
  201. package/build/trustAnchorVerify.js.map +1 -0
  202. package/build/trustAnchorVerifyCli.d.ts +45 -0
  203. package/build/trustAnchorVerifyCli.d.ts.map +1 -0
  204. package/build/trustAnchorVerifyCli.js +235 -0
  205. package/build/trustAnchorVerifyCli.js.map +1 -0
  206. package/build/txBroadcastClient.d.ts +26 -0
  207. package/build/txBroadcastClient.d.ts.map +1 -0
  208. package/build/txBroadcastClient.js +20 -0
  209. package/build/txBroadcastClient.js.map +1 -0
  210. package/build/unbindClient.d.ts +77 -0
  211. package/build/unbindClient.d.ts.map +1 -0
  212. package/build/unbindClient.js +169 -0
  213. package/build/unbindClient.js.map +1 -0
  214. package/build/units.d.ts +28 -0
  215. package/build/units.d.ts.map +1 -0
  216. package/build/units.js +65 -0
  217. package/build/units.js.map +1 -0
  218. package/build/vatRates.d.ts +54 -0
  219. package/build/vatRates.d.ts.map +1 -0
  220. package/build/vatRates.js +82 -0
  221. package/build/vatRates.js.map +1 -0
  222. package/build/vatRatesData.d.ts +5 -0
  223. package/build/vatRatesData.d.ts.map +1 -0
  224. package/build/vatRatesData.js +42 -0
  225. package/build/vatRatesData.js.map +1 -0
  226. package/build/vendorAccountClient.d.ts +66 -0
  227. package/build/vendorAccountClient.d.ts.map +1 -0
  228. package/build/vendorAccountClient.js +47 -0
  229. package/build/vendorAccountClient.js.map +1 -0
  230. package/build/verifyCore.d.ts +4 -1
  231. package/build/verifyCore.d.ts.map +1 -0
  232. package/build/verifyCore.js +21 -10
  233. package/build/verifyCore.js.map +1 -0
  234. package/build/verifyOffline.d.ts +85 -0
  235. package/build/verifyOffline.d.ts.map +1 -0
  236. package/build/verifyOffline.js +139 -0
  237. package/build/verifyOffline.js.map +1 -0
  238. package/build/verifyService.d.ts.map +1 -0
  239. package/build/verifyService.js +571 -501
  240. package/build/verifyService.js.map +1 -0
  241. package/build/verifyWithAncestors.d.ts +19 -0
  242. package/build/verifyWithAncestors.d.ts.map +1 -0
  243. package/build/verifyWithAncestors.js +127 -0
  244. package/build/verifyWithAncestors.js.map +1 -0
  245. package/build/zipToState.d.ts +2 -0
  246. package/build/zipToState.d.ts.map +1 -0
  247. package/build/zipToState.js +94 -0
  248. package/build/zipToState.js.map +1 -0
  249. package/package.json +141 -16
  250. package/src/agent.ts +682 -0
  251. package/src/agentActions.ts +637 -0
  252. package/src/agentRecord.ts +121 -0
  253. package/src/agentVendor.ts +356 -0
  254. package/src/appsLookup.ts +48 -0
  255. package/src/archiveBootstrap.ts +386 -0
  256. package/src/atomicJson.ts +53 -0
  257. package/src/bindClient.ts +297 -0
  258. package/src/buyClient.ts +344 -0
  259. package/src/chainHead.ts +106 -0
  260. package/src/compactMerkleMap.ts +222 -0
  261. package/src/contractInterface.ts +465 -0
  262. package/src/contractTypes.ts +31 -0
  263. package/src/countryStats.ts +200 -0
  264. package/src/deployClient.ts +517 -0
  265. package/src/deviceIdentity.ts +249 -0
  266. package/src/freezeClient.ts +162 -0
  267. package/src/generationClient.ts +145 -0
  268. package/src/holderSecret.ts +91 -0
  269. package/src/index.ts +362 -0
  270. package/src/keysClient.ts +135 -0
  271. package/src/licenseLeaf.ts +221 -0
  272. package/src/licenseRecord.ts +190 -0
  273. package/src/licenseStore.ts +767 -0
  274. package/src/licenseTrustless.ts +207 -0
  275. package/src/manifestVerify.ts +164 -0
  276. package/src/minaPriceHistory.ts +166 -0
  277. package/src/onChainRoot.ts +90 -0
  278. package/src/ownershipLicenseHash.ts +31 -0
  279. package/src/ownershipSignature.ts +421 -0
  280. package/src/permitCheckFlow.ts +227 -0
  281. package/src/permitDescribe.ts +362 -0
  282. package/src/permitInterface.ts +146 -0
  283. package/src/permitMessages.ts +572 -0
  284. package/src/permitProof.ts +230 -0
  285. package/src/permitRegistryRebuild.ts +423 -0
  286. package/src/permitTree.ts +232 -0
  287. package/src/permitsClient.ts +746 -0
  288. package/src/proveErrors.ts +98 -0
  289. package/src/receipt.ts +156 -0
  290. package/src/refundClient.ts +177 -0
  291. package/src/registryTrustVerify.ts +192 -0
  292. package/src/releaseClient.ts +101 -0
  293. package/src/renewClient.ts +234 -0
  294. package/src/seatName.ts +165 -0
  295. package/src/slotConstants.ts +18 -0
  296. package/src/statsClient.ts +249 -0
  297. package/src/successorChain.ts +87 -0
  298. package/src/taxId.ts +227 -0
  299. package/src/trustAnchorVerify.ts +550 -0
  300. package/src/trustAnchorVerifyCli.ts +234 -0
  301. package/src/txBroadcastClient.ts +48 -0
  302. package/src/unbindClient.ts +233 -0
  303. package/src/units.ts +74 -0
  304. package/src/vatRates.ts +100 -0
  305. package/src/vatRatesData.ts +43 -0
  306. package/src/vendorAccountClient.ts +120 -0
  307. package/src/verifyCore.ts +100 -0
  308. package/src/verifyOffline.ts +212 -0
  309. package/src/verifyService.ts +982 -0
  310. package/src/verifyWithAncestors.ts +163 -0
  311. package/src/zipToState.ts +94 -0
  312. package/build/licenseProof.d.ts +0 -26
  313. package/build/licenseProof.js +0 -41
  314. package/build/migrateClient.d.ts +0 -43
  315. package/build/migrateClient.js +0 -47
  316. package/build/ownership.d.ts +0 -34
  317. package/build/ownership.js +0 -147
@@ -1,5 +1,26 @@
1
1
  // Copyright (c) 2025-2026 zkLicensing project developers
2
- // All rights reserved.
2
+ // SPDX-License-Identifier: BUSL-1.1
3
+ /**
4
+ * The health block for `network`. Without a network: the only configured
5
+ * one, or null when several are configured (ambiguous). Falls back to the
6
+ * legacy flat shape.
7
+ */
8
+ export function pickNetworkHealth(health, network) {
9
+ const nested = ['devnet', 'mainnet'].filter(n => health[n] && typeof health[n].slot === 'number');
10
+ if (nested.length > 0) {
11
+ if (network)
12
+ return health[network] ?? null;
13
+ return nested.length === 1 ? health[nested[0]] : null;
14
+ }
15
+ if (typeof health.slot === 'number' || typeof health.salesFrozen === 'boolean') {
16
+ return {
17
+ slot: typeof health.slot === 'number' ? health.slot : 0,
18
+ salesFrozen: health.salesFrozen === true,
19
+ freezeAfterSlot: typeof health.freezeAfterSlot === 'number' ? health.freezeAfterSlot : null,
20
+ };
21
+ }
22
+ return null;
23
+ }
3
24
  function baseUrl(url) {
4
25
  return url.replace(/\/+$/, '');
5
26
  }
@@ -28,7 +49,7 @@ export async function getKeeperHealth(opts) {
28
49
  // the caller override or process.env, the current slot is not known
29
50
  // client-side, so salesFrozen is filled from /health only — the override
30
51
  // path returns { freezeAfterSlot: N, salesFrozen: false, currentSlot: null }
31
- // and lets the keeper reject the actual prove call if the freeze has fired.
52
+ // and lets the backend reject the actual prove call if the freeze has fired.
32
53
  export async function resolveFreezeState(opts) {
33
54
  if (typeof opts.freezeAfterSlot === 'number' && opts.freezeAfterSlot > 0) {
34
55
  return { salesFrozen: false, freezeAfterSlot: opts.freezeAfterSlot, currentSlot: null };
@@ -43,15 +64,18 @@ export async function resolveFreezeState(opts) {
43
64
  fetcher: opts.fetcher,
44
65
  signal: opts.signal,
45
66
  });
67
+ const net = pickNetworkHealth(health, opts.network);
68
+ if (!net)
69
+ return { salesFrozen: false, freezeAfterSlot: null, currentSlot: null };
46
70
  return {
47
- salesFrozen: health.salesFrozen === true,
48
- freezeAfterSlot: typeof health.freezeAfterSlot === 'number' ? health.freezeAfterSlot : null,
49
- currentSlot: typeof health.slot === 'number' ? health.slot : null,
71
+ salesFrozen: net.salesFrozen === true,
72
+ freezeAfterSlot: typeof net.freezeAfterSlot === 'number' && net.freezeAfterSlot > 0 ? net.freezeAfterSlot : null,
73
+ currentSlot: typeof net.slot === 'number' && net.slot > 0 ? net.slot : null,
50
74
  };
51
75
  }
52
76
  catch {
53
77
  // /health unreachable — treat as no freeze so we don't block buys on a
54
- // transient network hiccup. The keeper's own guard is still the last
78
+ // transient network hiccup. The backend's own guard is still the last
55
79
  // line of defense.
56
80
  return { salesFrozen: false, freezeAfterSlot: null, currentSlot: null };
57
81
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"freezeClient.js","sourceRoot":"","sources":["../src/freezeClient.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,oCAAoC;AAgDpC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoB,EAAE,OAA8B;IACpF,MAAM,MAAM,GAAI,CAAC,QAAQ,EAAE,SAAS,CAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC9G,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,OAAO;YAAE,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;QAC5C,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACzD,CAAC;IACD,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,MAAM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,IAAI,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI;YAChH,WAAW,EAAM,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;SAChF,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;QACvE,sEAAsE;QACtE,mBAAmB;QACnB,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC1E,CAAC;AACH,CAAC"}
@@ -15,6 +15,7 @@ export interface GenerationInfo {
15
15
  }
16
16
  export interface FetchGenerationRequest {
17
17
  keeperUrl: string;
18
+ network: 'devnet' | 'mainnet';
18
19
  appId: string;
19
20
  /** Base64-encoded Ed25519 public keys pinned by the caller. Empty ⇒ verified:false. */
20
21
  pinnedPublicKeysBase64: readonly string[];
@@ -23,6 +24,8 @@ export interface FetchGenerationRequest {
23
24
  }
24
25
  export interface FetchGenerationByAddressRequest {
25
26
  keeperUrl: string;
27
+ /** When given, a list signed for the other network is refused. */
28
+ network?: 'devnet' | 'mainnet';
26
29
  /** Any zkApp address in the app's generation chain — current live or any retired. */
27
30
  zkAppAddress: string;
28
31
  /** Base64-encoded Ed25519 public keys pinned by the caller. Empty ⇒ verified:false. */
@@ -34,7 +37,7 @@ export interface FetchGenerationByAddressRequest {
34
37
  * GET /apps/:appId — returns { appId, current, generations, issuedAt, publicKey, signature }.
35
38
  * We reconstruct the canonical payload (everything except `publicKey` +
36
39
  * `signature`) and verify against the pin list. `publicKey` in the response
37
- * is advisory only — it's the key the keeper claims to have signed with;
40
+ * is advisory only — it's the key the backend claims to have signed with;
38
41
  * the SDK never trusts it in place of a pin.
39
42
  */
40
43
  export declare function fetchGenerationInfo(req: FetchGenerationRequest): Promise<GenerationInfo>;
@@ -42,11 +45,11 @@ export declare function fetchGenerationInfo(req: FetchGenerationRequest): Promis
42
45
  * GET /apps/by-address/:zkAppAddress — same signed payload as fetchGenerationInfo,
43
46
  * but keyed by an address the caller already has (direct-paste buys, renew on a
44
47
  * since-retired address). Buyers arriving without an appId would otherwise have
45
- * to trust the keeper's unsigned `/apps` list to bind their address to an appId
48
+ * to trust the backend's unsigned `/apps` list to bind their address to an appId
46
49
  * first — defeating the pin.
47
50
  *
48
51
  * Extra assertion beyond the appId flow: the queried address MUST appear in the
49
- * returned `generations[]`. Without this, a malicious keeper could return a
52
+ * returned `generations[]`. Without this, a malicious backend could return a
50
53
  * validly-signed payload for a DIFFERENT app in response to the query, and the
51
54
  * signature check alone wouldn't catch it.
52
55
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generationClient.d.ts","sourceRoot":"","sources":["../src/generationClient.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAW,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAQ,SAAS,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAG,MAAM,CAAC;IACrB,SAAS,CAAC,EAAI,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,sGAAsG;IACtG,OAAO,EAAM,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,qEAAqE;IACrE,QAAQ,EAAK,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAG,QAAQ,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAK,MAAM,CAAC;IACjB,uFAAuF;IACvF,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,MAAM,CAAC,EAAG,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,qFAAqF;IACrF,YAAY,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,MAAM,CAAC,EAAG,WAAW,CAAC;CACvB;AAuBD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAc9F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,+BAA+B,GACnC,OAAO,CAAC,cAAc,CAAC,CAmBzB"}
@@ -1,67 +1,54 @@
1
1
  // Copyright (c) 2025-2026 zkLicensing project developers
2
- // All rights reserved.
2
+ // SPDX-License-Identifier: BUSL-1.1
3
3
  /**
4
4
  * generationClient.ts
5
5
  *
6
- * Browser-safe fetcher for the keeper's signed generation-list. Returns the
6
+ * Browser-safe fetcher for the backend's signed generation-list. Returns the
7
7
  * app's deployment history — every past address plus the current live one —
8
8
  * verified against a caller-supplied pin list of platform manifest public
9
9
  * keys.
10
10
  *
11
- * Trust model: the keeper is not the trust anchor for this data — it can
11
+ * Trust model: the backend is not the trust anchor for this data — it can
12
12
  * be re-hosted, mirrored, cached, or (worst case) impersonated. The pin
13
13
  * list is. Any response that fails signature verification is surfaced as
14
14
  * `verified: false` with `generations: []` so callers cannot accidentally
15
15
  * route a wallet prompt to an unverified address.
16
16
  *
17
17
  * Optional corroboration channel: an operator that publishes
18
- * https://<vendor-host>/.well-known/zklicensing/<appId>.json
19
- * (using the same keeper-signed payload) can be cross-checked from the
20
- * on-chain zkappUri. Per-app filename because a vendor may host several
21
- * apps at one origin. The cross-check is opt-in per-app — a 404 at that
18
+ * https://<vendor-host>/.well-known/zklicensing/<zkAppAddress>.json
19
+ * (using the same backend-signed payload) can be cross-checked from the
20
+ * on-chain zkappUri. One file per deployed address (so per generation),
21
+ * because a vendor may host several apps at one origin. The cross-check is opt-in per-app — a 404 at that
22
22
  * URL is not a failure signal, just "no corroboration published for this
23
23
  * app." That's the caller's job, not this module's.
24
24
  */
25
- import { verifyManifestSignature } from './manifestVerify.js';
25
+ import { verifyManifest } from './manifestVerify.js';
26
26
  function baseUrl(url) {
27
27
  return url.replace(/\/+$/, '');
28
28
  }
29
- function parseGenerationBody(body) {
30
- const gensRaw = body.generations;
31
- return {
32
- current: typeof body.current === 'number' ? body.current : null,
33
- generations: Array.isArray(gensRaw) ? gensRaw : [],
34
- signature: typeof body.signature === 'string' ? body.signature : null,
35
- issuedAt: typeof body.issuedAt === 'string' ? body.issuedAt : null,
36
- appId: typeof body.appId === 'string' ? body.appId : null,
37
- };
38
- }
39
- async function verifyAndProject(parsed, pinnedPublicKeysBase64) {
40
- const { current, generations, signature, issuedAt, appId } = parsed;
41
- if (!signature || !issuedAt || !appId || current === null) {
42
- return { current, generations, verified: false };
43
- }
44
- // Reconstruct the canonical payload — must match keeperService's
45
- // signPayload input exactly.
46
- const canonical = { appId, current, generations, issuedAt };
47
- const verified = await verifyManifestSignature(canonical, signature, pinnedPublicKeysBase64);
48
- if (!verified) {
49
- // Never surface unverified `current`/`generations` — a caller must not
50
- // accidentally route a wallet prompt to an address we couldn't authenticate.
29
+ /**
30
+ * The verified generation list in a keeper response: a platform signature
31
+ * from a pinned key (current or, during a key rotation, the previous one)
32
+ * over the signed fields, for `network` when given. Unverified data is
33
+ * never surfaced: a caller must not route a wallet prompt to an address we
34
+ * couldn't authenticate.
35
+ */
36
+ async function verifyAndProject(body, pinnedPublicKeysBase64, network) {
37
+ const signed = await verifyManifest(body, pinnedPublicKeysBase64, network ? { network } : {});
38
+ if (!signed)
51
39
  return { current: null, generations: [], verified: false };
52
- }
53
- return { current, generations, verified: true };
40
+ return { current: signed.current, generations: signed.generations, verified: true };
54
41
  }
55
42
  /**
56
43
  * GET /apps/:appId — returns { appId, current, generations, issuedAt, publicKey, signature }.
57
44
  * We reconstruct the canonical payload (everything except `publicKey` +
58
45
  * `signature`) and verify against the pin list. `publicKey` in the response
59
- * is advisory only — it's the key the keeper claims to have signed with;
46
+ * is advisory only — it's the key the backend claims to have signed with;
60
47
  * the SDK never trusts it in place of a pin.
61
48
  */
62
49
  export async function fetchGenerationInfo(req) {
63
50
  const fetcher = req.fetcher ?? fetch;
64
- const resp = await fetcher(`${baseUrl(req.keeperUrl)}/apps/${encodeURIComponent(req.appId)}`, {
51
+ const resp = await fetcher(`${baseUrl(req.keeperUrl)}/apps/${encodeURIComponent(req.appId)}?network=${req.network}`, {
65
52
  method: 'GET',
66
53
  signal: req.signal,
67
54
  });
@@ -75,17 +62,17 @@ export async function fetchGenerationInfo(req) {
75
62
  catch {
76
63
  return { current: null, generations: [], verified: false };
77
64
  }
78
- return verifyAndProject(parseGenerationBody(body), req.pinnedPublicKeysBase64);
65
+ return verifyAndProject(body, req.pinnedPublicKeysBase64, req.network);
79
66
  }
80
67
  /**
81
68
  * GET /apps/by-address/:zkAppAddress — same signed payload as fetchGenerationInfo,
82
69
  * but keyed by an address the caller already has (direct-paste buys, renew on a
83
70
  * since-retired address). Buyers arriving without an appId would otherwise have
84
- * to trust the keeper's unsigned `/apps` list to bind their address to an appId
71
+ * to trust the backend's unsigned `/apps` list to bind their address to an appId
85
72
  * first — defeating the pin.
86
73
  *
87
74
  * Extra assertion beyond the appId flow: the queried address MUST appear in the
88
- * returned `generations[]`. Without this, a malicious keeper could return a
75
+ * returned `generations[]`. Without this, a malicious backend could return a
89
76
  * validly-signed payload for a DIFFERENT app in response to the query, and the
90
77
  * signature check alone wouldn't catch it.
91
78
  */
@@ -102,7 +89,7 @@ export async function fetchGenerationInfoByAddress(req) {
102
89
  catch {
103
90
  return { current: null, generations: [], verified: false };
104
91
  }
105
- const projected = await verifyAndProject(parseGenerationBody(body), req.pinnedPublicKeysBase64);
92
+ const projected = await verifyAndProject(body, req.pinnedPublicKeysBase64, req.network);
106
93
  if (!projected.verified)
107
94
  return projected;
108
95
  if (!projected.generations.some(g => g.zkAppAddress === req.zkAppAddress)) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generationClient.js","sourceRoot":"","sources":["../src/generationClient.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,oCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAyCrD,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,gBAAgB,CAC7B,IAAa,EACb,sBAAyC,EACzC,OAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9F,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,WAAgC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC3G,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,GAA2B;IACnE,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,KAAK,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,kBAAkB,CAAC,GAAG,CAAC,KAAK,C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AC,CAAC;IAC5D,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAAC,CAAC;IAErE,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,sBAAsB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxF,IAAI,CAAC,SAAS,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * holderSecret.ts — the permit holder's secret for anonymous proofs
3
+ * (see permitProof.ts). Light: no ZkProgram, so clients can derive it when
4
+ * applying without loading the proof.
5
+ */
6
+ import { Field } from 'o1js';
7
+ import { type PermitNetwork } from './permitMessages.js';
8
+ /** Tags for the holder secret's signed message and for the salt derived from it. */
9
+ export declare const HOLDER_SECRET_TAG: Field;
10
+ export declare const HOLDER_SALT_TAG: Field;
11
+ /** How many counter values recovery tries: one key rarely holds more permits in one registry. */
12
+ export declare const MAX_HOLDER_SECRETS = 16;
13
+ /**
14
+ * What the holder's wallet signs (a text signature, signMessage) to derive a
15
+ * secret: the registry's lineage, its network and a counter: 0 for the
16
+ * key's first permit in the registry, 1 for the next, and so on. The
17
+ * lineage is the registry's first generation's address (the keeper's
18
+ * `registry.lineage`; the address itself for a registry never redeployed),
19
+ * so a permit's secret stays the same when the registry moves to a new
20
+ * address. Readable in the wallet, and nothing needs to be kept: the holder
21
+ * re-derives the secret from the chain and the wallet alone (findHolderSecret).
22
+ */
23
+ export declare function holderSecretText(lineage: string, network: PermitNetwork, index: number): string;
24
+ /** The holder secret from the wallet's (deterministic) text signature over holderSecretText. */
25
+ export declare function holderSecretFromSignature(sig: {
26
+ field: string;
27
+ scalar: string;
28
+ }): Field;
29
+ /** The permit's salt: public to the keeper and the authority, and reveals nothing about the secret. */
30
+ export declare function saltFromHolderSecret(holderSecret: Field): Field;
31
+ type TextWallet = {
32
+ address: string;
33
+ signMessage(message: string): Promise<{
34
+ field: string;
35
+ scalar: string;
36
+ }>;
37
+ };
38
+ /** Derives the secret, salt and permit subject for counter `index` (one wallet signature). */
39
+ export declare function deriveHolderSecret(wallet: TextWallet, args: {
40
+ lineage: string;
41
+ network: PermitNetwork;
42
+ index: number;
43
+ }): Promise<{
44
+ secret: string;
45
+ salt: string;
46
+ subject: string;
47
+ index: number;
48
+ }>;
49
+ /**
50
+ * Recovers the secret of the permit `subject` held by this wallet: signs for
51
+ * counter 0, 1, 2… until one gives that subject (usually the first). Throws
52
+ * when none does: another wallet, or a permit issued before secrets were
53
+ * derived this way.
54
+ */
55
+ export declare function findHolderSecret(wallet: TextWallet, args: {
56
+ lineage: string;
57
+ network: PermitNetwork;
58
+ subject: string;
59
+ maxTries?: number;
60
+ }): Promise<{
61
+ secret: string;
62
+ index: number;
63
+ }>;
64
+ /**
65
+ * True when `holderSecret` belongs to the permit (subject = H(holderKey, salt(secret))).
66
+ * Check before proving, for a clear error instead of a failed proof.
67
+ */
68
+ export declare function holderSecretMatches(holderKey: string, subject: string, holderSecret: string): boolean;
69
+ export {};
70
+ //# sourceMappingURL=holderSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holderSecret.d.ts","sourceRoot":"","sources":["../src/holderSecret.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAuB,MAAM,MAAM,CAAC;AAClD,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA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,EAAE,MAAM,CAAA;CAAE,GACpF,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAM5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAErG"}
@@ -0,0 +1,76 @@
1
+ // Copyright (c) 2025-2026 zkLicensing project developers
2
+ // SPDX-License-Identifier: BUSL-1.1
3
+ /**
4
+ * holderSecret.ts — the permit holder's secret for anonymous proofs
5
+ * (see permitProof.ts). Light: no ZkProgram, so clients can derive it when
6
+ * applying without loading the proof.
7
+ */
8
+ import { Field, Poseidon, PublicKey } from 'o1js';
9
+ import { networkField, permitSubject } from './permitMessages.js';
10
+ /** Tags for the holder secret's signed message and for the salt derived from it. */
11
+ export const HOLDER_SECRET_TAG = Field([...'zkPermits/v1/holder-secret'].reduce((v, ch) => (v << 8n) | BigInt(ch.charCodeAt(0)), 0n));
12
+ export const HOLDER_SALT_TAG = Field([...'zkPermits/v1/holder-salt'].reduce((v, ch) => (v << 8n) | BigInt(ch.charCodeAt(0)), 0n));
13
+ /** How many counter values recovery tries: one key rarely holds more permits in one registry. */
14
+ export const MAX_HOLDER_SECRETS = 16;
15
+ /**
16
+ * What the holder's wallet signs (a text signature, signMessage) to derive a
17
+ * secret: the registry's lineage, its network and a counter: 0 for the
18
+ * key's first permit in the registry, 1 for the next, and so on. The
19
+ * lineage is the registry's first generation's address (the keeper's
20
+ * `registry.lineage`; the address itself for a registry never redeployed),
21
+ * so a permit's secret stays the same when the registry moves to a new
22
+ * address. Readable in the wallet, and nothing needs to be kept: the holder
23
+ * re-derives the secret from the chain and the wallet alone (findHolderSecret).
24
+ */
25
+ export function holderSecretText(lineage, network, index) {
26
+ if (!Number.isSafeInteger(index) || index < 0)
27
+ throw new Error('holder secret index must be a non-negative integer');
28
+ PublicKey.fromBase58(lineage);
29
+ networkField(network);
30
+ return [
31
+ 'zkPermits: recover my permit secret',
32
+ `registry: ${lineage}`,
33
+ `network: ${network}`,
34
+ `permit number: ${index}`,
35
+ 'Sign this only on zkLicensing pages: it lets the signer recognise this permit\'s anonymous proofs.',
36
+ ].join('\n');
37
+ }
38
+ /** The holder secret from the wallet's (deterministic) text signature over holderSecretText. */
39
+ export function holderSecretFromSignature(sig) {
40
+ const scalar = BigInt(sig.scalar);
41
+ const low = scalar & ((1n << 128n) - 1n);
42
+ return Poseidon.hash([HOLDER_SECRET_TAG, Field(BigInt(sig.field)), Field(scalar >> 128n), Field(low)]);
43
+ }
44
+ /** The permit's salt: public to the keeper and the authority, and reveals nothing about the secret. */
45
+ export function saltFromHolderSecret(holderSecret) {
46
+ return Poseidon.hash([HOLDER_SALT_TAG, holderSecret]);
47
+ }
48
+ /** Derives the secret, salt and permit subject for counter `index` (one wallet signature). */
49
+ export async function deriveHolderSecret(wallet, args) {
50
+ const signature = await wallet.signMessage(holderSecretText(args.lineage, args.network, args.index));
51
+ const secret = holderSecretFromSignature(signature);
52
+ const salt = saltFromHolderSecret(secret);
53
+ return { secret: secret.toString(), salt: salt.toString(), subject: permitSubject(PublicKey.fromBase58(wallet.address), salt).toString(), index: args.index };
54
+ }
55
+ /**
56
+ * Recovers the secret of the permit `subject` held by this wallet: signs for
57
+ * counter 0, 1, 2… until one gives that subject (usually the first). Throws
58
+ * when none does: another wallet, or a permit issued before secrets were
59
+ * derived this way.
60
+ */
61
+ export async function findHolderSecret(wallet, args) {
62
+ for (let index = 0; index < (args.maxTries ?? MAX_HOLDER_SECRETS); index++) {
63
+ const d = await deriveHolderSecret(wallet, { lineage: args.lineage, network: args.network, index });
64
+ if (d.subject === args.subject)
65
+ return { secret: d.secret, index };
66
+ }
67
+ throw new Error('This wallet derives no secret for this permit: is it the wallet the permit was applied for with, on this network?');
68
+ }
69
+ /**
70
+ * True when `holderSecret` belongs to the permit (subject = H(holderKey, salt(secret))).
71
+ * Check before proving, for a clear error instead of a failed proof.
72
+ */
73
+ export function holderSecretMatches(holderKey, subject, holderSecret) {
74
+ return permitSubject(PublicKey.fromBase58(holderKey), saltFromHolderSecret(Field(holderSecret))).toString() === subject;
75
+ }
76
+ //# sourceMappingURL=holderSecret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holderSecret.js","sourceRoot":"","sources":["../src/holderSecret.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,oCAAoC;AAEpC;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAEtF,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAU,KAAK,CAAC,CAAC,GAAG,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7I,MAAM,CAAC,MAAM,eAAe,GAAU,KAAK,CAAC,CAAC,GAAG,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAEzI,iGAAiG;AACjG,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,OAAsB,EAAE,KAAa;IACrF,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oDA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C,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;AAChK,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAkB,EAClB,IAAqF;IAErF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3E,MAAM,CAAC,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;IACrE,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mHAAmH,CAAC,CAAC;AACvI,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,OAAe,EAAE,YAAoB;IAC1F,OAAO,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC;AAC1H,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,60 +1,39 @@
1
1
  /**
2
2
  * verifyLicense — client SDK.
3
3
  *
4
- * Calls the keeper's GET /verify until the on-chain refund window for the
5
- * license has closed; from that point on returns from a local anchor and
6
- * never touches the network again. The refund-window decision is server-
7
- * side: the keeper returns `refundWindowClosed: boolean` on its /verify
8
- * response, computed from its own record of `purchaseSlot + REFUND_WINDOW_N`
9
- * against the on-chain `currentSlot`. The SDK gates anchor writes on that
10
- * boolean and never trusts a `purchaseSlot` supplied by the local proof
11
- * file, so a user who forges their proof metadata cannot force the offline
12
- * branch prematurely.
4
+ * Calls the licensing service's GET /verify until the on-chain refund
5
+ * window for the license has closed; from that point on returns from a
6
+ * local anchor and never touches the network again. The refund-window
7
+ * decision is server-side: the service returns `refundWindowClosed:
8
+ * boolean` on its /verify response, computed from its own record of
9
+ * `purchaseSlot + REFUND_WINDOW_N` against the on-chain `currentSlot`.
10
+ * The SDK gates anchor writes on that boolean and never trusts a
11
+ * `purchaseSlot` supplied by the local license file, so a user who forges
12
+ * their proof metadata cannot force the offline branch prematurely.
13
13
  *
14
14
  * Anchor purity: every field persisted in the Anchor derives from the
15
- * keeper's /verify response — `anchoredSlot`, `expirySlot`, `ownership`.
16
- * The only client-supplied input to the offline branch is
17
- * `proof.expirySlot`, used solely as the loadAnchor binding key. A
18
- * tampered proof file therefore never gets a wrong answer; it gets no
19
- * offline branch at all and falls through to the keeper on every call.
15
+ * service's /verify response — `anchoredSlot`, `expirySlot`. The only
16
+ * client-supplied input to the offline branch is `proof.expirySlot`,
17
+ * used solely as the loadAnchor binding key. A tampered license file
18
+ * therefore never gets a wrong answer; it gets no offline branch at all
19
+ * and falls through to the licensing service on every call.
20
20
  */
21
- import { REFUND_WINDOW_N, GRACE_PERIOD_N } from './contractInterface.js';
21
+ import { REFUND_WINDOW_N, GRACE_PERIOD_N } from './slotConstants.js';
22
22
  declare const MS_PER_SLOT = 90000;
23
+ export declare const DEFAULT_VERIFIER_URL = "https://zklicensing.com/api/verify";
23
24
  export interface Storage {
24
25
  getItem(key: string): string | null;
25
26
  setItem(key: string, value: string): void;
26
27
  }
27
- export interface ActivationRecord {
28
- token: string;
29
- expiresAt: number;
30
- secretHash?: string;
31
- }
32
- export declare function loadActivation(storage: Storage, zkAppAddress: string, licenseHash: string, nowMs?: number): ActivationRecord | null;
33
- export declare function saveActivation(storage: Storage, zkAppAddress: string, licenseHash: string, rec: ActivationRecord): void;
34
28
  export interface ProofInput {
35
29
  licenseHash: string;
36
30
  zkAppAddress: string;
37
31
  expirySlot: number;
38
- verifierUrl?: string;
39
32
  }
40
- /**
41
- * Callback that proves an OwnershipChallenge using a stored secretHash.
42
- * Callers wire this up with their own o1js + LicenseProof imports so the SDK
43
- * stays dependency-free for the verify-only path. Return value is the
44
- * `proof.toJSON()` payload the verifier's POST /respond expects.
45
- */
46
- export type TokenProver = (input: {
47
- licenseHash: string;
48
- nonce: string;
49
- secretHash: string;
50
- }) => Promise<unknown>;
51
33
  export interface VerifyOptions {
52
- verifierUrl?: string;
53
34
  storage?: Storage | null;
54
35
  fetcher?: typeof fetch;
55
36
  now?: () => number;
56
- prover?: TokenProver;
57
- secretHash?: string;
58
37
  }
59
38
  export interface VerifyResult {
60
39
  valid: boolean;
@@ -65,8 +44,29 @@ export interface VerifyResult {
65
44
  remainingDays: number;
66
45
  reason: string | null;
67
46
  source: 'offline' | 'chain';
68
- ownership: 'verified' | 'unverified';
69
47
  }
70
48
  export declare function verifyLicense(proof: ProofInput, options?: VerifyOptions): Promise<VerifyResult>;
71
49
  export { REFUND_WINDOW_N, GRACE_PERIOD_N, MS_PER_SLOT };
50
+ type BindClient = typeof import('./bindClient.js');
51
+ type UnbindClient = typeof import('./unbindClient.js');
52
+ type DeviceIdentityModule = typeof import('./deviceIdentity.js');
53
+ export declare function proveBind(...a: Parameters<BindClient['proveBind']>): ReturnType<BindClient['proveBind']>;
54
+ export declare function confirmBind(...a: Parameters<BindClient['confirmBind']>): ReturnType<BindClient['confirmBind']>;
55
+ export declare function pollBindStatus(...a: Parameters<BindClient['pollBindStatus']>): ReturnType<BindClient['pollBindStatus']>;
56
+ export declare function fetchBindingState(...a: Parameters<BindClient['fetchBindingState']>): ReturnType<BindClient['fetchBindingState']>;
57
+ export declare function proveUnbind(...a: Parameters<UnbindClient['proveUnbind']>): ReturnType<UnbindClient['proveUnbind']>;
58
+ export declare function confirmUnbind(...a: Parameters<UnbindClient['confirmUnbind']>): ReturnType<UnbindClient['confirmUnbind']>;
59
+ export declare function pollUnbindStatus(...a: Parameters<UnbindClient['pollUnbindStatus']>): ReturnType<UnbindClient['pollUnbindStatus']>;
60
+ export declare function getOrCreateDeviceIdentity(...a: Parameters<DeviceIdentityModule['getOrCreateDeviceIdentity']>): ReturnType<DeviceIdentityModule['getOrCreateDeviceIdentity']>;
61
+ export type { ProveBindRequest, ProveBindResponse, ConfirmBindRequest, BindStatus, PollBindStatusOptions, } from './bindClient.js';
62
+ export type { ProveUnbindRequest, ProveUnbindResponse, ConfirmUnbindRequest, UnbindStatus, PollUnbindStatusOptions, } from './unbindClient.js';
63
+ export type { DeviceIdentity } from './deviceIdentity.js';
64
+ export type { VerifyOfflineInput, VerifyOfflineResult, DeviceSlotSnapshot, } from './verifyOffline.js';
65
+ export { fetchOnChainLicensesRoot, DEFAULT_MINA_GRAPHQL_URLS } from './onChainRoot.js';
66
+ export type { FetchOnChainLicensesRootInput, NetworkName } from './onChainRoot.js';
67
+ export { licenseFileName, platformFeeNano, vendorShareNano } from './licenseRecord.js';
68
+ export { seatNameFor, SEAT_NAME_COMBINATIONS } from './seatName.js';
69
+ export type { SeatNameInput } from './seatName.js';
70
+ export { proveVendorRelease, confirmVendorRelease } from './releaseClient.js';
71
+ export type { ProveVendorReleaseRequest, ProveVendorReleaseResponse, ConfirmVendorReleaseRequest, ConfirmVendorReleaseResponse, } from './releaseClient.js';
72
72
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EAGf,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,WAAW,QAAgB,CAAC;AAOlC,eAAO,M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