Skip to content

ChaosLabsInc/dydx-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaos Labs <> dYdX CLI

image

Usage:

After installation, to start the CLI run npm run start and the CLI menu will open See sections below for detailed instructions of the dfferent options.

Installation

  1. git clone repo.
  2. run npm i from inside the repo.
  3. run npm run build from inside the repo.

Public API:

The Public API can be used directly by following the CLI instructions, for optional values, leaving an empty input will result in discarding these fields form the call.

  • You can view all the available calls and their descriptions through 'See Public Method Descriptions' option.

Private API:

Private API requires API authentication, see Authentication section beefore the first use. In addition, using the Prviate API requires that the user will finish onboarding through the UI first for it work. If your API requests fail with API key not found - that means the onboarding proccess is not done. Finished the onboarding to dYdX here Private API

  • You can view all the available calls and their descriptions through 'See Private Method Descriptions' option.

Example Flow:

Let's see how we get the GetMarkets from the Public API:

  1. Choose 'Call Public Methods':

image

  1. Choose 'GetMarkets':

image

  1. Enter the required parameters for the 'GetMarkets' method:

image

  1. Done:

image

Authentication:

  • Authenticaiton is only required for the Private API. If you're using the Public API then you can simply start using the CLI.
  • Authentication is only required once. The authenticaiton credentials will be stored under config/config.json for future usage of the CLI.

Authenticaiton (Private wallet key) flow:

When first starting, the CLI will show that you're logged out, like so: image

  • In order to authenticate you CLI against dYdX the wallet private key is required, once, to fetch the dYdX credentials. The key will not be saved, but the dYdX credentials will be stored into the config/config.json.
  1. Go to 'Authentication Options' in the main menu.
  2. Go to 'Login API Credentials'
  3. Enter your wallet address.
  4. Enter your API key.
  5. Enter your API secret.
  6. Enter your API passphrase.

Done. When you next open the CLI you should see that you're logged in like so: image

Authenticaiton (Private wallet key) flow:

  • This flow is only availalbe in developer mode which can be turned on from the CLI.
  • In order to authenticate you CLI against dYdX the wallet private key is required, once, to fetch the dYdX credentials. The key will not be saved, but the dYdX credentials will be stored into the config/config.json.
  1. Go to 'Authentication Options' in the main menu.
  2. Go to 'Login Using Ethereum Private Key'
  3. Enter your wallet address.
  4. Enter your private key.

Releases

No releases published

Packages

No packages published