The following repository hosts the source codes for AlgoWorld Swapper
. Free and open-source swapper that allows for trustless transfers of assets on Algorand blockchain and extensibility.
⚠️ NOTE: algoworld-contracts used by the swapper are not formally audited by accredited third parties. However, contracts are a basis for certain functionality on the AlgoWorldExplorer.io platform and were created in collaboration with Solution Architect from Algorand (credits @cusma).
Node
>= 14.xyarn
>= 1.12.15vercel cli
>= 24.2.4pre-commit
>= 2.19.0
Run the following command from the root of the repo to setup hooks:
pre-commit install # for all hooks
pre-commit install --hook-type commit-msg # for commitlint checks
AlgoWorld Swapper currently offers usage of several smart signatures used for single and multi ASA transfers.
There are two different types of smart signatures available:
-
ASA to ASA swap | 🎴
↔️ 🎴:
Allows performing a swap of any single ASA of specified amount to any other single ASA of specified amount. -
ASAs to ALGO swap | 🎴🎴🎴
↔️ 💰:
Allows performing a swap of multiple ASAs of specified amount to ALGO of specified amount.
Detailed documentation is work in progress
⚠️
To start the project locally:
- Create virtual environment for python functions:
python -m venv .venv
source .venv/bin/activate
- Install all dependencies
pip install -r api/swappers/requirements.txt
- Run the client locally:
vercel dev
Open http://localhost:3000
with your browser to see the result.
Running
vercel dev
for the first time will prompt you to setup and link with your existing/new vercel project. You can create a dummy project and link it to be able to run the development locally.
For running locally create a file called .env.local
and fill it with the following default parameters (or replace with your own values):
Variable Name | Required? | Description |
---|---|---|
AW_WEB_STORAGE_API_KEY | yes | obtain your own api key on web3.storage . |
NEXT_PUBLIC_CHAIN_TYPE | yes | set to mainnet or testnet to indicate which chain to use by default. |
NEXT_PUBLIC_GA_MEASUREMENT_ID | no | a tag value for Google Analytics tracking. For local dev purposes you can skip it completely. |
NEXT_PUBLIC_SENTRY_DSN | no | a tag value for Sentry error tracking. For local dev purposes you can skip it completely. |
public
— Static assets such as robots.txt, images, and favicon.src
— Application source code, including pages, components, styles.api
— Serverless vercel functions, contract compilation is usingpython
andpyteal
and ipfs storage is done withnode
..pre-commit-config.yaml
— pre commit coniguration for formatting python serverless functions.
The section describes different modes of running the swapper for local dev purposes.
vercel dev
- executes both backend and frontend.
Below is for frontend client only (excluding Vercel
serveless functions).
yarn dev
— Starts the application in development mode athttp://localhost:3000
.yarn build
— Creates an optimized production build of your application.yarn start
— Starts the application in production mode.yarn type-check
— Validate code using TypeScript compiler.yarn lint
— Runs ESLint for all files in thesrc
directory.yarn format
— Runs Prettier for all files in thesrc
directory.yarn commit
— Run commitizen. Alternative togit commit
.
TypeScript are pre-configured with custom path mappings. To import components or files, use the @
prefix.
import { Button } from '@/components/Button';
// To import images or other files from the public folder
import avatar from '@/public/avatar.png';
TBD
This project is licensed under the GPLv3 License - see the LICENSE.md file for more information.
Special thanks to everyone who forked or starred the repository ❤️