@@ -13,15 +13,15 @@ With contextual switch to Litecoin parameters:
13
13
``` python
14
14
import os
15
15
import litecointx
16
- from bitcointx import ChainParams, GetCurrentChainParams
16
+ from bitcointx import ChainParams, get_current_chain_params
17
17
from bitcointx.wallet import (
18
18
CCoinKey, CCoinExtKey, P2WPKHCoinAddress, CCoinAddress
19
19
)
20
20
21
21
with ChainParams(' litecoin' ):
22
22
k = CCoinExtKey.from_seed(os.urandom(32 ))
23
23
a = P2WPKHCoinAddress.from_pubkey(k.derive_path(" m/0h/0h/1" ).pub)
24
- print (' example {} address: {} ' .format(GetCurrentChainParams ().NAME , a))
24
+ print (' example {} address: {} ' .format(get_current_chain_params ().NAME , a))
25
25
assert CCoinAddress(str (a)) == a
26
26
27
27
```
@@ -30,11 +30,11 @@ With global switch to Litecoin parameters:
30
30
31
31
``` python
32
32
from litecointx import LitecoinMainnetParams
33
- from bitcointx import SelectChainParams
33
+ from bitcointx import select_chain_params
34
34
35
- SelectChainParams (' litecoin' )
35
+ select_chain_params (' litecoin' )
36
36
# or, using the chain params class directly
37
- SelectChainParams (LitecoinMainnetParams)
37
+ select_chain_params (LitecoinMainnetParams)
38
38
39
39
```
40
40
@@ -52,11 +52,11 @@ assert str(canonical_adr) == 'MMDkQMv8pGGmAXdVyxaW8YtQMCHw7eouma'
52
52
Without special parameter that makes CCoinAddress to decode legacy p2sh addresses:
53
53
54
54
``` python
55
- from bitcointx import SelectChainParams
55
+ from bitcointx import select_chain_params
56
56
from bitcointx.wallet import CCoinAddress
57
57
from litecointx.wallet import P2SHLitecoinLegacyAddress
58
58
59
- SelectChainParams (' litecoin' , allow_legacy_p2sh = True )
59
+ select_chain_params (' litecoin' , allow_legacy_p2sh = True )
60
60
legacy_adr = CCoinAddress(' 3F1c6UWAs9RLN2Mbt5bAJue12VhVCorXzs' )
61
61
assert isinstance (legacy_adr, P2SHLitecoinLegacyAddress)
62
62
```
0 commit comments