@ocap/tx-pipeline 1.31.5 → 1.31.6

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 (57) hide show
  1. package/esm/bridge-release-keys.d.mts +17 -1
  2. package/esm/bridge-release-keys.mjs +35 -20
  3. package/esm/bridge-reserves.d.mts +48 -9
  4. package/esm/bridge-reserves.mjs +66 -16
  5. package/esm/helpers/bridge-withdraw.d.mts +22 -38
  6. package/esm/helpers/bridge-withdraw.mjs +57 -77
  7. package/esm/helpers/replay-guard.d.mts +29 -12
  8. package/esm/helpers/replay-guard.mjs +68 -22
  9. package/esm/index.d.mts +3 -3
  10. package/esm/index.mjs +3 -3
  11. package/esm/legacy-protocol-sunset.d.mts +35 -21
  12. package/esm/legacy-protocol-sunset.mjs +124 -70
  13. package/esm/legacy-rollup-archive.d.mts +44 -7
  14. package/esm/legacy-rollup-archive.mjs +78 -13
  15. package/esm/library.d.mts +3 -3
  16. package/esm/library.mjs +3 -3
  17. package/esm/pipes/bridge-release-gate.d.mts +3 -2
  18. package/esm/pipes/bridge-release-gate.mjs +90 -35
  19. package/esm/pipes/bridge-reserve-v2-gate.d.mts +2 -0
  20. package/esm/pipes/bridge-reserve-v2-gate.mjs +31 -13
  21. package/esm/pipes/decode-tx.mjs +1 -1
  22. package/esm/pipes/post-execution-invariant-gate.mjs +5 -4
  23. package/esm/pipes/pre-flight-waf.mjs +6 -3
  24. package/esm/pipes/verify-multisig-v2.mjs +1 -1
  25. package/esm/pipes/verify-multisig.mjs +1 -1
  26. package/esm/pipes/verify-tx-size.mjs +8 -2
  27. package/esm/pipes/verify-tx.mjs +1 -1
  28. package/esm/transaction-block.mjs +11 -0
  29. package/lib/bridge-release-keys.cjs +35 -18
  30. package/lib/bridge-release-keys.d.cts +17 -1
  31. package/lib/bridge-reserves.cjs +73 -18
  32. package/lib/bridge-reserves.d.cts +48 -9
  33. package/lib/helpers/bridge-withdraw.cjs +60 -80
  34. package/lib/helpers/bridge-withdraw.d.cts +22 -38
  35. package/lib/helpers/replay-guard.cjs +64 -17
  36. package/lib/helpers/replay-guard.d.cts +29 -12
  37. package/lib/index.cjs +2 -2
  38. package/lib/index.d.cts +3 -3
  39. package/lib/legacy-protocol-sunset.cjs +122 -69
  40. package/lib/legacy-protocol-sunset.d.cts +35 -21
  41. package/lib/legacy-rollup-archive.cjs +82 -14
  42. package/lib/legacy-rollup-archive.d.cts +44 -7
  43. package/lib/library.cjs +1 -2
  44. package/lib/library.d.cts +3 -3
  45. package/lib/pipes/bridge-release-gate.cjs +89 -33
  46. package/lib/pipes/bridge-release-gate.d.cts +3 -2
  47. package/lib/pipes/bridge-reserve-v2-gate.cjs +30 -12
  48. package/lib/pipes/bridge-reserve-v2-gate.d.cts +2 -0
  49. package/lib/pipes/decode-tx.cjs +1 -1
  50. package/lib/pipes/post-execution-invariant-gate.cjs +3 -2
  51. package/lib/pipes/pre-flight-waf.cjs +6 -3
  52. package/lib/pipes/verify-multisig-v2.cjs +1 -1
  53. package/lib/pipes/verify-multisig.cjs +1 -1
  54. package/lib/pipes/verify-tx-size.cjs +8 -2
  55. package/lib/pipes/verify-tx.cjs +1 -1
  56. package/lib/transaction-block.cjs +11 -0
  57. package/package.json +10 -10
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
2
  let _ocap_mcrypto = require("@ocap/mcrypto");
3
3
  let _ocap_util_lib_error = require("@ocap/util/lib/error");
4
+ let _ocap_state = require("@ocap/state");
4
5
 
5
6
  //#region src/legacy-rollup-archive.ts
6
7
  /**
@@ -14,7 +15,6 @@ const ErrorCode = {
14
15
  ForbiddenBridge: "FORBIDDEN_EVM_SIMPLIFIED_BRIDGE"
15
16
  };
16
17
  const DEFAULT_MAX_ROLLUP_BLOCK_SIZE = 256;
17
- const DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT = 1;
18
18
  const DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS = Object.freeze([
19
19
  "fg:t:create_rollup",
20
20
  "fg:t:update_rollup",
@@ -25,6 +25,60 @@ const DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS = Object.freeze([
25
25
  "fg:t:pause_rollup",
26
26
  "fg:t:resume_rollup"
27
27
  ]);
28
+ /**
29
+ * #1720 (S4b): the branch of a tx whose `itx.rollup` names `rollupRow`, derived exactly as the protocols do
30
+ * (`peekBridgeFailClosed` -> `rollup.isBridgeV2(row)`, `data.value.version == 2`). No row is the v1 branch: the
31
+ * protocols refuse a bridge kind on a v1 row or on no row.
32
+ */
33
+ function rollupBranchOf(rollupRow, itx) {
34
+ return {
35
+ isBridgeV2: _ocap_state.rollup.isBridgeV2(rollupRow),
36
+ itx: itx ?? null
37
+ };
38
+ }
39
+ /**
40
+ * #1720 (S4b): the branch information every guard call must carry. Missing or malformed is a programming error, never a
41
+ * default: allowing would skip the sunset, treating it as v1 would turn the bridge off once a guard is wired (§7.1, M-5).
42
+ */
43
+ function assertRollupBranchInfo(branch) {
44
+ if (!branch || typeof branch !== "object" || typeof branch.isBridgeV2 !== "boolean") throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: branch information must be { isBridgeV2: boolean, itx? }");
45
+ }
46
+ /** #1720 (S4b): the guards take no blockHeight (CHAIN_DESIGN §1 item 2); a caller still passing one is refused. */
47
+ const REMOVED_BLOCK_HEIGHT_KEYS = [
48
+ "currentBlockHeight",
49
+ "sunsetActivationHeight",
50
+ "rollupSunsetActivationHeight"
51
+ ];
52
+ function assertNoBlockHeightParams(params, label) {
53
+ if (!params || typeof params !== "object") return;
54
+ const stale = REMOVED_BLOCK_HEIGHT_KEYS.filter((k) => Object.prototype.hasOwnProperty.call(params, k));
55
+ if (stale.length) throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, `${label}: blockHeight parameters were removed (${stale.join(", ")}); there is no blockHeight on chain`);
56
+ }
57
+ /** Rollup governance types a v2 bridge uses (ocap-protocols.md §v2.2): bridge governance when the row is v2. */
58
+ const BRIDGE_GOVERNANCE_TYPE_URLS = new Set([
59
+ "fg:t:create_rollup",
60
+ "fg:t:update_rollup",
61
+ "fg:t:join_rollup",
62
+ "fg:t:leave_rollup",
63
+ "fg:t:pause_rollup",
64
+ "fg:t:resume_rollup"
65
+ ]);
66
+ const BRIDGE_RELEASE_KINDS = new Set([
67
+ 1,
68
+ 2,
69
+ 3
70
+ ]);
71
+ /**
72
+ * Whether a tx of `canonicalTypeUrl` (`fg:t:...`) with `branch` is the bridge branch: a deposit with a bridge kind on a
73
+ * v2 row, a withdraw on a v2 row, or bridge governance on a v2 row. Both keys must agree for a deposit (the protocol
74
+ * refuses any other pairing). Throws on malformed branch information (a programming error, never a default).
75
+ */
76
+ function isBridgeBranch(canonicalTypeUrl, branch) {
77
+ assertRollupBranchInfo(branch);
78
+ if (!branch.isBridgeV2) return false;
79
+ if (canonicalTypeUrl === "fg:t:deposit_token_v2") return BRIDGE_RELEASE_KINDS.has(branch.itx?.kind);
80
+ return canonicalTypeUrl === "fg:t:withdraw_token_v2" || BRIDGE_GOVERNANCE_TYPE_URLS.has(canonicalTypeUrl);
81
+ }
28
82
  const ZERO_BYTES32_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000";
29
83
  const BYTES32_HEX_REGEX = /^0x[0-9a-fA-F]{64}$/;
30
84
  const CANONICAL_UINT256_DECIMAL_REGEX = /^(0|[1-9]\d{0,77})$/;
