@aifinpay/deployments

中文文档
2.1.5发布于 2026/11/02MITTypeScriptES Module零依赖近 30 天下载 3481

Contracts deployment registry for AiFinPay SDK and Agent Passport identity and settlement protocol.

原始使用文档
文档目录10 节
  1. Deployment registry & artifact manager
  2. Quick Start
  3. Evidence and availability
  4. Registry grabber (legacy)
  5. Registry layout
  6. Exports
  7. Deployment Registry
  8. Artifact Registry
  9. Legacy grabber (deprecated)
  10. Types

@aifinpay/deployments

Deployment registry & artifact manager

This package provides a programmatic interface for querying AIFP deployment records and contract artifacts (ABI/IDL).

Quick Start

import { AifinpayRegistry, ArtifactRegistry } from "@aifinpay/deployments";

// Load deployment registries
const evmRegistry = AifinpayRegistry.loadEvm("latest");      // or "1.4", "1.3", etc.
const solanaRegistry = AifinpayRegistry.loadSolana("latest");

// Load contract artifacts
const artifacts = ArtifactRegistry.load();

// Query deployments
const optimism = evmRegistry.getEvmDeployment(10);
const splitterAddr = evmRegistry.getSplitterAddress(10);
const stablecoins = evmRegistry.getStablecoins(10);

// Get supported chains
const chains = evmRegistry.getSupportedChains("enabled");
const networks = evmRegistry.getNetworkList();             // [{ chainId, name, settlementEnabled, testnet }]

// Export as markdown/json/csv
const markdown = evmRegistry.exportAsMarkdown("prod");
const json = evmRegistry.exportAsJson();
const csv = evmRegistry.exportAsCsv();

// Query artifacts
const abi = artifacts.getEvmAbi("B2BSplitterV14", "1.4");
const solanaIdl = artifacts.getSolanaIdl("mainnet");
const nearAbi = artifacts.getNearAbi("aifinpay-near-contract");

See USAGE.md for complete documentation.

Evidence and availability

Use the registry index to select the actual machine-readable record for the required ecosystem, version, chain and route. Addresses, program IDs, runtime hashes, governance and provenance belong in those records, not copied tables here.

Registry queries read packaged metadata; they do not check live chain state or backend receipt verification. Settlement flags are not current verification results. Follow the index's runtime/backend verification checklist and obtain fresh end-to-end evidence before claiming availability. Never infer activation from an export.


Registry grabber (legacy)

src/grabber.ts pulls the latest deployment records from the canonical upstream repositories and produces per-ecosystem split registry files:

  • EVM v1.4: registry/splitter/evm/v1.4/deployments.json
  • Solana v1.4: registry/splitter/solana/deployments.json
cd deployments
npm ci --no-audit --no-fund
npm run build          # compile TypeScript
npm run registry:build # fetch upstream + write registry/*.json
npm test               # offline unit tests

Registry layout

Per-ecosystem split files are the canonical artifacts. ABI and IDL subdirectories are kept for downstream consumers that need raw contract artifacts:

registry/
├── splitter/                  # versioned registry with governance metadata
│   ├── evm/
│   │   ├── v1.4/deployments.json  # EVM v1.4 full contract suite
│   │   ├── v1.3/deployments.json  # EVM v1.3 route table
│   │   ├── v1.2/deployments.json  # EVM v1.2 legacy
│   │   └── v1.1/deployments.json  # EVM v1.1 legacy
│   ├── solana/deployments.json # Solana v1.4 program deployments
│   ├── casper/deployments.json # Casper deployments
│   ├── near/deployments.json   # Curated NEAR account/WASM snapshots
│   └── aptos/                  # Aptos deployment snapshots
│       ├── deployments.json
│       └── multisig-deployments.json
├── abi/
│   ├── aptos/       # Aptos splitter ABI snapshots
│   ├── evm/         # EVM ABI bundles (including the linted B2BSplitterV14 ABI)
│   └── tron/        # Tron ABI bundles when applicable
└── idl/
    ├── solana/      # Solana IDL (splitter-v14 mainnet/devnet)
    ├── aptos/       # Aptos IDL artifacts
    └── casper/      # Casper IDL artifacts

