Skip to content

Instantly share code, notes, and snippets.

@barmstrong
Last active December 11, 2015 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barmstrong/b2cbef344576caaf6347 to your computer and use it in GitHub Desktop.
Save barmstrong/b2cbef344576caaf6347 to your computer and use it in GitHub Desktop.
coinbase = Coinbase::Client.new(api_key)
coinbase.balance.to_f
=> 200.353
coinbase.send_money('user@example.com', 1.23).success?
=> true
coinbase.send_money('user@example.com', 1.23.to_money('EUR'), "thanks for the coffee!").success?
=> true
coinbase.request_money('client@example.com', 500.to_money('USD'), "website redesign").success?
=> true
coinbase.buy_price(1).format
=> "$17.95 USD"
coinbase.sell_price(30).format
=> "$534.60 USD"
coinbase.buy!(1).transfer.payout_date
=> 2013-02-01 18:00:00 -0800
coinbase.create_button("Donate bitcoins!", 1).embed_html
=> "<div class=\"coinbase-button\" data-code=\"93865b9cae83706ae59220c013bc0afd\"></div><script src=\"https://coinbase.com/assets/button.js\" type=\"text/javascript\"></script>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment