//Andrew Malta 2015 //this is a small list of crucial api enpoints supported by blockcypher and their resultand inputs/outputs. //this data being returned is going to be converted to a standard derived from bitoind's standards. Blockcypher: No npm module, have to use url endpoints. Note: mainnet = http://api.blockcypher.com/v1/btc/main ... testnet = http://api.blockcypher.com/v1/btc/test3 ... 1. walletInfo: INPUT: MAIN- http://api.blockcypher.com/v1/btc/main/addrs/some-address TEST- http://api.blockcypher.com/v1/btc/test3/addrs/some-address OUTPUT: { "address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "total_received": 4433416, "total_sent": 0, "balance": 4433416, "unconfirmed_balance": 0, "final_balance": 4433416, "n_tx": 7, "unconfirmed_n_tx": 0, "final_n_tx": 7, "txrefs": [ { "tx_hash": "14b1052855bbf6561bc4db8aa501762...", "block_height": 302013, "tx_input_n": -1, "tx_output_n": 0, "value": 20213, "spent": false, "confirmations": 55061, "confirmed": "2014-05-22T03:46:25Z", "double_spend": false }, { "tx_hash": "4cff011ec53022f2ae47197d1a2fd4a6...", "block_height": 302002, "tx_input_n": -1, "tx_output_n": 0, "value": 40596, "spent": false, "confirmations": 55072, "confirmed": "2014-05-22T02:56:08Z", "double_spend": false }, ... ], "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/" } 2. getUnpsents: INPUT: http://api.blockcypher.com/v1/btc/main/addrs/some-address?unspentOnly=true OUPUT: { "address": "some-address", "total_received": 3463133, "total_sent": 1911375, "balance": 1551758, "unconfirmed_balance": 0, "final_balance": 1551758, "n_tx": 62, "unconfirmed_n_tx": 0, "final_n_tx": 62, "txrefs": [ { "tx_hash": "186efd8689fc403e5cc6faeef9497fcf177750b52afe55f407244d0c95625836", "block_height": 361537, "tx_input_n": -1, "tx_output_n": 0, "value": 12098, "spent": false, "confirmations": 840, "confirmed": "2015-06-18T22:09:15Z", "double_spend": false }, { "tx_hash": "415adf5ae53842aa96c9a0a8705f968bf1522405f930d0feac513c75856fec8c", "block_height": 361530, "tx_input_n": -1, "tx_output_n": 0, "value": 12103, "spent": false, "confirmations": 847, "confirmed": "2015-06-18T21:21:55Z", "double_spend": false }, { "tx_hash": "e4ee03421619fa0e325ce8b2862aeba7bc0c3a6d5564a8ab329d98901cec5a18", "block_height": 361530, "tx_input_n": -1, "tx_output_n": 0, "value": 12098, "spent": false, "confirmations": 847, "confirmed": "2015-06-18T21:21:55Z", "double_spend": false }, ... ], "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/" } 3. getTxINfo: INPUTS: https://api.blockcypher.com/v1/btc/main/txs/some-txid OUTPUTS: { "hash": "c326105f7fbfa4e8fe971569ef8858f47ee7e4aa5e8e7c458be8002be3d86aad", "first_seen_at": "2014-03-11T08:27:57+0000", "last_seen_at": "2014-03-11T08:27:57+0000", "block_height": 290000, "block_time": "2014-03-11T08:27:57+0000", "block_hash": "0000000000000000fa0b2badd05db0178623ebf8dd081fe7eb874c26e27d0b3b", "confirmations": 31130, "is_coinbase": false, "estimated_value": 70000000, "total_input_value": 70070000, "total_output_value": 70030000, "total_fee": 40000, "estimated_change": 30000, "estimated_change_address": "19M1EraiuAvZp8ZV7QJHH2LVkYm8ECufCJ", "high_priority": false, "enough_fee": true, "contains_dust": false, "inputs": [ { "index": 0, "output_hash": "d283ab6edd394b8a69d6943ea3a29a679d92176b112b1f69ffb9b70cf27dec5a", "output_index": 2769, "value": 2730000, "address": "19M1EraiuAvZp8ZV7QJHH2LVkYm8ECufCJ", "type": "pubkeyhash", "multisig": null, "script_signature": "0x49 0x3046022100bb3d102afd0d57be618aeaa7432bc038dea928bec0af6b8cba37c7ec85701e3d022100c467073956b385f08fbfbc2e130d8f76deb7c5436ba245afca4678200b127c2001 0x21 0x02aa6584518e528be497be65fba84913b7d0cb55158f4e7922298923286a7f6156" }, { "index": 1, "output_hash": "b350de75f9c27b457fa6cefb7072af8aa94de53ccedff4ec06ce885d63645e1d", "output_index": 2764, "value": 2740000, "address": "19M1EraiuAvZp8ZV7QJHH2LVkYm8ECufCJ", "type": "pubkeyhash", "multisig": null, "script_signature": "0x48 0x3045022059c6cc77c0a7c3a3a1ab0678690178750f2b5e442dc6f9331835be4cdb087cc00221008fca79860ab8f15acba61522b4f8482909cadfdf79dca7790efabf71c7c12d3701 0x21 0x02aa6584518e528be497be65fba84913b7d0cb55158f4e7922298923286a7f6156" }, { "index": 2, "output_hash": "fa3f040de013ddbe4a5746c89d32de2cac147845682e7d26119fd686a57e0b65", "output_index": 2549, "value": 2930000, "address": "19M1EraiuAvZp8ZV7QJHH2LVkYm8ECufCJ", "type": "pubkeyhash", "multisig": null, "script_signature": "0x47 0x304402207266d8c69d2c28e4050a90f48209768554e1470999a2259b000fd3c096edc39f02207b7f6a6b7ca7952249a1a1f3064e6a3f573fcd6700084e2fe71ce8f3d3f2be8301 0x21 0x02aa6584518e528be497be65fba84913b7d0cb55158f4e7922298923286a7f6156" }, { /* ... */ } ], "outputs": [ { "index": 0, "value": 70000000, "address": "1JSywyhFSvCC4NGALvKoyX5xng86QaigAN", "type": "pubkeyhash", "multisig": null, "script": "DUP HASH160 0x14 0xbf641337e3ab4eaae788a72bafedb965749882b2 EQUALVERIFY CHECKSIG", "script_hex": "76a914bf641337e3ab4eaae788a72bafedb965749882b288ac", "spent_hash": "71acf863d37d9d18524607e3dd68128b91ddc43dfe32f620ec124ceff3bb3295", "spent_index": 34 }, { "index": 1, "value": 30000, "address": "19M1EraiuAvZp8ZV7QJHH2LVkYm8ECufCJ", "type": "pubkeyhash", "multisig": null, "script": "DUP HASH160 0x14 0x5b8986608535c96923769138ad5be236a091b791 EQUALVERIFY CHECKSIG", "script_hex": "76a9145b8986608535c96923769138ad5be236a091b79188ac", "spent_hash": "400f77fff18e24d1a770c0e1ca85434ca5e4cd0f6e1489e5849256cc71f9ec0a", "spent_index": 2 }, { /* ... */ } ] } 4. pushTX: //just push signed transaction hex //{"tx": hex}; INPUTS: api.blockcypher.com/v1/bcy/test/txs/push OUTPUTS: { "block_height": -1, "hash": "4e6dfb1415b4fba5bd257c129847c70fbd4e45e41828079c4a282680528f3a50", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 4988000, "fees": 12000, "size": 226, "preference": "high", "relayed_by": "73.162.198.68", "received": "2015-05-22T05:10:00.305308666Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 1, "vout_sz": 2, "confirmations": 0, "inputs": [ { "prev_hash": "c8ea8b221580ebb2f1cabc8b40797bffec742b97c82a329df96d93121db43519", "output_index": 0, "script": "483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044", "output_value": 5000000, "sequence": 4294967295, "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash", "age": 576 } ], "outputs": [ { "value": 1000000, "script": "76a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac", "addresses": [ "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "script_type": "pay-to-pubkey-hash" }, { "value": 3988000, "script": "76a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash" } ] }