specter-desktop/src/cryptoadvance/specter/server_endpoints/wallets.py

842 lines
32 KiB
Python
Raw Normal View History

import json
import logging
import random
from functools import wraps
import requests
from cryptoadvance.specter.commands.psbt_creator import PsbtCreator
from cryptoadvance.specter.util.wallet_importer import WalletImporter
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
from cryptoadvance.specter.wallet import Wallet
from cryptoadvance.specter.util.tx import is_hex, convert_rawtransaction_to_psbt
from flask import Blueprint
from flask import current_app as app
from flask import flash, jsonify, redirect, render_template, request, url_for
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
from flask_babel import lazy_gettext as _
from flask_login import login_required
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
from ..helpers import bcur2base64, get_devices_with_keys_by_type, get_txid
from ..key import Key
from ..managers.wallet_manager import purposes
from ..persistence import delete_file
from ..specter_error import SpecterError, handle_exception
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
# Setup endpoint blueprint
wallets_endpoint = Blueprint("wallets_endpoint", __name__)
def handle_wallet_error(func_name, error):
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("SpecterError while {}: {}").format(func_name, error), "error")
app.logger.error(f"SpecterError while {func_name}: {error}")
app.specter.wallet_manager.update()
return redirect(url_for("welcome_endpoint.about"))
def check_wallet(func):
@wraps(func)
def wrapper(*args, **kwargs):
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
"""checks the wallet for healthiness A wrapper function"""
if kwargs["wallet_alias"]:
wallet_alias = kwargs["wallet_alias"]
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
wallet.get_info()
return func(*args, **kwargs)
return wrapper
################## Wallet overview #######################
@wallets_endpoint.route("/wallets_overview/")
@login_required
def wallets_overview():
app.specter.check_blockheight()
2021-04-09 09:02:55 +02:00
for wallet in list(app.specter.wallet_manager.wallets.values()):
wallet.update_balance()
wallet.check_utxo()
return render_template(
"wallet/wallets_overview.jinja",
specter=app.specter,
rand=rand,
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
services=app.specter.service_manager.services,
)
################## Failed wallets fix #######################
@wallets_endpoint.route("/failed_wallets/", methods=["POST"])
@login_required
def failed_wallets():
if request.method == "POST":
action = request.form["action"]
if action == "retry_loading_wallets":
app.specter.wallet_manager.update()
elif action == "delete_failed_wallet":
try:
wallet = json.loads(request.form["wallet_data"])
fullpath = wallet["fullpath"]
delete_file(fullpath)
delete_file(fullpath + ".bkp")
delete_file(fullpath.replace(".json", "_addr.csv"))
delete_file(fullpath.replace(".json", "_txs.csv"))
app.specter.wallet_manager.update()
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Failed to delete wallet: {}").format(str(e)), "error")
return redirect("/")
################## New wallet #######################
@wallets_endpoint.route("/new_wallet/")
@login_required
def new_wallet_type():
err = None
if app.specter.chain is None:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _("Configure Bitcoin Core to create wallets")
return render_template("base.jinja", error=err, specter=app.specter, rand=rand)
try:
# Make sure wallet is enabled on Bitcoin Core
app.specter.rpc.listwallets()
except Exception as e:
handle_exception(e)
# Hmm, would be better to be more precise with this exception. Best assumption:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _(
'<p><br>Bitcoin Core is running with wallets disabled.<br><br>Please make sure disablewallet is off (set disablewallet=0 in your bitcoin.conf), then restart Bitcoin Core and try again.<br>See <a href="https://github.com/cryptoadvance/specter-desktop/blob/34ca139694ecafb2e7c2bd5ad5c4ac74c6d11501/docs/faq.md#im-not-sure-i-want-the-bitcoin-core-wallet-functionality-to-be-used-is-that-mandatory-if-so-is-it-considered-secure" target="_blank" style="color: white;">here</a> for more information.</p>'
)
return render_template("base.jinja", error=err, specter=app.specter, rand=rand)
return render_template(
"wallet/new_wallet/new_wallet_type.jinja", specter=app.specter, rand=rand
)
@wallets_endpoint.route("/new_wallet/<wallet_type>/", methods=["GET", "POST"])
@login_required
def new_wallet(wallet_type):
wallet_types = ["simple", "multisig", "import_wallet"]
if wallet_type not in wallet_types:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Unknown wallet type requested"), "error")
return redirect(url_for("wallets_endpoint.new_wallet_type"))
err = None
if request.method == "POST":
action = request.form["action"]
if action == "importwallet":
try:
wallet_importer: WalletImporter = WalletImporter(
request.form["wallet_data"],
app.specter,
)
except SpecterError as se:
flash(str(se), "error")
return redirect(url_for("wallets_endpoint.new_wallet_type"))
createwallet = "createwallet" in request.form
if createwallet:
# User might have renamed it
wallet_importer.wallet_name = request.form["wallet_name"]
wallet_importer.create_nonexisting_signers(
app.specter.device_manager, request.form
)
try:
wallet_importer.create_wallet(app.specter.wallet_manager)
except SpecterError as se:
flash(str(se), "error")
return redirect(url_for("wallets_endpoint.new_wallet_type"))
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Wallet imported successfully"), "info")
try:
wallet_importer.rescan_as_needed(app.specter)
except SpecterError as se:
flash(str(se), "error")
return redirect(
url_for(
"wallets_endpoint.receive",
wallet_alias=wallet_importer.wallet.alias,
)
+ "?newwallet=true"
)
else:
return render_template(
"wallet/new_wallet/import_wallet.jinja",
wallet_data=wallet_importer.wallet_json,
wallet_type=wallet_importer.wallet_type,
wallet_name=wallet_importer.wallet_name,
cosigners=wallet_importer.cosigners,
unknown_cosigners=wallet_importer.unknown_cosigners,
unknown_cosigners_types=wallet_importer.unknown_cosigners_types,
sigs_required=wallet_importer.sigs_required,
sigs_total=wallet_importer.sigs_total,
specter=app.specter,
rand=rand,
)
if action == "device":
cosigners = [
app.specter.device_manager.get_by_alias(alias)
for alias in request.form.getlist("devices")
]
2021-05-20 18:26:10 +03:00
if not cosigners:
return render_template(
"wallet/new_wallet/new_wallet.jinja",
wallet_type=wallet_type,
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
error=_(
"No device was selected. Please select a device to create the wallet for."
),
2021-05-20 18:26:10 +03:00
specter=app.specter,
rand=rand,
)
devices = get_devices_with_keys_by_type(app, cosigners, wallet_type)
for device in devices:
if len(device.keys) == 0:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _(
"Device {} doesn't have keys matching this wallet type"
).format(device.name)
break
name = wallet_type.title()
wallet_name = name
i = 2
while wallet_name in app.specter.wallet_manager.wallets_names:
wallet_name = "%s %d" % (name, i)
i += 1
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
sigs_required=max(len(devices) * 2 // 3, 1),
error=err,
specter=app.specter,
rand=rand,
)
if action == "key" and err is None:
2021-02-19 11:52:06 +02:00
wallet_name = request.form["wallet_name"]
address_type = request.form["type"]
sigs_total = int(request.form.get("sigs_total", 1))
sigs_required = int(request.form.get("sigs_required", 1))
if wallet_name in app.specter.wallet_manager.wallets_names:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _("Wallet already exists")
if err:
devices = [
app.specter.device_manager.get_by_alias(
request.form.get("cosigner{}".format(i))
)
for i in range(0, sigs_total)
]
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
sigs_required=max(len(devices) * 2 // 3, 1),
error=err,
specter=app.specter,
rand=rand,
)
keys = []
cosigners = []
devices = []
for i in range(sigs_total):
try:
2021-02-19 11:52:06 +02:00
key = request.form["key%d" % i]
cosigner_name = request.form["cosigner%d" % i]
cosigner = app.specter.device_manager.get_by_alias(cosigner_name)
cosigners.append(cosigner)
for k in cosigner.keys:
if k.original == key:
keys.append(k)
break
except:
pass
if len(keys) != sigs_total or len(cosigners) != sigs_total:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _(
"No keys were selected for device, please try adding keys first"
)
devices = [
app.specter.device_manager.get_by_alias(
request.form.get("cosigner{}".format(i))
)
for i in range(0, sigs_total)
]
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
cosigners=devices,
wallet_type=wallet_type,
sigs_total=len(devices),
sigs_required=max(len(devices) * 2 // 3, 1),
error=err,
specter=app.specter,
rand=rand,
)
# create a wallet here
try:
wallet = app.specter.wallet_manager.create_wallet(
wallet_name, sigs_required, address_type, keys, cosigners
)
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
err = _("Failed to create wallet. Error: {}").format(e)
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
cosigners=cosigners,
wallet_type=wallet_type,
sigs_total=len(devices),
sigs_required=max(len(devices) * 2 // 3, 1),
error=err,
specter=app.specter,
rand=rand,
)
app.logger.info("Created Wallet %s" % wallet_name)
rescan_blockchain = "rescanblockchain" in request.form
if rescan_blockchain:
# old wallet - import more addresses
wallet.keypoolrefill(0, wallet.IMPORT_KEYPOOL, change=False)
wallet.keypoolrefill(0, wallet.IMPORT_KEYPOOL, change=True)
2021-02-19 11:52:06 +02:00
if "utxo" in request.form.get("full_rescan_option"):
explorer = None
if "use_explorer" in request.form:
if request.form["explorer"] == "CUSTOM":
explorer = request.form["custom_explorer"]
else:
explorer = app.config["EXPLORERS_LIST"][
request.form["explorer"]
]["url"]
wallet.rescanutxo(
explorer,
app.specter.requests_session(explorer.endswith(".onion")),
app.specter.only_tor,
)
app.specter.info["utxorescan"] = 1
app.specter.utxorescanwallet = wallet.alias
else:
app.logger.info("Rescanning Blockchain ...")
startblock = int(request.form["startblock"])
try:
wallet.rpc.rescanblockchain(startblock, no_wait=True)
except Exception as e:
handle_exception(e)
err = "%r" % e
wallet.getdata()
return redirect(
url_for("wallets_endpoint.receive", wallet_alias=wallet.alias)
+ "?newwallet=true"
)
if action == "preselected_device":
return render_template(
"wallet/new_wallet/new_wallet_keys.jinja",
cosigners=[
app.specter.device_manager.get_by_alias(request.form["device"])
],
wallet_type="simple",
sigs_total=1,
sigs_required=1,
error=err,
specter=app.specter,
rand=rand,
)
return render_template(
"wallet/new_wallet/new_wallet.jinja",
wallet_type=wallet_type,
error=err,
specter=app.specter,
rand=rand,
)
################## Wallet pages #######################
###### Wallet index page ######
@wallets_endpoint.route("/wallet/<wallet_alias>/")
@login_required
def wallet(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
UIUX: Overhaul of UTXO list, handling of locked UTXOs and scrollbar added to tx-table web component (#1580) * Added tests/bitcoin to gitignore * Ensure locked UTXO can't be used for transactions, fix rounding error in coin selection, fix styling/text in general settings. * overhaul of checkbox logic in utxolist including mouseover event for checkboxes, manage psbt button action added, icon info popups added,design changes in utxo- and txlist to make the display quieter * change of balance display, scrollbars for main and tx table, bugfixes (pagination, coin selection, unsigned labeling) & some styling finetuning * deleted locked utxo balance calculations, added doc strings regarding balances * jinja comment added in tx table, making scrollbar less vivid, tx table settings changed to no compact view toggle and scrollbar on by default * more granular amount properties, little test fix. * applying new amount properties to the frontend and other parts of the code & improving balance display design * refactored a_simple_wallet to be only used in test_rest once * tests for amounts and test performance optimisations. * fix spec_node_configured * fix spec_wallet_send.js * fix spec_wallet_utxo.js * keep action teaser div hidden on wallets overview. * minor bug fix in tx-table, added includeShadowDom to cypress.json, adapted spec_wallet_utxo.js to new utxo list logic and added tests of new functionality to it. * fix spec_plugins.js and switch back to includeShadowDom false The problem with true is, that you are no longer able to spot when you need to apply the workaround described in https://docs.cypress.io/api/commands/shadow#Known-Issue as you only need to apply in a shadow-DOM. Feel free to switch it back in any test you see fit. Cypress.config('includeShadowDom',true) * better organisation of wallet utxo spec file * some wait-tweaks to cypress tests to make them run smoother on cirrus, note: cypress tests green in local dev. * longer wait in spec_elm_multi_segwit_wallet.js * fixing spec_elm_multi_segwit_wallet.js * more checks whether checkboxes get selected and additional waits for cirrus in spec_wallet_utxo.js. Co-authored-by: Kim Neunert <k9ert@gmx.de>
2022-04-08 11:07:01 +02:00
if wallet.amount_total > 0:
return redirect(url_for("wallets_endpoint.history", wallet_alias=wallet_alias))
else:
return redirect(url_for("wallets_endpoint.receive", wallet_alias=wallet_alias))
###### Wallet transaction history ######
@wallets_endpoint.route("/wallet/<wallet_alias>/history/", methods=["GET", "POST"])
@login_required
def history(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
tx_list_type = "txlist"
if request.method == "POST":
action = request.form["action"]
if action == "freezeutxo":
wallet.toggle_freeze_utxo(request.form.getlist("selected_utxo"))
tx_list_type = "utxo"
elif action == "abandon_tx":
txid = request.form["txid"]
try:
wallet.abandontransaction(txid)
except SpecterError as e:
flash(str(e), "error")
# update balances in the wallet
app.specter.check_blockheight()
wallet.update_balance()
wallet.check_utxo()
return render_template(
"wallet/history/wallet_history.jinja",
wallet_alias=wallet_alias,
wallet=wallet,
tx_list_type=tx_list_type,
specter=app.specter,
rand=rand,
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
services=app.specter.service_manager.services,
)
###### Wallet receive ######
@wallets_endpoint.route("/wallet/<wallet_alias>/receive/", methods=["GET", "POST"])
@login_required
@check_wallet
def receive(wallet_alias):
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
wallet: Wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
if request.method == "POST":
action = request.form["action"]
if action == "newaddress":
wallet.getnewaddress()
elif action == "updatelabel":
2021-02-19 11:52:06 +02:00
label = request.form["label"]
wallet.setlabel(wallet.address, label)
# check that current address is unused
# and generate new one if it is
wallet.check_unused()
return render_template(
"wallet/receive/wallet_receive.jinja",
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
###### Wallet send ######
@wallets_endpoint.route("/wallet/<wallet_alias>/send")
@login_required
def send(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
if len(wallet.pending_psbts) > 0:
return redirect(
url_for("wallets_endpoint.send_pending", wallet_alias=wallet_alias)
)
else:
return redirect(url_for("wallets_endpoint.send_new", wallet_alias=wallet_alias))
@wallets_endpoint.route("/wallet/<wallet_alias>/send/new", methods=["GET", "POST"])
@login_required
def send_new(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
# update balances in the wallet
wallet.update_balance()
# update utxo list for coin selection
wallet.check_utxo()
psbt = None
addresses = [""]
labels = [""]
amounts = [0]
amount_units = ["btc"]
err = None
ui_option = "ui"
recipients_txt = ""
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
fillform = False
subtract = False
subtract_from = 1
fee_options = "dynamic"
rbf = not app.specter.is_liquid
rbf_utxo = []
rbf_tx_id = ""
selected_coins = request.form.getlist("coinselect")
UIUX: Overhaul of UTXO list, handling of locked UTXOs and scrollbar added to tx-table web component (#1580) * Added tests/bitcoin to gitignore * Ensure locked UTXO can't be used for transactions, fix rounding error in coin selection, fix styling/text in general settings. * overhaul of checkbox logic in utxolist including mouseover event for checkboxes, manage psbt button action added, icon info popups added,design changes in utxo- and txlist to make the display quieter * change of balance display, scrollbars for main and tx table, bugfixes (pagination, coin selection, unsigned labeling) & some styling finetuning * deleted locked utxo balance calculations, added doc strings regarding balances * jinja comment added in tx table, making scrollbar less vivid, tx table settings changed to no compact view toggle and scrollbar on by default * more granular amount properties, little test fix. * applying new amount properties to the frontend and other parts of the code & improving balance display design * refactored a_simple_wallet to be only used in test_rest once * tests for amounts and test performance optimisations. * fix spec_node_configured * fix spec_wallet_send.js * fix spec_wallet_utxo.js * keep action teaser div hidden on wallets overview. * minor bug fix in tx-table, added includeShadowDom to cypress.json, adapted spec_wallet_utxo.js to new utxo list logic and added tests of new functionality to it. * fix spec_plugins.js and switch back to includeShadowDom false The problem with true is, that you are no longer able to spot when you need to apply the workaround described in https://docs.cypress.io/api/commands/shadow#Known-Issue as you only need to apply in a shadow-DOM. Feel free to switch it back in any test you see fit. Cypress.config('includeShadowDom',true) * better organisation of wallet utxo spec file * some wait-tweaks to cypress tests to make them run smoother on cirrus, note: cypress tests green in local dev. * longer wait in spec_elm_multi_segwit_wallet.js * fixing spec_elm_multi_segwit_wallet.js * more checks whether checkboxes get selected and additional waits for cirrus in spec_wallet_utxo.js. Co-authored-by: Kim Neunert <k9ert@gmx.de>
2022-04-08 11:07:01 +02:00
# Additional server side check not to use frozen UTXO as a precaution
frozen_utxo = wallet.frozen_utxo
for utxo in selected_coins:
if utxo in frozen_utxo:
selected_coins.remove(utxo)
flash(f"You've selected a frozen UTXO for a transaction.", "error")
return redirect(
url_for("wallets_endpoint.history", wallet_alias=wallet_alias)
)
if request.method == "POST":
action = request.form.get("action")
rbf_tx_id = request.form.get("rbf_tx_id", "")
if action == "createpsbt":
psbt_creator = PsbtCreator(
app.specter,
wallet,
request.form.get("ui_option", "ui"),
request_form=request.form,
recipients_txt=request.form["recipients"],
recipients_amount_unit=request.form.get("amount_unit_text"),
)
psbt = psbt_creator.create_psbt(wallet)
return render_template(
"wallet/send/sign/wallet_send_sign_psbt.jinja",
psbt=psbt,
labels=labels,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
elif action in ["rbf", "rbf_cancel"]:
try:
2021-02-19 11:52:06 +02:00
rbf_tx_id = request.form["rbf_tx_id"]
rbf_fee_rate = float(request.form["rbf_fee_rate"])
if action == "rbf":
psbt = wallet.bumpfee(rbf_tx_id, rbf_fee_rate)
elif action == "rbf_cancel":
psbt = wallet.canceltx(rbf_tx_id, rbf_fee_rate)
else:
raise SpecterError("Invalid action")
if psbt["fee_rate"] - rbf_fee_rate > wallet.MIN_FEE_RATE / 10:
flash(
_(
"We had to increase the fee rate from {} to {} sat/vbyte"
).format(rbf_fee_rate, psbt["fee_rate"])
)
return render_template(
"wallet/send/sign/wallet_send_sign_psbt.jinja",
psbt=psbt,
labels=[],
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Failed to perform RBF. Error: {}").format(e), "error")
return redirect(
url_for("wallets_endpoint.history", wallet_alias=wallet_alias)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
)
elif action == "rbf_edit":
try:
decoded_tx = wallet.decode_tx(rbf_tx_id)
addresses = decoded_tx["addresses"]
amounts = decoded_tx["amounts"]
amount_units = decoded_tx.get("assets", ["btc"] * len(addresses))
# get_label returns a label or address if no label is set
labels = [wallet.getlabel(addr) for addr in addresses]
# set empty label to addresses that don't have labels
labels = [
label if label != addr else ""
for addr, label in zip(addresses, labels)
]
selected_coins = [
f"{utxo['txid']}, {utxo['vout']}"
for utxo in decoded_tx["used_utxo"]
]
fee_rate = float(request.form["rbf_fee_rate"])
fee_options = "manual"
rbf = True
fillform = True
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Failed to perform RBF. Error: {}").format(e), "error")
elif action == "signhotwallet":
passphrase = request.form["passphrase"]
2021-05-20 18:26:10 +03:00
psbt = json.loads(request.form["psbt"])
current_psbt = wallet.pending_psbts[psbt["tx"]["txid"]]
b64psbt = str(current_psbt)
device = request.form["device"]
if "devices_signed" not in psbt or device not in psbt["devices_signed"]:
try:
# get device and sign with it
signed_psbt = app.specter.device_manager.get_by_alias(
device
).sign_psbt(b64psbt, wallet, passphrase)
raw = None
if signed_psbt["complete"]:
raw = wallet.rpc.finalizepsbt(b64psbt)
current_psbt.update(signed_psbt["psbt"], raw)
signed_psbt = signed_psbt["psbt"]
psbt = current_psbt.to_dict()
except Exception as e:
handle_exception(e)
signed_psbt = None
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Failed to sign PSBT: {}").format(e), "error")
else:
signed_psbt = None
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Device already signed the PSBT"), "error")
return render_template(
"wallet/send/sign/wallet_send_sign_psbt.jinja",
signed_psbt=signed_psbt,
psbt=psbt,
labels=labels,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
elif action == "fillform":
# TODO: Not yet used. Remove if the use case doesn't happen.
# can be used to recommend a transaction from a service (goind to an exchange or so)
addresses = request.form.getlist("addresses[]")
labels = request.form.getlist("labels[]")
amounts = request.form.getlist("amounts[]")
fillform = True
if rbf_tx_id:
try:
rbf_utxo = wallet.get_rbf_utxo(rbf_tx_id)
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Failed to get RBF coins. Error: {}").format(e), "error")
show_advanced_settings = (
UIUX: Overhaul of UTXO list, handling of locked UTXOs and scrollbar added to tx-table web component (#1580) * Added tests/bitcoin to gitignore * Ensure locked UTXO can't be used for transactions, fix rounding error in coin selection, fix styling/text in general settings. * overhaul of checkbox logic in utxolist including mouseover event for checkboxes, manage psbt button action added, icon info popups added,design changes in utxo- and txlist to make the display quieter * change of balance display, scrollbars for main and tx table, bugfixes (pagination, coin selection, unsigned labeling) & some styling finetuning * deleted locked utxo balance calculations, added doc strings regarding balances * jinja comment added in tx table, making scrollbar less vivid, tx table settings changed to no compact view toggle and scrollbar on by default * more granular amount properties, little test fix. * applying new amount properties to the frontend and other parts of the code & improving balance display design * refactored a_simple_wallet to be only used in test_rest once * tests for amounts and test performance optimisations. * fix spec_node_configured * fix spec_wallet_send.js * fix spec_wallet_utxo.js * keep action teaser div hidden on wallets overview. * minor bug fix in tx-table, added includeShadowDom to cypress.json, adapted spec_wallet_utxo.js to new utxo list logic and added tests of new functionality to it. * fix spec_plugins.js and switch back to includeShadowDom false The problem with true is, that you are no longer able to spot when you need to apply the workaround described in https://docs.cypress.io/api/commands/shadow#Known-Issue as you only need to apply in a shadow-DOM. Feel free to switch it back in any test you see fit. Cypress.config('includeShadowDom',true) * better organisation of wallet utxo spec file * some wait-tweaks to cypress tests to make them run smoother on cirrus, note: cypress tests green in local dev. * longer wait in spec_elm_multi_segwit_wallet.js * fixing spec_elm_multi_segwit_wallet.js * more checks whether checkboxes get selected and additional waits for cirrus in spec_wallet_utxo.js. Co-authored-by: Kim Neunert <k9ert@gmx.de>
2022-04-08 11:07:01 +02:00
ui_option != "ui" or subtract or fee_options != "dynamic" or not rbf
)
2021-06-20 17:19:47 +02:00
wallet_utxo = wallet.utxo
if app.specter.is_liquid:
for tx in wallet_utxo + rbf_utxo:
if "asset" in tx:
tx["assetlabel"] = app.specter.asset_label(tx.get("asset"))
return render_template(
"wallet/send/new/wallet_send.jinja",
psbt=psbt,
ui_option=ui_option,
recipients_txt=recipients_txt,
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
addresses=addresses,
labels=labels,
amounts=amounts,
fillform=fillform,
recipients=list(zip(addresses, amounts, amount_units, labels)),
subtract=subtract,
subtract_from=subtract_from,
fee_options=fee_options,
rbf=rbf,
selected_coins=selected_coins,
show_advanced_settings=show_advanced_settings,
rbf_utxo=rbf_utxo,
rbf_tx_id=rbf_tx_id,
2021-06-20 17:19:47 +02:00
wallet_utxo=wallet_utxo,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
error=err,
)
@wallets_endpoint.route("/wallet/<wallet_alias>/send/pending/", methods=["GET", "POST"])
@login_required
def send_pending(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
if request.method == "POST":
action = request.form["action"]
if action == "deletepsbt":
try:
wallet.delete_pending_psbt(
2021-05-20 18:26:10 +03:00
json.loads(request.form["pending_psbt"])["tx"]["txid"]
)
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Could not delete Pending PSBT!"), "error")
elif action == "openpsbt":
2021-05-20 18:26:10 +03:00
psbt = json.loads(request.form["pending_psbt"])
return render_template(
"wallet/send/sign/wallet_send_sign_psbt.jinja",
psbt=psbt,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
pending_psbts = wallet.pending_psbts_dict()
return render_template(
"wallet/send/pending/wallet_sendpending.jinja",
pending_psbts=pending_psbts,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
)
@wallets_endpoint.route("/wallet/<wallet_alias>/send/import", methods=["GET", "POST"])
@login_required
def import_psbt(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
if request.method == "POST":
action = request.form["action"]
if action == "importpsbt":
try:
b64psbt = "".join(request.form["rawpsbt"].split())
psbt = wallet.importpsbt(
convert_rawtransaction_to_psbt(wallet.rpc, b64psbt)
if is_hex(b64psbt)
else b64psbt
)
except Exception as e:
handle_exception(e)
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Could not import PSBT: {}").format(e), "error")
return redirect(
url_for("wallets_endpoint.import_psbt", wallet_alias=wallet_alias)
)
return render_template(
"wallet/send/sign/wallet_send_sign_psbt.jinja",
psbt=psbt,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
)
err = None
return render_template(
"wallet/send/import/wallet_importpsbt.jinja",
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
error=err,
)
###### Wallet addresses ######
@wallets_endpoint.route("/wallet/<wallet_alias>/addresses/", methods=["GET"])
@login_required
def addresses(wallet_alias):
"""Show informations about cached addresses (wallet._addresses) of the <wallet_alias>.
It updates balances in the wallet before renderization in order to show updated UTXO and
balance of each address."""
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
# update balances in the wallet
app.specter.check_blockheight()
wallet.update_balance()
wallet.check_utxo()
return render_template(
"wallet/addresses/wallet_addresses.jinja",
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
Feature: Service integration - Swan (#1517) * fix create_order issue * fix url and better error-handling * basic balances tab * activating services * Service management * Improve settings page and default to it if token unset * Fix history tab * Fix trade error handling * Add withdraw * calling specter-cloud for creating vaultoro orders * Improve trade screen and fixes * sidebar fix * black * refactor Service integration * refactor to have Service Classes like manifests * maturity * dynamic initialisation of service-classes and blueprints * fix sidebar_services * migrated templates and static into vaultoro folder * refactor config to manifest * some minor things * swan initial * rename and fix test * adding ServiceApiKeyStorageUserAware * fix * store the access token * directory indirection to shield templates from each others blueprint * first attempts with automatic withdrawals * proper tab highlighting * Update service_apikey_storage.py * Update oauth2_success.jinja * Awaiting refresh_token support * Service logo display on Addresses * Associate addr with a Service * address-data component reorg Separates the presentation html from the data as much as possible. * Services data/icon added to tx History * Now hitting the updated Swan endpoint to save deposit addrs * Simplified injecting Services data into JS * Reducing js calls back to server in tx-data; templatizing utxo in/outs * renaming "reserving" to "associating" an Address with a Service. * rename `manifest.py` files to `service.py`. * rename "api_data" to "service_data" to make the storage a bit more generalized. `ServiceApiKeyStorage` is now `ServiceEncryptedStorage` to match. * Beginning of factoring out Swan api to its own `api.py` file; need to rectify with `swan_client.py`. * Removed tx-table/row/data changes and address-table/row/data Kept only the bare minimum changes required to display the Services icon, plus optimizations. * deleted no longer used CustomElement * Adding services docs to mkdocs * Configuration for Services * more clever configuration * fix test * deleted swan_client * Changing the address abbreviation format to 7...7 and little big fix for not vertically aligned addresses in Firefox. * Better state management if Auth method changes * Cleanup, better user messaging; pulling Service methods out of controller and User * Redirect to services endpoint after setting up authentication. * PR cleanup, bug fixes, test suite updates * Fixed test case problem * First fix for delete API key button. * Service hooks; Option to fully remove Swan Integration; Logout clears plaintext_user_secret * Restoring bugfix from @moneymanolis * cleanup and black * Make service-decovery in AppImage work * import hashlib, maybe fix cypress * Update service_encrypted_storage.py * further bugfix on update * TODO: remove debugging in client.py before first release * fix controller-test * fix singleton testing issues Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Kim Neunert <kneunert@gmail.com> Co-authored-by: moneymanolis <moneymanolis@protonmail.com>
2022-01-13 04:47:28 -06:00
services=app.specter.service_manager.services,
)
###### Wallet settings ######
@wallets_endpoint.route("/wallet/<wallet_alias>/settings/", methods=["GET", "POST"])
@login_required
def settings(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
error = None
if request.method == "POST":
action = request.form["action"]
if action == "rescanblockchain":
startblock = int(request.form["startblock"])
try:
delete_file(wallet._transactions.path)
wallet.fetch_transactions()
# This rpc call does not seem to return a result; use no_wait to ignore timeout errors
wallet.rpc.rescanblockchain(startblock, no_wait=True)
except Exception as e:
handle_exception(e)
error = "%r" % e
wallet.getdata()
elif action == "abortrescan":
res = wallet.rpc.abortrescan()
if not res:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
error = _("Failed to abort rescan. Maybe already complete?")
wallet.getdata()
elif action == "rescanutxo":
explorer = None
if "use_explorer" in request.form:
if request.form["explorer"] == "CUSTOM":
explorer = request.form["custom_explorer"]
else:
explorer = app.config["EXPLORERS_LIST"][request.form["explorer"]][
"url"
]
wallet.rescanutxo(
explorer,
app.specter.requests_session(explorer and explorer.endswith(".onion")),
app.specter.only_tor,
)
app.specter.info["utxorescan"] = 1
app.specter.utxorescanwallet = wallet.alias
flash(
"Rescan started. Check the status bar on the left for progress and/or the logs for potential issues."
)
elif action == "abortrescanutxo":
app.specter.node.abortrescanutxo()
app.specter.info["utxorescan"] = None
app.specter.utxorescanwallet = None
flash(_("Successfully aborted the UTXO rescan"))
elif action == "import_address_labels":
address_labels = request.form["address_labels_data"]
imported_addresses_len = wallet.import_address_labels(address_labels)
if imported_addresses_len > 1:
flash(f"Successfully imported {imported_addresses_len} address labels.")
elif imported_addresses_len == 1:
flash(f"Successfully imported {imported_addresses_len} address label.")
else:
flash("No address labels were imported.")
elif action == "keypoolrefill":
delta = int(request.form["keypooladd"])
wallet.keypoolrefill(wallet.keypool, wallet.keypool + delta)
wallet.keypoolrefill(
wallet.change_keypool, wallet.change_keypool + delta, change=True
)
wallet.getdata()
elif action == "deletewallet":
app.specter.wallet_manager.delete_wallet(
wallet, app.specter.bitcoin_datadir, app.specter.chain
)
response = redirect(url_for("index"))
return response
elif action == "rename":
2021-02-19 11:52:06 +02:00
wallet_name = request.form["newtitle"]
if not wallet_name:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Wallet name cannot be empty"), "error")
elif wallet_name == wallet.name:
pass
elif wallet_name in app.specter.wallet_manager.wallets_names:
Babel integration (#1247) * Default bitcoind timeout to 60s for all platforms * Create bitcoind_setup_tasks.py * Missing prop setter bugfix Fixes #1221 * Early progress check-in * Docs update, initial FR translation file * Lots more text wrapping, babel.cfg fix for html * docs update * Updated translator procedures, added initial German, Hebrew, and Portugese files * Update README.md * Update README.md * Update messages.po Started the translation process using Poedit. Lines * Test first modif in ES First modification (only adding one line here) using Poedit and following the translation steps given by kdmukai. If everything is working well here I am ready to start translating. * Update messages.po * Bugfix; multi-language mnemonic support * Explicit language selection * Translation support for strings with variable insertions * Bugfixes; define supported langages in only one place * Cleanup * Update messages.po * Update messages.po * Latest translations integrated * Regenerating messages; disabling fuzzy matching * Compiled messages * template bugfixes * Use jinja's "tojson" to safely escape account_map device labels * Update wallet_pdf.jinja * Update helpers.py * Update node.py * Bugfixes * Updated requirements.txt; bugfix on language selection on Settings * Update wallets.py * Require `mnemonic==0.19` for multi-language BIP39 wordlists * Update iw translation * "he" language code fix for Hebrew * Update README.md * Adding blank Greek file; minor README update * Update messages.po 50% on this ... My ass is flat. * Spanish translation file updated * Update messages.po * Extracted from the latest code; recompiled with the latest translations * Added missing wrapped strings * Update messages.po * Updated Spanish translations * Adding blank Dutch ("nl") translation file * Blank Korean ("ko") translation file * Blank Portugese ("pt") file updated * Blank Turkish ("tr") translation file * Adding blank Serbian ("sr") translation file * Update messages.po * Compiled latest Spanish translations * Translation progress Translated the first 181 strings * Blank Italian ("it") translation file * More translation work done 6667810 strings translated. Nice number, guess I'll stop here :) * Compiled first batch of German translations * Update messages.po * Translation 100% All done. Would be extra pleased if my name popped up somewhere in credits. Not required though :) * Update messages.po * Update messages.po All done !!! :) * Compiled in initial Greek translations * Updated completion of German translation * Initial Dutch translations compiled in * Compiled full Spanish translations * Re-ran extraction, update, compile * Update Dutch translation * Blank Icelandic ("is") translation file * Blank Chinese (zh_Hans_CN and zh_hant_TW) translation files * Compiled latest Dutch translations * Add missing strings to translation files * Blank Swedish (sv) translation file * Blank Polish ("pl") translation file * Blank Bulgarian ("bg") translation file * Blank Russian ("ru") translation file * Swedish 30% done * Update messages.po * Blank Croatian ("hr") translation file * Delete messages.mo * Added translator Also fixed some warnings in poedit * Babel docs update * Compiled latest Dutch and Swedish translations * Update messages.po Completed 100% * Update wallets.py * Compiled in latest German translations * Update messages.po * Extracted, updated, compiled translation files * Compiled in first batch of Polish translations * Update messages.po More translations. * Compiled latest Polish translations * Hindi, Tamil, Malayalam translation files * Completed Swedish translation * 80% complete * Blank Finnish ("fi") translation file * Compiled latest Swedish translations * Full update and recompile of Swedish * Compiled Polish translations * Full update and recompile for Polish * Update messages.po * Updating Poedit docs * Removed word wrap; compiled latest Dutch * Hindi Translation --initial * updated w/no line wrap; compiled first Hindi translations * Update messages.po * Update messages.po Initial and partial test Bulgarian commit * updated and compiled initial Bulgarian translations. * Bugfix on text wrapping * Update messages.po * Update messages.po BG translation ~25% complete * Fully completed polish translation (first draft) Probably needs some further tweaking here and there. * Start Russian translation * Russian translation 30% complete * Format fixes * Compiled latest French translations * Compiled latest Chinese (Traditional) translations * Compiled latest Bulgarian translations * Compiled latest Polish translations * Compiled latest Russian translations * Update French to 36% * Update messages.po * Compiled in latest French translations * Compiled latest Dutch translations * Russian 70% complete * Update messages.po * Russian 100% complete * Update French to 44% Slowly but surely * Adds in-progress languages; latest Russian translations compiled * Extracted latest; updated Russian translation file. * Compiled latest Chinese (Traditional) translations * Updated and compiled Chinese (Traditional) * Compiled latest Russian translations * Updated and compiled latest French translations * Updated all translation files * Fix double quotes format issue Co-authored-by: Kim Neunert <k9ert@gmx.de> Co-authored-by: 2a3dex <58116837+2a3dex@users.noreply.github.com> Co-authored-by: rafa1239 <raphael.altieri@gmail.com> Co-authored-by: benk10 <ben.kaufman10@gmail.com> Co-authored-by: Volker Herminghaus <volker@bitcorn.wtf> Co-authored-by: glowleaf <69010742+glowleaf@users.noreply.github.com> Co-authored-by: DirkVdk <86686185+DirkVdk@users.noreply.github.com> Co-authored-by: mutatrum <mutatrum@gmail.com> Co-authored-by: Kryptoministern <77808545+Kryptoministern@users.noreply.github.com> Co-authored-by: PommbearBTC <86745004+PommbearBTC@users.noreply.github.com> Co-authored-by: Gummybear <holuan@gmail.com> Co-authored-by: sreshta suresh <sreshtasuresh@gmail.com> Co-authored-by: KST-Energy <82534243+KST-Energy@users.noreply.github.com> Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com> Co-authored-by: dudezoo <86764634+dudezoo@users.noreply.github.com> Co-authored-by: Sergei Tikhomirov <sergey.s.tikhomirov@gmail.com> Co-authored-by: Bitpaint <67663265+bitpaint@users.noreply.github.com>
2021-07-05 17:14:19 -05:00
flash(_("Wallet already exists"), "error")
else:
app.specter.wallet_manager.rename_wallet(wallet, wallet_name)
scroll_to_rescan_blockchain = request.args.get("rescan_blockchain")
return render_template(
"wallet/settings/wallet_settings.jinja",
purposes=purposes,
wallet_alias=wallet_alias,
wallet=wallet,
specter=app.specter,
rand=rand,
error=error,
scroll_to_rescan_blockchain=scroll_to_rescan_blockchain,
)