forked from zaivanza/all-in-one
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinance.py
37 lines (29 loc) · 966 Bytes
/
binance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import time
import json
import ccxt
from ccxt.base.errors import InvalidAddress, InvalidOrder, ExchangeError
from termcolor import cprint
import random
from config import *
def binance_withdraw(address_wallet, amount_to_withdraw, symbol_to_withdraw, network):
account_binance = ccxt.binance({
'apiKey': BINANCE_API_KEY,
'secret': BINANCE_API_SECRET,
'enableRateLimit': True,
'options': {
'defaultType': 'spot'
}
})
try:
account_binance.withdraw(
code = symbol_to_withdraw,
amount = amount_to_withdraw,
address = address_wallet,
tag = None,
params = {
"network": network
}
)
cprint(f">>> Успешно | {address_wallet} | {amount_to_withdraw}", "green")
except ExchangeError as error:
cprint(f">>> Неудачно | {address_wallet} | ошибка : {error}", "red")