Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adshao/binance-cli
binance cli
https://github.com/adshao/binance-cli
binance bitcoin bnb btc cli ieo
Last synced: 2 months ago
JSON representation
binance cli
- Host: GitHub
- URL: https://github.com/adshao/binance-cli
- Owner: adshao
- Created: 2019-07-29T12:37:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-24T14:14:11.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T05:17:54.410Z (6 months ago)
- Topics: binance, bitcoin, bnb, btc, cli, ieo
- Language: Go
- Size: 348 KB
- Stars: 18
- Watchers: 5
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### binance-cli
Binance CLI
币安交易所命令行工具Manipulate multiple accounts with one command!
支持批量操作多账号!### Installation
```shell
go install github.com/adshao/binance-cli
```### Prepare key file
save api/secret keys into keys.json
```json
[
{
"name": "demo",
"api_key": "xxxx",
"secret_key": "xxx"
},
{
}
]
```### Run CLI
use ```-h``` to get help.
```shell
./binance-cli -hNAME:
binance-cli - Binance CLIUSAGE:
binance-cli [global options] command [command options] [arguments...]VERSION:
0.0.0COMMANDS:
list-balance list account balances
list-price list latest price for a symbol or symbols
list-order list open orders
create-order create order
cancel-order cancel open orders
list-symbol list symbols info
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--name value account name
--keyfile value file path of api keys
--debug, -d show debug info
--help, -h show help
--version, -v print the version
```#### Check Latest Price
```shell
./binance-cli list-price --symbol BNBBTC
```output
```shell
{
"test1": [
{
"symbol": "BNBBTC",
"price": "0.00283210"
}
]
}
```#### List Balances
```shell
./binance-cli list-balance
```output
```shell
[
{
"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
}
]
```#### Create Order
Currently only support LIMIT order.
##### Create Sell Order
```shell
./binance-cli create-order --symbol BNBUSDT --side SELL --quantity 10 --price 50
```##### Create Sell Order With Percent Quantity
This will sell 50% of your BNB to buy USDT at price 50 USDT.
```shell
./binance-cli create-order --symbol BNBUSDT --side SELL --quantity 50% --price 50
```##### Create Buy Order
```shell
./binance-cli create-order --symbol BNBUSDT --side BUY --quantity 10 --price 20
```##### Create Buy Order With Percent Quantity
This will sell 100% of your USDT to buy BNB at price 20 USDT.
```shell
./binance-cli create-order --symbol BNBUSDT --side BUY --quantity 100% --price 20
```#### Cancel Order
Cancel all orders with BNBUSDT in all accounts.
```shell
./binance-cli cancel-order --symbol BNBUSDT
```