Skip to content

Commit

Permalink
Merge pull request #8 from Jwyman328/release-0.6.0
Browse files Browse the repository at this point in the history
Release 0.6.0
  • Loading branch information
Jwyman328 authored Sep 1, 2024
2 parents 781b35d + 0c06836 commit 0671163
Show file tree
Hide file tree
Showing 38 changed files with 1,027 additions and 380 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@

# 0.6.0
- Improve fee estimate
- Display total USD value in Batch input header
- Bug fixes
- Clear batch tx estimate after output count changes.
- Handle hardware wallet xpub not found error handling
- Code refactors
- Enum for page routes
- Refactor descriptor functions.
- improve hardware wallet flow with state enum.
- Improve variable naming (multisigWalletDetails -> keyDetails)

# 0.5.0
- Transaction output selection.
- Separate batch vs single tx ui.
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ https://github.com/user-attachments/assets/42f34e55-e6ef-4519-9754-dadb7fed4f7b
https://github.com/user-attachments/assets/ca5f1332-5443-4283-8c0d-54bdf4363e11









# Development

## Prerequisits
Expand All @@ -39,13 +32,13 @@ $ brew install libusb
- Use the script update_app_version.sh, passing it a new version number and text to append to the change log file.
- If a new version is successfully set then this script will build a new release by running the package_app.sh script.
```bash
$ bash update_app_version.sh "1.2.0" "I am adding another item to the change log"
$ bash scripts/update_app_version.sh "1.2.0" "I am adding another item to the change log"
```

## How to create build
- in a single script you can package the backend and the frontend into a single executable by running
```bash
$ bash package_app.sh
$ bash scripts/package_app.sh
```
- The app build will be available in /release directory

