MCPcopy Create free account
hub / github.com/GridPlus/client / issueRequest

Method issueRequest

src/rpc/web3.go:326–345  ·  view source on GitHub ↗

issueRequest issues the JSON-RPC request

(reqBody *JSONRPCRequest)

Source from the content-addressed store, hash-verified

324
325// issueRequest issues the JSON-RPC request
326func (client *EthereumClient) issueRequest(reqBody *JSONRPCRequest) ([]byte, error) {
327
328 payload, err := reqBody.ToJSON()
329 if err != nil {
330 return nil, err
331 }
332
333 reader := strings.NewReader(string(payload))
334 resp, err := http.Post(client.URL, JSON_MEDIA_TYPE, reader)
335 if err != nil {
336 return nil, err
337 }
338
339 body, err := ioutil.ReadAll(resp.Body)
340 defer resp.Body.Close()
341 if err != nil {
342 return nil, err
343 }
344 return body, nil
345}
346
347// Eth_newBlockFilter calls the eth_newBlockFilter JSON-RPC method
348func (client *EthereumClient) Eth_newBlockFilter() (string, error) {

Callers 13

Eth_newBlockFilterMethod · 0.95
Eth_getFilterChangesMethod · 0.95
Eth_getBlockByHashMethod · 0.95
Eth_getBlockByNumberMethod · 0.95
Eth_blockNumberMethod · 0.95
NetVersionMethod · 0.95
Eth_callMethod · 0.95
Eth_gasUsedMethod · 0.95

Calls 1

ToJSONMethod · 0.45

Tested by

no test coverage detected