MCPcopy Index your code
hub / github.com/airswap/airswap-protocols

github.com/airswap/airswap-protocols @v5.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.0.0 ↗ · + Follow
214 symbols 529 edges 150 files 6 documented · 3% updated 2mo agov5.0.0 · 2024-10-08★ 2438 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AirSwap Protocols

AirSwap is a peer-to-peer trading network. This repository contains smart contracts for use by developers and traders on the AirSwap network.

Discord License lerna Twitter Follow

Resources

  • Discord → https://chat.airswap.io/
  • X → https://x.com/airswap
  • Website → https://www.airswap.io/
  • About → https://about.airswap.io/

Contracts

Package Version Description
@airswap/registry npm Server Registry
@airswap/swap npm Atomic Token Swap
@airswap/swap-erc20 npm Atomic Token Swap (ERC20)
@airswap/wrapper npm Wrapper for Native Tokens
@airswap/staking npm Staking for Members
@airswap/pool npm Rewards Pool for Members
@airswap/batch-call npm Batch Token and Order Calls

Tools

Package Version Description
@airswap/libraries npm Libraries for Developers
@airswap/utils npm Utils for Developers

Commands

Command Description
yarn compile Compile all contracts to build folders.
yarn clean Clean all contract build folders.
yarn test Run all contract tests in test folders.
yarn lint:fix Run eslint for all JavaScript code.
yarn pretty:fix Run prettier for all JavaScript code.

Branching

Flow for contracts and associated tools: Branch from Develop; Merge Feature → Develop → Beta → Main

Flow for tool updates (not contracts): Branch from Main; Merge Feature → Main → Develop

Process

Regular development process for a complete release

  1. New work and features are cut from and merged to "develop"

  2. Cut feature branches from develop

  3. Merge feature branches into develop (Squash and Merge)

  4. Merge "develop" into "beta" to publish beta packages. (Semver: x.x.x-beta.x)

  5. Merge develop into beta (Merge Commit): this will publish NPM with "beta" tag.

  6. Tag beta release from beta branch. (x.x.x-beta.x)
  7. Share tagged release with auditors if auditing.

  8. Merge "develop" into "main" to publish latest packages. (Semver: x.x.x)

  9. Merge develop into main (Merge Commit): this will publish NPM with "latest" tag.

  10. Merge main into beta: this will update the beta with latest.
  11. Tag release from main branch. (x.x.x)

Each deploys.js must be limited to contracts deployed from that package version.

Individual package features or patches

  1. Cut a feature or fix branch from main.
  2. Merge fix into main (Squash and Merge): this will publish to NPM with "latest" tag.
  3. Merge main into develop.

Deploying and Verifying

Each package has commands yarn deploy and yarn verify. Each command takes a --network flag. For example:

yarn deploy --network sepolia
yarn verify --network sepolia

The source of these scripts can be found in the scripts folder of each package. The account used to deploy and verify is derived from the PRIVATE_KEY environment variable in .env in the repository root.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 128
Method 66
Class 12
Enum 5
Interface 3

Languages

TypeScript100%

Modules by API surface

tools/libraries/src/Server.ts42 symbols
tools/utils/src/swap-erc20.ts15 symbols
tools/utils/src/metadata.ts14 symbols
tools/stores/redis/redis.ts14 symbols
tools/libraries/test/test-utils.ts13 symbols
tools/libraries/test/Server.test.ts13 symbols
tools/utils/index.ts9 symbols
tools/utils/src/swap.ts8 symbols
tools/utils/src/pricing.ts7 symbols
tools/libraries/src/Contracts.ts6 symbols
tools/libraries/src/RegistryV3.ts5 symbols
tools/libraries/src/Registry.ts5 symbols

For agents

$ claude mcp add airswap-protocols \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page