-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Highlights** - Full support for **Foundation Passport**, **Trezor**, **Keystone** (full UR support) - **SyncChat** for Label Synchronization backup and Multi-party Multisig Collaboration can now be enabled in the last wallet setup wizard step - Send dialog: Highlight projected block matching the selected fee rate - Balance Statement PDF Export - Transaction diagram navigation by clicking on inputs and outputs **UI Improvements and Bug Fixes** - Improvements in **SyncChat** and **USB connection** reliability and UI - Added a lot more extensive testing - Better hardware signer images and icons thanks to [BitcoinUI](https://github.com/reez/BitcoinUI)
- Loading branch information
1 parent
e97093b
commit 56d4fe6
Showing
207 changed files
with
37,502 additions
and
30,961 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Test DMG | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tags: | ||
description: 'Test Build DMG' | ||
required: false | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-14 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
|
||
|
||
- name: Run build script | ||
run: tools/build-mac/make_osx.sh | ||
|
||
|
||
- name: Check for DMG file | ||
run: | | ||
if [ -z "$(find dist -type f -name '*.dmg')" ]; then | ||
echo "dmg file is missing" | ||
exit 1 | ||
fi | ||
- name: Upload DMG Files from dist/ | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dmgs | ||
path: dist/*.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# this is the source of the version information | ||
__version__ = "1.0.0b4" | ||
__version__ = "1.0.0b5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# | ||
# Bitcoin Safe | ||
# Copyright (C) 2024 Andreas Griffin | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of version 3 of the GNU General Public License as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html | ||
# | ||
# The above copyright notice and this permission notice shall be | ||
# included in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
|
||
import logging | ||
|
||
from bitcoin_safe.gui.qt.util import save_file_dialog | ||
from bitcoin_safe.hardware_signers import DescriptorExportType, DescriptorExportTypes | ||
from bitcoin_safe.wallet import filename_clean | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
from typing import Optional | ||
|
||
import bdkpython as bdk | ||
from bitcoin_qr_tools.data import ConverterMultisigWalletExport | ||
from bitcoin_qr_tools.signer_info import SignerInfo | ||
from bitcoin_usb.address_types import DescriptorInfo | ||
|
||
from .descriptors import MultipathDescriptor | ||
|
||
|
||
class DescriptorExportTools: | ||
|
||
@classmethod | ||
def _get_coldcard_str(cls, wallet_id: str, multipath_descriptor: MultipathDescriptor) -> str: | ||
return f"""# Coldcard descriptor export of wallet: {filename_clean( wallet_id, file_extension='', replace_spaces_by='_')} | ||
{ multipath_descriptor.bdk_descriptors[0].as_string() }""" | ||
|
||
@staticmethod | ||
def _get_passport_str(wallet_id: str, descriptor_str: str, hardware_signer_name="Passport") -> str: | ||
infos = DescriptorInfo.from_str(descriptor_str) | ||
signer_infos = [ | ||
SignerInfo( | ||
xpub=spk_provider.xpub, | ||
fingerprint=spk_provider.fingerprint, | ||
key_origin=spk_provider.key_origin, | ||
derivation_path=spk_provider.derivation_path, | ||
) | ||
for spk_provider in infos.spk_providers | ||
] | ||
return ConverterMultisigWalletExport( | ||
name=filename_clean(wallet_id, file_extension="", replace_spaces_by="_"), | ||
threshold=infos.threshold, | ||
address_type_short_name=infos.address_type.short_name.upper(), | ||
signer_infos=signer_infos, | ||
).to_custom_str(hardware_signer_name=hardware_signer_name) | ||
|
||
@classmethod | ||
def _get_keystone_str(cls, wallet_id: str, descriptor_str: str, network: bdk.Network) -> str: | ||
return cls._get_passport_str( | ||
wallet_id=wallet_id, descriptor_str=descriptor_str, hardware_signer_name="Keystone" | ||
) | ||
|
||
@classmethod | ||
def _get_specter_diy_str(cls, wallet_id: str, descriptor_str: str) -> str: | ||
simplified_descriptor = ( | ||
descriptor_str.split("#")[0].replace("/<0;1>/*", "").replace("0/*", "").replace("1/*", "") | ||
) | ||
return f"addwallet {filename_clean( wallet_id, file_extension='', replace_spaces_by='_')}&{simplified_descriptor}" | ||
|
||
@classmethod | ||
def _export_wallet(cls, wallet_id: str, s: str, descripor_type: DescriptorExportType) -> Optional[str]: | ||
filename = save_file_dialog( | ||
name_filters=["Text (*.txt)", "All Files (*.*)"], | ||
default_suffix="txt", | ||
default_filename=filename_clean(wallet_id, file_extension=".txt", replace_spaces_by="_")[:24], | ||
window_title=f"Export Wallet for {descripor_type.display_name}", | ||
) | ||
if not filename: | ||
return None | ||
|
||
with open(filename, "w") as file: | ||
file.write(s) | ||
return filename | ||
|
||
@classmethod | ||
def get_export_str( | ||
cls, | ||
wallet_id: str, | ||
multipath_descriptor: MultipathDescriptor, | ||
network: bdk.Network, | ||
descriptor_export_type: DescriptorExportType, | ||
) -> str: | ||
if descriptor_export_type.name == DescriptorExportTypes.text.name: | ||
return multipath_descriptor.as_string() | ||
elif descriptor_export_type.name == DescriptorExportTypes.coldcard.name: | ||
return cls._get_coldcard_str(wallet_id=wallet_id, multipath_descriptor=multipath_descriptor) | ||
elif descriptor_export_type.name == DescriptorExportTypes.passport.name: | ||
return cls._get_passport_str( | ||
wallet_id=wallet_id, | ||
descriptor_str=multipath_descriptor.as_string(), | ||
) | ||
elif descriptor_export_type.name == DescriptorExportTypes.keystone.name: | ||
return cls._get_keystone_str( | ||
wallet_id=wallet_id, descriptor_str=multipath_descriptor.as_string(), network=network | ||
) | ||
elif descriptor_export_type.name == DescriptorExportTypes.specterdiy.name: | ||
return cls._get_specter_diy_str( | ||
wallet_id=wallet_id, descriptor_str=multipath_descriptor.as_string() | ||
) | ||
else: | ||
raise NotImplementedError(f"Cannot export descritpor for type {descriptor_export_type}") | ||
|
||
@classmethod | ||
def export( | ||
cls, | ||
wallet_id: str, | ||
multipath_descriptor: MultipathDescriptor, | ||
network: bdk.Network, | ||
descripor_type: DescriptorExportType, | ||
): | ||
if descripor_type.name not in [t.name for t in DescriptorExportTypes.as_list()]: | ||
logger.error(f"Cannot export the descriptor for {descripor_type}") | ||
return | ||
|
||
cls._export_wallet( | ||
wallet_id=wallet_id, | ||
s=cls.get_export_str( | ||
wallet_id=wallet_id, | ||
multipath_descriptor=multipath_descriptor, | ||
network=network, | ||
descriptor_export_type=descripor_type, | ||
), | ||
descripor_type=descripor_type, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.