本文整理汇总了Python中electrum_ltc.Wallet.fee_per_kb方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.fee_per_kb方法的具体用法?Python Wallet.fee_per_kb怎么用?Python Wallet.fee_per_kb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类electrum_ltc.Wallet
的用法示例。
在下文中一共展示了Wallet.fee_per_kb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from electrum_ltc import Wallet [as 别名]
# 或者: from electrum_ltc.Wallet import fee_per_kb [as 别名]
#.........这里部分代码省略.........
return self.run_dialog(title, map(lambda x: {'type':'button','label':x}, items), interval=1, y_pos = self.pos+3)
def network_dialog(self):
if not self.network: return
host, port, protocol, proxy_config, auto_connect = self.network.get_parameters()
srv = 'auto-connect' if auto_connect else self.network.default_server
out = self.run_dialog('Network', [
{'label':'server', 'type':'str', 'value':srv},
{'label':'proxy', 'type':'str', 'value':self.config.get('proxy', '')},
], buttons = 1)
if out:
if out.get('server'):
server = out.get('server')
auto_connect = server == 'auto-connect'
if not auto_connect:
try:
host, port, protocol = server.split(':')
except Exception:
self.show_message("Error:" + server + "\nIn doubt, type \"auto-connect\"")
return False
if out.get('proxy'):
proxy = self.parse_proxy_options(out.get('proxy'))
else:
proxy = None
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
def settings_dialog(self):
fee = str(Decimal(self.wallet.fee_per_kb(self.config)) / COIN)
out = self.run_dialog('Settings', [
{'label':'Default fee', 'type':'satoshis', 'value': fee }
], buttons = 1)
if out:
if out.get('Default fee'):
fee = int(Decimal(out['Default fee']) * COIN)
self.config.set_key('fee_per_kb', fee, True)
def password_dialog(self):
out = self.run_dialog('Password', [
{'label':'Password', 'type':'password', 'value':''}
], buttons = 1)
return out.get('Password')
def run_dialog(self, title, items, interval=2, buttons=None, y_pos=3):
self.popup_pos = 0
self.w = curses.newwin( 5 + len(items)*interval + (2 if buttons else 0), 50, y_pos, 5)
w = self.w
out = {}
while True:
w.clear()
w.border(0)
w.addstr( 0, 2, title)
num = len(items)
numpos = num
if buttons: numpos += 2