Stellar SDK for Ruby: Horizon Integration and Higher Level Abstractions
This library helps you to integrate your application into the Stellar network.
Installation
Add this lines to your application's Gemfile:
gem 'stellar-sdk'
And then execute:
$ bundle
Also requires libsodium. Installable via brew install libsodium on OS X.
Usage
See examples.
A simple payment from the root account to some random accounts
require 'stellar-sdk'
account = Stellar::Account.master
client = Stellar::Client.default_testnet()
recipient = Stellar::Account.random
client.send_payment({
from: account,
to: recipient,
amount: Stellar::Amount.new(100_000_000)
})
Be sure to set the network when submitting to the public network (more information in stellar-base):
Stellar.default_network = Stellar::Networks::PUBLIC
Development
- Install and activate rvm
- Ensure your
bundlerversion is up-to-date:gem install bundler - Run
bundle install - Copy
spec/config.yml.sampletospec/config.yml - Replace anything in
spec/config.ymlespecially if you will re-record specs bundle exec rspec spec
Contributing
- Sign the Contributor License Agreement
- Fork it ( https://github.com/astroband/ruby-stellar-sdk/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request