https://github.com/dan1d/lbry-api-ruby
Ruby wrapper for LBRY and LBRYcrd APIs
https://github.com/dan1d/lbry-api-ruby
cryptocurrency lbry lbrycrd-apis ruby ruby-wrapper
Last synced: 22 days ago
JSON representation
Ruby wrapper for LBRY and LBRYcrd APIs
- Host: GitHub
- URL: https://github.com/dan1d/lbry-api-ruby
- Owner: dan1d
- License: mit
- Created: 2018-06-01T23:29:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-21T21:44:17.000Z (almost 8 years ago)
- Last Synced: 2025-12-31T22:30:52.617Z (5 months ago)
- Topics: cryptocurrency, lbry, lbrycrd-apis, ruby, ruby-wrapper
- Language: Ruby
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Lbry
LBRY is an open-source protocol providing distribution, discovery, and purchase of digital content (data) via a decentralized network.
Ruby wrapper for LBRY and LBRYcrd APIs
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'lbry'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install lbry
## Usage
All methods listed on [Lbry API doc](https://lbryio.github.io/lbry) are working here and they have the same name and accept the same arguments, for example to call the method get example from the api doc: `curl 'http://localhost:5279' --data '{"method":"get","params":{"uri":"what"} }'`, here you will need to do this
```
client = Lbry::Client.new
client.get(uri: "what") =>
=> #, mime_type="video/mp4", nout=0, outpoint="6c71c02c4990ce0590f6888a77ad11f1ae45486f6a4c56d5013954ee8f6356bc:0", points_paid=0.0, sd_hash="d5169241150022f996fa7cd6a9a1c421937276a3275eb912790bd07ba7aec1fac5fd45431d226b8fb402691e79aeb24b", status="completed", stopped=true, stream_hash="9f41e37b1ea706d1b431a65f634b89c5aadefb106280da3661e4d565d47bc938a345755cafb2af807bcfc9fbde3306e3", stream_name="LBRY100.mp4", suggested_file_name="LBRY100.mp4", total_bytes=158433904, txid="6c71c02c4990ce0590f6888a77ad11f1ae45486f6a4c56d5013954ee8f6356bc", written_bytes=158433824>>
```
Example on how to get a list of claims:
```
client = Lbry::Client.new
response = client.claim_list(name: "lbry")
claims = response.result.claims # array of claims
claims.first => #, source=#, version="_0_0_1">, version="_0_0_1">>
```
You can also look under `test/fixtures/[method_name]/ to see how the response looks like.
You can get the list of supported methods [here](https://github.com/dan1d/lbry-api-ruby/blob/master/lib/lbry/client.rb#L6) and the API doc [here](https://lbryio.github.io/lbry), on the original API DOC you can see the list of arguments needed for each method call.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/dan1d/lbry.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).