@ottochain/sdk 2.2.5 → 2.4.0

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 (222) hide show
  1. package/dist/cjs/apps/contracts/index.js +15 -8
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +89 -46
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +152 -45
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +40 -8
  5. package/dist/cjs/apps/corporate/index.js +2 -2
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +169 -59
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +245 -47
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +407 -99
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +151 -37
  10. package/dist/cjs/apps/governance/index.js +14 -14
  11. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +85 -43
  12. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +73 -43
  13. package/dist/cjs/apps/governance/state-machines/dao-single.js +55 -14
  14. package/dist/cjs/apps/governance/state-machines/dao-token.js +103 -45
  15. package/dist/cjs/apps/governance/state-machines/governance-simple.js +129 -65
  16. package/dist/cjs/apps/governance/state-machines/governance-universal.js +29 -5
  17. package/dist/cjs/apps/identity/constants.js +55 -14
  18. package/dist/cjs/apps/identity/index.js +27 -11
  19. package/dist/cjs/apps/identity/state-machines/identity-agent.js +57 -9
  20. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +70 -27
  21. package/dist/cjs/apps/identity/state-machines/identity-registry.js +288 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-universal.js +30 -6
  23. package/dist/cjs/apps/identity/state-machines/index.js +3 -1
  24. package/dist/cjs/apps/index.js +19 -8
  25. package/dist/cjs/apps/lending/assets.js +223 -0
  26. package/dist/cjs/apps/lending/credit-scoring.js +87 -0
  27. package/dist/cjs/apps/lending/eligibility.js +121 -0
  28. package/dist/cjs/apps/lending/index.js +91 -0
  29. package/dist/cjs/apps/lending/state-machines/index.js +9 -0
  30. package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +412 -0
  31. package/dist/cjs/apps/markets/index.js +21 -11
  32. package/dist/cjs/apps/markets/state-machines/market-auction.js +44 -19
  33. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +54 -29
  34. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +53 -31
  35. package/dist/cjs/apps/markets/state-machines/market-prediction.js +120 -61
  36. package/dist/cjs/apps/markets/state-machines/market-universal.js +50 -10
  37. package/dist/cjs/apps/oracles/index.js +2 -2
  38. package/dist/cjs/errors.js +3 -3
  39. package/dist/cjs/generated/google/protobuf/struct.js +4 -4
  40. package/dist/cjs/generated/index.js +11 -7
  41. package/dist/cjs/generated/openapi.js +6 -0
  42. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +50 -50
  43. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +19 -20
  44. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +13 -13
  45. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +4 -4
  46. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +124 -130
  47. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +107 -107
  48. package/dist/cjs/generated/ottochain/v1/common.js +1722 -1
  49. package/dist/cjs/generated/ottochain/v1/fiber.js +355 -5
  50. package/dist/cjs/generated/ottochain/v1/messages.js +775 -3
  51. package/dist/cjs/generated/ottochain/v1/records.js +350 -3
  52. package/dist/cjs/index.js +45 -7
  53. package/dist/cjs/openapi.js +2 -0
  54. package/dist/cjs/ottochain/drop-nulls.js +1 -2
  55. package/dist/cjs/ottochain/genesis-manifest.js +193 -0
  56. package/dist/cjs/ottochain/index.js +27 -13
  57. package/dist/cjs/ottochain/metagraph-client.js +65 -8
  58. package/dist/cjs/ottochain/snapshot.js +11 -12
  59. package/dist/cjs/ottochain/transaction.js +57 -14
  60. package/dist/cjs/ottochain/types.js +19 -1
  61. package/dist/cjs/privacy/index.js +14 -0
  62. package/dist/cjs/privacy/sealed-bid.js +210 -0
  63. package/dist/cjs/privacy/shield-app.js +131 -0
  64. package/dist/cjs/schema/effects.js +40 -0
  65. package/dist/cjs/schema/fiber-app.js +19 -13
  66. package/dist/cjs/schema/guard-lint.js +352 -0
  67. package/dist/cjs/schema/guards.js +246 -0
  68. package/dist/cjs/signing.js +80 -0
  69. package/dist/cjs/types.js +2 -3
  70. package/dist/cjs/validation.js +8 -8
  71. package/dist/cjs/verify.js +9 -4
  72. package/dist/cjs/zk/commit.js +53 -0
  73. package/dist/cjs/zk/guard.js +107 -0
  74. package/dist/cjs/zk/index.js +48 -0
  75. package/dist/cjs/zk/preimage.js +37 -0
  76. package/dist/cjs/zk/prover.js +87 -0
  77. package/dist/cjs/zk/registry.js +62 -0
  78. package/dist/cjs/zk/types.js +28 -0
  79. package/dist/cjs/zk/witness.js +19 -0
  80. package/dist/esm/apps/contracts/index.js +7 -3
  81. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +89 -46
  82. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +152 -45
  83. package/dist/esm/apps/contracts/state-machines/contract-universal.js +40 -8
  84. package/dist/esm/apps/corporate/state-machines/corp-board.js +169 -59
  85. package/dist/esm/apps/corporate/state-machines/corp-entity.js +245 -47
  86. package/dist/esm/apps/corporate/state-machines/corp-securities.js +407 -99
  87. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +151 -37
  88. package/dist/esm/apps/governance/state-machines/dao-multisig.js +85 -43
  89. package/dist/esm/apps/governance/state-machines/dao-reputation.js +73 -43
  90. package/dist/esm/apps/governance/state-machines/dao-single.js +55 -14
  91. package/dist/esm/apps/governance/state-machines/dao-token.js +103 -45
  92. package/dist/esm/apps/governance/state-machines/governance-simple.js +129 -65
  93. package/dist/esm/apps/governance/state-machines/governance-universal.js +29 -5
  94. package/dist/esm/apps/identity/constants.js +51 -12
  95. package/dist/esm/apps/identity/index.js +12 -7
  96. package/dist/esm/apps/identity/state-machines/identity-agent.js +57 -9
  97. package/dist/esm/apps/identity/state-machines/identity-oracle.js +70 -27
  98. package/dist/esm/apps/identity/state-machines/identity-registry.js +285 -0
  99. package/dist/esm/apps/identity/state-machines/identity-universal.js +30 -6
  100. package/dist/esm/apps/identity/state-machines/index.js +1 -0
  101. package/dist/esm/apps/index.js +1 -0
  102. package/dist/esm/apps/lending/assets.js +207 -0
  103. package/dist/esm/apps/lending/credit-scoring.js +81 -0
  104. package/dist/esm/apps/lending/eligibility.js +115 -0
  105. package/dist/esm/apps/lending/index.js +69 -0
  106. package/dist/esm/apps/lending/state-machines/index.js +5 -0
  107. package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +409 -0
  108. package/dist/esm/apps/markets/index.js +8 -4
  109. package/dist/esm/apps/markets/state-machines/market-auction.js +44 -19
  110. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +54 -29
  111. package/dist/esm/apps/markets/state-machines/market-group-buy.js +53 -31
  112. package/dist/esm/apps/markets/state-machines/market-prediction.js +120 -61
  113. package/dist/esm/apps/markets/state-machines/market-universal.js +50 -10
  114. package/dist/esm/generated/index.js +9 -5
  115. package/dist/esm/generated/openapi.js +5 -0
  116. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +46 -46
  117. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +114 -120
  118. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +100 -100
  119. package/dist/esm/generated/ottochain/v1/common.js +1718 -0
  120. package/dist/esm/generated/ottochain/v1/fiber.js +351 -1
  121. package/dist/esm/generated/ottochain/v1/messages.js +774 -2
  122. package/dist/esm/generated/ottochain/v1/records.js +349 -2
  123. package/dist/esm/index.js +23 -2
  124. package/dist/esm/openapi.js +1 -0
  125. package/dist/esm/ottochain/genesis-manifest.js +189 -0
  126. package/dist/esm/ottochain/index.js +4 -3
  127. package/dist/esm/ottochain/metagraph-client.js +65 -8
  128. package/dist/esm/ottochain/snapshot.js +4 -4
  129. package/dist/esm/ottochain/transaction.js +43 -3
  130. package/dist/esm/ottochain/types.js +18 -0
  131. package/dist/esm/privacy/index.js +6 -0
  132. package/dist/esm/privacy/sealed-bid.js +206 -0
  133. package/dist/esm/privacy/shield-app.js +127 -0
  134. package/dist/esm/schema/effects.js +35 -0
  135. package/dist/esm/schema/fiber-app.js +13 -6
  136. package/dist/esm/schema/guard-lint.js +346 -0
  137. package/dist/esm/schema/guards.js +229 -0
  138. package/dist/esm/signing.js +74 -0
  139. package/dist/esm/verify.js +8 -2
  140. package/dist/esm/zk/commit.js +44 -0
  141. package/dist/esm/zk/guard.js +99 -0
  142. package/dist/esm/zk/index.js +19 -0
  143. package/dist/esm/zk/preimage.js +30 -0
  144. package/dist/esm/zk/prover.js +82 -0
  145. package/dist/esm/zk/registry.js +55 -0
  146. package/dist/esm/zk/types.js +25 -0
  147. package/dist/esm/zk/witness.js +15 -0
  148. package/dist/types/apps/contracts/index.d.ts +159 -227
  149. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +50 -101
  150. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +86 -120
  151. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +20 -4
  152. package/dist/types/apps/corporate/index.d.ts +1040 -304
  153. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +188 -52
  154. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +267 -62
  155. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +355 -131
  156. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +225 -53
  157. package/dist/types/apps/governance/index.d.ts +396 -417
  158. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +92 -95
  159. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +57 -69
  160. package/dist/types/apps/governance/state-machines/dao-single.d.ts +40 -50
  161. package/dist/types/apps/governance/state-machines/dao-token.d.ts +80 -53
  162. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +107 -121
  163. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +17 -5
  164. package/dist/types/apps/identity/constants.d.ts +32 -4
  165. package/dist/types/apps/identity/index.d.ts +449 -100
  166. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +30 -0
  167. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +41 -87
  168. package/dist/types/apps/identity/state-machines/identity-registry.d.ts +379 -0
  169. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +15 -0
  170. package/dist/types/apps/identity/state-machines/index.d.ts +1 -0
  171. package/dist/types/apps/index.d.ts +1 -0
  172. package/dist/types/apps/lending/assets.d.ts +258 -0
  173. package/dist/types/apps/lending/credit-scoring.d.ts +80 -0
  174. package/dist/types/apps/lending/eligibility.d.ts +83 -0
  175. package/dist/types/apps/lending/index.d.ts +548 -0
  176. package/dist/types/apps/lending/state-machines/index.d.ts +5 -0
  177. package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +528 -0
  178. package/dist/types/apps/markets/index.d.ts +184 -204
  179. package/dist/types/apps/markets/state-machines/market-auction.d.ts +25 -37
  180. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +26 -34
  181. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +31 -43
  182. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +67 -72
  183. package/dist/types/apps/markets/state-machines/market-universal.d.ts +30 -10
  184. package/dist/types/generated/index.d.ts +5 -5
  185. package/dist/types/generated/openapi.d.ts +1257 -0
  186. package/dist/types/generated/ottochain/apps/contracts/v1/contract.d.ts +5 -5
  187. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +12 -12
  188. package/dist/types/generated/ottochain/apps/markets/v1/market.d.ts +11 -11
  189. package/dist/types/generated/ottochain/v1/common.d.ts +228 -0
  190. package/dist/types/generated/ottochain/v1/fiber.d.ts +32 -1
  191. package/dist/types/generated/ottochain/v1/messages.d.ts +84 -0
  192. package/dist/types/generated/ottochain/v1/records.d.ts +34 -0
  193. package/dist/types/index.d.ts +8 -2
  194. package/dist/types/openapi.d.ts +22 -0
  195. package/dist/types/ottochain/genesis-manifest.d.ts +130 -0
  196. package/dist/types/ottochain/index.d.ts +6 -5
  197. package/dist/types/ottochain/metagraph-client.d.ts +49 -7
  198. package/dist/types/ottochain/snapshot.d.ts +6 -6
  199. package/dist/types/ottochain/transaction.d.ts +33 -1
  200. package/dist/types/ottochain/types.d.ts +602 -11
  201. package/dist/types/privacy/index.d.ts +6 -0
  202. package/dist/types/privacy/sealed-bid.d.ts +348 -0
  203. package/dist/types/privacy/shield-app.d.ts +48 -0
  204. package/dist/types/schema/effects.d.ts +34 -0
  205. package/dist/types/schema/fiber-app.d.ts +41 -3
  206. package/dist/types/schema/guard-lint.d.ts +111 -0
  207. package/dist/types/schema/guards.d.ts +134 -0
  208. package/dist/types/signing.d.ts +45 -0
  209. package/dist/types/validation.d.ts +22 -217
  210. package/dist/types/verify.d.ts +4 -0
  211. package/dist/types/zk/commit.d.ts +28 -0
  212. package/dist/types/zk/guard.d.ts +46 -0
  213. package/dist/types/zk/index.d.ts +19 -0
  214. package/dist/types/zk/preimage.d.ts +10 -0
  215. package/dist/types/zk/prover.d.ts +34 -0
  216. package/dist/types/zk/registry.d.ts +34 -0
  217. package/dist/types/zk/types.d.ts +33 -0
  218. package/dist/types/zk/witness.d.ts +40 -0
  219. package/package.json +52 -35
  220. package/dist/cjs/ottochain/normalize.js +0 -186
  221. package/dist/esm/ottochain/normalize.js +0 -179
  222. package/dist/types/ottochain/normalize.d.ts +0 -79
