@newton-xyz/policy-pack-blockaid 2.0.2 → 2.0.4
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/dist/index.cjs +21 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -22
- package/dist/index.d.ts +25 -22
- package/dist/index.js +23 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
SecretsSchema: () => SecretsSchema,
|
|
30
30
|
WasmArgsSchema: () => WasmArgsSchema,
|
|
31
31
|
blockaid: () => blockaid,
|
|
32
|
+
blockaidOracleModule: () => blockaidOracleModule,
|
|
32
33
|
deployments: () => deployments,
|
|
33
34
|
prepareQuery: () => prepareQuery
|
|
34
35
|
});
|
|
@@ -38,38 +39,34 @@ module.exports = __toCommonJS(index_exports);
|
|
|
38
39
|
var deployments = {
|
|
39
40
|
"84532": {
|
|
40
41
|
stagef: {
|
|
41
|
-
policy: "
|
|
42
|
-
policyData: "
|
|
43
|
-
wasmCid: "
|
|
42
|
+
policy: "0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c",
|
|
43
|
+
policyData: "0x1808Ad6D96E736D6867b4e0773e4641940Cff555",
|
|
44
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
44
45
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
45
|
-
deployedAt: "2026-06-
|
|
46
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Base Sepolia, stagef)"
|
|
46
|
+
deployedAt: "2026-06-16"
|
|
47
47
|
},
|
|
48
48
|
prod: {
|
|
49
|
-
policy: "
|
|
50
|
-
policyData: "
|
|
51
|
-
wasmCid: "
|
|
49
|
+
policy: "0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3",
|
|
50
|
+
policyData: "0xa086D57d33d030A5209fED5f62be0014f09B0413",
|
|
51
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
52
52
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
53
|
-
deployedAt: "2026-06-
|
|
54
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Base Sepolia, prod)"
|
|
53
|
+
deployedAt: "2026-06-16"
|
|
55
54
|
}
|
|
56
55
|
},
|
|
57
56
|
"11155111": {
|
|
58
57
|
stagef: {
|
|
59
|
-
policy: "
|
|
60
|
-
policyData: "
|
|
61
|
-
wasmCid: "
|
|
58
|
+
policy: "0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7",
|
|
59
|
+
policyData: "0x97697E15119b85365eFa6eF3C2Dc704c177b6384",
|
|
60
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
62
61
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
63
|
-
deployedAt: "2026-06-
|
|
64
|
-
notes: "Phase 0 Stream D \u2014 composite namespacing redeploy"
|
|
62
|
+
deployedAt: "2026-06-16"
|
|
65
63
|
},
|
|
66
64
|
prod: {
|
|
67
|
-
policy: "
|
|
68
|
-
policyData: "
|
|
69
|
-
wasmCid: "
|
|
65
|
+
policy: "0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73",
|
|
66
|
+
policyData: "0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1",
|
|
67
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
70
68
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
71
|
-
deployedAt: "2026-06-
|
|
72
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Sepolia, prod)"
|
|
69
|
+
deployedAt: "2026-06-16"
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
72
|
};
|
|
@@ -81,6 +78,9 @@ var PACK_DESCRIPTION = "Gates vault deposits at transaction-submission time usin
|
|
|
81
78
|
var PACK_LINK = "https://www.blockaid.io";
|
|
82
79
|
var PACK_AUTHOR = "";
|
|
83
80
|
|
|
81
|
+
// src/pack.ts
|
|
82
|
+
var import_policy_pack_shared = require("@newton-xyz/policy-pack-shared");
|
|
83
|
+
|
|
84
84
|
// src/params.ts
|
|
85
85
|
var import_zod = require("zod");
|
|
86
86
|
var ParamsSchema = import_zod.z.object({
|
|
@@ -167,4 +167,5 @@ var blockaid = {
|
|
|
167
167
|
link: PACK_LINK || void 0
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
+
var blockaidOracleModule = (0, import_policy_pack_shared.oracleModuleFromPack)(blockaid);
|
|
170
171
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/deployments.ts","../src/metadata.ts","../src/params.ts","../src/prepare-query.ts","../src/secrets.ts","../src/wasm-args.ts","../src/pack.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n\nexport * from \"./deployments\";\nexport * from \"./metadata\";\nexport * from \"./pack\";\nexport * from \"./params\";\nexport * from \"./secrets\";\nexport * from \"./wasm-args\";\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nimport type { ChainId, Deployment, GatewayEnv } from \"@newton-xyz/policy-pack-shared\";\n\nexport const deployments = {\n\t\"84532\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x2DfC58315De3e43F365449aF68202fC4AA3CC0a3\",\n\t\t\tpolicyData: \"0xB03321c6E4905c399ED5E7aAeDA8A180dEfC175b\",\n\t\t\twasmCid: \"bafybeidp2gyreu3e7qhflnwlhcrboug6bj4wzayythtd4efnr6reyyxe2e\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, stagef)\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x16B61ba697eeD838Ca7E09154289781EebbdC7f2\",\n\t\t\tpolicyData: \"0x3F14D8a7780153c32200829B4E7eE64D9e21550C\",\n\t\t\twasmCid: \"bafybeicqujyqanpoh3lserei46d5yrwcqjzvbs3uof45xipkvoyqgrxv74\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, prod)\",\n\t\t},\n\t},\n\t\"11155111\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0xcBC09be770c0b220ABC5D95A49f81964B8E2da43\",\n\t\t\tpolicyData: \"0x2305EC115a0E34D3772D68912bBD85eB6C3c550d\",\n\t\t\twasmCid: \"bafybeia2ci3xamxzjontcqv22zlv3cv7lk5nrwnlgcf5oriwhsw5pc6vni\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D — composite namespacing redeploy\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x992bc96446B048FE0bD7DAA11E741A4e9e709777\",\n\t\t\tpolicyData: \"0x6A245Fca1FFF1197D6692944639971891B09Ee21\",\n\t\t\twasmCid: \"bafybeicf2rj3zdinteuji6zb2oh3rshcojh2y36qvev2gggtenajkspw5e\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Sepolia, prod)\",\n\t\t},\n\t},\n} as const satisfies Readonly<\n\tPartial<Record<ChainId, Readonly<Partial<Record<GatewayEnv, Deployment>>>>>\n>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nexport const PACK_NAME = \"blockaid\" as const;\nexport const PACK_VERSION = \"0.0.1\" as const;\nexport const PACK_DESCRIPTION =\n\t\"Gates vault deposits at transaction-submission time using Blockaid's EVM transaction scan (validation + simulation) to catch malicious calldata, frontend-redirect attacks, and value-skim simulations\" as const;\nexport const PACK_LINK = \"https://www.blockaid.io\" as const;\nexport const PACK_AUTHOR = \"\" as const;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/params_schema.json\nimport { z } from \"zod\";\n\nexport const ParamsSchema = z\n\t.object({\n\t\tdeny_features: z\n\t\t\t.array(z.string())\n\t\t\t.describe(\n\t\t\t\t\"Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])\",\n\t\t\t),\n\t\tmax_outbound_inbound_ratio: z\n\t\t\t.number()\n\t\t\t.describe(\n\t\t\t\t\"Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.\",\n\t\t\t),\n\t\trequire_received_shares: z\n\t\t\t.boolean()\n\t\t\t.describe(\n\t\t\t\t\"Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.\",\n\t\t\t),\n\t})\n\t.describe(\"Thresholds for the Blockaid transaction-time exploit gate\")\n\t.strict();\n\nexport type Params = z.infer<typeof ParamsSchema>;\n","import type { PrepareQueryArgs, PrepareQueryResult } from \"@newton-xyz/policy-pack-shared\";\nimport type { WasmArgs } from \"./wasm-args\";\n\n/**\n * Blockaid maps EVM chain id → its own chain identifier slug. Keep this\n * aligned with whatever the AVS-side `policy.js` posts to Blockaid; if you\n * extend it, extend both sides together.\n */\nconst CHAIN_BY_ID: Readonly<Record<number, string>> = {\n\t1: \"ethereum\",\n\t8453: \"base\",\n\t42161: \"arbitrum\",\n\t10: \"optimism\",\n\t137: \"polygon\",\n\t56: \"bsc\",\n\t11155111: \"sepolia\",\n\t84532: \"base-sepolia\",\n};\n\n/**\n * Per-call inputs for Blockaid: every wasmArg (`from`, `to`, `value`, `data`)\n * mirrors the on-chain transaction the depositor is about to submit, so it\n * has to come from the SDK's intent context — `PrepareQueryArgs` (which only\n * carries `publicClient` + `vault`) doesn't have any of it. The SDK forwards\n * these via `prepareQuery`'s second `options` arg (introduced in NEWT-1499).\n *\n * `chain` is derived from `publicClient.chain.id` so curators don't have to\n * keep the Blockaid slug list in sync separately.\n */\nexport interface PrepareQueryOptions {\n\treadonly from: string;\n\treadonly to: string;\n\treadonly value?: string;\n\treadonly data?: string;\n}\n\nexport async function prepareQuery(\n\t{ publicClient }: PrepareQueryArgs,\n\toptions?: PrepareQueryOptions,\n): Promise<PrepareQueryResult<WasmArgs>> {\n\tconst chainId = publicClient.chain?.id;\n\tif (chainId === undefined) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: publicClient.chain is undefined. Pass a chain to viem's createPublicClient.\",\n\t\t);\n\t}\n\tconst chain = CHAIN_BY_ID[chainId];\n\tif (!chain) {\n\t\tthrow new Error(\n\t\t\t`policy-pack-blockaid: chain id ${chainId} is not in the Blockaid chain map. Add it to CHAIN_BY_ID before using this pack on this chain.`,\n\t\t);\n\t}\n\tif (!options?.from || !options?.to) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: prepareQuery requires `from` and `to` in the options bag — these mirror the on-chain transaction the depositor is about to submit.\",\n\t\t);\n\t}\n\n\treturn {\n\t\twasmArgs: {\n\t\t\tchain,\n\t\t\tfrom: options.from,\n\t\t\tto: options.to,\n\t\t\tvalue: options.value,\n\t\t\tdata: options.data,\n\t\t},\n\t};\n}\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/secrets_schema.json\nimport { z } from \"zod\";\n\nexport const SecretsSchema = z.object({ BLOCKAID_API_KEY: z.string().min(1) }).strict();\n\nexport type Secrets = z.infer<typeof SecretsSchema>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/wasm_args_schema.json\nimport { z } from \"zod\";\n\nexport const WasmArgsSchema = z\n\t.object({\n\t\tchain: z.string().describe(\"Blockaid chain identifier (e.g. 'ethereum', 'base', 'arbitrum').\"),\n\t\tfrom: z.string().describe(\"Sender / account address (0x-prefixed 20-byte address).\"),\n\t\tto: z.string().describe(\"Recipient or contract address being called (0x-prefixed).\"),\n\t\tvalue: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t\"Transaction value in wei as a 0x-prefixed hex string. Defaults to '0x0' when omitted.\",\n\t\t\t)\n\t\t\t.optional(),\n\t\tdata: z\n\t\t\t.string()\n\t\t\t.describe(\"Transaction calldata as a 0x-prefixed hex string. Defaults to '0x' when omitted.\")\n\t\t\t.optional(),\n\t})\n\t.describe(\"Inputs passed to the Blockaid policy WASM at evaluation time\");\n\nexport type WasmArgs = z.infer<typeof WasmArgsSchema>;\n","// Hand-written canonical export — survives `pnpm gen:bindings` regen.\n// The generated `index.ts` re-exports `pack.ts` when present.\nimport type { PolicyPack } from \"@newton-xyz/policy-pack-shared\";\nimport { deployments } from \"./deployments\";\nimport { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION } from \"./metadata\";\nimport { type Params, ParamsSchema } from \"./params\";\nimport { prepareQuery } from \"./prepare-query\";\nimport { type Secrets, SecretsSchema } from \"./secrets\";\nimport { type WasmArgs, WasmArgsSchema } from \"./wasm-args\";\n\nexport { type PrepareQueryOptions, prepareQuery } from \"./prepare-query\";\n\n/**\n * The Blockaid transaction-scan `PolicyPack`.\n *\n * Pass to `createShield(...)` from `@newton-xyz/newton-shield-sdk`. Encoding\n * for the on-chain `policyParams` blob is handled by `encodePolicyParams` /\n * `decodePolicyParams` in `@newton-xyz/policy-pack-shared` (UTF-8 JSON,\n * sorted keys) — not per-pack.\n *\n * `prepareQuery` derives the Blockaid `chain` slug from `publicClient.chain.id`\n * and reads `from`/`to`/`value`/`data` from the SDK's per-call options bag —\n * these mirror the on-chain transaction the depositor is about to submit, so\n * they can't be inferred from `PrepareQueryArgs` alone.\n */\nexport const blockaid: PolicyPack<Params, WasmArgs, Secrets> = {\n\tid: `${PACK_NAME}/transaction-scan/v1`,\n\tparamsSchema: ParamsSchema,\n\twasmArgsSchema: WasmArgsSchema,\n\tsecretsSchema: SecretsSchema,\n\tprepareQuery,\n\tdeployments,\n\tmetadata: {\n\t\tname: PACK_NAME,\n\t\tversion: PACK_VERSION,\n\t\tdescription: PACK_DESCRIPTION,\n\t\tauthor: PACK_AUTHOR || undefined,\n\t\tlink: PACK_LINK || undefined,\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,cAAc;AAAA,EAC1B,SAAS;AAAA,IACR,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,IACA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AAA,IAC1C;AAAA,EACD;AACA,MAAI,CAAC,SAAS,QAAQ,CAAC,SAAS,IAAI;AACnC,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,UAAU;AAAA,MACT;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,IAAI,QAAQ;AAAA,MACZ,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ;AAAA,IACf;AAAA,EACD;AACD;;;AChEA,IAAAA,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO,EAAE,kBAAkB,cAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;;;ACFtF,IAAAC,cAAkB;AAEX,IAAM,iBAAiB,cAC5B,OAAO;AAAA,EACP,OAAO,cAAE,OAAO,EAAE,SAAS,kEAAkE;AAAA,EAC7F,MAAM,cAAE,OAAO,EAAE,SAAS,yDAAyD;AAAA,EACnF,IAAI,cAAE,OAAO,EAAE,SAAS,2DAA2D;AAAA,EACnF,OAAO,cACL,OAAO,EACP;AAAA,IACA;AAAA,EACD,EACC,SAAS;AAAA,EACX,MAAM,cACJ,OAAO,EACP,SAAS,kFAAkF,EAC3F,SAAS;AACZ,CAAC,EACA,SAAS,8DAA8D;;;ACIlE,IAAM,WAAkD;AAAA,EAC9D,IAAI,GAAG,SAAS;AAAA,EAChB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,QAAQ,eAAe;AAAA,IACvB,MAAM,aAAa;AAAA,EACpB;AACD;","names":["import_zod","import_zod"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/deployments.ts","../src/metadata.ts","../src/pack.ts","../src/params.ts","../src/prepare-query.ts","../src/secrets.ts","../src/wasm-args.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n\nexport * from \"./deployments\";\nexport * from \"./metadata\";\nexport * from \"./pack\";\nexport * from \"./params\";\nexport * from \"./secrets\";\nexport * from \"./wasm-args\";\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nimport type { ChainId, Deployment, GatewayEnv } from \"@newton-xyz/policy-pack-shared\";\n\nexport const deployments = {\n\t\"84532\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c\",\n\t\t\tpolicyData: \"0x1808Ad6D96E736D6867b4e0773e4641940Cff555\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3\",\n\t\t\tpolicyData: \"0xa086D57d33d030A5209fED5f62be0014f09B0413\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t},\n\t\"11155111\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7\",\n\t\t\tpolicyData: \"0x97697E15119b85365eFa6eF3C2Dc704c177b6384\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73\",\n\t\t\tpolicyData: \"0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t},\n} as const satisfies Readonly<\n\tPartial<Record<ChainId, Readonly<Partial<Record<GatewayEnv, Deployment>>>>>\n>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nexport const PACK_NAME = \"blockaid\" as const;\nexport const PACK_VERSION = \"0.0.1\" as const;\nexport const PACK_DESCRIPTION =\n\t\"Gates vault deposits at transaction-submission time using Blockaid's EVM transaction scan (validation + simulation) to catch malicious calldata, frontend-redirect attacks, and value-skim simulations\" as const;\nexport const PACK_LINK = \"https://www.blockaid.io\" as const;\nexport const PACK_AUTHOR = \"\" as const;\n","// Hand-written canonical export — survives `pnpm gen:bindings` regen.\n// The generated `index.ts` re-exports `pack.ts` when present.\nimport {\n\ttype OracleModule,\n\toracleModuleFromPack,\n\ttype PolicyPack,\n} from \"@newton-xyz/policy-pack-shared\";\nimport { deployments } from \"./deployments\";\nimport { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION } from \"./metadata\";\nimport { type Params, ParamsSchema } from \"./params\";\nimport { prepareQuery } from \"./prepare-query\";\nimport { type Secrets, SecretsSchema } from \"./secrets\";\nimport { type WasmArgs, WasmArgsSchema } from \"./wasm-args\";\n\nexport { type PrepareQueryOptions, prepareQuery } from \"./prepare-query\";\n\n/**\n * The Blockaid transaction-scan `PolicyPack`.\n *\n * Pass to `createShield(...)` from `@newton-xyz/newton-shield-sdk`. Encoding\n * for the on-chain `policyParams` blob is handled by `encodePolicyParams` /\n * `decodePolicyParams` in `@newton-xyz/policy-pack-shared` (UTF-8 JSON,\n * sorted keys) — not per-pack.\n *\n * `prepareQuery` derives the Blockaid `chain` slug from `publicClient.chain.id`\n * and reads `from`/`to`/`value`/`data` from the SDK's per-call options bag —\n * these mirror the on-chain transaction the depositor is about to submit, so\n * they can't be inferred from `PrepareQueryArgs` alone.\n */\nexport const blockaid: PolicyPack<Params, WasmArgs, Secrets> = {\n\tid: `${PACK_NAME}/transaction-scan/v1`,\n\tparamsSchema: ParamsSchema,\n\twasmArgsSchema: WasmArgsSchema,\n\tsecretsSchema: SecretsSchema,\n\tprepareQuery,\n\tdeployments,\n\tmetadata: {\n\t\tname: PACK_NAME,\n\t\tversion: PACK_VERSION,\n\t\tdescription: PACK_DESCRIPTION,\n\t\tauthor: PACK_AUTHOR || undefined,\n\t\tlink: PACK_LINK || undefined,\n\t},\n};\n\n/**\n * Composite-policy view of the blockaid pack. Pass to `defineComposite(...)`\n * (Phase 2 — see `docs/composite-policies.md`) when stacking blockaid with\n * other packs in one Shield. Strict subset of the `PolicyPack` above —\n * shares the same `id`, schemas, and deployments.\n */\nexport const blockaidOracleModule: OracleModule<Params, WasmArgs, Secrets> =\n\toracleModuleFromPack(blockaid);\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/params_schema.json\nimport { z } from \"zod\";\n\nexport const ParamsSchema = z\n\t.object({\n\t\tdeny_features: z\n\t\t\t.array(z.string())\n\t\t\t.describe(\n\t\t\t\t\"Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])\",\n\t\t\t),\n\t\tmax_outbound_inbound_ratio: z\n\t\t\t.number()\n\t\t\t.describe(\n\t\t\t\t\"Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.\",\n\t\t\t),\n\t\trequire_received_shares: z\n\t\t\t.boolean()\n\t\t\t.describe(\n\t\t\t\t\"Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.\",\n\t\t\t),\n\t})\n\t.describe(\"Thresholds for the Blockaid transaction-time exploit gate\")\n\t.strict();\n\nexport type Params = z.infer<typeof ParamsSchema>;\n","import type { PrepareQueryArgs, PrepareQueryResult } from \"@newton-xyz/policy-pack-shared\";\nimport type { WasmArgs } from \"./wasm-args\";\n\n/**\n * Blockaid maps EVM chain id → its own chain identifier slug. Keep this\n * aligned with whatever the AVS-side `policy.js` posts to Blockaid; if you\n * extend it, extend both sides together.\n */\nconst CHAIN_BY_ID: Readonly<Record<number, string>> = {\n\t1: \"ethereum\",\n\t8453: \"base\",\n\t42161: \"arbitrum\",\n\t10: \"optimism\",\n\t137: \"polygon\",\n\t56: \"bsc\",\n\t11155111: \"sepolia\",\n\t84532: \"base-sepolia\",\n};\n\n/**\n * Per-call inputs for Blockaid: every wasmArg (`from`, `to`, `value`, `data`)\n * mirrors the on-chain transaction the depositor is about to submit, so it\n * has to come from the SDK's intent context — `PrepareQueryArgs` (which only\n * carries `publicClient` + `vault`) doesn't have any of it. The SDK forwards\n * these via `prepareQuery`'s second `options` arg (introduced in NEWT-1499).\n *\n * `chain` is derived from `publicClient.chain.id` so curators don't have to\n * keep the Blockaid slug list in sync separately.\n */\nexport interface PrepareQueryOptions {\n\treadonly from: string;\n\treadonly to: string;\n\treadonly value?: string;\n\treadonly data?: string;\n}\n\nexport async function prepareQuery(\n\t{ publicClient }: PrepareQueryArgs,\n\toptions?: PrepareQueryOptions,\n): Promise<PrepareQueryResult<WasmArgs>> {\n\tconst chainId = publicClient.chain?.id;\n\tif (chainId === undefined) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: publicClient.chain is undefined. Pass a chain to viem's createPublicClient.\",\n\t\t);\n\t}\n\tconst chain = CHAIN_BY_ID[chainId];\n\tif (!chain) {\n\t\tthrow new Error(\n\t\t\t`policy-pack-blockaid: chain id ${chainId} is not in the Blockaid chain map. Add it to CHAIN_BY_ID before using this pack on this chain.`,\n\t\t);\n\t}\n\tif (!options?.from || !options?.to) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: prepareQuery requires `from` and `to` in the options bag — these mirror the on-chain transaction the depositor is about to submit.\",\n\t\t);\n\t}\n\n\treturn {\n\t\twasmArgs: {\n\t\t\tchain,\n\t\t\tfrom: options.from,\n\t\t\tto: options.to,\n\t\t\tvalue: options.value,\n\t\t\tdata: options.data,\n\t\t},\n\t};\n}\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/secrets_schema.json\nimport { z } from \"zod\";\n\nexport const SecretsSchema = z.object({ BLOCKAID_API_KEY: z.string().min(1) }).strict();\n\nexport type Secrets = z.infer<typeof SecretsSchema>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/wasm_args_schema.json\nimport { z } from \"zod\";\n\nexport const WasmArgsSchema = z\n\t.object({\n\t\tchain: z.string().describe(\"Blockaid chain identifier (e.g. 'ethereum', 'base', 'arbitrum').\"),\n\t\tfrom: z.string().describe(\"Sender / account address (0x-prefixed 20-byte address).\"),\n\t\tto: z.string().describe(\"Recipient or contract address being called (0x-prefixed).\"),\n\t\tvalue: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t\"Transaction value in wei as a 0x-prefixed hex string. Defaults to '0x0' when omitted.\",\n\t\t\t)\n\t\t\t.optional(),\n\t\tdata: z\n\t\t\t.string()\n\t\t\t.describe(\"Transaction calldata as a 0x-prefixed hex string. Defaults to '0x' when omitted.\")\n\t\t\t.optional(),\n\t})\n\t.describe(\"Inputs passed to the Blockaid policy WASM at evaluation time\");\n\nexport type WasmArgs = z.infer<typeof WasmArgsSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,cAAc;AAAA,EAC1B,SAAS;AAAA,IACR,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,IACA,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,IACA,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AACD;;;ACnCO,IAAM,YAAY;AAClB,IAAM,eAAe;AACrB,IAAM,mBACZ;AACM,IAAM,YAAY;AAClB,IAAM,cAAc;;;ACL3B,gCAIO;;;ACHP,iBAAkB;AAEX,IAAM,eAAe,aAC1B,OAAO;AAAA,EACP,eAAe,aACb,MAAM,aAAE,OAAO,CAAC,EAChB;AAAA,IACA;AAAA,EACD;AAAA,EACD,4BAA4B,aAC1B,OAAO,EACP;AAAA,IACA;AAAA,EACD;AAAA,EACD,yBAAyB,aACvB,QAAQ,EACR;AAAA,IACA;AAAA,EACD;AACF,CAAC,EACA,SAAS,2DAA2D,EACpE,OAAO;;;AChBT,IAAM,cAAgD;AAAA,EACrD,GAAG;AAA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AgB;AAAA,EAChB,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,QAAQ,eAAe;AAAA,IACvB,MAAM,aAAa;AAAA,EACpB;AACD;AAQO,IAAM,2BACZ,gDAAqB,QAAQ;","names":["import_zod","import_zod"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
import { PrepareQueryArgs, PrepareQueryResult, PolicyPack } from '@newton-xyz/policy-pack-shared';
|
|
1
|
+
import { PrepareQueryArgs, PrepareQueryResult, PolicyPack, OracleModule } from '@newton-xyz/policy-pack-shared';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare const deployments: {
|
|
5
5
|
readonly "84532": {
|
|
6
6
|
readonly stagef: {
|
|
7
|
-
readonly policy: "
|
|
8
|
-
readonly policyData: "
|
|
9
|
-
readonly wasmCid: "
|
|
7
|
+
readonly policy: "0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c";
|
|
8
|
+
readonly policyData: "0x1808Ad6D96E736D6867b4e0773e4641940Cff555";
|
|
9
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
10
10
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
11
|
-
readonly deployedAt: "2026-06-
|
|
12
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, stagef)";
|
|
11
|
+
readonly deployedAt: "2026-06-16";
|
|
13
12
|
};
|
|
14
13
|
readonly prod: {
|
|
15
|
-
readonly policy: "
|
|
16
|
-
readonly policyData: "
|
|
17
|
-
readonly wasmCid: "
|
|
14
|
+
readonly policy: "0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3";
|
|
15
|
+
readonly policyData: "0xa086D57d33d030A5209fED5f62be0014f09B0413";
|
|
16
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
18
17
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
19
|
-
readonly deployedAt: "2026-06-
|
|
20
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, prod)";
|
|
18
|
+
readonly deployedAt: "2026-06-16";
|
|
21
19
|
};
|
|
22
20
|
};
|
|
23
21
|
readonly "11155111": {
|
|
24
22
|
readonly stagef: {
|
|
25
|
-
readonly policy: "
|
|
26
|
-
readonly policyData: "
|
|
27
|
-
readonly wasmCid: "
|
|
23
|
+
readonly policy: "0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7";
|
|
24
|
+
readonly policyData: "0x97697E15119b85365eFa6eF3C2Dc704c177b6384";
|
|
25
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
28
26
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
29
|
-
readonly deployedAt: "2026-06-
|
|
30
|
-
readonly notes: "Phase 0 Stream D — composite namespacing redeploy";
|
|
27
|
+
readonly deployedAt: "2026-06-16";
|
|
31
28
|
};
|
|
32
29
|
readonly prod: {
|
|
33
|
-
readonly policy: "
|
|
34
|
-
readonly policyData: "
|
|
35
|
-
readonly wasmCid: "
|
|
30
|
+
readonly policy: "0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73";
|
|
31
|
+
readonly policyData: "0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1";
|
|
32
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
36
33
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
37
|
-
readonly deployedAt: "2026-06-
|
|
38
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Sepolia, prod)";
|
|
34
|
+
readonly deployedAt: "2026-06-16";
|
|
39
35
|
};
|
|
40
36
|
};
|
|
41
37
|
};
|
|
@@ -123,5 +119,12 @@ declare function prepareQuery({ publicClient }: PrepareQueryArgs, options?: Prep
|
|
|
123
119
|
* they can't be inferred from `PrepareQueryArgs` alone.
|
|
124
120
|
*/
|
|
125
121
|
declare const blockaid: PolicyPack<Params, WasmArgs, Secrets>;
|
|
122
|
+
/**
|
|
123
|
+
* Composite-policy view of the blockaid pack. Pass to `defineComposite(...)`
|
|
124
|
+
* (Phase 2 — see `docs/composite-policies.md`) when stacking blockaid with
|
|
125
|
+
* other packs in one Shield. Strict subset of the `PolicyPack` above —
|
|
126
|
+
* shares the same `id`, schemas, and deployments.
|
|
127
|
+
*/
|
|
128
|
+
declare const blockaidOracleModule: OracleModule<Params, WasmArgs, Secrets>;
|
|
126
129
|
|
|
127
|
-
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, deployments, prepareQuery };
|
|
130
|
+
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, blockaidOracleModule, deployments, prepareQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
import { PrepareQueryArgs, PrepareQueryResult, PolicyPack } from '@newton-xyz/policy-pack-shared';
|
|
1
|
+
import { PrepareQueryArgs, PrepareQueryResult, PolicyPack, OracleModule } from '@newton-xyz/policy-pack-shared';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare const deployments: {
|
|
5
5
|
readonly "84532": {
|
|
6
6
|
readonly stagef: {
|
|
7
|
-
readonly policy: "
|
|
8
|
-
readonly policyData: "
|
|
9
|
-
readonly wasmCid: "
|
|
7
|
+
readonly policy: "0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c";
|
|
8
|
+
readonly policyData: "0x1808Ad6D96E736D6867b4e0773e4641940Cff555";
|
|
9
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
10
10
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
11
|
-
readonly deployedAt: "2026-06-
|
|
12
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, stagef)";
|
|
11
|
+
readonly deployedAt: "2026-06-16";
|
|
13
12
|
};
|
|
14
13
|
readonly prod: {
|
|
15
|
-
readonly policy: "
|
|
16
|
-
readonly policyData: "
|
|
17
|
-
readonly wasmCid: "
|
|
14
|
+
readonly policy: "0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3";
|
|
15
|
+
readonly policyData: "0xa086D57d33d030A5209fED5f62be0014f09B0413";
|
|
16
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
18
17
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
19
|
-
readonly deployedAt: "2026-06-
|
|
20
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, prod)";
|
|
18
|
+
readonly deployedAt: "2026-06-16";
|
|
21
19
|
};
|
|
22
20
|
};
|
|
23
21
|
readonly "11155111": {
|
|
24
22
|
readonly stagef: {
|
|
25
|
-
readonly policy: "
|
|
26
|
-
readonly policyData: "
|
|
27
|
-
readonly wasmCid: "
|
|
23
|
+
readonly policy: "0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7";
|
|
24
|
+
readonly policyData: "0x97697E15119b85365eFa6eF3C2Dc704c177b6384";
|
|
25
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
28
26
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
29
|
-
readonly deployedAt: "2026-06-
|
|
30
|
-
readonly notes: "Phase 0 Stream D — composite namespacing redeploy";
|
|
27
|
+
readonly deployedAt: "2026-06-16";
|
|
31
28
|
};
|
|
32
29
|
readonly prod: {
|
|
33
|
-
readonly policy: "
|
|
34
|
-
readonly policyData: "
|
|
35
|
-
readonly wasmCid: "
|
|
30
|
+
readonly policy: "0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73";
|
|
31
|
+
readonly policyData: "0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1";
|
|
32
|
+
readonly wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq";
|
|
36
33
|
readonly policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6";
|
|
37
|
-
readonly deployedAt: "2026-06-
|
|
38
|
-
readonly notes: "Phase 0 Stream D2 — env-axis expansion to (Sepolia, prod)";
|
|
34
|
+
readonly deployedAt: "2026-06-16";
|
|
39
35
|
};
|
|
40
36
|
};
|
|
41
37
|
};
|
|
@@ -123,5 +119,12 @@ declare function prepareQuery({ publicClient }: PrepareQueryArgs, options?: Prep
|
|
|
123
119
|
* they can't be inferred from `PrepareQueryArgs` alone.
|
|
124
120
|
*/
|
|
125
121
|
declare const blockaid: PolicyPack<Params, WasmArgs, Secrets>;
|
|
122
|
+
/**
|
|
123
|
+
* Composite-policy view of the blockaid pack. Pass to `defineComposite(...)`
|
|
124
|
+
* (Phase 2 — see `docs/composite-policies.md`) when stacking blockaid with
|
|
125
|
+
* other packs in one Shield. Strict subset of the `PolicyPack` above —
|
|
126
|
+
* shares the same `id`, schemas, and deployments.
|
|
127
|
+
*/
|
|
128
|
+
declare const blockaidOracleModule: OracleModule<Params, WasmArgs, Secrets>;
|
|
126
129
|
|
|
127
|
-
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, deployments, prepareQuery };
|
|
130
|
+
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, blockaidOracleModule, deployments, prepareQuery };
|
package/dist/index.js
CHANGED
|
@@ -2,38 +2,34 @@
|
|
|
2
2
|
var deployments = {
|
|
3
3
|
"84532": {
|
|
4
4
|
stagef: {
|
|
5
|
-
policy: "
|
|
6
|
-
policyData: "
|
|
7
|
-
wasmCid: "
|
|
5
|
+
policy: "0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c",
|
|
6
|
+
policyData: "0x1808Ad6D96E736D6867b4e0773e4641940Cff555",
|
|
7
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
8
8
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
9
|
-
deployedAt: "2026-06-
|
|
10
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Base Sepolia, stagef)"
|
|
9
|
+
deployedAt: "2026-06-16"
|
|
11
10
|
},
|
|
12
11
|
prod: {
|
|
13
|
-
policy: "
|
|
14
|
-
policyData: "
|
|
15
|
-
wasmCid: "
|
|
12
|
+
policy: "0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3",
|
|
13
|
+
policyData: "0xa086D57d33d030A5209fED5f62be0014f09B0413",
|
|
14
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
16
15
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
17
|
-
deployedAt: "2026-06-
|
|
18
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Base Sepolia, prod)"
|
|
16
|
+
deployedAt: "2026-06-16"
|
|
19
17
|
}
|
|
20
18
|
},
|
|
21
19
|
"11155111": {
|
|
22
20
|
stagef: {
|
|
23
|
-
policy: "
|
|
24
|
-
policyData: "
|
|
25
|
-
wasmCid: "
|
|
21
|
+
policy: "0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7",
|
|
22
|
+
policyData: "0x97697E15119b85365eFa6eF3C2Dc704c177b6384",
|
|
23
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
26
24
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
27
|
-
deployedAt: "2026-06-
|
|
28
|
-
notes: "Phase 0 Stream D \u2014 composite namespacing redeploy"
|
|
25
|
+
deployedAt: "2026-06-16"
|
|
29
26
|
},
|
|
30
27
|
prod: {
|
|
31
|
-
policy: "
|
|
32
|
-
policyData: "
|
|
33
|
-
wasmCid: "
|
|
28
|
+
policy: "0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73",
|
|
29
|
+
policyData: "0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1",
|
|
30
|
+
wasmCid: "bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq",
|
|
34
31
|
policyCodeHash: "0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6",
|
|
35
|
-
deployedAt: "2026-06-
|
|
36
|
-
notes: "Phase 0 Stream D2 \u2014 env-axis expansion to (Sepolia, prod)"
|
|
32
|
+
deployedAt: "2026-06-16"
|
|
37
33
|
}
|
|
38
34
|
}
|
|
39
35
|
};
|
|
@@ -45,6 +41,11 @@ var PACK_DESCRIPTION = "Gates vault deposits at transaction-submission time usin
|
|
|
45
41
|
var PACK_LINK = "https://www.blockaid.io";
|
|
46
42
|
var PACK_AUTHOR = "";
|
|
47
43
|
|
|
44
|
+
// src/pack.ts
|
|
45
|
+
import {
|
|
46
|
+
oracleModuleFromPack
|
|
47
|
+
} from "@newton-xyz/policy-pack-shared";
|
|
48
|
+
|
|
48
49
|
// src/params.ts
|
|
49
50
|
import { z } from "zod";
|
|
50
51
|
var ParamsSchema = z.object({
|
|
@@ -131,6 +132,7 @@ var blockaid = {
|
|
|
131
132
|
link: PACK_LINK || void 0
|
|
132
133
|
}
|
|
133
134
|
};
|
|
135
|
+
var blockaidOracleModule = oracleModuleFromPack(blockaid);
|
|
134
136
|
export {
|
|
135
137
|
PACK_AUTHOR,
|
|
136
138
|
PACK_DESCRIPTION,
|
|
@@ -141,6 +143,7 @@ export {
|
|
|
141
143
|
SecretsSchema,
|
|
142
144
|
WasmArgsSchema,
|
|
143
145
|
blockaid,
|
|
146
|
+
blockaidOracleModule,
|
|
144
147
|
deployments,
|
|
145
148
|
prepareQuery
|
|
146
149
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deployments.ts","../src/metadata.ts","../src/params.ts","../src/prepare-query.ts","../src/secrets.ts","../src/wasm-args.ts","../src/pack.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nimport type { ChainId, Deployment, GatewayEnv } from \"@newton-xyz/policy-pack-shared\";\n\nexport const deployments = {\n\t\"84532\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x2DfC58315De3e43F365449aF68202fC4AA3CC0a3\",\n\t\t\tpolicyData: \"0xB03321c6E4905c399ED5E7aAeDA8A180dEfC175b\",\n\t\t\twasmCid: \"bafybeidp2gyreu3e7qhflnwlhcrboug6bj4wzayythtd4efnr6reyyxe2e\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, stagef)\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x16B61ba697eeD838Ca7E09154289781EebbdC7f2\",\n\t\t\tpolicyData: \"0x3F14D8a7780153c32200829B4E7eE64D9e21550C\",\n\t\t\twasmCid: \"bafybeicqujyqanpoh3lserei46d5yrwcqjzvbs3uof45xipkvoyqgrxv74\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Base Sepolia, prod)\",\n\t\t},\n\t},\n\t\"11155111\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0xcBC09be770c0b220ABC5D95A49f81964B8E2da43\",\n\t\t\tpolicyData: \"0x2305EC115a0E34D3772D68912bBD85eB6C3c550d\",\n\t\t\twasmCid: \"bafybeia2ci3xamxzjontcqv22zlv3cv7lk5nrwnlgcf5oriwhsw5pc6vni\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D — composite namespacing redeploy\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x992bc96446B048FE0bD7DAA11E741A4e9e709777\",\n\t\t\tpolicyData: \"0x6A245Fca1FFF1197D6692944639971891B09Ee21\",\n\t\t\twasmCid: \"bafybeicf2rj3zdinteuji6zb2oh3rshcojh2y36qvev2gggtenajkspw5e\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-14\",\n\t\t\tnotes: \"Phase 0 Stream D2 — env-axis expansion to (Sepolia, prod)\",\n\t\t},\n\t},\n} as const satisfies Readonly<\n\tPartial<Record<ChainId, Readonly<Partial<Record<GatewayEnv, Deployment>>>>>\n>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nexport const PACK_NAME = \"blockaid\" as const;\nexport const PACK_VERSION = \"0.0.1\" as const;\nexport const PACK_DESCRIPTION =\n\t\"Gates vault deposits at transaction-submission time using Blockaid's EVM transaction scan (validation + simulation) to catch malicious calldata, frontend-redirect attacks, and value-skim simulations\" as const;\nexport const PACK_LINK = \"https://www.blockaid.io\" as const;\nexport const PACK_AUTHOR = \"\" as const;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/params_schema.json\nimport { z } from \"zod\";\n\nexport const ParamsSchema = z\n\t.object({\n\t\tdeny_features: z\n\t\t\t.array(z.string())\n\t\t\t.describe(\n\t\t\t\t\"Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])\",\n\t\t\t),\n\t\tmax_outbound_inbound_ratio: z\n\t\t\t.number()\n\t\t\t.describe(\n\t\t\t\t\"Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.\",\n\t\t\t),\n\t\trequire_received_shares: z\n\t\t\t.boolean()\n\t\t\t.describe(\n\t\t\t\t\"Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.\",\n\t\t\t),\n\t})\n\t.describe(\"Thresholds for the Blockaid transaction-time exploit gate\")\n\t.strict();\n\nexport type Params = z.infer<typeof ParamsSchema>;\n","import type { PrepareQueryArgs, PrepareQueryResult } from \"@newton-xyz/policy-pack-shared\";\nimport type { WasmArgs } from \"./wasm-args\";\n\n/**\n * Blockaid maps EVM chain id → its own chain identifier slug. Keep this\n * aligned with whatever the AVS-side `policy.js` posts to Blockaid; if you\n * extend it, extend both sides together.\n */\nconst CHAIN_BY_ID: Readonly<Record<number, string>> = {\n\t1: \"ethereum\",\n\t8453: \"base\",\n\t42161: \"arbitrum\",\n\t10: \"optimism\",\n\t137: \"polygon\",\n\t56: \"bsc\",\n\t11155111: \"sepolia\",\n\t84532: \"base-sepolia\",\n};\n\n/**\n * Per-call inputs for Blockaid: every wasmArg (`from`, `to`, `value`, `data`)\n * mirrors the on-chain transaction the depositor is about to submit, so it\n * has to come from the SDK's intent context — `PrepareQueryArgs` (which only\n * carries `publicClient` + `vault`) doesn't have any of it. The SDK forwards\n * these via `prepareQuery`'s second `options` arg (introduced in NEWT-1499).\n *\n * `chain` is derived from `publicClient.chain.id` so curators don't have to\n * keep the Blockaid slug list in sync separately.\n */\nexport interface PrepareQueryOptions {\n\treadonly from: string;\n\treadonly to: string;\n\treadonly value?: string;\n\treadonly data?: string;\n}\n\nexport async function prepareQuery(\n\t{ publicClient }: PrepareQueryArgs,\n\toptions?: PrepareQueryOptions,\n): Promise<PrepareQueryResult<WasmArgs>> {\n\tconst chainId = publicClient.chain?.id;\n\tif (chainId === undefined) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: publicClient.chain is undefined. Pass a chain to viem's createPublicClient.\",\n\t\t);\n\t}\n\tconst chain = CHAIN_BY_ID[chainId];\n\tif (!chain) {\n\t\tthrow new Error(\n\t\t\t`policy-pack-blockaid: chain id ${chainId} is not in the Blockaid chain map. Add it to CHAIN_BY_ID before using this pack on this chain.`,\n\t\t);\n\t}\n\tif (!options?.from || !options?.to) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: prepareQuery requires `from` and `to` in the options bag — these mirror the on-chain transaction the depositor is about to submit.\",\n\t\t);\n\t}\n\n\treturn {\n\t\twasmArgs: {\n\t\t\tchain,\n\t\t\tfrom: options.from,\n\t\t\tto: options.to,\n\t\t\tvalue: options.value,\n\t\t\tdata: options.data,\n\t\t},\n\t};\n}\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/secrets_schema.json\nimport { z } from \"zod\";\n\nexport const SecretsSchema = z.object({ BLOCKAID_API_KEY: z.string().min(1) }).strict();\n\nexport type Secrets = z.infer<typeof SecretsSchema>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/wasm_args_schema.json\nimport { z } from \"zod\";\n\nexport const WasmArgsSchema = z\n\t.object({\n\t\tchain: z.string().describe(\"Blockaid chain identifier (e.g. 'ethereum', 'base', 'arbitrum').\"),\n\t\tfrom: z.string().describe(\"Sender / account address (0x-prefixed 20-byte address).\"),\n\t\tto: z.string().describe(\"Recipient or contract address being called (0x-prefixed).\"),\n\t\tvalue: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t\"Transaction value in wei as a 0x-prefixed hex string. Defaults to '0x0' when omitted.\",\n\t\t\t)\n\t\t\t.optional(),\n\t\tdata: z\n\t\t\t.string()\n\t\t\t.describe(\"Transaction calldata as a 0x-prefixed hex string. Defaults to '0x' when omitted.\")\n\t\t\t.optional(),\n\t})\n\t.describe(\"Inputs passed to the Blockaid policy WASM at evaluation time\");\n\nexport type WasmArgs = z.infer<typeof WasmArgsSchema>;\n","// Hand-written canonical export — survives `pnpm gen:bindings` regen.\n// The generated `index.ts` re-exports `pack.ts` when present.\nimport type { PolicyPack } from \"@newton-xyz/policy-pack-shared\";\nimport { deployments } from \"./deployments\";\nimport { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION } from \"./metadata\";\nimport { type Params, ParamsSchema } from \"./params\";\nimport { prepareQuery } from \"./prepare-query\";\nimport { type Secrets, SecretsSchema } from \"./secrets\";\nimport { type WasmArgs, WasmArgsSchema } from \"./wasm-args\";\n\nexport { type PrepareQueryOptions, prepareQuery } from \"./prepare-query\";\n\n/**\n * The Blockaid transaction-scan `PolicyPack`.\n *\n * Pass to `createShield(...)` from `@newton-xyz/newton-shield-sdk`. Encoding\n * for the on-chain `policyParams` blob is handled by `encodePolicyParams` /\n * `decodePolicyParams` in `@newton-xyz/policy-pack-shared` (UTF-8 JSON,\n * sorted keys) — not per-pack.\n *\n * `prepareQuery` derives the Blockaid `chain` slug from `publicClient.chain.id`\n * and reads `from`/`to`/`value`/`data` from the SDK's per-call options bag —\n * these mirror the on-chain transaction the depositor is about to submit, so\n * they can't be inferred from `PrepareQueryArgs` alone.\n */\nexport const blockaid: PolicyPack<Params, WasmArgs, Secrets> = {\n\tid: `${PACK_NAME}/transaction-scan/v1`,\n\tparamsSchema: ParamsSchema,\n\twasmArgsSchema: WasmArgsSchema,\n\tsecretsSchema: SecretsSchema,\n\tprepareQuery,\n\tdeployments,\n\tmetadata: {\n\t\tname: PACK_NAME,\n\t\tversion: PACK_VERSION,\n\t\tdescription: PACK_DESCRIPTION,\n\t\tauthor: PACK_AUTHOR || undefined,\n\t\tlink: PACK_LINK || undefined,\n\t},\n};\n"],"mappings":";AAIO,IAAM,cAAc;AAAA,EAC1B,SAAS;AAAA,IACR,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,S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ACZ,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ;AAAA,IACf;AAAA,EACD;AACD;;;AChEA,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO,EAAE,kBAAkBA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;;;ACFtF,SAAS,KAAAC,UAAS;AAEX,IAAM,iBAAiBA,GAC5B,OAAO;AAAA,EACP,OAAOA,GAAE,OAAO,EAAE,SAAS,kEAAkE;AAAA,EAC7F,MAAMA,GAAE,OAAO,EAAE,SAAS,yDAAyD;AAAA,EACnF,IAAIA,GAAE,OAAO,EAAE,SAAS,2DAA2D;AAAA,EACnF,OAAOA,GACL,OAAO,EACP;AAAA,IACA;AAAA,EACD,EACC,SAAS;AAAA,EACX,MAAMA,GACJ,OAAO,EACP,SAAS,kFAAkF,EAC3F,SAAS;AACZ,CAAC,EACA,SAAS,8DAA8D;;;ACIlE,IAAM,WAAkD;AAAA,EAC9D,IAAI,GAAG,SAAS;AAAA,EAChB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,QAAQ,eAAe;AAAA,IACvB,MAAM,aAAa;AAAA,EACpB;AACD;","names":["z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/deployments.ts","../src/metadata.ts","../src/pack.ts","../src/params.ts","../src/prepare-query.ts","../src/secrets.ts","../src/wasm-args.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nimport type { ChainId, Deployment, GatewayEnv } from \"@newton-xyz/policy-pack-shared\";\n\nexport const deployments = {\n\t\"84532\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x3ed9Ca05599C59d0A43dD67CfE93c21BFf87d43c\",\n\t\t\tpolicyData: \"0x1808Ad6D96E736D6867b4e0773e4641940Cff555\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0xEC514aEA6cbB4C56829f982AdfBe13E616B7E0b3\",\n\t\t\tpolicyData: \"0xa086D57d33d030A5209fED5f62be0014f09B0413\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t},\n\t\"11155111\": {\n\t\tstagef: {\n\t\t\tpolicy: \"0x5d08aF9aCB10E6e6C6bFd064B6671aA3E74643E7\",\n\t\t\tpolicyData: \"0x97697E15119b85365eFa6eF3C2Dc704c177b6384\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t\tprod: {\n\t\t\tpolicy: \"0x9Dfe1C2a2a6c6f4DfCD6ECeF528949290638DA73\",\n\t\t\tpolicyData: \"0x849b66977Ac8aCEB246A6b42379F2df4cD6a8DD1\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-16\",\n\t\t},\n\t},\n} as const satisfies Readonly<\n\tPartial<Record<ChainId, Readonly<Partial<Record<GatewayEnv, Deployment>>>>>\n>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\nexport const PACK_NAME = \"blockaid\" as const;\nexport const PACK_VERSION = \"0.0.1\" as const;\nexport const PACK_DESCRIPTION =\n\t\"Gates vault deposits at transaction-submission time using Blockaid's EVM transaction scan (validation + simulation) to catch malicious calldata, frontend-redirect attacks, and value-skim simulations\" as const;\nexport const PACK_LINK = \"https://www.blockaid.io\" as const;\nexport const PACK_AUTHOR = \"\" as const;\n","// Hand-written canonical export — survives `pnpm gen:bindings` regen.\n// The generated `index.ts` re-exports `pack.ts` when present.\nimport {\n\ttype OracleModule,\n\toracleModuleFromPack,\n\ttype PolicyPack,\n} from \"@newton-xyz/policy-pack-shared\";\nimport { deployments } from \"./deployments\";\nimport { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION } from \"./metadata\";\nimport { type Params, ParamsSchema } from \"./params\";\nimport { prepareQuery } from \"./prepare-query\";\nimport { type Secrets, SecretsSchema } from \"./secrets\";\nimport { type WasmArgs, WasmArgsSchema } from \"./wasm-args\";\n\nexport { type PrepareQueryOptions, prepareQuery } from \"./prepare-query\";\n\n/**\n * The Blockaid transaction-scan `PolicyPack`.\n *\n * Pass to `createShield(...)` from `@newton-xyz/newton-shield-sdk`. Encoding\n * for the on-chain `policyParams` blob is handled by `encodePolicyParams` /\n * `decodePolicyParams` in `@newton-xyz/policy-pack-shared` (UTF-8 JSON,\n * sorted keys) — not per-pack.\n *\n * `prepareQuery` derives the Blockaid `chain` slug from `publicClient.chain.id`\n * and reads `from`/`to`/`value`/`data` from the SDK's per-call options bag —\n * these mirror the on-chain transaction the depositor is about to submit, so\n * they can't be inferred from `PrepareQueryArgs` alone.\n */\nexport const blockaid: PolicyPack<Params, WasmArgs, Secrets> = {\n\tid: `${PACK_NAME}/transaction-scan/v1`,\n\tparamsSchema: ParamsSchema,\n\twasmArgsSchema: WasmArgsSchema,\n\tsecretsSchema: SecretsSchema,\n\tprepareQuery,\n\tdeployments,\n\tmetadata: {\n\t\tname: PACK_NAME,\n\t\tversion: PACK_VERSION,\n\t\tdescription: PACK_DESCRIPTION,\n\t\tauthor: PACK_AUTHOR || undefined,\n\t\tlink: PACK_LINK || undefined,\n\t},\n};\n\n/**\n * Composite-policy view of the blockaid pack. Pass to `defineComposite(...)`\n * (Phase 2 — see `docs/composite-policies.md`) when stacking blockaid with\n * other packs in one Shield. Strict subset of the `PolicyPack` above —\n * shares the same `id`, schemas, and deployments.\n */\nexport const blockaidOracleModule: OracleModule<Params, WasmArgs, Secrets> =\n\toracleModuleFromPack(blockaid);\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/params_schema.json\nimport { z } from \"zod\";\n\nexport const ParamsSchema = z\n\t.object({\n\t\tdeny_features: z\n\t\t\t.array(z.string())\n\t\t\t.describe(\n\t\t\t\t\"Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])\",\n\t\t\t),\n\t\tmax_outbound_inbound_ratio: z\n\t\t\t.number()\n\t\t\t.describe(\n\t\t\t\t\"Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.\",\n\t\t\t),\n\t\trequire_received_shares: z\n\t\t\t.boolean()\n\t\t\t.describe(\n\t\t\t\t\"Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.\",\n\t\t\t),\n\t})\n\t.describe(\"Thresholds for the Blockaid transaction-time exploit gate\")\n\t.strict();\n\nexport type Params = z.infer<typeof ParamsSchema>;\n","import type { PrepareQueryArgs, PrepareQueryResult } from \"@newton-xyz/policy-pack-shared\";\nimport type { WasmArgs } from \"./wasm-args\";\n\n/**\n * Blockaid maps EVM chain id → its own chain identifier slug. Keep this\n * aligned with whatever the AVS-side `policy.js` posts to Blockaid; if you\n * extend it, extend both sides together.\n */\nconst CHAIN_BY_ID: Readonly<Record<number, string>> = {\n\t1: \"ethereum\",\n\t8453: \"base\",\n\t42161: \"arbitrum\",\n\t10: \"optimism\",\n\t137: \"polygon\",\n\t56: \"bsc\",\n\t11155111: \"sepolia\",\n\t84532: \"base-sepolia\",\n};\n\n/**\n * Per-call inputs for Blockaid: every wasmArg (`from`, `to`, `value`, `data`)\n * mirrors the on-chain transaction the depositor is about to submit, so it\n * has to come from the SDK's intent context — `PrepareQueryArgs` (which only\n * carries `publicClient` + `vault`) doesn't have any of it. The SDK forwards\n * these via `prepareQuery`'s second `options` arg (introduced in NEWT-1499).\n *\n * `chain` is derived from `publicClient.chain.id` so curators don't have to\n * keep the Blockaid slug list in sync separately.\n */\nexport interface PrepareQueryOptions {\n\treadonly from: string;\n\treadonly to: string;\n\treadonly value?: string;\n\treadonly data?: string;\n}\n\nexport async function prepareQuery(\n\t{ publicClient }: PrepareQueryArgs,\n\toptions?: PrepareQueryOptions,\n): Promise<PrepareQueryResult<WasmArgs>> {\n\tconst chainId = publicClient.chain?.id;\n\tif (chainId === undefined) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: publicClient.chain is undefined. Pass a chain to viem's createPublicClient.\",\n\t\t);\n\t}\n\tconst chain = CHAIN_BY_ID[chainId];\n\tif (!chain) {\n\t\tthrow new Error(\n\t\t\t`policy-pack-blockaid: chain id ${chainId} is not in the Blockaid chain map. Add it to CHAIN_BY_ID before using this pack on this chain.`,\n\t\t);\n\t}\n\tif (!options?.from || !options?.to) {\n\t\tthrow new Error(\n\t\t\t\"policy-pack-blockaid: prepareQuery requires `from` and `to` in the options bag — these mirror the on-chain transaction the depositor is about to submit.\",\n\t\t);\n\t}\n\n\treturn {\n\t\twasmArgs: {\n\t\t\tchain,\n\t\t\tfrom: options.from,\n\t\t\tto: options.to,\n\t\t\tvalue: options.value,\n\t\t\tdata: options.data,\n\t\t},\n\t};\n}\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/secrets_schema.json\nimport { z } from \"zod\";\n\nexport const SecretsSchema = z.object({ BLOCKAID_API_KEY: z.string().min(1) }).strict();\n\nexport type Secrets = z.infer<typeof SecretsSchema>;\n","// AUTO-GENERATED by scripts/generate-bindings.ts — DO NOT EDIT.\n// Source: AVS-side artifacts in this repo (run `pnpm gen:bindings` to regenerate).\n// Source schema: blockaid/wasm_args_schema.json\nimport { z } from \"zod\";\n\nexport const WasmArgsSchema = z\n\t.object({\n\t\tchain: z.string().describe(\"Blockaid chain identifier (e.g. 'ethereum', 'base', 'arbitrum').\"),\n\t\tfrom: z.string().describe(\"Sender / account address (0x-prefixed 20-byte address).\"),\n\t\tto: z.string().describe(\"Recipient or contract address being called (0x-prefixed).\"),\n\t\tvalue: z\n\t\t\t.string()\n\t\t\t.describe(\n\t\t\t\t\"Transaction value in wei as a 0x-prefixed hex string. Defaults to '0x0' when omitted.\",\n\t\t\t)\n\t\t\t.optional(),\n\t\tdata: z\n\t\t\t.string()\n\t\t\t.describe(\"Transaction calldata as a 0x-prefixed hex string. Defaults to '0x' when omitted.\")\n\t\t\t.optional(),\n\t})\n\t.describe(\"Inputs passed to the Blockaid policy WASM at evaluation time\");\n\nexport type WasmArgs = z.infer<typeof WasmArgsSchema>;\n"],"mappings":";AAIO,IAAM,cAAc;AAAA,EAC1B,SAAS;AAAA,IACR,QAAQ;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,IACA,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA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,UAAU;AAAA,MACT;AAAA,MACA,MAAM,QAAQ;AAAA,MACd,IAAI,QAAQ;AAAA,MACZ,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ;AAAA,IACf;AAAA,EACD;AACD;;;AChEA,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO,EAAE,kBAAkBA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO;;;ACFtF,SAAS,KAAAC,UAAS;AAEX,IAAM,iBAAiBA,GAC5B,OAAO;AAAA,EACP,OAAOA,GAAE,OAAO,EAAE,SAAS,kEAAkE;AAAA,EAC7F,MAAMA,GAAE,OAAO,EAAE,SAAS,yDAAyD;AAAA,EACnF,IAAIA,GAAE,OAAO,EAAE,SAAS,2DAA2D;AAAA,EACnF,OAAOA,GACL,OAAO,EACP;AAAA,IACA;AAAA,EACD,EACC,SAAS;AAAA,EACX,MAAMA,GACJ,OAAO,EACP,SAAS,kFAAkF,EAC3F,SAAS;AACZ,CAAC,EACA,SAAS,8DAA8D;;;AJQlE,IAAM,WAAkD;AAAA,EAC9D,IAAI,GAAG,SAAS;AAAA,EAChB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA,UAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,QAAQ,eAAe;AAAA,IACvB,MAAM,aAAa;AAAA,EACpB;AACD;AAQO,IAAM,uBACZ,qBAAqB,QAAQ;","names":["z","z"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newton-xyz/policy-pack-blockaid",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Bindings-only Newton blockaid policy pack (zod schemas + deployments). No PolicyPack export yet — use with NewtonShield.guardedCall until pack.ts lands.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Newton Protocol <https://x.com/newton_xyz> (https://newton.xyz)",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"LICENSE"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@newton-xyz/policy-pack-shared": "^0.4.
|
|
44
|
+
"@newton-xyz/policy-pack-shared": "^0.4.2",
|
|
45
45
|
"viem": "^2.0.0",
|
|
46
46
|
"zod": "^3.0.0"
|
|
47
47
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"typescript": "^5.5.0",
|
|
52
52
|
"viem": "^2.0.0",
|
|
53
53
|
"zod": "^3.23.0",
|
|
54
|
-
"@newton-xyz/policy-pack-shared": "0.4.
|
|
54
|
+
"@newton-xyz/policy-pack-shared": "0.4.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsup",
|