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

@umbra-labs-llc/lendr-client

v1.2.0

Published

> This example uses @solana/web3.js version 1.91.8

Downloads

381

Readme

lendr-client: A TypeScript SDK

Getting Started

Step 1: Initialize the lendr client

This example uses @solana/web3.js version 1.91.8

In order to interact with the lendr SDK, we must first configure the lendr client object using the LendrClient instance:

import { Connection } from "@solana/web3.js";
import { LendrClient, getConfig } from 'lendr-client';
import { NodeWallet } from "./src/common";

const connection = new Connection(CLUSTER_CONNECTION, "confirmed");
const wallet = new NodeWallet(KEYPAIR);
const config = getConfig();
const client = await LendrClient.fetch({ config, wallet, connection });
  • connection establishes a connection to a Solana cluster
  • wallet creates an Anchor-compliant Node.js wallet from your local Solana keypair
  • config returns a configuration object specific to the specified environment (e.g. “production”, “development”)
  • client is a high-level SDK for interacting with the Lendr protocol

Step 2: Create an Account

Accounts on lendr are the entry point for interacting with the protocol, allowing users to deposit assets, take out loans, and manage their positions. Using the lendr SDK, you can create an account with one line of code. With this ability, you can enable seamless user onboarding by creating dedicated accounts for each new user.

const lendrAccount = await client.createLendrAccount();

Step 3: Fetch a Bank

In order to interact with asset pools, or “banks,” on Lendr, you must first fetch the specific bank you want to borrow/lend from:

const bankLabel = "SOL";
const bank = client.getBankByTokenSymbol(bankLabel);
if (!bank) throw Error(`${bankLabel} bank not found`);
  • bankLabel holds the symbol for the bank that you will fetch. Note that you can also query banks by the token mint address (using getBankByMint) or by the bank address (using getBankByPk).
  • bank1 fetches the specified bank using getBankByTokenSymbol, using the bank’s token symbol “SOL” as the query parameter.

Step 4: Make a Deposit

Once you’ve fetched the bank you want to interact with, you can make a deposit:

await lendrAccount.deposit(1, bank.address);

The deposit method on the lendr account object allows you to make a deposit into the specified bank account using the bank's address as a parameter (second parameter). Note that the first parameter let’s you specify how much (in the denominated asset) you want to deposit into the bank.

Step 5: Borrow From a Bank

After lending liquidity on lendr, your account is eligible to act as a Borrower. You can borrow liquidity from lendr banks using one line of code:

await lendrAccount.borrow(1, bank.address);

The structure of the borrow method is identical to the deposit method. You specify the amount you want to borrow using the first parameter, and you specify which bank you want to interact with using the second parameter.

if you followed along with these steps, you just went through the full lending-and-borrowing lifecycle on lendr. To execute your node, simply run ts-node <file-path> in your terminal. Your code should look like this:

import { Connection } from "@solana/web3.js";
import { LendrClient, getConfig } from 'lendr-client';
import { NodeWallet } from "./src/common";

const CLUSTER_CONNECTION = <your-rpc-url>;

const main = async () => {
	const connection = new Connection(CLUSTER_CONNECTION, "confirmed");
	const wallet = new NodeWallet(KEYPAIR);
	const config = getConfig();
	const client = await LendrClient.fetch({ config, wallet, connection }); // initialize client

    const lendrAccount = await client.createLendrAccount(); // create an account
	
	const bankLabel = "SOL";
	const bank = client.getBankByTokenSymbol(bankLabel);
	if (!bank) throw Error(`${bankLabel} bank not found`); // fetch a bank
	
	await lendrAccount.deposit(1, bank.address); // make a deposit
	await lendrAccount.borrow(1, bank.address); // borrow from a bank
};

main();

You’re now have an active position! For more details on the lendr SDK and use cases, refer to the examples and sections below.


Overriding LendrClient's Config

You can override LendrClient's config either by passing an optional overrides object to getConfig():

import {PublicKey} from "@solana/web3.js";

const config = getConfig({
	overrides: {
		groupPk: new PublicKey("..."),
	},
});
const client = await LendrClient.fetch({ config, wallet: {} as Wallet, connection });

Or using these environment variables:

  • LENDR_GROUP_PK
  • LENDR_PROGRAM_ID
  • LENDR_CLUSTER_OVERRIDE