Class: TezosClient::Tools::ConvertToHash::Address
- Includes:
- Crypto
- Defined in:
- lib/tezos_client/tools/convert_to_hash/address.rb
Constant Summary
Constants included from Crypto
Crypto::PREFIXES, Crypto::WATERMARK
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Crypto
#check_signature, #check_signature!, #checksum, #decode_account_wallet, #decode_base58, #decode_tz, #edsk2_to_edsk, #encode_base58, #encode_script_expr, #encode_tz, #generate_key, #generate_mnemonic, #get_prefix_and_payload, #hex_prefix, #operation_id, #public_key_to_address, #secret_key_to_public_key, #sign_bytes, #sign_operation, #signing_key
Methods inherited from Base
Constructor Details
This class inherits a constructor from TezosClient::Tools::ConvertToHash::Base
Instance Method Details
#decode ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tezos_client/tools/convert_to_hash/address.rb', line 9 def decode if data.key?(:bytes) if data[:bytes].start_with?("0000") encode_tz(:tz1, data[:bytes][4..-1]) elsif data[:bytes].start_with?("0001") encode_tz(:tz2, data[:bytes][4..-1]) elsif data[:bytes].start_with?("0002") encode_tz(:tz3, data[:bytes][4..-1]) elsif data[:bytes].start_with?("01") encode_tz(:KT, data[:bytes][2..-3]) else data[:bytes] end else data[:string] end end |