@cordystackx/cordy_minikit

中文文档
3.1.2发布于 2026/11/06MITTypeScriptESM + CJS近 30 天下载 2271

Cordy Minikit - Open Source Web3 Dev Toolkit for both EVM and Non-EVM Wallets

原始使用文档
文档目录8 节
  1. Configuration highlights
  2. Configuration map
  3. © 2025 Cordy StackX (@cordystackx) · Licensed under the MIT…
  4. Install
  5. Version 3.1.1 documentation
  6. Current API
  7. Bridge API
  8. Links
Cordy Minikit logo

Cordy Minikit

Typed Web3 toolkit for EVM and Stellar wallet access, server-verified sign-in, balances, transfers, swaps, and bridges.

Configuration highlights

EVM networks are declared once under networks. ERC-20 assets are grouped by chain ID under evm; native currencies such as ETH and BOT come from networks[].nativeCurrency and should not be repeated in evm.

{
  "networks": [
    {
      "chainId": 11155111,
      "name": "Ethereum Sepolia",
      "nativeCurrency": { "name": "Sepolia Ether", "symbol": "ETH", "decimals": 18 },
      "rpcUrl": "https://rpc.example"
    }
  ],
  "evm": {
    "11155111": [
      { "symbol": "USDC", "contractAddress": "0xToken", "decimals": 6 }
    ]
  }
}

Wallets may connect on another EVM network, but Cordy rejects balance, transfer, and swap operations until that chain is configured. Bridge wallet connection can prepare the configured route network and request its token in wallets that support wallet_addEthereumChain and wallet_watchAsset.

Configuration map

The demo's assets.json keeps wallet, network, asset, Stellar, and bridge settings in one configuration:

flowchart LR
    config --> project["walletConnectProjectId"]
    config --> networks["networks[]<br/>EVM networks"]
    config --> evm["evm[chainId]<br/>EVM assets"]
    config --> stellarNetwork["stellarNetwork<br/>Stellar connection"]
    config --> stellar["stellar[]<br/>Stellar assets"]
    config --> routes["bridge.routes[]<br/>Bridge routes"]

Native currencies belong to networks[].nativeCurrency; ERC-20 contracts belong under evm["<chainId>"]; bridge directions and contract details belong under bridge.routes[].

Socket Badge

Cordy Minikit wallet connection interface Cordy Minikit EVM wallet interface Cordy Minikit Stellar wallet interface

NPM · GitHub · Documentation


© 2025 Cordy StackX (@cordystackx) · Licensed under the MIT License.

Install

npm install @cordystackx/cordy_minikit
# or
pnpm add @cordystackx/cordy_minikit

Version 3.1.1 documentation

Read the complete documentation in the docs/ folder:

Current API

import { cordy } from "@cordystackx/cordy_minikit";

const wallet = await cordy.cons_verify();
const balance = await cordy.balance();
const transfer = await cordy.transfer("1", recipient);
await cordy.cons_disconnect();

The current 3.1.1 API is:

  • cordy.configure({ assets })
  • cordy.cons_verify()
  • cordy.cons_disconnect()
  • useConsSession()
  • createCordyServer() from @cordystackx/cordy_minikit/server
  • cordy.transfer()
  • cordy.balance()
  • cordy.swap(amount, from, to, tolerancePercent?, options?)
  • cordy.bridge(amount, from, to, recipient, options?)

With cons_session={true}, ConnectWalletBT requests a wallet signature, verifies SIWE (EVM) or SEP-10 (Stellar) through your server, and navigates only after verification succeeds. Mount the SDK server handler and configure it with createCordyServer(); the SDK never reads environment variables. cordy.cons_verify() and useConsSession() read the resulting server session, while cordy.cons_disconnect() clears the session and disconnects wallets. See the authentication guide. Keep signing keys in server-only environment variables and never pass them to client components.

Bridge API

cordy.bridge() is a supported API in 3.1.0. Configure routes in assets.bridge.routes; pass { routeId } when more than one route is configured. The demo includes BOT Chain Testnet ↔ Sepolia and BOT Chain Testnet ↔ BNB Testnet validator routes, plus Stellar Testnet ↔ Sepolia CCTP for USDC. EVM validator delivery is asynchronous; CCTP completes through attestation and destination mint. See the bridge route configuration, API example, and Use Cordy functions in your app.

cordy.swap(amount, from, to, tolerancePercent?, options?) is available for configured EVM and Stellar assets. EVM networks can configure a V2 swapRouterAddress, V3 swapV3 router and QuoterV2, or both. The default auto mode compares configured quotes; use { version: "v2" } or { version: "v3" } to choose explicitly. Pass feeTiers: [500, 3000] in the options to override the configured V3 tiers for one call; with version: "auto", V2 is still compared against only those selected V3 tiers. The tiers 500, 3000, and 10000 correspond to pool fees of 0.05%, 0.30%, and 1.00%. Every network needs compatible deployments, fee tiers, token addresses, and available liquidity. Native EVM swaps also need wrappedNativeTokenAddress. Stellar swaps use Horizon strict-send path payments and require a live liquidity path. The tolerance argument is a percentage: 1 means 1% tolerance, and omission defaults to 1%.

版本与发布记录

@cordystackx/cordy_minikit 共发布 74 个版本,首次发布于 2025/10/02;过去 12 个月发布了 31 个版本。

版本发布日期距今
3.1.2latest2026/11/064 天前
3.1.12026/11/046 天前
3.1.02026/11/037 天前
3.0.102026/11/028 天前
3.0.62026/10/3011 天前
3.0.52026/10/2715 天前

关于 @cordystackx/cordy_minikit 的常见问题

@cordystackx/cordy_minikit 是什么?

Cordy Minikit - Open Source Web3 Dev Toolkit for both EVM and Non-EVM Wallets

如何安装 @cordystackx/cordy_minikit?

在项目目录运行 npm install @cordystackx/cordy_minikit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:next(>=13)、react(>=18)、wagmi(>=3)、react-dom(>=18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cordystackx/cordy_minikit 支持 TypeScript 吗?

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

@cordystackx/cordy_minikit 支持 ESM 还是 CommonJS?

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

@cordystackx/cordy_minikit 可以商用吗?

@cordystackx/cordy_minikit 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cordystackx/cordy_minikit 的下载量有多少?

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

@cordystackx/cordy_minikit 还在维护吗?

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