The registry index links versioned JSON records and interface guides, and the payment deployment JSON Schema describes their ecosystem-specific record shapes. Output selection is implemented in the grabber and build CLI; upstream provenance is stored in the generated JSON rather than this README.

Aptos records are curated package data, not outputs of registry:build. See the Aptos registry guide for snapshot provenance and refresh instructions.

NEAR deployment records are curated package data, not grabber outputs or programmatic deployment lookup APIs. NEAR ABI documents are available through ArtifactRegistry. See the NEAR registry guide for provenance, field normalization, governance caveats, and refresh instructions.

Exports

Deployment Registry

  • AifinpayRegistry.loadEvm(version?) — load EVM deployment registry (default: "latest" = "1.4")
  • AifinpayRegistry.loadSolana(version?) — load Solana deployment registry (default: "latest" = "1.4")
  • getEvmDeployment(chainId) — O(1) lookup by chain ID
  • getEvmByNetwork(network) — lookup by network name
  • getSplitterAddress(chainId), getTokenListAddress(chainId), getProfilesAddress(chainId) — contract addresses
  • getStablecoins(chainId) — stablecoin list
  • isSettlementEnabled(chainId) — recorded settlement flag, not a live check
  • getGovernanceSafe(env) — Safe multisig address
  • getProdDeployments(), getTestnetDeployments() — filtering
  • getSupportedChains(filter?) — get list of supported chain IDs (filter: "all" | "prod" | "testnet" | "enabled")
  • getNetworkList(filter?) — get network list with metadata
  • isChainSupported(chainId) — check if chain is supported
  • getChainIdByNetwork(network) — get chain ID by name
  • getNetworkByChainId(chainId) — get network name by ID
  • exportAsMarkdown(filter?), exportAsJson(filter?), exportAsCsv(filter?) — export formats

Artifact Registry

  • ArtifactRegistry.load() — load all ABI/IDL artifacts
  • getEvmAbi(contractName, version?) — EVM ABI
  • getSolanaIdl(cluster) — Solana IDL (mainnet/devnet)
  • getCasperIdl(network) — Casper IDL (mainnet/testnet)
  • getAptosIdl(contractName, version?) — Aptos IDL
  • getTronAbi(contractName, version?) — Tron ABI
  • getNearAbi(contractName, version?) — NEAR ABI document
  • getAllNearAbis() — all loaded NEAR ABI documents

Legacy grabber (deprecated)

  • buildRegistry() — fetch upstream EVM + Solana records (deprecated: use AifinpayRegistry.loadEvm())
  • writeSplitRegistries(registry, outDir) — write split registry files
  • grabEvmDeployments() / grabSolanaDeployments() — grab one chain family
  • getEvmDeployment(registry, chainId) / getSolanaDeployment(registry, cluster) — O(1) lookup helpers
  • isEvmDeployment(d) / isSolanaDeployment(d) — type guards

Types

  • DeploymentRegistry, EcosystemRegistry, Deployment, EvmDeployment, SolanaDeployment, Stablecoin
  • EvmDeploymentRecord, SolanaDeploymentRecord, EvmAbiArtifact, SolanaIdlArtifact, NearAbiArtifact

版本与发布记录

@aifinpay/deployments 共发布 9 个版本,首次发布于 2026/09/16;过去 12 个月发布了 9 个版本。

版本发布日期距今
2.1.5latest2026/11/025 天前
2.1.42026/11/016 天前
2.1.32026/10/317 天前
2.1.12026/10/317 天前
2.1.02026/10/2019 天前
1.1.42026/10/0929 天前

关于 @aifinpay/deployments 的常见问题

@aifinpay/deployments 是什么?

Contracts deployment registry for AiFinPay SDK and Agent Passport identity and settlement protocol.

如何安装 @aifinpay/deployments?

在项目目录运行 npm install @aifinpay/deployments,或使用 pnpm add / yarn add / bun add。

@aifinpay/deployments 支持 TypeScript 吗?

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

@aifinpay/deployments 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aifinpay/deployments 可以商用吗?

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

@aifinpay/deployments 的下载量有多少?

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

@aifinpay/deployments 还在维护吗?

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