当前位置: 首页>>代码示例>>Python>>正文


Python BIP32_Account.parse_xpubkey方法代码示例

本文整理汇总了Python中account.BIP32_Account.parse_xpubkey方法的典型用法代码示例。如果您正苦于以下问题:Python BIP32_Account.parse_xpubkey方法的具体用法?Python BIP32_Account.parse_xpubkey怎么用?Python BIP32_Account.parse_xpubkey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account.BIP32_Account的用法示例。


在下文中一共展示了BIP32_Account.parse_xpubkey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: inputs_to_sign

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
    def inputs_to_sign(self):
        from account import BIP32_Account, OldAccount
        xpub_list = []
        addr_list = set()
        for txin in self.inputs:
            x_signatures = txin['signatures']
            signatures = filter(lambda x: x is not None, x_signatures)

            if len(signatures) == txin['num_sig']:
                # input is complete
                continue

            for k, x_pubkey in enumerate(txin['x_pubkeys']):

                if x_signatures[k] is not None:
                    # this pubkey already signed
                    continue

                if x_pubkey[0:2] == 'ff':
                    xpub, sequence = BIP32_Account.parse_xpubkey(x_pubkey)
                    xpub_list.append((xpub,sequence))
                elif x_pubkey[0:2] == 'fe':
                    xpub, sequence = OldAccount.parse_xpubkey(x_pubkey)
                    xpub_list.append((xpub,sequence))
                else:
                    addr_list.add(txin['address'])

        return addr_list, xpub_list
开发者ID:potcoin-repos,项目名称:electrum-pot,代码行数:30,代码来源:transaction.py

示例2: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.get_pubkey_from_x(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    else:
        pubkey = x_pubkey
    return pubkey
开发者ID:potcoin-repos,项目名称:electrum-pot,代码行数:14,代码来源:transaction.py

示例3: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] == "ff":
        from account import BIP32_Account

        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == "fe":
        from account import OldAccount

        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode("hex"), s[0], s[1])
    else:
        pubkey = x_pubkey
    return pubkey
开发者ID:mrtexaznl,项目名称:electrum-med,代码行数:16,代码来源:transaction.py

示例4: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ['02','03','04']:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    else:
        raise BaseException("Cannnot parse pubkey")
    return pubkey
开发者ID:Lexiks,项目名称:electrum,代码行数:16,代码来源:transaction.py

示例5: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ['02','03','04']:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == 'fe':
        from account import OldAccount
        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode('hex'), s[0], s[1])
    elif x_pubkey[0:2] == 'fd':
        addrtype = ord(x_pubkey[2:4].decode('hex'))
        hash160 = x_pubkey[4:].decode('hex')
        pubkey = None
        address = hash_160_to_bc_address(hash160, addrtype)
    else:
        raise BaseException("Cannnot parse pubkey")
    if pubkey:
        address = public_key_to_bc_address(pubkey.decode('hex'))
    return pubkey, address
开发者ID:akshayaurora,项目名称:electrum,代码行数:23,代码来源:transaction.py

示例6: parse_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def parse_xpub(x_pubkey):
    if x_pubkey[0:2] in ["02", "03", "04"]:
        pubkey = x_pubkey
    elif x_pubkey[0:2] == "ff":
        from account import BIP32_Account

        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        pubkey = BIP32_Account.derive_pubkey_from_xpub(xpub, s[0], s[1])
    elif x_pubkey[0:2] == "fe":
        from account import OldAccount

        mpk, s = OldAccount.parse_xpubkey(x_pubkey)
        pubkey = OldAccount.get_pubkey_from_mpk(mpk.decode("hex"), s[0], s[1])
    elif x_pubkey[0:2] == "fd":
        addrtype = ord(x_pubkey[2:4].decode("hex"))
        hash160 = x_pubkey[4:].decode("hex")
        pubkey = None
        address = hash_160_to_bc_address(hash160, addrtype)
    else:
        raise BaseException("Cannnot parse pubkey")
    if pubkey:
        address = public_key_to_bc_address(pubkey.decode("hex"))
    return pubkey, address
开发者ID:justinvforvendetta,项目名称:electrum-boli,代码行数:25,代码来源:transaction.py

示例7: x_to_xpub

# 需要导入模块: from account import BIP32_Account [as 别名]
# 或者: from account.BIP32_Account import parse_xpubkey [as 别名]
def x_to_xpub(x_pubkey):
    if x_pubkey[0:2] == 'ff':
        from account import BIP32_Account
        xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
        return xpub
开发者ID:akshayaurora,项目名称:electrum,代码行数:7,代码来源:transaction.py


注:本文中的account.BIP32_Account.parse_xpubkey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。