-1

I'm retrieving two asset balances. I've set my code so that I only need to enter my pair once.

crypto = 'BTC' #coin
base = 'USDT'  # stable-coin
symbol = crypto+base

I then try to pass these variables to certain functions, but I'm getting an error for one. This one works just as it should, and returns data:

base_Bal_p = client.get_asset_balance(asset=base, timestamp=timestamp, recvWindow=recvWindow)

This one gives an error:

crypto_Bal_p = client.get_asset_balance(asset=crypto, timestamp=timestamp, recvWindow=recvWindow)

Error:

AttributeError: 'DataFrame' object has no attribute 'lower'

It will work if I code it like this:

crypto_Bal_p = client.get_asset_balance(asset='BTC', timestamp=timestamp, recvWindow=recvWindow)

Any ideas?

I honestly don't know where to begin.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
octoma
  • 5
  • 4

1 Answers1

1

It looks like get_asset_balance should return a string, but is returning a dataframe type instead.

algorythms
  • 1,547
  • 1
  • 15
  • 28
  • I guess if you have multiple assets it would have to be a dataframe, but it gets weird because "base" works fine, even though there are multiple. – octoma Jul 16 '23 at 20:04