Class: TezosClient::Tools::ConvertToHash::Key
- Includes:
- Crypto
- Defined in:
- lib/tezos_client/tools/convert_to_hash/key.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 |
# File 'lib/tezos_client/tools/convert_to_hash/key.rb', line 9 def decode if tmp_data.start_with?("00") encode_tz(:edpk, tmp_data[2..-1]) elsif tmp_data.start_with?("01") encode_tz(:sppk, tmp_data[2..-1]) elsif tmp_data.start_with?("02") encode_tz(:p2pk, tmp_data[2..-1]) else tmp_data end end |
#tmp_data ⇒ Object
21 22 23 |
# File 'lib/tezos_client/tools/convert_to_hash/key.rb', line 21 def tmp_data @tmp_data ||= data[:bytes] || data[:string] end |