Class: Minter::Wallet

Inherits:
Object
  • Object
show all
Defined in:
lib/minter/wallet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mnemonic = nil) ⇒ Wallet

Returns a new instance of Wallet.



6
7
8
9
10
11
12
# File 'lib/minter/wallet.rb', line 6

def initialize(mnemonic = nil)
  @mnemonic = mnemonic
  @mnemonic ||= Minter::WalletFfi.NewMnemonic
  @private_key = Minter::WalletFfi.PrivateKeyFromMnemonic(@mnemonic)
  @public_key = Minter::WalletFfi.PublicKeyFromPrivateKey(@private_key)
  @address = Minter::WalletFfi.AddressFromMnemonic(@mnemonic)
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



5
6
7
# File 'lib/minter/wallet.rb', line 5

def address
  @address
end

#mnemonicObject (readonly)

Returns the value of attribute mnemonic.



5
6
7
# File 'lib/minter/wallet.rb', line 5

def mnemonic
  @mnemonic
end

#private_keyObject (readonly)

Returns the value of attribute private_key.



5
6
7
# File 'lib/minter/wallet.rb', line 5

def private_key
  @private_key
end

#public_keyObject (readonly)

Returns the value of attribute public_key.



5
6
7
# File 'lib/minter/wallet.rb', line 5

def public_key
  @public_key
end

#seedObject (readonly)

Returns the value of attribute seed.



5
6
7
# File 'lib/minter/wallet.rb', line 5

def seed
  @seed
end