open-index/open-npm huggingface dataset:
npm package: @polkadot-agent-kit/common
Description: SDK common code for Polkadot Agent Kit for developers
Latest version: 2.1.5

<div align="center">
  <h1 align="center">@polkadot-agent-kit/common</h1>
  <h4 align="center">Shared types, chain metadata, and utilities for Polkadot Agent Kit</h4>
  <p align="center">
    <a href="https://npmjs.com/package/@polkadot-agent-kit/common">
      <img alt="version" src="https://img.shields.io/npm/v/@polkadot-agent-kit/common?style=flat-square" />
    </a>
    <a href="https://npmjs.com/package/@polkadot-agent-kit/common">
      <img alt="downloads" src="https://img.shields.io/npm/dm/@polkadot-agent-kit/common?style=flat-square" />
    </a>
  </p>
</div>

## Overview

The `@polkadot-agent-kit/common` package provides shared TypeScript types, chain metadata, client helpers, and utility functions used across the Polkadot Agent Kit (core, sdk, and llm packages).

## Features

- **Strongly-Typed Models**: Accounts, transactions, chains, APIs
- **Chain Metadata**: Supported chains and helpers (relay/system/para detection)
- **Formatting Utilities**: Balance parsing/formatting helpers
- **Crypto Utilities**: Address/SS58 helpers and convenience methods
- **Client Helpers**: Smoldot provider utilities and client setup helpers

## Installation

```bash
pnpm add @polkadot-agent-kit/common
```

## Development

```bash
pnpm install
pnpm build
pnpm test
```

## License

Published under [MIT License](https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/LICENSE).

---

