forked from MsLolita/backpack-volume-auto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (28 loc) · 1.27 KB
/
main.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
35
36
37
38
39
40
41
42
43
44
import asyncio
import ctypes
import sys
from core.autoreger import AutoReger
from core.backpack_trade import BackpackTrade
from art import tprint
from inputs.config import (ACCOUNTS_FILE_PATH, PROXIES_FILE_PATH, THREADS, DELAY_BETWEEN_TRADE, DELAY_BETWEEN_DEAL,
ALLOWED_ASSETS, NEEDED_TRADE_VOLUME, MIN_BALANCE_TO_LEFT, TRADE_AMOUNT)
def bot_info(name: str = ""):
tprint(name)
if sys.platform == 'win32':
ctypes.windll.kernel32.SetConsoleTitleW(f"{name}")
print("EnJoYeR's <crypto/> moves: https://t.me/+tdC-PXRzhnczNDli\n")
async def worker_task(account: str, proxy: str):
api_key, api_secret = account.split(":")
backpack = BackpackTrade(api_key, api_secret, proxy, DELAY_BETWEEN_TRADE, DELAY_BETWEEN_DEAL,
NEEDED_TRADE_VOLUME, MIN_BALANCE_TO_LEFT, TRADE_AMOUNT)
await backpack.start_trading(pairs=ALLOWED_ASSETS)
await backpack.close()
return True
async def main():
bot_info("Backpack_Trading")
autoreger = AutoReger.get_accounts(ACCOUNTS_FILE_PATH, PROXIES_FILE_PATH)
await autoreger.start(worker_task, THREADS)
if __name__ == '__main__':
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())