class Infurarb::Request

Constants

RPC_METHODS

Attributes

endpoint[R]
method_name[R]
params[R]

Public Class Methods

new(endpoint:, method_name:, params: []) click to toggle source
# File lib/infurarb/request.rb, line 37
def initialize(endpoint:, method_name:, params: [])
  @endpoint = endpoint
  @method_name = method_name
  @params = params
end

Public Instance Methods

call() click to toggle source
# File lib/infurarb/request.rb, line 43
def call
  Response.new(
    HTTP.post(
      endpoint,
      json: { jsonrpc: '2.0', method: method_name, params: params, id: 1 }
    ),
    self
  )
end