Skip to content

Commit

Permalink
added omni + feathercoin
Browse files Browse the repository at this point in the history
  • Loading branch information
ranaroussi committed Aug 16, 2018
1 parent 9adb45e commit eb784ea
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
37 changes: 37 additions & 0 deletions pywallet/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ class DashTestNet(object):
EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses
BIP32_PATH = "m/44'/1'/0'/"

class OmniMainNet(object):
"""Bitcoin MainNet version bytes.
From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp
"""
NAME = "Omni Main Net"
COIN = "USDT"
SCRIPT_ADDRESS = 0x00 # int(0x00) = 0
PUBKEY_ADDRESS = 0x05 # int(0x05) = 5 # Used to create payment addresses
SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format
EXT_PUBLIC_KEY = 0x0488B21E # Used to serialize public BIP32 addresses
EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses
BIP32_PATH = "m/44'/0'/0'/"

class OmniTestNet(object):
"""Bitcoin MainNet version bytes.
From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp
"""
NAME = "Omni Test Net"
COIN = "USDT"
SCRIPT_ADDRESS = 0x6f # int(0x6f) = 111
PUBKEY_ADDRESS = 0xc4 # int(0xc4) = 196 # Used to create payment addresses
SECRET_KEY = 0xef # int(0xef) = 239 # Used for WIF format
EXT_PUBLIC_KEY = 0x043587CF # Used to serialize public BIP32 addresses
EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses
BIP32_PATH = "m/44'/0'/0'/"

class BitcoinMainNet(object):
"""Bitcoin MainNet version bytes.
Expand All @@ -59,6 +84,18 @@ class BitcoinMainNet(object):
EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses
BIP32_PATH = "m/44'/0'/0'/"

class FeathercoinMainNet(object):
"""Feathercoin MainNet version bytes.
From https://github.com/FeatherCoin/Feathercoin/blob/master-0.13/src/chainparams.cpp
"""
NAME = "Feathercoin Main Net"
COIN = "FTC"
SCRIPT_ADDRESS = 0x05 # int(0x05) = 5
PUBKEY_ADDRESS = 0x0E # int(0x0E) = 14 # Used to create payment addresses
SECRET_KEY = 0x8E # int(0x8E) = 142 # Used for WIF format
EXT_PUBLIC_KEY = 0x0488BC26 # Used to serialize public BIP32 addresses
EXT_SECRET_KEY = 0x0488DAEE # Used to serialize private BIP32 addresses
BIP32_PATH = "m/44'/4'/0'/"

class BitcoinTestNet(object):
"""Bitcoin TestNet version bytes.
Expand Down
6 changes: 6 additions & 0 deletions pywallet/utils/bip32.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,12 @@ def get_network(self, network):
response = DashMainNet
elif network == 'dash_testnet' or network == 'DASHTEST':
response = DashTestNet
elif network == 'omni' or network == 'OMNI':
response = OmniMainNet
elif network == 'omni_testnet' or network == 'OMNI_TESTNET':
response = OmniTestNet
elif network == 'feathercoin' or network == 'FTC':
response = FeathercoinMainNet
elif network == "qtum" or network == "QTUM":
response = QtumMainNet
elif network == 'qtum_testnet' or network == 'QTUMTEST':
Expand Down
8 changes: 7 additions & 1 deletion pywallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@ def get_network(network='btctest'):
return BitcoinCashMainNet
elif network == "bitcoin_gold" or network == "btg":
return BitcoinGoldMainNet
elif network == "dash" or network == "dash":
elif network == "dash":
return DashMainNet
elif network == "dash_testnet" or network == 'dashtest':
return DashTestNet
elif network == 'omni':
return OmniMainNet
elif network == 'omni_testnet':
return OmniTestNet
elif network == "feathercoin" or network == 'ftc':
return FeathercoinMainNet
elif network == "qtum":
return QtumMainNet
elif network == "qtum_testnet" or network == "qtumtest":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def load_version():
setup(
name='pywallet',
version=version,
description="Simple BIP32 (HD) wallet creation for BTC, BTG, BCH, LTC, DASH and DOGE",
description="Simple BIP32 (HD) wallet creation for BTC, BTG, BCH, LTC, DASH, USDT, QTUM and DOGE",
long_description=long_description,
url='https://github.com/ranaroussi/pywallet',
author='Ran Aroussi',
Expand Down

0 comments on commit eb784ea

Please sign in to comment.