Method: Stellar::DSL.SignerKey

Defined in:
lib/stellar/dsl.rb

.SignerKey(input = nil) ⇒ Stellar::SignerKey

Provides conversion from different input types into the SignerKey to use in ManageData operation.

Parameters:

  • input (String|zStellar::Account|Stellar::PublicKey|Stellar::SignerKey|Stellar::Keypair) (defaults to: nil)

    subject.

Returns:



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/stellar/dsl.rb', line 98

def SignerKey(input = nil)
  case input
  when Transaction
    SignerKey.pre_auth_tx(input.hash)
  when /^[0-9A-Za-z+\/=]{44}$/
    SignerKey.hash_x(Stellar::Convert.from_base64(input))
  when /^[0-9a-f]{64}$/
    SignerKey.hash_x(Stellar::Convert.from_hex(input))
  when /^.{32}$/
    SignerKey.hash_x(input)
  else
    SignerKey.ed25519(KeyPair(input))
  end
end