InSwap API Guide
InSwap Community Edition is now available on GitHub with the latest version of its full source code. Here’s a quick guide to using InSwap.
For full details, please refer to the InSwap API guide: https://github.com/unisat-wallet/inswap-community-edition
How do I use InSwap API?
To use InSwap, follow these steps:
Clone the repository:
git clone https://github.com/brc20-devs/brc20-swap-api.gitInstall the project dependencies:
yarnCopy the
config.json.examplefile and rename it toconfig.json:cp conf/config.json.example conf/config.jsonConfigure the OpenAPI API key by updating the
config.jsonfile with your API key. For example:"openApi": { "url": "https://open-api.unisat.io", "apiKey": "YOUR_API_KEY" },Replace
YOUR_API_KEYwith your actual API key. Note: If you don't have an API key, you can obtain one by signing up on the OpenAPI website: https://developer.unisat.ioConfigure the MongoDB connection by updating the
config.jsonfile with your MongoDB connection details. For example:{ "mongoUrl": "mongodb://127.0.0.1:27017/" }Make sure you have MongoDB installed and running on your machine.
Note: If you don't have MongoDB installed, you can download it from the official MongoDB website: https://www.mongodb.com/download-center/community
Start the development server:
yarn start-devOpen your web browser and navigate to
http://localhost:3000/documentation/static/index.htmlto access the application.
How do I deploy a new InSwap module instance?
To build a new InSwap module instance, follow these steps:
Refer to the
script/deploy-on-testnet-example.tsfile for an example of how to deploy a new module and contract.Once you have the new module and contract, update the corresponding configuration in the
config.jsonfile.
How can I contribute to InSwap?
If you would like to contribute to this project, please follow these guidelines:
Fork the repository on GitHub.
Create a new branch for your feature or bug fix.
Make your changes and commit them with descriptive messages.
Push your branch to your forked repository.
Submit a pull request to the main repository.
Can I refer to any InSwap API demos?
Please check the demo here: https://github.com/unisat-wallet/unisat-dev-examples/tree/master/brc20-swap-demo
Last updated