Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README.md with example and stellar links #80

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Ruby Stellar

[![Build Status](https://travis-ci.org/bloom-solutions/ruby-stellar-sdk.svg)](https://travis-ci.org/bloom-solutions/ruby-stellar-sdk)
[![Code Climate](https://codeclimate.com/github/bloom-solutions/ruby-stellar-sdk/badges/gpa.svg)](https://codeclimate.com/github/bloom-solutions/ruby-stellar-sdk)
[![Build Status](https://travis-ci.org/stellar/ruby-stellar-sdk.svg)](https://travis-ci.org/stellar/ruby-stellar-sdk)

This library helps you to integrate your application into the [Stellar network](http://stellar.org).

Expand All @@ -27,7 +26,7 @@ Also requires libsodium. Installable via `brew install libsodium` on OS X.

See [examples](examples).

A simple payment from the root account to some random accounts
A simple payment from the root account to some random account

```ruby
require 'stellar-sdk'
Expand All @@ -36,14 +35,21 @@ 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)
})
next_seq_num = client.account_info(account).sequence.to_i + 1
tx = Stellar::TransactionBuilder.new(
source_account: account.keypair,
sequence_number: next_seq_num
).add_operation(
Stellar::Operation.payment({
destination: recipient,
amount: [Stellar::Asset.native, 100]
})
).add_timeout(600).build()
envelope = tx.to_envelope(account.keypair)
client.submit_transaction(tx_envelope: envelope)
```

Be sure to set the network when submitting to the public network (more information in [stellar-base](https://www.github.com/bloom-solutions/ruby-stellar-base)):
Be sure to set the network when submitting to the public network (more information in [stellar-base](https://www.github.com/stellar/ruby-stellar-base)):

```ruby
Stellar.default_network = Stellar::Networks::PUBLIC
Expand All @@ -61,7 +67,7 @@ Stellar.default_network = Stellar::Networks::PUBLIC
## Contributing

1. Sign the [Contributor License Agreement](https://docs.google.com/forms/d/1g7EF6PERciwn7zfmfke5Sir2n10yddGGSXyZsq98tVY/viewform?usp=send_form)
2. Fork it ( https://github.com/bloom-solutions/ruby-stellar-lib/fork )
2. Fork it ( https://github.com/stellar/ruby-stellar-sdk/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
Expand Down