bip44 0.2.16 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bip44/bitcoin.rb +3 -12
- data/lib/bip44/ethereum.rb +1 -11
- data/lib/bip44/version.rb +1 -1
- data/lib/bip44/wallet.rb +11 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e7a38b23565dfdc0099af222d5e72a3d613fddd
|
4
|
+
data.tar.gz: c710b0bb4f07ece827d2e8bf66a1520f588b6e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b1a1edd6e788ae38c352221ff0b50f2a3fa2be8c0be10f1c0ce88ead591047085da3a36cc2bc4a2ab16378277d5b697153a68935aedce0cdc6dd5bbea9ab236
|
7
|
+
data.tar.gz: 81d1d4d16d647032988f93c313b3c48b8cb29b89f916b329adf8a767963707d4fefa68d792b1abc1d978d6ef4758124b2a833f3e240691df2c6fc02101035e6d
|
data/lib/bip44/bitcoin.rb
CHANGED
@@ -1,17 +1,8 @@
|
|
1
1
|
module Bip44
|
2
2
|
module Bitcoin
|
3
|
-
def
|
4
|
-
|
5
|
-
node.to_address
|
6
|
-
end
|
7
|
-
|
8
|
-
def get_bitcoin_address(index)
|
9
|
-
sub_wallet = sub_wallet()
|
10
|
-
sub_wallet.bitcoin_address
|
11
|
-
end
|
12
|
-
|
13
|
-
def bitcoin_address
|
3
|
+
def bitcoin_address(testnet: false)
|
4
|
+
return @wallet_node.public_key.to_address(network: :bitcoin_testnet) if testnet
|
14
5
|
@wallet_node.public_key.to_address
|
15
6
|
end
|
16
7
|
end
|
17
|
-
end
|
8
|
+
end
|
data/lib/bip44/ethereum.rb
CHANGED
@@ -1,15 +1,5 @@
|
|
1
1
|
module Bip44
|
2
2
|
module Ethereum
|
3
|
-
def get_ethereum_address(path)
|
4
|
-
sub_wallet = sub_wallet(path)
|
5
|
-
sub_wallet.ethereum_address
|
6
|
-
end
|
7
|
-
|
8
|
-
def get_child_ethereum_address(index)
|
9
|
-
sub_wallet = sub_wallet()
|
10
|
-
sub_wallet.ethereum_address
|
11
|
-
end
|
12
|
-
|
13
3
|
def ethereum_address
|
14
4
|
# from bitcoin public key to ethereum public key
|
15
5
|
group = ECDSA::Group::Secp256k1
|
@@ -23,4 +13,4 @@ module Bip44
|
|
23
13
|
Bip44::Utils.prefix_hex(address)
|
24
14
|
end
|
25
15
|
end
|
26
|
-
end
|
16
|
+
end
|
data/lib/bip44/version.rb
CHANGED
data/lib/bip44/wallet.rb
CHANGED
@@ -34,16 +34,22 @@ module Bip44
|
|
34
34
|
Wallet.new(@wallet_node.node_for_path(path))
|
35
35
|
end
|
36
36
|
|
37
|
-
def xpub
|
38
|
-
@wallet_node.to_bip32
|
37
|
+
def xpub(testnet: false)
|
38
|
+
return @wallet_node.to_bip32(:public, network: :bitcoin_testnet) if testnet
|
39
|
+
@wallet_node.to_bip32(:public)
|
39
40
|
end
|
40
41
|
|
41
|
-
def xprv
|
42
|
+
def xprv(testnet: :false)
|
43
|
+
return @wallet_node.to_bip32(:private, network: :bitcoin_testnet) if testnet
|
42
44
|
@wallet_node.to_bip32(:private)
|
43
45
|
end
|
44
46
|
|
45
|
-
def
|
46
|
-
return @wallet_node.private_key.to_wif
|
47
|
+
def wif(compressed: true, testnet: false)
|
48
|
+
return @wallet_node.private_key.to_wif(compressed: compressed, network: :bitcoin_testnet) if testnet
|
49
|
+
@wallet_node.private_key.to_wif(compressed: compressed)
|
50
|
+
end
|
51
|
+
|
52
|
+
def private_key
|
47
53
|
@wallet_node.private_key.to_hex
|
48
54
|
end
|
49
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bip44
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wuminzhe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|