Skip to content

Commit

Permalink
Fix wallet asset clean endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Wu Fei authored and Carlos Wu Fei committed Oct 8, 2023
1 parent 0a79714 commit 1951357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/account/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ async def clean_balance_assets(self):
assets = []
for item in data["balances"]:
if item["asset"] not in ["USDT", "NFT", "BNB"] and float(item["free"]) > 0:
assets.append(item["free"])
assets.append(item["asset"])

if len(assets) > 5:
self.transfer_dust(assets)
Expand Down
7 changes: 4 additions & 3 deletions api/apis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import List
import hashlib
import hmac
import os
Expand Down Expand Up @@ -147,12 +148,12 @@ def get_isolated_balance_total(self):
raise IsolateBalanceError("Hit symbol 24hr restriction or not available (requires transfer in)")
return assets

def transfer_dust(self, assets):
def transfer_dust(self, assets: List[str]):
"""
Transform small balances to BNB
"""
assets = ",".join(assets)
response = self.signed_request(url=self.dust_transfer_url, method="POST", payload={"asset": assets})
list_assets = ",".join(assets)
response = self.signed_request(url=self.dust_transfer_url, method="POST", payload={"asset": list_assets})
return response

class BinbotApi(BinanceApi):
Expand Down

0 comments on commit 1951357

Please sign in to comment.