@newton-xyz/policy-pack-blockaid 4.1.0 → 6.0.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.
- package/README.md +1 -1
- package/dist/index.cjs +2 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -56
- package/dist/index.d.ts +62 -56
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ pnpm add @newton-xyz/policy-pack-blockaid
|
|
|
14
14
|
|
|
15
15
|
| Export | Source | Purpose |
|
|
16
16
|
|---|---|---|
|
|
17
|
-
| `blockaid` (`PolicyPack
|
|
17
|
+
| `blockaid` (the pack's `PolicyPack` type) | `pack.ts` | Canonical pack object; pass to `createShield(...)` from `@newton-xyz/newton-shield-sdk`. |
|
|
18
18
|
| `prepareQuery`, `PrepareQueryOptions` | `prepare-query.ts` | Derives Blockaid `chain` from `publicClient.chain.id`; reads `from`/`to`/`value`/`data` from the SDK options bag. |
|
|
19
19
|
| `WasmArgsSchema` (zod) + `WasmArgs` (type) | `wasm_args_schema.json` | Inputs the pack's WASM receives at evaluation time. |
|
|
20
20
|
| `SecretsSchema` (zod) + `Secrets` (type) | `secrets_schema.json` | API credentials uploaded before run/sim. |
|
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,6 @@ __export(index_exports, {
|
|
|
30
30
|
SecretsSchema: () => SecretsSchema,
|
|
31
31
|
WasmArgsSchema: () => WasmArgsSchema,
|
|
32
32
|
blockaid: () => blockaid,
|
|
33
|
-
blockaidOracleModule: () => blockaidOracleModule,
|
|
34
33
|
deployments: () => deployments,
|
|
35
34
|
prepareQuery: () => prepareQuery
|
|
36
35
|
});
|
|
@@ -175,10 +174,9 @@ var WasmArgsSchema = import_zod3.z.object({
|
|
|
175
174
|
}).describe("Inputs passed to the Blockaid policy WASM at evaluation time");
|
|
176
175
|
|
|
177
176
|
// src/pack.ts
|
|
178
|
-
var blockaid = {
|
|
177
|
+
var blockaid = (0, import_policy_pack_shared.definePolicyPack)({
|
|
179
178
|
id: `${PACK_NAME}/transaction-scan/v1`,
|
|
180
179
|
paramsSchema: ParamsSchema,
|
|
181
|
-
paramsJsonSchema: ParamsJsonSchema,
|
|
182
180
|
wasmArgsSchema: WasmArgsSchema,
|
|
183
181
|
secretsSchema: SecretsSchema,
|
|
184
182
|
prepareQuery,
|
|
@@ -190,6 +188,5 @@ var blockaid = {
|
|
|
190
188
|
author: PACK_AUTHOR || void 0,
|
|
191
189
|
link: PACK_LINK || void 0
|
|
192
190
|
}
|
|
193
|
-
};
|
|
194
|
-
var blockaidOracleModule = (0, import_policy_pack_shared.oracleModuleFromPack)(blockaid);
|
|
191
|
+
});
|
|
195
192
|
//# 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/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\"1\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0xa7ab76E81269f48b6C40132d2234A710b0B7A099\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-21\",\n\t\t},\n\t},\n\t\"8453\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0x33394324EA2a7a599B368bd73133cc02c1E04753\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-20\",\n\t\t},\n\t},\n\t\"84532\": {\n\t\tprod: {\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\tprod: {\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, ParamsJsonSchema, 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\tparamsJsonSchema: ParamsJsonSchema,\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\nexport const ParamsJsonSchema = {\n\ttype: \"object\",\n\tdescription: \"Thresholds for the Blockaid transaction-time exploit gate\",\n\tproperties: {\n\t\tdeny_features: {\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tdescription:\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},\n\t\tmax_outbound_inbound_ratio: {\n\t\t\ttype: \"number\",\n\t\t\tdescription:\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},\n\t\trequire_received_shares: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription:\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},\n\t},\n\trequired: [\"deny_features\", \"max_outbound_inbound_ratio\", \"require_received_shares\"],\n} as const;\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` + `target`) 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;AAAA;;;ACIO,IAAM,cAAc;AAAA,EAC1B,KAAK;AAAA,IACJ,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,QAAQ;AAAA,IACP,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,SAAS;AAAA,IACR,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX,MAAM;AAAA,MACL,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;AAIF,IAAM,mBAAmB;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,IACX,eAAe;AAAA,MACd,MAAM;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AAS,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;;;AJQlE,IAAM,WAAkD;AAAA,EAC9D,IAAI,GAAG,SAAS;AAAA,EAChB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,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,2BACZ,gDAAqB,QAAQ;","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\"1\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0xa7ab76E81269f48b6C40132d2234A710b0B7A099\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-21\",\n\t\t},\n\t},\n\t\"8453\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0x33394324EA2a7a599B368bd73133cc02c1E04753\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-20\",\n\t\t},\n\t},\n\t\"84532\": {\n\t\tprod: {\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\tprod: {\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 { definePolicyPack } 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 = definePolicyPack({\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","// 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\nexport const ParamsJsonSchema = {\n\ttype: \"object\",\n\tdescription: \"Thresholds for the Blockaid transaction-time exploit gate\",\n\tproperties: {\n\t\tdeny_features: {\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tdescription:\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},\n\t\tmax_outbound_inbound_ratio: {\n\t\t\ttype: \"number\",\n\t\t\tdescription:\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},\n\t\trequire_received_shares: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription:\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},\n\t},\n\trequired: [\"deny_features\", \"max_outbound_inbound_ratio\", \"require_received_shares\"],\n} as const;\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` + `target`) 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,KAAK;AAAA,IACJ,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,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AAgB;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,CAAC;","names":["import_zod","import_zod"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _newton_xyz_policy_pack_shared from '@newton-xyz/policy-pack-shared';
|
|
2
|
+
import { PrepareQueryArgs, PrepareQueryResult } from '@newton-xyz/policy-pack-shared';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
declare const deployments: {
|
|
@@ -42,52 +43,6 @@ declare const PACK_DESCRIPTION: "Gates vault deposits at transaction-submission
|
|
|
42
43
|
declare const PACK_LINK: "https://www.blockaid.io";
|
|
43
44
|
declare const PACK_AUTHOR: "";
|
|
44
45
|
|
|
45
|
-
declare const ParamsSchema: z.ZodObject<{
|
|
46
|
-
deny_features: z.ZodArray<z.ZodString, "many">;
|
|
47
|
-
max_outbound_inbound_ratio: z.ZodNumber;
|
|
48
|
-
require_received_shares: z.ZodBoolean;
|
|
49
|
-
}, "strict", z.ZodTypeAny, {
|
|
50
|
-
deny_features: string[];
|
|
51
|
-
max_outbound_inbound_ratio: number;
|
|
52
|
-
require_received_shares: boolean;
|
|
53
|
-
}, {
|
|
54
|
-
deny_features: string[];
|
|
55
|
-
max_outbound_inbound_ratio: number;
|
|
56
|
-
require_received_shares: boolean;
|
|
57
|
-
}>;
|
|
58
|
-
type Params = z.infer<typeof ParamsSchema>;
|
|
59
|
-
declare const ParamsJsonSchema: {
|
|
60
|
-
readonly type: "object";
|
|
61
|
-
readonly description: "Thresholds for the Blockaid transaction-time exploit gate";
|
|
62
|
-
readonly properties: {
|
|
63
|
-
readonly deny_features: {
|
|
64
|
-
readonly type: "array";
|
|
65
|
-
readonly items: {
|
|
66
|
-
readonly type: "string";
|
|
67
|
-
};
|
|
68
|
-
readonly description: "Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])";
|
|
69
|
-
};
|
|
70
|
-
readonly max_outbound_inbound_ratio: {
|
|
71
|
-
readonly type: "number";
|
|
72
|
-
readonly description: "Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.";
|
|
73
|
-
};
|
|
74
|
-
readonly require_received_shares: {
|
|
75
|
-
readonly type: "boolean";
|
|
76
|
-
readonly description: "Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.";
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
readonly required: readonly ["deny_features", "max_outbound_inbound_ratio", "require_received_shares"];
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const SecretsSchema: z.ZodObject<{
|
|
83
|
-
BLOCKAID_API_KEY: z.ZodString;
|
|
84
|
-
}, "strict", z.ZodTypeAny, {
|
|
85
|
-
BLOCKAID_API_KEY: string;
|
|
86
|
-
}, {
|
|
87
|
-
BLOCKAID_API_KEY: string;
|
|
88
|
-
}>;
|
|
89
|
-
type Secrets = z.infer<typeof SecretsSchema>;
|
|
90
|
-
|
|
91
46
|
declare const WasmArgsSchema: z.ZodObject<{
|
|
92
47
|
chain: z.ZodString;
|
|
93
48
|
from: z.ZodString;
|
|
@@ -140,13 +95,64 @@ declare function prepareQuery({ publicClient }: PrepareQueryArgs, options?: Prep
|
|
|
140
95
|
* these mirror the on-chain transaction the depositor is about to submit, so
|
|
141
96
|
* they can't be inferred from `PrepareQueryArgs` alone.
|
|
142
97
|
*/
|
|
143
|
-
declare const blockaid: PolicyPack<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
98
|
+
declare const blockaid: _newton_xyz_policy_pack_shared.PolicyPack<"blockaid/transaction-scan/v1", {
|
|
99
|
+
deny_features: string[];
|
|
100
|
+
max_outbound_inbound_ratio: number;
|
|
101
|
+
require_received_shares: boolean;
|
|
102
|
+
}, {
|
|
103
|
+
chain: string;
|
|
104
|
+
from: string;
|
|
105
|
+
to: string;
|
|
106
|
+
value?: string | undefined;
|
|
107
|
+
data?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
BLOCKAID_API_KEY: string;
|
|
110
|
+
}, PrepareQueryOptions>;
|
|
111
|
+
|
|
112
|
+
declare const ParamsSchema: z.ZodObject<{
|
|
113
|
+
deny_features: z.ZodArray<z.ZodString, "many">;
|
|
114
|
+
max_outbound_inbound_ratio: z.ZodNumber;
|
|
115
|
+
require_received_shares: z.ZodBoolean;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
deny_features: string[];
|
|
118
|
+
max_outbound_inbound_ratio: number;
|
|
119
|
+
require_received_shares: boolean;
|
|
120
|
+
}, {
|
|
121
|
+
deny_features: string[];
|
|
122
|
+
max_outbound_inbound_ratio: number;
|
|
123
|
+
require_received_shares: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
type Params = z.infer<typeof ParamsSchema>;
|
|
126
|
+
declare const ParamsJsonSchema: {
|
|
127
|
+
readonly type: "object";
|
|
128
|
+
readonly description: "Thresholds for the Blockaid transaction-time exploit gate";
|
|
129
|
+
readonly properties: {
|
|
130
|
+
readonly deny_features: {
|
|
131
|
+
readonly type: "array";
|
|
132
|
+
readonly items: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
};
|
|
135
|
+
readonly description: "Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])";
|
|
136
|
+
};
|
|
137
|
+
readonly max_outbound_inbound_ratio: {
|
|
138
|
+
readonly type: "number";
|
|
139
|
+
readonly description: "Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.";
|
|
140
|
+
};
|
|
141
|
+
readonly require_received_shares: {
|
|
142
|
+
readonly type: "boolean";
|
|
143
|
+
readonly description: "Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly required: readonly ["deny_features", "max_outbound_inbound_ratio", "require_received_shares"];
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare const SecretsSchema: z.ZodObject<{
|
|
150
|
+
BLOCKAID_API_KEY: z.ZodString;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
BLOCKAID_API_KEY: string;
|
|
153
|
+
}, {
|
|
154
|
+
BLOCKAID_API_KEY: string;
|
|
155
|
+
}>;
|
|
156
|
+
type Secrets = z.infer<typeof SecretsSchema>;
|
|
151
157
|
|
|
152
|
-
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsJsonSchema, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid,
|
|
158
|
+
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsJsonSchema, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, deployments, prepareQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _newton_xyz_policy_pack_shared from '@newton-xyz/policy-pack-shared';
|
|
2
|
+
import { PrepareQueryArgs, PrepareQueryResult } from '@newton-xyz/policy-pack-shared';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
declare const deployments: {
|
|
@@ -42,52 +43,6 @@ declare const PACK_DESCRIPTION: "Gates vault deposits at transaction-submission
|
|
|
42
43
|
declare const PACK_LINK: "https://www.blockaid.io";
|
|
43
44
|
declare const PACK_AUTHOR: "";
|
|
44
45
|
|
|
45
|
-
declare const ParamsSchema: z.ZodObject<{
|
|
46
|
-
deny_features: z.ZodArray<z.ZodString, "many">;
|
|
47
|
-
max_outbound_inbound_ratio: z.ZodNumber;
|
|
48
|
-
require_received_shares: z.ZodBoolean;
|
|
49
|
-
}, "strict", z.ZodTypeAny, {
|
|
50
|
-
deny_features: string[];
|
|
51
|
-
max_outbound_inbound_ratio: number;
|
|
52
|
-
require_received_shares: boolean;
|
|
53
|
-
}, {
|
|
54
|
-
deny_features: string[];
|
|
55
|
-
max_outbound_inbound_ratio: number;
|
|
56
|
-
require_received_shares: boolean;
|
|
57
|
-
}>;
|
|
58
|
-
type Params = z.infer<typeof ParamsSchema>;
|
|
59
|
-
declare const ParamsJsonSchema: {
|
|
60
|
-
readonly type: "object";
|
|
61
|
-
readonly description: "Thresholds for the Blockaid transaction-time exploit gate";
|
|
62
|
-
readonly properties: {
|
|
63
|
-
readonly deny_features: {
|
|
64
|
-
readonly type: "array";
|
|
65
|
-
readonly items: {
|
|
66
|
-
readonly type: "string";
|
|
67
|
-
};
|
|
68
|
-
readonly description: "Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])";
|
|
69
|
-
};
|
|
70
|
-
readonly max_outbound_inbound_ratio: {
|
|
71
|
-
readonly type: "number";
|
|
72
|
-
readonly description: "Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.";
|
|
73
|
-
};
|
|
74
|
-
readonly require_received_shares: {
|
|
75
|
-
readonly type: "boolean";
|
|
76
|
-
readonly description: "Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.";
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
readonly required: readonly ["deny_features", "max_outbound_inbound_ratio", "require_received_shares"];
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
declare const SecretsSchema: z.ZodObject<{
|
|
83
|
-
BLOCKAID_API_KEY: z.ZodString;
|
|
84
|
-
}, "strict", z.ZodTypeAny, {
|
|
85
|
-
BLOCKAID_API_KEY: string;
|
|
86
|
-
}, {
|
|
87
|
-
BLOCKAID_API_KEY: string;
|
|
88
|
-
}>;
|
|
89
|
-
type Secrets = z.infer<typeof SecretsSchema>;
|
|
90
|
-
|
|
91
46
|
declare const WasmArgsSchema: z.ZodObject<{
|
|
92
47
|
chain: z.ZodString;
|
|
93
48
|
from: z.ZodString;
|
|
@@ -140,13 +95,64 @@ declare function prepareQuery({ publicClient }: PrepareQueryArgs, options?: Prep
|
|
|
140
95
|
* these mirror the on-chain transaction the depositor is about to submit, so
|
|
141
96
|
* they can't be inferred from `PrepareQueryArgs` alone.
|
|
142
97
|
*/
|
|
143
|
-
declare const blockaid: PolicyPack<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
98
|
+
declare const blockaid: _newton_xyz_policy_pack_shared.PolicyPack<"blockaid/transaction-scan/v1", {
|
|
99
|
+
deny_features: string[];
|
|
100
|
+
max_outbound_inbound_ratio: number;
|
|
101
|
+
require_received_shares: boolean;
|
|
102
|
+
}, {
|
|
103
|
+
chain: string;
|
|
104
|
+
from: string;
|
|
105
|
+
to: string;
|
|
106
|
+
value?: string | undefined;
|
|
107
|
+
data?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
BLOCKAID_API_KEY: string;
|
|
110
|
+
}, PrepareQueryOptions>;
|
|
111
|
+
|
|
112
|
+
declare const ParamsSchema: z.ZodObject<{
|
|
113
|
+
deny_features: z.ZodArray<z.ZodString, "many">;
|
|
114
|
+
max_outbound_inbound_ratio: z.ZodNumber;
|
|
115
|
+
require_received_shares: z.ZodBoolean;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
deny_features: string[];
|
|
118
|
+
max_outbound_inbound_ratio: number;
|
|
119
|
+
require_received_shares: boolean;
|
|
120
|
+
}, {
|
|
121
|
+
deny_features: string[];
|
|
122
|
+
max_outbound_inbound_ratio: number;
|
|
123
|
+
require_received_shares: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
type Params = z.infer<typeof ParamsSchema>;
|
|
126
|
+
declare const ParamsJsonSchema: {
|
|
127
|
+
readonly type: "object";
|
|
128
|
+
readonly description: "Thresholds for the Blockaid transaction-time exploit gate";
|
|
129
|
+
readonly properties: {
|
|
130
|
+
readonly deny_features: {
|
|
131
|
+
readonly type: "array";
|
|
132
|
+
readonly items: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
};
|
|
135
|
+
readonly description: "Blockaid feature ids that, if present on a Warning-classified transaction, deny the deposit (e.g. ['unbounded_approval','honeypot','phishing'])";
|
|
136
|
+
};
|
|
137
|
+
readonly max_outbound_inbound_ratio: {
|
|
138
|
+
readonly type: "number";
|
|
139
|
+
readonly description: "Maximum allowed simulated outbound-to-inbound USD value ratio. Above this, the transaction is treated as a value-skim and denied.";
|
|
140
|
+
};
|
|
141
|
+
readonly require_received_shares: {
|
|
142
|
+
readonly type: "boolean";
|
|
143
|
+
readonly description: "Deny if the simulated state-diff shows the depositor receives no inbound asset (vault shares). Catches contracts that take funds without minting receipts.";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly required: readonly ["deny_features", "max_outbound_inbound_ratio", "require_received_shares"];
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare const SecretsSchema: z.ZodObject<{
|
|
150
|
+
BLOCKAID_API_KEY: z.ZodString;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
BLOCKAID_API_KEY: string;
|
|
153
|
+
}, {
|
|
154
|
+
BLOCKAID_API_KEY: string;
|
|
155
|
+
}>;
|
|
156
|
+
type Secrets = z.infer<typeof SecretsSchema>;
|
|
151
157
|
|
|
152
|
-
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsJsonSchema, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid,
|
|
158
|
+
export { PACK_AUTHOR, PACK_DESCRIPTION, PACK_LINK, PACK_NAME, PACK_VERSION, type Params, ParamsJsonSchema, ParamsSchema, type PrepareQueryOptions, type Secrets, SecretsSchema, type WasmArgs, WasmArgsSchema, blockaid, deployments, prepareQuery };
|
package/dist/index.js
CHANGED
|
@@ -42,9 +42,7 @@ var PACK_LINK = "https://www.blockaid.io";
|
|
|
42
42
|
var PACK_AUTHOR = "";
|
|
43
43
|
|
|
44
44
|
// src/pack.ts
|
|
45
|
-
import {
|
|
46
|
-
oracleModuleFromPack
|
|
47
|
-
} from "@newton-xyz/policy-pack-shared";
|
|
45
|
+
import { definePolicyPack } from "@newton-xyz/policy-pack-shared";
|
|
48
46
|
|
|
49
47
|
// src/params.ts
|
|
50
48
|
import { z } from "zod";
|
|
@@ -139,10 +137,9 @@ var WasmArgsSchema = z3.object({
|
|
|
139
137
|
}).describe("Inputs passed to the Blockaid policy WASM at evaluation time");
|
|
140
138
|
|
|
141
139
|
// src/pack.ts
|
|
142
|
-
var blockaid = {
|
|
140
|
+
var blockaid = definePolicyPack({
|
|
143
141
|
id: `${PACK_NAME}/transaction-scan/v1`,
|
|
144
142
|
paramsSchema: ParamsSchema,
|
|
145
|
-
paramsJsonSchema: ParamsJsonSchema,
|
|
146
143
|
wasmArgsSchema: WasmArgsSchema,
|
|
147
144
|
secretsSchema: SecretsSchema,
|
|
148
145
|
prepareQuery,
|
|
@@ -154,8 +151,7 @@ var blockaid = {
|
|
|
154
151
|
author: PACK_AUTHOR || void 0,
|
|
155
152
|
link: PACK_LINK || void 0
|
|
156
153
|
}
|
|
157
|
-
};
|
|
158
|
-
var blockaidOracleModule = oracleModuleFromPack(blockaid);
|
|
154
|
+
});
|
|
159
155
|
export {
|
|
160
156
|
PACK_AUTHOR,
|
|
161
157
|
PACK_DESCRIPTION,
|
|
@@ -167,7 +163,6 @@ export {
|
|
|
167
163
|
SecretsSchema,
|
|
168
164
|
WasmArgsSchema,
|
|
169
165
|
blockaid,
|
|
170
|
-
blockaidOracleModule,
|
|
171
166
|
deployments,
|
|
172
167
|
prepareQuery
|
|
173
168
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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\"1\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0xa7ab76E81269f48b6C40132d2234A710b0B7A099\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-21\",\n\t\t},\n\t},\n\t\"8453\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0x33394324EA2a7a599B368bd73133cc02c1E04753\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-20\",\n\t\t},\n\t},\n\t\"84532\": {\n\t\tprod: {\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\tprod: {\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, ParamsJsonSchema, 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\tparamsJsonSchema: ParamsJsonSchema,\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\nexport const ParamsJsonSchema = {\n\ttype: \"object\",\n\tdescription: \"Thresholds for the Blockaid transaction-time exploit gate\",\n\tproperties: {\n\t\tdeny_features: {\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tdescription:\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},\n\t\tmax_outbound_inbound_ratio: {\n\t\t\ttype: \"number\",\n\t\t\tdescription:\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},\n\t\trequire_received_shares: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription:\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},\n\t},\n\trequired: [\"deny_features\", \"max_outbound_inbound_ratio\", \"require_received_shares\"],\n} as const;\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` + `target`) 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,KAAK;AAAA,IACJ,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,QAAQ;AAAA,IACP,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,SAAS;AAAA,IACR,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AACD;;;ACnCO,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,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,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,kBAAkB;AAAA,EAClB,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"]}
|
|
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\"1\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0xa7ab76E81269f48b6C40132d2234A710b0B7A099\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-21\",\n\t\t},\n\t},\n\t\"8453\": {\n\t\tprod: {\n\t\t\tpolicyData: \"0x33394324EA2a7a599B368bd73133cc02c1E04753\",\n\t\t\twasmCid: \"bafybeifktjif3473eeunuozy6dcr6qs5z774yo27ufhezohtdgryobralq\",\n\t\t\tpolicyCodeHash: \"0xb95ee22e1aeda1008947322959dcd2b42dddeea426a63e3a28c4530f5f02eea6\",\n\t\t\tdeployedAt: \"2026-06-20\",\n\t\t},\n\t},\n\t\"84532\": {\n\t\tprod: {\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\tprod: {\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 { definePolicyPack } 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 = definePolicyPack({\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","// 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\nexport const ParamsJsonSchema = {\n\ttype: \"object\",\n\tdescription: \"Thresholds for the Blockaid transaction-time exploit gate\",\n\tproperties: {\n\t\tdeny_features: {\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\tdescription:\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},\n\t\tmax_outbound_inbound_ratio: {\n\t\t\ttype: \"number\",\n\t\t\tdescription:\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},\n\t\trequire_received_shares: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription:\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},\n\t},\n\trequired: [\"deny_features\", \"max_outbound_inbound_ratio\", \"require_received_shares\"],\n} as const;\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` + `target`) 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,KAAK;AAAA,IACJ,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,QAAQ;AAAA,IACP,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,SAAS;AAAA,IACR,MAAM;AAAA,MACL,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,IACb;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX,MAAM;AAAA,MACL,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,SAAS,wBAAwB;;;ACCjC,SAAS,SAAS;AAEX,IAAM,eAAe,EAC1B,OAAO;AAAA,EACP,eAAe,EACb,MAAM,EAAE,OAAO,CAAC,EAChB;AAAA,IACA;AAAA,EACD;AAAA,EACD,4BAA4B,EAC1B,OAAO,EACP;AAAA,IACA;AAAA,EACD;AAAA,EACD,yBAAyB,EACvB,QAAQ,EACR;AAAA,IACA;AAAA,EACD;AACF,CAAC,EACA,SAAS,2DAA2D,EACpE,OAAO;AAIF,IAAM,mBAAmB;AAAA,EAC/B,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,IACX,eAAe;AAAA,MACd,MAAM;AAAA,MACN,OAAO;AAAA,QACN,MAAM;AAAA,MACP;AAAA,MACA,aACC;AAAA,IACF;AAAA,IACA,4BAA4B;AAAA,MAC3B,MAAM;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,EACP;AAAA,IACA;AAAA,EACD,EACC,SAAS;AAAA,EACX,MAAMA,GACJ,OAAO,EACP,SAAS,kFAAkF,EAC3F,SAAS;AACZ,CAAC,EACA,SAAS,8DAA8D;;;AJIlE,IAAM,WAAW,iBAAiB;AAAA,EACxC,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,CAAC;","names":["z","z"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newton-xyz/policy-pack-blockaid",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "Typed TypeScript bindings for the Newton blockaid policy pack.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Newton Protocol <https://x.com/newton_xyz> (https://newton.xyz)",
|
|
7
7
|
"homepage": "https://github.com/newt-foundation/newton-policy-packs/tree/main/packages/policy-pack-blockaid",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"LICENSE"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@newton-xyz/policy-pack-shared": "^0.
|
|
44
|
+
"@newton-xyz/policy-pack-shared": "^0.9.0",
|
|
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.
|
|
54
|
+
"@newton-xyz/policy-pack-shared": "0.9.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsup",
|