Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/pufferfinance/puffer-sdk
- Owner: PufferFinance
- License: mit
- Created: 2024-05-08T12:20:04.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T15:35:10.000Z (10 days ago)
- Last Synced: 2024-11-04T15:43:26.983Z (10 days ago)
- Language: TypeScript
- Homepage: https://pufferfinance.github.io/puffer-sdk/
- Size: 1.11 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Puffer SDK
## 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.