Skip to content

PufferFinance/puffer-sdk

Repository files navigation

Puffer SDK

build license npm downloads npm version

SDK to seamlessly interact with puffer smart contracts

Usage

Install the package.

npm install @pufferfinance/puffer-sdk

Example code to check pufETH balance.

import {
  PufferClientHelpers,
  PufferClient,
  Chain,
} from '@pufferfinance/puffer-sdk';

const walletClient = PufferClientHelpers.createWalletClient({
  chain: Chain.Holesky,
  provider: window.ethereum,
});
const pufferClient = new PufferClient(Chain.Holesky, walletClient);
const [walletAddress] = await pufferClient.requestAddresses();

const balance = await pufferClient.vault.balanceOf(walletAddress);

Features

  • Interact with puffer smart contracts.
  • Deposit ETH to mint pufETH.
  • Deposit stETH to mint pufETH.
  • Check pufETH balance.
  • Get the latest rate of pufETH compared to ETH.
  • and much more.

Documentation

Check the documentation website for detailed documentation and guides.

Development

Install dependencies.

pnpm install

Start the package in watch mode.

pnpm dev

Setup linking so the package can be linked to other projects locally.

pnpm link --global

To link the package to a local project, run the following command.

pnpm link --global @pufferfinance/puffer-sdk

Release

The release is automated using release-it and the publish.yml GitHub action. The action can be dispatched manually to make the release.