Sha256: c19a94f3011c9b836b8d7e5af8b12d819bf599e800d9190c4e988b8c5006834e

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

require "bip44/version"
require 'ecdsa'
require 'digest/sha3'
require 'rlp'
require 'money-tree'
require 'bip_mnemonic'
require 'eth'
require 'bip44/utils'
require 'bip44/bitcoin'
require 'bip44/ethereum'
require 'bip44/litecoin'
require 'bip44/bitcoin_cash'
require 'bip44/zcoin'
require 'bip44/qtum'
require 'bip44/wallet'

module Bip44
  def self.create_mnemonic_wallet
    words = BipMnemonic.to_mnemonic(bits: 128)
    puts words
    seed = BipMnemonic.to_seed(mnemonic: words)
    puts "seed: #{seed}"
    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
    dash_wallet = Bip44::Wallet.from_seed(seed, "m/44'/5'/0'/0")
    puts 'dash xprv: ' + dash_wallet.xprv
    puts 'dash xpub: ' + dash_wallet.xpub
  end

  def self.from_mnemonic(words)
    seed = BipMnemonic.to_seed(mnemonic: words)
    puts "seed: #{seed}"
    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
    dash_wallet = Bip44::Wallet.from_seed(seed, "m/44'/5'/0'/0")
    puts 'dash xprv: ' + dash_wallet.xprv
    puts 'dash xpub: ' + dash_wallet.xpub
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bip44-extended-0.2.26 lib/bip44.rb