-
Notifications
You must be signed in to change notification settings - Fork 15
Support specified wallet to get balance information #814
base: bixin_dev
Are you sure you want to change the base?
Support specified wallet to get balance information #814
Conversation
9b8dbcc
to
f7e4df0
Compare
f7e4df0
to
ed4e5ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我只看了一部分,感觉第二个commit好像多做了一些和发送无关的内容,你是想直接全部去掉self.wallet吗,但是又好像不太彻底...
最好只改现在app需要的那部分,或者其实前端多使用select_wallet还是switch_wallet(我忘了是哪个)也能够解决问题,除了取余额之类的操作,发送相关的不太可能说需要同时对两个钱包去进行调用,那么完全可以多做切换就好了...
@@ -925,9 +925,9 @@ def get_coins(self, coins_info): | |||
coins.append(utxo) | |||
return coins | |||
|
|||
def format_return_data(self, feerate, size, block): | |||
def format_return_data(self, feerate, size, block, coin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个其实只是btc的用,所以,写死btc就好了
@@ -960,7 +960,9 @@ def get_default_fee_info(self, feerate=None, coin="btc", eth_tx_info=None): | |||
"normal": {"gas_price": 79, "time": 3, "gas_limit": 40000, "fee": "0.00316", "fiat": "4.33 USD"}, | |||
"slow": {"gas_price": 72, "time": 10, "gas_limit": 40000, "fee": "0.00288", "fiat": "3.95 USD"}} | |||
""" | |||
self._assert_wallet_isvalid() | |||
|
|||
wallet = self.get_wallet_by_name(id) if id else self.wallet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不太合理,把id作为一个必须的属性,然后去掉self.wallet会更好点,就是直接抛弃self.wallet了。那么get_wallet_by_name
里找不到wallet的话可以抛出找不到钱包的统一异常
@@ -1122,6 +1127,8 @@ def get_fee_by_feerate(self, coin="btc", outputs=None, message=None, feerate=Non | |||
else if coin is "eth": | |||
json like {"gas_price": 110, "time": 0.25, "gas_limit": 36015, "fee": "0.00396165", "fiat": "5.43 USD"} | |||
""" | |||
wallet = self.get_wallet_by_name(id) if id else self.wallet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
""" | ||
Confirm to create transaction, for btc only | ||
:param tx: tx that created by get_fee_by_feerate | ||
:return: json like {"tx":""} | ||
""" | ||
|
||
try: | ||
self._assert_wallet_isvalid() | ||
wallet = self.get_wallet_by_name(id) if id else self.wallet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要检查是btc的钱包
现在的新页面设计是需要的 总资产里边点进去需要支持直接转账 并且回到钱包页面的时候 不能切换钱包 |
上周最后的结论是隐藏掉所有资产页面进去之后的转账功能,等我们解耦之后才来处理,所以这个留着或者关掉都可以,做个记录 |
What does this implement/fix? Explain your changes.
commit1:get_wallet_balance支持指定钱包获取余额
commit2:转账相关接口支持指定钱包操作
Does this close any currently open issues?
If it fixes a bug or resolves a feature request, be sure to link to that issue.
…
Pull request type
Put an
x
in the boxes that applyWhere has this been tested?
…
Any other comments?
…