npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@monad-agent-kit/core

v0.1.2

Published

Core package for Monad Agent Kit - AI agent SDK for Monad blockchain

Readme

@monad-agent-kit/core

Core SDK for building AI agents that interact with the Monad blockchain.

Installation

bun add @monad-agent-kit/core
# or
npm install @monad-agent-kit/core

Quick Start

import { MonadAgentKit } from "@monad-agent-kit/core"

const agent = new MonadAgentKit({
  privateKey: "0x...",
  chainId: 10143, // Monad Testnet
})

// Execute a built-in action
const result = await agent.execute("readContract", {
  address: "0x...",
  abi: [{ type: "function", name: "balanceOf", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }], stateMutability: "view" }],
  functionName: "balanceOf",
  args: ["0x..."],
})

Wallet Providers

The SDK supports three wallet sources:

// 1. Private key (sync)
const agent = new MonadAgentKit({ privateKey: "0x..." })

// 2. Pre-configured viem Account (sync)
import { privateKeyToAccount } from "viem/accounts"
const account = privateKeyToAccount("0x...")
const agent = new MonadAgentKit({ account })

// 3. EIP-1193 provider like MetaMask, WalletConnect, Privy (async)
const agent = await MonadAgentKit.create({ provider: window.ethereum })

Plugin System

Register plugins to extend the agent with domain-specific actions:

import { tokenPlugin } from "@monad-agent-kit/plugin-token"
import { defiPlugin } from "@monad-agent-kit/plugin-defi"

await agent.use(tokenPlugin)
await agent.use(defiPlugin)

// All plugin actions are now available via agent.execute()
await agent.execute("transfer", { to: "0x...", amount: "1.0" })
await agent.execute("swap", { tokenIn: "0x...", tokenOut: "0x...", amountIn: "1.0" })

Built-in Actions

These are auto-registered — no plugin needed:

| Action | Description | |--------|-------------| | readContract | Call any read-only contract function | | writeContract | Execute any state-changing contract function | | subscribeEvents | Subscribe to on-chain events by address/signature | | getEventLog | Retrieve captured events from a subscription | | unsubscribeEvents | Stop watching and remove a subscription |

Name Resolution

Built-in resolvers for ENS (.eth) and Mon Name Service (.mon):

import { MonadAgentKit, CompositeNameResolver, MnsNameResolver, EnsNameResolver } from "@monad-agent-kit/core"

const agent = new MonadAgentKit({
  privateKey: "0x...",
  nameResolver: new CompositeNameResolver([
    new MnsNameResolver(publicClient),
    new EnsNameResolver(),
  ]),
})

// Names are resolved automatically in actions that accept addresses
await agent.execute("transfer", { to: "alice.mon", amount: "1.0" })

Safety Rails

Constrain agent behavior with spending limits, action scoping, and approval gates:

const agent = new MonadAgentKit({
  privateKey: "0x...",
  safety: {
    allowedActions: ["transfer", "getBalance", "getQuote"],
    spendingLimits: {
      perAction: "10",  // max 10 MON per action
      daily: "100",     // max 100 MON per day
    },
    addressWhitelist: ["0xabc...", "0xdef..."],
    approvalHandler: async (request) => {
      // Custom approval logic (e.g., human-in-the-loop)
      return confirm(`Approve ${request.action}?`)
    },
  },
})

Transaction Logging

Every action execution is automatically logged:

// Access the tx log
const entries = await agent.txLog.query({ action: "transfer", limit: 10 })
const stats = await agent.txLog.count()

// Use a custom store (default: InMemoryTxLogStore)
import { InMemoryTxLogStore } from "@monad-agent-kit/core"
const agent = new MonadAgentKit({
  privateKey: "0x...",
  txLog: new InMemoryTxLogStore({ maxEntries: 5000 }),
})

Event Monitoring

Subscribe to on-chain events with polling-based monitoring:

const agent = new MonadAgentKit({
  privateKey: "0x...",
  events: { pollingInterval: 2000, maxEventsPerSubscription: 1000 },
})

const result = await agent.execute("subscribeEvents", {
  address: "0x...",
  event: "Transfer(address,address,uint256)",
})

// Later, retrieve captured events
const events = await agent.execute("getEventLog", {
  subscriptionId: result.data.subscriptionId,
})

// Clean up
agent.destroy()

Utilities

import {
  normalizeAddress,
  getTokenDecimals,
  isNativeToken,
  getExplorerTxUrl,
  resolveNameOrAddress,
  MAINNET_CHAIN_ID,
  TESTNET_CHAIN_ID,
  NATIVE_TOKEN_ADDRESS,
} from "@monad-agent-kit/core"

Networks

| Network | Chain ID | Constant | |---------|----------|----------| | Mainnet | 143 | MAINNET_CHAIN_ID | | Testnet | 10143 | TESTNET_CHAIN_ID |

Creating Custom Actions

import { defineAction, successResult, errorResult } from "@monad-agent-kit/core"

const myAction = defineAction({
  name: "myAction",
  description: "Does something useful",
  category: "custom",
  parameters: {
    type: "object",
    properties: {
      param: { type: "string", description: "A parameter" },
    },
    required: ["param"],
  },
  async execute(params, context) {
    // context.publicClient - read operations
    // context.wallet - write operations
    // context.agent - agent info
    return successResult({ result: "done" })
  },
})

agent.registerAction(myAction)

Creating Custom Plugins

import { definePlugin } from "@monad-agent-kit/core"

const myPlugin = definePlugin({
  name: "my-plugin",
  actions: [actionA, actionB],
  async initialize(agent) {
    // Optional setup logic
  },
})

await agent.use(myPlugin)

License

MIT