Skip to content

Commit

Permalink
also tries to get descriptor from qr:urtype.Account
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Do committed Jul 21, 2024
1 parent 5c42590 commit ca61e0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/krux/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ def parse_wallet(wallet_data, allow_assumption=None):
except:
pass

# Try to parse as a Crypto-Account type
try:
account = urtypes.crypto.Account.from_cbor(
wallet_data.cbor
).output_descriptors[0]
return Descriptor.from_string(account.descriptor()), None
except:
pass

# Treat the UR as a generic UR bytes object and extract the data for further processing
wallet_data = urtypes.Bytes.from_cbor(wallet_data.cbor).data

Expand Down

0 comments on commit ca61e0d

Please sign in to comment.