Ensure the AirSwap CLI is installed.
$ yarn global add airswap
Once your Server is up and running at a public URL, you're ready to add it to the Indexer. First, ensure an account is set with the airswap account:import
command. You can but are not required to use the same Ethereum account that your Server is using.
Let's take a look at the available Indexer commands.
$ airswap indexerAirSwap CLI 1.3.8 — https://support.airswap.io/get, set, and unset intents on the indexerUSAGE$ airswap indexer:COMMANDCOMMANDSindexer:enable enable staking on the indexerindexer:get get intents from the indexerindexer:new create an index for a new token pairindexer:set set an intentindexer:unset unset an intent
First run the following command to enable staking for your account.
$ airswap indexer:enable
Now run the following command to set your intent to trade.
$ airswap indexer:set
Param | Type | Description |
|
| Whether you intend to buy or sell a token. |
|
| Token you intend to buy or sell. |
|
| Base token to buy or sell for. |
|
| URL of your Server where |
|
| Number of AirSwap Tokens to stake. |
To ensure your intent was correctly set, you can query the opposite side of your intent on the indexer. For example, if you set an intent to sell DAI for WETH, you would query to buy DAI for WETH with the indexer:get
command.
$ airswap indexer:getAirSwap CLI 1.3.8 — https://support.airswap.io/get intents from the indexer RINKEBYIndexer 0x10F6702447414cE1250Af5f7000D7c9A0f04E824buy or sell: buytoken: daifor: wethTop peers selling DAI for WETH (HTTPS)Staked Locator------ ------------------------------100 mymaker.vercel.app
Now that your Server is running and has been added to the Indexer, your quotes will be returned among results of the airswap quote:best
command and aggregators like MetaMask Swaps.
$ airswap quote:bestAirSwap CLI 1.3.8 — https://support.airswap.io/get the best available quote RINKEBYbuy or sell: buyamount: 0.1of: wethfor: daiRequesting from 3 peers... doneQuote from mymaker.vercel.app✨ Buy 0.1 WETH for 40 DAIPrice 0.0025 WETH/DAI (400 DAI/WETH)