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

lendguard-sdk

v0.3.0

Published

TypeScript SDK for the LendGuard native lending protocol on Solana — Ika dWallet collateral provenance (SOL + native Bitcoin via Secp256k1 dWallets), Encrypt FHE health monitoring, and full borrow/repay/liquidate lifecycle.

Readme

@lendguard/sdk

npm version

Framework-agnostic TypeScript SDK for the LendGuard native lending protocol on Solana — built on Ika dWallets for cryptographically-provable cross-chain collateral (SOL and native Bitcoin via Secp256k1 dWallets) and Encrypt FHE for private, anti-MEV risk monitoring.

Install

npm install @lendguard/sdk @solana/web3.js

Peer deps: @solana/web3.js >= 1.95.

What's in 0.3.0

  • SOL collateral pathbuildBorrowAgainstCollateralIx, buildRepayBorrowIx, buildLiquidatePositionIx, plus admin helpers
  • 🆕 BTC collateral path (native Bitcoin via Ika Secp256k1 dWallets) — 8 new instruction builders:
    • buildRegisterBtcVaultIx
    • buildVerifyBtcCustodyProofIx
    • buildRefreshBtcCustodyProofIx
    • buildAttestBtcBalanceIx
    • buildBorrowAgainstBtcCollateralIx
    • buildRepayBtcBorrowIx
    • buildLiquidateBtcPositionIx
    • buildFinalizeBtcLiquidationIx
  • All BTC PDA helpers: deriveBtcVaultPda, deriveBtcAttestationPda, deriveBtcBorrowPositionPda, deriveIkaCpiAuthority
  • Account decoders for LendingPool, BorrowPosition, AdminPriceFeed, ProtocolState

Quick start — borrow LGUSD against SOL collateral

import {
  buildBorrowAgainstCollateralIx,
  deriveVaultPda,
  LGUSD_MINT_DEVNET,
} from "@lendguard/sdk";
import { Connection, Transaction, PublicKey } from "@solana/web3.js";

const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const owner = wallet.publicKey;
const [vaultPda] = deriveVaultPda(owner, ikaDwalletPubkey);

const { ix } = await buildBorrowAgainstCollateralIx({
  owner,
  vaultPda,
  borrowAssetMint: LGUSD_MINT_DEVNET,
  poolTokenVault,
  borrowerTokenAccount,
  amount: 25_000_000n, // 25 LGUSD (6-decimal)
});

const sig = await connection.sendTransaction(new Transaction().add(ix), [wallet]);

Quick start — register a Bitcoin testnet vault

import {
  buildRegisterBtcVaultIx,
  buildVerifyBtcCustodyProofIx,
  deriveBtcVaultPda,
} from "@lendguard/sdk";

const { ix: registerIx, btcVaultPda } = await buildRegisterBtcVaultIx({
  owner: wallet.publicKey,
  ikaDwallet: ikaDwalletAccount,        // 32-byte Ika dWallet pubkey
  dwalletPubkey: compressedSecp256k1,   // 33 bytes
  bitcoinAddress: "tb1q...",
});

const verifyIx = await buildVerifyBtcCustodyProofIx({
  owner: wallet.publicKey,
  btcVaultPda,
  messageApprovalPda,                   // produced by Ika DKG/signing flow
});

// Combine register + verify in a single transaction.
const tx = new Transaction().add(registerIx, verifyIx);

Quick start — borrow against attested BTC

After an authorized keeper has posted a BitcoinBalanceAttestation:

import { buildBorrowAgainstBtcCollateralIx, LGUSD_MINT_DEVNET } from "@lendguard/sdk";

const { ix } = await buildBorrowAgainstBtcCollateralIx({
  owner: wallet.publicKey,
  btcVaultPda,
  borrowAssetMint: LGUSD_MINT_DEVNET,
  poolTokenVault,
  borrowerTokenAccount,
  amount: 50_000_000n, // 50 LGUSD
});

To repay everything at once (debt + accrued interest, with on-chain dust forgiveness):

import { buildRepayBtcBorrowIx } from "@lendguard/sdk";

const ix = await buildRepayBtcBorrowIx({
  /* ...accounts... */
  amount: (1n << 64n) - 1n,             // u64::MAX → repay everything
});

Devnet program IDs

| Component | Address | |---|---| | LendGuard program | LGUARDxJP9G4QH7uW2GuV5KKqPRkrCZcZ8jKqcQVUWJ | | LGUSD mint | LGUSDcMv5sH6KEqMW9P5GE52f72NgaT9CrLuFA3JTH4 | | Ika dWallet program | 87W54kGYFQ1rgWqMeu4XTPHWXWmXSQCcjm8vCTfiq1oY |

Project links