def make_billing_address(wallet, num, addr_type): long_id, short_id = wallet.get_user_id() xpub = make_xpub(get_billing_xpub(), long_id) version, _, _, _, c, cK = deserialize_xpub(xpub) cK, c = CKD_pub(cK, c, num) if addr_type == 'legacy': return bitcoin.public_key_to_p2pkh(cK) elif addr_type == 'segwit': return bitcoin.public_key_to_p2wpkh(cK) else: raise ValueError(f'unexpected billing type: {addr_type}')
def make_billing_address(wallet, num): long_id, short_id = wallet.get_user_id() xpub = make_xpub(get_billing_xpub(), long_id) version, _, _, _, c, cK = deserialize_xpub(xpub) cK, c = CKD_pub(cK, c, num) return public_key_to_p2pkh(cK)