Application guide
Create a simple application interface
In our application guide we will cover the following:
Installation
Setup
Initialization of the IntentClient class
The creation and submission of an intent
Fetching intentpool state to be displayed on the frontend
1. Installation
To install the fabriq-sdk
in your project, ensure you have Node.js and yarn installed in your environment and run the following command:
2. Setup
Import fabriq-sdk
into your project to start:
3. Initializing the IntentClient class
To create an instance of the IntentClient class, one has to create a wallet client first with the desired network and account(this example is using an embedded browser account). There is a possibility to add a specific intentPoolUrl to submit the intents to.
4. Creating and submitting an Intent
To submit an intent to the intent pool, you need to specify the details of the intent you want to create. This involves defining the source and destination chain IDs , the asset amount to be transferred, the inputAddress which is the asset address on the source chain and the output address which is the asset address on the destination chain.
5. Getting intent pool statistics data
The following functions will help get the intentpool data for an enhanced user experience on the application level.
Last updated