Class: Minter::Wallet
- Inherits:
-
Object
- Object
- Minter::Wallet
- Defined in:
- lib/minter/wallet.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#mnemonic ⇒ Object
readonly
Returns the value of attribute mnemonic.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#public_key ⇒ Object
readonly
Returns the value of attribute public_key.
-
#seed ⇒ Object
readonly
Returns the value of attribute seed.
Instance Method Summary collapse
-
#initialize(mnemonic = nil) ⇒ Wallet
constructor
A new instance of Wallet.
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
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/minter/wallet.rb', line 5 def address @address end |
#mnemonic ⇒ Object (readonly)
Returns the value of attribute mnemonic.
5 6 7 |
# File 'lib/minter/wallet.rb', line 5 def mnemonic @mnemonic end |
#private_key ⇒ Object (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_key ⇒ Object (readonly)
Returns the value of attribute public_key.
5 6 7 |
# File 'lib/minter/wallet.rb', line 5 def public_key @public_key end |
#seed ⇒ Object (readonly)
Returns the value of attribute seed.
5 6 7 |
# File 'lib/minter/wallet.rb', line 5 def seed @seed end |