@circle-fin/smart-contract-platform

中文文档
10.8.1发布于 2026/09/22TypeScriptESM + CJS近 30 天下载 2.3万

This SDK provides convenient access to Circle's Smart Contract Platform APIs for applications written in NodeJS. For the API reference, see the Circle Web3 API docs.

原始使用文档
文档目录4 节
  1. Installation
  2. Usage
  3. Configuration
  4. Need help or have questions?

Circle's Smart Contract Platform NodeJS SDK

This SDK provides convenient access to Circle's Smart Contract Platform APIs for applications written in NodeJS. For the API reference, see the Circle Web3 API docs.

Installation

Install the package with:

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

or

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

Usage

  1. Generate an API key, if you haven't already, in the Web3 Services Console. This API key will be used for authentication and authorization when making requests to Circle's APIs.

  2. Register an entity secret following Circle's Developer-Controlled QuickStart. This step ensures that your account is correctly set up to interact with Circle's APIs.

  3. In your code, import the factory initiateSmartContractPlatformClient from the SDK and initialize the client using your API key and entity secret:

    const { initiateSmartContractPlatformClient } = require('@circle-fin/smart-contract-platform')
    
    const client = initiateSmartContractPlatformClient({
      apiKey: '<your-api-key>',
      entitySecret: '<your-entity-secret>',
    })
    

    or

    import { initiateSmartContractPlatformClient } from '@circle-fin/smart-contract-platform'
    
    const client = initiateSmartContractPlatformClient({
      apiKey: '<your-api-key>',
      entitySecret: '<your-entity-secret>',
    })
    
  4. Interact with the client:

    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)
    

We recommend reading through the official documentation and QuickStart guides mentioned above to ensure a smooth setup and usage experience.

Configuration

The client accepts the following configuration parameters:

OptionRequiredDescription
apiKey[x]Api Key that is used to authenticate against Circle APIs.
entitySecret[x]Your configured entity secret. You can follow the QuickStart to set it up.
baseUrl[ ]Optional base URL to override the default: https://api.circle.com.
storage[ ]Optional custom storage solution for persisting data. We will fallback to InMemoryStorage if none was provided.
userAgent[ ]Optional custom user agent request header. We will prepend it to default user agent header if provided.

Need help or have questions?

Here are some helpful links, if you encounter any issues or have questions about this SDK:

Happy coding!

版本与发布记录

@circle-fin/smart-contract-platform 共发布 48 个版本,首次发布于 2023/11/23;过去 12 个月发布了 19 个版本。

版本发布日期距今
10.8.1latest2026/09/221 个月前
10.8.02026/07/014 个月前
10.7.12026/06/244 个月前
10.6.02026/05/295 个月前
10.5.52026/05/285 个月前
10.5.42026/05/275 个月前

关于 @circle-fin/smart-contract-platform 的常见问题

@circle-fin/smart-contract-platform 是什么?

This SDK provides convenient access to Circle's Smart Contract Platform APIs for applications written in NodeJS. For the API reference, see the Circle Web3 API docs.

如何安装 @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 和提交记录判断。