Expand All @@ -65,6 +58,20 @@ $ sudo npm run package
```
- The app build will be available in /release directory

## How to have apple sign app builds
- this script will send zip files of the builds of the arm and intel builds to apple to notarize.
- specify the version of the build, for example (0.6.0)
```bash
$ bash scripts/notarize_mac_app_builds.sh 0.6.0
```

## How to verify mac os app builds have been notarized by apple
- this script will run commands to verify both arm64 and intel based builds
have been signed by apple and can successfully be run on mac os systems.
```bash
$ bash scripts/verify_mac_app_notarizations.sh
```


## How to start app locally
- To startup the electron app run
Expand Down
27 changes: 11 additions & 16 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# TODO frontend
- in batch tx header, show the amount usd below the amount btc.
- changing fee output amount in batch should clear batch fee state.
- refactor hardware wallet select to use a state machine for the varous states of the flow.
// Finish tests before refactoring to state machine model
// Select state machine
// - locked
// - ReadyForPin
// - ReadyForPassphrase
// - available
- use an enum for the page routes.
- better control where wallets are saved and imported from so it is less random. like how sparrow does it
- add a banner for showing that a specific wallet is loaded
- redesign (meet with bitcoin design foundation)
- https://bitcoindesignfoundation.org/
-


# TODOs backend
Expand All @@ -26,24 +19,26 @@
- "Since pyinstaller is not a cross-compiler (which means with pyinstaller you cannot create an executable for any other system than the one you are on), you will have to look for other tools."
- use wine?
- Analyze the build size and try to make it smaller
- e2e tests


# Feature Ideas
- consolidation comparison, and create psbt at end of process.
- ability to toggle fee rate comparing the prevous utxos vs. the hypothetical new one and how they fare in different fee rates
- consolidation recommendation support.
- utxo cost breakdown.
- individual non wallet fee estimation.
- additional hardware wallet support
- additional config wallet support
- add ability to create a batch based off of how much you owe someone. either in btc or in usd?
- so you select the amount you owe and then you can see how much the fee would be.
- add ability to select how many outputs to use in the fee estimation
- resource:
- https://jlopp.github.io/bitcoin-transaction-size-calculator/
- https://bitcoinops.org/en/tools/calc-size/
- gpt response
- a button that generates a summary of your wallet
- it will take into consideration the conditions you set and it will out put that there are like x number of utxos in the different fee ranges set by the user
- maybe a score but probably not since that is subjective
- a chart of the history of fees in bitcoin
- breakdown where the cost comes form for each part of the transaction
- ability to just put in a utxo and test that instead of an entire wallet.
- click on a utxo and get told when it is unspendable.
- add how many outputs a tx would have and have it change the fee estimation.
- send message to a nostr account when a utxo is at a dangerous level.
- if you have many wallets and many utxos like an exchange you probably want to know when one of them is in danger of becoming unspendable. but how do you do this anonymously?

Expand Down
2 changes: 1 addition & 1 deletion backend/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[metadata]
name = local_family_wallet
version = 0.5.0
version = 0.6.0

[options]
packages = src
Expand Down
9 changes: 9 additions & 0 deletions backend/src/controllers/hardware_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ def get_xpub(uuid: str):
uuid, data.account_number, script_type, data.network
)

if xpub is None:
return (
ValidationErrorResponse(
message="Error getting xpub from hardware wallet",
errors=["Error getting xpub from hardware wallet"],
).model_dump(),
400,
)

return GetXpubResponseDto(xpub=xpub).model_dump()

except ValidationError as e:
Expand Down
28 changes: 21 additions & 7 deletions backend/src/controllers/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CreateSpendableWalletRequestDto(BaseModel):
utxoCount: str
minUtxoAmount: str
maxUtxoAmount: str
descriptor: Optional[str] = None


class CreateSpendableWalletResponseDto(BaseModel):
Expand All @@ -80,7 +81,11 @@ def create_wallet():
data = CreateWalletRequestDto.model_validate_json(request.data)

WalletService.create_wallet(
data.descriptor, data.change_descriptor, data.network, data.electrumUrl, data.gapLimit
data.descriptor,
data.change_descriptor,
data.network,
data.electrumUrl,
data.gapLimit,
)

WalletService()
Expand Down Expand Up @@ -154,20 +159,29 @@ def create_spendable_wallet():
Create a new wallet with spendable UTXOs.
"""
try:
data = CreateSpendableWalletRequestDto.model_validate_json(request.data)
data = CreateSpendableWalletRequestDto.model_validate_json(
request.data)

bdk_network: bdk.Network = bdk.Network.__members__[data.network]
wallet_descriptor = WalletService.create_spendable_descriptor(
bdk_network, data.type
)

if data.descriptor is None:
wallet_descriptor = WalletService.create_spendable_descriptor(
bdk_network, data.type
)
else:
wallet_descriptor = bdk.Descriptor(
descriptor=data.descriptor, network=bdk_network
)

if wallet_descriptor is None:
return (
SimpleErrorResponse(message="Error creating wallet").model_dump(),
SimpleErrorResponse(
message="Error creating wallet").model_dump(),
400,
)

wallet = WalletService.create_spendable_wallet(bdk_network, wallet_descriptor)
wallet = WalletService.create_spendable_wallet(
bdk_network, wallet_descriptor)
# fund wallet
try:
wallet_address = wallet.get_address(bdk.AddressIndex.LAST_UNUSED())
Expand Down
3 changes: 2 additions & 1 deletion backend/src/services/hardware_wallet/hardware_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def get_xpub_from_device(
)

except Exception as e:
LOGGER.info("caught it error", error=e)
LOGGER.info("Error getting xpub from hardware device", error=e)
return None

return xpub

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,27 @@ def test_get_xpub_controller_invalid_network(self):
"message": "Error getting xpub from hardware wallet",
"errors": ANY,
}

def test_get_xpub_xpub_not_found_error(self):
with patch.object(
HardwareWalletService,
"get_xpub_from_device",
return_value=None,
) as get_xpub_from_device_mock:
response = self.test_client.post(
"hardware-wallets/unlock/mock_uuid/xpub",
json={
"derivation_path": "m/86'/0'/0'/0/0",
"account_number": 1,
"network": "BITCOIN",
},
)
get_xpub_from_device_mock.assert_called_once_with(
"mock_uuid", 1, common.AddressType.TAP, Chain.MAIN
)

assert response.status == "400 BAD REQUEST"
assert json.loads(response.data) == {
"message": "Error getting xpub from hardware wallet",
"errors": ANY,
}
Loading

0 comments on commit 0671163

Please sign in to comment.