@@ -4,10 +4,12 @@
4
4
  * Re-exports from TypeScript definition files.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.identityUniversalDef = exports.identityOracleDef = exports.identityAgentDef = void 0;
7
+ exports.identityRegistryDef = exports.identityUniversalDef = exports.identityOracleDef = exports.identityAgentDef = void 0;
8
8
  var identity_agent_js_1 = require("./identity-agent.js");
9
9
  Object.defineProperty(exports, "identityAgentDef", { enumerable: true, get: function () { return identity_agent_js_1.identityAgentDef; } });
10
10
  var identity_oracle_js_1 = require("./identity-oracle.js");
11
11
  Object.defineProperty(exports, "identityOracleDef", { enumerable: true, get: function () { return identity_oracle_js_1.identityOracleDef; } });
12
12
  var identity_universal_js_1 = require("./identity-universal.js");
13
13
  Object.defineProperty(exports, "identityUniversalDef", { enumerable: true, get: function () { return identity_universal_js_1.identityUniversalDef; } });
14
+ var identity_registry_js_1 = require("./identity-registry.js");
15
+ Object.defineProperty(exports, "identityRegistryDef", { enumerable: true, get: function () { return identity_registry_js_1.identityRegistryDef; } });
@@ -43,18 +43,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
43
43
  }) : function(o, v) {
44
44
  o["default"] = v;
45
45
  });
