lib/yolodice_client.rb
##
# Authenticates the connection by requesting a challenge message, signing it and sending the response back.
# 
# Parameters:
# * <tt>auth_key</tt> -- Base58 encoded private key for the API key
#
# Returns
# * <tt>false</tt> if authentication fails,
# * user object (Hash with public user attributes) when authentication succeeds.
Authenticates the connection by requesting a challenge message, signing it and sending the response back.
Parameters:
auth_key -- Base58 encoded private key for the API key

Returns
false if authentication fails,
user object (Hash with public user attributes) when authentication succeeds.
Authenticates the connection by requesting a challenge message signing it and sending the response back . Parameters : auth_key -- Base58 encoded private key for the API key Returns false if authentication fails user object ( Hash with public user attributes ) when authentication succeeds .
def authenticate auth_key
    auth_key = Bitcoin::Key.from_base58(auth_key) unless auth_key.is_a?(Bitcoin::Key)
    challenge = generate_auth_challenge
    user = auth_by_address address: auth_key.addr, signature: auth_key.sign_message(challenge)
    raise Error, "Authentication failed" unless user
    log.debug "Authenticated as user #{user['name']}(#{user['id']})"
    user
  end
def authenticate auth_key auth_key = Bitcoin :: Key . from_base58 ( auth_key ) unless auth_key . is_a? ( Bitcoin :: Key ) challenge = generate_auth_challenge user = auth_by_address address : auth_key . addr , signature : auth_key . sign_message ( challenge ) raise Error , "Authentication failed" unless user log . debug "Authenticated as user #{user['name']}(#{user['id']})" user end
Authenticates the connection by requesting a challenge message, signing it and sending the response back.
Authenticates the connection by requesting a challenge message signing it and sending the response back .
auth_key
<not_specific>