Git Product home page Git Product logo

razrbit-sdk-ruby's Introduction

Official SDKs: Android | iOS | Javascript | PHP | Ruby

Razrbit Bitcoin Platform and SDKs โ€” build, test and scale bitcoin apps faster with Razrbit. Plug in our powerful SDKs to supercharge your bitcoin toolbox.

Razrbit SDK for Ruby (Beta)

Installation

gem install razrbit

HTTP Examples

Wallet

require 'razrbit'

wallet = Razrbit::Wallet.new(app_id: '', app_secret: '')

response = wallet.create_new_address

response = wallet.send_amount(from_address_private_key: '',
                              to_address: '',
                              amount: 0)

response = wallet.balance_from_address(address: '')

case response
when Net::HTTPSuccess then
  response
else
  # handle error
end

Explorer

require 'razrbit'

explorer = Razrbit::Explorer.new(app_id: '', app_secret: '')

response = explorer.block(block_hash: '')
response = explorer.transaction(transaction_hash: '')
response = explorer.address(address: '')
response = explorer.address_unspent_outputs(address: '')

case response
when Net::HTTPSuccess then
  response
else
  # handle error
end

Network

require 'razrbit'

network = Razrbit::Network.new(app_id: '', app_secret: '')

response = network.get_difficulty
response = network.push_transaction(transaction: '')

case response
when Net::HTTPSuccess then
  response
else
  # handle error
end

Markets

require 'razrbit'

markets = Razrbit::Markets.new(app_id: '', app_secret: '')

response = markets.price(currency_code: 'USD')
response = markets.day_price(currency_code: 'USD')
response = markets.historical_price(currency_code: 'USD',
                                    date: '2014-08-14')


case response
when Net::HTTPSuccess then
  response
else
  # handle error
end

Webhook

require 'razrbit'

notifications = Razrbit::Notifications.new(app_id: '', app_secret: '')

response = notifications.address(address: '',
                           email: '[email protected]')

response = notifications.block(block_hash: '',
                          email: '[email protected]')

response = notifications.transaction(transaction_hash: '',
                                email: '[email protected]')

case response
when Net::HTTPSuccess then
  response
else
  # handle error
end

API

Wallet

response = wallet.create_new_address

Creates a new bitcoin address in your wallet

response = wallet.send_amount(from_address_private_key: '', to_address: '', satoshi_amount: 0)

Sends bitcoin from one of your addresses to the destination address.

response = wallet.balance_from_address(address: '')

Returns the balance of the given address in satoshis.

Explorer

response = explorer.block(block_hash: '')

Retrieve details about a given block

response = explorer.transaction(transaction_hash: '')

Retrieve details about a given transaction

response = explorer.address(address: '')

Retrieve details about a given address

response = explorer.address_unspent_outputs(address: '')

Returns the list of unspent outputs for a given address

Network

response = network.get_difficulty

Retrieve the current network difficulty

response = network.push_transaction(transaction: '')

Push a transaction on the network

Markets

currencyCode is a valid ISO 4217 code such as USD or EUR.

response = markets.price(currency_code: 'USD')

Returns the current bitcoin price

response = markets.day_price(currency_code: 'USD')

Returns the day price

response = markets.historical_price(currency_code: 'USD', date: '2014-08-14')

Returns the historical price at the given date. date must be a date in the yyyy-mm-dd format.

Notifications

response = notifications.address(address: '', email: '[email protected]')

Setup a notification email for a given address

response = notifications.blocks(block_hash: '', email: '[email protected]')

Setup a notification email for a given block

response = notifications.transactions(transaction_hash: '', email: '[email protected]')

Setup a notification email for a given transaction

Support

Feel free to request a feature and make suggestions for our product team.

License

Code released under the MIT license.

Copyright 2012-2014 LUXSTACK Inc. Razrbit is a trademark maintained by LUXSTACK Inc.

Razrbit Bitcoin SDKs for other platforms

razrbit-sdk-ruby's People

Contributors

kevinaleman avatar jonwaller avatar

Watchers

motoki yoan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.