def get_btc_balance(address):
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            btc_address, btc_balance = bunch[:2]
            if btc_address == address:
                return btc_balance
    return 0
Пример #2
0
def get_btc_balance(address):
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            btc_address, btc_balance = bunch[:2]
            if btc_address == address:
                return btc_balance
    return 0
def get_wallet_addresses():
    addresses = []
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            address, btc_balance = bunch[:2]
            addresses.append(address)
    return addresses
Пример #4
0
def get_wallet_addresses():
    addresses = []
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            address, btc_balance = bunch[:2]
            addresses.append(address)
    return addresses
Пример #5
0
def get_btc_balances():
    addresses = {}
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] not in addresses:
            addresses[output['address']] = 0
        addresses[output['address']] += output['amount']

    for address in addresses:
        yield [address, addresses[address]]
Пример #6
0
def get_btc_balances():
    addresses = {}
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] not in addresses:
            addresses[output['address']] = 0
        addresses[output['address']] += output['amount']

    for address in addresses:
        yield [address, addresses[address]]
Пример #7
0
def is_locked():
    getinfo = rpc('getwalletinfo', [])
    if 'unlocked_until' in getinfo:
        if getinfo['unlocked_until'] >= 10:
            return False  # Wallet is unlocked for at least the next 10 seconds.
        else:
            return True  # Wallet is locked
    else:
        False
def is_locked():
    getinfo = rpc('getinfo', [])
    if 'unlocked_until' in getinfo:
        if getinfo['unlocked_until'] >= 10:
            return False # Wallet is unlocked for at least the next 10 seconds.
        else:
            return True # Wallet is locked
    else:
        False
Пример #9
0
def is_valid(address):
    address_info = rpc('validateaddress', [address])
    # btcwallet return valid for pubkey
    if address_info['isvalid'] and address_info['address'] == address:
        return True
    return False
Пример #10
0
def get_pubkey(address):
    address_infos = rpc('validateaddress', [address])
    get_address_infos = rpc('getaddressinfo', [address])
    if address_infos['isvalid'] and get_address_infos['ismine']:
        return get_address_infos['pubkey']
    return None
Пример #11
0
def get_wallet_addresses():
    addresses = []
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] not in addresses:
            addresses.append(output['address'])
    return addresses
Пример #12
0
def send_raw_transaction(tx_hex):
    return rpc('sendrawtransaction', [tx_hex])
Пример #13
0
def get_btc_balance(address):
    balance = 0
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] == address:
            balance += output['amount']
    return balance
Пример #14
0
def get_wallet_addresses():
    addresses = []
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] not in addresses:
            addresses.append(output['address'])
    return addresses
Пример #15
0
def send_raw_transaction(tx_hex):
    return rpc('sendrawtransaction', [tx_hex])
Пример #16
0
def list_unspent():
    return rpc('listunspent', [0, 99999])
Пример #17
0
def is_mine(address):
    address_info = rpc('getaddressinfo', [address])
    if 'ismine' not in address_info:
        return False
    return address_info['ismine']
Пример #18
0
def is_mine(address):
    return rpc('validateaddress', [address])['ismine']
def is_valid(address):
    return rpc('validateaddress', [address])['isvalid']
def get_btc_balances():
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            yield bunch[:2]
Пример #21
0
def is_valid(address):
    address_info = rpc('validateaddress', [address])
    # btcwallet return valid for pubkey
    if address_info['isvalid'] and address_info['address'] == address:
        return True
    return False
Пример #22
0
def unlock(passphrase):
    return rpc('walletpassphrase', [passphrase, 60])
Пример #23
0
def get_pubkey(address):
    address_infos = rpc('validateaddress', [address])
    if address_infos['isvalid'] and address_infos['ismine']:
        return address_infos['pubkey']
    return None
Пример #24
0
def wallet_last_block():
    getinfo = rpc('getinfo', [])
    return getinfo['blocks']
Пример #25
0
def is_locked():
    return rpc('walletislocked', [])
Пример #26
0
def get_btc_balances():
    for group in rpc('listaddressgroupings', []):
        for bunch in group:
            yield bunch[:2]
Пример #27
0
def is_locked():
    return rpc('walletislocked', [])
Пример #28
0
def sign_raw_transaction(tx_hex):
    return rpc('signrawtransaction', [tx_hex])['hex']
Пример #29
0
def list_unspent():
    return rpc('listunspent', [0, 99999])
Пример #30
0
def is_mine(address):
    address_info = rpc('validateaddress', [address])
    if 'ismine' not in address_info:
        return False
    return address_info['ismine']
Пример #31
0
def sign_raw_transaction(tx_hex):
    return rpc('signrawtransaction', [tx_hex])['hex']
Пример #32
0
def get_btc_balance(address):
    balance = 0
    for output in rpc('listunspent', [0, 99999]):
        if output['address'] == addresses:
            balance += output['amount']
    return balance
Пример #33
0
def is_valid(address):
    return rpc('validateaddress', [address])['isvalid']
Пример #34
0
def unlock(passphrase):
    return rpc('walletpassphrase', [passphrase, 60])
Пример #35
0
def is_mine(address):
    return rpc('getaddressinfo', [address])['ismine']
Пример #36
0
def wallet_last_block():
    getinfo = rpc('getinfo', [])
    return getinfo['blocks']
Пример #37
0
def is_mine(address):
    address_info = rpc('validateaddress', [address])
    if 'ismine' not in address_info:
        return False
    return address_info['ismine']