예제 #1
0
 async def eth_n_erc20_balances() -> Dict[str, Decimal]:
     ethereum_rpc_url = global_config_map.get("ethereum_rpc_url").value
     connector = BalancerConnector(ethereum_required_trading_pairs(),
                                   get_eth_wallet_private_key(),
                                   ethereum_rpc_url, True)
     await connector._update_balances()
     return connector.get_all_balances()
예제 #2
0
 async def ethereum_balances_df(self,  # type: HummingbotApplication
                                ):
     rows = []
     if ethereum_required_trading_pairs():
         bals = await UserBalances.eth_n_erc20_balances()
         for token, bal in bals.items():
             rows.append({"Asset": token, "Amount": round(bal, 4)})
     else:
         eth_bal = UserBalances.ethereum_balance()
         rows.append({"Asset": "ETH", "Amount": round(eth_bal, 4)})
     df = pd.DataFrame(data=rows, columns=["Asset", "Amount"])
     df.sort_values(by=["Asset"], inplace=True)
     return df