Sha256: 1dc6d96a4decc8671e9ae0955859236ccd8c47e15cdf2f6c92a41d26e5b12542
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
require "bip44/version" require 'ecdsa' require 'digest/sha3' require 'rlp' require 'money-tree' require 'bip_mnemonic' require 'bip44/utils' require 'bip44/bitcoin' require 'bip44/ethereum' require 'bip44/wallet' module Bip44 def self.create_mnemonic_wallet words = BipMnemonic.to_mnemonic(bits: 128) puts words seed = BipMnemonic.to_seed(mnemonic: words) ethereum_wallet = Bip44::Wallet.from_seed(seed, "m/44'/60'/0'/0") puts 'ethereum xprv: ' + ethereum_wallet.xprv puts 'ethereum xpub: ' + ethereum_wallet.xpub bitcoin_wallet = Bip44::Wallet.from_seed(seed, "m/44'/0'/0'/0") puts 'bitcoin xprv: ' + bitcoin_wallet.xprv puts 'bitcoin xpub: ' + bitcoin_wallet.xpub end def self.from_mnemonic(words) seed = BipMnemonic.to_seed(mnemonic: words) ethereum_wallet = Bip44::Wallet.from_seed(seed, "m/44'/60'/0'/0") puts 'ethereum xprv: ' + ethereum_wallet.xprv puts 'ethereum xpub: ' + ethereum_wallet.xpub bitcoin_wallet = Bip44::Wallet.from_seed(seed, "m/44'/0'/0'/0") puts 'bitcoin xprv: ' + bitcoin_wallet.xprv puts 'bitcoin xpub: ' + bitcoin_wallet.xpub end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
bip44-0.2.10 | lib/bip44.rb |
bip44-0.2.9 | lib/bip44.rb |
bip44-0.2.8 | lib/bip44.rb |
bip44-0.2.7 | lib/bip44.rb |