@canton-network/core-provider-conformance

中文文档
1.5.0发布于 2026/11/06Apache-2.0TypeScriptESM + CJS近 30 天下载 5254

Typed conformance test providers and wallet interaction wrappers

原始使用文档
文档目录3 节
  1. Test Hooks
  2. Automating a Wallet
  3. Development

Conformance Test Provider

@canton-network/core-provider-conformance provides the contracts and wrappers used by the conformance CLI to automate wallet approvals and rejections during a CIP-103 conformance run. See src/test-provider.ts for the full API.

pnpm add @canton-network/core-provider-conformance

Test Hooks

TestProvider extends the SDK provider with six hooks, each approving or rejecting a request that is already pending in the wallet:

  • test_approveConnect / test_rejectConnect
  • test_approveSignMessage / test_rejectSignMessage
  • test_approvePrepareExecute / test_rejectPrepareExecute

Hooks only perform the user action; the wallet's own RPC response remains the result under test.

Automating a Wallet

The suite discovers the wallet under test like any production wallet (remote or extension) and drives decisions through a wrapper selected in the suite config:

  • manual: the tester performs the action and confirms in the dApp.
  • window: the dApp dispatches a cip103:test:interaction event on window.
  • webhook: the dApp POSTs the interaction as JSON to the configured url (which must allow CORS).

The interaction has the shape { id, method, decision, params }. After performing the action in the wallet, reply with { id, completed: true }, or { id, error: "description" } if the action could not be performed — as a cip103:test:ack window event, or as the HTTP 2xx response body for webhooks. Payloads may contain sensitive transaction data; use test data only.

Development

pnpm --filter @canton-network/core-provider-conformance build
pnpm nx test @canton-network/core-provider-conformance

版本与发布记录

@canton-network/core-provider-conformance 共发布 5 个版本,首次发布于 2026/09/30;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.5.0latest2026/11/063 天前
1.4.02026/10/2910 天前
1.3.02026/10/2317 天前
1.2.02026/10/1227 天前
1.1.02026/09/301 个月前

关于 @canton-network/core-provider-conformance 的常见问题

@canton-network/core-provider-conformance 是什么?

Typed conformance test providers and wallet interaction wrappers

如何安装 @canton-network/core-provider-conformance?

在项目目录运行 npm install @canton-network/core-provider-conformance,或使用 pnpm add / yarn add / bun add。

@canton-network/core-provider-conformance 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@canton-network/core-provider-conformance 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@canton-network/core-provider-conformance 可以商用吗?

@canton-network/core-provider-conformance 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@canton-network/core-provider-conformance 的下载量有多少?

根据 npm 官方下载统计,@canton-network/core-provider-conformance 在 2026/10/09 – 2026/11/07 这 30 天内被下载 5,254 次,日均约 175 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@canton-network/core-provider-conformance 还在维护吗?

最新版本 1.5.0 发布于 2026/11/06(3 天前);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/09/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。