@newton-xyz/policy-pack-sumsub
v2.0.2
Published
Bindings-only Newton sumsub policy pack (zod schemas + deployments). No PolicyPack export yet — use with NewtonShield.guardedCall until pack.ts lands.
Readme
@newton-xyz/policy-pack-sumsub
Gates vault deposits behind SumSub KYC: requires a passing applicant review (GREEN), allowed country, minimum age, and non-stale verification.
Typed TypeScript bindings for the Newton sumsub policy pack. Generated from the AVS-side artifacts at /sumsub/ in this repo.
Install
pnpm add @newton-xyz/policy-pack-sumsubWhat's exported
| Export | Source | Purpose |
|---|---|---|
| sumsub (PolicyPack<Params, WasmArgs, Secrets>) | pack.ts | Canonical pack object; pass to createShield(...) from @newton-xyz/newton-shield-sdk. |
| prepareQuery, PrepareQueryOptions | prepare-query.ts | Reads the depositor walletAddress from the SDK options bag. |
| 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 /sumsub/ 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.