46
- var __importStar = (this && this.__importStar) || function (mod) {
47
- if (mod && mod.__esModule) return mod;
48
- var result = {};
49
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
50
- __setModuleDefault(result, mod);
51
- return result;
52
- };
46
+ var __importStar = (this && this.__importStar) || (function () {
47
+ var ownKeys = function(o) {
48
+ ownKeys = Object.getOwnPropertyNames || function (o) {
49
+ var ar = [];
50
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
51
+ return ar;
52
+ };
53
+ return ownKeys(o);
54
+ };
55
+ return function (mod) {
56
+ if (mod && mod.__esModule) return mod;
57
+ var result = {};
58
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
59
+ __setModuleDefault(result, mod);
60
+ return result;
61
+ };
62
+ })();
53
63
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.corporate = exports.governance = exports.markets = exports.contracts = exports.identity = void 0;
64
+ exports.lending = exports.corporate = exports.governance = exports.markets = exports.contracts = exports.identity = void 0;
55
65
  // Re-export as namespaces for organized access
56
66
  exports.identity = __importStar(require("./identity/index.js"));
57
67
  exports.contracts = __importStar(require("./contracts/index.js"));
58
68
  exports.markets = __importStar(require("./markets/index.js"));
59
69
  exports.governance = __importStar(require("./governance/index.js"));
60
70
  exports.corporate = __importStar(require("./corporate/index.js"));
