> ## Documentation Index
> Fetch the complete documentation index at: https://tusharpamnani.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ShardeumAPI Class

> A class to interact with the Shardeum network via JSON-RPC and ethers.js.

We'll be working with a `ShardeumAPI` class that encapsulates all our interactions with the Shardeum network. This class demonstrates two primary ways to interact with Shardeum's JSON-RPC:

1. **Using `ethers.js` `BrowserProvider` and `Signer`:** For wallet interactions (connecting, sending transactions).
2. **Direct `fetch` calls:** For simple read-only queries (e.g., getting balance or gas price).

### Full Class Code

```javascript theme={null}
import { ethers } from 'ethers';

class ShardeumAPI {
  constructor() {
    this.rpcUrl = 'https://api-testnet.shardeum.org';
    this.provider = null;
    this.signer = null;
    this.txHistory = {};
  }
  // ... (rest of the class as in the guide)
}

export default new ShardeumAPI(); 
```
