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

@tortoise-os/core

v0.2.0

Published

Core utilities and types for TortoiseOS

Downloads

14

Readme

@tortoise-os/core 🐢⚙️

Core utilities and types for TortoiseOS - The foundation of your Sui DeFi journey

📦 Installation

# bun (recommended)
bun add @tortoise-os/core

# npm
npm install @tortoise-os/core

🎯 What's Included

This package provides the foundational utilities, constants, and types used across all TortoiseOS packages.

Constants

  • Network configurations - Sui network endpoints (localnet, devnet, testnet, mainnet)
  • Protocol constants - Default values, gas limits, timeouts
  • Type identifiers - Common Sui Move type strings

Logger

Structured logging utility with customizable log levels:

import { logger } from '@tortoise-os/core';

logger.info('Connecting to Sui network', { network: 'devnet' });
logger.error('Transaction failed', { digest: '0x...' });
logger.debug('Debug information', { data: {...} });

Types

Common TypeScript types for Sui development:

import type { Network, SuiAddress, ObjectId } from '@tortoise-os/core';

const network: Network = 'devnet';
const walletAddress: SuiAddress = '0x...';
const nftId: ObjectId = '0x...';

Utilities

Helper functions for common operations:

import { formatAddress, isValidAddress, parseAmount } from '@tortoise-os/core';

// Shorten wallet addresses for display
const short = formatAddress('0x1234567890abcdef...');
// → '0x1234...cdef'

// Validate Sui addresses
if (isValidAddress(address)) {
  // Safe to use
}

// Parse token amounts with decimals
const amount = parseAmount('1.5', 9); // SUI has 9 decimals
// → 1500000000

📚 API Reference

Constants

export const NETWORKS = {
  LOCALNET: 'http://localhost:9000',
  DEVNET: 'https://fullnode.devnet.sui.io',
  TESTNET: 'https://fullnode.testnet.sui.io',
  MAINNET: 'https://fullnode.mainnet.sui.io',
};

export const DEFAULT_GAS_BUDGET = 10_000_000; // 0.01 SUI
export const MAX_GAS_BUDGET = 1_000_000_000; // 1 SUI

Logger

interface Logger {
  info(message: string, meta?: Record<string, any>): void;
  error(message: string, meta?: Record<string, any>): void;
  warn(message: string, meta?: Record<string, any>): void;
  debug(message: string, meta?: Record<string, any>): void;
}

Types

type Network = 'localnet' | 'devnet' | 'testnet' | 'mainnet';
type SuiAddress = `0x${string}`;
type ObjectId = `0x${string}`;
type TransactionDigest = string;

Utilities

// Format addresses for display
function formatAddress(address: string, length?: number): string;

// Validate Sui address format
function isValidAddress(address: string): boolean;

// Parse amounts with decimal places
function parseAmount(amount: string, decimals: number): bigint;

// Format amounts for display
function formatAmount(amount: bigint, decimals: number): string;

🏗️ Usage in Other Packages

This package is used as the foundation for all other TortoiseOS packages:

// In @tortoise-os/sdk
import { NETWORKS, logger } from '@tortoise-os/core';

// In @tortoise-os/hooks
import type { Network, SuiAddress } from '@tortoise-os/core';

// In @tortoise-os/components
import { formatAddress } from '@tortoise-os/core';

🔧 Development

# Run tests
bun test

# Lint code
bun run lint

# Format code
bun run format

🤝 Contributing

This is a core package - changes here affect the entire ecosystem. Please:

  • Write tests for new utilities
  • Update types carefully (breaking changes affect all packages)
  • Keep the bundle size small
  • Document all exports

📄 License

MIT © TortoiseOS Team

🔗 Links


Part of the TortoiseOS ecosystem 🐢

Built with Bun, optimized for Sui.