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

@ring-protocol/ringearnsdk

v0.0.10

Published

EarnSDK — unified DeFi yield aggregation for Ethereum and Solana

Readme

@ring-protocol/ringearnsdk

Unified DeFi yield aggregation SDK for Ethereum and Solana.

Install

npm install @ring-protocol/ringearnsdk viem wagmi

viem and wagmi are peer dependencies.

Quick Start

import { RingEarn } from '@ring-protocol/ringearnsdk'
import { mainnet } from 'viem/chains'
import { createPublicClient, http } from 'viem'

const ring = new RingEarn({
  chain: mainnet,
  publicClient: createPublicClient({
    chain: mainnet,
    transport: http(),
  }),
})

// Query all positions across protocols
const positions = await ring.getPositions('0x...')

// Get total yield summary
const summary = await ring.getTotalYield('0x...')

// Stake ETH via Lido
const lido = await ring.lido()
await lido.stakeEth({
  amount: 1000000000000000000n, // 1 ETH
  account: '0x...',
})

// Simulate yield for 30 days
const sim = await ring.simulate('lido-steth', 1000000000000000000n, 30)

React Hooks

npm install @ring-protocol/ringearnsdk/react
import { useYield, useStake } from '@ring-protocol/ringearnsdk/react'

function YieldCard({ config, address }) {
  const { data, isLoading, refetch } = useYield(config, address)

  if (isLoading) return <div>Loading...</div>

  return (
    <div>
      <p>Total Balance: ${data?.totalBalanceUsd}</p>
      <p>Weighted APY: {data?.weightedApy}%</p>
      <button onClick={refetch}>Refresh</button>
    </div>
  )
}

Vue Composables

npm install @ring-protocol/ringearnsdk/vue
<script setup>
import { useYield } from '@ring-protocol/ringearnsdk/vue'

const { data, isLoading, refetch } = useYield(config, address)
</script>

<template>
  <div v-if="isLoading">Loading...</div>
  <div v-else>
    <p>Total Balance: ${{ data?.totalBalanceUsd }}</p>
    <p>Weighted APY: {{ data?.weightedApy }}%</p>
    <button @click="refetch">Refresh</button>
  </div>
</template>

API

new RingEarn(config)

| Option | Type | Required | Description | |--------|------|----------|-------------| | chain | Chain | Yes | Viem chain object | | publicClient | PublicClient | Yes | Viem public client | | walletClient | WalletClient | No | Viem wallet client (for transactions) | | rpcUrl | string | No | Custom RPC URL | | cacheSize | number | No | Max cache entries (default: 100) | | cacheTtlMs | number | No | Cache TTL in ms (default: 30000) |

Core Methods

  • ring.getPositions(address) — Query all positions across protocols
  • ring.getTotalYield(address) — Get aggregated yield summary
  • ring.simulate(strategyId, amount, days) — Simulate yield projection
  • ring.compareStrategies(strategyIds, amount, days) — Compare multiple strategies
  • ring.batch(operations) — Execute multiple operations in a single transaction
  • ring.clearCache() — Clear the in-memory cache

Adapters

Adapters are lazy-loaded on first access.

  • await ring.lido() — Lido staking adapter

    • stakeEth({ amount, account, referral? })
    • unstakeStEth({ amount, account })
    • getStEthBalance(address)
    • getRewards(address)
  • await ring.morpho() — Morpho vault adapter

    • supply({ vault, assets, account })
    • withdraw({ vault, assets, account })
    • getPosition(address, vault)
    • getVaultApy(vault)

Release Workflow

This project uses Changesets for version management.

1. Create a changeset

After making changes, run:

pnpm changeset

Select the packages to bump and describe the changes.

2. Version packages

When ready to release, run:

pnpm version

This will:

  • Bump versions in package.json
  • Update CHANGELOG.md
  • Remove consumed changeset files

3. Publish

pnpm release

This runs pnpm build && changeset publish, which builds the project and then calls npm publish to publish to the npm registry.

Note on 2FA / OTP If your npm account has two-factor authentication enabled for publishing, pnpm release will fail with an EOTP error because Changesets cannot prompt for an OTP interactively.

In that case, get the 6-digit OTP code from your authenticator app and run:

pnpm build && pnpm changeset publish --otp=<your-otp-code>

Full release flow

# 1. Make changes, commit them
# 2. Create changeset
pnpm changeset

# 3. Commit the changeset
 git add .changeset/*.md && git commit -m "chore: add changeset"

# 4. When ready to release
pnpm version
 git add . && git commit -m "chore: version packages"

# 5. Publish
pnpm release

# 6. Push tags
 git push --follow-tags

License

MIT