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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@underscore-finance/sdk

v1.2.6

Published

SDK for interacting with Underscore Finance Smart Contracts with TypeScript

Readme

Underscore Smart Contracts SDK

A TypeScript SDK for interacting with Underscore's AI-driven smart contracts on Base network. Underscore enables trustless AI agents to operate on your behalf in DeFi—securely, transparently, and within boundaries you define.

Key Features

  • Non-Custodial: Retain full control of your assets; only you can transfer or withdraw funds
  • Granular Control: Define precise boundaries for AI agent operations
  • Rule-Based Autonomy: Smart contracts strictly enforce your parameters
  • Minimal Trust: Built on open-source, immutable code
  • Extensible: Add new DeFi protocol integrations without migrating funds
  • Auditability: Fully transparent, verifiable code

Installation

npm install @underscore-finance/sdk viem
# or
yarn add @underscore-finance/sdk viem

Quick Start

import Underscore from '@underscore-finance/sdk'
import { createWalletClient, custom } from 'viem'
import { base } from 'viem/chains'

// Initialize SDK = Read mode only
const underscore = new Underscore()

// For AI agent operations, initialize with a wallet client
const underscore = new Underscore({
  walletClient: createWalletClient({
    chain: base,
    transport: custom(window.ethereum),
  }),
})

// Create an AI Wallet
const createWallet = async (owner: string, aiAgent: string) => {
  return await underscore.Factory.createUserWallet(
    owner, // Your wallet address
    aiAgent, // AI agent's address
  )
}

// Configure AI permissions
const configureAgent = async (agent: string, allowedAssets: string[]) => {
  for (const asset of allowedAssets) {
    await underscore.UserWalletConfig.at('0xWalletAddress').addAssetForAgent(agent, asset)
  }
}

Core Components

AI Agent System

  • AgentFactory - Deploy and manage AI wallets
  • AgentTemplate - Access to AI agent templates
  • WalletConfig - Set AI agent permissions and rules
  • WalletFunds - Manage wallet assets
  • LegoHelper - Set of helper functions to interact with legos
  • OracleRegistry - Registry for price feeds

Protocol Integrations ("Legos")

Modular DeFi integrations your AI can interact with:

  • LegoAaveV3 - Aave V3 lending/borrowing
  • LegoCompoundV3 - Compound V3 operations
  • LegoUniswapV3 - Uniswap V3 swaps
  • LegoCurve - Curve pool interactions
  • And many more protocol integrations

Price Feed Systems

Price oracles your AI can reference:

  • ChainlinkFeeds - Chainlink oracle data
  • PythFeeds - Pyth Network feeds
  • StorkFeeds - Stork protocol data

Use Cases

  1. Autonomous Yield Farming

    • AI monitors lending rates across protocols
    • Automatically shifts funds to optimal yields
    • Operates within your risk parameters
  2. Smart Portfolio Rebalancing

    • AI maintains your desired asset ratios
    • Executes trades based on market conditions
    • Respects your defined boundaries
  3. Risk Management

    • AI monitors on-chain risk indicators
    • Automatically adjusts positions
    • Follows your pre-set safety rules

Configuration

interface UnderscoreConfig {
  rpcUrl?: string // Custom RPC URL for Base network
  publicClient?: PublicClient // Custom viem public client
  walletClient?: WalletClient // Required for transactions
}

Best Practices

  1. Always initialize with a wallet client for AI agent operations
  2. Use custom RPC URLs in production
  3. Implement comprehensive error handling
  4. Set clear boundaries for AI agent actions

Support

License

Business Source License 1.1 - This SDK is provided under a commercial license. All rights reserved. Unauthorized copying, modification, distribution, or use of this software is strictly prohibited without a valid license agreement.

Built by the team at Hightop + Ripe