Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: enhance README with comprehensive documentation #554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 70 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,90 @@
# SDK
# Balancer SDK

[![npm version](https://img.shields.io/npm/v/@balancer/sdk/latest.svg)](https://www.npmjs.com/package/@balancer/sdk/v/latest)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

WIP SDK for Balancer Protocol. Interfaces may have frequent breaking changes until a stable release.
## Overview

## Local Setup
The Balancer SDK provides a powerful interface for interacting with the Balancer Protocol. This SDK enables developers to integrate Balancer's functionality into their applications, including pool management, trading, and liquidity provision.

`pnpm install`
> **Note**: This SDK is currently under active development. APIs may have breaking changes until we reach a stable release.

### Requirements
## Features

- `fetch`
- Pool management and queries
- Trading operations
- Liquidity provision
- Multi-chain support (Ethereum, Polygon, Fantom, Sepolia)

### Polyfill
## Installation

If your platform does not support one of the required features, it is also possible to import a polyfill.
```bash
pnpm install @balancer/sdk
```

## Prerequisites

### Required Dependencies
- `fetch` - Required for HTTP requests

### Optional Polyfills

If your platform doesn't support required features, you can use these polyfills:
- For `fetch`: Use [node-fetch](https://github.com/node-fetch/node-fetch#providing-global-access)

- `fetch` -> [node-fetch](https://github.com/node-fetch/node-fetch#providing-global-access)
## Development Setup

1. Clone the repository
2. Install dependencies:
```bash
pnpm install
```

## Testing

`pnpm test`
Run the test suite:
```bash
pnpm test
```

Testing runs against a local anvil fork and requires the following RPC URL to be configured in your .env file:
### Testing Requirements

Tests run against a local anvil fork. Configure the following RPC URLs in your `.env` file:
```
ETHEREUM_RPC_URL
POLYGON_RPC_URL
FANTOM_RPC_URL
SEPOLIA_RPC_URL
ETHEREUM_RPC_URL=
POLYGON_RPC_URL=
FANTOM_RPC_URL=
SEPOLIA_RPC_URL=
```
### Anvil Client

To download and install the anvil client, run the following commands (MacOS):
- `curl -L https://foundry.paradigm.xyz | bash`
- `brew install libusb`
- `source /Users/$(whoami)/.zshenv`
- `foundryup`
### Setting up Anvil Client

#### MacOS Installation
```bash
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash

# Install required dependency
brew install libusb

# Update shell configuration
source /Users/$(whoami)/.zshenv

# Update Foundry
foundryup
```

#### Other Platforms
Please refer to the [Foundry Book](https://book.getfoundry.sh/getting-started/installation) for installation instructions.

## Documentation

In-depth documentation on this SDK is available at [docs-v3.balancer.fi/developer-reference/sdk](https://docs-v3.balancer.fi/developer-reference/sdk/).
For comprehensive documentation, visit [docs-v3.balancer.fi/developer-reference/sdk](https://docs-v3.balancer.fi/developer-reference/sdk/).

## Contributing

We welcome contributions! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License.