lib/flow_client/client.rb in flow_client-0.2.1 vs lib/flow_client/client.rb in flow_client-0.2.2
- old
+ new
@@ -29,10 +29,12 @@
# :section: Accounts
# Returns an account for the address specified at the latest
# block.
#
+ # @param [String] the address string value
+ #
# @return [FlowClient::Account] the account
def get_account(address)
req = Access::GetAccountAtLatestBlockRequest.new(address: to_bytes(address))
begin
@@ -250,10 +252,12 @@
Block.parse_grpc_block_response(res)
end
# Returns the latest with height
#
+ # @param [Integer] block height
+ #
# @return [FlowClient::Block] the block
def get_block_by_height(height)
req = Access::GetBlockByHeightRequest.new(
height: height
)
@@ -263,10 +267,12 @@
# :section: Collections
# Returns the collection with id
#
+ # @param [String] collection id
+ #
# @return [FlowClient::Collection] the collection
def get_collection_by_id(id)
req = Access::GetCollectionByIDRequest.new(
id: to_bytes(id)
)
@@ -274,10 +280,16 @@
Collection.parse_grpc_type(res)
end
# :section: Events
- # Returns events of the given type between the start and end block heights.
+ # Returns events of the given type between the start and end block heights
+ #
+ # @param [String] event name
+ # @param [Integer] start block height
+ # @param [Integer] end block height
+ #
+ # @return [FlowClient::EventsResult] the events response
def get_events(type, start_height, end_height)
req = Access::GetEventsForHeightRangeRequest.new(
type: type,
start_height: start_height,
end_height: end_height