Skip to content

Commit

Permalink
[ADD] Get public master keys with different witness types
Browse files Browse the repository at this point in the history
  • Loading branch information
mccwdev committed Oct 16, 2023
1 parent f68947e commit 61cbe59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bitcoinlib/wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4100,7 +4100,7 @@ def wif(self, is_private=False, account_id=0):
wiflist.append(cs.wif(is_private=is_private))
return wiflist

def public_master(self, account_id=None, name=None, as_private=False, network=None):
def public_master(self, account_id=None, name=None, as_private=False, witness_type=None, network=None):
"""
Return public master key(s) for this wallet. Use to import in other wallets to sign transactions or create keys.
Expand All @@ -4127,9 +4127,10 @@ def public_master(self, account_id=None, name=None, as_private=False, network=No
key = self.main_key
return key if as_private else key.public()
elif not self.cosigner:
witness_type = witness_type if witness_type else self.witness_type
depth = -self.key_depth + self.depth_public_master
key = self.key_for_path([], depth, name=name, account_id=account_id, network=network,
cosigner_id=self.cosigner_id)
cosigner_id=self.cosigner_id, witness_type=witness_type)
return key if as_private else key.public()
else:
pm_list = []
Expand Down

0 comments on commit 61cbe59

Please sign in to comment.