# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fabriq.network/reference/fabriq-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