@@ -93,21 +147,22 @@ function isDeprecatedRollupWriteProtocol(typeUrl) {
93
147
  /**
94
148
  * Issue #1245:
95
149
  * Sunset guard for active transaction pipeline execution:
96
- * - Blocks all 8 deprecated Rollup write protocols when `currentBlockHeight >= rollupSunsetActivationHeight`.
97
- * - Allows historical block replay when `currentBlockHeight < rollupSunsetActivationHeight`.
150
+ * - Blocks all 8 deprecated Rollup write protocols of the v1 branch.
151
+ * - Allows historical block replay when `readOnlyArchiveMode === true`.
152
+ *
153
+ * #1720 (S4b, bridge/docs/deposit-withdraw-v2-unification.md §7.1): `branch` is required (missing throws) and the
154
+ * blockHeight parameters are gone (CHAIN_DESIGN §1 item 2): the switch is whether the guard is wired, plus
155
+ * `readOnlyArchiveMode` for replay. Governance of a v2 bridge is bridge governance, never sunset.
98
156
  */
99
157
  function assertRollupProtocolNotSunset(params) {
100
158
  if (!params || typeof params !== "object") throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: sunset guard params must be an object");
159
+ assertNoBlockHeightParams(params, "SimplifiedEvmBridge");
101
160
  if (typeof params.typeUrl !== "string" || params.typeUrl.trim().length === 0) throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: typeUrl must be a non-empty string");
102
- if (!Number.isSafeInteger(params.currentBlockHeight) || params.currentBlockHeight < 0) throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: currentBlockHeight must be a non-negative safe integer");
103
- const activationHeight = params.rollupSunsetActivationHeight ?? DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT;
104
- if (!Number.isSafeInteger(activationHeight) || activationHeight < 1) throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: rollupSunsetActivationHeight must be a positive safe integer (>= 1)");
161
+ assertRollupBranchInfo(params.branch);
105
162
  if (isDeprecatedRollupWriteProtocol(params.typeUrl)) {
106
- if (params.currentBlockHeight >= activationHeight) {
107
- const canonicalTypeUrl = normalizeRollupProtocolTypeUrl(params.typeUrl);
108
- throw new _ocap_util_lib_error.CustomError(ErrorCode.ForbiddenBridge, `SimplifiedEvmBridge: legacy Rollup write protocol ${canonicalTypeUrl} is deprecated and disabled at block height ${params.currentBlockHeight} (>= sunset height ${activationHeight}); use Zero-Rollup-Block EIP-712 DirectWithdrawVoucher instead`);
109
- }
110
- return;
163
+ const canonicalTypeUrl = normalizeRollupProtocolTypeUrl(params.typeUrl);
164
+ if (params.readOnlyArchiveMode === true || isBridgeBranch(canonicalTypeUrl, params.branch)) return;
165
+ throw new _ocap_util_lib_error.CustomError(ErrorCode.ForbiddenBridge, `SimplifiedEvmBridge: legacy Rollup write protocol ${canonicalTypeUrl} is deprecated and disabled; use Zero-Rollup-Block EIP-712 DirectWithdrawVoucher instead`);
111
166
  }
112
167
  assertCleanString(params.typeUrl, "typeUrl");
113
168
  }
@@ -117,11 +172,19 @@ function assertRollupProtocolNotSunset(params) {
117
172
  * and `withdraw_token_v2` records so block explorers, indexers, and audit tools can inspect historical
118
173
  * chain data after the active Rollup write protocols are removed.
119
174
  */
120
- function parseLegacyRollupReadOnlyRecord(rawRecord) {
175
+ function parseLegacyRollupReadOnlyRecord(rawRecord, branch) {
176
+ assertRollupBranchInfo(branch);
121
177
  if (!rawRecord || typeof rawRecord !== "object" || Array.isArray(rawRecord)) throw new _ocap_util_lib_error.CustomError(ErrorCode.InvalidBridge, "SimplifiedEvmBridge: legacy Rollup record must be a plain object");
122
178
  if (Object.prototype.hasOwnProperty.call(rawRecord, "__proto__") || Object.prototype.hasOwnProperty.call(rawRecord, "constructor") || Object.prototype.hasOwnProperty.call(rawRecord, "prototype")) throw new _ocap_util_lib_error.CustomError(ErrorCode.ForbiddenBridge, "SimplifiedEvmBridge: prototype pollution keys rejected in legacy Rollup record");
123
179
  const rawKind = String(rawRecord.recordKind ?? rawRecord.typeUrl ?? "").trim();
124
180
  const normalizedKind = rawKind.startsWith("fg:t:") ? rawKind.slice(5) : rawKind;
181
+ if (branch.isBridgeV2 && [
182
+ "RollupState",
183
+ "RollupBlock",
184
+ "create_rollup_block",
185
+ "deposit_token_v2",
186
+ "withdraw_token_v2"
187
+ ].includes(normalizedKind)) throw new _ocap_util_lib_error.CustomError(ErrorCode.ForbiddenBridge, `SimplifiedEvmBridge: ${normalizedKind} of the bridge branch (v2 bridge) is not a legacy Rollup record`);
125
188
  if (normalizedKind === "RollupState") {
126
189
  const rollupAddress = assertCleanString(String(rawRecord.rollupAddress ?? rawRecord.address ?? ""), "rollupAddress");
127
190
  const tokenAddress = assertCleanString(String(rawRecord.tokenAddress ?? ""), "tokenAddress");
@@ -175,6 +238,8 @@ function parseLegacyRollupReadOnlyRecord(rawRecord) {
175
238
  });
176
239
  }
177
240
  if (normalizedKind === "deposit_token_v2" || normalizedKind === "withdraw_token_v2") {
241
+ const kind = rawRecord.kind ?? rawRecord.itx?.kind ?? branch.itx?.kind;
242
+ if (rawRecord.isBridgeV2 === true || normalizedKind === "deposit_token_v2" && kind !== void 0 && kind !== null && kind !== 0 && kind !== "0") throw new _ocap_util_lib_error.CustomError(ErrorCode.ForbiddenBridge, `SimplifiedEvmBridge: ${normalizedKind} of the bridge branch (kind ${String(kind ?? "-")}, v2 bridge) is not a legacy Rollup record`);
178
243
  const rollupAddress = assertCleanString(String(rawRecord.rollupAddress ?? rawRecord.rollup ?? ""), "rollupAddress");
179
244
  const tokenAddress = assertCleanString(String(rawRecord.tokenAddress ?? ""), "tokenAddress");
180
245
  const fromDid = rawRecord.fromDid ? assertCleanString(String(rawRecord.fromDid), "fromDid") : void 0;
@@ -198,11 +263,14 @@ function parseLegacyRollupReadOnlyRecord(rawRecord) {
198
263
 
199
264
  //#endregion
200
265
  exports.DEFAULT_MAX_ROLLUP_BLOCK_SIZE = DEFAULT_MAX_ROLLUP_BLOCK_SIZE;
201
- exports.DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT = DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT;
202
266
  exports.DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS = DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS;
203
267
  exports.ZERO_BYTES32_HASH = ZERO_BYTES32_HASH;
268
+ exports.assertNoBlockHeightParams = assertNoBlockHeightParams;
269
+ exports.assertRollupBranchInfo = assertRollupBranchInfo;
204
270
  exports.assertRollupProtocolNotSunset = assertRollupProtocolNotSunset;
205
271
  exports.computeEvmBridgeBlockHash = computeEvmBridgeBlockHash;
206
272
  exports.computeEvmBridgeTxsHash = computeEvmBridgeTxsHash;
273
+ exports.isBridgeBranch = isBridgeBranch;
207
274
  exports.isDeprecatedRollupWriteProtocol = isDeprecatedRollupWriteProtocol;
208
- exports.parseLegacyRollupReadOnlyRecord = parseLegacyRollupReadOnlyRecord;
275
+ exports.parseLegacyRollupReadOnlyRecord = parseLegacyRollupReadOnlyRecord;
276
+ exports.rollupBranchOf = rollupBranchOf;
@@ -1,7 +1,40 @@
1
1
  //#region src/legacy-rollup-archive.d.ts
2
2
  declare const DEFAULT_MAX_ROLLUP_BLOCK_SIZE = 256;
3
- declare const DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT = 1;
4
3
  declare const DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS: readonly ["fg:t:create_rollup", "fg:t:update_rollup", "fg:t:join_rollup", "fg:t:leave_rollup", "fg:t:create_rollup_block", "fg:t:claim_block_reward", "fg:t:pause_rollup", "fg:t:resume_rollup"];
4
+ /**
5
+ * Branch information of a `deposit_token_v2` / `withdraw_token_v2` / rollup governance tx (#1692,
6
+ * bridge/docs/deposit-withdraw-v2-unification.md §7.1): whether the row `itx.rollup` names is a v2 bridge, and the itx
7
+ * (a deposit is a bridge release only with `kind ∈ {1,2,3}`). The bridge branch reuses the tx type names but none of
8
+ * the retired rollup-block mechanism, so it is never sunset and never archived as a legacy rollup record.
9
+ */
10
+ interface RollupBranchInfo {
11
+ isBridgeV2: boolean;
12
+ itx?: Record<string, unknown> | null;
13
+ }
14
+ /**
15
+ * #1720 (S4b): resolves the branch of one statement / record (`{ typeUrl | type, itx, ... }`) for the statement-level
16
+ * helpers. It is called only for the rollup-family types, whose outcome depends on the row `itx.rollup` names. It is
17
+ * synchronous: the caller reads the rows first, and builds each result with `rollupBranchOf`.
18
+ */
19
+ type RollupBranchResolver = (stmt: Record<string, unknown>) => RollupBranchInfo;
20
+ /**
21
+ * #1720 (S4b): the branch of a tx whose `itx.rollup` names `rollupRow`, derived exactly as the protocols do
22
+ * (`peekBridgeFailClosed` -> `rollup.isBridgeV2(row)`, `data.value.version == 2`). No row is the v1 branch: the
23
+ * protocols refuse a bridge kind on a v1 row or on no row.
24
+ */
25
+ declare function rollupBranchOf(rollupRow: unknown, itx: Record<string, unknown> | null | undefined): RollupBranchInfo;
26
+ /**
27
+ * #1720 (S4b): the branch information every guard call must carry. Missing or malformed is a programming error, never a
28
+ * default: allowing would skip the sunset, treating it as v1 would turn the bridge off once a guard is wired (§7.1, M-5).
29
+ */
30
+ declare function assertRollupBranchInfo(branch: unknown): asserts branch is RollupBranchInfo;
31
+ declare function assertNoBlockHeightParams(params: unknown, label: string): void;
32
+ /**
33
+ * Whether a tx of `canonicalTypeUrl` (`fg:t:...`) with `branch` is the bridge branch: a deposit with a bridge kind on a
34
+ * v2 row, a withdraw on a v2 row, or bridge governance on a v2 row. Both keys must agree for a deposit (the protocol
35
+ * refuses any other pairing). Throws on malformed branch information (a programming error, never a default).
36
+ */
37
+ declare function isBridgeBranch(canonicalTypeUrl: string, branch: RollupBranchInfo): boolean;
5
38
  declare const ZERO_BYTES32_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000";
6
39
  type DeprecatedRollupProtocolTypeUrl = (typeof DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS)[number];
7
40
  type LegacyRollupRecordKind = 'RollupState' | 'RollupBlock' | 'deposit_token_v2' | 'withdraw_token_v2';
@@ -48,13 +81,17 @@ declare function isDeprecatedRollupWriteProtocol(typeUrl: string): boolean;
48
81
  /**
49
82
  * Issue #1245:
50
83
  * Sunset guard for active transaction pipeline execution:
51
- * - Blocks all 8 deprecated Rollup write protocols when `currentBlockHeight >= rollupSunsetActivationHeight`.
52
- * - Allows historical block replay when `currentBlockHeight < rollupSunsetActivationHeight`.
84
+ * - Blocks all 8 deprecated Rollup write protocols of the v1 branch.
85
+ * - Allows historical block replay when `readOnlyArchiveMode === true`.
86
+ *
87
+ * #1720 (S4b, bridge/docs/deposit-withdraw-v2-unification.md §7.1): `branch` is required (missing throws) and the
88
+ * blockHeight parameters are gone (CHAIN_DESIGN §1 item 2): the switch is whether the guard is wired, plus
89
+ * `readOnlyArchiveMode` for replay. Governance of a v2 bridge is bridge governance, never sunset.
53
90
  */
54
91
  declare function assertRollupProtocolNotSunset(params: {
55
92
  typeUrl: string;
56
- currentBlockHeight: number;
57
- rollupSunsetActivationHeight?: number;
93
+ branch: RollupBranchInfo;
94
+ readOnlyArchiveMode?: boolean;
58
95
  }): void;
59
96
  /**
60
97
  * Issue #1245:
@@ -62,6 +99,6 @@ declare function assertRollupProtocolNotSunset(params: {
62
99
  * and `withdraw_token_v2` records so block explorers, indexers, and audit tools can inspect historical
63
100
  * chain data after the active Rollup write protocols are removed.
64
101
  */
65
- declare function parseLegacyRollupReadOnlyRecord(rawRecord: Record<string, unknown>): LegacyRollupReadOnlySummary;
102
+ declare function parseLegacyRollupReadOnlyRecord(rawRecord: Record<string, unknown>, branch: RollupBranchInfo): LegacyRollupReadOnlySummary;
66
103
  //#endregion
67
- export { DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DeprecatedRollupProtocolTypeUrl, LegacyRollupReadOnlySummary, LegacyRollupRecordKind, ZERO_BYTES32_HASH, assertRollupProtocolNotSunset, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, isDeprecatedRollupWriteProtocol, parseLegacyRollupReadOnlyRecord };
104
+ export { DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DeprecatedRollupProtocolTypeUrl, LegacyRollupReadOnlySummary, LegacyRollupRecordKind, RollupBranchInfo, RollupBranchResolver, ZERO_BYTES32_HASH, assertNoBlockHeightParams, assertRollupBranchInfo, assertRollupProtocolNotSunset, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, isBridgeBranch, isDeprecatedRollupWriteProtocol, parseLegacyRollupReadOnlyRecord, rollupBranchOf };
package/lib/library.cjs CHANGED
@@ -32,7 +32,6 @@ exports.DEFAULT_FT_ISSUANCE_FEE_ABT = require_native_abt_exchange.DEFAULT_FT_ISS
32
32
  exports.DEFAULT_GRADUATION_FEE_ABT = require_native_abt_exchange.DEFAULT_GRADUATION_FEE_ABT;
33
33
  exports.DEFAULT_ISSUER_STAGING_TTL_EPOCHS = require_social_economy_factories.DEFAULT_ISSUER_STAGING_TTL_EPOCHS;
34
34
  exports.DEFAULT_KARMA_TOKEN_ADDRESS = require_give_to_mint_karma.DEFAULT_KARMA_TOKEN_ADDRESS;
35
- exports.DEFAULT_LEGACY_PROTOCOL_SUNSET_HEIGHT = require_legacy_protocol_sunset.DEFAULT_LEGACY_PROTOCOL_SUNSET_HEIGHT;
36
35
  exports.DEFAULT_LP_JITTER_WINDOW_BLOCKS = require_uniswap_lp_copilot.DEFAULT_LP_JITTER_WINDOW_BLOCKS;
37
36
  exports.DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS = require_uniswap_lp_copilot.DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS;
38
37
  exports.DEFAULT_MAX_HISTORICAL_KARMA_CLAIM = require_give_to_mint_karma.DEFAULT_MAX_HISTORICAL_KARMA_CLAIM;
@@ -51,7 +50,6 @@ exports.DEFAULT_NFT_UI_REFERRER_FEE_BPS = require_native_abt_exchange.DEFAULT_NF
51
50
  exports.DEFAULT_OCAP_INTEGRATOR_ID = require_uniswap_router.DEFAULT_OCAP_INTEGRATOR_ID;
52
51
  exports.DEFAULT_OFFICIAL_TOKEN_ADDRESS = require_native_abt_exchange.DEFAULT_OFFICIAL_TOKEN_ADDRESS;
53
52
  exports.DEFAULT_PROTOCOL_FEE_SHARE_BPS = require_native_abt_exchange.DEFAULT_PROTOCOL_FEE_SHARE_BPS;
54
- exports.DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT = require_legacy_rollup_archive.DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT;
55
53
  exports.DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS = require_uniswap_router.DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS;
56
54
  exports.DEFAULT_SELF_BRIDGE_REGISTRATION_FEE_ABT = require_native_abt_exchange.DEFAULT_SELF_BRIDGE_REGISTRATION_FEE_ABT;
57
55
  exports.DEFAULT_SKU_ALPHA_PROTECTION_WINDOW_SECONDS = require_native_abt_exchange.DEFAULT_SKU_ALPHA_PROTECTION_WINDOW_SECONDS;
@@ -241,6 +239,7 @@ exports.resolveDomainAgnosticVNextProtocol = require_legacy_protocol_sunset.reso
241
239
  exports.resolveEffectiveResourceBudget = require_transaction_block.resolveEffectiveResourceBudget;
242
240
  exports.resolveEscalatingPromoterBps = require_native_abt_exchange.resolveEscalatingPromoterBps;
243
241
  exports.resolveStatementReferences = require_transaction_block.resolveStatementReferences;
242
+ exports.rollupBranchOf = require_legacy_rollup_archive.rollupBranchOf;
244
243
  exports.scheduleParallelBatches = require_transaction_block.scheduleParallelBatches;
245
244
  exports.selectSolverSubVaultShard = require_uniswap_erc7683_solver.selectSolverSubVaultShard;
246
245
  exports.verifyOcapHookTicketSignature = require_uniswap_v4_hook.verifyOcapHookTicketSignature;
package/lib/library.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { CrowdloanContributorPosition, MAX_FREE_RELAY_CREDITS_PER_EPOCH, OcapSovereignAppChainHubEngine, PfmCrossSpokePacketInput, SovereignReserveState, SpokeCrowdloanState, VLedgerCheckpointInput, computeVLedgerCheckpointStateRoot, deriveSovereignVaultDid } from "./appchain-sovereign-hub.cjs";
2
2
  import { ArcVaultLiquidityState, ArcVaultShareholderPosition, ExternalSwapHookInput, ExternalSwapHookResult, FORBIDDEN_EXTERNAL_CALL_SELECTORS, MAX_HARVEST_YIELD_BPS, MAX_VAULT_STRATEGY_DEPLOYED_BPS, MAX_ZAP_ABT_PER_SETTLEMENT_SCALAR, MAX_ZAP_PRICE_IMPACT_BPS, MIN_VAULT_LIQUID_BUFFER_BPS, OcapArcVaultExternalAdapterEngine, UniversalAbtZapInInput, UniversalAbtZapInResult } from "./arcvault-external-adapter.cjs";
3
3
  import { AcknowledgeNftPayloadCustodyInput, AppreciationMedalKind, ArcSpaceKarmaCheckpointInput, ArcSpaceKarmaCheckpointResult, ArcSpaceKarmaVoucherItem, CompanionAppreciationMedalNft, ConfigureNftPayloadVisibilityInput, CreateGiveToMintTokenInput, CreationSocialObject, CreatorThankYouBadge, DEFAULT_EPOCH_KARMA_ALLOWANCE, DEFAULT_KARMA_TOKEN_ADDRESS, DEFAULT_MAX_HISTORICAL_KARMA_CLAIM, DEFAULT_SPONSORED_BADGE_MINT_QUOTA, DidKarmaIdentityState, GIVE_TO_MINT_TOKEN_TYPE, GiveToMintDistributionEntry, GiveToMintRequest, GiveToMintResult, GiveToMintTokenConfig, HISTORICAL_CLAIM_TRUST_BOOST_BPS, HistoricalKarmaClaimInput, HistoricalKarmaClaimResult, HistoricalSourcePlatform, KarmaCitationShare, KarmaIndexedPoolSettlementInput, KarmaIndexedPoolSettlementResult, KarmaStakeLock, MAX_ACTIVE_SPONSORED_BADGE_MINT_QUOTA, MAX_CHECKPOINT_VOUCHERS_PER_BATCH, MAX_CUSTOM_TOKEN_EPOCH_ALLOWANCE, MAX_CUSTOM_TOKEN_HISTORICAL_CLAIM_CAP, MAX_EPOCH_FORWARD_DRIFT, MAX_HISTORICAL_KARMA_PER_VERIFIED_ITEM, MAX_SPONSORED_BADGE_MINT_QUOTA_PER_GRANT, MAX_TOTAL_CITATION_SHARE_BPS, MAX_UPSTREAM_CITATIONS, MIN_GIVE_TO_MINT_DUST_FLOOR, MIN_GIVE_TO_MINT_TOKEN_CREATION_FEE, MIN_KARMA_FOR_THANK_YOU_BADGE, NftPayloadAccessResolution, NftPayloadCustodyState, NftPayloadVisibility, OcapGiveToMintEngine, PerTokenAccountKarmaState, RECIPROCAL_RING_DAMPING_BPS, VerifiableEpochArchiveCheckpoint, computeArcSpaceCheckpointRoot, computeArcSpaceVoucherDigest, computeHistoricalClaimNullifier, computeNftPayloadCommitmentDigest, deriveCompanionMedalDid, deriveThankYouBadgeDid } from "./give-to-mint-karma.cjs";
4
- import { DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DeprecatedRollupProtocolTypeUrl, LegacyRollupReadOnlySummary, LegacyRollupRecordKind, ZERO_BYTES32_HASH, assertRollupProtocolNotSunset, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, isDeprecatedRollupWriteProtocol, parseLegacyRollupReadOnlyRecord } from "./legacy-rollup-archive.cjs";
4
+ import { DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DeprecatedRollupProtocolTypeUrl, LegacyRollupReadOnlySummary, LegacyRollupRecordKind, RollupBranchInfo, RollupBranchResolver, ZERO_BYTES32_HASH, assertRollupProtocolNotSunset, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, isDeprecatedRollupWriteProtocol, parseLegacyRollupReadOnlyRecord, rollupBranchOf } from "./legacy-rollup-archive.cjs";
5
5
  import { CONTRACT_NFT_KIND, ContractGuardPredicate, ContractNftPayload, CrossChainDepositSpec, CrossChainPurchaseInput, DEFAULT_MAX_STATEMENTS_PER_HOT_KEY_PER_BLOCK, HARD_MAX_TX_BLOCK_STATEMENTS, MAX_CONTRACT_ARGS_BYTES, MAX_CONTRACT_FOOTPRINT_KEYS, MAX_CONTRACT_NFT_STATEMENTS, MAX_EXECUTE_ASSET_CALLS_PER_BLOCK, MAX_EXECUTE_ASSET_DEPTH, MAX_TX_BLOCK_BYTES, MAX_TX_BLOCK_READ_KEYS, MAX_TX_BLOCK_STATE_DIFF_ENTRIES, MAX_TX_BLOCK_TOP_LEVEL_STATEMENTS, MAX_TX_BLOCK_TOTAL_EXPANDED_STATEMENTS, MAX_TX_BLOCK_WRITE_KEYS, OverlayStateDB, PendingTransferRecord, PreparedTransactionBlock, ResolvedTransactionBlockBudget, StagedSyncPipeline, StateDiffEntry, StateFootprint, StatementExecutor, SyncStage, TransactionBlockInput, TransactionBlockPostConditions, TransactionBlockResourceBudget, TransactionBlockResult, TransactionStatement, TwoPhaseCommitCoordinator, TwoPhaseTransferLedger, WalletClearSigningPreview, assertLeafStatementTemplateOnly, assertTransactionBlockResourceBudget, buildWalletClearSigningPreview, computeAccountAndAssetNetEffects, createOverlayStateDB, executeContractNft, executeCrossChainPurchaseBlock, executeTransactionBlock, extractStateFootprint, hasStateConflict, isExecuteAssetStatement, resolveEffectiveResourceBudget, resolveStatementReferences, scheduleParallelBatches, verifyTransactionBlockPostConditions } from "./transaction-block.cjs";
6
- import { CompatibilityAddonMetrics, CompatibilityAddonMode, CompatibilityDeprecationWarning, CompatibilityTranslationResult, DEFAULT_LEGACY_PROTOCOL_SUNSET_HEIGHT, DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS, DEPRECATED_MIOTX_AND_TRADE_TYPE_URLS, DEPRECATED_MIOTX_PROTOCOL_TYPE_URLS, DEPRECATED_ROLLUP_AND_BRIDGE_TYPE_URLS, DEPRECATED_VERSIONED_ASSET_TYPE_URLS, DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP, DeprecatedLegacyProtocolTypeUrl, DomainCoupledProtocolAliasTypeUrl, LegacyMiotxParticipantEntry, LegacyProtocolCompatibilityAddon, LegacyProtocolReplacementSpec, LegacyProtocolSunsetCategory, LegacyTokenAmountEntry, LegacyTxReadOnlyArchiveSummary, MAX_LEGACY_MIOTX_ASSETS_PER_ENTRY, MAX_LEGACY_MIOTX_PARTICIPANTS, MAX_LEGACY_MIOTX_TOKENS_PER_ENTRY, VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS, VNextCanonicalWriteProtocolTypeUrl, assertLegacyProtocolNotSunset, assertTransactionBlockVNextPure, compileLegacyTxToVNextTransactionBlock, executeVNextTransactionBlock, getLegacyProtocolReplacementSpec, isDeprecatedLegacyWriteProtocol, isDomainCoupledProtocolAlias, isMiotxLegacyProtocol, isVNextCanonicalWriteProtocol, normalizeProtocolTypeUrl, parseLegacyTxReadOnlyArchiveRecord, resolveDomainAgnosticVNextProtocol } from "./legacy-protocol-sunset.cjs";
6
+ import { CompatibilityAddonMetrics, CompatibilityAddonMode, CompatibilityDeprecationWarning, CompatibilityTranslationResult, DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS, DEPRECATED_MIOTX_AND_TRADE_TYPE_URLS, DEPRECATED_MIOTX_PROTOCOL_TYPE_URLS, DEPRECATED_ROLLUP_AND_BRIDGE_TYPE_URLS, DEPRECATED_VERSIONED_ASSET_TYPE_URLS, DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP, DeprecatedLegacyProtocolTypeUrl, DomainCoupledProtocolAliasTypeUrl, LegacyMiotxParticipantEntry, LegacyProtocolCompatibilityAddon, LegacyProtocolReplacementSpec, LegacyProtocolSunsetCategory, LegacyTokenAmountEntry, LegacyTxReadOnlyArchiveSummary, MAX_LEGACY_MIOTX_ASSETS_PER_ENTRY, MAX_LEGACY_MIOTX_PARTICIPANTS, MAX_LEGACY_MIOTX_TOKENS_PER_ENTRY, VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS, VNextCanonicalWriteProtocolTypeUrl, assertLegacyProtocolNotSunset, assertTransactionBlockVNextPure, compileLegacyTxToVNextTransactionBlock, executeVNextTransactionBlock, getLegacyProtocolReplacementSpec, isDeprecatedLegacyWriteProtocol, isDomainCoupledProtocolAlias, isMiotxLegacyProtocol, isVNextCanonicalWriteProtocol, normalizeProtocolTypeUrl, parseLegacyTxReadOnlyArchiveRecord, resolveDomainAgnosticVNextProtocol } from "./legacy-protocol-sunset.cjs";
7
7
  import { AcceptNftBuyOfferInput, AddAmmLiquidityInput, AttributionHopSplit, AuthorizeValueCardSpenderInput, BundleComponentAllocationInput, BurnCirculatingUserTokenInput, CANONICAL_ABT_EXCHANGE_BURN_SINK_DID, CANONICAL_SELF_BRIDGE_LIABILITY_DISCLAIMER, CategoryDemandBountyRecord, CategorySupplyDemandMetrics, ChallengeDefectiveSkuInput, ChallengeDefectiveSkuResult, ClawbackUnmaturedCardSettlementInput, ClawbackUnmaturedDistributorRebateInput, ClosePostpaidCreditCardInput, ComposePermissionlessBundleValueCardInput, ComposePermissionlessBundleValueCardResult, ConfigureEscalatingPromoterPolicyInput, CreateBondingCurveFactoryInput, CreateConstantProductPoolInput, CreateNativeNftListingInput, CreateNftBuyOfferInput, DEFAULT_ANTI_SNIPE_WINDOW_SECONDS, DEFAULT_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, DEFAULT_EXCHANGE_ABT_TOKEN_ADDRESS, DEFAULT_EXCHANGE_SWAP_FEE_BPS, DEFAULT_FISHERMAN_DEFECT_BOUNTY_BPS, DEFAULT_FT_ISSUANCE_FEE_ABT, DEFAULT_GRADUATION_FEE_ABT, DEFAULT_MAX_SWAP_PRICE_IMPACT_BPS, DEFAULT_MIN_ENGLISH_BID_INCREMENT_BPS, DEFAULT_MIN_GRADUATION_RESERVE_ABT, DEFAULT_MIN_GRADUATION_UNIQUE_HOLDERS, DEFAULT_MIN_SELF_BRIDGE_SECURITY_BOND_ABT, DEFAULT_MIN_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, DEFAULT_NFT_PROTOCOL_FEE_BPS, DEFAULT_NFT_UI_REFERRER_FEE_BPS, DEFAULT_OFFICIAL_TOKEN_ADDRESS, DEFAULT_PROTOCOL_FEE_SHARE_BPS, DEFAULT_SELF_BRIDGE_REGISTRATION_FEE_ABT, DEFAULT_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, DEFAULT_SKU_QUALITY_BASE_STAKE_ABT, DEFAULT_VALUE_CARD_PROTOCOL_FEE_BPS, DynamicCategoryStakeFloorResult, EscalatingPromoterTier, ExchangeFactoryMode, ExecuteProgrammaticPolRebalanceInput, ExecuteProgrammaticPolRebalanceResult, ExecuteUnifiedSkuCheckoutInput, FulfillNativeNftListingInput, GovernanceExchangePolicy, HARD_MAX_SWAP_PRICE_IMPACT_BPS, IssuePermissionlessTokenInput, IssuePostpaidCreditCardInput, IssuePrepaidValueCardInput, LiquidateDefaultedPostpaidCardInput, MAX_ACTIVE_MATURING_REBATES_PER_DISTRIBUTOR, MAX_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MAX_DISTRIBUTOR_STAKE_COOLDOWN_SECONDS, MAX_ESCALATING_PROMOTER_REBATE_BPS, MAX_ESCALATING_PROMOTER_TIERS, MAX_EXCHANGE_SWAP_FEE_BPS, MAX_FT_ISSUANCE_FEE_ABT, MAX_GRADUATION_RESERVE_ABT_CEILING, MAX_GRADUATION_UNIQUE_HOLDERS_CEILING, MAX_NFT_CREATOR_ROYALTY_BPS, MAX_NFT_OFFER_PREDICATES, MAX_PROTOCOL_FEE_SHARE_BPS, MAX_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, MAX_SKU_QUALITY_DYNAMIC_STAKE_ABT, MAX_TRACKED_CURVE_HOLDERS, MAX_VALUE_CARD_ALLOWED_MERCHANTS, MAX_VALUE_CARD_ALLOWED_SERVICE_TAGS, MAX_VALUE_CARD_ATTRIBUTION_HOPS, MAX_VALUE_CARD_ATTRIBUTION_TOTAL_BPS, MAX_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, MINIMUM_LOCKED_AMM_LIQUIDITY, MIN_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MIN_FT_ISSUANCE_FEE_ABT, MIN_GRADUATION_HOLDER_SHARE_BPS, MIN_GRADUATION_RESERVE_ABT_FLOOR, MaturingCardSettlementRecord, MaturingDistributorRebateRecord, MinerRevenueTier, MinerShopPersonaPublicRecord, NativeNftBuyOfferRecord, NativeNftListingMode, NativeNftListingRecord, NativeNftOfferSettlementResult, NativeNftSettlementResult, NativeSwapExecutionResult, NftAttributePredicate, NftAttributePredicateOperator, OcapNativeAbtExchangeEngine, OcapNativeExchangeEngine, OpenComposingRuleClaims, PathPaymentCheckoutInput, PlaceEnglishNftBidInput, PostCategoryDemandBountyInput, PurchaseDedicatedValueCardInput, PurchaseDedicatedValueCardResult, RecalibrateDynamicStakeFloorInput, RecalibrateDynamicStakeFloorResult, RedeemPrepaidValueCardInput, RegisterMinerShopPersonaInput, RegisterSelfOperatedBridgeInput, RegisterSkuFactoryListingInput, ReleaseMaturedCardSettlementInput, ReleaseMaturedDistributorRebateInput, RemoveAmmLiquidityInput, RetireDestroyedTokenInput, RewardCoalitionValueCardInput, RewardCoalitionValueCardResult, SelfOperatedSubTokenBridgeRecord, SettlePostpaidValueCardInput, SignedOpenComposingRuleVc, SingleHopAbtSwapInput, SkuFactoryListingRecord, SkuGranularMetricsView, SkuOrderSettlementRecord, SpendValueCardInput, SpendValueCardResult, StakeForValueCardDistributorInput, StakeForValueCardDistributorResult, TopUpPrepaidValueCardInput, TwoHopTokenSwapInput, UnifiedAbtExchangePoolState, UnstakeValueCardDistributorInput, UnstakeValueCardDistributorResult, UpdateGovernanceExchangePolicyInput, UserIssuedTokenRecord, ValueCardDistributorStakeRecord, ValueCardFundingLineage, ValueCardMode, ValueCardPolicyEnvelope, ValueCardRecord, VerifiableMinerRevenueBadge, computeOpenComposingRuleVcDigest, computeSelfBridgeDisclaimerDigest, computeStakeAddress, deriveSkuQualityStakeAddress, deriveValueCardDistributorStakeAddress, evaluateNftAttributePredicates, integerSqrtBn, issueOpenComposingRuleVc, resolveEscalatingPromoterBps, verifyOpenComposingRuleVc } from "./native-abt-exchange.cjs";
8
8
  import { DEFAULT_ISSUER_STAGING_TTL_EPOCHS, FactoryBlueprintRolloutResult, FactoryBlueprintSafetyReport, FactorySafetyInvariant, KarmaSettlementPoolFactoryRecord, KarmaSettlementPoolFactorySpec, MAX_ISSUER_STAGING_TTL_EPOCHS, MAX_SOVEREIGN_NFT_FACTORY_SUPPLY, MintSovereignNftInput, OcapSocialEconomyFactoryRegistry, PilotPrivateCircleDeliveryInput, PilotPrivateCircleDeliveryResult, PilotPublicContentAppreciationInput, PilotPublicContentAppreciationResult, ReputationTokenFactoryInput, ReputationTokenFactoryRecord, SocialEconomyFactoryBlueprint, SocialEconomyFactoryKind, SovereignNftAccessResolution, SovereignNftCategory, SovereignNftFactoryRecord, SovereignNftFactorySpec, SovereignNftInstance, deriveSovereignNftDid } from "./social-economy-factories.cjs";
9
9
  import { AcceptStickerOfferInput, AcceptStickerOfferResult, AnchorSpaceManifestInput, ArcadeMachineState, ArcadeSettlementMode, AttentionStampRecord, AttentionStampResolutionMode, BPS_DENOMINATOR, CreateSponsorBudgetPoolInput, DEFAULT_ABT_TOKEN_ADDRESS, GrantSpaceAssetDelegationInput, IBO_DIVIDEND_PRECISION, IboOrganizationState, IboPartnerPosition, IssuePrepaidBudgetCardInput, LockAttentionStampInput, MAX_ARCADE_HOUSE_SPLIT_BPS, MAX_ARCADE_WINNERS_PER_ROUND, MAX_ATTENTION_STAMP_TTL_EPOCHS, MAX_IBO_TOTAL_FEE_SPLIT_BPS, MAX_PREPAID_CARD_ALLOWED_PROVIDERS, MAX_SPACE_DISPLAYED_STICKERS, MAX_SPACE_PLACED_MACHINES, MAX_STICKER_ROYALTY_BPS, MIN_ARCADE_HOUSE_SPLIT_BPS, MIN_ATTENTION_STAMP_ABT, MakeStickerOfferInput, OcapSuperSuitesFoundationEngine, PlayArcadeMachineTicketInput, PlayArcadeMachineTicketResult, PrepaidBudgetCardNft, RedeemPrepaidBudgetCardInput, RedeemPrepaidBudgetCardResult, RegisterArcadeMachineInput, RegisterIboOrganizationInput, RegisterStickerNftInput, ResolveAttentionStampInput, ResolveAttentionStampResult, SettleArcadeMachineWinnersInput, SettleArcadeMachineWinnersResult, SettleIboServiceCheckoutInput, SettleIboServiceCheckoutResult, SpaceAssetDelegationGrant, SpaceManifestAnchorRecord, SponsorBudgetPoolState, StickerNftRecord, StickerOfferRecord, computeArcadeCommitDigest, computeSpaceManifestRootDigest } from "./super-suites-foundation.cjs";
@@ -13,4 +13,4 @@ import { CHAINALYSIS_OFAC_ORACLE_ADDRESS, assertNotOfacSanctioned, normalizeScre
13
13
  import { ABT_DECIMALS_SCALE, AbtUtilityPassThroughInput, AbtUtilityPassThroughPlan, DEFAULT_OCAP_INTEGRATOR_ID, DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS, DEFAULT_USD_QUOTE_TTL_SECONDS, DirectBuyExternalSettlementMode, DirectBuyOcapFulfillmentMode, DirectBuyPricingPolicyMode, DirectBuyTreasuryCashier, DirectBuyTreasuryCashierConfig, DirectBuyTreasuryCashierInput, DirectBuyTreasuryCashierPlan, ExternalPaymentChainFamily, MAX_ALLOWED_ZAP_SLIPPAGE_BPS, MAX_ROUTE_PATH_LENGTH, MAX_TRACKED_DIRECT_BUY_EVIDENCES, MAX_USD_QUOTE_TTL_SECONDS, OutboundWithdrawAndSwapInput, OutboundWithdrawAndSwapPlan, Permit2SingleSpec, SelectedTreasuryCurrencySpec, SelectedTreasuryCurrencySymbol, UNIVERSAL_ROUTER_COMMANDS, UniversalRouterCrossChainZapInput, UniversalRouterCrossChainZapPayload, UnlistedTokenExternalSwapSpec, UsdAnchoredAbtQuote, UsdAnchoredAbtQuoteInput, VerifyUsdAnchoredAbtQuoteInput, buildAbtUtilityPassThroughPlan, buildDirectBuyTreasuryCashierPlan, buildOutboundWithdrawAndSwapPlan, buildUniversalRouterCrossChainPayload, createUsdAnchoredAbtQuote, verifyUsdAnchoredAbtQuote } from "./uniswap-router.cjs";
14
14
  import { BaseV4GraduationMigrationProof, CANONICAL_LP_BURN_DEAD_ADDRESS, FunctionalUtilityCategory, FunctionalUtilityCharter, IncubatedTokenFactoryRecord, IncubatedTokenFactorySpec, MAX_MINT_RATIO_PER_RESERVE_UNIT, MIN_CREATOR_VESTING_CLIFF_BLOCKS, OcapTokenFactoryGraduationEngine, TokenFactoryGraduationStatus, VerifiedCreatorCredential, computeDeterministicV4GraduationPoolId } from "./uniswap-token-factory-graduation.cjs";
15
15
  import { BeforeSwapEvaluationResult, DEFAULT_MIN_HOLDING_BLOCKS, HookFeeTierName, MAX_HOOK_TICKET_TTL_SECONDS, MAX_V4_DYNAMIC_FEE_BPS, MIN_LP_MEV_REBATE_SHARE_BPS, OCAP_VERIFIED_HOOK_SOLIDITY_SPEC, OcapHookTicketClaims, OcapVerifiedHookEngine, SignedOcapHookTicket, V4PoolComplianceMode, V4PoolHookConfig, assertZeroPiiInHookData, computeOcapHookTicketDigest, issueOcapHookTicket, verifyOcapHookTicketSignature } from "./uniswap-v4-hook.cjs";
16
- export { ABT_DECIMALS_SCALE, type AbtUtilityPassThroughInput, type AbtUtilityPassThroughPlan, type AcceptNftBuyOfferInput, type AcceptStickerOfferInput, type AcceptStickerOfferResult, type AcknowledgeNftPayloadCustodyInput, type AddAmmLiquidityInput, type AnchorSpaceManifestInput, type AppreciationMedalKind, type ArcSpaceKarmaCheckpointInput, type ArcSpaceKarmaCheckpointResult, type ArcSpaceKarmaVoucherItem, type ArcVaultLiquidityState, type ArcVaultShareholderPosition, type ArcadeMachineState, type ArcadeSettlementMode, type AttentionStampRecord, type AttentionStampResolutionMode, type AttributionHopSplit, type AuthorizeValueCardSpenderInput, BPS_DENOMINATOR, type BaseV4GraduationMigrationProof, type BeforeSwapEvaluationResult, type BundleComponentAllocationInput, type BurnCirculatingUserTokenInput, CANONICAL_ABT_EXCHANGE_BURN_SINK_DID, CANONICAL_LP_BURN_DEAD_ADDRESS, CANONICAL_SELF_BRIDGE_LIABILITY_DISCLAIMER, CHAINALYSIS_OFAC_ORACLE_ADDRESS, CONTRACT_NFT_KIND, type CategoryDemandBountyRecord, type CategorySupplyDemandMetrics, type ChallengeDefectiveSkuInput, type ChallengeDefectiveSkuResult, type ClawbackUnmaturedCardSettlementInput, type ClawbackUnmaturedDistributorRebateInput, type ClosePostpaidCreditCardInput, type CompanionAppreciationMedalNft, type CompatibilityAddonMetrics, type CompatibilityAddonMode, type CompatibilityDeprecationWarning, type CompatibilityTranslationResult, type ComposePermissionlessBundleValueCardInput, type ComposePermissionlessBundleValueCardResult, type ConfigureEscalatingPromoterPolicyInput, type ConfigureNftPayloadVisibilityInput, type ContractGuardPredicate, type ContractNftPayload, type CreateBondingCurveFactoryInput, type CreateConstantProductPoolInput, type CreateGiveToMintTokenInput, type CreateNativeNftListingInput, type CreateNftBuyOfferInput, type CreateSponsorBudgetPoolInput, type CreationSocialObject, type CreatorThankYouBadge, type CrossChainDepositSpec, type CrossChainPurchaseInput, type CrossChainSettlementProof, type CrowdloanContributorPosition, DEFAULT_ABT_TOKEN_ADDRESS, DEFAULT_ANTI_SNIPE_WINDOW_SECONDS, DEFAULT_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, DEFAULT_EPOCH_KARMA_ALLOWANCE, DEFAULT_EXCHANGE_ABT_TOKEN_ADDRESS, DEFAULT_EXCHANGE_SWAP_FEE_BPS, DEFAULT_FISHERMAN_DEFECT_BOUNTY_BPS, DEFAULT_FT_ISSUANCE_FEE_ABT, DEFAULT_GRADUATION_FEE_ABT, DEFAULT_ISSUER_STAGING_TTL_EPOCHS, DEFAULT_KARMA_TOKEN_ADDRESS, DEFAULT_LEGACY_PROTOCOL_SUNSET_HEIGHT, DEFAULT_LP_JITTER_WINDOW_BLOCKS, DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS, DEFAULT_MAX_HISTORICAL_KARMA_CLAIM, DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEFAULT_MAX_STATEMENTS_PER_HOT_KEY_PER_BLOCK, DEFAULT_MAX_SWAP_PRICE_IMPACT_BPS, DEFAULT_MAX_SWEEP_BATCH_SIZE, DEFAULT_MIN_ENGLISH_BID_INCREMENT_BPS, DEFAULT_MIN_GRADUATION_RESERVE_ABT, DEFAULT_MIN_GRADUATION_UNIQUE_HOLDERS, DEFAULT_MIN_HOLDING_BLOCKS, DEFAULT_MIN_SELF_BRIDGE_SECURITY_BOND_ABT, DEFAULT_MIN_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, DEFAULT_NFT_PROTOCOL_FEE_BPS, DEFAULT_NFT_UI_REFERRER_FEE_BPS, DEFAULT_OCAP_INTEGRATOR_ID, DEFAULT_OFFICIAL_TOKEN_ADDRESS, DEFAULT_PROTOCOL_FEE_SHARE_BPS, DEFAULT_ROLLUP_SUNSET_ACTIVATION_HEIGHT, DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS, DEFAULT_SELF_BRIDGE_REGISTRATION_FEE_ABT, DEFAULT_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, DEFAULT_SKU_QUALITY_BASE_STAKE_ABT, DEFAULT_SPONSORED_BADGE_MINT_QUOTA, DEFAULT_USD_QUOTE_TTL_SECONDS, DEFAULT_VALUE_CARD_PROTOCOL_FEE_BPS, DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS, DEPRECATED_MIOTX_AND_TRADE_TYPE_URLS, DEPRECATED_MIOTX_PROTOCOL_TYPE_URLS, DEPRECATED_ROLLUP_AND_BRIDGE_TYPE_URLS, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DEPRECATED_VERSIONED_ASSET_TYPE_URLS, DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP, type DeprecatedLegacyProtocolTypeUrl, type DeprecatedRollupProtocolTypeUrl, type DidKarmaIdentityState, type DirectBuyExternalSettlementMode, type DirectBuyOcapFulfillmentMode, type DirectBuyPricingPolicyMode, DirectBuyTreasuryCashier, type DirectBuyTreasuryCashierConfig, type DirectBuyTreasuryCashierInput, type DirectBuyTreasuryCashierPlan, type DomainCoupledProtocolAliasTypeUrl, type DynamicCategoryStakeFloorResult, type Erc7683FillInstruction, type Erc7683Output, type Erc7683ResolvedCrossChainOrder, type EscalatingPromoterTier, type ExchangeFactoryMode, type ExecuteProgrammaticPolRebalanceInput, type ExecuteProgrammaticPolRebalanceResult, type ExecuteUnifiedSkuCheckoutInput, type ExternalPaymentChainFamily, type ExternalSwapHookInput, type ExternalSwapHookResult, FORBIDDEN_EXTERNAL_CALL_SELECTORS, type FactoryBlueprintRolloutResult, type FactoryBlueprintSafetyReport, type FactorySafetyInvariant, type FulfillNativeNftListingInput, type FunctionalUtilityCategory, type FunctionalUtilityCharter, GIVE_TO_MINT_TOKEN_TYPE, type GiveToMintDistributionEntry, type GiveToMintRequest, type GiveToMintResult, type GiveToMintTokenConfig, type GovernanceExchangePolicy, type GrantSpaceAssetDelegationInput, HARD_MAX_SWAP_PRICE_IMPACT_BPS, HARD_MAX_TX_BLOCK_STATEMENTS, HISTORICAL_CLAIM_TRUST_BOOST_BPS, type HistoricalKarmaClaimInput, type HistoricalKarmaClaimResult, type HistoricalSourcePlatform, type HookFeeTierName, IBO_DIVIDEND_PRECISION, type IboOrganizationState, type IboPartnerPosition, type IncubatedTokenFactoryRecord, type IncubatedTokenFactorySpec, type IssuePermissionlessTokenInput, type IssuePostpaidCreditCardInput, type IssuePrepaidBudgetCardInput, type IssuePrepaidValueCardInput, type KarmaCitationShare, type KarmaIndexedPoolSettlementInput, type KarmaIndexedPoolSettlementResult, type KarmaSettlementPoolFactoryRecord, type KarmaSettlementPoolFactorySpec, type KarmaStakeLock, type LegacyMiotxParticipantEntry, LegacyProtocolCompatibilityAddon, type LegacyProtocolReplacementSpec, type LegacyProtocolSunsetCategory, type LegacyRollupReadOnlySummary, type LegacyRollupRecordKind, type LegacyTokenAmountEntry, type LegacyTxReadOnlyArchiveSummary, type LiquidateDefaultedPostpaidCardInput, type LockAttentionStampInput, type LpRebalanceProposalInput, MAX_ACTIVE_INTENTS_PER_USER, MAX_ACTIVE_MATURING_REBATES_PER_DISTRIBUTOR, MAX_ACTIVE_SPONSORED_BADGE_MINT_QUOTA, MAX_ALLOWED_ZAP_SLIPPAGE_BPS, MAX_ARCADE_HOUSE_SPLIT_BPS, MAX_ARCADE_WINNERS_PER_ROUND, MAX_ATTENTION_STAMP_TTL_EPOCHS, MAX_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MAX_CHECKPOINT_VOUCHERS_PER_BATCH, MAX_CONTRACT_ARGS_BYTES, MAX_CONTRACT_FOOTPRINT_KEYS, MAX_CONTRACT_NFT_STATEMENTS, MAX_CUSTOM_TOKEN_EPOCH_ALLOWANCE, MAX_CUSTOM_TOKEN_HISTORICAL_CLAIM_CAP, MAX_DISTRIBUTOR_STAKE_COOLDOWN_SECONDS, MAX_EPOCH_FORWARD_DRIFT, MAX_ESCALATING_PROMOTER_REBATE_BPS, MAX_ESCALATING_PROMOTER_TIERS, MAX_EXCHANGE_SWAP_FEE_BPS, MAX_EXECUTE_ASSET_CALLS_PER_BLOCK, MAX_EXECUTE_ASSET_DEPTH, MAX_FREE_RELAY_CREDITS_PER_EPOCH, MAX_FT_ISSUANCE_FEE_ABT, MAX_GRADUATION_RESERVE_ABT_CEILING, MAX_GRADUATION_UNIQUE_HOLDERS_CEILING, MAX_HARVEST_YIELD_BPS, MAX_HISTORICAL_KARMA_PER_VERIFIED_ITEM, MAX_HOOK_TICKET_TTL_SECONDS, MAX_IBO_TOTAL_FEE_SPLIT_BPS, MAX_INTENT_TIMEOUT_BLOCKS, MAX_ISSUER_STAGING_TTL_EPOCHS, MAX_LEGACY_MIOTX_ASSETS_PER_ENTRY, MAX_LEGACY_MIOTX_PARTICIPANTS, MAX_LEGACY_MIOTX_TOKENS_PER_ENTRY, MAX_LP_REBALANCE_SLIPPAGE_BPS, MAX_MINT_RATIO_PER_RESERVE_UNIT, MAX_NFT_CREATOR_ROYALTY_BPS, MAX_NFT_OFFER_PREDICATES, MAX_PREPAID_CARD_ALLOWED_PROVIDERS, MAX_PROTOCOL_FEE_SHARE_BPS, MAX_ROUTE_PATH_LENGTH, MAX_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, MAX_SKU_QUALITY_DYNAMIC_STAKE_ABT, MAX_SOVEREIGN_NFT_FACTORY_SUPPLY, MAX_SPACE_DISPLAYED_STICKERS, MAX_SPACE_PLACED_MACHINES, MAX_SPONSORED_BADGE_MINT_QUOTA_PER_GRANT, MAX_STICKER_ROYALTY_BPS, MAX_TOTAL_CITATION_SHARE_BPS, MAX_TRACKED_CURVE_HOLDERS, MAX_TRACKED_DIRECT_BUY_EVIDENCES, MAX_TX_BLOCK_BYTES, MAX_TX_BLOCK_READ_KEYS, MAX_TX_BLOCK_STATE_DIFF_ENTRIES, MAX_TX_BLOCK_TOP_LEVEL_STATEMENTS, MAX_TX_BLOCK_TOTAL_EXPANDED_STATEMENTS, MAX_TX_BLOCK_WRITE_KEYS, MAX_UNISWAP_TICK, MAX_UPSTREAM_CITATIONS, MAX_USD_QUOTE_TTL_SECONDS, MAX_V4_DYNAMIC_FEE_BPS, MAX_VALUE_CARD_ALLOWED_MERCHANTS, MAX_VALUE_CARD_ALLOWED_SERVICE_TAGS, MAX_VALUE_CARD_ATTRIBUTION_HOPS, MAX_VALUE_CARD_ATTRIBUTION_TOTAL_BPS, MAX_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, MAX_VAULT_STRATEGY_DEPLOYED_BPS, MAX_ZAP_ABT_PER_SETTLEMENT_SCALAR, MAX_ZAP_PRICE_IMPACT_BPS, MINIMUM_LOCKED_AMM_LIQUIDITY, MIN_ARCADE_HOUSE_SPLIT_BPS, MIN_ATTENTION_STAMP_ABT, MIN_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MIN_CREATOR_VESTING_CLIFF_BLOCKS, MIN_FT_ISSUANCE_FEE_ABT, MIN_GIVE_TO_MINT_DUST_FLOOR, MIN_GIVE_TO_MINT_TOKEN_CREATION_FEE, MIN_GRADUATION_HOLDER_SHARE_BPS, MIN_GRADUATION_RESERVE_ABT_FLOOR, MIN_KARMA_FOR_THANK_YOU_BADGE, MIN_LP_MEV_REBATE_SHARE_BPS, MIN_RECOMMENDED_SOLVER_SHARDS, MIN_UNISWAP_TICK, MIN_VAULT_LIQUID_BUFFER_BPS, type MakeStickerOfferInput, type ManagedIntentRecord, type MaturingCardSettlementRecord, type MaturingDistributorRebateRecord, type MinerRevenueTier, type MinerShopPersonaPublicRecord, type MintSovereignNftInput, type NativeNftBuyOfferRecord, type NativeNftListingMode, type NativeNftListingRecord, type NativeNftOfferSettlementResult, type NativeNftSettlementResult, type NativeSwapExecutionResult, type NftAttributePredicate, type NftAttributePredicateOperator, type NftPayloadAccessResolution, type NftPayloadCustodyState, type NftPayloadVisibility, type NonCustodialLpContractNftAsset, type NonCustodialLpGuardSpec, OCAP_VERIFIED_HOOK_SOLIDITY_SPEC, OcapArcVaultExternalAdapterEngine, OcapErc7683SolverEngine, OcapGiveToMintEngine, type OcapHookTicketClaims, OcapNativeAbtExchangeEngine, OcapNativeExchangeEngine, OcapSocialEconomyFactoryRegistry, OcapSovereignAppChainHubEngine, OcapSuperSuitesFoundationEngine, OcapTokenFactoryGraduationEngine, OcapVerifiedHookEngine, type OpenComposingRuleClaims, type OriginEscrowProof, type OutboundWithdrawAndSwapInput, type OutboundWithdrawAndSwapPlan, OverlayStateDB, type PathPaymentCheckoutInput, type PendingTransferRecord, type PerTokenAccountKarmaState, type Permit2SingleSpec, type PfmCrossSpokePacketInput, type PilotPrivateCircleDeliveryInput, type PilotPrivateCircleDeliveryResult, type PilotPublicContentAppreciationInput, type PilotPublicContentAppreciationResult, type PlaceEnglishNftBidInput, type PlayArcadeMachineTicketInput, type PlayArcadeMachineTicketResult, type PostCategoryDemandBountyInput, type PrepaidBudgetCardNft, type PreparedTransactionBlock, type PurchaseDedicatedValueCardInput, type PurchaseDedicatedValueCardResult, RECIPROCAL_RING_DAMPING_BPS, type RecalibrateDynamicStakeFloorInput, type RecalibrateDynamicStakeFloorResult, type RedeemPrepaidBudgetCardInput, type RedeemPrepaidBudgetCardResult, type RedeemPrepaidValueCardInput, type RegisterArcadeMachineInput, type RegisterIboOrganizationInput, type RegisterMinerShopPersonaInput, type RegisterSelfOperatedBridgeInput, type RegisterSkuFactoryListingInput, type RegisterStickerNftInput, type ReleaseMaturedCardSettlementInput, type ReleaseMaturedDistributorRebateInput, type RemoveAmmLiquidityInput, type ReputationTokenFactoryInput, type ReputationTokenFactoryRecord, type ResolveAttentionStampInput, type ResolveAttentionStampResult, type ResolvedTransactionBlockBudget, type RetireDestroyedTokenInput, type RewardCoalitionValueCardInput, type RewardCoalitionValueCardResult, type SelectedTreasuryCurrencySpec, type SelectedTreasuryCurrencySymbol, type SelfOperatedSubTokenBridgeRecord, type SettleArcadeMachineWinnersInput, type SettleArcadeMachineWinnersResult, type SettleIboServiceCheckoutInput, type SettleIboServiceCheckoutResult, type SettlePostpaidValueCardInput, type SignedOcapHookTicket, type SignedOpenComposingRuleVc, type SingleHopAbtSwapInput, type SkuFactoryListingRecord, type SkuGranularMetricsView, type SkuOrderSettlementRecord, type SocialEconomyFactoryBlueprint, type SocialEconomyFactoryKind, type SolverEngineConfig, type SolverExecutionMode, type SovereignNftAccessResolution, type SovereignNftCategory, type SovereignNftFactoryRecord, type SovereignNftFactorySpec, type SovereignNftInstance, type SovereignReserveState, type SpaceAssetDelegationGrant, type SpaceManifestAnchorRecord, type SpendValueCardInput, type SpendValueCardResult, type SpokeCrowdloanState, type SponsorBudgetPoolState, StagedSyncPipeline, type StakeForValueCardDistributorInput, type StakeForValueCardDistributorResult, type StateDiffEntry, type StateFootprint, type StatementExecutor, type StickerNftRecord, type StickerOfferRecord, type SyncStage, type TokenFactoryGraduationStatus, type TopUpPrepaidValueCardInput, type TransactionBlockInput, type TransactionBlockPostConditions, type TransactionBlockResourceBudget, type TransactionBlockResult, type TransactionStatement, type TwoHopTokenSwapInput, TwoPhaseCommitCoordinator, TwoPhaseTransferLedger, UNIVERSAL_ROUTER_COMMANDS, type UnifiedAbtExchangePoolState, type UniversalAbtZapInInput, type UniversalAbtZapInResult, type UniversalRouterCrossChainZapInput, type UniversalRouterCrossChainZapPayload, type UnlistedTokenExternalSwapSpec, type UnstakeValueCardDistributorInput, type UnstakeValueCardDistributorResult, type UpdateGovernanceExchangePolicyInput, type UsdAnchoredAbtQuote, type UsdAnchoredAbtQuoteInput, type UserIssuedTokenRecord, type V4PoolComplianceMode, type V4PoolHookConfig, type VLedgerCheckpointInput, VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS, type VNextCanonicalWriteProtocolTypeUrl, type ValueCardDistributorStakeRecord, type ValueCardFundingLineage, type ValueCardMode, type ValueCardPolicyEnvelope, type ValueCardRecord, type VerifiableEpochArchiveCheckpoint, type VerifiableMinerRevenueBadge, type VerifiedCreatorCredential, type VerifyUsdAnchoredAbtQuoteInput, type WalletClearSigningPreview, ZERO_BYTES32_HASH, assertLeafStatementTemplateOnly, assertLegacyProtocolNotSunset, assertNotOfacSanctioned, assertRollupProtocolNotSunset, assertTransactionBlockResourceBudget, assertTransactionBlockVNextPure, assertZeroPiiInHookData, buildAbtUtilityPassThroughPlan, buildDirectBuyTreasuryCashierPlan, buildNonCustodialLpContractNft, buildOutboundWithdrawAndSwapPlan, buildUniversalRouterCrossChainPayload, buildWalletClearSigningPreview, compileLegacyTxToVNextTransactionBlock, computeAccountAndAssetNetEffects, computeArcSpaceCheckpointRoot, computeArcSpaceVoucherDigest, computeArcadeCommitDigest, computeDeterministicRebalanceSlot, computeDeterministicV4GraduationPoolId, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, computeHistoricalClaimNullifier, computeNftPayloadCommitmentDigest, computeOcapHookTicketDigest, computeOpenComposingRuleVcDigest, computeSelfBridgeDisclaimerDigest, computeSpaceManifestRootDigest, computeStakeAddress, computeVLedgerCheckpointStateRoot, createOverlayStateDB, createUsdAnchoredAbtQuote, deriveCompanionMedalDid, deriveSkuQualityStakeAddress, deriveSovereignNftDid, deriveSovereignVaultDid, deriveThankYouBadgeDid, deriveValueCardDistributorStakeAddress, evaluateNftAttributePredicates, executeContractNft, executeCrossChainPurchaseBlock, executeNonCustodialLpRebalance, executeTransactionBlock, executeVNextTransactionBlock, extractStateFootprint, getLegacyProtocolReplacementSpec, hasStateConflict, integerSqrtBn, isDeprecatedLegacyWriteProtocol, isDeprecatedRollupWriteProtocol, isDomainCoupledProtocolAlias, isExecuteAssetStatement, isMiotxLegacyProtocol, isVNextCanonicalWriteProtocol, issueOcapHookTicket, issueOpenComposingRuleVc, normalizeProtocolTypeUrl, normalizeScreeningAddress, parseLegacyRollupReadOnlyRecord, parseLegacyTxReadOnlyArchiveRecord, resolveDomainAgnosticVNextProtocol, resolveEffectiveResourceBudget, resolveEscalatingPromoterBps, resolveStatementReferences, scheduleParallelBatches, selectSolverSubVaultShard, verifyOcapHookTicketSignature, verifyOpenComposingRuleVc, verifyTransactionBlockPostConditions, verifyUsdAnchoredAbtQuote };
16
+ export { ABT_DECIMALS_SCALE, type AbtUtilityPassThroughInput, type AbtUtilityPassThroughPlan, type AcceptNftBuyOfferInput, type AcceptStickerOfferInput, type AcceptStickerOfferResult, type AcknowledgeNftPayloadCustodyInput, type AddAmmLiquidityInput, type AnchorSpaceManifestInput, type AppreciationMedalKind, type ArcSpaceKarmaCheckpointInput, type ArcSpaceKarmaCheckpointResult, type ArcSpaceKarmaVoucherItem, type ArcVaultLiquidityState, type ArcVaultShareholderPosition, type ArcadeMachineState, type ArcadeSettlementMode, type AttentionStampRecord, type AttentionStampResolutionMode, type AttributionHopSplit, type AuthorizeValueCardSpenderInput, BPS_DENOMINATOR, type BaseV4GraduationMigrationProof, type BeforeSwapEvaluationResult, type BundleComponentAllocationInput, type BurnCirculatingUserTokenInput, CANONICAL_ABT_EXCHANGE_BURN_SINK_DID, CANONICAL_LP_BURN_DEAD_ADDRESS, CANONICAL_SELF_BRIDGE_LIABILITY_DISCLAIMER, CHAINALYSIS_OFAC_ORACLE_ADDRESS, CONTRACT_NFT_KIND, type CategoryDemandBountyRecord, type CategorySupplyDemandMetrics, type ChallengeDefectiveSkuInput, type ChallengeDefectiveSkuResult, type ClawbackUnmaturedCardSettlementInput, type ClawbackUnmaturedDistributorRebateInput, type ClosePostpaidCreditCardInput, type CompanionAppreciationMedalNft, type CompatibilityAddonMetrics, type CompatibilityAddonMode, type CompatibilityDeprecationWarning, type CompatibilityTranslationResult, type ComposePermissionlessBundleValueCardInput, type ComposePermissionlessBundleValueCardResult, type ConfigureEscalatingPromoterPolicyInput, type ConfigureNftPayloadVisibilityInput, type ContractGuardPredicate, type ContractNftPayload, type CreateBondingCurveFactoryInput, type CreateConstantProductPoolInput, type CreateGiveToMintTokenInput, type CreateNativeNftListingInput, type CreateNftBuyOfferInput, type CreateSponsorBudgetPoolInput, type CreationSocialObject, type CreatorThankYouBadge, type CrossChainDepositSpec, type CrossChainPurchaseInput, type CrossChainSettlementProof, type CrowdloanContributorPosition, DEFAULT_ABT_TOKEN_ADDRESS, DEFAULT_ANTI_SNIPE_WINDOW_SECONDS, DEFAULT_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, DEFAULT_EPOCH_KARMA_ALLOWANCE, DEFAULT_EXCHANGE_ABT_TOKEN_ADDRESS, DEFAULT_EXCHANGE_SWAP_FEE_BPS, DEFAULT_FISHERMAN_DEFECT_BOUNTY_BPS, DEFAULT_FT_ISSUANCE_FEE_ABT, DEFAULT_GRADUATION_FEE_ABT, DEFAULT_ISSUER_STAGING_TTL_EPOCHS, DEFAULT_KARMA_TOKEN_ADDRESS, DEFAULT_LP_JITTER_WINDOW_BLOCKS, DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS, DEFAULT_MAX_HISTORICAL_KARMA_CLAIM, DEFAULT_MAX_ROLLUP_BLOCK_SIZE, DEFAULT_MAX_STATEMENTS_PER_HOT_KEY_PER_BLOCK, DEFAULT_MAX_SWAP_PRICE_IMPACT_BPS, DEFAULT_MAX_SWEEP_BATCH_SIZE, DEFAULT_MIN_ENGLISH_BID_INCREMENT_BPS, DEFAULT_MIN_GRADUATION_RESERVE_ABT, DEFAULT_MIN_GRADUATION_UNIQUE_HOLDERS, DEFAULT_MIN_HOLDING_BLOCKS, DEFAULT_MIN_SELF_BRIDGE_SECURITY_BOND_ABT, DEFAULT_MIN_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, DEFAULT_NFT_PROTOCOL_FEE_BPS, DEFAULT_NFT_UI_REFERRER_FEE_BPS, DEFAULT_OCAP_INTEGRATOR_ID, DEFAULT_OFFICIAL_TOKEN_ADDRESS, DEFAULT_PROTOCOL_FEE_SHARE_BPS, DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS, DEFAULT_SELF_BRIDGE_REGISTRATION_FEE_ABT, DEFAULT_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, DEFAULT_SKU_QUALITY_BASE_STAKE_ABT, DEFAULT_SPONSORED_BADGE_MINT_QUOTA, DEFAULT_USD_QUOTE_TTL_SECONDS, DEFAULT_VALUE_CARD_PROTOCOL_FEE_BPS, DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS, DEPRECATED_MIOTX_AND_TRADE_TYPE_URLS, DEPRECATED_MIOTX_PROTOCOL_TYPE_URLS, DEPRECATED_ROLLUP_AND_BRIDGE_TYPE_URLS, DEPRECATED_ROLLUP_PROTOCOL_TYPE_URLS, DEPRECATED_VERSIONED_ASSET_TYPE_URLS, DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP, type DeprecatedLegacyProtocolTypeUrl, type DeprecatedRollupProtocolTypeUrl, type DidKarmaIdentityState, type DirectBuyExternalSettlementMode, type DirectBuyOcapFulfillmentMode, type DirectBuyPricingPolicyMode, DirectBuyTreasuryCashier, type DirectBuyTreasuryCashierConfig, type DirectBuyTreasuryCashierInput, type DirectBuyTreasuryCashierPlan, type DomainCoupledProtocolAliasTypeUrl, type DynamicCategoryStakeFloorResult, type Erc7683FillInstruction, type Erc7683Output, type Erc7683ResolvedCrossChainOrder, type EscalatingPromoterTier, type ExchangeFactoryMode, type ExecuteProgrammaticPolRebalanceInput, type ExecuteProgrammaticPolRebalanceResult, type ExecuteUnifiedSkuCheckoutInput, type ExternalPaymentChainFamily, type ExternalSwapHookInput, type ExternalSwapHookResult, FORBIDDEN_EXTERNAL_CALL_SELECTORS, type FactoryBlueprintRolloutResult, type FactoryBlueprintSafetyReport, type FactorySafetyInvariant, type FulfillNativeNftListingInput, type FunctionalUtilityCategory, type FunctionalUtilityCharter, GIVE_TO_MINT_TOKEN_TYPE, type GiveToMintDistributionEntry, type GiveToMintRequest, type GiveToMintResult, type GiveToMintTokenConfig, type GovernanceExchangePolicy, type GrantSpaceAssetDelegationInput, HARD_MAX_SWAP_PRICE_IMPACT_BPS, HARD_MAX_TX_BLOCK_STATEMENTS, HISTORICAL_CLAIM_TRUST_BOOST_BPS, type HistoricalKarmaClaimInput, type HistoricalKarmaClaimResult, type HistoricalSourcePlatform, type HookFeeTierName, IBO_DIVIDEND_PRECISION, type IboOrganizationState, type IboPartnerPosition, type IncubatedTokenFactoryRecord, type IncubatedTokenFactorySpec, type IssuePermissionlessTokenInput, type IssuePostpaidCreditCardInput, type IssuePrepaidBudgetCardInput, type IssuePrepaidValueCardInput, type KarmaCitationShare, type KarmaIndexedPoolSettlementInput, type KarmaIndexedPoolSettlementResult, type KarmaSettlementPoolFactoryRecord, type KarmaSettlementPoolFactorySpec, type KarmaStakeLock, type LegacyMiotxParticipantEntry, LegacyProtocolCompatibilityAddon, type LegacyProtocolReplacementSpec, type LegacyProtocolSunsetCategory, type LegacyRollupReadOnlySummary, type LegacyRollupRecordKind, type LegacyTokenAmountEntry, type LegacyTxReadOnlyArchiveSummary, type LiquidateDefaultedPostpaidCardInput, type LockAttentionStampInput, type LpRebalanceProposalInput, MAX_ACTIVE_INTENTS_PER_USER, MAX_ACTIVE_MATURING_REBATES_PER_DISTRIBUTOR, MAX_ACTIVE_SPONSORED_BADGE_MINT_QUOTA, MAX_ALLOWED_ZAP_SLIPPAGE_BPS, MAX_ARCADE_HOUSE_SPLIT_BPS, MAX_ARCADE_WINNERS_PER_ROUND, MAX_ATTENTION_STAMP_TTL_EPOCHS, MAX_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MAX_CHECKPOINT_VOUCHERS_PER_BATCH, MAX_CONTRACT_ARGS_BYTES, MAX_CONTRACT_FOOTPRINT_KEYS, MAX_CONTRACT_NFT_STATEMENTS, MAX_CUSTOM_TOKEN_EPOCH_ALLOWANCE, MAX_CUSTOM_TOKEN_HISTORICAL_CLAIM_CAP, MAX_DISTRIBUTOR_STAKE_COOLDOWN_SECONDS, MAX_EPOCH_FORWARD_DRIFT, MAX_ESCALATING_PROMOTER_REBATE_BPS, MAX_ESCALATING_PROMOTER_TIERS, MAX_EXCHANGE_SWAP_FEE_BPS, MAX_EXECUTE_ASSET_CALLS_PER_BLOCK, MAX_EXECUTE_ASSET_DEPTH, MAX_FREE_RELAY_CREDITS_PER_EPOCH, MAX_FT_ISSUANCE_FEE_ABT, MAX_GRADUATION_RESERVE_ABT_CEILING, MAX_GRADUATION_UNIQUE_HOLDERS_CEILING, MAX_HARVEST_YIELD_BPS, MAX_HISTORICAL_KARMA_PER_VERIFIED_ITEM, MAX_HOOK_TICKET_TTL_SECONDS, MAX_IBO_TOTAL_FEE_SPLIT_BPS, MAX_INTENT_TIMEOUT_BLOCKS, MAX_ISSUER_STAGING_TTL_EPOCHS, MAX_LEGACY_MIOTX_ASSETS_PER_ENTRY, MAX_LEGACY_MIOTX_PARTICIPANTS, MAX_LEGACY_MIOTX_TOKENS_PER_ENTRY, MAX_LP_REBALANCE_SLIPPAGE_BPS, MAX_MINT_RATIO_PER_RESERVE_UNIT, MAX_NFT_CREATOR_ROYALTY_BPS, MAX_NFT_OFFER_PREDICATES, MAX_PREPAID_CARD_ALLOWED_PROVIDERS, MAX_PROTOCOL_FEE_SHARE_BPS, MAX_ROUTE_PATH_LENGTH, MAX_SKU_ALPHA_PROTECTION_WINDOW_SECONDS, MAX_SKU_QUALITY_DYNAMIC_STAKE_ABT, MAX_SOVEREIGN_NFT_FACTORY_SUPPLY, MAX_SPACE_DISPLAYED_STICKERS, MAX_SPACE_PLACED_MACHINES, MAX_SPONSORED_BADGE_MINT_QUOTA_PER_GRANT, MAX_STICKER_ROYALTY_BPS, MAX_TOTAL_CITATION_SHARE_BPS, MAX_TRACKED_CURVE_HOLDERS, MAX_TRACKED_DIRECT_BUY_EVIDENCES, MAX_TX_BLOCK_BYTES, MAX_TX_BLOCK_READ_KEYS, MAX_TX_BLOCK_STATE_DIFF_ENTRIES, MAX_TX_BLOCK_TOP_LEVEL_STATEMENTS, MAX_TX_BLOCK_TOTAL_EXPANDED_STATEMENTS, MAX_TX_BLOCK_WRITE_KEYS, MAX_UNISWAP_TICK, MAX_UPSTREAM_CITATIONS, MAX_USD_QUOTE_TTL_SECONDS, MAX_V4_DYNAMIC_FEE_BPS, MAX_VALUE_CARD_ALLOWED_MERCHANTS, MAX_VALUE_CARD_ALLOWED_SERVICE_TAGS, MAX_VALUE_CARD_ATTRIBUTION_HOPS, MAX_VALUE_CARD_ATTRIBUTION_TOTAL_BPS, MAX_VALUE_CARD_DISTRIBUTOR_STAKE_ABT, MAX_VAULT_STRATEGY_DEPLOYED_BPS, MAX_ZAP_ABT_PER_SETTLEMENT_SCALAR, MAX_ZAP_PRICE_IMPACT_BPS, MINIMUM_LOCKED_AMM_LIQUIDITY, MIN_ARCADE_HOUSE_SPLIT_BPS, MIN_ATTENTION_STAMP_ABT, MIN_BASELINE_TOKEN_ISSUANCE_STAKE_ABT, MIN_CREATOR_VESTING_CLIFF_BLOCKS, MIN_FT_ISSUANCE_FEE_ABT, MIN_GIVE_TO_MINT_DUST_FLOOR, MIN_GIVE_TO_MINT_TOKEN_CREATION_FEE, MIN_GRADUATION_HOLDER_SHARE_BPS, MIN_GRADUATION_RESERVE_ABT_FLOOR, MIN_KARMA_FOR_THANK_YOU_BADGE, MIN_LP_MEV_REBATE_SHARE_BPS, MIN_RECOMMENDED_SOLVER_SHARDS, MIN_UNISWAP_TICK, MIN_VAULT_LIQUID_BUFFER_BPS, type MakeStickerOfferInput, type ManagedIntentRecord, type MaturingCardSettlementRecord, type MaturingDistributorRebateRecord, type MinerRevenueTier, type MinerShopPersonaPublicRecord, type MintSovereignNftInput, type NativeNftBuyOfferRecord, type NativeNftListingMode, type NativeNftListingRecord, type NativeNftOfferSettlementResult, type NativeNftSettlementResult, type NativeSwapExecutionResult, type NftAttributePredicate, type NftAttributePredicateOperator, type NftPayloadAccessResolution, type NftPayloadCustodyState, type NftPayloadVisibility, type NonCustodialLpContractNftAsset, type NonCustodialLpGuardSpec, OCAP_VERIFIED_HOOK_SOLIDITY_SPEC, OcapArcVaultExternalAdapterEngine, OcapErc7683SolverEngine, OcapGiveToMintEngine, type OcapHookTicketClaims, OcapNativeAbtExchangeEngine, OcapNativeExchangeEngine, OcapSocialEconomyFactoryRegistry, OcapSovereignAppChainHubEngine, OcapSuperSuitesFoundationEngine, OcapTokenFactoryGraduationEngine, OcapVerifiedHookEngine, type OpenComposingRuleClaims, type OriginEscrowProof, type OutboundWithdrawAndSwapInput, type OutboundWithdrawAndSwapPlan, OverlayStateDB, type PathPaymentCheckoutInput, type PendingTransferRecord, type PerTokenAccountKarmaState, type Permit2SingleSpec, type PfmCrossSpokePacketInput, type PilotPrivateCircleDeliveryInput, type PilotPrivateCircleDeliveryResult, type PilotPublicContentAppreciationInput, type PilotPublicContentAppreciationResult, type PlaceEnglishNftBidInput, type PlayArcadeMachineTicketInput, type PlayArcadeMachineTicketResult, type PostCategoryDemandBountyInput, type PrepaidBudgetCardNft, type PreparedTransactionBlock, type PurchaseDedicatedValueCardInput, type PurchaseDedicatedValueCardResult, RECIPROCAL_RING_DAMPING_BPS, type RecalibrateDynamicStakeFloorInput, type RecalibrateDynamicStakeFloorResult, type RedeemPrepaidBudgetCardInput, type RedeemPrepaidBudgetCardResult, type RedeemPrepaidValueCardInput, type RegisterArcadeMachineInput, type RegisterIboOrganizationInput, type RegisterMinerShopPersonaInput, type RegisterSelfOperatedBridgeInput, type RegisterSkuFactoryListingInput, type RegisterStickerNftInput, type ReleaseMaturedCardSettlementInput, type ReleaseMaturedDistributorRebateInput, type RemoveAmmLiquidityInput, type ReputationTokenFactoryInput, type ReputationTokenFactoryRecord, type ResolveAttentionStampInput, type ResolveAttentionStampResult, type ResolvedTransactionBlockBudget, type RetireDestroyedTokenInput, type RewardCoalitionValueCardInput, type RewardCoalitionValueCardResult, type RollupBranchInfo, type RollupBranchResolver, type SelectedTreasuryCurrencySpec, type SelectedTreasuryCurrencySymbol, type SelfOperatedSubTokenBridgeRecord, type SettleArcadeMachineWinnersInput, type SettleArcadeMachineWinnersResult, type SettleIboServiceCheckoutInput, type SettleIboServiceCheckoutResult, type SettlePostpaidValueCardInput, type SignedOcapHookTicket, type SignedOpenComposingRuleVc, type SingleHopAbtSwapInput, type SkuFactoryListingRecord, type SkuGranularMetricsView, type SkuOrderSettlementRecord, type SocialEconomyFactoryBlueprint, type SocialEconomyFactoryKind, type SolverEngineConfig, type SolverExecutionMode, type SovereignNftAccessResolution, type SovereignNftCategory, type SovereignNftFactoryRecord, type SovereignNftFactorySpec, type SovereignNftInstance, type SovereignReserveState, type SpaceAssetDelegationGrant, type SpaceManifestAnchorRecord, type SpendValueCardInput, type SpendValueCardResult, type SpokeCrowdloanState, type SponsorBudgetPoolState, StagedSyncPipeline, type StakeForValueCardDistributorInput, type StakeForValueCardDistributorResult, type StateDiffEntry, type StateFootprint, type StatementExecutor, type StickerNftRecord, type StickerOfferRecord, type SyncStage, type TokenFactoryGraduationStatus, type TopUpPrepaidValueCardInput, type TransactionBlockInput, type TransactionBlockPostConditions, type TransactionBlockResourceBudget, type TransactionBlockResult, type TransactionStatement, type TwoHopTokenSwapInput, TwoPhaseCommitCoordinator, TwoPhaseTransferLedger, UNIVERSAL_ROUTER_COMMANDS, type UnifiedAbtExchangePoolState, type UniversalAbtZapInInput, type UniversalAbtZapInResult, type UniversalRouterCrossChainZapInput, type UniversalRouterCrossChainZapPayload, type UnlistedTokenExternalSwapSpec, type UnstakeValueCardDistributorInput, type UnstakeValueCardDistributorResult, type UpdateGovernanceExchangePolicyInput, type UsdAnchoredAbtQuote, type UsdAnchoredAbtQuoteInput, type UserIssuedTokenRecord, type V4PoolComplianceMode, type V4PoolHookConfig, type VLedgerCheckpointInput, VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS, type VNextCanonicalWriteProtocolTypeUrl, type ValueCardDistributorStakeRecord, type ValueCardFundingLineage, type ValueCardMode, type ValueCardPolicyEnvelope, type ValueCardRecord, type VerifiableEpochArchiveCheckpoint, type VerifiableMinerRevenueBadge, type VerifiedCreatorCredential, type VerifyUsdAnchoredAbtQuoteInput, type WalletClearSigningPreview, ZERO_BYTES32_HASH, assertLeafStatementTemplateOnly, assertLegacyProtocolNotSunset, assertNotOfacSanctioned, assertRollupProtocolNotSunset, assertTransactionBlockResourceBudget, assertTransactionBlockVNextPure, assertZeroPiiInHookData, buildAbtUtilityPassThroughPlan, buildDirectBuyTreasuryCashierPlan, buildNonCustodialLpContractNft, buildOutboundWithdrawAndSwapPlan, buildUniversalRouterCrossChainPayload, buildWalletClearSigningPreview, compileLegacyTxToVNextTransactionBlock, computeAccountAndAssetNetEffects, computeArcSpaceCheckpointRoot, computeArcSpaceVoucherDigest, computeArcadeCommitDigest, computeDeterministicRebalanceSlot, computeDeterministicV4GraduationPoolId, computeEvmBridgeBlockHash, computeEvmBridgeTxsHash, computeHistoricalClaimNullifier, computeNftPayloadCommitmentDigest, computeOcapHookTicketDigest, computeOpenComposingRuleVcDigest, computeSelfBridgeDisclaimerDigest, computeSpaceManifestRootDigest, computeStakeAddress, computeVLedgerCheckpointStateRoot, createOverlayStateDB, createUsdAnchoredAbtQuote, deriveCompanionMedalDid, deriveSkuQualityStakeAddress, deriveSovereignNftDid, deriveSovereignVaultDid, deriveThankYouBadgeDid, deriveValueCardDistributorStakeAddress, evaluateNftAttributePredicates, executeContractNft, executeCrossChainPurchaseBlock, executeNonCustodialLpRebalance, executeTransactionBlock, executeVNextTransactionBlock, extractStateFootprint, getLegacyProtocolReplacementSpec, hasStateConflict, integerSqrtBn, isDeprecatedLegacyWriteProtocol, isDeprecatedRollupWriteProtocol, isDomainCoupledProtocolAlias, isExecuteAssetStatement, isMiotxLegacyProtocol, isVNextCanonicalWriteProtocol, issueOcapHookTicket, issueOpenComposingRuleVc, normalizeProtocolTypeUrl, normalizeScreeningAddress, parseLegacyRollupReadOnlyRecord, parseLegacyTxReadOnlyArchiveRecord, resolveDomainAgnosticVNextProtocol, resolveEffectiveResourceBudget, resolveEscalatingPromoterBps, resolveStatementReferences, rollupBranchOf, scheduleParallelBatches, selectSolverSubVaultShard, verifyOcapHookTicketSignature, verifyOpenComposingRuleVc, verifyTransactionBlockPostConditions, verifyUsdAnchoredAbtQuote };
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_bridge_release_keys = require('../bridge-release-keys.cjs');
3
3
  const require_bridge_reserves = require('../bridge-reserves.cjs');
4
+ let _ocap_mcrypto = require("@ocap/mcrypto");
4
5
  let _ocap_util = require("@ocap/util");
5
6
  let lodash_isEqual = require("lodash/isEqual");
6
7
  lodash_isEqual = require_rolldown_runtime.__toESM(lodash_isEqual);
@@ -9,13 +10,20 @@ lodash_isEqual = require_rolldown_runtime.__toESM(lodash_isEqual);
9
10
  /**
10
11
  * Gate rules of the release primitive (#1466, bridge/docs/ocap-protocols.md §3 and §v2.4): R4 and the ownership of the
11
12
  * release-window buckets. R1-R3 and R5 for the reserves themselves live in `bridge-reserve-v2-gate.ts`; this file only
12
- * adds what is specific to `release_bridge_token`.
13
+ * adds what is specific to a bridge release (`deposit_token_v2` with kind 1/2/3).
13
14
  *
14
- * - **Ownership.** A bucket row (two rings of 24 hourly slots per bridge, in the evidence table) may be written only by
15
- * `release_bridge_token`. A row is recognised by what it says about itself (`identifyBucketRow`: its data names the
16
- * bridge, ring and slot, and its key is the key recomputed from them), so no global list of bridges is needed.
17
- * - **R4, accounting.** A release debits exactly the reserve it is entitled to (the reserve of `itx.bridge`; for a REFUND
18
- * of a migrated bridge the reserve that holds the funds now) by exactly `itx.amount` of the bridge token, and credits
15
+ * - **Ownership of the release key space (#1680).** Tombstones (`rt:`) and buckets (`rb:`) live in a self-identifying key
16
+ * space no `patterns.txHash` key can reach (`@ocap/mcrypto` `inBridgeReleaseKeySpace`). Every tx type but
17
+ * a bridge release is refused any write in it, recognised by the KEY alone, whatever the row's data; a bucket is
18
+ * also recognised by what it says about itself (`identifyBucketRow`). A release writes in that space only its own
19
+ * tombstone and the one bucket it uses.
20
+ * - **Ownership of the other bridge records (#1680, #1505 L2).** Membership tombstones and the gateway / token / reserve
21
+ * index rows keep keccak `0x` keys, which a legacy v1 tx CAN name. They are safe because a row there counts only when
22
+ * it reads as a genuine bridge record (`data.type = json`, a bridge `kind`); any other row is overwritten by its owner.
23
+ * So no protocol may write caller-supplied data at a caller-supplied key that reads as one: a row that reads as a
24
+ * bridge record may be written (or overwritten) only by the tx types that own that record.
25
+ * - **R4, accounting.** A release debits exactly the reserve it is entitled to (the reserve of `itx.rollup`; for a REFUND
26
+ * of a migrated bridge the reserve that holds the funds now) by exactly `itx.token.value` of the bridge token, and credits
19
27
  * exactly one account, `itx.to`, by the same amount. The only other balance movement is the gas: the vaults gain it and
20
28
  * the sender (`tx.from`) pays it, to the unit.
21
29
  * - **Records.** A release creates its tombstone and writes exactly one bucket of the ring of its kind, for its own
@@ -25,6 +33,40 @@ lodash_isEqual = require_rolldown_runtime.__toESM(lodash_isEqual);
25
33
  */
26
34
  const ZERO = new _ocap_util.BN(0);
27
35
  const CANONICAL_UINT = /^(?:0|[1-9]\d*)$/;
36
+ /**
37
+ * Whether `txType` / `itx` is a release that owns the release key space and is accounted by R4: `deposit_token_v2` with
38
+ * `kind ∈ {1,2,3}` naming its bridge in `itx.rollup` (`isNamedBridgeRelease`). A v1 deposit (`kind == 0`), or a bridge
39
+ * kind that names no bridge, owns nothing here.
40
+ */
41
+ const isReleaseForm = (txType, itx) => require_bridge_reserves.isNamedBridgeRelease(txType, itx);
42
+ /** The release fields: the deposit fields, reused (`rollup`, `token.value`, `evidence.hash`, `token.address`). */
43
+ const releaseFieldsOf = (itx) => {
44
+ const token = itx.token ?? {};
45
+ const evidence = itx.evidence ?? {};
46
+ return {
47
+ label: "deposit_token_v2 (bridge release)",
48
+ bridge: itx.rollup,
49
+ amount: token.value,
50
+ evidence: evidence.hash,
51
+ token: token.address
52
+ };
53
+ };
54
+ /** owners of the hex-keyed bridge records, by `data.value.kind` (#1505 L2 rows, membership tombstones) */
55
+ const BRIDGE_RECORD_OWNERS = {
56
+ "bridge-join": new Set(["join_rollup", "leave_rollup"]),
57
+ "bridge-leave": new Set(["join_rollup", "leave_rollup"]),
58
+ "bridge-gateway": new Set(["create_rollup", "close_rollup"]),
59
+ "bridge-token": new Set(["create_rollup", "close_rollup"]),
60
+ "bridge-reserve": new Set(["create_rollup"])
61
+ };
62
+ const MEMBERSHIP_KINDS = new Set(["bridge-join", "bridge-leave"]);
63
+ /** the bridge record kind a row reads as, or null */
64
+ const bridgeRecordKind = (row) => {
65
+ const data = row?.data;
66
+ if (!data || typeof data !== "object" || data.type !== "json") return null;
67
+ const kind = data.value && typeof data.value === "object" ? data.value.kind : void 0;
68
+ return typeof kind === "string" && Object.prototype.hasOwnProperty.call(BRIDGE_RECORD_OWNERS, kind) ? kind : null;
69
+ };
28
70
  const bodyOf = (row) => {
29
71
  const v = (row?.data)?.value;
30
72
  return v && typeof v === "object" ? v : null;
@@ -33,34 +75,45 @@ function assertBridgeReleaseProtected(input) {
33
75
  const { txType, itx, norm, createGateError } = input;
34
76
  const violation = (code, message) => createGateError(code, `Post-Execution Invariant Gate: ${message}`);
35
77
  const writtenEvidence = input.written("evidence") ?? /* @__PURE__ */ new Set();
36
- if (txType !== "release_bridge_token") {
37
- for (const key of writtenEvidence) {
38
- const row = input.after.get("evidence")?.get(key) ?? input.before.get("evidence")?.get(key) ?? null;
39
- const prior = input.before.get("evidence")?.get(key) ?? null;
40
- if (require_bridge_release_keys.identifyBucketRow(row) || require_bridge_release_keys.identifyBucketRow(prior)) throw violation("BRIDGE_RELEASE_BUCKET_FORBIDDEN", `release-window bucket ${key} may only be written by release_bridge_token, not a ${txType || "unknown"} tx`);
78
+ for (const key of writtenEvidence) {
79
+ const row = input.after.get("evidence")?.get(key) ?? input.before.get("evidence")?.get(key) ?? null;
80
+ const prior = input.before.get("evidence")?.get(key) ?? null;
81
+ const rowKind = bridgeRecordKind(row);
82
+ const priorKind = bridgeRecordKind(prior);
83
+ for (const kind$1 of [rowKind, priorKind]) if (kind$1 && !BRIDGE_RECORD_OWNERS[kind$1]?.has(txType)) throw violation("BRIDGE_RECORD_FORBIDDEN", `evidence ${key} reads as a ${kind$1} record, which a ${txType || "unknown"} tx may not write`);
84
+ if (priorKind && !rowKind) throw violation("BRIDGE_RECORD_FORBIDDEN", `the ${priorKind} record ${key} may only be replaced by a record of its own kind, never by other data`);
85
+ if (rowKind && prior) {
86
+ if (!(priorKind === rowKind && !MEMBERSHIP_KINDS.has(rowKind)) && !require_bridge_release_keys.isV1EvidenceRow(prior)) throw violation("BRIDGE_RECORD_FORBIDDEN", `a ${rowKind} record may not replace the existing evidence row ${key} (only a v1-planted row or a ${rowKind} index entry)`);
41
87
  }
42
- return;
88
+ if (isReleaseForm(txType, itx)) continue;
89
+ if (require_bridge_release_keys.identifyBucketRow(row) || require_bridge_release_keys.identifyBucketRow(prior) || /^rb:/i.test(String(key).trim())) throw violation("BRIDGE_RELEASE_BUCKET_FORBIDDEN", `release-window bucket ${key} may only be written by a deposit_token_v2 bridge release, not a ${txType || "unknown"} tx`);
90
+ if ((0, _ocap_mcrypto.inBridgeReleaseKeySpace)(key)) throw violation("BRIDGE_RELEASE_TOMBSTONE_FORBIDDEN", `release tombstone ${key} may only be written by a deposit_token_v2 bridge release, not a ${txType || "unknown"} tx`);
43
91
  }
92
+ if (!isReleaseForm(txType, itx)) return;
44
93
  const R4 = (message) => violation("BRIDGE_RELEASE_ACCOUNTING_VIOLATION", message);
94
+ const fields = releaseFieldsOf(itx);
95
+ const label = fields.label;
45
96
  const release = input.resolution?.release ?? null;
46
- if (!release) throw R4("release_bridge_token names no existing bridge (itx.bridge)");
97
+ if (!release) throw R4(`${label} names no existing bridge (itx.rollup)`);
98
+ if (typeof fields.bridge !== "string" || release.bridge.address !== fields.bridge) throw R4(`${label} names bridge ${String(fields.bridge)}, not the resolved bridge ${release.bridge.address}`);
47
99
  const kind = Number(itx.kind);
48
100
  if (![
49
101
  1,
50
102
  2,
51
103
  3
52
- ].includes(kind)) throw R4("release_bridge_token has an unknown kind");
53
- if (typeof itx.amount !== "string" || !CANONICAL_UINT.test(itx.amount)) throw R4("release_bridge_token amount must be a canonical decimal string");
54
- const amount = new _ocap_util.BN(itx.amount, 10);
55
- if (amount.isZero()) throw R4("release_bridge_token amount must be positive");
104
+ ].includes(kind)) throw R4(`${label} has an unknown kind`);
105
+ if (typeof fields.amount !== "string" || !CANONICAL_UINT.test(fields.amount)) throw R4(`${label} amount must be a canonical decimal string`);
106
+ const amount = new _ocap_util.BN(fields.amount, 10);
107
+ if (amount.isZero()) throw R4(`${label} amount must be positive`);
56
108
  const toKey = norm(itx.to);
57
- if (!toKey || input.isReserveAddress(toKey)) throw R4("release_bridge_token recipient must not be a bridge reserve");
58
- if (input.vaults.has(toKey)) throw R4("release_bridge_token recipient must not be a vault");
109
+ if (!toKey || input.isReserveAddress(toKey)) throw R4(`${label} recipient must not be a bridge reserve`);
110
+ if (input.vaults.has(toKey)) throw R4(`${label} recipient must not be a vault`);
59
111
  const expectedReserve = norm(kind === 2 ? release.fundsReserve : release.reserve);
60
112
  const owner = release.debitable.get(require_bridge_reserves.bareAddress(kind === 2 ? release.fundsReserve : release.reserve));
61
- if (!owner) throw R4("release_bridge_token does not resolve the reserve it must debit");
113
+ if (!owner) throw R4(`${label} does not resolve the reserve it must debit`);
62
114
  const tokenKey = norm(owner.token);
63
- if (!tokenKey) throw R4("release_bridge_token has no bridge token");
115
+ if (!tokenKey) throw R4(`${label} has no bridge token`);
116
+ if (typeof fields.token !== "string" || fields.token !== release.bridge.token) throw R4(`${label} names token ${String(fields.token)}, not the bridge token ${release.bridge.token}`);
64
117
  for (const table of [
65
118
  "stake",
66
119
  "token",
@@ -69,8 +122,8 @@ function assertBridgeReleaseProtected(input) {
69
122
  "factory",
70
123
  "delegation",
71
124
  "rollupBlock"
72
- ]) if ((input.written(table)?.size || 0) > 0) throw R4(`release_bridge_token must not write ${table} records`);
73
- if (input.directBalanceWrites.length > 0 || (input.written("balance")?.size || 0) > 0) throw R4("release_bridge_token must not write the balance table directly");
125
+ ]) if ((input.written(table)?.size || 0) > 0) throw R4(`${label} must not write ${table} records`);
126
+ if (input.directBalanceWrites.length > 0 || (input.written("balance")?.size || 0) > 0) throw R4(`${label} must not write the balance table directly`);
74
127
  const officialKey = input.officialToken;
75
128
  const beforeAccounts = input.before.get("account") ?? /* @__PURE__ */ new Map();
76
129
  const afterAccounts = input.after.get("account") ?? /* @__PURE__ */ new Map();
@@ -88,7 +141,7 @@ function assertBridgeReleaseProtected(input) {
88
141
  const deltaOf = (addr, tok) => actual.get(addr)?.get(tok) ?? ZERO;
89
142
  let gas = ZERO;
90
143
  for (const vault of input.vaults) for (const [tok, d] of actual.get(vault) ?? []) {
91
- if (tok !== officialKey || d.isNeg()) throw R4(`release_bridge_token may only credit vault ${vault} with the gas`);
144
+ if (tok !== officialKey || d.isNeg()) throw R4(`${label} may only credit vault ${vault} with the gas`);
92
145
  gas = gas.add(d);
93
146
  }
94
147
  const expected = /* @__PURE__ */ new Map();
@@ -104,19 +157,21 @@ function assertBridgeReleaseProtected(input) {
104
157
  if (input.vaults.has(addr)) continue;
105
158
  for (const tok of new Set([...actual.get(addr)?.keys() ?? [], ...expected.get(addr)?.keys() ?? []])) {
106
159
  const want = expected.get(addr)?.get(tok) ?? ZERO;
107
- if (!deltaOf(addr, tok).eq(want)) throw R4(`release_bridge_token moved ${deltaOf(addr, tok).toString(10)} of ${tok} for ${addr}, expected ${want.toString(10)} (reserve -${amount.toString(10)}, recipient +${amount.toString(10)}, sender -gas)`);
160
+ if (!deltaOf(addr, tok).eq(want)) throw R4(`${label} moved ${deltaOf(addr, tok).toString(10)} of ${tok} for ${addr}, expected ${want.toString(10)} (reserve -${amount.toString(10)}, recipient +${amount.toString(10)}, sender -gas)`);
108
161
  }
109
162
  }
110
- const tombstone = require_bridge_release_keys.getReleaseTombstoneKey(String(itx.bridge), kind, String(itx.evidence || ""), Number(itx.ordinal));
111
- if (!writtenEvidence.has(tombstone) || input.before.get("evidence")?.get(tombstone)) throw R4("release_bridge_token must create its tombstone");
163
+ const tombstone = require_bridge_release_keys.getReleaseTombstoneKey(String(fields.bridge), kind, String(fields.evidence || ""), Number(itx.ordinal));
164
+ if (!writtenEvidence.has(tombstone) || input.before.get("evidence")?.get(tombstone)) throw R4(`${label} must create its tombstone`);
112
165
  const ring = kind === 2 ? "refund" : "deposit";
113
166
  const buckets = [...writtenEvidence].filter((k) => require_bridge_release_keys.identifyBucketRow(input.after.get("evidence")?.get(k)) !== null);
114
167
  const bucket = buckets.length === 1 ? require_bridge_release_keys.identifyBucketRow(input.after.get("evidence")?.get(buckets[0])) : null;
115
- if (!bucket || bucket.bridge !== String(itx.bridge) || bucket.ring !== ring) throw R4(`release_bridge_token must write exactly one ${ring} release-window bucket of bridge ${String(itx.bridge)}, wrote ${buckets.length}`);
168
+ if (!bucket || bucket.bridge !== String(fields.bridge) || bucket.ring !== ring) throw R4(`${label} must write exactly one ${ring} release-window bucket of bridge ${String(fields.bridge)}, wrote ${buckets.length}`);
169
+ const stray = [...writtenEvidence].filter((k) => (0, _ocap_mcrypto.inBridgeReleaseKeySpace)(k) && k !== tombstone && k !== buckets[0]);
170
+ if (stray.length > 0) throw R4(`${label} may write only its tombstone and one bucket in the release key space, also wrote ${stray[0]}`);
116
171
  const ledgerBridges = kind === 2 ? [...release.debitable.values()].filter((b) => b.reserve !== release.fundsReserve).map((b) => b.address) : [];
117
172
  const writtenRollups = [...input.written("rollup") ?? []];
118
173
  const expectedRows = new Set(ledgerBridges.map((a) => require_bridge_reserves.bareAddress(a)));
119
- if (writtenRollups.length !== expectedRows.size || writtenRollups.some((k) => !expectedRows.has(require_bridge_reserves.bareAddress(k)))) throw R4("release_bridge_token may write only the refund ledger of the migrated bridges it draws through");
174
+ if (writtenRollups.length !== expectedRows.size || writtenRollups.some((k) => !expectedRows.has(require_bridge_reserves.bareAddress(k)))) throw R4(`${label} may write only the refund ledger of the migrated bridges it draws through`);
120
175
  for (const key of writtenRollups) {
121
176
  const prior = [...input.before.get("rollup")?.entries() ?? []].find(([k]) => require_bridge_reserves.bareAddress(k) === require_bridge_reserves.bareAddress(key));
122
177
  const next = [...input.after.get("rollup")?.entries() ?? []].find(([k]) => require_bridge_reserves.bareAddress(k) === require_bridge_reserves.bareAddress(key));
@@ -124,8 +179,8 @@ function assertBridgeReleaseProtected(input) {
124
179
  const nb = bodyOf(next?.[1]);
125
180
  const oldAmount = pb?.migratedAmount;
126
181
  const newAmount = nb?.migratedAmount;
127
- if (!pb || !nb || typeof oldAmount !== "string" || typeof newAmount !== "string") throw R4(`release_bridge_token needs a recorded refund ledger (migratedAmount) on migrated bridge ${key}`);
128
- if (!CANONICAL_UINT.test(oldAmount) || !CANONICAL_UINT.test(newAmount) || !new _ocap_util.BN(oldAmount, 10).sub(amount).eq(new _ocap_util.BN(newAmount, 10)) || new _ocap_util.BN(oldAmount, 10).lt(amount)) throw R4(`release_bridge_token must lower the refund ledger of ${key} by exactly ${amount.toString(10)}`);
182
+ if (!pb || !nb || typeof oldAmount !== "string" || typeof newAmount !== "string") throw R4(`${label} needs a recorded refund ledger (migratedAmount) on migrated bridge ${key}`);
183
+ if (!CANONICAL_UINT.test(oldAmount) || !CANONICAL_UINT.test(newAmount) || !new _ocap_util.BN(oldAmount, 10).sub(amount).eq(new _ocap_util.BN(newAmount, 10)) || new _ocap_util.BN(oldAmount, 10).lt(amount)) throw R4(`${label} must lower the refund ledger of ${key} by exactly ${amount.toString(10)}`);
129
184
  const strip = (row) => {
130
185
  const { context: _context, data, ...rest } = row ?? {};
131
186
  const { migratedAmount: _ma, ...body } = bodyOf(row) ?? {};
@@ -137,9 +192,10 @@ function assertBridgeReleaseProtected(input) {
137
192
  }
138
193
  };
139
194
  };
140
- if (!(0, lodash_isEqual.default)(strip(prior?.[1]), strip(next?.[1]))) throw R4(`release_bridge_token may change only the refund ledger of bridge ${key}`);
195
+ if (!(0, lodash_isEqual.default)(strip(prior?.[1]), strip(next?.[1]))) throw R4(`${label} may change only the refund ledger of bridge ${key}`);
141
196
  }
142
197
  }
143
198
 
144
199
  //#endregion
145
- exports.assertBridgeReleaseProtected = assertBridgeReleaseProtected;
200
+ exports.assertBridgeReleaseProtected = assertBridgeReleaseProtected;
201
+ exports.bridgeRecordKind = bridgeRecordKind;
@@ -2,7 +2,6 @@ import { BridgeReserveResolution } from "../bridge-reserves.cjs";
2
2
  import { BN } from "@ocap/util";
3
3
 
4
4
  //#region src/pipes/bridge-release-gate.d.ts
5
-
6
5
  type Rec = Record<string, unknown>;
7
6
  type Bn = InstanceType<typeof BN>;
8
7
  interface BridgeReleaseGateInput {
@@ -25,6 +24,8 @@ interface BridgeReleaseGateInput {
25
24
  vaults: Set<string>;
26
25
  resolution?: BridgeReserveResolution | null;
27
26
  }
27
+ /** the bridge record kind a row reads as, or null */
28
+ declare const bridgeRecordKind: (row: Rec | null | undefined) => string | null;
28
29
  declare function assertBridgeReleaseProtected(input: BridgeReleaseGateInput): void;
29
30
  //#endregion
30
- export { BridgeReleaseGateInput, assertBridgeReleaseProtected };
31
+ export { BridgeReleaseGateInput, assertBridgeReleaseProtected, bridgeRecordKind };