Class: Stellar::Account
- Inherits:
-
Object
- Object
- Stellar::Account
- Includes:
- Contracts
- Defined in:
- lib/stellar/account.rb
Instance Attribute Summary collapse
-
#keypair ⇒ Object
readonly
Returns the value of attribute keypair.
Class Method Summary collapse
- .from_address(address) ⇒ Object
- .from_seed(seed) ⇒ Object
- .lookup(federated_name) ⇒ Object
- .master ⇒ Object
- .random ⇒ Object
Instance Method Summary collapse
-
#initialize(keypair) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(keypair) ⇒ Account
Returns a new instance of Account.
34 35 36 |
# File 'lib/stellar/account.rb', line 34 def initialize(keypair) @keypair = keypair end |
Instance Attribute Details
#keypair ⇒ Object (readonly)
Returns the value of attribute keypair.
31 32 33 |
# File 'lib/stellar/account.rb', line 31 def keypair @keypair end |
Class Method Details
.from_address(address) ⇒ Object
17 18 19 20 |
# File 'lib/stellar/account.rb', line 17 def self.from_address(address) keypair = Stellar::KeyPair.from_address(address) new(keypair) end |
.from_seed(seed) ⇒ Object
12 13 14 15 |
# File 'lib/stellar/account.rb', line 12 def self.from_seed(seed) keypair = Stellar::KeyPair.from_seed(seed) new(keypair) end |
.lookup(federated_name) ⇒ Object
22 23 24 |
# File 'lib/stellar/account.rb', line 22 def self.lookup(federated_name) raise NotImplementedError end |
.master ⇒ Object
26 27 28 29 |
# File 'lib/stellar/account.rb', line 26 def self.master keypair = Stellar::KeyPair.from_raw_seed("allmylifemyhearthasbeensearching") new(keypair) end |
.random ⇒ Object
7 8 9 10 |
# File 'lib/stellar/account.rb', line 7 def self.random keypair = Stellar::KeyPair.random new(keypair) end |