Class: Round::Wallet
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#multiwallet ⇒ Object
readonly
Returns the value of attribute multiwallet.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #accounts ⇒ Object
-
#initialize(options = {}) ⇒ Wallet
constructor
A new instance of Wallet.
- #unlock(passphrase) ⇒ Object
Methods inherited from Base
association, #hash_identifier, #method_missing, #refresh
Constructor Details
#initialize(options = {}) ⇒ Wallet
Returns a new instance of Wallet.
6 7 8 9 10 |
# File 'lib/round/wallet.rb', line 6 def initialize( = {}) @multiwallet = [:multiwallet] @application = [:application] super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Round::Base
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
4 5 6 |
# File 'lib/round/wallet.rb', line 4 def application @application end |
#multiwallet ⇒ Object (readonly)
Returns the value of attribute multiwallet.
4 5 6 |
# File 'lib/round/wallet.rb', line 4 def multiwallet @multiwallet end |
Class Method Details
.hash_identifier ⇒ Object
34 35 36 |
# File 'lib/round/wallet.rb', line 34 def self.hash_identifier 'name' end |
Instance Method Details
#accounts ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/round/wallet.rb', line 26 def accounts Round::AccountCollection.new( resource: @resource.accounts, wallet: self, client: @client ) end |
#unlock(passphrase) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/round/wallet.rb', line 12 def unlock(passphrase) primary_seed = CoinOp::Crypto::PassphraseBox.decrypt(passphrase, @resource.primary_private_seed) primary_master = MoneyTree::Master.new(seed_hex: primary_seed) @multiwallet = CoinOp::Bit::MultiWallet.new( private: { primary: primary_master }, public: { cosigner: @resource.cosigner_public_seed, backup: @resource.backup_public_seed } ) end |