SDK

About

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

yarn add fabriq-sdk

Configuration

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.

intentClient.approvePermit2(tokenAddress: Address)

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

Functionalities

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

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

  • Sepolia

  • Hardhat

Last updated