Build on Asentum
SDK & CLI
Reference summary · Estimated read time: 8 minutes
Updated 2026-09-09: native addresses in SDK examples are ase1 bech32.
The CLI
@asentum/cli is the canonical command-line tool for working with Asentum. Install it as a one-shot via npx, or globally:
curl -fsSL https://testnet.asentum.com/install | sh
asentum --helpTop-level commands:
asentum init- initialize a local node data directory and configure peersasentum start- boot the local node (service mode by default)asentum wallet- create, import, list, and manage local walletsasentum tx- send transactions, query balances, watch for confirmationsasentum contract- deploy contracts, call methods, read stateasentum validator- validator key management, bonding, profile, monitoringasentum delegate- delegate ASE to a validator, claim rewards, undelegateasentum test- run a local in-memory chain and execute test suites against it
Run asentum <command> --help for the full reference for any subcommand.
The SDK
@asentum/sdk is the JavaScript/TypeScript client for talking to Asentum from your application code:
import { Chain, Wallet, Contract, Delegation } from '@asentum/sdk';
// Connect
const chain = new Chain({ rpc: 'https://testnet.asentum.com' });
// Wallet
const wallet = await Wallet.fromKeystore('./my-key.json');
// Read state
const balance = await chain.getBalance(wallet.address);
const block = await chain.getBlockNumber();
// Send a transaction
const tx = await chain.sendTransaction({
from: wallet.address,
to: 'ase1...',
value: 10n * 10n ** 18n,
signer: wallet,
});
// Interact with a contract
const contract = await chain.contract('ase1...');
const result = await contract.someMethod(arg1, arg2, { signer: wallet });
// Delegate
await Delegation.delegate({
delegator: wallet.address,
validator: 'ase1...',
amount: 1000n * 10n ** 18n,
signer: wallet,
});The SDK is a thin layer over JSON-RPC that handles ML-DSA-65 signing, address checksumming, and Asentum-specific features (transaction bundles, delegation, etc.) transparently.
Testing framework
@asentum/testing provides a local in-memory chain you can run unit tests against. The test harness gives you:
- Snapshot & revert - wrap each test in a state snapshot and revert after
- Time control - advance the block clock manually for time-sensitive tests
- Pre-funded mock accounts - every test gets fresh wallets with testnet ASE
- Deterministic execution - same input, same output, every run
Tests run with Jest or Mocha - your existing test infrastructure works as-is.
Real-time subscriptions
For dApps that need real-time updates (incoming transactions, contract events, validator state changes), the SDK exposes WebSocket subscriptions:
const sub = chain.subscribe({
type: 'logs',
contract: 'ase1...',
event: 'Transfer',
});
for await (const event of sub) {
console.log('New transfer:', event);
}Raw JSON-RPC
If you need to drop below the SDK abstraction, the chain exposes JSON-RPC directly. The supported subset is documented in Connect a Wallet.
Most existing Ethereum tools (ethers.js, viem, web3.js, Hardhat-style task runners) work over the same interface with thin shims. See the integration examples in those sections.
Read next