Class: Stellar::Account

Inherits:
Object
  • Object
show all
Includes:
Contracts
Defined in:
lib/stellar/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#keypairObject (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

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/stellar/account.rb', line 22

def self.lookup(federated_name)
  raise NotImplementedError
end

.masterObject



26
27
28
29
# File 'lib/stellar/account.rb', line 26

def self.master
  keypair = Stellar::KeyPair.from_raw_seed("allmylifemyhearthasbeensearching")
  new(keypair)
end

.randomObject



7
8
9
10
# File 'lib/stellar/account.rb', line 7

def self.random
  keypair = Stellar::KeyPair.random
  new(keypair)
end