@ocap/tx-pipeline 1.30.25 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/esm/appchain-sovereign-hub.d.mts +160 -0
  2. package/esm/appchain-sovereign-hub.mjs +348 -0
  3. package/esm/arcvault-external-adapter.d.mts +166 -0
  4. package/esm/arcvault-external-adapter.mjs +376 -0
  5. package/esm/encrypted-nft-envelope.d.mts +172 -0
  6. package/esm/encrypted-nft-envelope.mjs +458 -0
  7. package/esm/evm-simplified-bridge.d.mts +1370 -0
  8. package/esm/evm-simplified-bridge.mjs +3875 -0
  9. package/esm/give-to-mint-karma.d.mts +472 -0
  10. package/esm/give-to-mint-karma.mjs +1057 -0
  11. package/esm/helpers/replay-guard.d.mts +15 -0
  12. package/esm/helpers/replay-guard.mjs +23 -0
  13. package/esm/index.d.mts +10 -5
  14. package/esm/index.mjs +14 -10
  15. package/esm/legacy-protocol-sunset.d.mts +251 -0
  16. package/esm/legacy-protocol-sunset.mjs +1519 -0
  17. package/esm/library.d.mts +16 -0
  18. package/esm/library.mjs +17 -0
  19. package/esm/native-abt-exchange.d.mts +2055 -0
  20. package/esm/native-abt-exchange.mjs +7250 -0
  21. package/esm/ofac-screening.d.mts +17 -0
  22. package/esm/ofac-screening.mjs +39 -0
  23. package/esm/pipes/anti-land-attack.mjs +1 -1
  24. package/esm/pipes/decode-itx.mjs +43 -4
  25. package/esm/pipes/decode-tx.d.mts +2 -3
  26. package/esm/pipes/decode-tx.mjs +53 -115
  27. package/esm/pipes/extract-signer.mjs +2 -2
  28. package/esm/pipes/extract-state.mjs +14 -3
  29. package/esm/pipes/post-execution-invariant-gate.d.mts +61 -0
  30. package/esm/pipes/post-execution-invariant-gate.mjs +789 -0
  31. package/esm/pipes/pre-flight-waf.d.mts +34 -0
  32. package/esm/pipes/pre-flight-waf.mjs +603 -0
  33. package/esm/pipes/take-state-snapshot.mjs +3 -2
  34. package/esm/pipes/update-owner.mjs +39 -4
  35. package/esm/pipes/verify-account-migration.mjs +14 -4
  36. package/esm/pipes/verify-blocked.mjs +1 -1
  37. package/esm/pipes/verify-delegation.d.mts +22 -3
  38. package/esm/pipes/verify-delegation.mjs +259 -36
  39. package/esm/pipes/verify-list-size.mjs +1 -1
  40. package/esm/pipes/verify-multisig-v2.mjs +15 -7
  41. package/esm/pipes/verify-multisig.mjs +15 -7
  42. package/esm/pipes/verify-sender.mjs +1 -1
  43. package/esm/pipes/verify-signature.mjs +35 -6
  44. package/esm/pipes/verify-signer.mjs +2 -2
  45. package/esm/pipes/verify-state-diff.mjs +3 -3
  46. package/esm/pipes/verify-token-access.mjs +1 -1
  47. package/esm/pipes/verify-token-balance.mjs +13 -5
  48. package/esm/pipes/verify-transferrable.d.mts +8 -1
  49. package/esm/pipes/verify-transferrable.mjs +3 -3
  50. package/esm/pipes/verify-tx-input.mjs +2 -2
  51. package/esm/pipes/verify-tx-size.mjs +46 -2
  52. package/esm/pipes/verify-tx.mjs +5 -7
  53. package/esm/pipes/verify-updater.mjs +1 -1
  54. package/esm/social-economy-factories.d.mts +346 -0
  55. package/esm/social-economy-factories.mjs +845 -0
  56. package/esm/super-suites-foundation.d.mts +513 -0
  57. package/esm/super-suites-foundation.mjs +1241 -0
  58. package/esm/transaction-block.d.mts +471 -0
  59. package/esm/transaction-block.mjs +1906 -0
  60. package/esm/uniswap-erc7683-solver.d.mts +201 -0
  61. package/esm/uniswap-erc7683-solver.mjs +321 -0
  62. package/esm/uniswap-lp-copilot.d.mts +113 -0
  63. package/esm/uniswap-lp-copilot.mjs +320 -0
  64. package/esm/uniswap-router.d.mts +335 -0
  65. package/esm/uniswap-router.mjs +578 -0
  66. package/esm/uniswap-token-factory-graduation.d.mts +187 -0
  67. package/esm/uniswap-token-factory-graduation.mjs +426 -0
  68. package/esm/uniswap-v4-hook.d.mts +173 -0
  69. package/esm/uniswap-v4-hook.mjs +517 -0
  70. package/lib/appchain-sovereign-hub.cjs +352 -0
  71. package/lib/appchain-sovereign-hub.d.cts +160 -0
  72. package/lib/arcvault-external-adapter.cjs +383 -0
  73. package/lib/arcvault-external-adapter.d.cts +166 -0
  74. package/lib/encrypted-nft-envelope.cjs +477 -0
  75. package/lib/encrypted-nft-envelope.d.cts +172 -0
  76. package/lib/evm-simplified-bridge.cjs +3943 -0
  77. package/lib/evm-simplified-bridge.d.cts +1370 -0
  78. package/lib/give-to-mint-karma.cjs +1084 -0
  79. package/lib/give-to-mint-karma.d.cts +472 -0
  80. package/lib/helpers/replay-guard.cjs +27 -0
  81. package/lib/helpers/replay-guard.d.cts +15 -0
  82. package/lib/index.cjs +49 -16
  83. package/lib/index.d.cts +10 -5
  84. package/lib/legacy-protocol-sunset.cjs +1543 -0
  85. package/lib/legacy-protocol-sunset.d.cts +251 -0
  86. package/lib/library.cjs +303 -0
  87. package/lib/library.d.cts +16 -0
  88. package/lib/native-abt-exchange.cjs +7322 -0
  89. package/lib/native-abt-exchange.d.cts +2055 -0
  90. package/lib/ofac-screening.cjs +42 -0
  91. package/lib/ofac-screening.d.cts +17 -0
  92. package/lib/pipes/anti-land-attack.cjs +2 -2
  93. package/lib/pipes/decode-itx.cjs +43 -4
  94. package/lib/pipes/decode-itx.d.cts +1 -1
  95. package/lib/pipes/decode-tx.cjs +52 -116
  96. package/lib/pipes/decode-tx.d.cts +3 -4
  97. package/lib/pipes/extract-signer.cjs +2 -2
  98. package/lib/pipes/extract-state.cjs +14 -3
  99. package/lib/pipes/post-execution-invariant-gate.cjs +800 -0
  100. package/lib/pipes/post-execution-invariant-gate.d.cts +61 -0
  101. package/lib/pipes/pre-flight-waf.cjs +616 -0
  102. package/lib/pipes/pre-flight-waf.d.cts +34 -0
  103. package/lib/pipes/take-state-snapshot.cjs +3 -2
  104. package/lib/pipes/update-owner.cjs +40 -5
  105. package/lib/pipes/update-owner.d.cts +1 -1
  106. package/lib/pipes/verify-account-migration.cjs +14 -4
  107. package/lib/pipes/verify-blocked.cjs +1 -1
  108. package/lib/pipes/verify-delegation.cjs +259 -36
  109. package/lib/pipes/verify-delegation.d.cts +22 -3
  110. package/lib/pipes/verify-list-size.cjs +1 -1
  111. package/lib/pipes/verify-multisig-v2.cjs +15 -7
  112. package/lib/pipes/verify-multisig.cjs +15 -7
  113. package/lib/pipes/verify-sender.cjs +1 -1
  114. package/lib/pipes/verify-service-fee.d.cts +1 -1
  115. package/lib/pipes/verify-signature.cjs +35 -6
  116. package/lib/pipes/verify-signature.d.cts +1 -1
  117. package/lib/pipes/verify-signer.cjs +2 -2
  118. package/lib/pipes/verify-state-diff.cjs +4 -4
  119. package/lib/pipes/verify-token-access.cjs +2 -2
  120. package/lib/pipes/verify-token-balance.cjs +13 -5
  121. package/lib/pipes/verify-transferrable.cjs +3 -3
  122. package/lib/pipes/verify-transferrable.d.cts +8 -1
  123. package/lib/pipes/verify-tx-input.cjs +3 -3
  124. package/lib/pipes/verify-tx-size.cjs +46 -2
  125. package/lib/pipes/verify-tx-size.d.cts +1 -1
  126. package/lib/pipes/verify-tx.cjs +6 -8
  127. package/lib/pipes/verify-tx.d.cts +1 -1
  128. package/lib/pipes/verify-updater.cjs +1 -1
  129. package/lib/social-economy-factories.cjs +852 -0
  130. package/lib/social-economy-factories.d.cts +346 -0
  131. package/lib/super-suites-foundation.cjs +1257 -0
  132. package/lib/super-suites-foundation.d.cts +513 -0
  133. package/lib/transaction-block.cjs +1941 -0
  134. package/lib/transaction-block.d.cts +471 -0
  135. package/lib/uniswap-erc7683-solver.cjs +327 -0
  136. package/lib/uniswap-erc7683-solver.d.cts +201 -0
  137. package/lib/uniswap-lp-copilot.cjs +328 -0
  138. package/lib/uniswap-lp-copilot.d.cts +113 -0
  139. package/lib/uniswap-router.cjs +593 -0
  140. package/lib/uniswap-router.d.cts +335 -0
  141. package/lib/uniswap-token-factory-graduation.cjs +431 -0
  142. package/lib/uniswap-token-factory-graduation.d.cts +187 -0
  143. package/lib/uniswap-v4-hook.cjs +527 -0
  144. package/lib/uniswap-v4-hook.d.cts +173 -0
  145. package/package.json +11 -10
  146. package/esm/helpers/dedup-height.d.mts +0 -16
  147. package/esm/helpers/dedup-height.mjs +0 -61
  148. package/lib/helpers/dedup-height.cjs +0 -72
  149. package/lib/helpers/dedup-height.d.cts +0 -16
