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

@asentum/sdk

v0.1.0

Published

TypeScript SDK for building on Asentum. Chain reads, wallet management, contract deployment and interaction. Works in Node.js and browsers.

Downloads

161

Readme

@asentum/sdk

TypeScript SDK for building on Asentum. Three classes, one import, works in Node.js and browsers.

npm install @asentum/sdk

Quick start

import { AsentumClient, AsentumWallet } from '@asentum/sdk';

const client = new AsentumClient('https://testnet.asentum.com');
const wallet = AsentumWallet.create(client);

// Fund from the testnet faucet
await wallet.requestFaucet();

// Check balance
const balance = await wallet.getBalance();
console.log(balance); // 100000000000000000000n (100 ASE)

// Send ASE
const tx = await wallet.sendTransfer({
  to: '0x1111111111111111111111111111111111111111',
  amount: '10',
});
const receipt = await tx.wait();
console.log('confirmed in block', receipt.blockNumber);

Deploy and interact with a contract

// Deploy
const contract = await wallet.deploy(`
  function init() {
    storage.set('greeting', 'hello world');
    emit('Init', { sender: msg.sender });
  }

  function getGreeting() {
    return storage.get('greeting');
  }

  function setGreeting(value) {
    storage.set('greeting', value);
    emit('Updated', { value });
  }
`);
console.log('contract:', contract.address);

// Initialize
const initTx = await contract.send('init');
await initTx.wait();

// Read (free, no tx)
const greeting = await contract.view('getGreeting');
console.log(greeting); // "hello world"

// Write (sends a tx)
const setTx = await contract.send('setGreeting', ['gm asentum']);
await setTx.wait();

console.log(await contract.view('getGreeting')); // "gm asentum"

API

AsentumClient

Read-only interface to the chain. No keys, no signing: just reads.

const client = new AsentumClient('https://testnet.asentum.com');

await client.getBlockNumber();           // number
await client.getChainId();               // bigint
await client.getBlock(42);               // Block | null
await client.getBalance('0x...');        // { address, balance, nonce }
await client.getNonce('0x...');          // bigint
await client.getReceipt('0xabc...');     // Receipt | null
await client.getCode('0x...');           // hex string
await client.getContractSource('0x...');  // JS source string | null
await client.viewCall('0x...', 'name');  // ViewCallResult
await client.getValidators();            // { count, validators[] }
await client.getMetadata();              // EIP-3085 metadata
await client.isHealthy();                // boolean
await client.faucet('0x...');            // TxResult (testnet only)

AsentumWallet

A client + Dilithium3 keypair. Can sign and submit transactions.

// Create random
const wallet = AsentumWallet.create(client);

// From seed (deterministic)
const wallet2 = AsentumWallet.fromSeed(client, seed32bytes);

// From exported keys
const wallet3 = AsentumWallet.fromSecretKey(client, '0xsk...', '0xpk...');

wallet.address;        // '0x...' checksummed
wallet.secretKeyHex;   // for backup
wallet.publicKeyHex;

await wallet.getBalance();     // bigint (wei)
await wallet.getNonce();       // bigint
await wallet.requestFaucet();  // TxResult

// Send transfer
const tx = await wallet.sendTransfer({ to: '0x...', amount: '1.5' });
const receipt = await tx.wait();

// Deploy contract
const contract = await wallet.deploy('function init() { ... }');

// Call contract (write)
const tx2 = await wallet.sendCall({
  to: '0x...',
  method: 'transfer',
  args: ['0xbob...', '100'],
});

AsentumContract

A deployed contract with view + send helpers.

// From a deploy
const contract = await wallet.deploy(source);

// Or wrap an existing address
import { AsentumContract } from '@asentum/sdk';
const contract = new AsentumContract(client, '0xcontract...');

// Read (free)
const result = await contract.view('balanceOf', ['0x...']);

// Read with full result (includes gas + events)
const full = await contract.viewFull('balanceOf', ['0x...']);

// Write (needs wallet)
const tx = await contract.send('transfer', ['0x...', '100']);
await tx.wait();

// Attach a wallet for future send() calls
const signed = contract.connect(wallet);
await signed.send('transfer', ['0x...', '50']);

// Get source code
const source = await contract.getSource();

// Wait for deploy confirmation
await contract.waitForDeploy();

Helpers

import { parseAse, formatAse } from '@asentum/sdk';

parseAse('1');      // 1000000000000000000n (1 ASE in wei)
parseAse('0.5');    // 500000000000000000n
parseAse(100n);     // 100n (already wei)

formatAse(1500000000000000000n);  // "1.5"
formatAse('1000000000000000000'); // "1"

How it works

The SDK wraps the node's HTTP RPC endpoints:

| SDK method | RPC endpoint | |------------|-------------| | getBlock(n) | GET /block/{n} | | getBalance(addr) | GET /balance/{addr} | | viewCall(addr, method, args) | POST /view | | sendTransfer/sendCall/deploy | POST /tx (signed SSZ bytes) | | getCode(addr) | POST / eth_getCode (JSON-RPC) | | faucet(addr) | POST /dev/faucet |

Transactions are built via SSZ schemas from @asentum/types, hashed with BLAKE3, signed with Dilithium3 from @asentum/crypto, and submitted as hex-encoded wire bytes. The entire signing pipeline runs locally: private keys never leave your process.

Requirements

  • Node.js 22+ or any modern browser with fetch and crypto.getRandomValues
  • An Asentum RPC endpoint (the public testnet is at https://testnet.asentum.com)

License

Apache-2.0