blockcypher / docs Goto Github PK
View Code? Open in Web Editor NEWThis project forked from slatedocs/slate
BlockCypher's API documentation
Home Page: http://www.blockcypher.com/dev
License: Apache License 2.0
This project forked from slatedocs/slate
BlockCypher's API documentation
Home Page: http://www.blockcypher.com/dev
License: Apache License 2.0
At the page:
http://dev.blockcypher.com/?python#blockchain-api
from blockcypher import get_block_overview
get_blockchain_overview()
should be:
from blockcypher import get_blockchain_overview
For example, I have two addresses and each of them has received 1 BTC. Now, I want to transfer 1.5 BTC to another address. How can I achieve this using the Blockcypher create transaction API?
Tag @matthieu, @Catheryne for discussion:
I think the language can/should be tweaked so that it's more clear that we support any language that can make JSON HTTP calls (every modern language), and that the API is just JSON over http.
For me, this is most prominent in two places:
"Official" language support: maybe weaken this, we don't want to make it seem like other languages aren't going to work for some reason. My suggestion: change to "BlockCypher Supported Language SDKs" or "Officially Supported Language SDKs" to make it clear that the support is for the language library, not the language itself. Maybe additionally, make it explicit that we support any language that can make HTTP calls and parse JSON.
Frequent use of "cURL" : to experienced readers, curl is more or less a synonym for "GET over HTTP", but for inexperienced readers this may seem like some magic tool and the connection may not be obvious.
For example:
If not, or you’d rather write your own bindings, we always support cURLing endpoints directly, which is the default code sample you’ll see to the right.
My suggestion would be something along the lines of:
Of course, all our API's are standard HTTP endpoints using JSON formatted responses, so any language (or cURL from the command-line) will work just fine.
A few things to change:
Find/replace all the things!
Already mentioned in offline, just adding there here as well. It's basically the "Several code samples..." section here:
People are mistakenly thinking that there is an issue blockcypher/node-client#27 but they do not provide a token. Add token to web socket example.
Bug Description
When creating a Bitcoin transaction using the example Javascript code, bitcoinjs-lib no longer works. This is due to ECPair being removed from the module: bitcoinjs/bitcoinjs-lib@e5a7730.
Documentation should be updated with an appropriate solution or a comment stating v5.2.0 is required.
Browser (please complete the following information):
I try get txSkeleton
post to https://api.blockcypher.com/v1/btc/test3/txs/new/
{ "inputs": [ { "addresses": [ "mgqXuAznRc7vgCjFfFn842WrbiXtBgHvXN" ] } ], "outputs": [ { "addresses": [ "mgdYwFuDkXdWnktXm5Ap6BisRGQaumhU5z" ], "value": 500000 } ], "fees": 12000 }
But in response I get 404 error.
See insomnia timeline
POST /v1/btc/test3/txs/new/ HTTP/1.1
Host: api.blockcypher.com
User-Agent: insomnia/6.3.2
Content-Type: application/json
Accept: */*
Content-Length: 217
| {
| "inputs": [
| {
| "addresses": [
| "mgqXuAznRc7vgCjFfFn842WrbiXtBgHvXN"
| ]
| }
| ],
| "outputs": [
| {
| "addresses": [
| "mgdYwFuDkXdWnktXm5Ap6BisRGQaumhU5z"
| ],
| "value": 500000
| }
| ],
| "fees": 12000
| }
upload completely sent off: 217 out of 217 bytes
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.3 (Ubuntu)
Date: Tue, 16 Apr 2019 11:03:45 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Connection: keep-alive
Location: /v1/btc/test3/txs/new
Connection #11 to host api.blockcypher.com left intact
Issue another request to this URL: 'https://api.blockcypher.com/v1/btc/test3/txs/new'
Switch from POST to GET
Found bundle for host api.blockcypher.com: 0x28fd17bf3f0 [can pipeline]
Re-using existing connection! (#11) with host api.blockcypher.com
Connected to api.blockcypher.com (52.2.101.52) port 443 (#11)
GET /v1/btc/test3/txs/new HTTP/1.1
Host: api.blockcypher.com
User-Agent: insomnia/6.3.2
Content-Type: application/json
Accept: */*
HTTP/1.1 404 Not Found
Server: nginx/1.10.3 (Ubuntu)
Date: Tue, 16 Apr 2019 11:03:45 GMT
Content-Type: application/json
Content-Length: 36
Connection: keep-alive
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Allow-Origin: *
X-Ratelimit-Remaining: 99
Received 36 B chunk
Connection #11 to host api.blockcypher.com left intact
I'm finding that docs easier on the eyes if font-smoothing is disabled:
docs/source/stylesheets/screen.css.scss
Lines 33 to 34 in ded3e93
We use bcy/test from time to time to make more sensitive examples involving signing/private keys/faucets more "copy-pasteable" (also so we can occasionally post full private keys).
That said, can be confusing switching from one to the other without calling it. Going to make an effort to call this out in the code comments.
I'd create a pull requests but then I'd have to fork now and fork again once the repo is in blockcypher so just being lazy here ;)
Not sure what the best way to do this is, can you have runnable code in the 3rd column? If so it might be best to put it there when we add Javascript examples.
Please consider adding node to your code examples.
Anytime I look at it, it throws me off that the simple transaction lookup isn't first. So I'm guessing most others would be the same :)
From @acityinohio's #26
$ ack "coin_symbol='bcy'"
source/includes/_microtx.md
76:>>> simple_spend_tx(from_privkey_hex='97838249d77bfa65f97be02b63fd1b7bb6a58474c7c22784a0da63993d1c2f90', to_address='C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn', to_satoshis=10000, coin_symbol='bcy')
source/includes/_tx.md
742:>>> simple_spend_tx(from_privkey_hex='97838249d77bfa65f97be02b63fd1b7bb6a58474c7c22784a0da63993d1c2f90', to_address='C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn', to_satoshis=1000000, coin_symbol='bcy')
749:>>> unsigned_tx = create_unsigned_tx(inputs=inputs, outputs=outputs, coin_symbol='bcy')
1874:>>> decodetx(tx_hex=tx_hex, coin_symbol='bcy')
source/index.md
890:>>> send_faucet_coins(address_to_fund='CFqoZmZ3ePwK5wnkhxJjJAQKJ82C7RJdmd', satoshis=10000, api_key='YOUR_TOKEN', coin_symbol='bcy')
We have many posts and tweets that link to the a given section of the documentation using anchors. It'd be nice to not break all of those by keeping the same anchor names if possible (not sure if slate makes that easy-ish). For example:
http://dev.blockcypher.com/#zero_confirmations
http://dev.blockcypher.com/#websocket_webhook
http://dev.blockcypher.com/#micro_transactions
Our javascript examples are clearly outdated which led users to open PR on bitcoin-js lib such as bitcoinjs/bitcoinjs-lib#1399 and bitcoinjs/bitcoinjs-lib#1241.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.