coins: add slip44

pull/25/head
Jan Pochyla 6 years ago
parent ab98322d4d
commit fd35b4c5c9

@ -11,6 +11,7 @@ class CoinInfo:
xpub_magic: int,
bech32_prefix: str,
cashaddr_prefix: str,
slip44: int,
segwit: bool,
fork_id: int,
force_bip143: bool,
@ -25,6 +26,7 @@ class CoinInfo:
self.xpub_magic = xpub_magic
self.bech32_prefix = bech32_prefix
self.cashaddr_prefix = cashaddr_prefix
self.slip44 = slip44
self.segwit = segwit
self.fork_id = fork_id
self.force_bip143 = force_bip143
@ -44,6 +46,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='bc',
cashaddr_prefix=None,
slip44=0,
segwit=True,
fork_id=None,
force_bip143=False,
@ -59,6 +62,7 @@ COINS = [
xpub_magic=0x043587cf,
bech32_prefix='tb',
cashaddr_prefix=None,
slip44=1,
segwit=True,
fork_id=None,
force_bip143=False,
@ -74,6 +78,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix=None,
cashaddr_prefix='bitcoincash',
slip44=145,
segwit=False,
fork_id=0,
force_bip143=True,
@ -89,6 +94,7 @@ COINS = [
xpub_magic=0x043587cf,
bech32_prefix=None,
cashaddr_prefix='bchtest',
slip44=1,
segwit=False,
fork_id=0,
force_bip143=True,
@ -104,6 +110,7 @@ COINS = [
xpub_magic=0x019da462,
bech32_prefix=None,
cashaddr_prefix=None,
slip44=7,
segwit=False,
fork_id=None,
force_bip143=False,
@ -119,6 +126,7 @@ COINS = [
xpub_magic=0x019da462,
bech32_prefix='ltc',
cashaddr_prefix=None,
slip44=2,
segwit=True,
fork_id=None,
force_bip143=False,
@ -134,6 +142,7 @@ COINS = [
xpub_magic=0x02facafd,
bech32_prefix=None,
cashaddr_prefix=None,
slip44=3,
segwit=False,
fork_id=None,
force_bip143=False,
@ -149,6 +158,7 @@ COINS = [
xpub_magic=0x02fe52cc,
bech32_prefix=None,
cashaddr_prefix=None,
slip44=5,
segwit=False,
fork_id=None,
force_bip143=False,
@ -164,6 +174,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix=None,
cashaddr_prefix=None,
slip44=133,
segwit=False,
fork_id=None,
force_bip143=False,
@ -179,6 +190,7 @@ COINS = [
xpub_magic=0x043587cf,
bech32_prefix=None,
cashaddr_prefix=None,
slip44=1,
segwit=False,
fork_id=None,
force_bip143=False,
@ -194,6 +206,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='btg',
cashaddr_prefix=None,
slip44=156,
segwit=True,
fork_id=79,
force_bip143=True,
@ -209,6 +222,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='dgb',
cashaddr_prefix=None,
slip44=20,
segwit=True,
fork_id=None,
force_bip143=False,
@ -224,6 +238,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='mona',
cashaddr_prefix=None,
slip44=22,
segwit=True,
fork_id=None,
force_bip143=False,
@ -239,6 +254,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='fc',
cashaddr_prefix=None,
slip44=75,
segwit=True,
fork_id=None,
force_bip143=False,
@ -254,6 +270,7 @@ COINS = [
xpub_magic=0x0488b21e,
bech32_prefix='vtc',
cashaddr_prefix=None,
slip44=28,
segwit=True,
fork_id=None,
force_bip143=False,

@ -20,3 +20,10 @@ def by_address_type(address_type):
if c.address_type == address_type:
return c
raise ValueError('Unknown coin address type %d' % address_type)
def by_slip44(slip44):
for c in COINS:
if c.slip44 == slip44:
return c
raise ValueError('Unknown coin slip44 index %d' % slip44)

@ -11,6 +11,7 @@ fields = [
'xpub_magic',
'bech32_prefix',
'cashaddr_prefix',
'slip44',
'segwit',
'fork_id',
'force_bip143',

Loading…
Cancel
Save