當前位置: 首頁>>代碼示例>>Python>>正文


Python CCProtocolPacker.get_xpub方法代碼示例

本文整理匯總了Python中ckcc.protocol.CCProtocolPacker.get_xpub方法的典型用法代碼示例。如果您正苦於以下問題:Python CCProtocolPacker.get_xpub方法的具體用法?Python CCProtocolPacker.get_xpub怎麽用?Python CCProtocolPacker.get_xpub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ckcc.protocol.CCProtocolPacker的用法示例。


在下文中一共展示了CCProtocolPacker.get_xpub方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_xpub

# 需要導入模塊: from ckcc.protocol import CCProtocolPacker [as 別名]
# 或者: from ckcc.protocol.CCProtocolPacker import get_xpub [as 別名]
 def get_xpub(self, bip32_path, xtype):
     assert xtype in ColdcardPlugin.SUPPORTED_XTYPES
     print_error('[coldcard]', 'Derive xtype = %r' % xtype)
     xpub = self.dev.send_recv(CCProtocolPacker.get_xpub(bip32_path), timeout=5000)
     # TODO handle timeout?
     # change type of xpub to the requested type
     try:
         __, depth, fingerprint, child_number, c, cK = deserialize_xpub(xpub)
     except InvalidMasterKeyVersionBytes:
         raise UserFacingException(_('Invalid xpub magic. Make sure your {} device is set to the correct chain.')
                                   .format(self.device)) from None
     if xtype != 'standard':
         xpub = serialize_xpub(xtype, c, cK, depth, fingerprint, child_number)
     return xpub
開發者ID:neocogent,項目名稱:electrum,代碼行數:16,代碼來源:coldcard.py

示例2: get_xpub

# 需要導入模塊: from ckcc.protocol import CCProtocolPacker [as 別名]
# 或者: from ckcc.protocol.CCProtocolPacker import get_xpub [as 別名]
 def get_xpub(self, bip32_path, xtype):
     assert xtype in ColdcardPlugin.SUPPORTED_XTYPES
     print_error('[coldcard]', 'Derive xtype = %r' % xtype)
     xpub = self.dev.send_recv(CCProtocolPacker.get_xpub(bip32_path), timeout=5000)
     # TODO handle timeout?
     # change type of xpub to the requested type
     try:
         node = BIP32Node.from_xkey(xpub)
     except InvalidMasterKeyVersionBytes:
         raise UserFacingException(_('Invalid xpub magic. Make sure your {} device is set to the correct chain.')
                                   .format(self.device)) from None
     if xtype != 'standard':
         xpub = node._replace(xtype=xtype).to_xpub()
     return xpub
開發者ID:faircoin,項目名稱:electrumfair,代碼行數:16,代碼來源:coldcard.py


注:本文中的ckcc.protocol.CCProtocolPacker.get_xpub方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。