0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Wrapper for BiiLabs APIs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.8.0

Runtime

~> 0.15
~> 2.2
 Project Readme

Biilabs Client

To post/get tangles on IoTA

Install

from console

gem install biilabs-client

with bundler, write follwing line in your Gemfile

gem 'biilabs-client'

Usage

setup endpoint in config/biilabs-client.yml check config/biilabs-client_example.yml for example

require on demand

irb> require 'biilabs-client'

convert string to trytes

irb> "Hello World".to_trytes.value
# "RBTC9D9DCDEAFCCDFD9DSC"

convert trytes string to normal string

irb> Trytes.new("RBTC9D9DCDEAFCCDFD9DSC").to_string
# "Hello World"

post tangle to IoTA via Biilabs

irb> BiilabsClient.new.post_tangle('my tag', 'my message')
# {
#   "hash"=>"LTSDZIYLKSLQHCOZPHWWCNUNSFZCVLTZELARIONAGR9RGY9ZXC9J9AYHUZMGEODZXI9AOMJ9PCKB99999",
#   "signature_and_message_fragment"=>"ADMDEAADTCGDGDPCVCTC9999...",
#   "tag"=>"ADMDEAHDPCVC999999999999999",
#   ...
# }

get tangle from IoTA via Biilabs

irb> BiilabsClient.new.get_tangle('LTSDZIYLKSLQHCOZPHWWCNUNSFZCVLTZELARIONAGR9RGY9ZXC9J9AYHUZMGEODZXI9AOMJ9PCKB99999')
# {
#   "hash"=>"LTSDZIYLKSLQHCOZPHWWCNUNSFZCVLTZELARIONAGR9RGY9ZXC9J9AYHUZMGEODZXI9AOMJ9PCKB99999",
#   "signature_and_message_fragment"=>"ADMDEAADTCGDGDPCVCTC9999...",
#   "tag"=>"ADMDEAHDPCVC999999999999999",
#   ...
# }

get tangles by tag from IoTA via Biilabs

irb> BiilabsClient.new.get_tangle_by_tag('my tag')
# {
#   "transactions"=>[{
#     "hash"=>"LTSDZIYLKSLQHCOZPHWWCNUNSFZCVLTZELARIONAGR9RGY9ZXC9J9AYHUZMGEODZXI9AOMJ9PCKB99999",
#     "signature_and_message_fragment"=>"ADMDEAADTCGDGDPCVCTC9999...",
#     "tag"=>"ADMDEAHDPCVC999999999999999",
#     ...
#   }]
# }