Skip to content
Open
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Fuel Agent Kit

## Overview
Fuel Agent Kit is an agentic framework designed to enhance the capabilities of the Fuel Network. It provides tools, libraries, and infrastructure to build, deploy, and manage intelligent agents that can interact with the Fuel Network ecosystem.

## Prerequisites
Before you begin, ensure you have the following installed on your system:

- **Fuel Toolchain**: The Fuel development environment and toolchain.
- **Node.js**: Version 16 or higher for building and running agent applications.

## Installation

1. **Clone the Repository**:
```bash
git clone https://github.com/priyanshudumps/fuel-agent-kit.git
cd fuel-agent-kit
```

2. **Install Dependencies**:
```bash
npm install
```

3. **Set Up Environment**:
Configure your environment variables as specified in the `.env.example` file.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
208 changes: 208 additions & 0 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@


# Fuel Agent Kit CLI Reference

Fuel Agent Kit is a powerful toolkit for interacting with the Fuel blockchain. While it's primarily designed as a TypeScript library, it can be used programmatically through various commands and tools.

## Installation

First, install the Fuel Agent Kit:

```bash
npm install fuel-agent-kit
```

## Basic Usage

### Initializing a Fuel Agent

To initialize a Fuel Agent, you need to create an instance with your wallet private key and configuration:

```javascript
import { FuelAgent } from 'fuel-agent-kit';

const agent = new FuelAgent({
walletPrivateKey: 'your_private_key_here',
model: 'gpt-4', // or other supported model
openAiApiKey: 'your_openai_api_key' // if required
});
```

### Available Tools

Fuel Agent Kit provides several tools for interacting with the Fuel blockchain:

#### 1. Transfer Assets

Transfer assets from your wallet to another address:

```javascript
await agent.transfer({
to: 'recipient_address',
amount: '1000',
symbol: 'USDC'
});
```

#### 2. Swap Assets

Swap one asset for another using Mira DEX:

```javascript
await agent.swapExactInput({
amount: '1000',
fromSymbol: 'USDC',
toSymbol: 'ETH',
slippage: 0.01 // optional, default is 0.01 (1%)
});
```

#### 3. Supply Collateral

Supply collateral to Swaylend for lending:

```javascript
await agent.supplyCollateral({
amount: '1000',
symbol: 'USDC'
});
```

#### 4. Borrow Assets

Borrow assets from Swaylend:

```javascript
await agent.borrowAsset({
amount: '500'
});
```

#### 5. Add Liquidity

Add liquidity to a Mira pool:

```javascript
await agent.addLiquidity({
amount0: '1000',
asset0Symbol: 'USDC',
asset1Symbol: 'ETH',
slippage: 0.01 // optional, default is 0.01 (1%)
});
```

#### 6. Check Balances

Check your wallet balance:

```javascript
const balance = await agent.getOwnBalance({
symbol: 'USDC'
});
```

Check another wallet's balance:

```javascript
const balance = await agent.getBalance({
walletAddress: 'recipient_address',
assetSymbol: 'USDC'
});
```

## Theoretical CLI Commands

While Fuel Agent Kit is primarily a library, here's a theoretical CLI interface that could be implemented:

### fuel-agent init

Initialize a new Fuel Agent configuration:

```bash
fuel-agent init --wallet-private-key <your_private_key> --model <model_name>
```

Example:
```bash
fuel-agent init --wallet-private-key 0x123...abc --model gpt-4
```

### fuel-agent deploy

Deploy a smart contract to the Fuel blockchain:

```bash
fuel-agent deploy --contract <contract_path> --args <arguments>
```

### fuel-agent run

Execute a transaction or command:

```bash
fuel-agent run <command> [options]
```

Common commands:
- `transfer`: Transfer assets
- `swap`: Swap assets
- `supply`: Supply collateral
- `borrow`: Borrow assets
- `add-liquidity`: Add liquidity to a pool
- `balance`: Check wallet balance

Examples:
```bash
fuel-agent run transfer --to 0x123...abc --amount 1000 --symbol USDC
fuel-agent run swap --amount 1000 --from USDC --to ETH
fuel-agent run balance --symbol USDC
```

### fuel-agent execute

Execute a custom transaction:

```bash
fuel-agent execute --script <script_path> [options]
```

## Configuration

Fuel Agent Kit can be configured with various options:

```javascript
const agent = new FuelAgent({
walletPrivateKey: 'your_private_key',
model: 'gpt-4',
openAiApiKey: 'your_openai_api_key',
anthropicApiKey: 'your_anthropic_api_key',
googleGeminiApiKey: 'your_gemini_api_key'
});
```

## Supported Models

Fuel Agent Kit supports multiple AI models:
- OpenAI models (e.g., gpt-4, gpt-3.5-turbo)
- Anthropic models (e.g., claude-2)
- Google Gemini models

## Error Handling

Fuel Agent Kit provides detailed error handling. When a transaction fails, it returns a response in the following format:

```
The transaction failed.
[Error details]
```

For successful transactions, it returns:

```
The transaction was successful. The explorer link is: https://app.fuel.network/tx/0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef/simple
```

## API Reference

For more detailed API information, refer to the [Fuel Agent Kit documentation](https://github.com/dhaiwat10/fuel-agent-kit).

49 changes: 49 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Fuel Agent Kit - Python Implementation

Fuel Agent Kit provides tools for building and managing fuel agents in Python.

## Prerequisites

- Python 3.10 or higher
- pip package manager

## Installation

Install the Fuel Agent Kit using pip:

```bash
pip install fuel-agent-kit
```

## Quick Start

Here's how to initialize a basic Fuel Agent:

```python
from fuel_agent import FuelAgent

# Initialize a new Fuel Agent
agent = FuelAgent(
agent_id="my_agent_123",
name="My Fuel Agent",
description="A sample fuel agent implementation"
)

# Start the agent
agent.start()

# Stop the agent when done
agent.stop()
```

## Features

- Fuel agent management
- Configuration and initialization
- Integration with fuel infrastructure
- Extensible architecture for custom agents

## Documentation

For more detailed documentation and API reference, please visit our [official documentation](https://fuel-agent-kit.org/docs).