# Fabriq SDK

### About  <a href="#about-the-sdk" id="about-the-sdk"></a>

The Fabriq SDK is an easy way to get involved with building cross-chain intent applications. The SDK provides a set of essential functions that facilitate the intent pool access, enabling the submission of intents alongside number of helper functions that provide intentpool statistics.

### **Installation** <a href="#installation" id="installation"></a>

```sh
yarn add fabriq-sdk
```

### Configuration

```typescript
const walletClient = createWalletClient({ 
    chain: hardhat, 
    transport: custom(window.ethereum) 
});

const intentClient = new intentClient(walletClient, intentPoolURL);
```

### Core functionalities

The SDK is created to facilitate the development of frontend applications that want to get access to a network of solvers. The SDK enhances the creation of intents and submission to different intent pools.&#x20;

```typescript
intentClient.approvePermit2(tokenAddress: Address)

intentClient.submitIntent(
    inputAddress: Address,
    outputAddress: Address,
    amount: bigint,
    srcChainId: number,
    dstChainId: number
);
```

### Functionalities <a href="#id-3-utility-functions" id="id-3-utility-functions"></a>

The SDK provides several utility functions that provide intent pool statistics that are very important for every application frontend.&#x20;

```typescript
async getBalance(token: Address) {}

async getIntent(intentHash: Hex) {}

async getAllIntentsWithOrigin(chainId: Number) {}

async getAllIntentsWithDestination(chainId: Number) {}

async getSolvedIntents(numberOfIntents: Number) {}

async getPendingIntents(numberOfIntents: Number) {}
```

### Supported Networks <a href="#id-4-supported-projects" id="id-4-supported-projects"></a>

* Sepolia
* Hardhat
