Method: Multichain::CLI#send_url

Defined in:
lib/multichain/cli.rb

#send_url(recipient, url) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/multichain/cli.rb', line 40

def send_url recipient, url
  data = Client.new.send_url recipient, url
  out = "You sent '#{url}' to '#{recipient}'\n"
  out << "\n"
  out << "The transaction id is\n"
  out << "  #{data[:id]}\n"
  out << "\n"
  out << "The URL\n"
  out << "  #{url}\n"
  out << "hashed to\n"
  out << "  #{data[:hash]}\n"
  out << "at\n"
  out << "  #{Time.at(data[:timestamp].to_i).to_datetime}\n"
  out << "\n"
  out << "Verify the hash with\n"
  out << "  multichain verify #{data[:hex]}\n"

  puts out
end