71
+ exports.lending = __importStar(require("./lending/index.js"));
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ /**
3
+ * Asset-subsystem integration for the lending family.
4
+ *
5
+ * The loan's collateral, principal/debt, and repayment are ASSETS. This module provides
6
+ * typed payload builders for the OttoChain asset operations and loan-specific helpers that
7
+ * map the zk-loan lifecycle onto typed asset morphisms.
8
+ *
9
+ * Wire shapes mirror the asset-model proposal
10
+ * (`/home/euler/repos/ottochain/docs/proposals/asset-model.md` §7 — `CreateAssetPolicy`,
11
+ * `MintAsset`, `ApplyMorphism`, `AuthorizeCompose`; §8 — Governed/ZkVerify-gated morphisms)
12
+ * and follow the SDK's existing single-key-wrapper convention (the discriminator is the outer
13
+ * key, e.g. `{ MintAsset: {...} }`), matching `src/ottochain/transaction.ts`
14
+ * (`createTransitionPayload`, `createScriptPayload`, ...). The asset op-codes are not yet a
15
+ * merged TypeScript SDK surface; these builders let the lending app construct the proposed
16
+ * wire format today and sign it with the existing `signTransaction` path.
17
+ *
18
+ * Amounts are `Long` on-chain; modeled here as `number` for SDK ergonomics (callers may pass a
19
+ * string for values beyond 2^53 — the field is serialized verbatim).
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.TokenBehaviors = exports.fiberHolder = exports.walletHolder = void 0;
23
+ exports.behaviorBits = behaviorBits;
24
+ exports.createAssetPolicyPayload = createAssetPolicyPayload;
25
+ exports.createMintAssetPayload = createMintAssetPayload;
26
+ exports.createApplyMorphismPayload = createApplyMorphismPayload;
27
+ exports.createAuthorizeComposePayload = createAuthorizeComposePayload;
28
+ exports.collateralPolicy = collateralPolicy;
29
+ exports.debtPolicy = debtPolicy;
30
+ exports.lockCollateralOp = lockCollateralOp;
31
+ exports.mintPrincipalOp = mintPrincipalOp;
32
+ exports.repayBurnOp = repayBurnOp;
33
+ exports.settleCollateralOp = settleCollateralOp;
34
+ /** Helpers for the two-variant holder. */
35
+ const walletHolder = (address) => ({ Wallet: { address } });
36
+ exports.walletHolder = walletHolder;
37
+ const fiberHolder = (fiberId) => ({ Fiber: { fiberId } });
38
+ exports.fiberHolder = fiberHolder;
39
+ /** Pack a {@link TokenBehavior} to its 5-bit integer (T=16 S=8 C=4 E=2 G=1). */
40
+ function behaviorBits(b) {
41
+ return ((b.transferable ? 16 : 0) |
42
+ (b.splittable ? 8 : 0) |
43
+ (b.combinable ? 4 : 0) |
44
+ (b.expirable ? 2 : 0) |
45
+ (b.governable ? 1 : 0));
46
+ }
47
+ /** Common behavior presets (asset-model.md §2). */
48
+ exports.TokenBehaviors = {
49
+ /** Non-transferable, non-divisible (bits 0). */
50
+ Soulbound: { transferable: false, splittable: false, combinable: false, expirable: false, governable: false },
51
+ /** Transferable only (bits 16). */
52
+ NFT: { transferable: true, splittable: false, combinable: false, expirable: false, governable: false },
53
+ /** Transferable + splittable + combinable (bits 28 = TSC). */
54
+ Fungible: { transferable: true, splittable: true, combinable: true, expirable: false, governable: false },
55
+ /** Fungible + governable (bits 29 = TSCG) — the default for a gated debt token. */
56
+ GovernedFungible: { transferable: true, splittable: true, combinable: true, expirable: false, governable: true },
57
+ };
58
+ /** Publish an asset policy package version. asset-model.md §7. */
59
+ function createAssetPolicyPayload(params) {
60
+ return {
61
+ CreateAssetPolicy: {
62
+ name: params.name,
63
+ version: params.version,
64
+ behavior: params.behavior,
65
+ supply: params.supply,
66
+ morphisms: params.morphisms,
67
+ stateShape: params.stateShape,
68
+ ...(params.metadata ? { metadata: params.metadata } : {}),
69
+ },
70
+ };
71
+ }
72
+ /**
73
+ * Mint an asset instance. asset-model.md §7. When the policy's `mintPolicy` is a
74
+ * `groth16_verify` guard (proof-gated mint), pass the eligibility `witness`.
75
+ */
76
+ function createMintAssetPayload(params) {
77
+ return {
78
+ MintAsset: {
79
+ assetId: params.assetId,
80
+ policyRef: params.policyRef,
81
+ holder: params.holder,
82
+ amount: params.amount,
83
+ ...(params.expiresAt !== undefined ? { expiresAt: params.expiresAt } : {}),
84
+ ...(params.witness ? { witness: params.witness } : {}),
85
+ },
86
+ };
87
+ }
88
+ /**
89
+ * Apply a typed morphism (Transfer / Burn / Compose / ...). asset-model.md §7.
90
+ * Transfer = `{ kind: "Transfer", recipient }`; Burn (repay) = `{ kind: "Burn" }`.
91
+ */
92
+ function createApplyMorphismPayload(params) {
93
+ return {
94
+ ApplyMorphism: {
95
+ assetId: params.assetId,
96
+ kind: params.kind,
97
+ targetSequenceNumber: params.targetSequenceNumber,
98
+ ...(params.recipient ? { recipient: params.recipient } : {}),
99
+ ...(params.otherAssets ? { otherAssets: params.otherAssets } : {}),
100
+ ...(params.compositeId ? { compositeId: params.compositeId } : {}),
101
+ ...(params.shardIds ? { shardIds: params.shardIds } : {}),
102
+ ...(params.nonce !== undefined ? { nonce: params.nonce } : {}),
103
+ ...(params.witness ? { witness: params.witness } : {}),
104
+ },
105
+ };
106
+ }
107
+ /** Commit half of a two-party compose. asset-model.md §7/§8. */
108
+ function createAuthorizeComposePayload(params) {
109
+ return {
110
+ AuthorizeCompose: {
111
+ assetId: params.assetId,
112
+ partnerPolicy: params.partnerPolicy,
113
+ nonce: params.nonce,
114
+ expiresAt: params.expiresAt,
115
+ targetSequenceNumber: params.targetSequenceNumber,
116
+ },
117
+ };
118
+ }
119
+ // ---------------------------------------------------------------------------
120
+ // Loan-specific asset policy builders
121
+ // ---------------------------------------------------------------------------
122
+ /**
123
+ * The collateral vault policy: an NFT-like custodial holding (no fungible split) whose
124
+ * `Transfer` morphism is Governed — the loan/escrow fiber is the authorization. Locking is
125
+ * a custody Transfer into `AssetHolder.Fiber(escrow)`; release/liquidation is a Transfer out
126
+ * driven by the loan fiber's REPAID / LIQUIDATED transition (`_transferAsset`).
127
+ */
128
+ function collateralPolicy(name = "collateral-vault-v1.asset", version = "1.0.0") {
129
+ return {
130
+ name,
131
+ version,
132
+ behavior: { transferable: true, splittable: false, combinable: false, expirable: false, governable: true },
133
+ supply: { maxSupply: null, mintPolicy: null, burnPolicy: null, decimals: 0 },
134
+ morphisms: {
135
+ Transfer: { visibility: "Governed" },
136
+ Burn: { visibility: "Disabled" },
137
+ Compose: { visibility: "Disabled" },
138
+ },
139
+ stateShape: {},
140
+ metadata: { family: "lending", role: "collateral" },
141
+ };
142
+ }
143
+ /**
144
+ * The loan-debt / principal policy: a governed fungible whose `mintPolicy` is the
145
+ * proof-gated origination guard — the principal is mintable to the borrower only when the
146
+ * eligibility proof verifies. Repayment is a `Burn` governed by `burnPolicy`.
147
+ *
148
+ * @param mintGuard the origination guard (see `buildOriginationGuard`) — a `groth16_verify`
149
+ * expression bound to the pinned public lending rule.
150
+ */
151
+ function debtPolicy(mintGuard, name = "loan-debt-v1.asset", version = "1.0.0") {
152
+ return {
153
+ name,
154
+ version,
155
+ behavior: exports.TokenBehaviors.GovernedFungible,
156
+ supply: {
157
+ maxSupply: null,
158
+ // Proof-gated mint: principal is minted only if the eligibility proof verifies.
159
+ mintPolicy: mintGuard,
160
+ // Repayment burns the debt; only the holder (borrower) may burn theirs. The asset context has
161
+ // no `event` key — bind to the verified `signers` (chain-derived from the op's proofs).
162
+ burnPolicy: { in: [{ var: "holder.Wallet.address" }, { var: "signers" }] },
163
+ decimals: 2,
164
+ },
165
+ morphisms: {
166
+ Transfer: { visibility: "Public" },
167
+ Burn: { visibility: "Public" },
168
+ },
169
+ stateShape: {},
170
+ metadata: { family: "lending", role: "debt" },
171
+ };
172
+ }
173
+ // ---------------------------------------------------------------------------
174
+ // Loan lifecycle → asset morphism drivers
175
+ // ---------------------------------------------------------------------------
176
+ /**
177
+ * lock_collateral: custody Transfer of the pledged collateral into the loan escrow fiber.
178
+ * (asset-model.md §10 — locking is a custody transfer to `AssetHolder.Fiber`, there is no
179
+ * `Lock` morphism.)
180
+ */
181
+ function lockCollateralOp(args) {
182
+ return createApplyMorphismPayload({
183
+ assetId: args.collateralAssetId,
184
+ kind: "Transfer",
185
+ recipient: (0, exports.fiberHolder)(args.escrowFiberId),
186
+ targetSequenceNumber: args.targetSequenceNumber,
187
+ });
188
+ }
189
+ /**
190
+ * originate: Mint the loan principal/debt to the borrower. The policy's `mintPolicy`
191
+ * (the origination guard) reads the eligibility `witness` ({publicValues, proof}).
192
+ */
193
+ function mintPrincipalOp(args) {
194
+ return createMintAssetPayload({
195
+ assetId: args.debtAssetId,
196
+ policyRef: args.debtPolicyRef,
197
+ holder: (0, exports.walletHolder)(args.borrower),
198
+ amount: args.principalAmount,
199
+ witness: args.witness,
200
+ });
201
+ }
202
+ /** repay: Burn the borrower's debt token (the principal is repaid). */
203
+ function repayBurnOp(args) {
204
+ return createApplyMorphismPayload({
205
+ assetId: args.debtAssetId,
206
+ kind: "Burn",
207
+ targetSequenceNumber: args.targetSequenceNumber,
208
+ });
209
+ }
210
+ /**
211
+ * release / liquidate: Transfer the escrowed collateral out of the escrow fiber to a
212
+ * recipient (the borrower on REPAID, the lender on LIQUIDATED). On-chain this is emitted by
213
+ * the loan fiber's transition via `_transferAsset`; this builder produces the equivalent
214
+ * explicit `ApplyMorphism(Transfer)` for off-fiber/manual settlement.
215
+ */
216
+ function settleCollateralOp(args) {
217
+ return createApplyMorphismPayload({
218
+ assetId: args.collateralAssetId,
219
+ kind: "Transfer",
220
+ recipient: (0, exports.walletHolder)(args.recipient),
221
+ targetSequenceNumber: args.targetSequenceNumber,
222
+ });
223
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reputationScore = reputationScore;
4
+ exports.reputationCreditRule = reputationCreditRule;
5
+ exports.buildCreditDataContext = buildCreditDataContext;
6
+ exports.reputationAuthorityClause = reputationAuthorityClause;
7
+ /**
8
+ * Credit scoring via the identity + reputation app.
9
+ *
10
+ * A zk-loan's `creditScore` is NOT a self-asserted number — it is the borrower's on-chain identity
11
+ * REPUTATION, derived from their {@link Attestation} deltas (the identity app's reputation model:
12
+ * `baseReputation + Σ delta`, floored at `minReputation`). This module is the wire between the two
13
+ * apps: it computes the reputation-backed score, pins a lending rule that BINDS the score to a
14
+ * specific borrower identity (so a borrower cannot prove eligibility against someone else's
15
+ * reputation), and assembles the PRIVATE data context the borrower proves it over.
16
+ *
17
+ * Privacy boundary: the exact `creditScore` and `collateralValue` stay private (their keccak is the
18
+ * proof's `dataHash`); the `subject` (borrower identity) and the bounds are PUBLIC (pinned in the
19
+ * rule's `logicHash`). The zk proof attests "borrower X's reputation-backed score ≥ floor and
20
+ * collateral coverage ≥ ratio" without revealing the score or the holdings.
21
+ *
22
+ * Trust model: the proof binds the score to the borrower's identity, but the borrower supplies the
23
+ * score value. When reputation attestations are PUBLIC on-chain, a verifier can independently
24
+ * recompute the score and check the proof used it; when reputation is PRIVATE (off-chain / held
25
+ * credentials) the score is genuinely hidden. To make the score AUTHORITY-attested in zero knowledge
26
+ * (the strongest form), have the SP1 rule additionally `schnorr_verify` the reputation issuer's
27
+ * signature over `(subject, score)` — see {@link reputationAuthorityClause}.
28
+ */
29
+ const index_js_1 = require("../identity/index.js");
30
+ const eligibility_js_1 = require("./eligibility.js");
31
+ /**
32
+ * Derive an agent's credit score from their identity reputation attestations:
33
+ * `baseReputation + Σ attestation.delta`, floored at `minReputation`. This IS the integration point —
34
+ * a zk-loan's creditScore is the borrower's identity reputation, not an independent number.
35
+ */
36
+ function reputationScore(attestations, config = index_js_1.DEFAULT_REPUTATION_CONFIG) {
37
+ const raw = attestations.reduce((sum, a) => sum + (a.delta ?? 0), config.baseReputation);
38
+ return Math.max(config.minReputation, raw);
39
+ }
40
+ /**
41
+ * The PUBLIC reputation-credit lending rule. Extends {@link lendingRule} (collateral coverage +
42
+ * optional credit-score floor) with a SUBJECT binding `subject === borrowerId`, so the proven score
43
+ * belongs to a specific identity — a borrower cannot prove eligibility against another agent's
44
+ * reputation. `borrowerId` and all bounds are literals, so pinning the rule pins them.
45
+ */
46
+ function reputationCreditRule(params) {
47
+ const base = (0, eligibility_js_1.lendingRule)(params); // coverage, or {and:[coverage, creditScore floor]}
48
+ const subjectBound = { "===": [{ var: "subject" }, params.borrowerId] };
49
+ const clauses = "and" in base ? base.and : [base];
50
+ return { and: [...clauses, subjectBound] };
51
+ }
52
+ /**
53
+ * Assemble the PRIVATE data context the borrower feeds to the zk-jlvm prover: the `creditScore` is
54
+ * their identity {@link reputationScore}, the `subject` is their identity. Only its keccak (`dataHash`)
55
+ * becomes public.
56
+ */
57
+ function buildCreditDataContext(args) {
58
+ return {
59
+ collateralValue: args.collateralValue,
60
+ creditScore: reputationScore(args.attestations, args.config ?? index_js_1.DEFAULT_REPUTATION_CONFIG),
61
+ subject: args.borrowerId,
62
+ };
63
+ }
64
+ /**
65
+ * OPTIONAL hardening — an authority-attested credit clause. ANDed into a rule, it makes the SP1 guest
66
+ * verify (in zero knowledge) the reputation issuer's Schnorr signature over the score, so the score is
67
+ * not merely borrower-supplied but ATTESTED.
68
+ *
69
+ * SECURITY: the authority's `authorityPubKey` MUST be a LITERAL pinned in the rule (it is part of the
70
+ * rule's keccak `logicHash`, so pinning it binds it) — NEVER read from the borrower's witness/private
71
+ * data, or the borrower could supply their own keypair and self-attest any score. Only the signature
72
+ * `repSig` and the signed `scoreCommit` ride on the (private) witness; the signature binds them to the
73
+ * pinned key. `scoreCommit` should commit the pinned `subject` + the proof's `dataHash` so a signature
74
+ * cannot be replayed for a different borrower/score.
75
+ *
76
+ * NOTE: producing a real signature + proof is required to exercise this end-to-end; the builder pins
77
+ * the structure so the on-chain rule and the prover agree. See the JLVM `schnorr_verify` opcode.
78
+ */
79
+ function reputationAuthorityClause(authorityPubKey) {
80
+ return {
81
+ schnorr_verify: [
82
+ authorityPubKey, // the reputation authority's public key — PINNED literal, not witness-supplied
83
+ { var: "scoreCommit" }, // the signed message: a commitment over (subject, creditScore)
84
+ { var: "repSig" }, // the authority's signature over scoreCommit
85
+ ],
86
+ };
87
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lendingRule = lendingRule;
4
+ exports.pinLendingRule = pinLendingRule;
5
+ exports.buildOriginationGuard = buildOriginationGuard;
6
+ exports.buildEligibilityWitness = buildEligibilityWitness;
7
+ /**
8
+ * The eligibility-proof model for the zk-loan: pin a PUBLIC lending rule, build the
9
+ * semi-private origination guard that gates it, and construct the witness the guard reads.
10
+ *
11
+ * The borrower proves in zero-knowledge that their PRIVATE financials satisfy the PUBLIC
12
+ * lending rule — without revealing them. The rule (with its literal bounds) is canonicalized
13
+ * and keccak-hashed into a `logicHash`; the proof commits that same `exprHash`, so binding
14
+ * `exprHash == logicHash` pins exactly WHICH rule was proven. See `src/zk` and
15
+ * `/home/euler/repos/ottochain/docs/proposals/asset-model.md` §8 (ZkVerify-gated morphisms).
16
+ */
17
+ const index_js_1 = require("../../zk/index.js");
18
+ /**
19
+ * The PUBLIC lending rule, as a JSON-Logic predicate over the borrower's PRIVATE data context
20
+ * `{ collateralValue, creditScore }`. Evaluates to `true` iff the borrower is eligible:
21
+ *
22
+ * collateralValue * 100 >= loanAmount * collateralRatioPct (collateral coverage)
23
+ * AND creditScore >= minCreditScore (if a floor is set)
24
+ *
25
+ * Only the predicate and its literal bounds are public; the data it is evaluated over
26
+ * (`collateralValue`, `creditScore`) is the prover's private witness — its keccak is the
27
+ * proof's `dataHash`, never revealed. This is the rule the zk-jlvm guest runs; its `exprHash`
28
+ * is pinned as the loan's `lendingRuleLogicHash`.
29
+ */
30
+ function lendingRule(params) {
31
+ const coverage = {
32
+ ">=": [
33
+ { "*": [{ var: "collateralValue" }, 100] },
34
+ params.loanAmount * params.collateralRatioPct,
35
+ ],
36
+ };
37
+ if (params.minCreditScore === undefined) {
38
+ return coverage;
39
+ }
40
+ return {
41
+ and: [
42
+ coverage,
43
+ { ">=": [{ var: "creditScore" }, params.minCreditScore] },
44
+ ],
45
+ };
46
+ }
47
+ /**
48
+ * Pin a lending rule: produce the public rule plus the three constants the loan's origination
49
+ * guard binds against. `vkey` is the verifying key of the SP1 zk-jlvm program that runs the
50
+ * rule (supplied by the lender / deployment).
51
+ */
52
+ function pinLendingRule(params, vkey) {
53
+ const rule = lendingRule(params);
54
+ return {
55
+ rule,
56
+ logicHash: (0, index_js_1.exprHash)(rule),
57
+ keccakTrue: index_js_1.KECCAK_TRUE,
58
+ vkey,
59
+ };
60
+ }
61
+ /**
62
+ * Build the semi-private ORIGINATION guard expression.
63
+ *
64
+ * It verifies the SP1-Groth16 eligibility proof AND binds its committed public values to the
65
+ * pinned public rule. `publicValues = abi_encode(JlvmPublicValues{exprHash|dataHash|outputHash|ok})`
66
+ * is opaque to `groth16_verify`; the guard slices the `0x`-hex form with native JLVM `substr`
67
+ * (start, len) and re-`cat`s the `0x` prefix — there is no `jlvm_pv_decode` opcode. Clauses:
68
+ *
69
+ * 1. `groth16_verify(vkey, witness.publicValues, witness.proof)` — the proof is valid
70
+ * 2. `exprHash == logicHash` (word 0, hex chars [2,66)) — it proved THE pinned rule
71
+ * 3. `outputHash == keccakTrue` (word 2, hex chars [130,194)) — the rule evaluated to true
72
+ * 4. `ok == "01"` (word 3 final pair, [256,258)) — the JLVM run did not error
73
+ *
74
+ * This is the closed boolean an asset `mintPolicy` or a fiber-transition guard wraps. The
75
+ * lending state machine ANDs clause 0 (`agent == lender`) in front of it; the debt asset
76
+ * policy uses it directly as the proof-gated `mintPolicy`.
77
+ */
78
+ function buildOriginationGuard(refs = {}) {
79
+ const vkeyVar = refs.vkeyVar ?? "state.lendingRuleVKey";
80
+ const logicHashVar = refs.logicHashVar ?? "state.lendingRuleLogicHash";
81
+ const keccakTrueVar = refs.keccakTrueVar ?? "state.keccakTrue";
82
+ return {
83
+ and: [
84
+ {
85
+ groth16_verify: [
86
+ { var: vkeyVar },
87
+ { var: "witness.publicValues" },
88
+ { var: "witness.proof" },
89
+ ],
90
+ },
91
+ {
92
+ "===": [
93
+ { cat: ["0x", { substr: [{ var: "witness.publicValues" }, 2, 64] }] },
94
+ { var: logicHashVar },
95
+ ],
96
+ },
97
+ {
98
+ "===": [
99
+ { cat: ["0x", { substr: [{ var: "witness.publicValues" }, 130, 64] }] },
100
+ { var: keccakTrueVar },
101
+ ],
102
+ },
103
+ {
104
+ "===": [{ substr: [{ var: "witness.publicValues" }, 256, 2] }, "01"],
105
+ },
106
+ ],
107
+ };
108
+ }
109
+ /**
110
+ * Construct the eligibility-proof witness the origination guard reads. The `{publicValues,
111
+ * proof}` come from the SP1 zk-jlvm prover (`--mode groth16`) run over the public rule and the
112
+ * borrower's PRIVATE data context. Both are lowercase `0x`-hex; they are exposed to the guard
113
+ * under the reserved `witness` key (on the loan `originate` event payload, or on a proof-gated
114
+ * `MintAsset`).
115
+ */
116
+ function buildEligibilityWitness(bundle) {
117
+ return {
118
+ publicValues: bundle.publicValues,
119
+ proof: bundle.proof,
120
+ };
121
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /**
3
+ * Lending Application — privacy-preserving credit & lending on OttoChain.
4
+ *
5
+ * The lending family hosts private-finance fibers whose financial state stays private while
6
+ * eligibility is proven in zero-knowledge. The collateral, principal, and repayment are
7
+ * asset-subsystem tokens driven by the fiber lifecycle.
8
+ *
9
+ * Variants:
10
+ * - `zkLoan` — a collateralized loan whose origination is gated by a zk eligibility proof
11
+ * (collateral coverage / credit-score floor) without revealing the borrower's financials.
12
+ *
13
+ * The name `lending` (vs. `loans`) deliberately generalizes for the future credit family —
14
+ * credit lines, BNPL, bonds, escrowed credit — mirroring how `markets` hosts prediction /
15
+ * auction / crowdfund variants under one app.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * import {
20
+ * getLendingDefinition,
21
+ * pinLendingRule,
22
+ * buildOriginationGuard,
23
+ * buildEligibilityWitness,
24
+ * debtPolicy,
25
+ * collateralPolicy,
26
+ * } from '@ottochain/sdk/apps/lending';
27
+ *
28
+ * const loanDef = getLendingDefinition('zkLoan');
29
+ *
30
+ * // Pin the public rule + build the proof-gated origination guard.
31
+ * const pinned = pinLendingRule({ collateralRatioPct: 150, loanAmount: 1000, minCreditScore: 680 }, vkey);
32
+ * const guard = buildOriginationGuard();
33
+ * const debt = debtPolicy(guard);
34
+ * ```
35
+ *
36
+ * @packageDocumentation
37
+ */
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.settleCollateralOp = exports.repayBurnOp = exports.mintPrincipalOp = exports.lockCollateralOp = exports.debtPolicy = exports.collateralPolicy = exports.createAuthorizeComposePayload = exports.createApplyMorphismPayload = exports.createMintAssetPayload = exports.createAssetPolicyPayload = exports.TokenBehaviors = exports.behaviorBits = exports.fiberHolder = exports.walletHolder = exports.reputationAuthorityClause = exports.buildCreditDataContext = exports.reputationCreditRule = exports.reputationScore = exports.buildEligibilityWitness = exports.buildOriginationGuard = exports.pinLendingRule = exports.lendingRule = exports.LENDING_DEFINITIONS = exports.lendingZkLoanDef = void 0;
40
+ exports.getLendingDefinition = getLendingDefinition;
41
+ const index_js_1 = require("./state-machines/index.js");
42
+ Object.defineProperty(exports, "lendingZkLoanDef", { enumerable: true, get: function () { return index_js_1.lendingZkLoanDef; } });
43
+ /** All lending state machine definitions. */
44
+ exports.LENDING_DEFINITIONS = {
45
+ zkLoan: index_js_1.lendingZkLoanDef,
46
+ };
47
+ /**
48
+ * Get a lending state machine definition by type.
49
+ * @param type - 'zkLoan' (default: 'zkLoan')
50
+ */
51
+ function getLendingDefinition(type = "zkLoan") {
52
+ return exports.LENDING_DEFINITIONS[type];
53
+ }
54
+ // ---------------------------------------------------------------------------
55
+ // Eligibility-proof model (the semi-private gate)
56
+ // ---------------------------------------------------------------------------
57
+ var eligibility_js_1 = require("./eligibility.js");
58
+ Object.defineProperty(exports, "lendingRule", { enumerable: true, get: function () { return eligibility_js_1.lendingRule; } });
59
+ Object.defineProperty(exports, "pinLendingRule", { enumerable: true, get: function () { return eligibility_js_1.pinLendingRule; } });
60
+ Object.defineProperty(exports, "buildOriginationGuard", { enumerable: true, get: function () { return eligibility_js_1.buildOriginationGuard; } });
61
+ Object.defineProperty(exports, "buildEligibilityWitness", { enumerable: true, get: function () { return eligibility_js_1.buildEligibilityWitness; } });
62
+ // ---------------------------------------------------------------------------
63
+ // Credit scoring via the identity + reputation app (the creditScore IS reputation)
64
+ // ---------------------------------------------------------------------------
65
+ var credit_scoring_js_1 = require("./credit-scoring.js");
66
+ Object.defineProperty(exports, "reputationScore", { enumerable: true, get: function () { return credit_scoring_js_1.reputationScore; } });
67
+ Object.defineProperty(exports, "reputationCreditRule", { enumerable: true, get: function () { return credit_scoring_js_1.reputationCreditRule; } });
68
+ Object.defineProperty(exports, "buildCreditDataContext", { enumerable: true, get: function () { return credit_scoring_js_1.buildCreditDataContext; } });
69
+ Object.defineProperty(exports, "reputationAuthorityClause", { enumerable: true, get: function () { return credit_scoring_js_1.reputationAuthorityClause; } });
70
+ // ---------------------------------------------------------------------------
71
+ // Asset-subsystem integration (collateral, debt/principal, repayment morphisms)
72
+ // ---------------------------------------------------------------------------
73
+ var assets_js_1 = require("./assets.js");
74
+ // value types
75
+ Object.defineProperty(exports, "walletHolder", { enumerable: true, get: function () { return assets_js_1.walletHolder; } });
76
+ Object.defineProperty(exports, "fiberHolder", { enumerable: true, get: function () { return assets_js_1.fiberHolder; } });
77
+ Object.defineProperty(exports, "behaviorBits", { enumerable: true, get: function () { return assets_js_1.behaviorBits; } });
78
+ Object.defineProperty(exports, "TokenBehaviors", { enumerable: true, get: function () { return assets_js_1.TokenBehaviors; } });
79
+ // op payload builders
80
+ Object.defineProperty(exports, "createAssetPolicyPayload", { enumerable: true, get: function () { return assets_js_1.createAssetPolicyPayload; } });
81
+ Object.defineProperty(exports, "createMintAssetPayload", { enumerable: true, get: function () { return assets_js_1.createMintAssetPayload; } });
82
+ Object.defineProperty(exports, "createApplyMorphismPayload", { enumerable: true, get: function () { return assets_js_1.createApplyMorphismPayload; } });
83
+ Object.defineProperty(exports, "createAuthorizeComposePayload", { enumerable: true, get: function () { return assets_js_1.createAuthorizeComposePayload; } });
84
+ // loan policy builders
85
+ Object.defineProperty(exports, "collateralPolicy", { enumerable: true, get: function () { return assets_js_1.collateralPolicy; } });
86
+ Object.defineProperty(exports, "debtPolicy", { enumerable: true, get: function () { return assets_js_1.debtPolicy; } });
87
+ // lifecycle → morphism drivers
88
+ Object.defineProperty(exports, "lockCollateralOp", { enumerable: true, get: function () { return assets_js_1.lockCollateralOp; } });
89
+ Object.defineProperty(exports, "mintPrincipalOp", { enumerable: true, get: function () { return assets_js_1.mintPrincipalOp; } });
90
+ Object.defineProperty(exports, "repayBurnOp", { enumerable: true, get: function () { return assets_js_1.repayBurnOp; } });
91
+ Object.defineProperty(exports, "settleCollateralOp", { enumerable: true, get: function () { return assets_js_1.settleCollateralOp; } });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lendingZkLoanDef = void 0;
4
+ /**
5
+ * Lending state machine definitions.
6
+ * Re-exports from TypeScript definition files.
7
+ */
8
+ var lending_zk_loan_js_1 = require("./lending-zk-loan.js");
9
+ Object.defineProperty(exports, "lendingZkLoanDef", { enumerable: true, get: function () { return lending_zk_loan_js_1.lendingZkLoanDef; } });