bismuthclient package

Submodules

bismuthclient.async_client module

bismuthclient.bismuthapi module

Wrapper around the official Bismuth API from api.bismuth.live

WIP

bismuthclient.bismuthapi.get_wallet_servers_legacy(light_ip_list='', app_log=None)[source]

Use different methods to return the best possible list of wallet servers, sorted ip:port

bismuthclient.bismuthclient module

bismuthclient.bismuthcrypto module

bismuthclient.bismuthformat module

Formatting helpers for Bismuth

class bismuthclient.bismuthformat.AmountFormatter(amount)[source]

Bases: object

Format a BIS amount to string

amount
to_string(decimals=3, leading=0)[source]
class bismuthclient.bismuthformat.TxFormatter(tx)[source]

Bases: object

Formats a Bismuth Transaction

to_json(for_display=False)[source]
to_string()[source]
tx

bismuthclient.bismuthwallet module

bismuthclient.lwbench module

Wallet server benchmarking functions - ported from gui wallet, converted to use the native api class.

bismuthclient.lwbench.connectible(ipport)[source]

Helper: return True if the ip:port can be connected to, without sending any command.

bismuthclient.lwbench.convert_ip_port(ip, some_port)[source]

Helper: Get ip and port, but extract port from ip if ip was as ip:port

Parameters:
  • ip
  • some_port – default port
Returns:

(ip, port)

bismuthclient.lwbench.time_measure(light_ip_list, app_log=None)[source]

Measure answer time for the servers in light_ip list

Parameters:
  • light_ip_list – a list of “ip:port” wallet servers
  • app_log – an optional logger
Returns:

A sorted light_ip list

bismuthclient.rpcconnections module

Bismuth default/legacy connection layer. Json over sockets This file is no more compatible with the Bismuth code, it’s been converted to a class EggPool 2018

class bismuthclient.rpcconnections.Connection(ipport, verbose=False, raw=False)[source]

Bases: object

Connection to a Bismuth Node. Handles auto reconnect when needed

check_connection()[source]

Check connection state and reconnect if needed.

close()[source]

Close the socket

command(command, options=None)[source]

Sends a command and return it’s raw result. options has to be a list. Each item of options will be sent separately. So If you ant to send a list, pass a list of list.

command_lock
ipport
last_activity
raw
sdef
stats
verbose

Module contents

Top-level package for BismuthClient.