Official SDKs: Android | iOS | Javascript | PHP | Ruby
LUXSTACK Bitcoin Platform and SDKs — build, test and scale bitcoin apps faster. 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.
LUXSTACK Bitcoin SDKs for other platforms
- Android
- iOS
- Javascript
- PHP
- Ruby