sbd.ninja v0.0.2 - Add Witness Info/Vote For Functions, Add Android Release

in #utopian-io6 years ago (edited)

sbd.ninja v0.0.2 - Add Witness Info/Vote For Functions, Add Android Release

Project Info

  • A Cross Platform STEEM Information Query Tool (Mac/Windows/iOS/Android)
  • A lot of my friends need a native tool on Mobile (iOS/Android) to query steem related information, especially outdoors or on train.

Technology Stack

  • Lua + Corona SDK

License

  • MIT

Build

Special Thanks

New Features

local function queryWitnessInfo(username)

  local body = "?cached&id=" .. username

  local params = {}
  params.body = body

  network.request( "https://helloacm.com/api/steemit/witness/", 
    "POST", 
    function(event)
      if ( event.isError ) then
        print( "Network error: ", event.response )
      else
        print ( "RESPONSE: " .. event.response )
        local witnessInfo = json.decode(event.response)
        local detail = witnessInfo[1]

        -- insert info into table view
        for i = 0, #witnessInfo do
          if i == 0 then
            uiInfoTableView:insertRow({
                isCategory = true,
                params = {
                  text = username .. 
                  " - Witness Info"
                }
              })
          else
            local  rowHeight = math.ceil(display.contentHeight * 0.5 * 0.1)
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "name: " .. detail["name"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "created: " .. detail["created"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "url: " .. detail["url"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "votes: " .. detail["votes"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "running_version: " .. detail["running_version"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "total missed: " .. 
                  detail["total_missed"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "account creation fee: " .. 
                  detail["account_creation_fee"] .. " " ..
                  detail["account_creation_fee_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "maximum block size: " .. 
                  detail["maximum_block_size"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "sbd exchange rate base: " .. 
                  detail["sbd_exchange_rate_base"] .. " " ..
                  detail["sbd_exchange_rate_base_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "sbd_exchange_rate_quote: " .. 
                  detail["sbd_exchange_rate_quote"] .. " " ..
                  detail["sbd_exchange_rate_quote_symbol"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "last confirmed block num: " .. 
                  detail["last_confirmed_block_num"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "last aslot: " .. 
                  detail["last_aslot"]}})
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {text = "signing key: " .. detail["signing_key"]}})
          end
        end

      end
    end, 
    params )

end
  • Query Witness Vote For
    image.png
local function queryWitnessVoteFor(username)

    local body = "?cached&id=" .. username

  local params = {}
  params.body = body

  network.request( "https://helloacm.com/api/steemit/witness_votes/", 
    "POST", 
    function(event)
      if ( event.isError ) then
        print( "Network error: ", event.response )
      else
        print ( "RESPONSE: " .. event.response )
        local witnessInfo = json.decode(event.response)
        local votes = witnessInfo[1]["witness_votes"]

        -- insert info into table view
        for i = 0, #votes do
          if i == 0 then
            uiInfoTableView:insertRow({
                isCategory = true,
                params = {
                  text = username .. 
                  " - Witness Vote For"
                }
              })
          else
            local  rowHeight = math.ceil(display.contentHeight * 0.5 * 0.1)
            uiInfoTableView:insertRow({
                rowHeight = rowHeight, 
                params = {
                  text = 
                  votes[i]
                }
              })

          end
        end

      end
    end, 
    params )
end

Bug Fix

Roadmap

  • Mac/Windows
  • iOS/Android
  • Account Information
  • Delegation (In)
  • Delegation (Out)
  • Witness Info
  • Followed/Following
  • Profile
  • Curation
  • Converter
  • Transfer History
  • Votes
  • More...

Contribution is Welcome

Github: https://github.com/bobdos/sbd.ninja

  • Fork it!
  • 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
  • Submit a pull request.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

Great work, it is better to decompose info-scene.lua into a few modules.

You can contact us on Discord.
[utopian-moderator]

Thanks a lot for your support and feedback.

I will separate info-scene.lua into different files in next update.

Hey @bobdos I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Hey @bobdos I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.031
BTC 60970.88
ETH 2634.17
USDT 1.00
SBD 2.59