@@ -0,0 +1,15 @@
1
+ import { assertEnvelopeMatchesTxContext, isCanonicalWalletEnvelopeExtra } from "@ocap/mcrypto";
2
+ import { parseNonceBn } from "@ocap/state";
3
+
4
+ //#region src/helpers/replay-guard.d.ts
5
+
6
+ /**
7
+ * Validate that a passkey Multisig.extra payload is a JSON object containing
8
+ * non-empty string `authenticatorData` and `clientDataJSON`.
9
+ * Does not restrict key ordering or additional client fields (such as iOS
10
+ * DIDConnect `signature` and `userHandle`), relying on `unsignedTxHash`
11
+ * deduplication and `nonce > 0` for replay protection.
12
+ */
13
+ declare function isCanonicalPasskeyExtra(extra: string): boolean;
14
+ //#endregion
15
+ export { assertEnvelopeMatchesTxContext, isCanonicalPasskeyExtra, isCanonicalWalletEnvelopeExtra, parseNonceBn };
@@ -0,0 +1,23 @@
1
+ import { assertEnvelopeMatchesTxContext, isCanonicalWalletEnvelopeExtra } from "@ocap/mcrypto";
2
+ import { parseNonceBn } from "@ocap/state";
3
+
4
+ //#region src/helpers/replay-guard.ts
5
+ /**
6
+ * Validate that a passkey Multisig.extra payload is a JSON object containing
7
+ * non-empty string `authenticatorData` and `clientDataJSON`.
8
+ * Does not restrict key ordering or additional client fields (such as iOS
9
+ * DIDConnect `signature` and `userHandle`), relying on `unsignedTxHash`
10
+ * deduplication and `nonce > 0` for replay protection.
11
+ */
12
+ function isCanonicalPasskeyExtra(extra) {
13
+ try {
14
+ const parsed = JSON.parse(extra);
15
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return false;
16
+ return typeof parsed.authenticatorData === "string" && parsed.authenticatorData.length > 0 && typeof parsed.clientDataJSON === "string" && parsed.clientDataJSON.length > 0;
17
+ } catch {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ //#endregion
23
+ export { assertEnvelopeMatchesTxContext, isCanonicalPasskeyExtra, isCanonicalWalletEnvelopeExtra, parseNonceBn };
package/esm/index.d.mts CHANGED
@@ -1,11 +1,14 @@
1
- import { CHAIN_UNSIGNED_TX_DEDUP_HEIGHTS, PENDING_DEDUP_ACTIVATION_HEIGHT, isCanonicalPasskeyExtra, isDedupHeightActive, parseNonceBn, readExplicitHeight, resolveDedupActivationHeight, resolveEffectiveHeight } from "./helpers/dedup-height.mjs";
1
+ import { ENCRYPTED_NFT_SCHEMA_VERSION, EncryptedAssetEnvelope, EncryptedNftAlgorithm, EncryptedNftOwnerCipherEnvelope, EncryptedNftPrivateMetadata, EncryptedNftPublicDiscoveryHeader, MAX_ENCRYPTED_NFT_CATEGORY_LENGTH, MAX_ENCRYPTED_NFT_CIPHERTEXT_HEX_CHARS, MAX_ENCRYPTED_NFT_SUMMARY_LENGTH, MAX_ENCRYPTED_NFT_TAGS, MAX_ENCRYPTED_NFT_TAG_LENGTH, MAX_ENCRYPTED_NFT_URI_LENGTH, OpenEncryptedNftAsOwnerInput, OpenEncryptedNftAsOwnerResult, RewrapEncryptedNftForNewOwnerInput, SealEncryptedNftForOwnerInput, VALID_ENCRYPTED_NFT_ALGORITHMS, VerifyEncryptedNftHandoverInput, canonicalizeEncryptedNftMetadata, computeEncryptedNftCekCommitmentHash, computeEncryptedNftPlaintextHash, computeEncryptedNftPublicHeaderAad, deriveOwnerPublicKeyHexFromSecretKey, openEncryptedNftAsOwner, rewrapEncryptedNftForNewOwner, sealEncryptedNftForOwner, validateEncryptedAssetEnvelope, verifyEncryptedNftHandover } from "./encrypted-nft-envelope.mjs";
2
+ import { isCanonicalPasskeyExtra, parseNonceBn } from "./helpers/replay-guard.mjs";
2
3
  import PipelineRunner, { ErrorPipeFunction, PipeFunction, PipeNext, PipeOptions } from "./runner.mjs";
3
4
  import CreateAntiLandAttackPipe from "./pipes/anti-land-attack.mjs";
4
5
  import DecodeItx from "./pipes/decode-itx.mjs";
5
- import DecodeTx, { assertCanonicalActiveTx } from "./pipes/decode-tx.mjs";
6
+ import DecodeTx from "./pipes/decode-tx.mjs";
6
7
  import CreateExtractReceiverPipe from "./pipes/extract-receiver.mjs";
7
8
  import CreateExtractSignerPipe from "./pipes/extract-signer.mjs";
8
9
  import CreateExtractStatePipe from "./pipes/extract-state.mjs";
10
+ import { CreatePostExecutionInvariantGatePipe, IStateWriteTracker, MAX_POST_EXECUTION_WRITE_SET_ENTRIES, TRACKED_STATE_TABLES, TrackedStateTable, inspectPostExecutionInvariants, installStateWriteInterceptor, normalizeEntityKey, rollbackTrackedStateWrites } from "./pipes/post-execution-invariant-gate.mjs";
11
+ import PreFlightWaf, { MAX_DELEGATE_TYPE_URLS_LIST_SIZE, MAX_PREFLIGHT_JSON_DEPTH, MAX_PREFLIGHT_JSON_KEYS, MAX_PREFLIGHT_STRING_FIELD_BYTES, MAX_PREFLIGHT_WIRE_BYTES_FALLBACK, MAX_ROLLUP_TXS_LIST_SIZE, assertKnownItxFields, assertRawWireEnvelope, inspectTransactionPreFlight, scanItxPayloadAnomalies } from "./pipes/pre-flight-waf.mjs";
9
12
  import CreateTakeStateSnapshotPipe from "./pipes/take-state-snapshot.mjs";
10
13
  import CreateUpdateOwnerPipe, { verifyAssetHierarchy } from "./pipes/update-owner.mjs";
11
14
  import CreateVerifyAccountMigrationPipe from "./pipes/verify-account-migration.mjs";
@@ -34,10 +37,11 @@ declare const pipes: {
34
37
  AntiLandAttack: typeof CreateAntiLandAttackPipe;
35
38
  DecodeItx: typeof DecodeItx;
36
39
  DecodeTx: typeof DecodeTx;
37
- assertCanonicalActiveTx: typeof assertCanonicalActiveTx;
38
40
  ExtractReceiver: typeof CreateExtractReceiverPipe;
39
41
  ExtractSigner: typeof CreateExtractSignerPipe;
40
42
  ExtractState: typeof CreateExtractStatePipe;
43
+ PostExecutionInvariantGate: typeof CreatePostExecutionInvariantGatePipe;
44
+ PreFlightWaf: typeof PreFlightWaf;
41
45
  UpdateOwner: typeof CreateUpdateOwnerPipe;
42
46
  VerifyAccountMigration: typeof CreateVerifyAccountMigrationPipe;
43
47
  VerifyDelegation: typeof CreateVerifyDelegationPipe;
@@ -66,10 +70,11 @@ declare const _default: {
66
70
  AntiLandAttack: typeof CreateAntiLandAttackPipe;
67
71
  DecodeItx: typeof DecodeItx;
68
72
  DecodeTx: typeof DecodeTx;
69
- assertCanonicalActiveTx: typeof assertCanonicalActiveTx;
70
73
  ExtractReceiver: typeof CreateExtractReceiverPipe;
71
74
  ExtractSigner: typeof CreateExtractSignerPipe;
72
75
  ExtractState: typeof CreateExtractStatePipe;
76
+ PostExecutionInvariantGate: typeof CreatePostExecutionInvariantGatePipe;
77
+ PreFlightWaf: typeof PreFlightWaf;
73
78
  UpdateOwner: typeof CreateUpdateOwnerPipe;
74
79
  VerifyAccountMigration: typeof CreateVerifyAccountMigrationPipe;
75
80
  VerifyDelegation: typeof CreateVerifyDelegationPipe;
@@ -94,4 +99,4 @@ declare const _default: {
94
99
  };
95
100
  };
96
101
  //#endregion
97
- export { CreateAntiLandAttackPipe as AntiLandAttack, CHAIN_UNSIGNED_TX_DEDUP_HEIGHTS, DecodeItx, DecodeTx, type ErrorPipeFunction, CreateExtractReceiverPipe as ExtractReceiver, CreateExtractSignerPipe as ExtractSigner, CreateExtractStatePipe as ExtractState, type IAccountUpdate, type IBaseContext, type IDecodedContext, type IDecodedTransaction, type IExecutedContext, type IGasContext, type IReadyContext, type ITxOnlyContext, type IWithAsset, type IWithAssets, type IWithDelegation, type IWithDelegator, type IWithEvidence, type IWithFactory, type IWithLocked, type IWithOwner, type IWithReceiver, type IWithRollup, type IWithRollupBlock, type IWithSender, type IWithStake, type IWithStakes, type IWithToken, type IWithTokenFactory, type IWithTokens, PENDING_DEDUP_ACTIVATION_HEIGHT, type PipeFunction, type PipeNext, type PipeOptions, PipelineRunner as Runner, type TTransactionReceipt, CreateTakeStateSnapshotPipe as TakeStateSnapshot, CreateUpdateOwnerPipe as UpdateOwner, CreateVerifyAccountMigrationPipe as VerifyAccountMigration, CreatedVerifyBlockedPipe as VerifyBlocked, CreateVerifyDelegationPipe as VerifyDelegation, CreateVerifyInfoPipe as VerifyInfo, CreateVerifyListSizePipe as VerifyListSize, CreateVerifyMultiSigPipe as VerifyMultiSig, CreateVerifyMultiSigV2Pipe as VerifyMultiSigV2, CreateVerifySenderPipe as VerifySender, VerifyServiceFee, VerifySignature, CreateVerifySignerPipe as VerifySigner, CreateVerifyStateDiffPipe as VerifyStateDiff, CreateVerifyTokenBalancePipe as VerifyTokenBalance, CreateVerifyTransferrablePipe as VerifyTransferrable, VerifyTx, CreateVerifyTxInputPipe as VerifyTxInput, VerifyTxSize, CreateVerifyUpdaterPipe as VerifyUpdater, assertCanonicalActiveTx, _default as default, groupStatesByAddress, isCanonicalPasskeyExtra, isDedupHeightActive, isDelegationSufficient, parseNonceBn, pipes, readExplicitHeight, resolveDedupActivationHeight, resolveEffectiveHeight, verifyAssetHierarchy, verifyImplicitAssetOwnership, CreateVerifyTokenAccessPipe as verifyTokenAccess };
102
+ export { CreateAntiLandAttackPipe as AntiLandAttack, DecodeItx, DecodeTx, ENCRYPTED_NFT_SCHEMA_VERSION, type EncryptedAssetEnvelope, type EncryptedNftAlgorithm, type EncryptedNftOwnerCipherEnvelope, type EncryptedNftPrivateMetadata, type EncryptedNftPublicDiscoveryHeader, type ErrorPipeFunction, CreateExtractReceiverPipe as ExtractReceiver, CreateExtractSignerPipe as ExtractSigner, CreateExtractStatePipe as ExtractState, type IAccountUpdate, type IBaseContext, type IDecodedContext, type IDecodedTransaction, type IExecutedContext, type IGasContext, type IReadyContext, type IStateWriteTracker, type ITxOnlyContext, type IWithAsset, type IWithAssets, type IWithDelegation, type IWithDelegator, type IWithEvidence, type IWithFactory, type IWithLocked, type IWithOwner, type IWithReceiver, type IWithRollup, type IWithRollupBlock, type IWithSender, type IWithStake, type IWithStakes, type IWithToken, type IWithTokenFactory, type IWithTokens, MAX_DELEGATE_TYPE_URLS_LIST_SIZE, MAX_ENCRYPTED_NFT_CATEGORY_LENGTH, MAX_ENCRYPTED_NFT_CIPHERTEXT_HEX_CHARS, MAX_ENCRYPTED_NFT_SUMMARY_LENGTH, MAX_ENCRYPTED_NFT_TAGS, MAX_ENCRYPTED_NFT_TAG_LENGTH, MAX_ENCRYPTED_NFT_URI_LENGTH, MAX_POST_EXECUTION_WRITE_SET_ENTRIES, MAX_PREFLIGHT_JSON_DEPTH, MAX_PREFLIGHT_JSON_KEYS, MAX_PREFLIGHT_STRING_FIELD_BYTES, MAX_PREFLIGHT_WIRE_BYTES_FALLBACK, MAX_ROLLUP_TXS_LIST_SIZE, type OpenEncryptedNftAsOwnerInput, type OpenEncryptedNftAsOwnerResult, type PipeFunction, type PipeNext, type PipeOptions, CreatePostExecutionInvariantGatePipe as PostExecutionInvariantGate, PreFlightWaf, type RewrapEncryptedNftForNewOwnerInput, PipelineRunner as Runner, type SealEncryptedNftForOwnerInput, TRACKED_STATE_TABLES, type TTransactionReceipt, CreateTakeStateSnapshotPipe as TakeStateSnapshot, type TrackedStateTable, CreateUpdateOwnerPipe as UpdateOwner, VALID_ENCRYPTED_NFT_ALGORITHMS, CreateVerifyAccountMigrationPipe as VerifyAccountMigration, CreatedVerifyBlockedPipe as VerifyBlocked, CreateVerifyDelegationPipe as VerifyDelegation, type VerifyEncryptedNftHandoverInput, CreateVerifyInfoPipe as VerifyInfo, CreateVerifyListSizePipe as VerifyListSize, CreateVerifyMultiSigPipe as VerifyMultiSig, CreateVerifyMultiSigV2Pipe as VerifyMultiSigV2, CreateVerifySenderPipe as VerifySender, VerifyServiceFee, VerifySignature, CreateVerifySignerPipe as VerifySigner, CreateVerifyStateDiffPipe as VerifyStateDiff, CreateVerifyTokenBalancePipe as VerifyTokenBalance, CreateVerifyTransferrablePipe as VerifyTransferrable, VerifyTx, CreateVerifyTxInputPipe as VerifyTxInput, VerifyTxSize, CreateVerifyUpdaterPipe as VerifyUpdater, assertKnownItxFields, assertRawWireEnvelope, canonicalizeEncryptedNftMetadata, computeEncryptedNftCekCommitmentHash, computeEncryptedNftPlaintextHash, computeEncryptedNftPublicHeaderAad, _default as default, deriveOwnerPublicKeyHexFromSecretKey, groupStatesByAddress, inspectPostExecutionInvariants, inspectTransactionPreFlight, installStateWriteInterceptor, isCanonicalPasskeyExtra, isDelegationSufficient, normalizeEntityKey, openEncryptedNftAsOwner, parseNonceBn, pipes, rewrapEncryptedNftForNewOwner, rollbackTrackedStateWrites, scanItxPayloadAnomalies, sealEncryptedNftForOwner, validateEncryptedAssetEnvelope, verifyAssetHierarchy, verifyEncryptedNftHandover, verifyImplicitAssetOwnership, CreateVerifyTokenAccessPipe as verifyTokenAccess };
package/esm/index.mjs CHANGED
@@ -1,42 +1,46 @@
1
- import { CHAIN_UNSIGNED_TX_DEDUP_HEIGHTS, PENDING_DEDUP_ACTIVATION_HEIGHT, isCanonicalPasskeyExtra, isDedupHeightActive, parseNonceBn, readExplicitHeight, resolveDedupActivationHeight, resolveEffectiveHeight } from "./helpers/dedup-height.mjs";
1
+ import { ENCRYPTED_NFT_SCHEMA_VERSION, MAX_ENCRYPTED_NFT_CATEGORY_LENGTH, MAX_ENCRYPTED_NFT_CIPHERTEXT_HEX_CHARS, MAX_ENCRYPTED_NFT_SUMMARY_LENGTH, MAX_ENCRYPTED_NFT_TAGS, MAX_ENCRYPTED_NFT_TAG_LENGTH, MAX_ENCRYPTED_NFT_URI_LENGTH, VALID_ENCRYPTED_NFT_ALGORITHMS, canonicalizeEncryptedNftMetadata, computeEncryptedNftCekCommitmentHash, computeEncryptedNftPlaintextHash, computeEncryptedNftPublicHeaderAad, deriveOwnerPublicKeyHexFromSecretKey, openEncryptedNftAsOwner, rewrapEncryptedNftForNewOwner, sealEncryptedNftForOwner, validateEncryptedAssetEnvelope, verifyEncryptedNftHandover } from "./encrypted-nft-envelope.mjs";
2
+ import { isCanonicalPasskeyExtra, parseNonceBn } from "./helpers/replay-guard.mjs";
2
3
  import CreateAntiLandAttackPipe from "./pipes/anti-land-attack.mjs";
3
4
  import DecodeItx from "./pipes/decode-itx.mjs";
4
- import DecodeTx, { assertCanonicalActiveTx } from "./pipes/decode-tx.mjs";
5
+ import DecodeTx from "./pipes/decode-tx.mjs";
5
6
  import CreateExtractReceiverPipe from "./pipes/extract-receiver.mjs";
6
7
  import CreateExtractSignerPipe from "./pipes/extract-signer.mjs";
7
8
  import CreateExtractStatePipe from "./pipes/extract-state.mjs";
9
+ import post_execution_invariant_gate_default, { MAX_POST_EXECUTION_WRITE_SET_ENTRIES, TRACKED_STATE_TABLES, inspectPostExecutionInvariants, installStateWriteInterceptor, normalizeEntityKey, rollbackTrackedStateWrites } from "./pipes/post-execution-invariant-gate.mjs";
10
+ import runner_default from "./runner.mjs";
11
+ import CreatedVerifyBlockedPipe from "./pipes/verify-blocked.mjs";
12
+ import VerifyServiceFee from "./pipes/verify-service-fee.mjs";
13
+ import VerifySignature from "./pipes/verify-signature.mjs";
14
+ import VerifyTx from "./pipes/verify-tx.mjs";
15
+ import VerifyTxSize from "./pipes/verify-tx-size.mjs";
16
+ import PreFlightWaf, { MAX_DELEGATE_TYPE_URLS_LIST_SIZE, MAX_PREFLIGHT_JSON_DEPTH, MAX_PREFLIGHT_JSON_KEYS, MAX_PREFLIGHT_STRING_FIELD_BYTES, MAX_PREFLIGHT_WIRE_BYTES_FALLBACK, MAX_ROLLUP_TXS_LIST_SIZE, assertKnownItxFields, assertRawWireEnvelope, inspectTransactionPreFlight, scanItxPayloadAnomalies } from "./pipes/pre-flight-waf.mjs";
8
17
  import CreateVerifyStateDiffPipe, { groupStatesByAddress } from "./pipes/verify-state-diff.mjs";
9
18
  import CreateTakeStateSnapshotPipe from "./pipes/take-state-snapshot.mjs";
10
19
  import CreateUpdateOwnerPipe, { verifyAssetHierarchy } from "./pipes/update-owner.mjs";
11
20
  import CreateVerifyAccountMigrationPipe from "./pipes/verify-account-migration.mjs";
12
- import CreatedVerifyBlockedPipe from "./pipes/verify-blocked.mjs";
13
21
  import CreateVerifyDelegationPipe, { isDelegationSufficient, verifyImplicitAssetOwnership } from "./pipes/verify-delegation.mjs";
14
22
  import CreateVerifyInfoPipe from "./pipes/verify-info.mjs";
15
23
  import CreateVerifyListSizePipe from "./pipes/verify-list-size.mjs";
16
24
  import CreateVerifyMultiSigPipe from "./pipes/verify-multisig.mjs";
17
25
  import CreateVerifyMultiSigV2Pipe from "./pipes/verify-multisig-v2.mjs";
18
26
  import CreateVerifySenderPipe from "./pipes/verify-sender.mjs";
19
- import VerifyServiceFee from "./pipes/verify-service-fee.mjs";
20
- import VerifySignature from "./pipes/verify-signature.mjs";
21
27
  import CreateVerifySignerPipe from "./pipes/verify-signer.mjs";
22
28
  import CreateVerifyTokenAccessPipe from "./pipes/verify-token-access.mjs";
23
29
  import CreateVerifyTokenBalancePipe from "./pipes/verify-token-balance.mjs";
24
30
  import CreateVerifyTransferrablePipe from "./pipes/verify-transferrable.mjs";
25
- import VerifyTx from "./pipes/verify-tx.mjs";
26
31
  import CreateVerifyTxInputPipe from "./pipes/verify-tx-input.mjs";
27
- import VerifyTxSize from "./pipes/verify-tx-size.mjs";
28
32
  import CreateVerifyUpdaterPipe from "./pipes/verify-updater.mjs";
29
- import runner_default from "./runner.mjs";
30
33
 
31
34
  //#region src/index.ts
32
35
  const pipes = {
33
36
  AntiLandAttack: CreateAntiLandAttackPipe,
34
37
  DecodeItx,
35
38
  DecodeTx,
36
- assertCanonicalActiveTx,
37
39
  ExtractReceiver: CreateExtractReceiverPipe,
38
40
  ExtractSigner: CreateExtractSignerPipe,
39
41
  ExtractState: CreateExtractStatePipe,
42
+ PostExecutionInvariantGate: post_execution_invariant_gate_default,
43
+ PreFlightWaf,
40
44
  UpdateOwner: CreateUpdateOwnerPipe,
41
45
  VerifyAccountMigration: CreateVerifyAccountMigrationPipe,
42
46
  VerifyDelegation: CreateVerifyDelegationPipe,
@@ -65,4 +69,4 @@ var src_default = {
65
69
  };
66
70
 
67
71
  //#endregion
68
- export { CreateAntiLandAttackPipe as AntiLandAttack, CHAIN_UNSIGNED_TX_DEDUP_HEIGHTS, DecodeItx, DecodeTx, CreateExtractReceiverPipe as ExtractReceiver, CreateExtractSignerPipe as ExtractSigner, CreateExtractStatePipe as ExtractState, PENDING_DEDUP_ACTIVATION_HEIGHT, runner_default as Runner, CreateTakeStateSnapshotPipe as TakeStateSnapshot, CreateUpdateOwnerPipe as UpdateOwner, CreateVerifyAccountMigrationPipe as VerifyAccountMigration, CreatedVerifyBlockedPipe as VerifyBlocked, CreateVerifyDelegationPipe as VerifyDelegation, CreateVerifyInfoPipe as VerifyInfo, CreateVerifyListSizePipe as VerifyListSize, CreateVerifyMultiSigPipe as VerifyMultiSig, CreateVerifyMultiSigV2Pipe as VerifyMultiSigV2, CreateVerifySenderPipe as VerifySender, VerifyServiceFee, VerifySignature, CreateVerifySignerPipe as VerifySigner, CreateVerifyStateDiffPipe as VerifyStateDiff, CreateVerifyTokenBalancePipe as VerifyTokenBalance, CreateVerifyTransferrablePipe as VerifyTransferrable, VerifyTx, CreateVerifyTxInputPipe as VerifyTxInput, VerifyTxSize, CreateVerifyUpdaterPipe as VerifyUpdater, assertCanonicalActiveTx, src_default as default, groupStatesByAddress, isCanonicalPasskeyExtra, isDedupHeightActive, isDelegationSufficient, parseNonceBn, pipes, readExplicitHeight, resolveDedupActivationHeight, resolveEffectiveHeight, verifyAssetHierarchy, verifyImplicitAssetOwnership, CreateVerifyTokenAccessPipe as verifyTokenAccess };
72
+ export { CreateAntiLandAttackPipe as AntiLandAttack, DecodeItx, DecodeTx, ENCRYPTED_NFT_SCHEMA_VERSION, CreateExtractReceiverPipe as ExtractReceiver, CreateExtractSignerPipe as ExtractSigner, CreateExtractStatePipe as ExtractState, MAX_DELEGATE_TYPE_URLS_LIST_SIZE, MAX_ENCRYPTED_NFT_CATEGORY_LENGTH, MAX_ENCRYPTED_NFT_CIPHERTEXT_HEX_CHARS, MAX_ENCRYPTED_NFT_SUMMARY_LENGTH, MAX_ENCRYPTED_NFT_TAGS, MAX_ENCRYPTED_NFT_TAG_LENGTH, MAX_ENCRYPTED_NFT_URI_LENGTH, MAX_POST_EXECUTION_WRITE_SET_ENTRIES, MAX_PREFLIGHT_JSON_DEPTH, MAX_PREFLIGHT_JSON_KEYS, MAX_PREFLIGHT_STRING_FIELD_BYTES, MAX_PREFLIGHT_WIRE_BYTES_FALLBACK, MAX_ROLLUP_TXS_LIST_SIZE, post_execution_invariant_gate_default as PostExecutionInvariantGate, PreFlightWaf, runner_default as Runner, TRACKED_STATE_TABLES, CreateTakeStateSnapshotPipe as TakeStateSnapshot, CreateUpdateOwnerPipe as UpdateOwner, VALID_ENCRYPTED_NFT_ALGORITHMS, CreateVerifyAccountMigrationPipe as VerifyAccountMigration, CreatedVerifyBlockedPipe as VerifyBlocked, CreateVerifyDelegationPipe as VerifyDelegation, CreateVerifyInfoPipe as VerifyInfo, CreateVerifyListSizePipe as VerifyListSize, CreateVerifyMultiSigPipe as VerifyMultiSig, CreateVerifyMultiSigV2Pipe as VerifyMultiSigV2, CreateVerifySenderPipe as VerifySender, VerifyServiceFee, VerifySignature, CreateVerifySignerPipe as VerifySigner, CreateVerifyStateDiffPipe as VerifyStateDiff, CreateVerifyTokenBalancePipe as VerifyTokenBalance, CreateVerifyTransferrablePipe as VerifyTransferrable, VerifyTx, CreateVerifyTxInputPipe as VerifyTxInput, VerifyTxSize, CreateVerifyUpdaterPipe as VerifyUpdater, assertKnownItxFields, assertRawWireEnvelope, canonicalizeEncryptedNftMetadata, computeEncryptedNftCekCommitmentHash, computeEncryptedNftPlaintextHash, computeEncryptedNftPublicHeaderAad, src_default as default, deriveOwnerPublicKeyHexFromSecretKey, groupStatesByAddress, inspectPostExecutionInvariants, inspectTransactionPreFlight, installStateWriteInterceptor, isCanonicalPasskeyExtra, isDelegationSufficient, normalizeEntityKey, openEncryptedNftAsOwner, parseNonceBn, pipes, rewrapEncryptedNftForNewOwner, rollbackTrackedStateWrites, scanItxPayloadAnomalies, sealEncryptedNftForOwner, validateEncryptedAssetEnvelope, verifyAssetHierarchy, verifyEncryptedNftHandover, verifyImplicitAssetOwnership, CreateVerifyTokenAccessPipe as verifyTokenAccess };
@@ -0,0 +1,251 @@
1
+ import { StatementExecutor, TransactionBlockInput, TransactionBlockResult } from "./transaction-block.mjs";
2
+ import { LegacyRollupReadOnlySummary } from "./evm-simplified-bridge.mjs";
3
+
4
+ //#region src/legacy-protocol-sunset.d.ts
5
+ declare const DEFAULT_LEGACY_PROTOCOL_SUNSET_HEIGHT = 1;
6
+ declare const MAX_LEGACY_MIOTX_PARTICIPANTS = 64;
7
+ declare const MAX_LEGACY_MIOTX_TOKENS_PER_ENTRY = 32;
8
+ declare const MAX_LEGACY_MIOTX_ASSETS_PER_ENTRY = 64;
9
+ /**
10
+ * Category 1: Deprecated `miotx` (Multi-Input-Output UTXO-style `inputs[]`/`outputs[]`) & versioned trade/swap protocols.
11
+ * Replaced by composable `TransactionBlock` + versionless `fg:t:transfer`.
12
+ */
13
+ declare const DEPRECATED_MIOTX_AND_TRADE_TYPE_URLS: readonly ["fg:t:transfer_v2", "fg:t:transfer_v3", "fg:t:exchange", "fg:t:exchange_v2", "fg:t:setup_swap", "fg:t:retrieve_swap", "fg:t:revoke_swap"];
14
+ /**
15
+ * Category 2: Deprecated versioned asset & factory protocols (`_v2`, `_v3`).
16
+ * Replaced by versionless `fg:t:acquire_asset`, `fg:t:mint_asset`, `fg:t:update_asset`, `fg:t:create_factory`, `fg:t:contract_nft`.
17
+ */
18
+ declare const DEPRECATED_VERSIONED_ASSET_TYPE_URLS: readonly ["fg:t:acquire_asset_v2", "fg:t:acquire_asset_v3", "fg:t:mint_asset_v2", "fg:t:update_asset_v2", "fg:t:create_factory_v2"];
19
+ /**
20
+ * Category 3: Deprecated Rollup & legacy versioned token bridge write protocols.
21
+ * Replaced by Zero-Rollup-Block EIP-712 `fg:t:evm_bridge_settlement` (`OcapSimplifiedEvmBridgeNode`).
22
+ */
23
+ declare const DEPRECATED_ROLLUP_AND_BRIDGE_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", "fg:t:close_rollup", "fg:t:migrate_rollup", "fg:t:deposit_token", "fg:t:deposit_token_v2", "fg:t:withdraw_token", "fg:t:withdraw_token_v2", "fg:t:revoke_withdraw"];
24
+ /**
25
+ * Complete list of all 27 deprecated legacy `V1/V2/V3`, `miotx`, and Rollup write protocols
26
+ * frozen into `READ_ONLY_LEGACY_ARCHIVE` mode after `sunsetActivationHeight`.
27
+ */
28
+ declare const DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS: readonly ["fg:t:transfer_v2", "fg:t:transfer_v3", "fg:t:exchange", "fg:t:exchange_v2", "fg:t:setup_swap", "fg:t:retrieve_swap", "fg:t:revoke_swap", "fg:t:acquire_asset_v2", "fg:t:acquire_asset_v3", "fg:t:mint_asset_v2", "fg:t:update_asset_v2", "fg:t:create_factory_v2", "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", "fg:t:close_rollup", "fg:t:migrate_rollup", "fg:t:deposit_token", "fg:t:deposit_token_v2", "fg:t:withdraw_token", "fg:t:withdraw_token_v2", "fg:t:revoke_withdraw"];
29
+ /**
30
+ * Subset of deprecated protocols that used the legacy `miotx` (Multi-Input-Output) UTXO-style array structure.
31
+ */
32
+ declare const DEPRECATED_MIOTX_PROTOCOL_TYPE_URLS: readonly ["fg:t:transfer_v3", "fg:t:exchange_v2", "fg:t:acquire_asset_v3"];
33
+ /**
34
+ * Canonical Clean VNext Active Write Protocol Set (Domain-Agnostic, Versionless Composable Primitives).
35
+ * Issue #1251: L1 protocol identifiers strictly express orthogonal state-machine primitives
36
+ * without application-specific vocabulary (zero `nft`, `karma`, or `evm` in L1 protocol names).
37
+ */
38
+ declare const VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS: readonly ["fg:t:transaction_block", "fg:t:transfer", "fg:t:create_asset", "fg:t:mint_asset", "fg:t:acquire_asset", "fg:t:update_asset", "fg:t:consume_asset", "fg:t:execute_asset", "fg:t:create_factory", "fg:t:create_token", "fg:t:create_token_factory", "fg:t:update_token_factory", "fg:t:mint_token", "fg:t:burn_token", "fg:t:settle_attestation", "fg:t:declare", "fg:t:account_migrate", "fg:t:delegate", "fg:t:revoke_delegate", "fg:t:stake", "fg:t:revoke_stake", "fg:t:claim_stake", "fg:t:slash_stake", "fg:t:return_stake"];
39
+ /**
40
+ * Issue #1251: Mapping of application-coupled protocol aliases to their domain-agnostic
41
+ * VNext L1 state-machine primitives.
42
+ */
43
+ declare const DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP: Readonly<{
44
+ readonly 'fg:t:contract_nft': "fg:t:execute_asset";
45
+ readonly 'fg:t:give_karma': "fg:t:mint_token";
46
+ readonly 'fg:t:claim_karma': "fg:t:settle_attestation";
47
+ readonly 'fg:t:evm_bridge_settlement': "fg:t:settle_attestation";
48
+ }>;
49
+ type DomainCoupledProtocolAliasTypeUrl = keyof typeof DOMAIN_COUPLED_PROTOCOL_ALIAS_MAP;
50
+ type DeprecatedLegacyProtocolTypeUrl = (typeof DEPRECATED_LEGACY_PROTOCOL_TYPE_URLS)[number];
51
+ type VNextCanonicalWriteProtocolTypeUrl = (typeof VNEXT_CANONICAL_WRITE_PROTOCOL_TYPE_URLS)[number];
52
+ type LegacyProtocolSunsetCategory = 'MIOTX_AND_VERSIONED_TRADE' | 'VERSIONED_ASSET_AND_FACTORY' | 'LEGACY_ROLLUP_AND_BRIDGE';
53
+ interface LegacyProtocolReplacementSpec {
54
+ legacyTypeUrl: DeprecatedLegacyProtocolTypeUrl;
55
+ category: LegacyProtocolSunsetCategory;
56
+ isMiotx: boolean;
57
+ vnextReplacementTypeUrl: VNextCanonicalWriteProtocolTypeUrl;
58
+ migrationGuidance: string;
59
+ }
60
+ /**
61
+ * Normalizes any transaction or statement `typeUrl` / `type` (e.g. `fg:t:transfer_v3`,
62
+ * `transferV3`, `TransferV3Tx`, `type.googleapis.com/forge_abi.ExchangeV2Tx`, `acquire-asset-v3`)
63
+ * into its canonical `fg:t:<snake_case>` identifier so no alias can bypass sunset enforcement.
64
+ */
65
+ declare function normalizeProtocolTypeUrl(rawTypeUrl: string): string;
66
+ /**
67
+ * Returns true if `typeUrl` is one of the 27 deprecated legacy `V1/V2/V3`, `miotx`, or Rollup write protocols.
68
+ */
69
+ declare function isDeprecatedLegacyWriteProtocol(typeUrl: string): boolean;
70
+ /**
71
+ * Returns true if `typeUrl` is a deprecated `miotx` (Multi-Input-Output) protocol (`transfer_v3`, `exchange_v2`, `acquire_asset_v3`).
72
+ */
73
+ declare function isMiotxLegacyProtocol(typeUrl: string): boolean;
74
+ /**
75
+ * Returns true if `typeUrl` is in the clean VNext canonical active write protocol set.
76
+ */
77
+ declare function isVNextCanonicalWriteProtocol(typeUrl: string): boolean;
78
+ /**
79
+ * Issue #1251: Returns true if `typeUrl` is an application-domain-coupled protocol alias
80
+ * (`contract_nft`, `give_karma`, `claim_karma`, `evm_bridge_settlement`).
81
+ */
82
+ declare function isDomainCoupledProtocolAlias(typeUrl: string): boolean;
83
+ /**
84
+ * Issue #1251: Resolves an application-coupled protocol alias (`contract_nft`, `give_karma`,
85
+ * `claim_karma`, `evm_bridge_settlement`) or canonical VNext protocol to its domain-agnostic
86
+ * VNext L1 primitive (`fg:t:execute_asset`, `fg:t:mint_token`, `fg:t:settle_attestation`, etc.).
87
+ */
88
+ declare function resolveDomainAgnosticVNextProtocol(typeUrl: string): VNextCanonicalWriteProtocolTypeUrl | null;
89
+ /**
90
+ * Returns the structured replacement specification and migration guidance for a deprecated legacy protocol,
91
+ * or `null` if the protocol is not in the deprecated legacy list.
92
+ */
93
+ declare function getLegacyProtocolReplacementSpec(typeUrl: string): LegacyProtocolReplacementSpec | null;
94
+ /**
95
+ * Active Write Pipeline Sunset Gate (`assertLegacyProtocolNotSunset`):
96
+ * - When `readOnlyArchiveMode === true` or `currentBlockHeight < sunsetActivationHeight`, allows historical read/replay.
97
+ * - When `currentBlockHeight >= sunsetActivationHeight`, fails closed (`FORBIDDEN_LEGACY_PROTOCOL_SUNSET`) on all
98
+ * 27 deprecated `V1/V2/V3`, `miotx`, and Rollup write protocols with actionable VNext migration guidance.
99
+ */
100
+ declare function assertLegacyProtocolNotSunset(params: {
101
+ typeUrl: string;
102
+ currentBlockHeight: number;
103
+ sunsetActivationHeight?: number;
104
+ readOnlyArchiveMode?: boolean;
105
+ }): void;
106
+ /**
107
+ * Deeply validates that a `TransactionBlockInput` contains ONLY clean VNext canonical write statements
108
+ * and does NOT smuggle any deprecated `V1/V2/V3`, `miotx`, or Rollup protocol inside `statements[]`
109
+ * or nested `ContractNFT` `statementTemplates`.
110
+ */
111
+ declare function assertTransactionBlockVNextPure(block: TransactionBlockInput, options?: {
112
+ currentBlockHeight?: number;
113
+ sunsetActivationHeight?: number;
114
+ requireStrictCanonicalWhitelist?: boolean;
115
+ }): void;
116
+ interface LegacyTokenAmountEntry {
117
+ readonly address: string;
118
+ readonly value: bigint;
119
+ }
120
+ interface LegacyMiotxParticipantEntry {
121
+ readonly owner: string;
122
+ readonly tokens: readonly LegacyTokenAmountEntry[];
123
+ readonly assets: readonly string[];
124
+ }
125
+ interface LegacyTxReadOnlyArchiveSummary {
126
+ readonly recordKind: 'transfer_v2' | 'transfer_v3' | 'exchange_v2' | 'acquire_asset_v2' | 'acquire_asset_v3' | 'mint_asset_v2' | 'update_asset_v2' | 'create_factory_v2' | 'RollupState' | 'RollupBlock' | 'deposit_token_v2' | 'withdraw_token_v2';
127
+ readonly canonicalLegacyTypeUrl: DeprecatedLegacyProtocolTypeUrl | 'RollupState' | 'RollupBlock';
128
+ readonly mode: 'READ_ONLY_LEGACY_ARCHIVE';
129
+ readonly isMiotx: boolean;
130
+ readonly vnextReplacementTypeUrl: VNextCanonicalWriteProtocolTypeUrl;
131
+ readonly txHash?: string;
132
+ readonly fromDid?: string;
133
+ readonly toDid?: string;
134
+ readonly factoryAddress?: string;
135
+ readonly assetAddress?: string;
136
+ readonly inputs?: readonly LegacyMiotxParticipantEntry[];
137
+ readonly outputs?: readonly LegacyMiotxParticipantEntry[];
138
+ readonly totalTokenVolumeByAddress?: Readonly<Record<string, string>>;
139
+ readonly transferredAssets?: readonly string[];
140
+ readonly acquiredAssetSpecsCount?: number;
141
+ readonly rollupArchive?: LegacyRollupReadOnlySummary;
142
+ }
143
+ /**
144
+ * Strictly parses historical `V1/V2/V3`, `miotx` (`transfer_v3`, `exchange_v2`, `acquire_asset_v3`),
145
+ * and Rollup records into a deeply frozen (`Object.freeze`) read-only archive summary (`mode: 'READ_ONLY_LEGACY_ARCHIVE'`).
146
+ * Enforces strict zero-sum token and asset conservation for historical `transfer_v3` `miotx` records.
147
+ */
148
+ declare function parseLegacyTxReadOnlyArchiveRecord(rawRecord: Record<string, unknown>): LegacyTxReadOnlyArchiveSummary;
149
+ /**
150
+ * Deterministically compiles any legacy `transfer_v2`, `transfer_v3` (`miotx`), `exchange_v2` (`miotx`),
151
+ * or `acquire_asset_v2` / `acquire_asset_v3` record into a 100% VNext-pure `TransactionBlockInput`
152
+ * containing only versionless atomic statements (`fg:t:transfer`, `fg:t:acquire_asset`) with explicit
153
+ * `readSet` / `writeSet` footprints and zero-sum conservation.
154
+ */
155
+ declare function compileLegacyTxToVNextTransactionBlock(rawRecord: Record<string, unknown>): {
156
+ archiveSummary: LegacyTxReadOnlyArchiveSummary;
157
+ transactionBlock: TransactionBlockInput;
158
+ };
159
+ /**
160
+ * Executes a VNext `TransactionBlockInput` after enforcing `assertTransactionBlockVNextPure`
161
+ * (guaranteeing no deprecated `V1/V2/V3`, `miotx`, or Rollup protocol can execute at or after `sunsetActivationHeight`).
162
+ */
163
+ declare function executeVNextTransactionBlock(block: TransactionBlockInput, options: {
164
+ statedb: Record<string, any>;
165
+ executeStatement: StatementExecutor;
166
+ currentBlockHeight?: number;
167
+ sunsetActivationHeight?: number;
168
+ dryRun?: boolean;
169
+ }): Promise<TransactionBlockResult>;
170
+ type CompatibilityAddonMode = 'ADDON_TRANSLATE_AND_EXECUTE' | 'SUNSET_READ_ONLY_ARCHIVE';
171
+ interface CompatibilityDeprecationWarning {
172
+ readonly originalTypeUrl: string;
173
+ readonly translatedVNextTypeUrl: VNextCanonicalWriteProtocolTypeUrl;
174
+ readonly category: LegacyProtocolSunsetCategory | 'DOMAIN_COUPLED_ALIAS';
175
+ readonly targetRemovalRelease: string;
176
+ readonly message: string;
177
+ }
178
+ interface CompatibilityTranslationResult {
179
+ readonly transactionBlock: TransactionBlockInput;
180
+ readonly wasTranslated: boolean;
181
+ readonly compatibilityMode: CompatibilityAddonMode;
182
+ readonly deprecationWarnings: readonly CompatibilityDeprecationWarning[];
183
+ readonly archiveSummary?: LegacyTxReadOnlyArchiveSummary;
184
+ }
185
+ interface CompatibilityAddonMetrics {
186
+ readonly mode: CompatibilityAddonMode;
187
+ readonly targetRemovalRelease: string;
188
+ readonly totalTranslatedTxs: number;
189
+ readonly totalPassthroughVNextTxs: number;
190
+ readonly rejectedAfterSunsetCount: number;
191
+ readonly translatedByLegacyTypeUrl: Readonly<Record<string, number>>;
192
+ }
193
+ /**
194
+ * Issue #1251:
195
+ * Pluggable Compatibility Add-On Layer (`LegacyProtocolCompatibilityAddon`).
196
+ *
197
+ * Allows existing wallets (DID Wallet), SDKs, and legacy services that still submit deprecated
198
+ * `V1/V2/V3` (`transfer_v2`, `acquire_asset_v2`), `miotx` (`transfer_v3`, `exchange_v2`, `acquire_asset_v3`),
199
+ * or application-coupled protocol names (`contract_nft`, `give_karma`, `claim_karma`, `evm_bridge_settlement`)
200
+ * to continue working seamlessly in the current release (`ADDON_TRANSLATE_AND_EXECUTE`), while
201
+ * 100% of underlying state execution runs on the pure, domain-agnostic VNext `TransactionBlock` engine.
202
+ *
203
+ * In the next major release, operators simply switch `mode` to `'SUNSET_READ_ONLY_ARCHIVE'` (or remove the add-on)
204
+ * to reject legacy write protocols fail-closed while preserving read-only archive decoding.
205
+ */
206
+ declare class LegacyProtocolCompatibilityAddon {
207
+ private mode;
208
+ private readonly targetRemovalRelease;
209
+ private readonly sunsetActivationHeight;
210
+ private totalTranslatedTxs;
211
+ private totalPassthroughVNextTxs;
212
+ private rejectedAfterSunsetCount;
213
+ private readonly translatedCounts;
214
+ constructor(options?: {
215
+ mode?: CompatibilityAddonMode;
216
+ targetRemovalRelease?: string;
217
+ sunsetActivationHeight?: number;
218
+ });
219
+ getMode(): CompatibilityAddonMode;
220
+ setMode(mode: CompatibilityAddonMode): void;
221
+ getMetrics(): CompatibilityAddonMetrics;
222
+ private recordTranslation;
223
+ private remapStepReferencesInValue;
224
+ private translateStatementTemplateRecursively;
225
+ /**
226
+ * Translates any legacy single transaction (`transfer_v2`, `transfer_v3`, `exchange_v2`, `acquire_asset_v2/v3`,
227
+ * `mint_asset_v2`, `update_asset_v2`, `create_factory_v2`, `deposit_token_v2`, `withdraw_token_v2`),
228
+ * domain-coupled statement (`contract_nft`, `give_karma`, `claim_karma`, `evm_bridge_settlement`),
229
+ * or `TransactionBlockInput` into a 100% pure, domain-agnostic VNext `TransactionBlockInput`.
230
+ */
231
+ translateToVNextTransactionBlock(txOrBlock: Record<string, unknown> | TransactionBlockInput, options?: {
232
+ currentBlockHeight?: number;
233
+ }): CompatibilityTranslationResult;
234
+ /**
235
+ * End-to-end execution through the Compatibility Add-On Layer:
236
+ * 1. Translates legacy `V1/V2/V3`, `miotx`, or domain-coupled protocols into a pure VNext `TransactionBlockInput`
237
+ * (when in `'ADDON_TRANSLATE_AND_EXECUTE'` mode) or rejects them fail-closed (when in `'SUNSET_READ_ONLY_ARCHIVE'` mode).
238
+ * 2. Executes the resulting pure VNext `TransactionBlockInput` on the VNext `OverlayStateDB` engine.
239
+ */
240
+ executeWithCompatibilityAddon(txOrBlock: Record<string, unknown> | TransactionBlockInput, options: {
241
+ statedb: Record<string, any>;
242
+ executeStatement: StatementExecutor;
243
+ currentBlockHeight?: number;
244
+ dryRun?: boolean;
245
+ }): Promise<{
246
+ executionResult: TransactionBlockResult;
247
+ translationResult: CompatibilityTranslationResult;
248
+ }>;
249
+ }
250
+ //#endregion
251
+ export { 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 };