Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit d4087fa

Browse files
committed
hhjjj
1 parent 29f8516 commit d4087fa

5 files changed

Lines changed: 12 additions & 9 deletions

File tree

-59 Bytes
Binary file not shown.

pocketoptionapi/stable_api.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@ def check_connect():
120120

121121
# self.update_ACTIVES_OPCODE()
122122
def get_balance(self):
123-
self.api.get_balances()
124-
return {
125-
"balance_id" : global_value.balance_id,
126-
"balance" : global_value.balance,
127-
"balance_type" : global_value.balance_type
128-
}
123+
if global_value.balance_updated:
124+
return global_value.balance
125+
else:
126+
return None
129127

130128
def buy(self, amount, ACTIVES, ACTION, expirations):
131129
self.api.buy_multi_option = {}
66 Bytes
Binary file not shown.

pocketoptionapi/ws/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ async def on_open(): # pylint: disable=unused-argument
2727

2828

2929
async def send_pin(ws):
30-
while global_value.websocket_is_connected is False:
30+
while not global_value.websocket_is_connected:
3131
await asyncio.sleep(0.1)
32-
pass
32+
print("before pass")
33+
# pass
34+
print("after pass")
3335
while True:
34-
await asyncio.sleep(20)
36+
await asyncio.sleep(5)
37+
print("sent ping request")
3538
await ws.send('42["ps"]')
3639

3740

test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ def main():
1818

1919
max_retries = 5
2020
for _ in range(max_retries):
21+
print(api.get_balance())
2122
time.sleep(5)
2223
try:
2324
asyncio.run(api.reconect())
2425
except:
2526
pass
2627
if api.check_connect():
28+
print(api.get_balance())
2729
break # Exit loop if connected
2830
else:
2931
print("Failed to connect after max retries")

0 commit comments

Comments
 (0)