Class: Infurarb::Request
- Inherits:
-
Object
- Object
- Infurarb::Request
- Defined in:
- lib/infurarb/request.rb
Constant Summary collapse
- RPC_METHODS =
%i[ eth_accounts eth_blockNumber eth_gasPrice eth_getBalance eth_getBlockByHash eth_getBlockByNumber eth_getTransactionReceipt eth_getBlockTransactionCountByHash eth_getBlockTransactionCountByNumber eth_getCode eth_getLogs eth_getStorageAt eth_getTransactionByBlockHashAndIndex eth_getTransactionByBlockNumberAndIndex eth_getUncleByBlockNumberAndIndex eth_getUncleCountByBlockHash eth_getUncleCountByBlockNumber eth_getWork eth_hashrate eth_mining eth_protocolVersion eth_syncing eth_getTransactionByHash eth_getTransactionCount web3_clientVersion eth_call eth_estimateGas eth_sendRawTransaction eth_submitHashrate eth_submitWork ].freeze
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(endpoint:, method_name:, params: []) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(endpoint:, method_name:, params: []) ⇒ Request
Returns a new instance of Request.
37 38 39 40 41 |
# File 'lib/infurarb/request.rb', line 37 def initialize(endpoint:, method_name:, params: []) @endpoint = endpoint @method_name = method_name @params = params end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
36 37 38 |
# File 'lib/infurarb/request.rb', line 36 def endpoint @endpoint end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
36 37 38 |
# File 'lib/infurarb/request.rb', line 36 def method_name @method_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
36 37 38 |
# File 'lib/infurarb/request.rb', line 36 def params @params end |