# ChainAdapter

ChainAdapter is the most basic interface of the signet.js library. It provides a standard set of methods that all chains must implement.

With this interface you will be able to interact with Sig Network smart contracts in a standard way to:

* getBalance
* deriveAddressAndPublicKey
* serializeTransaction
* deserializeTransaction
* prepareTransactionForSigning
* finalizeTransactionSigning
* broadcastTx

If you want to have a look, this is the chain interface with a brief description of each method:

```ts twoslash
// [!include ~/../src/chain-adapters/ChainAdapter.ts]
```

# Implementing a New ChainAdapter

This guide explains how to implement support for a new blockchain network in the signet.js library.

## Overview

To add support for a new blockchain, you need to implement the `ChainAdapter` interface:

## Step-by-Step Guide

### 1. Create the ChainAdapter Types

First, define the transaction types for your chain:

```ts twoslash
// [!include ~/../src/types.ts]
```

### 2. Implement the ChainAdapter Interface

Create a new class that implements the `ChainAdapter` interface:

```ts twoslash
// [!include ~/../src/chain-adapters/EVM/EVM.ts]
```
