File tree Expand file tree Collapse file tree 9 files changed +26
-26
lines changed Expand file tree Collapse file tree 9 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ class TxFetcher:
21
21
@classmethod
22
22
def get_url (cls , testnet = False ):
23
23
if testnet :
24
- return 'http ://testnet.programmingbitcoin.com '
24
+ return 'https ://blockstream.info/testnet/api/ '
25
25
else :
26
- return 'http ://mainnet.programmingbitcoin.com '
26
+ return 'https ://blockstream.info/api/ '
27
27
28
28
@classmethod
29
29
def fetch (cls , tx_id , testnet = False , fresh = False ):
30
30
if fresh or (tx_id not in cls .cache ):
31
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
31
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
32
32
response = requests .get (url )
33
33
try :
34
34
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ class TxFetcher:
20
20
@classmethod
21
21
def get_url (cls , testnet = False ):
22
22
if testnet :
23
- return 'http ://testnet.programmingbitcoin.com '
23
+ return 'https ://blockstream.info/testnet/api '
24
24
else :
25
- return 'http ://mainnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/api '
26
26
27
27
@classmethod
28
28
def fetch (cls , tx_id , testnet = False , fresh = False ):
29
29
if fresh or (tx_id not in cls .cache ):
30
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
30
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
31
31
response = requests .get (url )
32
32
try :
33
33
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
31
31
if fresh or (tx_id not in cls .cache ):
32
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
32
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
33
33
response = requests .get (url )
34
34
try :
35
35
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
31
31
if fresh or (tx_id not in cls .cache ):
32
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
32
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
33
33
response = requests .get (url )
34
34
try :
35
35
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api/ '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api/ '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
31
31
if fresh or (tx_id not in cls .cache ):
32
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
32
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
33
33
response = requests .get (url )
34
34
try :
35
35
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ class TxFetcher:
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
31
31
if fresh or (tx_id not in cls .cache ):
32
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
32
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
33
33
response = requests .get (url )
34
34
try :
35
35
raw = bytes .fromhex (response .text .strip ())
Original file line number Diff line number Diff line change 18
18
19
19
class TxFetcher :
20
20
cache = {}
21
-
21
+
22
22
@classmethod
23
23
def get_url (cls , testnet = False ):
24
24
if testnet :
25
- return 'http ://testnet.programmingbitcoin.com '
25
+ return 'https ://blockstream.info/testnet/api '
26
26
else :
27
- return 'http ://mainnet.programmingbitcoin.com '
27
+ return 'https ://blockstream.info/api '
28
28
29
29
@classmethod
30
30
def fetch (cls , tx_id , testnet = False , fresh = False ):
31
31
if fresh or (tx_id not in cls .cache ):
32
- url = '{}/tx/{}. hex' .format (cls .get_url (testnet ), tx_id )
32
+ url = '{}/tx/{}/ hex' .format (cls .get_url (testnet ), tx_id )
33
33
response = requests .get (url )
34
34
try :
35
35
raw = bytes .fromhex (response .text .strip ())
You can’t perform that action at this time.
0 commit comments