# @circle-fin/smart-contract-platform 中文文档

规范地址：https://npmcn.com/package/%40circle-fin/smart-contract-platform/

版本：10\.8\.1
npm 元数据更新时间：2026-09-22T04:27:35.268Z
中文译文更新时间：2026-11-09T16:45:35.726Z
软件包许可：未声明

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40circle-fin/smart-contract-platform
原文对照：https://npmcn.com/package/%40circle-fin/smart-contract-platform/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：457 kB，10 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：1 个
- 首次发布：2023-11-23T06:09:47.018Z
- 最新版本发布：2026-09-22T04:27:35.061Z
- 近 30 天下载量：23204（2026-10-10 至 2026-11-08，npm 官方下载统计）
- 已发布版本数：48（近 12 个月 19 个）

## 中文简介

这个SDK为Circle的"智能合同"平台API提供了方便访问,用于由NodeJS所写的应用程序. API 参考文献 [圆形 Web3 API 文件](https://developers.circle.com/api-reference/contracts/common/ping)。 。 。 .

## 安装

```sh
npm install @circle-fin/smart-contract-platform
```

也可以使用：`pnpm add @circle-fin/smart-contract-platform`、`yarn add @circle-fin/smart-contract-platform`、`bun add @circle-fin/smart-contract-platform`

## README

# Circle 的智能合同平台节点JS SDK

这个SDK为Circle的"智能合同"平台API提供了方便访问,用于由NodeJS所写的应用程序. API 参考文献 [圆形 Web3 API 文件](https://developers.circle.com/api-reference/contracts/common/ping)。 。 。 .

## 安装

以 :

```sh
npm install @circle-fin/smart-contract-platform --save
```

或者说

```sh
pnpm add @circle-fin/smart-contract-platform
```

## 使用量

1.  生成 API 密钥, 如果您还没有, 在 [Web3 服务控制台](https://console.circle.com/api-keys)。当向 Circle 的 API 提出请求时,此 API 密钥将被用于认证和授权.
    
2.  在 Circle 后注册一个实体 [开发者控制的快速启动](https://developers.circle.com/wallets/dev-controlled/create-your-first-wallet)。该步骤确保您的账户正确设置,以便与 Circle 的 API 交互.
    
3.  在你的代码中,导入工厂 `initiateSmartContractPlatformClient` 使用您的 API 密钥和实体密钥初始化客户端 :
    
    ```javascript
    const { initiateSmartContractPlatformClient } = require('@circle-fin/smart-contract-platform')
    
    const client = initiateSmartContractPlatformClient({
      apiKey: '<your-api-key>',
      entitySecret: '<your-entity-secret>',
    })
    ```
    
    或者说
    
    ```typescript
    import { initiateSmartContractPlatformClient } from '@circle-fin/smart-contract-platform'
    
    const client = initiateSmartContractPlatformClient({
      apiKey: '<your-api-key>',
      entitySecret: '<your-entity-secret>',
    })
    ```
    
4.  与客户交互 :
    
    ```javascript
    const response = await client.deployContract({
      name: 'First Contract',
      description: 'My first hello world contract',
      walletId: '004735f6-d9fc-44f8-933c-672cdf3d240d',
      abiJson: "[\n\t{\n\t\t'inputs': [],\n\t\t'stateMutability': 'nonpayable',\n\t\t'type': 'constructor'\n\t},\n\t...",
      bytecode: '0x60806040523480156200001157600080fd5b50604051806040...',
      constructorParameters: ['TICK', 10000],
      feeLevel: 'MEDIUM',
    })
    console.log(response.data)
    ```
    

我们建议通过官方阅读 [文档](https://developers.circle.com/contracts) 财务报告和审定财务报表 [快速启动指南](https://developers.circle.com/build-onchain) (b) 确保顺利设置和使用经验.

## 配置

客户端接受以下配置参数:

| 选项 | 需求 | 说明 |
| --- | --- | --- |
| `apiKey` | \[x\] (中文(简体) ) | 用于对 Circle API 认证的 Api 密钥 . |
| `entitySecret` | \[x\] (中文(简体) ) | 您配置的实体秘密 。 你可以跟着 [快速启动](https://developers.circle.com/wallets/dev-controlled/entity-secret-management) 来设置它. |
| `baseUrl` | \[ | 覆盖默认的可选基址 : `https://api.circle.com`。 。 。 . |
| `storage` | \[ | 为持续数据选择自定义存储解决方案 。 如果得不到任何信息,我们将回到记忆中. |
| `userAgent` | \[ | 可选自定义用户代理请求头. 如果提供的话, 我们将将其预置为默认用户代理头 . |

## 需要帮忙还是有问题?

这里有一些有用的链接,如果你遇到任何问题或对这个SDK有疑问:

-   📖 [开始](https://developers.circle.com/wallets/dev-controlled/create-your-first-wallet):检查我们的官方开发者控制的钱包QuickStart.
-   🎮 [加入我们的Discord社区](https://discord.com/invite/buildoncircle):接触、学习和协作.
-   🛎 [访问 Help-Desk 页面](https://help.circle.com/s/submit-ticket):潜入所编的FAQ和向导.
-   📧 [直接电子邮件](mailto:customer-support@circle.com)我们总是一个信息离开.
-   📖 [读取文件](https://developers.circle.com/contracts):检查我们的开发者文档.

编码愉快!

## 常见问题

### @circle-fin/smart-contract-platform 是什么？

这个SDK为Circle的"智能合同"平台API提供了方便访问,用于由NodeJS所写的应用程序\. API 参考文献 圆形 Web3 API 文件。 。 。 \.

### 如何安装 @circle-fin/smart-contract-platform？

在项目目录运行 npm install @circle-fin/smart-contract-platform，或使用 pnpm add / yarn add / bun add。

### @circle-fin/smart-contract-platform 支持 TypeScript 吗？

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

### @circle-fin/smart-contract-platform 支持 ESM 还是 CommonJS？

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

### @circle-fin/smart-contract-platform 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @circle-fin/smart-contract-platform 可以商用吗？

@circle-fin/smart-contract-platform 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @circle-fin/smart-contract-platform 的下载量有多少？

根据 npm 官方下载统计，@circle-fin/smart-contract-platform 在 2026/10/10 – 2026/11/08 这 30 天内被下载 23,204 次，日均约 773 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @circle-fin/smart-contract-platform 还在维护吗？

最新版本 10\.8\.1 发布于 2026/09/22（1 个月前）；至今共发布 48 个版本，其中过去 12 个月发布了 19 个；首次发布于 2023/11/23。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