Made with 💛 by [Elastic Labs](https://elasticlabs.org/)
npm package: @polkadot-agent-kit/core
Description: Core Package for Polkadot Agent Kit
Latest version: 2.1.5

<div align="center">
  <h1 align="center">@polkadot-agent-kit/core</h1>
  <h4 align="center">Core functionality for Polkadot Agent Kit</h4>
  <p align="center">
    <a href="https://npmjs.com/package/@polkadot-agent-kit/core">
      <img alt="version" src="https://img.shields.io/npm/v/@polkadot-agent-kit/core?style=flat-square" />
    </a>
    <a href="https://npmjs.com/package/@polkadot-agent-kit/core">
      <img alt="downloads" src="https://img.shields.io/npm/dm/@polkadot-agent-kit/core?style=flat-square" />
    </a>
  </p>
</div>

## Overview

The `@polkadot-agent-kit/core` package provides core functionality for building AI agents that interact with the Polkadot ecosystem. It includes utilities for blockchain operations, DeFi interactions, staking, and cross-chain transfers.

## Features

- **Cross-Chain Transfers (XCM)** - Native asset transfers between parachains
- **DeFi Operations** - Token swaps and liquidity operations  
- **Staking & Nomination Pools** - Join pools, bond/unbond, claim rewards
- **Bifrost Integration** - Mint vDOT tokens and liquid staking
- **Utility Functions** - Address validation, balance checking, transaction handling

## Installation

```bash
pnpm add @polkadot-agent-kit/core
```

## Development

### Prerequisites
- Node.js >= 22
- pnpm (recommended)

### Setup & Run

```bash
# Install dependencies
pnpm install

# Build the package
pnpm build

# Run tests
pnpm test

```

### Available Scripts

- `pnpm build` - Build the package
- `pnpm test` - Run unit tests
- `pnpm lint` - Run ESLint
- `pnpm compile` - TypeScript compilation check
- `pnpm format:write` - Format code with Prettier

## License

Published under [MIT License](https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/LICENSE).

---

Made with 💛 by [Elastic Labs](https://elasticlabs.org/)
npm package: @polkadot-agent-kit/llm
Description: SDK LLM for Polkadot Agent Kit
Latest version: 2.1.5

<div align="center">
  <h1 align="center">@polkadot-agent-kit/llm</h1>
  <h4 align="center">LLM tooling and agent actions for Polkadot Agent Kit</h4>
  <p align="center">
    <a href="https://npmjs.com/package/@polkadot-agent-kit/llm">
      <img alt="version" src="https://img.shields.io/npm/v/@polkadot-agent-kit/llm?style=flat-square" />
    </a>
    <a href="https://npmjs.com/package/@polkadot-agent-kit/llm">
      <img alt="downloads" src="https://img.shields.io/npm/dm/@polkadot-agent-kit/llm?style=flat-square" />
    </a>
  </p>
</div>

## Overview

The `@polkadot-agent-kit/llm` package provides LangChain-based tools and prompts for building AI agents that interact with the Polkadot ecosystem. It exposes structured tools for balance checks, transfers, XCM, swaps, staking, identity, and more.

## Features

- **Structured Tools** for on-chain actions (balance, transfers, XCM, swaps, staking, identity)
- **Prompt System** with strict chain-name conversion rules for XCM and swaps

## Installation

```bash
pnpm add @polkadot-agent-kit/llm
```

## Development

```bash
pnpm install
pnpm build
pnpm test
```


## License

Published under [MIT License](https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/LICENSE).

---

Made with 💛 by [Elastic Labs](https://elasticlabs.org/)
npm package: @polkadot-agent-kit/mcp
Description: Model Context Protocol server for Polkadot Agent Kit
Latest version: 2.1.0

# Polkadot Agent Kit MCP

Model Context Protocol (MCP) package for the Polkadot Agent Kit, enabling AI assistants to interact with Polkadot blockchain operations through standardized MCP tools.

## Installation

```bash
npm install @polkadot-agent-kit/mcp
```

## MCP Server Integration

To integrate with an MCP server (like Claude Desktop or custom MCP clients):

```typescript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import { PolkadotAgentKit } from "@polkadot-agent-kit/sdk";
import { getMcpTools } from "@polkadot-agent-kit/mcp";

async function runServer() {
  // Initialize the agent kit
  const agentKit = new PolkadotAgentKit({
    privateKey: process.env.PRIVATE_KEY!,
    chains: ["polkadot", "kusama", "westend"]
  });
  
  await agentKit.initializeApi();
  
  // Get MCP tools
  const { tools, toolHandler } = await getMcpTools(agentKit);

  // Create MCP server
  const server = new Server(
    {
      name: "polkadot-agent-kit",
      version: "1.0.0",
    },
    {
      capabilities: {
        tools: {},
      },
    }
  );

  // Handle tool listing
  server.setRequestHandler(ListToolsRequestSchema, async () => {
    return { tools };
  });

  // Handle tool calls
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
    return await toolHandler(request.params.name, request.params.arguments);
  });

  // Start server
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.log("Polkadot Agent Kit MCP server running on stdio");
}

runServer().catch(console.error);
```
npm package: @polkadot-agent-kit/sdk
Description: SDK for Polkadot Agent Kit
Latest version: 2.1.5

<div align="center">
  <h1 align="center">@polkadot-agent-kit/sdk</h1>
  <h4 align="center">A TypeScript SDK for building AI agents that interact with the Polkadot ecosystem.</h4>
  <p align="center">
    <a href="https://npmjs.com/package/@polkadot-agent-kit/sdk">
      <img alt="version" src="https://img.shields.io/npm/v/@polkadot-agent-kit/sdk?style=flat-square" />
    </a>
    <a href="https://npmjs.com/package/@polkadot-agent-kit/sdk">
      <img alt="downloads" src="https://img.shields.io/npm/dm/@polkadot-agent-kit/sdk?style=flat-square" />
    </a>
  </p>
</div>

## Installation

```sh
npm install @polkadot-agent-kit/sdk
```

## Features

- **Multi-chain Support**: Connect to multiple Polkadot ecosystem chains
- **Assets Operations**: Check balances and transfer tokens  
- **Cross-chain Transfers**: XCM transfers between parachains and relaychains 
- **LangChain Integration**: Ready-to-use tools for AI agents

## Quick Start

### Basic Usage

```typescript
import { PolkadotAgentKit, getLangChainTools } from '@polkadot-agent-kit/sdk'
import { getLangChainTools } from '@polkadot-agent-kit/sdk'

// Initialize PolkadotAgentKit
const agent = new PolkadotAgentKit({privateKey:'your private key', keyType: 'Sr25519', chains: ['polkadot','west', 'west_asset_hub'] });
await agent.initializeApi()

// Optional: Add your custom tool

agent.addCustomTools([yourTool]);

// Get LangChain tools
const tools = getLangChainTools(agent)

// Create LangChain agent - OpenAI, Ollama, ...

```

## Supported Chains

### Relay Chains

| Chain Name | Chain ID | Network |
|------------|----------|---------|
| Polkadot | `polkadot` | Mainnet |
| Kusama | `kusama` | Mainnet |
| Westend | `west` | Testnet |
| Paseo | `paseo` | Testnet |

### Parachains

| Chain Name | Chain ID | Network |
|------------|----------|---------|
| Polkadot Asset Hub | `polkadot_asset_hub` | Mainnet |
| Kusama Asset Hub | `kusama_asset_hub` | Mainnet |
| HydraDX | `hydra` | Mainnet |
| Westend Asset Hub | `west_asset_hub` | Testnet |
| Paseo Asset Hub | `paseo_asset_hub` | Testnet |
| Bifrost | `bifrost_polkadot` | Mainnet |
> **Note:** More chains are supported. See the [chain configuration](packages/common/src/chains/supportedChains.ts) for the complete list.


### LangChain Tools

The `getLangChainTools()` function provides multiple ready-to-use LangChain tools for AI agents


## License

Published under [MIT License](https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/LICENSE).

---

Made with 💛 by [Elastic Labs](https://elasticlabs.org/)
npm package: @polkadot-api/ledger-signer
Description: Ledger libraries require `Buffer` global to exist in scope. If you are on a NodeJS (or Bun) environment you are good to go. If you are on a browser environment, make sure your bundler exposes it or polyfill it yourself with [`buffer` package](https://www.
Author: Carlo Sala
Latest version: 0.3.0
npm package: @polkadot-api/merkleize-metadata
Description: This TS package provides utils for the merkleization of [`frame_metadata`](https://docs.rs/frame-metadata/latest/frame_metadata/) as described in [RFC78](https://polkadot-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html).
Author: Carlo Sala
Latest version: 1.2.0
npm package: @polkadot-api/wasm-executor
Description: This package has been strongly influenced by [Chopsticks](https://github.com/AcalaNetwork/chopsticks). It can be used in both web and NodeJS environments.
Author: Carlo Sala
Latest version: 0.2.3

# @polkadot-api/wasm-executor

This package has been strongly influenced by [Chopsticks](https://github.com/AcalaNetwork/chopsticks).
It can be used in both web and NodeJS environments.

At this point, it just exports a `getMetadataFromRuntime` function that runs WASM under the hood, and returns its metadata in `string`.

## Examples

### Web

```ts
// IMPORTANT to prefix it with `0x`!
const runtime = "0x" + fs.readFileSync("runtime.wasm").toString("hex");

// returns a `0x` prefixed OpaqueMetadata. It's as well prefixed by a compactInt of its length
const metadata = await import("@polkadot-api/wasm-executor/web").then(
  async ({ default: init, getMetadataFromRuntime }) => {
    await init();
    return getMetadataFromRuntime(runtime);
  },
);
```

### Node

```ts
import { getMetadataFromRuntime } from "@polkadot-api/wasm-executor/node";

// IMPORTANT to prefix it with `0x`!
const runtime = "0x" + fs.readFileSync("runtime.wasm").toString("hex");

// returns a `0x` prefixed OpaqueMetadata. It's as well prefixed by a compactInt of its length
const metadata = getMetadataFromRuntime(runtime);
```