Command Line Interface (CLI) for the AirSwap Network
- Docs → https://docs.airswap.io/
- Website → https://www.airswap.io/
- Blog → https://blog.airswap.io/
- Support → https://support.airswap.io/
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.
Concepts
- 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.
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
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
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
- ETH to pay for transactions - Faucet
- WETH for trading -
0xc778417e063141139fce010982780140aa0cd5ab
Etherscan - DAI for trading -
0x5592ec0cfb4dbc12d3ab100b257153436a1f0fea
Etherscan - AST for staking -
0xcc1cbd4f67cceb7c001bd4adf98451237a193ff8
Etherscan / Faucet
airswap account:delete
airswap account:export
airswap account:generate
airswap account:import
airswap balances
airswap help [COMMAND]
airswap indexer:enable
airswap indexer:get
airswap indexer:new
airswap indexer:set
airswap indexer:unset
airswap ip
airswap metadata:add
airswap metadata:delete
airswap metadata:lookup
airswap metadata:update
airswap network
airswap order:best
airswap order:get
airswap quote:best
airswap quote:get
airswap quote:max
airswap token:approve
airswap token:transfer
airswap weth:deposit
airswap weth:withdraw
delete the current ethereum account
USAGE
$ airswap account:delete
See code: src/commands/account/delete.ts
export the current ethereum account
USAGE
$ airswap account:export
See code: src/commands/account/export.ts
generate a new ethereum account
USAGE
$ airswap account:generate
See code: src/commands/account/generate.ts
import an ethereum account
USAGE
$ airswap account:import
See code: src/commands/account/import.ts
display token balances
USAGE
$ airswap balances
See code: src/commands/balances.ts
display help for airswap
USAGE
$ airswap help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
enable staking on the indexer
USAGE
$ airswap indexer:enable
See code: src/commands/indexer/enable.ts
get intents from the indexer
USAGE
$ airswap indexer:get
See code: src/commands/indexer/get.ts
create an index for a new token pair
USAGE
$ airswap indexer:new
See code: src/commands/indexer/new.ts
set an intent
USAGE
$ airswap indexer:set
See code: src/commands/indexer/set.ts
unset an intent
USAGE
$ airswap indexer:unset
See code: src/commands/indexer/unset.ts
display local network addresses
USAGE
$ airswap ip
See code: src/commands/ip.ts
add token to local metadata
USAGE
$ airswap metadata:add
See code: src/commands/metadata/add.ts
add token to local metadata
USAGE
$ airswap metadata:delete
See code: src/commands/metadata/delete.ts
add token to local metadata
USAGE
$ airswap metadata:lookup
See code: src/commands/metadata/lookup.ts
update local metadata
USAGE
$ airswap metadata:update
See code: src/commands/metadata/update.ts
set the active network
USAGE
$ airswap network
See code: src/commands/network.ts
get the best available order
USAGE
$ airswap order:best
See code: src/commands/order/best.ts
get an order from a peer
USAGE
$ airswap order:get
See code: src/commands/order/get.ts
get the best available quote
USAGE
$ airswap quote:best
See code: src/commands/quote/best.ts
get a quote from a peer
USAGE
$ airswap quote:get
See code: src/commands/quote/get.ts
get a max quote from a peer
USAGE
$ airswap quote:max
See code: src/commands/quote/max.ts
approve a token for trading
USAGE
$ airswap token:approve
See code: src/commands/token/approve.ts
transfer tokens to another account
USAGE
$ airswap token:transfer
See code: src/commands/token/transfer.ts
deposit eth to weth
USAGE
$ airswap weth:deposit
See code: src/commands/weth/deposit.ts
withdraw eth from weth
USAGE
$ airswap weth:withdraw
See code: src/commands/weth/withdraw.ts