Skip to content

Commit

Permalink
Feat: Added dash compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Werner committed Apr 6, 2017
1 parent 79e05b0 commit ed7392f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
blockypher-python
=============

Official python library for BlockCypher web services. Easily query the blockchain without writing any code. Fast, reliable, and packed with powerful features you won't find in other block explorers. Currently supports bitcoin (including main and testnet), Litecoin, Dogecoin, URO and the blockcypher testnet.
Official python library for BlockCypher web services. Easily query the blockchain without writing any code. Fast, reliable, and packed with powerful features you won't find in other block explorers. Currently supports bitcoin (including main and testnet), Litecoin, Dogecoin, Dash, URO and the blockcypher testnet.

Designed to be used without having to RTFM.

Expand Down Expand Up @@ -258,7 +258,7 @@ Another cool feature is that we can generate a new address keypair server-side,
```
>>> from blockcypher import constants
>>> constants.COIN_SYMBOL_LIST
['btc', 'btc-testnet', 'ltc', 'doge', 'bcy']
['btc', 'btc-testnet', 'ltc', 'doge', 'dash', 'bcy']
```

`btc` will always be assumed if nothing else is specified, but all methods support swapping in any of the previous `coin_symbol` entries. Just pass `coin_symbol='foo'` as a keyword argument to the function.
Expand Down
19 changes: 18 additions & 1 deletion blockcypher/constants.py
Expand Up @@ -68,6 +68,23 @@
'vbyte_pubkey': 30,
'vbyte_script': 22,
},
{
'coin_symbol': 'dash',
'display_name': 'Dash',
'display_shortname': 'DASH',
'blockcypher_code': 'dash',
'blockcypher_network': 'main',
'currency_abbrev': 'DASH',
'pow': 'x11',
'example_address': 'XdZW5Waa1i6D9za3qpFvgiwHzr8aFcXtNP',
'address_first_char_list': ('X'),
'singlesig_prefix_list': ('X', ),
'multisig_prefix_list': ('7', ),
'first4_mprv': 'xprv',
'first4_mpub': 'xpub',
'vbyte_pubkey': 76,
'vbyte_script': 16,
},
{
'coin_symbol': 'bcy',
'display_name': 'BlockCypher Testnet',
Expand Down Expand Up @@ -106,7 +123,7 @@
'vbyte_script', # script hash version byte
)

ELIGIBLE_POW_ENTRIES = set(['sha', 'scrypt'])
ELIGIBLE_POW_ENTRIES = set(['sha', 'scrypt', 'x11'])

# Safety checks on the data
for coin_symbol_dict in COIN_SYMBOL_ODICT_LIST:
Expand Down
2 changes: 1 addition & 1 deletion test_blockcypher.py
Expand Up @@ -474,7 +474,7 @@ def test_simple_spend_wif(self):
class GenerateAddressServerSide(unittest.TestCase):

def test_generate_single_addr(self):
for coin_symbol in ('btc', 'btc-testnet', 'doge', 'ltc', 'bcy'):
for coin_symbol in ('btc', 'btc-testnet', 'doge', 'dash', 'ltc', 'bcy'):
response_dict = generate_new_address(
coin_symbol=coin_symbol,
api_key=BC_API_KEY,
Expand Down

0 comments on commit ed7392f

Please sign in to comment.