44uk/nis-ruby

View on GitHub
lib/nis/endpoint/chain/last_block.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Nis::Endpoint
  module Chain
    module LastBlock
      # @return [Nis::Struct::Block]
      # @see https://nemproject.github.io/#last-block-of-the-block-chain-score
      def chain_last_block
        request!(:get, '/chain/last-block') do |res|
          res[:transactions] = res[:transactions].map { |t| Nis::Struct::Transaction.new(t) }
          Nis::Struct::Block.build res
        end
      end
    end
  end
end