> For the complete documentation index, see [llms.txt](https://docs.frequencychain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frequencychain.org/15.-apis-and-sdk-integration/15.4-building-a-reusable-sdk-layer.md). Agents can also search and read this documentation through its [MCP server](https://docs.frequencychain.org/~gitbook/mcp).

# 15.4 Building a Reusable SDK Layer

In production applications, developers often build an SDK layer to encapsulate blockchain interactions. This approach abstracts low-level logic and provides reusable functions across the application.

A basic SDK structure might include:

* network initialization
* contract interaction methods
* transaction helpers
* error handling

Below is a simplified example of a FreCx SDK module.

```
class FreCxSDK {
  constructor(rpcUrl, privateKey) {
    this.provider = new ethers.JsonRpcProvider(rpcUrl);
    this.wallet = new ethers.Wallet(privateKey, this.provider);
  }

  async getBalance(address) {
    const balance = await this.provider.getBalance(address);
    return ethers.formatEther(balance);
  }

  async sendTransaction(to, amount) {
    const tx = await this.wallet.sendTransaction({
      to,
      value: ethers.parseEther(amount)
    });
    return tx.hash;
  }
}

module.exports = FreCxSDK;
```

This structure allows developers to reuse common functionality without repeating low-level logic.
