Required Dependencies and Peer Dependencies for Osmosis Agent Toolkit Core
The @osmosis-agent-toolkit/core package requires eighteen runtime dependencies including CosmJS libraries, cryptographic utilities, and Osmosis SDKs, but declares zero peer dependencies, making it fully self-contained.
The jonator/osmosis-agent-toolkit repository provides a TypeScript toolkit for building Osmosis blockchain agents. Understanding the required dependencies and peer dependencies is essential for integration, dependency conflict resolution, and bundle size optimization when deploying agents in production environments.
Core Package Dependencies Overview
The dependency manifest for @osmosis-agent-toolkit/core is defined in packages/core/package.json. The package maintains a comprehensive set of runtime dependencies required for blockchain interaction, cryptographic operations, and data validation. Notably, the package does not declare any peerDependencies, indicating it bundles all necessary libraries and does not require the consuming project to install specific versions of external packages.
Complete Dependency List for @osmosis-agent-toolkit/core
The following table details all required dependencies, their semantic versions, and their functional roles within the toolkit:
| Dependency | Version | Purpose |
|---|---|---|
@cosmjs/amino |
0.33.0 | Amino encoding and decoding utilities for Cosmos SDK messages |
@cosmjs/cosmwasm-stargate |
0.33.0 | CosmWasm smart contract support via Stargate clients |
@cosmjs/crypto |
0.33.0 | Cryptographic primitives including hashes and digital signatures |
@cosmjs/proto-signing |
0.33.0 | Protocol buffer message signing helpers |
@cosmjs/stargate |
0.33.0 | General Stargate client for Cosmos SDK blockchain queries and transactions |
@cosmjs/tendermint-rpc |
0.33.0 | Tendermint RPC client for low-level blockchain communication |
@noble/hashes |
^1.4.0 | Secure, audited hash functions for cryptographic operations |
@scure/base |
^1.1.7 | Base encoding and decoding utilities (base64, base58, bech32) |
@scure/bip32 |
^1.4.0 | BIP-32 hierarchical deterministic key derivation |
@scure/bip39 |
^1.3.0 | BIP-39 mnemonic phrase generation and validation |
chain-registry |
^1.69.106 | Registry of Cosmos-based chain metadata and asset lists |
fuse.js |
^7.1.0 | Lightweight fuzzy-search library for token and chain lookups |
lru-cache |
^11.0.2 | Least-Recently-Used cache implementation for performance optimization |
osmojs |
^16.14.0 | Osmosis-specific JavaScript SDK for DEX operations |
zod |
^3.24.2 | Type-safe schema validation for runtime data integrity |
Peer Dependencies Status
The @osmosis-agent-toolkit/core package does not declare any peer dependencies. This architectural decision means:
- The package is fully self-contained and bundles all necessary runtime libraries
- Consuming projects do not need to install specific versions of
@cosmjs/*or other blockchain libraries separately - There is no risk of version conflicts between the toolkit's dependencies and the host project's dependencies
- Installation requires only the core package itself:
bun install @osmosis-agent-toolkit/coreor equivalent npm/yarn/pnpm commands
How Dependencies Are Used in the Source Code
The declared dependencies power specific functionality across the core package's modules:
CosmJS Ecosystem Integration
The suite of @cosmjs/* packages at version 0.33.0 provides the foundational blockchain infrastructure. In packages/core/src/toolkit.ts, the OsmosisAgentToolkit class initializes Stargate clients using @cosmjs/stargate and @cosmjs/cosmwasm-stargate for interacting with Osmosis chain nodes and CosmWasm contracts. The @cosmjs/amino and @cosmjs/proto-signing packages handle transaction signing workflows, while @cosmjs/tendermint-rpc enables low-level RPC communication.
Cryptographic Operations
The @noble/hashes and @scure/* libraries provide audited, secure cryptographic primitives. These are utilized throughout the account management system for mnemonic generation (@scure/bip39), hierarchical deterministic key derivation (@scure/bip32), and base encoding operations (@scure/base). The @noble/hashes package supplies hash functions used in address generation and transaction hashing.
Osmosis-Specific Functionality
The osmojs package (version ^16.14.0) provides Osmosis-specific protobuf definitions and client helpers. In packages/core/src/tools/swap.ts, this SDK powers the swap quote and transaction construction tools, enabling precise DEX operations on the Osmosis network.
Validation and Utilities
The zod library (version ^3.24.2) enforces runtime type safety. In packages/core/src/queries/sqs/router.ts, Zod schemas validate SQS (Smart Query Service) router responses, ensuring data integrity when processing swap quotes and routing information. The fuse.js library enables fuzzy search capabilities for token discovery, while lru-cache optimizes performance by caching frequently accessed chain data. The chain-registry package provides up-to-date metadata for Cosmos chains and assets.
Installation and Usage Example
To install the core package in your project:
# Using bun (as used in the monorepo)
bun install @osmosis-agent-toolkit/core
# Using npm
npm install @osmosis-agent-toolkit/core
# Using yarn
yarn add @osmosis-agent-toolkit/core
Since the package includes all required dependencies and no peer dependencies, no additional libraries are necessary.
Basic Implementation
import { OsmosisAgentToolkit } from '@osmosis-agent-toolkit/core';
// Initialise with a mnemonic (use secure secret management in production)
const toolkit = new OsmosisAgentToolkit('your twelve word mnemonic');
// Access account functionality
const account = toolkit.account;
console.log('Address:', await account.getAddress());
// Query swap quotes
const quote = await toolkit.swapQuoteInGivenOutTool.getQuote({
tokenIn: 'uosmo',
tokenOut: 'ibc/ABC123',
amountIn: '1000000', // 1 OSMO in micro units
});
console.log('Estimated output:', quote.amountOut);
This example demonstrates that all blockchain interaction capabilities—account management, swap quotes, and transaction signing—are available immediately after installing the single core package.
Summary
- The
@osmosis-agent-toolkit/corepackage declares 18 runtime dependencies including the full CosmJS ecosystem (v0.33.0), cryptographic libraries from Noble and Scure, and the Osmosis JavaScript SDK. - No peer dependencies are required, making the package self-contained and eliminating version conflict risks with host projects.
- Dependencies power specific functions:
@cosmjs/*for blockchain clients,@scure/bip39and@noble/hashesfor cryptography,osmojsfor DEX operations, andzodfor runtime validation. - Installation requires only the core package itself—no additional blockchain libraries need to be manually installed by consumers.
Frequently Asked Questions
Does @osmosis-agent-toolkit/core require any peer dependencies?
No. The package does not declare any peerDependencies in its package.json. This design choice ensures that all necessary libraries are bundled as direct dependencies, preventing version conflicts and simplifying installation to a single package command without requiring consumers to manage specific versions of CosmJS or other blockchain libraries.
What version of CosmJS does the core package use?
The core package pins all @cosmjs/* dependencies to version 0.33.0. This includes @cosmjs/stargate, @cosmjs/cosmwasm-stargate, @cosmjs/proto-signing, and related packages that provide the foundational blockchain client infrastructure for interacting with Osmosis and other Cosmos SDK chains.
Do I need to install osmojs separately when using the core package?
No. The osmojs package (version ^16.14.0) is listed as a required dependency in packages/core/package.json. It is automatically installed when you add @osmosis-agent-toolkit/core to your project, providing the Osmosis-specific protobuf definitions and DEX functionality without requiring separate installation.
Which cryptographic libraries does the toolkit depend on?
The toolkit relies on @noble/hashes for secure hash functions and the @scure/ family of packages—including @scure/base, @scure/bip32, and @scure/bip39—for base encoding, hierarchical deterministic key derivation, and mnemonic handling. These are audited cryptographic primitives used throughout the account management system in packages/core/src/toolkit.ts and related modules.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →