A module for bitcore that implements HTTP requests to different Web APIs to query the state of the blockchain.
Getting started
Be careful! When using this module, the information retrieved from remote servers may be compromised and not reflect the actual state of the blockchain.
npm install bitcore-insight
bower install bitcore-insight
Insight
Description
Insight is a simple agent to perform queries to an Insight blockchain explorer. The default servers are https://insight.bitpay.com and https://test-insight.bitpay.com, hosted by BitPay Inc. You can (and we strongly suggest you do) run your own insight server. For more information, head to https://github.com/bitpay/insight-api
This Insight module allows you to:
Get the UTXOs of a Bitcoin address to create a transaction with a Bitcore transaction object.
Broadcast a Bitcore transaction object to the Bitcoin Network (Mainnet or Testnet)
Retrieving Unspent UTXOs for an Address (or set of)
Bitcoin's UTXO model does two transactions from its total balance to the receiving address and to its change address. For instance in the transaction below you can see valueIn = fees + valueOut. So where you see vin that is the input value and you have two vout transactions, one is to the address we want to send bitcoin to and the other is our own address to get the remaining bitcoin.
Where txid is returned with the following object. This is a sample transaction.