@hazbase/simplicity 0.4.7 → 0.4.8

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.
package/README.md CHANGED
@@ -112,6 +112,7 @@ import {
112
112
  buildStrictPolicyWhitelist,
113
113
  deriveStrictPolicyHolderPosition,
114
114
  inspectStrictPolicyTransactionWithProofs,
115
+ normalizeStrictPolicyVerifierCovenantParams,
115
116
  prepareStrictPolicySnapshot,
116
117
  verifyStrictPolicySnapshot,
117
118
  } from "@hazbase/simplicity";
@@ -170,10 +171,33 @@ output zero and exposes three mutually exclusive paths:
170
171
  - governance: the authority signs a verifier-only transition to a reviewed
171
172
  successor contract, without moving any strict asset.
172
173
 
173
- The pilot bound is 16 inputs, 8 outputs, and 256 whitelist owners; larger
174
- transactions fail closed. The verifier parameters now require both
175
- `redemptionScriptHash` and `authorityXonly`, so callers must bind the vault and
176
- the authority explicitly when compiling a new verifier.
174
+ ### Verifier resource profiles
175
+
176
+ `strict_v2` is the default profile for the general strict-policy lifecycle. It
177
+ permits up to 16 transaction inputs, 8 outputs, and a 256-owner whitelist;
178
+ larger transactions fail closed.
179
+
180
+ `strict_v2_compact` is an explicit, tightly bounded profile for a controlled
181
+ two-owner lifecycle, such as issuer inventory to an approved holder. It permits
182
+ at most 3 inputs, 4 outputs, and 2 whitelist owners. It retains the complete
183
+ holder signature and whitelist checks while making the verifier witness small
184
+ enough for the bounded transaction shape. Do not use it for a secondary market,
185
+ additional intermediaries, or transactions that need more inputs, outputs, or
186
+ approved holders.
187
+
188
+ ```ts
189
+ const verifier = normalizeStrictPolicyVerifierCovenantParams({
190
+ assetId,
191
+ feeAssetId,
192
+ redemptionScriptHash,
193
+ authorityXonly,
194
+ resourceProfile: "strict_v2_compact",
195
+ });
196
+ ```
197
+
198
+ The verifier parameters require both `redemptionScriptHash` and
199
+ `authorityXonly`, so callers must bind the vault and the authority explicitly
200
+ when compiling a new verifier.
177
201
 
178
202
  `inspectStrictPolicyTransactionWithProofs(...)` is the recommended wallet API.
179
203
  It validates every strict output by index, verifies its owner proof, derives the
@@ -1,4 +1,5 @@
1
1
  import type { SimplicityArtifact, SimplicityClientConfig } from "../core/types";
2
+ import { type StrictPolicyVerifierResourceProfileId } from "./dampPolicy";
2
3
  export declare const STRICT_POLICY_SNAPSHOT_SCHEMA: "hazbase_strict_policy_snapshot_v1";
3
4
  export declare const STRICT_POLICY_SNAPSHOT_APPROVAL_SCHEMA: "hazbase_strict_policy_snapshot_approval_v1";
4
5
  export declare const STRICT_POLICY_SNAPSHOT_APPROVAL_DOMAIN: "HAZBASE-RWA-POLICY-SNAPSHOT-V1";
@@ -72,6 +73,7 @@ export interface StrictPolicyVerifierCovenantParams {
72
73
  whitelistRoot: string;
73
74
  redemptionScriptHash: string;
74
75
  authorityXonly: string;
76
+ resourceProfile?: StrictPolicyVerifierResourceProfileId;
75
77
  }
76
78
  export declare function normalizeStrictPolicySnapshotPayload(value: unknown): StrictPolicySnapshotPayload;
77
79
  export declare function normalizeStrictPolicySnapshotAuthority(value: unknown): StrictPolicySnapshotAuthority;
@@ -213,6 +213,7 @@ function normalizeStrictPolicyVerifierCovenantParams(value) {
213
213
  whitelistRoot: hexValue(record.whitelistRoot, "verifierCovenant.whitelistRoot", 32),
214
214
  redemptionScriptHash: hexValue(record.redemptionScriptHash, "verifierCovenant.redemptionScriptHash", 32),
215
215
  authorityXonly: hexValue(record.authorityXonly, "verifierCovenant.authorityXonly", 32),
216
+ resourceProfile: (0, dampPolicy_1.resolveStrictPolicyVerifierResourceProfile)(record.resourceProfile).id,
216
217
  };
217
218
  }
