SDK & Developer Tools
Neutron provides a comprehensive suite of SDKs and developer tools to make building on the platform as seamless as possible. This page outlines the core libraries and resources available to developers.
Official SDK Libraries
The official Rust/CosmWasm SDK for interacting with Neutron blockchain features.
Language: Rust
Standard library of Rust types and functions for Neutron chain development.
Language: Rust
JavaScript library for interacting with Neutron chain, built on CosmJS.
Language: TypeScript
Neutron SDK (Rust)
The Neutron SDK provides Rust libraries for building smart contracts that interface with Neutron's specialized modules.
Example Contracts
The SDK repository includes several example contracts demonstrating Neutron's features:
Learn how to properly work with the Interchain Queries Module using the SDK
Demonstrates how to use the Interchain Transactions Module from your contracts
Shows how to handle Sudo callbacks from IBC transfers properly
Getting Started
# Clone the repository
git clone https://github.com/neutron-org/neutron-sdk.git
cd neutron-sdk
# Run tests
make test
# Generate schema
make schema
# Build for production
make build
NeutronJS (TypeScript/JavaScript)
NeutronJS provides TypeScript/JavaScript types and utilities for interacting with the Neutron chain from web applications.
Installation
npm install @neutron-org/neutronjs
Features
- TypeScript types for all Neutron modules
- Query functions for accessing chain data
- Transaction builders for Neutron-specific messages
- Integration with CosmJS for wallet connections
Example Usage
import { NeutronClient } from '@neutron-org/neutronjs';
// Create a client
const client = await NeutronClient.connect('https://rpc-neutron.keplr.app');
// Query tokens
const balances = await client.getAllBalances('neutron1...');
// Create and broadcast transactions
const msg = {
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
value: {
fromAddress: 'neutron1...',
toAddress: 'neutron1...',
amount: [{ denom: 'untrn', amount: '1000000' }]
}
};
const result = await client.signAndBroadcast([msg], fee, memo);
Boilerplates & Templates
Get started quickly with ready-to-use templates and scaffolding tools:
Complete collection of templates, boilerplates, and scaffolding tools for rapid development.
Templates • Integration Tools • Testing
Testing Tools
test-tube
test-tube is a powerful library for building testing environments for CosmWasm smart contracts. It allows you to test your contracts against the actual Cosmos SDK chain's logic, written in Go, using Rust.
Unlike cw-multi-test which simulates only basic modules, test-tube enables testing against the complete chain implementation, making it ideal for contracts that interact with custom Neutron modules.
Why Use test-tube?
If your contract interacts with Neutron's custom modules like Interchain Queries, Interchain Transactions, or the DEX module, test-tube provides more realistic testing than cw-multi-test.
Installation & Usage
See the test-tube documentation for setup instructions and examples.
Installing Development Dependencies
To develop for Neutron, you'll need the following tools:
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
rustup target add wasm32-unknown-unknown
# Install Go (required for test-tube and some tooling)
# Download from https://golang.org/dl/
# Install Node.js (for JavaScript/TypeScript development)
# Download from https://nodejs.org/