A high-performance Ethereum RPC client built on fasthttp and gobwas/ws. No go-ethereum dependency.
- Fasthttp-based HTTP — 3–5x faster than
net/httpfor JSON-RPC - WebSocket subscriptions — real-time log and header streaming
- Multicall2 —
aggregateandtryAggregatewith typed calls and automatic ABI decoding - Gas estimation — adaptive
eth_estimateGaswith automatic multiplier - Nonce management — concurrent-safe
eth_getTransactionCountwith caching - Transaction building — EIP-1559 (type 2) with legacy fallback, RLP encoding
- Wallet — secp256k1 key management and signing (via
decred/dcrd/secp256k1) - Price oracle — on-demand token price via known DEX pairs
import "github.com/cryptoddev/fasteth"
client := fasteth.NewClient("http://node:8545", "ws://node:8546")
// Direct eth_call
result, err := client.CallContract(ctx, &fasteth.CallMsg{
To: "0x...",
Data: "0x70a08231...",
}, 0)
// Multicall aggregate
call := fasteth.BuildCall(pool, "factory()")
results, _ := client.Aggregate3(ctx, []fasteth.Call{call}, 100)Aggregate up to 100 calls in a single RPC request. Supports both aggregate and tryAggregate (per-call failure tolerance).
symCall := fasteth.BuildCall(token, "symbol()")
symCall.OutputTypes = []fastabi.ParamType{fastabi.TString()}
balCall := fasteth.BuildCallWithArgs(token, "balanceOf(address)",
[]fastabi.ParamType{fastabi.TAddress()},
[]any{userAddr},
)
results, _ := client.Aggregate3(ctx, []fasteth.Call{symCall, balCall}, 100)
for _, r := range results {
if r.Success {
log.Printf("decoded: %v", r.Decoded)
}
}# Unit tests
go test -short ./...
# Integration tests (requires a running RPC node)
go test -tags=integration -run TestMultiCall ./
go test -tags=integration -run TestAggregate3_RealNode .MIT