Discover Packages
github.com/ModChain/ethrpc
package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Jul 17, 2024
License: MIT
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
ethrpc
Simple go lib to make RPC calls to Ethereum-like nodes easy
TODO
Expand ▾
Collapse ▴
Documentation
¶
ReadString decodes the return value as a string and returns it
ReadTo returns a setter function that will return an error if an error happens. This is
a bit convoluted because of limitation in Go's syntax, but this could be used as:
err = ReadTo(&block)(target.RPC("eth_getBlockByNumber", "0x1b4", true))
ReadUint64 decodes the return value and passes it as a uint64.
This can be used as: res, err := ReadUint64(target.Do("eth_blockNumber"))
TODO support ws protocol
New returns a new instance of RPC to perform requests to the given RPC endpoint
Do performs a RPC request
DoCtx performs a RPC request, taking an optional context that can be cancelled to stop the request
Source Files
¶
Click to show internal directories.
Click to hide internal directories.