zk-nullifier-snap 中文文档教程
TypeScript 示例 Snap
此 Snap 演示了如何使用 TypeScript 开发 Snap。
注释
- Babel 用于将 TypeScript 转换为 JavaScript,因此在使用 CLI 构建时,
transpilationMode
必须设置为localOnly
(默认)或localAndDeps
。 - 要使全局
wallet
类型正常工作,您必须将以下内容添加到tsconfig.json
中:
{
"files": ["./node_modules/@metamask/snap-types/global.d.ts"]
}
TypeScript Example Snap
This Snap demonstrates how to develop a Snap with TypeScript.
Notes
- Babel is used for transpiling TypeScript to JavaScript, so when building with the CLI,
transpilationMode
must be set tolocalOnly
(default) orlocalAndDeps
. - For the global
wallet
type to work, you have to add the following to yourtsconfig.json
:
{
"files": ["./node_modules/@metamask/snap-types/global.d.ts"]
}