# rpc_modules - Zora RPC Method

Returns the enabled JSON-RPC namespaces exposed by the connected Zora endpoint together with their version strings.

> **Non-standard method.** `rpc_modules` is a client-introspection RPC that is commonly available on Geth-compatible stacks, but it is not part of the core Ethereum Execution API method set. Availability varies by client and operator policy.

> **Why Zora?** Build on the creator-first L2 powering $353M+ in NFT trading volume with 179K+ active creators with 0.000777 ETH minting fees, 50% creator royalty share, no-code NFT toolkit, and OP Stack Ethereum security.

## When to Use This Method

`rpc_modules` is useful for NFT creators, digital artists, brands, and onchain media builders:

- **Capability Discovery** - Detect whether namespaces like `debug`, `trace`, `txpool`, or `erigon` are exposed before attempting those calls
- **Client Diagnostics** - Verify what the serving node has enabled when debugging environment-specific issues
- **Infrastructure Audits** - Compare public and private endpoints to confirm which RPC surfaces are intentionally exposed
- **Runtime Feature Gating** - Adjust tooling behavior dynamically based on the actual namespaces available on a node

## Best Practices

- Call at startup to determine which features are available on a node
- Module availability varies by node client and provider configuration
- Use to gate feature access in applications before attempting unsupported calls
- This is a non-standard method; some endpoints may not expose it

## Request Parameters

This method accepts no parameters.

## Request Example

```json
{
  "jsonrpc": "2.0",
  "method": "rpc_modules",
  "params": [],
  "id": 1
}
```

## Response Fields

- `result` (`Object, required`): Object whose keys are enabled namespaces and whose values are version strings

## Successful Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "eth": "1.0",
    "net": "1.0",
    "web3": "1.0",
    "rpc": "1.0",
    "debug": "1.0",
    "trace": "1.0",
    "txpool": "1.0"
  }
}
```

## Error Responses

### Error Response

- Code: `-32601`

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}
```

## Code Examples

cURL
JavaScript
Python
Go

```bash
curl -X POST https://api-zora-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "rpc_modules",
    "params": [],
    "id": 1
  }'
```

```javascript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-zora-mainnet.n.dwellir.com/YOUR_API_KEY');

const modules = await provider.send('rpc_modules', []);
console.log('Namespaces:', Object.keys(modules));

if (modules.debug) {
  console.log('Debug RPC is enabled');
}
```

```python
import requests

response = requests.post(
    'https://api-zora-mainnet.n.dwellir.com/YOUR_API_KEY',
    json={
        'jsonrpc': '2.0',
        'method': 'rpc_modules',
        'params': [],
        'id': 1,
    },
)

modules = response.json()['result']
print('Namespaces:', sorted(modules.keys()))
print('Has trace:', 'trace' in modules)
```

```go
package main

import (
    "context"
    "fmt"
    "log"
    "sort"

    "github.com/ethereum/go-ethereum/rpc"
)

func main() {
    client, err := rpc.Dial("https://api-zora-mainnet.n.dwellir.com/YOUR_API_KEY")
    if err != nil {
        log.Fatal(err)
    }

    var modules map[string]string
    err = client.CallContext(context.Background(), &modules, "rpc_modules")
    if err != nil {
        log.Fatal(err)
    }

    names := make([]string, 0, len(modules))
    for name := range modules {
        names = append(names, name)
    }
    sort.Strings(names)
    fmt.Printf("Namespaces: %v\n", names)
}
```

## Related Methods

- [`web3_clientVersion`](https://www.dwellir.com/docs/zora/web3_clientVersion) - Inspect the client software version string
- [`debug_traceTransaction`](https://www.dwellir.com/docs/zora/debug_traceTransaction) - Debug namespace example
- `trace_transaction` - Trace namespace example
