Class: NearApi::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/near_api/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = NearApi.config) ⇒ Query

Returns a new instance of Query.



4
5
6
# File 'lib/near_api/query.rb', line 4

def initialize(config = NearApi.config)
  @api = NearApi::Api.new(config)
end

Instance Method Details

#call(account_id, method_name, args, finality: 'optimistic') ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/near_api/query.rb', line 8

def call(, method_name, args, finality: 'optimistic')
  params = {
    account_id: ,
    method_name: method_name,
    finality: finality,
    request_type: 'call_function',
    args_base64: Base64.strict_encode64(args.to_json)
  }
  call_api(params)
end