218
219
  function strictPolicyHolderCovenantTemplatePath() {
@@ -247,6 +248,7 @@ function strictPolicyVerifierCovenantTemplatePath() {
247
248
  function strictPolicyVerifierTemplateVars(value) {
248
249
  const params = normalizeStrictPolicyVerifierCovenantParams(value);
249
250
  const tagHashes = (0, dampPolicy_1.strictPolicyWhitelistTagHashes)();
251
+ const resourceProfile = (0, dampPolicy_1.resolveStrictPolicyVerifierResourceProfile)(params.resourceProfile);
250
252
  return {
251
253
  STRICT_ASSET_ID_JET_HEX: params.strictAssetIdJetHex,
252
254
  VERIFIER_ASSET_ID_JET_HEX: params.verifierAssetIdJetHex,
@@ -258,11 +260,11 @@ function strictPolicyVerifierTemplateVars(value) {
258
260
  AUTHORITY_XONLY: params.authorityXonly,
259
261
  WHITELIST_OWNER_TAG_HASH: tagHashes.owner,
260
262
  WHITELIST_NODE_TAG_HASH: tagHashes.node,
261
- WHITELIST_DEPTH: dampPolicy_1.STRICT_POLICY_WHITELIST_DEPTH,
262
- MAX_INPUTS: exports.STRICT_POLICY_VERIFIER_MAX_INPUTS,
263
- MAX_OUTPUTS: exports.STRICT_POLICY_VERIFIER_MAX_OUTPUTS,
264
- INPUT_UNIT_SLOTS: Array.from({ length: exports.STRICT_POLICY_VERIFIER_MAX_INPUTS }, () => "()").join(", "),
265
- OUTPUT_UNIT_SLOTS: Array.from({ length: exports.STRICT_POLICY_VERIFIER_MAX_OUTPUTS }, () => "()").join(", "),
263
+ WHITELIST_DEPTH: resourceProfile.whitelistDepth,
264
+ MAX_INPUTS: resourceProfile.maxInputs,
265
+ MAX_OUTPUTS: resourceProfile.maxOutputs,
266
+ INPUT_UNIT_SLOTS: Array.from({ length: resourceProfile.maxInputs }, () => "()").join(", "),
267
+ OUTPUT_UNIT_SLOTS: Array.from({ length: resourceProfile.maxOutputs }, () => "()").join(", "),
266
268
  };
267
269
  }
268
270
  async function renderStrictPolicyVerifierCovenantSource(value) {
@@ -1,5 +1,30 @@
1
1
  export declare const STRICT_POLICY_WHITELIST_DEPTH: 8;
2
2
  export declare const STRICT_POLICY_MAX_WHITELIST_OWNERS: number;
3
+ export declare const STRICT_POLICY_COMPACT_WHITELIST_DEPTH: 1;
4
+ export declare const STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS: number;
5
+ /**
6
+ * Consensus-visible resource bounds for strict verifier covenants. The
7
+ * compact profile is for the bounded one-position testnet lifecycle only;
8
+ * the general strict_v2 profile remains the default.
9
+ */
10
+ export declare const STRICT_POLICY_VERIFIER_RESOURCE_PROFILES: {
11
+ readonly strict_v2: {
12
+ readonly id: "strict_v2";
13
+ readonly maxInputs: 16;
14
+ readonly maxOutputs: 8;
15
+ readonly whitelistDepth: 8;
16
+ readonly maxWhitelistOwners: number;
17
+ };
18
+ readonly strict_v2_compact: {
19
+ readonly id: "strict_v2_compact";
20
+ readonly maxInputs: 3;
21
+ readonly maxOutputs: 4;
22
+ readonly whitelistDepth: 1;
23
+ readonly maxWhitelistOwners: number;
24
+ };
25
+ };
26
+ export type StrictPolicyVerifierResourceProfileId = keyof typeof STRICT_POLICY_VERIFIER_RESOURCE_PROFILES;
27
+ export type StrictPolicyVerifierResourceProfile = (typeof STRICT_POLICY_VERIFIER_RESOURCE_PROFILES)[StrictPolicyVerifierResourceProfileId];
3
28
  export declare const STRICT_POLICY_WHITELIST_OWNER_DOMAIN: "HAZBASE-RWA-STRICT-WHITELIST-OWNER-V1";
4
29
  export declare const STRICT_POLICY_WHITELIST_EMPTY_DOMAIN: "HAZBASE-RWA-STRICT-WHITELIST-EMPTY-V1";
5
30
  export declare const STRICT_POLICY_WHITELIST_NODE_DOMAIN: "HAZBASE-RWA-STRICT-WHITELIST-NODE-V1";
@@ -29,7 +54,7 @@ export interface StrictPolicyWhitelistEntry {
29
54
  proof: StrictPolicyWhitelistProofStep[];
30
55
  }
31
56
  export interface StrictPolicyWhitelist {
32
- depth: typeof STRICT_POLICY_WHITELIST_DEPTH;
57
+ depth: number;
33
58
  root: string;
34
59
  entries: StrictPolicyWhitelistEntry[];
35
60
  }
@@ -37,6 +62,7 @@ export interface StrictPolicyWhitelistProof {
37
62
  ownerXonly: string;
38
63
  proof: StrictPolicyWhitelistProofStep[];
39
64
  }
65
+ export declare function resolveStrictPolicyVerifierResourceProfile(value?: unknown): StrictPolicyVerifierResourceProfile;
40
66
  export declare function computeStrictPolicyHolderTapleafHash(holderProgramCmrValue: string): string;
41
67
  export declare function computeStrictPolicyOwnerTapDataHash(holderXonlyValue: string): string;
42
68
  export declare function computeElementsTapBranch(leftValue: string, rightValue: string): string;
@@ -44,15 +70,19 @@ export declare function deriveStrictPolicyHolderPosition(value: StrictPolicyHold
44
70
  export declare function computeStrictPolicyWhitelistOwnerLeaf(ownerXonlyValue: string): string;
45
71
  export declare function computeStrictPolicyWhitelistEmptyLeaf(): string;
46
72
  export declare function computeStrictPolicyWhitelistNode(leftValue: string, rightValue: string): string;
47
- export declare function buildStrictPolicyWhitelist(ownerXonlyValues: readonly string[]): StrictPolicyWhitelist;
73
+ export declare function buildStrictPolicyWhitelist(ownerXonlyValues: readonly string[], options?: {
74
+ depth?: number;
75
+ }): StrictPolicyWhitelist;
48
76
  export declare function verifyStrictPolicyWhitelistProof(input: {
49
77
  ownerXonly: string;
50
78
  proof: readonly StrictPolicyWhitelistProofStep[];
51
79
  expectedRoot: string;
80
+ depth?: number;
52
81
  }): boolean;
53
82
  export declare function normalizeStrictPolicyWhitelistProof(input: {
54
83
  ownerXonly: string;
55
84
  proof: readonly StrictPolicyWhitelistProofStep[];
85
+ depth?: number;
56
86
  }): StrictPolicyWhitelistProof;
57
87
  export declare function strictPolicyWhitelistTagHashes(): {
58
88
  owner: string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN = exports.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN = exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN = exports.STRICT_POLICY_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_WHITELIST_DEPTH = void 0;
3
+ exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN = exports.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN = exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN = exports.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES = exports.STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_COMPACT_WHITELIST_DEPTH = exports.STRICT_POLICY_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_WHITELIST_DEPTH = void 0;
4
+ exports.resolveStrictPolicyVerifierResourceProfile = resolveStrictPolicyVerifierResourceProfile;
4
5
  exports.computeStrictPolicyHolderTapleafHash = computeStrictPolicyHolderTapleafHash;
5
6
  exports.computeStrictPolicyOwnerTapDataHash = computeStrictPolicyOwnerTapDataHash;
6
7
  exports.computeElementsTapBranch = computeElementsTapBranch;
@@ -17,6 +18,29 @@ const errors_1 = require("../core/errors");
17
18
  const strictPolicyCrypto_1 = require("../core/strictPolicyCrypto");
18
19
  exports.STRICT_POLICY_WHITELIST_DEPTH = 8;
19
20
  exports.STRICT_POLICY_MAX_WHITELIST_OWNERS = 1 << exports.STRICT_POLICY_WHITELIST_DEPTH;
21
+ exports.STRICT_POLICY_COMPACT_WHITELIST_DEPTH = 1;
22
+ exports.STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS = 1 << exports.STRICT_POLICY_COMPACT_WHITELIST_DEPTH;
23
+ /**
24
+ * Consensus-visible resource bounds for strict verifier covenants. The
25
+ * compact profile is for the bounded one-position testnet lifecycle only;
26
+ * the general strict_v2 profile remains the default.
27
+ */
28
+ exports.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES = {
29
+ strict_v2: {
30
+ id: "strict_v2",
31
+ maxInputs: 16,
32
+ maxOutputs: 8,
33
+ whitelistDepth: exports.STRICT_POLICY_WHITELIST_DEPTH,
34
+ maxWhitelistOwners: exports.STRICT_POLICY_MAX_WHITELIST_OWNERS,
35
+ },
36
+ strict_v2_compact: {
37
+ id: "strict_v2_compact",
38
+ maxInputs: 3,
39
+ maxOutputs: 4,
40
+ whitelistDepth: exports.STRICT_POLICY_COMPACT_WHITELIST_DEPTH,
41
+ maxWhitelistOwners: exports.STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS,
42
+ },
43
+ };
20
44
  exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN = "HAZBASE-RWA-STRICT-WHITELIST-OWNER-V1";
21
45
  exports.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN = "HAZBASE-RWA-STRICT-WHITELIST-EMPTY-V1";
22
46
  exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN = "HAZBASE-RWA-STRICT-WHITELIST-NODE-V1";
@@ -26,6 +50,12 @@ function validationError(field, message) {
26
50
  field,
27
51
  });
28
52
  }
53
+ function resolveStrictPolicyVerifierResourceProfile(value = "strict_v2") {
54
+ if (typeof value !== "string" || !(value in exports.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES)) {
55
+ validationError("resourceProfile", "must be strict_v2 or strict_v2_compact");
56
+ }
57
+ return exports.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES[value];
58
+ }
29
59
  function hex32(value, field) {
30
60
  if (typeof value !== "string")
31
61
  validationError(field, "must be 32 bytes of hex");
@@ -121,12 +151,14 @@ function computeStrictPolicyWhitelistNode(leftValue, rightValue) {
121
151
  const right = hex32(rightValue, "right");
122
152
  return taggedHashHex(exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN, concat(bytes(left), bytes(right)));
123
153
  }
124
- function buildStrictPolicyWhitelist(ownerXonlyValues) {
154
+ function buildStrictPolicyWhitelist(ownerXonlyValues, options = {}) {
155
+ const depth = strictPolicyWhitelistDepth(options.depth);
156
+ const maxOwners = 1 << depth;
125
157
  if (!Array.isArray(ownerXonlyValues) || ownerXonlyValues.length === 0) {
126
158
  validationError("ownerXonlyValues", "must contain at least one owner");
127
159
  }
128
- if (ownerXonlyValues.length > exports.STRICT_POLICY_MAX_WHITELIST_OWNERS) {
129
- validationError("ownerXonlyValues", `must contain at most ${exports.STRICT_POLICY_MAX_WHITELIST_OWNERS} owners`);
160
+ if (ownerXonlyValues.length > maxOwners) {
161
+ validationError("ownerXonlyValues", `must contain at most ${maxOwners} owners`);
130
162
  }
131
163
  const owners = ownerXonlyValues
132
164
  .map((owner, index) => hex32(owner, `ownerXonlyValues[${index}]`))
@@ -135,10 +167,10 @@ function buildStrictPolicyWhitelist(ownerXonlyValues) {
135
167
  validationError("ownerXonlyValues", "must not contain duplicates");
136
168
  }
137
169
  const emptyLeaf = computeStrictPolicyWhitelistEmptyLeaf();
138
- const leaves = Array.from({ length: exports.STRICT_POLICY_MAX_WHITELIST_OWNERS }, (_, index) => (index < owners.length ? computeStrictPolicyWhitelistOwnerLeaf(owners[index]) : emptyLeaf));
170
+ const leaves = Array.from({ length: maxOwners }, (_, index) => (index < owners.length ? computeStrictPolicyWhitelistOwnerLeaf(owners[index]) : emptyLeaf));
139
171
  const levels = [leaves];
140
- for (let depth = 0; depth < exports.STRICT_POLICY_WHITELIST_DEPTH; depth += 1) {
141
- const current = levels[depth];
172
+ for (let level = 0; level < depth; level += 1) {
173
+ const current = levels[level];
142
174
  const next = [];
143
175
  for (let index = 0; index < current.length; index += 2) {
144
176
  next.push(computeStrictPolicyWhitelistNode(current[index], current[index + 1]));
@@ -148,11 +180,11 @@ function buildStrictPolicyWhitelist(ownerXonlyValues) {
148
180
  const entries = owners.map((ownerXonly, ownerIndex) => {
149
181
  const proof = [];
150
182
  let index = ownerIndex;
151
- for (let depth = 0; depth < exports.STRICT_POLICY_WHITELIST_DEPTH; depth += 1) {
183
+ for (let level = 0; level < depth; level += 1) {
152
184
  const siblingIndex = index ^ 1;
153
185
  proof.push({
154
186
  siblingPosition: siblingIndex < index ? "left" : "right",
155
- siblingHash: levels[depth][siblingIndex],
187
+ siblingHash: levels[level][siblingIndex],
156
188
  });
157
189
  index = Math.floor(index / 2);
158
190
  }
@@ -163,8 +195,8 @@ function buildStrictPolicyWhitelist(ownerXonlyValues) {
163
195
  };
164
196
  });
165
197
  return {
166
- depth: exports.STRICT_POLICY_WHITELIST_DEPTH,
167
- root: levels[exports.STRICT_POLICY_WHITELIST_DEPTH][0],
198
+ depth,
199
+ root: levels[depth][0],
168
200
  entries,
169
201
  };
170
202
  }
@@ -182,8 +214,9 @@ function verifyStrictPolicyWhitelistProof(input) {
182
214
  }
183
215
  function normalizeStrictPolicyWhitelistProof(input) {
184
216
  const ownerXonly = hex32(input.ownerXonly, "ownerXonly");
185
- if (!Array.isArray(input.proof) || input.proof.length !== exports.STRICT_POLICY_WHITELIST_DEPTH) {
186
- validationError("proof", `must contain exactly ${exports.STRICT_POLICY_WHITELIST_DEPTH} sibling hashes`);
217
+ const depth = strictPolicyWhitelistDepth(input.depth);
218
+ if (!Array.isArray(input.proof) || input.proof.length !== depth) {
219
+ validationError("proof", `must contain exactly ${depth} sibling hashes`);
187
220
  }
188
221
  const proof = input.proof.map((step, index) => {
189
222
  if (!step || typeof step !== "object") {
@@ -199,6 +232,14 @@ function normalizeStrictPolicyWhitelistProof(input) {
199
232
  });
200
233
  return { ownerXonly, proof };
201
234
  }
235
+ function strictPolicyWhitelistDepth(value) {
236
+ if (value === undefined)
237
+ return exports.STRICT_POLICY_WHITELIST_DEPTH;
238
+ if (!Number.isInteger(value) || value < 1 || value > exports.STRICT_POLICY_WHITELIST_DEPTH) {
239
+ validationError("depth", `must be an integer between 1 and ${exports.STRICT_POLICY_WHITELIST_DEPTH}`);
240
+ }
241
+ return value;
242
+ }
202
243
  function strictPolicyWhitelistTagHashes() {
203
244
  return {
204
245
  owner: sha256(Buffer.from(exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN, "utf8")).toString("hex"),
package/dist/index.d.ts CHANGED
@@ -25,8 +25,8 @@ export { configureStrictPolicyCrypto, } from "./core/strictPolicyCrypto";
25
25
  export type { StrictPolicyCryptoProvider, } from "./core/strictPolicyCrypto";
26
26
  export { STRICT_POLICY_SNAPSHOT_SCHEMA, STRICT_POLICY_SNAPSHOT_APPROVAL_SCHEMA, STRICT_POLICY_SNAPSHOT_APPROVAL_DOMAIN, STRICT_POLICY_AUTHORITY_SET_DOMAIN, STRICT_POLICY_VERIFIER_MAX_INPUTS, STRICT_POLICY_VERIFIER_MAX_OUTPUTS, normalizeStrictPolicySnapshotPayload, normalizeStrictPolicySnapshotAuthority, normalizeStrictPolicySnapshotApprovalProof, taggedHashHexUtf8, computeStrictPolicyAuthoritySetHash, normalizeStrictPolicyHolderCovenantParams, normalizeStrictPolicyVerifierCovenantParams, strictPolicyHolderCovenantTemplatePath, strictPolicyVerifierCovenantTemplatePath, renderStrictPolicyHolderCovenantSource, renderStrictPolicyVerifierCovenantSource, compileStrictPolicyHolderCovenant, compileStrictPolicyVerifierCovenant, prepareStrictPolicySnapshot, finalizeStrictPolicySnapshot, verifyStrictPolicySnapshot, } from "./domain/damp";
27
27
  export type { StrictPolicyNetwork, StrictPolicyVerifierReference, StrictPolicySnapshotPayload, StrictPolicySnapshotAuthority, StrictPolicySnapshotApprovalProof, PreparedStrictPolicySnapshot, StrictPolicySnapshotEnvelope, StrictPolicyHolderCovenantParams, StrictPolicyVerifierCovenantParams, } from "./domain/damp";
28
- export { STRICT_POLICY_WHITELIST_DEPTH, STRICT_POLICY_MAX_WHITELIST_OWNERS, STRICT_POLICY_WHITELIST_OWNER_DOMAIN, STRICT_POLICY_WHITELIST_EMPTY_DOMAIN, STRICT_POLICY_WHITELIST_NODE_DOMAIN, computeStrictPolicyHolderTapleafHash, computeStrictPolicyOwnerTapDataHash, computeElementsTapBranch, deriveStrictPolicyHolderPosition, computeStrictPolicyWhitelistOwnerLeaf, computeStrictPolicyWhitelistEmptyLeaf, computeStrictPolicyWhitelistNode, buildStrictPolicyWhitelist, normalizeStrictPolicyWhitelistProof, verifyStrictPolicyWhitelistProof, strictPolicyWhitelistTagHashes, } from "./domain/dampPolicy";
29
- export type { StrictPolicyHolderPositionParams, StrictPolicyHolderPosition, StrictPolicyWhitelistProofStep, StrictPolicyWhitelistProof, StrictPolicyWhitelistEntry, StrictPolicyWhitelist, } from "./domain/dampPolicy";
28
+ export { STRICT_POLICY_WHITELIST_DEPTH, STRICT_POLICY_MAX_WHITELIST_OWNERS, STRICT_POLICY_COMPACT_WHITELIST_DEPTH, STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS, STRICT_POLICY_VERIFIER_RESOURCE_PROFILES, STRICT_POLICY_WHITELIST_OWNER_DOMAIN, STRICT_POLICY_WHITELIST_EMPTY_DOMAIN, STRICT_POLICY_WHITELIST_NODE_DOMAIN, computeStrictPolicyHolderTapleafHash, computeStrictPolicyOwnerTapDataHash, computeElementsTapBranch, deriveStrictPolicyHolderPosition, computeStrictPolicyWhitelistOwnerLeaf, computeStrictPolicyWhitelistEmptyLeaf, computeStrictPolicyWhitelistNode, buildStrictPolicyWhitelist, normalizeStrictPolicyWhitelistProof, verifyStrictPolicyWhitelistProof, strictPolicyWhitelistTagHashes, resolveStrictPolicyVerifierResourceProfile, } from "./domain/dampPolicy";
29
+ export type { StrictPolicyHolderPositionParams, StrictPolicyHolderPosition, StrictPolicyWhitelistProofStep, StrictPolicyWhitelistProof, StrictPolicyWhitelistEntry, StrictPolicyWhitelist, StrictPolicyVerifierResourceProfile, StrictPolicyVerifierResourceProfileId, } from "./domain/dampPolicy";
30
30
  export { STRICT_POLICY_TRANSACTION_SUMMARY_SCHEMA, normalizeStrictPolicyDecodedTransaction, inspectStrictPolicyTransaction, inspectStrictPolicyTransactionWithProofs, } from "./domain/dampTransaction";
31
31
  export type { StrictPolicyOperation, StrictPolicyTransactionOutpoint, StrictPolicyDecodedInput, StrictPolicyDecodedOutput, StrictPolicyDecodedTransaction, StrictPolicyTransactionExpectation, StrictPolicyTransactionSummary, StrictPolicyTransactionInspection, StrictPolicyOutputAuthorization, StrictPolicyProofBackedTransactionExpectation, StrictPolicyVerifiedOutputAuthorization, StrictPolicyProofBackedTransactionInspection, } from "./domain/dampTransaction";
32
32
  export { STRICT_POLICY_PSET_INSPECTION_SCHEMA, normalizeStrictPolicyPsetInspection, inspectStrictPolicyPsetForSigning, } from "./domain/dampPset";
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ exports.signPositionReceipt = exports.verifyCapitalCall = exports.executeCapital
18
18
  exports.validateFundDefinition = exports.summarizeFundFinalityPayload = exports.summarizeFundClosingDescriptor = exports.summarizeDistributionDescriptor = exports.summarizeLPPositionReceipt = exports.summarizeCapitalCallState = exports.summarizeFundDefinition = exports.validateBondSettlementMatchesExpected = exports.validateBondSettlementDescriptor = exports.summarizeBondSettlementDescriptor = exports.verifyBondIssuanceHistory = exports.summarizeBondIssuanceState = exports.buildRedeemedBondIssuanceState = exports.validateBondStateTransition = exports.validateBondCrossChecks = exports.validateBondIssuanceState = exports.validateBondDefinition = exports.exportReceivableFinalityPayload = exports.exportReceivableEvidence = exports.verifyReceivableStateHistory = exports.verifyReceivableClosing = exports.prepareReceivableClosing = exports.verifyReceivableWriteOff = exports.prepareReceivableWriteOff = exports.verifyReceivableRepaymentClaim = exports.executeReceivableRepaymentClaim = exports.inspectReceivableRepaymentClaim = exports.prepareReceivableRepaymentClaim = exports.verifyReceivableRepayment = exports.prepareReceivableRepayment = exports.verifyReceivableFundingClaim = exports.executeReceivableFundingClaim = exports.inspectReceivableFundingClaim = exports.prepareReceivableFundingClaim = exports.verifyReceivableFunding = exports.prepareReceivableFunding = exports.loadReceivable = exports.verifyReceivable = exports.defineReceivable = exports.exportFundFinalityPayload = exports.exportFundEvidence = exports.verifyFundClosing = exports.prepareFundClosing = exports.verifyDistribution = exports.executeDistributionClaim = exports.inspectDistributionClaim = exports.reconcilePosition = exports.prepareDistribution = exports.verifyPositionReceiptChain = exports.verifyPositionReceipt = void 0;
19
19
  exports.inspectRwaDvpDeliveryClaim = exports.exportRwaDvpEvidence = exports.executeRwaDvpRefundClaim = exports.executeRwaDvpDeliveryClaim = exports.defineRwaDvpPurchase = exports.compileRwaDvpEscrowContract = exports.buildRwaDvpPaymentRequirements = exports.RWA_DVP_VERIFICATION_SCHEMA_VERSION = exports.RWA_DVP_REFUND_CLAIM_SCHEMA_VERSION = exports.RWA_DVP_PURCHASE_SCHEMA_VERSION = exports.RWA_DVP_EVIDENCE_SCHEMA_VERSION = exports.RWA_DVP_DELIVERY_CLAIM_SCHEMA_VERSION = exports.verifyReceivableStateHistoryValidation = exports.validateReceivableWriteOffTransition = exports.validateReceivableRepaymentTransition = exports.validateReceivableFundingTransition = exports.validateReceivableCrossChecks = exports.validateReceivableState = exports.validateReceivableRepaymentClaimDescriptor = exports.validateReceivableRepaymentClaimAgainstState = exports.validateReceivableFundingClaimDescriptor = exports.validateReceivableFundingClaimAgainstState = exports.validateReceivableDefinition = exports.validateReceivableClosingDescriptor = exports.validateReceivableClosingAgainstState = exports.summarizeReceivableState = exports.summarizeReceivableRepaymentClaimDescriptor = exports.summarizeReceivableFundingClaimDescriptor = exports.summarizeReceivableDefinition = exports.summarizeReceivableClosingDescriptor = exports.buildReceivableRepaymentClaimDescriptor = exports.buildReceivableFundingClaimDescriptor = exports.buildReceivableClosingDescriptor = exports.buildFundedReceivableState = exports.buildDefaultedReceivableState = exports.applyReceivableRepayment = exports.buildFundClosingDescriptor = exports.buildDistributionDescriptor = exports.applyDistributionsToReceipt = exports.applyDistributionToReceipt = exports.buildLPPositionReceipt = exports.buildRefundedCapitalCallState = exports.buildClaimedCapitalCallState = exports.validateClosingAgainstReceipt = exports.validateDistributionAgainstReceipt = exports.validateFundCrossChecks = exports.validateFundClosingDescriptor = exports.validateDistributionDescriptor = exports.validateLPPositionReceipt = exports.validateCapitalCallState = void 0;
20
20
  exports.verifyStrictPolicySnapshot = exports.finalizeStrictPolicySnapshot = exports.prepareStrictPolicySnapshot = exports.compileStrictPolicyVerifierCovenant = exports.compileStrictPolicyHolderCovenant = exports.renderStrictPolicyVerifierCovenantSource = exports.renderStrictPolicyHolderCovenantSource = exports.strictPolicyVerifierCovenantTemplatePath = exports.strictPolicyHolderCovenantTemplatePath = exports.normalizeStrictPolicyVerifierCovenantParams = exports.normalizeStrictPolicyHolderCovenantParams = exports.computeStrictPolicyAuthoritySetHash = exports.taggedHashHexUtf8 = exports.normalizeStrictPolicySnapshotApprovalProof = exports.normalizeStrictPolicySnapshotAuthority = exports.normalizeStrictPolicySnapshotPayload = exports.STRICT_POLICY_VERIFIER_MAX_OUTPUTS = exports.STRICT_POLICY_VERIFIER_MAX_INPUTS = exports.STRICT_POLICY_AUTHORITY_SET_DOMAIN = exports.STRICT_POLICY_SNAPSHOT_APPROVAL_DOMAIN = exports.STRICT_POLICY_SNAPSHOT_APPROVAL_SCHEMA = exports.STRICT_POLICY_SNAPSHOT_SCHEMA = exports.configureStrictPolicyCrypto = exports.validatePolicyTransferDescriptor = exports.validatePolicyOutputDescriptor = exports.validatePolicyState = exports.summarizePolicyTransferDescriptor = exports.summarizePolicyOutputDescriptor = exports.summarizePolicyState = exports.exportPolicyEvidence = exports.verifyTransfer = exports.verifyState = exports.inspectTransfer = exports.executeTransfer = exports.prepareTransfer = exports.issue = exports.validatePolicyTemplateParams = exports.describePolicyTemplate = exports.validatePolicyTemplateManifest = exports.loadPolicyTemplateManifest = exports.listPolicyTemplates = exports.buildPolicyOutputDescriptor = exports.compilePolicyStateContract = exports.verifyRwaDvpRefundClaim = exports.verifyRwaDvpPaymentPset = exports.verifyRwaDvpDeliveryClaim = exports.summarizeRwaDvpPurchase = exports.prepareRwaDvpRefundClaim = exports.prepareRwaDvpDeliveryClaim = exports.inspectRwaDvpRefundClaim = void 0;
21
- exports.inspectStrictPolicyPsetForSigning = exports.normalizeStrictPolicyPsetInspection = exports.STRICT_POLICY_PSET_INSPECTION_SCHEMA = exports.inspectStrictPolicyTransactionWithProofs = exports.inspectStrictPolicyTransaction = exports.normalizeStrictPolicyDecodedTransaction = exports.STRICT_POLICY_TRANSACTION_SUMMARY_SCHEMA = exports.strictPolicyWhitelistTagHashes = exports.verifyStrictPolicyWhitelistProof = exports.normalizeStrictPolicyWhitelistProof = exports.buildStrictPolicyWhitelist = exports.computeStrictPolicyWhitelistNode = exports.computeStrictPolicyWhitelistEmptyLeaf = exports.computeStrictPolicyWhitelistOwnerLeaf = exports.deriveStrictPolicyHolderPosition = exports.computeElementsTapBranch = exports.computeStrictPolicyOwnerTapDataHash = exports.computeStrictPolicyHolderTapleafHash = exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN = exports.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN = exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN = exports.STRICT_POLICY_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_WHITELIST_DEPTH = void 0;
21
+ exports.inspectStrictPolicyPsetForSigning = exports.normalizeStrictPolicyPsetInspection = exports.STRICT_POLICY_PSET_INSPECTION_SCHEMA = exports.inspectStrictPolicyTransactionWithProofs = exports.inspectStrictPolicyTransaction = exports.normalizeStrictPolicyDecodedTransaction = exports.STRICT_POLICY_TRANSACTION_SUMMARY_SCHEMA = exports.resolveStrictPolicyVerifierResourceProfile = exports.strictPolicyWhitelistTagHashes = exports.verifyStrictPolicyWhitelistProof = exports.normalizeStrictPolicyWhitelistProof = exports.buildStrictPolicyWhitelist = exports.computeStrictPolicyWhitelistNode = exports.computeStrictPolicyWhitelistEmptyLeaf = exports.computeStrictPolicyWhitelistOwnerLeaf = exports.deriveStrictPolicyHolderPosition = exports.computeElementsTapBranch = exports.computeStrictPolicyOwnerTapDataHash = exports.computeStrictPolicyHolderTapleafHash = exports.STRICT_POLICY_WHITELIST_NODE_DOMAIN = exports.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN = exports.STRICT_POLICY_WHITELIST_OWNER_DOMAIN = exports.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES = exports.STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_COMPACT_WHITELIST_DEPTH = exports.STRICT_POLICY_MAX_WHITELIST_OWNERS = exports.STRICT_POLICY_WHITELIST_DEPTH = void 0;
22
22
  var SimplicityClient_1 = require("./client/SimplicityClient");
23
23
  Object.defineProperty(exports, "createSimplicityClient", { enumerable: true, get: function () { return SimplicityClient_1.createSimplicityClient; } });
24
24
  Object.defineProperty(exports, "SimplicityClient", { enumerable: true, get: function () { return SimplicityClient_1.SimplicityClient; } });
@@ -246,6 +246,9 @@ Object.defineProperty(exports, "verifyStrictPolicySnapshot", { enumerable: true,
246
246
  var dampPolicy_1 = require("./domain/dampPolicy");
247
247
  Object.defineProperty(exports, "STRICT_POLICY_WHITELIST_DEPTH", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_WHITELIST_DEPTH; } });
248
248
  Object.defineProperty(exports, "STRICT_POLICY_MAX_WHITELIST_OWNERS", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_MAX_WHITELIST_OWNERS; } });
249
+ Object.defineProperty(exports, "STRICT_POLICY_COMPACT_WHITELIST_DEPTH", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_COMPACT_WHITELIST_DEPTH; } });
250
+ Object.defineProperty(exports, "STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_COMPACT_MAX_WHITELIST_OWNERS; } });
251
+ Object.defineProperty(exports, "STRICT_POLICY_VERIFIER_RESOURCE_PROFILES", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_VERIFIER_RESOURCE_PROFILES; } });
249
252
  Object.defineProperty(exports, "STRICT_POLICY_WHITELIST_OWNER_DOMAIN", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_WHITELIST_OWNER_DOMAIN; } });
250
253
  Object.defineProperty(exports, "STRICT_POLICY_WHITELIST_EMPTY_DOMAIN", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_WHITELIST_EMPTY_DOMAIN; } });
251
254
  Object.defineProperty(exports, "STRICT_POLICY_WHITELIST_NODE_DOMAIN", { enumerable: true, get: function () { return dampPolicy_1.STRICT_POLICY_WHITELIST_NODE_DOMAIN; } });
@@ -260,6 +263,7 @@ Object.defineProperty(exports, "buildStrictPolicyWhitelist", { enumerable: true,
260
263
  Object.defineProperty(exports, "normalizeStrictPolicyWhitelistProof", { enumerable: true, get: function () { return dampPolicy_1.normalizeStrictPolicyWhitelistProof; } });
261
264
  Object.defineProperty(exports, "verifyStrictPolicyWhitelistProof", { enumerable: true, get: function () { return dampPolicy_1.verifyStrictPolicyWhitelistProof; } });
262
265
  Object.defineProperty(exports, "strictPolicyWhitelistTagHashes", { enumerable: true, get: function () { return dampPolicy_1.strictPolicyWhitelistTagHashes; } });
266
+ Object.defineProperty(exports, "resolveStrictPolicyVerifierResourceProfile", { enumerable: true, get: function () { return dampPolicy_1.resolveStrictPolicyVerifierResourceProfile; } });
263
267
  var dampTransaction_1 = require("./domain/dampTransaction");
264
268
  Object.defineProperty(exports, "STRICT_POLICY_TRANSACTION_SUMMARY_SCHEMA", { enumerable: true, get: function () { return dampTransaction_1.STRICT_POLICY_TRANSACTION_SUMMARY_SCHEMA; } });
265
269
  Object.defineProperty(exports, "normalizeStrictPolicyDecodedTransaction", { enumerable: true, get: function () { return dampTransaction_1.normalizeStrictPolicyDecodedTransaction; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hazbase/simplicity",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "An SDK for Simplicity on Liquid",
5
5
  "author": "IndieSquare Inc <info@hazbase.com>",
6
6
  "keywords": [