@newton-xyz/policy-pack-webacy
v2.0.2
Published
Bindings-only Newton webacy policy pack (zod schemas + deployments). No PolicyPack export yet — use with NewtonShield.guardedCall until pack.ts lands.
Readme
@newton-xyz/policy-pack-webacy
Gates vault deposits based on Webacy's per-address risk score (DD Score), sanctions hits, and exploit-exposure flags
Typed TypeScript bindings for the Newton webacy policy pack. Generated from the AVS-side artifacts at /webacy/ in this repo.
Install
pnpm add @newton-xyz/policy-pack-webacyWhat's exported
| Export | Source | Purpose |
|---|---|---|
| webacy (PolicyPack<Params, WasmArgs, Secrets>) | pack.ts | Canonical pack object; pass to createShield(...) from @newton-xyz/newton-shield-sdk. |
| prepareQuery, PrepareQueryOptions | prepare-query.ts | Reads pegged-token address (and optional chain/lookback_days) from the SDK options bag; derives Webacy chain slug from publicClient.chain.id. |
| WasmArgsSchema (zod) + WasmArgs (type) | wasm_args_schema.json | Inputs the pack's WASM receives at evaluation time. |
| SecretsSchema (zod) + Secrets (type) | secrets_schema.json | API credentials uploaded before run/sim. |
| ParamsSchema (zod) + Params (type) | params_schema.json | Configuration thresholds, set at policy upload time. |
| deployments | top-level deployments.json | chainId → { policy, policyData, wasmCid, ... } |
| PACK_NAME, PACK_VERSION, PACK_DESCRIPTION, PACK_LINK, PACK_AUTHOR | policy_metadata.json | Static pack identity. |
Regeneration
The generated src/* files (everything except pack.ts and prepare-query.ts) are emitted from the upstream JSON schemas. Edit the schemas under /webacy/ and run pnpm gen:bindings from the repo root to regenerate.
The hand-written files, package.json, tsconfig.json, tsup.config.ts, and this README survive regen — you can hand-tune them.
