Skip to content
Command Line Interface (CLI) for the AirSwap Network
TypeScript Other
Branch: master
Clone or download
Latest commit f0d4515 Feb 14, 2020
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin cli initial Jan 13, 2020
src Merge pull request #62 from airswap/response-handling Feb 14, 2020
.eslintignore Updating descriptions and adding linting configs Jan 14, 2020
.eslintrc Updating descriptions and adding linting configs Jan 14, 2020
LICENSE Adding LICENSE Feb 5, 2020 v1.2.13 Feb 14, 2020

AirSwap CLI

Command Line Interface (CLI) for the AirSwap Network

Version License Downloads/week Discord Twitter Follow

AirSwap is a peer-to-peer trading network for Ethereum (ERC20, ERC721) tokens. Using an Indexer smart contract, peers can find each other based on their mutual intent to trade specific tokens. Once found, peers exchange pricing information and settle trades on a Swap contract. AirSwap CLI includes functionality to interact with peers, indexers, and tokens. See Commands below.


  • Quotes are indicative prices and orders are signed and executable. Makers should be able to provide both.
  • Makers run as web servers at public URLs. Takers request quotes and orders using JSON-RPC over HTTP.
  • Indexers are used to signal an intent to trade to other peers. Tokens are staked to improve visibility.

Key Management

AirSwap CLI uses the native password manager of your system. On macOS, keys are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.

Quick Start

Install the CLI globally

$ yarn global add airswap

Create a new account to use for the CLI (recommended)

$ airswap account:generate

Import the newly generated or an existing private key

$ airswap account:import

Explore the Network

Set the active network to rinkeby or mainnet

$ airswap network

Get locators for actively trading peers

$ airswap indexer:get

Get a quote from a specific peer

$ airswap quote:get

Get the best quote from all peers

$ airswap quote:best

Balance Management

Get balances for known tokens

$ airswap balances

Transfer a balance to another account

$ airswap token:transfer

Deposit an ETH balance to WETH

$ airswap weth:deposit

Withdraw an ETH balance from WETH

$ airswap weth:withdraw

Rinkeby Resources

  • ETH to pay for transactions - Faucet
  • WETH for trading - 0xc778417e063141139fce010982780140aa0cd5ab Etherscan
  • DAI for trading - 0x5592ec0cfb4dbc12d3ab100b257153436a1f0fea Etherscan
  • AST for staking - 0xcc1cbd4f67cceb7c001bd4adf98451237a193ff8 Etherscan / Faucet

All Commands

airswap account:delete

delete the current ethereum account

  $ airswap account:delete

See code: src/commands/account/delete.ts

airswap account:export

export the current ethereum account

  $ airswap account:export

See code: src/commands/account/export.ts

airswap account:generate

generate a new ethereum account

  $ airswap account:generate

See code: src/commands/account/generate.ts

airswap account:import

import an ethereum account

  $ airswap account:import

See code: src/commands/account/import.ts

airswap balances

display token balances

  $ airswap balances

See code: src/commands/balances.ts

airswap gas

set gas price for transactions

  $ airswap gas

See code: src/commands/gas.ts

airswap help [COMMAND]

display help for airswap

  $ airswap help [COMMAND]

  COMMAND  command to show help for

  --all  see all commands in CLI

See code: @oclif/plugin-help

airswap indexer:enable

enable staking on the indexer

  $ airswap indexer:enable

See code: src/commands/indexer/enable.ts

airswap indexer:get

get intents from the indexer

  $ airswap indexer:get

See code: src/commands/indexer/get.ts

airswap indexer:new

create an index for a new token pair

  $ airswap indexer:new

See code: src/commands/indexer/new.ts

airswap indexer:set

set an intent

  $ airswap indexer:set

See code: src/commands/indexer/set.ts

airswap indexer:unset

unset an intent

  $ airswap indexer:unset

See code: src/commands/indexer/unset.ts

airswap ip

display local network addresses

  $ airswap ip

See code: src/commands/ip.ts

airswap metadata:add

add token to local metadata

  $ airswap metadata:add

See code: src/commands/metadata/add.ts

airswap metadata:delete

delete token from local metadata

  $ airswap metadata:delete

See code: src/commands/metadata/delete.ts

airswap metadata:lookup

lookup token in local metadata

  $ airswap metadata:lookup

See code: src/commands/metadata/lookup.ts

airswap metadata:update

update local metadata from remote sources

  $ airswap metadata:update

See code: src/commands/metadata/update.ts

airswap network

set the active network

  $ airswap network

See code: src/commands/network.ts

airswap order:best

get the best available order

  $ airswap order:best

See code: src/commands/order/best.ts

airswap order:get

get an order from a peer

  $ airswap order:get

See code: src/commands/order/get.ts

airswap quote:best

get the best available quote

  $ airswap quote:best

See code: src/commands/quote/best.ts

airswap quote:get

get a quote from a peer

  $ airswap quote:get

See code: src/commands/quote/get.ts

airswap quote:max

get a max quote from a peer

  $ airswap quote:max

See code: src/commands/quote/max.ts

airswap token:approve

approve a token for trading

  $ airswap token:approve

See code: src/commands/token/approve.ts

airswap token:transfer

transfer tokens to another account

  $ airswap token:transfer

See code: src/commands/token/transfer.ts

airswap weth:deposit

deposit eth to weth

  $ airswap weth:deposit

See code: src/commands/weth/deposit.ts

airswap weth:withdraw

withdraw eth from weth

  $ airswap weth:withdraw

See code: src/commands/weth/withdraw.ts

You can’t perform that action at this time.