Project

lbd_sdk

0.0
No release in over a year
LINE Blockchain Developer SDK for Ruby. This SDK is not official LINE SDK.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

LbdSdk

Unofficial LINE Blockchain API Client for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'lbd_sdk'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install lbd_sdk

Usage

client =
  LbdSdk::Client.new do |config|
    config.endpoint = 'https://test-api.blockchain.line.me'
    config.api_key = 'your_api_key'
    config.api_secret_key = 'your_secret_key'
  end

client.time

client.user_detail('<your-user-id>')

client.user_transactions('<your-user-id>', { page: 1, limit: 1 })

client.create_non_fungible_token(
  '<contract_id>',
  {
    owner_address: 'owner_address',
    owner_secret: 'owner_secret',
    name: 'SampleToken',
  },
)

client.mint_non_fungible_token(
  'contract_id',
  'token_type',
  {
    owner_address: 'owner_address',
    owner_secret: 'owner_secret',
    name: 'SampleToken',
    to_user_id: 'yout-user-id',
  },
)

client.update_non_fungible_token(
  'contract_id',
  'token_type',
  'token_index',
  {
    owner_address: 'owner_address',
    owner_secret: 'owner_secret',
    name: 'SampleToken2',
  },
)

client.burn_non_fungible_token(
  'contract_id',
  'token_type',
  'token_index',
  {
    owner_address: 'owner_address',
    owner_secret: 'owner_secret',
    from_user_id: 'yout-user-id',
  },
)

TODO

  • GET /v1/services/{serviceId}
  • GET /v1/service-tokens/
  • GET /v1/service-tokens/{contractId}
  • GET /v1/service-tokens/by-txHash/{txHash}
  • PUT /v1/service-tokens/{contractId}
  • POST /v1/service-tokens/{contractId}/mint
  • POST /v1/service-tokens/{contractId}/burn-from
  • POST /v1/service-tokens
  • GET /v1/service-tokens/{contractId}/holders
  • GET /v1/item-tokens/{contractId}
  • GET /v1/item-tokens/{contractId}/fungibles
  • GET /v1/item-tokens/{contractId}/fungibles/{tokenType}
  • GET /v1/item-tokens/{contractId}/fungibles/{tokenType}/holders
  • GET /v1/item-tokens/{contractId}/non-fungibles
  • POST /v1/item-tokens
  • GET /v1/item-tokens
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/holders
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/holder
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/children
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/parent
  • GET /v1/item-tokens/{contractId}/fungibles/thumbnails/{request-id}/status
  • PUT /v1/item-tokens/{contractId}/fungibles/thumbnails
  • GET /v1/item-tokens/{contractId}/fungibles/media-resources/{request-id}/status
  • PUT /v1/item-tokens/{contractId}/fungibles/media-resources
  • GET /v1/item-tokens/{contractId}/non-fungibles/thumbnails/{request-id}/status
  • PUT /v1/item-tokens/{contractId}/non-fungibles/thumbnails
  • GET /v1/item-tokens/{contractId}/non-fungibles/media-resources/{request-id}/status
  • PUT /v1/item-tokens/{contractId}/non-fungibles/media-resources
  • GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/root
  • PUT /v1/item-tokens/{contractId}/fungibles/{tokenType}
  • PUT /v1/item-tokens/{contractId}/non-fungibles/{tokenType}
  • PUT /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
  • POST /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/parent
  • DELETE /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/parent
  • POST /v1/item-tokens/{contractId}/fungibles
  • POST /v1/item-tokens/{contractId}/fungibles/{tokenType}/mint
  • POST /v1/item-tokens/{contractId}/fungibles/{tokenType}/burn
  • POST /v1/item-tokens/{contractId}/non-fungibles
  • POST /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/mint
  • POST /v1/item-tokens/{contractId}/non-fungibles/multi-mint
  • POST /v1/item-tokens/{contractId}/non-fungibles/multi-recipients/multi-mint
  • POST /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/burn
  • GET /v1/users/{userId}
  • GET /v1/users/{userId}/transactions
  • GET /v2/users/{userId}/transactions
  • GET /v1/users/{userId}/base-coin
  • GET /v1/users/{userId}/service-tokens
  • GET /v1/users/{userId}/service-tokens/{contractId}
  • GET /v1/users/{userId}/item-tokens/{contractId}/fungibles
  • GET /v1/users/{userId}/item-tokens/{contractId}/fungibles/{tokenType}
  • GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles
  • GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/with-type
  • GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/{tokenType}
  • GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
  • GET /v1/user-requests/{requestSessionToken}
  • GET /v1/users/{userId}/service-tokens/{contractId}/proxy
  • GET /v1/users/{userId}/item-tokens/{contractId}/proxy
  • POST /v1/users/{userId}/base-coin/request-transfer
  • POST /v1/users/{userId}/service-tokens/{contractId}/request-transfer
  • POST /v1/users/{userId}/service-tokens/{contractId}/request-proxy
  • POST /v1/users/{userId}/item-tokens/{contractId}/request-proxy
  • POST /v1/user-requests/{requestSessionToken}/commit
  • POST /v1/users/{userId}/service-tokens/{contractId}/transfer
  • POST /v1/users/{userId}/item-tokens/{contractId}/fungibles/{tokenType}/transfer
  • POST /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/transfer
  • POST /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/batch-transfer
  • GET /v1/wallets
  • GET /v1/wallets/{walletAddress}
  • GET /v1/wallets/{walletAddress}/transactions
  • GET /v2/wallets/{walletAddress}/transactions
  • GET /v1/wallets/{walletAddress}/base-coin
  • GET /v1/wallets/{walletAddress}/service-tokens
  • GET /v1/wallets/{walletAddress}/service-tokens/{contractId}
  • GET /v1/wallets/{walletAddress}/item-tokens/{contractId}/fungibles
  • GET /v1/wallets/{walletAddress}/item-tokens/{contractId}/fungibles/{tokenType}
  • GET /v1/wallets/{walletAddress}/item-tokens/{contractId}/non-fungibles
  • GET /v1/wallets/{walletAddress}/item-tokens/{contractId}/non-fungibles/{tokenType}
  • GET /v1/wallets/{walletAddress}/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
  • POST /v1/wallets/{walletAddress}/base-coin/transfer
  • POST /v1/wallets/{walletAddress}/service-tokens/{contractId}/transfer
  • POST /v1/wallets/{walletAddress}/item-tokens/{contractId}/fungibles/{tokenType}/transfer
  • POST /v1/wallets/{walletAddress}/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/transfer
  • POST /v1/wallets/{walletAddress}/item-tokens/{contractId}/non-fungibles/batch-transfer
  • POST /v1/memos
  • GET /v1/memos/{txHash}
  • GET /v1/time
  • GET /v1/transactions/{txHash}
  • GET /v2/transactions/{txHash}

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To work prettier, run npm i -D @prettier/plugin-ruby.

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.

Release

bundle exec rake build
git push origin <branch>
bundle exec rake release

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lbd_sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the LbdSdk project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.