Discovery
To find servers that support a token pair, clients call the getURLsForToken function on the Registry contract for each token and then intersect the results. For example, if the resulting URLs for token A are [maker1.com, maker2.com] and for token B are [maker2.com, maker3.com] then the only server supporting swapping token A for B is maker2.com.
See getURLsForToken on the Registry contract:
function getURLsForToken(address token) external view returns (string[] memory urls);Check deployments for latest contract addresses for Registry.
Fetching URLs via CLI
Ensure the AirSwap CLI is installed.
$ yarn global add airswapUse airswap chain to set your chain to Goerli or Mainnet.
$ airswap chain
AirSwap CLI 4.0.1 — https://www.airswap.xyz/
set the active ethereum chain
Current chain: 5 (GOERLI)
New chain id: (5) 1
Set active chain to ETHEREUM.Use registry:get to fetch server URLs for a token pair.
Example: Take an Order
Try airswap order with a server URL from the previous command.
TypeScript
Using the Registry library from @airswap/libraries returns Server instances that you can interact with.
Calling the Registry directly using ethers
Example: Take an Order
Last updated