@akashnetwork/akash-api

中文文档
1.4.3发布于 2026/04/15Apache-2.0TypeScriptCommonJS近 30 天下载 6362

Akash API TypeScript client

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. TypeScript 4.5 and above
  4. TypeScript below 4.5
  5. Contributing
  6. Contributing to Generated Files
  7. License

Akash API TypeScript Bindings

npm version License: Apache-2.0 semantic-release: conventionalcommits

DEPRECATED: This package is no longer maintained and does not support Akash Network v1. Please migrate to chain-sdk, which provides a more developer-friendly API with full IDE autocomplete and TypeScript support.

This package provides TypeScript bindings for the Akash API, generated from protobuf definitions.

Installation

To install the package, run:

npm install @akashnetwork/akash-api

Usage

You can import the generated namespaces from the package like this:

import * as akashDeploymentV1beta1 from '@akashnetwork/akash-api/akash/deployment/v1beta1';
import * as akashDiscoveryV1 from '@akashnetwork/akash-api/akash/discovery/v1';
// ... and so on for other namespaces

TypeScript 4.5 and above

If you're using TypeScript 4.5 or above, the package exports all the paths of the generated namespaces, so you can import them directly.

TypeScript below 4.5

If you're using a version of TypeScript below 4.5, the package provides a tsconfig.paths.json file that you can extend in your local TypeScript configuration to resolve the paths. Here's how you can do it: In your tsconfig.json file, add the following:

{
  "extends": "@akashnetwork/akash-api/tsconfig.paths.json"
}

Contributing

Contributions are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.

Contributing to Generated Files

The files in the src/generated directory are auto-generated and should not be modified directly. If you need to make changes to these files, follow the steps below:

  1. Create a new file in the src/patch directory with the same path as the file you want to modify. For example, if you want to modify src/generated/cosmos/base/v1beta1/coin.ts, you should create the directory src/patch/cosmos/base/v1beta1/coin.ts.

  2. Add your changes to a new file in the src/patch directory. The new file should have the same name as the file you want to modify.

  3. Rename the original file in the src/generated directory by appending .original.ts to its name. For example, src/generated/cosmos/base/v1beta1/coin.ts should be renamed to src/generated/cosmos/base/v1beta1/coin.original.ts.

  4. Create a new file in the src/generated directory with the same name as the original file. This new file should re-export everything from the corresponding file in the src/patch directory. For example, the content of src/generated/cosmos/base/v1beta1/coin.ts should be:

export * from '../../../../patch/cosmos/base/v1beta1/coin';

NOTE: Naming and paths are important to prevent the original file from being overwritten when the code is regenerated. See script/preserve-ts-patches.sh and script/restore-ts-patches.sh for more implementation details.

License

This package is licensed under the Apache-2.0.

版本与发布记录

@akashnetwork/akash-api 共发布 13 个版本,首次发布于 2024/04/12;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.4.3latest2026/04/156 个月前
1.4.22026/04/146 个月前
1.4.12025/10/291 年前
1.4.02024/05/152 年前
1.3.02024/05/042 年前
1.2.12024/05/032 年前

关于 @akashnetwork/akash-api 的常见问题

@akashnetwork/akash-api 是什么?

Akash API TypeScript client

如何安装 @akashnetwork/akash-api?

在项目目录运行 npm install @akashnetwork/akash-api,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@grpc/grpc-js(^1.10.6)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@akashnetwork/akash-api 支持 TypeScript 吗?

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

@akashnetwork/akash-api 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@akashnetwork/akash-api 可以商用吗?

@akashnetwork/akash-api 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@akashnetwork/akash-api 的下载量有多少?

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

@akashnetwork/akash-api 还在维护吗?

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