Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pufferfinance/puffer-sdk

SDK to seamlessly interact with puffer smart contracts
https://github.com/pufferfinance/puffer-sdk

Last synced: 1 day ago
JSON representation

SDK to seamlessly interact with puffer smart contracts

Awesome Lists containing this project

README

        

Puffer SDK


build
license
npm downloads
npm version

SDK to seamlessly interact with puffer smart contracts




## Usage

Install the package.

```sh
npm install @pufferfinance/puffer-sdk
```

Example code to check pufETH balance.

```ts
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](https://pufferfinance.github.io/puffer-sdk/) for detailed documentation and guides.

## Development

Install dependencies.

```sh
pnpm install
```

Start the package in watch mode.

```sh
pnpm dev
```

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

```sh
pnpm link --global
```

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

```sh
pnpm link --global @pufferfinance/puffer-sdk
```

## Release

The release is automated using [release-it](https://github.com/release-it/release-it) and the [publish.yml](./.github/workflows/publish.yml) GitHub action. The action can be [dispatched manually](https://github.com/PufferFinance/puffer-sdk/actions/workflows/publish.yml) to make the release.