New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitcoin-3rd-party-apis

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-3rd-party-apis

0.3.2
Rubygems
Version published
Maintainers
1
Created
Source

Bitcoin 3rd-party APIs

Ruby wrapper for various popular 3rd-party bitcoin related APIs. At the moment only Block Explorer (http://blockexplorer.com) and BlockChain.info (http://blockchain.info) are wrapped. The gem exposes some handy bitcoin blockchain query methods, useful for thin bitcoin clients.

Installation

Add this line to your application's Gemfile:

gem 'bitcoin-3rd-party-apis'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bitcoin-3rd-party-apis

Usage

mytransactions returns Ruby hash of raw transactions relating to the specified address(es).

    BlockExplorer.mytransactions(address)
    BlockExplorer.mytransactions([address1, address2])

multiaddr is similar to BlockExplorer's mytransactions, but returns a more user-friendly hash.

    BlockchainInfo.multiaddr(address)
    BlockchainInfo.multiaddr([address1, address2])

getreceivedbyaddress returns BigDecimal of the total amount of bitcoins sent to the address. Note for the BlockchainInfo version, 120 is the maximum confirmation number.

    BlockExplorer.getreceivedbyaddress(address)
    BlockExplorer.getreceivedbyaddress(address, 3) # return received amount where transactions have minconf=3

    BlockchainInfo.getreceivedbyaddress(address)
    BlockchainInfo.getreceivedbyaddress(address, 3) # return received amount where transactions have minconf=3

longest_block_count returns count of the longest blockchain in the network. This blockchain is considered the current blockchain.

    BlockchainInfo.longest_block_count

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 16 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts