View gist:9397005
### Keybase proof
I hereby claim:
* I am charleyhine on github.
* I am charley (https://keybase.io/charley) on keybase.
* I have a public key whose fingerprint is BB73 60F9 53BB D92E 48F9 AFEA 03E8 8F10 5CCC FCB4
To claim this, I am signing this object:
View gist:0dd1a7504c00b121de74
require 'uri'
require 'net/http'
# Request: My API (http://api.chain.com/v1/bitcoin/addresses/1CbC9CrmxoZAzHu16ccQsBGMNZbCZ3xAUc/transactions?limit=50)
uri = URI.parse("http://api.chain.com/v1/bitcoin/addresses/1CbC9CrmxoZAzHu16ccQsBGMNZbCZ3xAUc/transactions?limit=50")
http = Net::HTTP.new(uri.host, uri.port)
http.read_timeout = 30
request = Net::HTTP::Get.new(uri.request_uri)
View gist:62c35021d2a63338121d
require 'open-uri'
require 'JSON'
require 'digest/sha2'
require 'bigdecimal'
require 'bitcoin'
SATOSHI_PER_BITCOIN = BigDecimal.new("100000000")
####################
View gist:2dd04b5e533908b90239
require 'chain'
response = Chain.get_transaction_op_return('8bae12b5f4c088d940733dcd1455efc6a3a69cf9340e17a981286d3778615684')
p response['text']
=> "charley loves heidi"
View gist:4e7b227d8fe2977f507a
{
"hash": "1Bj5UVzWQ84iBCUiy5eQ1NEfWfJ4a3yKG1",
"balance": 31330001,
"received": 1032680001,
"sent": 1001350000,
"unconfirmed_received": 13600000,
"unconfirmed_sent": 13630000,
"unconfirmed_balance": -30000
}
View gist:abf228e3b9e680cbcb46
class HomeController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:callback]
def register_callback
register_url = 'https://api.chain.com/v1/webhooks?key=GUEST-TOKEN'
callback_url = 'http://chain-hooks.herokuapp.com/callback'
callback_alias = 'charley'
response = HTTParty.post(register_url,
body: { url: callback_url,
View gist:2197b76ed8f276f2dadc
class HomeController < ApplicationController
def callback
puts request.body.read
respond_to do |format|
format.all { render text: request.body.read }
end
end
end
View gist:b56b7c7d9b5c73bd85b0
Verifying that +charley is my Bitcoin username. You can send me #bitcoin here: https://onename.io/charley
View gist:04f8374966fa1985df4e

Create Payment Address (revised)

Create with new URL (POST)

https://api.chain.com/v1/payments

{
    "block_chain": "bitcoin",
    "destination_address": "1dk2l...",
    "webhook_url": "http://coinsafe.com/chain/random_id_here/",
View gist:c8b4c25343766d2c4cc5
<!DOCTYPE html>
<html>
<head>
<title>Bitcoin API - Chain</title>
<link rel='shortcut icon' type='image/x-icon' href='/chain32x32.ico' />
<link rel='shortcut icon' type='image/x-icon' href='/chain16x16.ico' />
<meta name="description" content="Chain is a powerful block chain API that makes it easy to build Bitcoin applications.">
<!--facebook meta tags-->