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

@yelay-lite/yva-sdk

v0.1.3

Published

TypeScript SDK for YVA (yelay vault on avalanche)

Downloads

9

Readme

YVA SDK

TypeScript SDK for YVA (Yelay Vault on Avalanche) - A DeFi vault protocol on the Avalanche network.

Overview

The YVA SDK provides a simple and intuitive interface to interact with the Avalanche Fusion protocol, allowing developers to integrate vault operations, user management, and analytics into their applications.

Installation

npm install @yelay-lite/yva-sdk
# or
pnpm add @yelay-lite/yva-sdk
# or
yarn add @yelay-lite/yva-sdk

Quick Start

Basic Setup

import { YvaSDK } from "@yelay-lite/yva-sdk";
import { ethers } from "ethers";

const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const sdk = new YvaSDK(provider, signer);

Environment Configuration

The SDK supports two environments:

  • mainnet: Production Avalanche network
  • testnet: Avalanche testnet (Fuji)
// Mainnet (default)
const mainnetSDK = new YvaSDK(provider, signer, "mainnet");

// Testnet
const testnetSDK = new YvaSDK(provider, signer, "testnet");

API Reference

Vault Operations

Deposit AVAX

// Deposit 1 AVAX to the vault
const amount = BigInt(1e18); // 1 AVAX in wei
const txReceipt = await sdk.vault.deposit(amount);
console.log("Deposit transaction:", txReceipt.transactionHash);

Redeem AVAX

// Redeem 1 AVAX from the vault
const amount = BigInt(1e18); // 1 AVAX in wei
const txReceipt = await sdk.vault.redeem(amount);
console.log("Redeem transaction:", txReceipt.transactionHash);

Get Staking Information

// Get comprehensive staking information including APY
const stakingInfo = await sdk.vault.stakingInfo();
console.log("Total Staked:", stakingInfo.totalStaked);
console.log("Last Round APY:", stakingInfo.lastRoundAPY);
console.log("Next Round Start:", new Date(stakingInfo.nextRoundStart));

User Analytics

Get Top Stakers

// Get top 10 stakers (default)
const topStakers = await sdk.users.topStakers();
console.log("Top stakers:", topStakers);

// Get top 5 stakers
const top5 = await sdk.users.topStakers(5);
console.log("Top 5 stakers:", top5);

// Each staker object contains:
// {
//   vault: string,
//   userId: string,
//   round: number,
//   position: string
// }

Get User Information

// Get current user's information (requires connected wallet)
const user = await sdk.users.getUser();
console.log("User address:", user.userAddress);

Response Structure:

The getUser() method returns different data based on the user's current state:

  1. New user (no deposits): {userAddress: string}
  2. Active staker: {userAddress: string, position: string}
  3. User with pending transactions: {userAddress: string, pending: {deposit: string, redeem: string}}
  4. Active staker with pending transactions: {userAddress: string, position: string, pending: {deposit: string, redeem: string}}

Note: The method automatically uses the connected wallet's address. A signer must be provided when initializing the SDK.

Requirements

  • Node.js 16+
  • ethers.js v5
  • TypeScript 5.4+ (for development)

Development

# Install dependencies
pnpm install

# Build the SDK
pnpm run build

# Run linting
pnpm run lint

Support

For questions and support, please visit our GitHub repository or contact the Yelay team.


Disclaimer: This SDK is for interacting with the Avalanche Fusion protocol. Please ensure you understand the risks involved with DeFi protocols before using this software.