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

blockchain

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockchain

  • 3.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Blockchain API library (Ruby, v1)

An official Ruby gem for interacting with the Blockchain.info API.

Release notes

This gem was recently updated to support additional functionality of the Blockchain API. As part of this process, the archticture was changed. Rather than calling static methods under the Blockchain module, applications can now create instances of different classes supporting different Blockchain API endpoints. Calling the static methods will still work, but these have been deprecated.

Getting started

Installation via RubyGems:

$ gem install blockchain

Manual installation:

$ git clone https://github.com/blockchain/api-v1-client-ruby
$ cd api-v1-client-ruby
$ rake install

To use the wallet and createwallet functionality, you'll also need an instance of service-my-wallet.

The gem consists of the following functionality:

The main module is called Blockchain

The Client class

Every class instance creates an instance of the client class, which is used to make calls to the API. The client instance will be created with a default base url if none is provided. You can also provide an API code when creating an instance of any class. For example:

require 'Blockchain'

# creates a block explorer instance pointing to the default base url, https://blockchain.info/, with no api code
explorer = Blockchain::BlockExplorer.new
# creates a block explorer pointing to an alternative base url and using an api code
explorer = Blockchain::BlockExplorer.new('http://some-other-url.com/', 'api-code')

Error handling

All functions may raise exceptions caused by incorrectly passed parameters or other problems. If a call is rejected server-side, the APIException exception will be raised.

Connection timeouts

It is possible to set arbitrary connection timeouts.

require 'Blockchain'
Blockchain::TIMEOUT_SECONDS = 5 #time out after 5 seconds

Request limits and API keys

In order to prevent abuse some API methods require an API key approved with some basic contact information and a description of its intended use. Please request an API key here.

The same API key can be used to bypass the request limiter.

FAQs

Package last updated on 15 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc