Class: Libra::AccountAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/libra/account_address.rb

Constant Summary collapse

ADDRESS_LENGTH =
32
SHORT_STRING_LENGTH =
4
LIBRA_NETWORK_ID_SHORT =
"lb"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hex_literal) ⇒ AccountAddress

Returns a new instance of AccountAddress.



15
16
17
18
# File 'lib/libra/account_address.rb', line 15

def initialize(hex_literal)
		@hex = hex_literal
		@addr = [hex_literal].pack('H*')
end

Instance Attribute Details

#addrObject

Returns the value of attribute addr.



12
13
14
# File 'lib/libra/account_address.rb', line 12

def addr
  @addr
end

#hexObject

Returns the value of attribute hex.



13
14
15
# File 'lib/libra/account_address.rb', line 13

def hex
  @hex
end

Class Method Details

.from_public_keyObject



24
25
26
# File 'lib/libra/account_address.rb', line 24

def self.from_public_key
	#TODO
end

.hex_to_bytes(hex_literal) ⇒ Object



20
21
22
# File 'lib/libra/account_address.rb', line 20

def self.hex_to_bytes(hex_literal)
	[hex_literal].pack('H*')
end