To use the brc20-swap project, follow these steps:
-
Clone the repository:
git clone https://github.com/brc20-devs/brc20-swap-api.git -
Install the project dependencies:
yarn -
Copy the
config.json.examplefile and rename it toconfig.json:cp conf/config.json.example conf/config.json -
Configure 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.io -
Configure 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-dev -
Open your web browser and navigate to
http://localhost:3000/documentation/static/index.htmlto access the application.
To build a new brc20-swap 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.
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.
This project is licensed under the MIT License. See the LICENSE file for more information.