This repository provides a simple example of how to integrate the Allbridge Core SDK into a React application. It demonstrates the essential functionalities of the SDK, including retrieving supported networks and tokens, calculating fees, estimating received amounts, and sending transactions.
src/pages/Demo.tsx
: This component contains the minimal implementation of the core features of the Allbridge SDK.src/services/sdk.ts
: This service aggregates all the methods used in theDemo
component for interacting with the Allbridge SDK.
- Retrieving Networks and Tokens: Fetches the list of networks and tokens that are available for transfers.
- Fetching Fees: Retrieves the fees associated with a transaction.
- Calculating Received Amount: Estimates the amount the recipient will receive after deducting the fees.
- Sending Transactions: Initiates the transfer of tokens between networks.
This example project intentionally omits any form of validation or error handling for the sake of simplicity. Integrators are expected to implement these as per their specific requirements.
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/allbridge-io/allbridge-example-react.git
-
Navigate to the project directory:
cd allbridge-example-react
-
Install the dependencies:
npm install
-
Start the development server:
npm start
Visit http://localhost:3000/allbridge-example-react/demo
in your browser to see the demo in action.
This project is licensed under the MIT License.