@ocap/tx-pipeline 1.30.26 → 1.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/appchain-sovereign-hub.d.mts +160 -0
- package/esm/appchain-sovereign-hub.mjs +348 -0
- package/esm/arcvault-external-adapter.d.mts +166 -0
- package/esm/arcvault-external-adapter.mjs +376 -0
- package/esm/encrypted-nft-envelope.d.mts +172 -0
- package/esm/encrypted-nft-envelope.mjs +458 -0
- package/esm/evm-simplified-bridge.d.mts +1370 -0
- package/esm/evm-simplified-bridge.mjs +3875 -0
- package/esm/give-to-mint-karma.d.mts +472 -0
- package/esm/give-to-mint-karma.mjs +1057 -0
- package/esm/helpers/replay-guard.d.mts +15 -0
- package/esm/helpers/replay-guard.mjs +23 -0
- package/esm/index.d.mts +10 -5
- package/esm/index.mjs +14 -10
- package/esm/legacy-protocol-sunset.d.mts +251 -0
- package/esm/legacy-protocol-sunset.mjs +1519 -0
- package/esm/library.d.mts +16 -0
- package/esm/library.mjs +17 -0
- package/esm/native-abt-exchange.d.mts +2055 -0
- package/esm/native-abt-exchange.mjs +7250 -0
- package/esm/ofac-screening.d.mts +17 -0
- package/esm/ofac-screening.mjs +39 -0
- package/esm/pipes/anti-land-attack.mjs +1 -1
- package/esm/pipes/decode-itx.mjs +46 -4
- package/esm/pipes/decode-tx.d.mts +2 -3
- package/esm/pipes/decode-tx.mjs +56 -115
- package/esm/pipes/extract-signer.mjs +2 -2
- package/esm/pipes/extract-state.mjs +14 -3
- package/esm/pipes/post-execution-invariant-gate.d.mts +61 -0
- package/esm/pipes/post-execution-invariant-gate.mjs +789 -0
- package/esm/pipes/pre-flight-waf.d.mts +73 -0
- package/esm/pipes/pre-flight-waf.mjs +756 -0
- package/esm/pipes/take-state-snapshot.mjs +3 -2
- package/esm/pipes/update-owner.mjs +39 -4
- package/esm/pipes/verify-account-migration.mjs +14 -4
- package/esm/pipes/verify-blocked.mjs +1 -1
- package/esm/pipes/verify-delegation.d.mts +22 -3
- package/esm/pipes/verify-delegation.mjs +259 -36
- package/esm/pipes/verify-list-size.mjs +1 -1
- package/esm/pipes/verify-multisig-v2.mjs +15 -7
- package/esm/pipes/verify-multisig.mjs +15 -7
- package/esm/pipes/verify-sender.mjs +1 -1
- package/esm/pipes/verify-signature.mjs +35 -6
- package/esm/pipes/verify-signer.mjs +2 -2
- package/esm/pipes/verify-state-diff.mjs +3 -3
- package/esm/pipes/verify-token-access.mjs +1 -1
- package/esm/pipes/verify-token-balance.mjs +13 -5
- package/esm/pipes/verify-transferrable.d.mts +8 -1
- package/esm/pipes/verify-transferrable.mjs +3 -3
- package/esm/pipes/verify-tx-input.mjs +2 -2
- package/esm/pipes/verify-tx-size.mjs +46 -2
- package/esm/pipes/verify-tx.mjs +5 -7
- package/esm/pipes/verify-updater.mjs +1 -1
- package/esm/social-economy-factories.d.mts +346 -0
- package/esm/social-economy-factories.mjs +845 -0
- package/esm/super-suites-foundation.d.mts +513 -0
- package/esm/super-suites-foundation.mjs +1241 -0
- package/esm/transaction-block.d.mts +471 -0
- package/esm/transaction-block.mjs +1906 -0
- package/esm/uniswap-erc7683-solver.d.mts +201 -0
- package/esm/uniswap-erc7683-solver.mjs +321 -0
- package/esm/uniswap-lp-copilot.d.mts +113 -0
- package/esm/uniswap-lp-copilot.mjs +320 -0
- package/esm/uniswap-router.d.mts +335 -0
- package/esm/uniswap-router.mjs +578 -0
- package/esm/uniswap-token-factory-graduation.d.mts +187 -0
- package/esm/uniswap-token-factory-graduation.mjs +426 -0
- package/esm/uniswap-v4-hook.d.mts +173 -0
- package/esm/uniswap-v4-hook.mjs +517 -0
- package/lib/appchain-sovereign-hub.cjs +352 -0
- package/lib/appchain-sovereign-hub.d.cts +160 -0
- package/lib/arcvault-external-adapter.cjs +383 -0
- package/lib/arcvault-external-adapter.d.cts +166 -0
- package/lib/encrypted-nft-envelope.cjs +477 -0
- package/lib/encrypted-nft-envelope.d.cts +172 -0
- package/lib/evm-simplified-bridge.cjs +3943 -0
- package/lib/evm-simplified-bridge.d.cts +1370 -0
- package/lib/give-to-mint-karma.cjs +1084 -0
- package/lib/give-to-mint-karma.d.cts +472 -0
- package/lib/helpers/replay-guard.cjs +27 -0
- package/lib/helpers/replay-guard.d.cts +15 -0
- package/lib/index.cjs +49 -16
- package/lib/index.d.cts +10 -5
- package/lib/legacy-protocol-sunset.cjs +1543 -0
- package/lib/legacy-protocol-sunset.d.cts +251 -0
- package/lib/library.cjs +303 -0
- package/lib/library.d.cts +16 -0
- package/lib/native-abt-exchange.cjs +7322 -0
- package/lib/native-abt-exchange.d.cts +2055 -0
- package/lib/ofac-screening.cjs +42 -0
- package/lib/ofac-screening.d.cts +17 -0
- package/lib/pipes/anti-land-attack.cjs +2 -2
- package/lib/pipes/decode-itx.cjs +46 -4
- package/lib/pipes/decode-itx.d.cts +1 -1
- package/lib/pipes/decode-tx.cjs +55 -116
- package/lib/pipes/decode-tx.d.cts +3 -4
- package/lib/pipes/extract-signer.cjs +2 -2
- package/lib/pipes/extract-state.cjs +14 -3
- package/lib/pipes/post-execution-invariant-gate.cjs +800 -0
- package/lib/pipes/post-execution-invariant-gate.d.cts +61 -0
- package/lib/pipes/pre-flight-waf.cjs +772 -0
- package/lib/pipes/pre-flight-waf.d.cts +73 -0
- package/lib/pipes/take-state-snapshot.cjs +3 -2
- package/lib/pipes/update-owner.cjs +40 -5
- package/lib/pipes/update-owner.d.cts +1 -1
- package/lib/pipes/verify-account-migration.cjs +14 -4
- package/lib/pipes/verify-blocked.cjs +1 -1
- package/lib/pipes/verify-delegation.cjs +259 -36
- package/lib/pipes/verify-delegation.d.cts +22 -3
- package/lib/pipes/verify-list-size.cjs +1 -1
- package/lib/pipes/verify-multisig-v2.cjs +15 -7
- package/lib/pipes/verify-multisig.cjs +15 -7
- package/lib/pipes/verify-sender.cjs +1 -1
- package/lib/pipes/verify-service-fee.d.cts +1 -1
- package/lib/pipes/verify-signature.cjs +35 -6
- package/lib/pipes/verify-signature.d.cts +1 -1
- package/lib/pipes/verify-signer.cjs +2 -2
- package/lib/pipes/verify-state-diff.cjs +4 -4
- package/lib/pipes/verify-token-access.cjs +2 -2
- package/lib/pipes/verify-token-balance.cjs +13 -5
- package/lib/pipes/verify-transferrable.cjs +3 -3
- package/lib/pipes/verify-transferrable.d.cts +8 -1
- package/lib/pipes/verify-tx-input.cjs +3 -3
- package/lib/pipes/verify-tx-size.cjs +46 -2
- package/lib/pipes/verify-tx-size.d.cts +1 -1
- package/lib/pipes/verify-tx.cjs +6 -8
- package/lib/pipes/verify-tx.d.cts +1 -1
- package/lib/pipes/verify-updater.cjs +1 -1
- package/lib/social-economy-factories.cjs +852 -0
- package/lib/social-economy-factories.d.cts +346 -0
- package/lib/super-suites-foundation.cjs +1257 -0
- package/lib/super-suites-foundation.d.cts +513 -0
- package/lib/transaction-block.cjs +1941 -0
- package/lib/transaction-block.d.cts +471 -0
- package/lib/uniswap-erc7683-solver.cjs +327 -0
- package/lib/uniswap-erc7683-solver.d.cts +201 -0
- package/lib/uniswap-lp-copilot.cjs +328 -0
- package/lib/uniswap-lp-copilot.d.cts +113 -0
- package/lib/uniswap-router.cjs +593 -0
- package/lib/uniswap-router.d.cts +335 -0
- package/lib/uniswap-token-factory-graduation.cjs +431 -0
- package/lib/uniswap-token-factory-graduation.d.cts +187 -0
- package/lib/uniswap-v4-hook.cjs +527 -0
- package/lib/uniswap-v4-hook.d.cts +173 -0
- package/package.json +11 -10
- package/esm/helpers/dedup-height.d.mts +0 -16
- package/esm/helpers/dedup-height.mjs +0 -61
- package/lib/helpers/dedup-height.cjs +0 -72
- package/lib/helpers/dedup-height.d.cts +0 -16
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CustomError } from "@ocap/util/lib/error";
|
|
2
|
+
import { IBaseContext, IChainConfig, IDecodedContext, IDecodedTransaction } from "@ocap/types";
|
|
3
|
+
|
|
4
|
+
//#region src/pipes/pre-flight-waf.d.ts
|
|
5
|
+
declare const MAX_PREFLIGHT_JSON_DEPTH = 16;
|
|
6
|
+
declare const MAX_PREFLIGHT_JSON_KEYS = 512;
|
|
7
|
+
declare const MAX_PREFLIGHT_STRING_FIELD_BYTES: number;
|
|
8
|
+
declare const MAX_PREFLIGHT_WIRE_BYTES_FALLBACK: number;
|
|
9
|
+
declare const MAX_ROLLUP_TXS_LIST_SIZE = 512;
|
|
10
|
+
declare const MAX_DELEGATE_TYPE_URLS_LIST_SIZE = 128;
|
|
11
|
+
/**
|
|
12
|
+
* Fast O(1) wire-size and base64 character validation before allocating buffers or decoding.
|
|
13
|
+
*/
|
|
14
|
+
declare function assertRawWireEnvelope(txBase64: string, config?: IChainConfig): void;
|
|
15
|
+
/**
|
|
16
|
+
* Reject unknown / alien fields in raw or CBOR `tx.itx` payloads that would otherwise be silently
|
|
17
|
+
* stripped by `createMessage()` or `vStripUnknown()`.
|
|
18
|
+
*/
|
|
19
|
+
declare function assertKnownItxFields(typeUrl: string, rawInner: Record<string, unknown>): void;
|
|
20
|
+
/**
|
|
21
|
+
* Deep structural & anomaly scanner over decoded `itx` and raw `tx.itx`.
|
|
22
|
+
*/
|
|
23
|
+
declare function scanItxPayloadAnomalies(itx: unknown, txType: string | undefined, config?: IChainConfig, rawTxItx?: unknown, txSignatures?: unknown): void;
|
|
24
|
+
/**
|
|
25
|
+
* Pipeline pipe that runs the Pre-Flight WAF structural & anomaly checks.
|
|
26
|
+
*/
|
|
27
|
+
declare function PreFlightWaf(context: IDecodedContext, next: (err?: CustomError) => void): void;
|
|
28
|
+
declare namespace PreFlightWaf {
|
|
29
|
+
var SNAPSHOT_SYMBOL: typeof PREFLIGHT_VERIFIED_SNAPSHOT_SYMBOL;
|
|
30
|
+
var tryApplyVerifiedSnapshot: typeof tryApplyPreFlightVerifiedSnapshot;
|
|
31
|
+
}
|
|
32
|
+
declare const PREFLIGHT_VERIFIED_SNAPSHOT_SYMBOL: unique symbol;
|
|
33
|
+
interface IPreFlightVerifiedSnapshot {
|
|
34
|
+
txBase64: string;
|
|
35
|
+
configRef: IChainConfig | undefined;
|
|
36
|
+
chainId: unknown;
|
|
37
|
+
tokenDecimal: unknown;
|
|
38
|
+
txFeeForType: unknown;
|
|
39
|
+
maxTxSizeForType: unknown;
|
|
40
|
+
maxExtraSize: unknown;
|
|
41
|
+
maxMultisig: unknown;
|
|
42
|
+
maxListSize: unknown;
|
|
43
|
+
maxAssetSize: unknown;
|
|
44
|
+
isSupportedTx: boolean;
|
|
45
|
+
isMultiSignV2Tx: boolean;
|
|
46
|
+
txExtraSerialized: string;
|
|
47
|
+
gasStakeHeadersSerialized: string;
|
|
48
|
+
coSignatureSerialized: string;
|
|
49
|
+
tx: IDecodedTransaction;
|
|
50
|
+
txEncoding: 'cbor' | 'protobuf';
|
|
51
|
+
txSize: number;
|
|
52
|
+
baseTxSize: number;
|
|
53
|
+
extraSizeCounted: boolean;
|
|
54
|
+
txHash: string;
|
|
55
|
+
unsignedTxHash: string;
|
|
56
|
+
txBaseGas: boolean;
|
|
57
|
+
itx: Record<string, unknown>;
|
|
58
|
+
txType: string;
|
|
59
|
+
rawTxItxBeforeNormalize: unknown;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Apply the verified pre-flight snapshot onto `context` if and only if all verified inputs
|
|
63
|
+
* (`txBase64`, `config` invariants, and `extra.{txExtra,gasStakeHeaders,coSignature}`) are
|
|
64
|
+
* unchanged since `inspectTransactionPreFlight(context)` succeeded.
|
|
65
|
+
*/
|
|
66
|
+
declare function tryApplyPreFlightVerifiedSnapshot(context: IBaseContext): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Stateless, zero-DB-I/O Pre-Flight inspection runner for `OCAPResolver.sendTx`
|
|
69
|
+
* BEFORE enqueuing into the single-writer queue (`this.queue`) or acquiring the SQLite write lock.
|
|
70
|
+
*/
|
|
71
|
+
declare function inspectTransactionPreFlight(context: IBaseContext): Promise<IDecodedContext>;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { IPreFlightVerifiedSnapshot, 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, PREFLIGHT_VERIFIED_SNAPSHOT_SYMBOL, assertKnownItxFields, assertRawWireEnvelope, PreFlightWaf as default, inspectTransactionPreFlight, scanItxPayloadAnomalies, tryApplyPreFlightVerifiedSnapshot };
|