Skip to content

hardensky/binance-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

binance-cli

Binance CLI 币安交易所命令行工具

Manipulate multiple accounts with one command! 支持批量操作多账号!

Installation

go install github.com/adshao/binance-cli

Prepare key file

save api/secret keys into keys.json

[
    {
        "name": "demo",
        "api_key": "xxxx",
        "secret_key": "xxx"
    },
    ...
]

Run CLI

use -h to get help.

./binance-cli -h

NAME:
   binance-cli - Binance CLI

USAGE:
   binance-cli [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
     list-balances  list account balances
     list-prices    list latest price for a symbol or symbols
     list-orders    list open orders
     create-order   create order
     cancel-orders  cancel open orders
     help, h        Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --name value     account name
   --keyfile value  file path of api keys
   --help, -h       show help
   --version, -v    print the version

Check Latest Price

./binance-cli list-prices --symbol BNBBTC

{
    "test1": [
        {
            "symbol": "BNBBTC",
            "price": "0.00283210"
        }
    ]
}

List Balances

./binance-cli list-balances

[
    {
        "test1": [
            {
                "asset": "BNB",
                "free": "2027.68758027",
                "locked": "1000.00000000"
            },
            {
                "asset": "BTC",
                "free": "0.00001550",
                "locked": "0.00000000"
            }
        ],
        "test2": [
            {
                "asset": "BNB",
                "free": "300.00000000",
                "locked": "0.00000000"
            },
            {
                "asset": "BTC",
                "free": "0.00000000",
                "locked": "0.00000000"
            }
        ],
        "test3": [
            {
                "asset": "BNB",
                "free": "603.98788625",
                "locked": "0.00000000"
            },
            {
                "asset": "BTC",
                "free": "0.00881320",
                "locked": "0.00000000"
            }
        ]
    },
    {
        "BNB": 3931.6754665199996,
        "BTC": 0.0088287
    }
]

About

binance cli

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%