diff --git a/go.mod b/go.mod index b13e07ad93b2dc56268ad6484fc8afe3a4c237ee..94784b450e7f1d6792bef96f43b30aabf0762993 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gobuffalo/packr/v2 v2.8.3 github.com/iancoleman/strcase v0.2.0 github.com/json-iterator/go v1.1.12 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce gopkg.in/yaml.v2 v2.4.0 nhooyr.io/websocket v1.8.7 @@ -30,6 +30,7 @@ require ( github.com/gobuffalo/logger v1.0.6 // indirect github.com/gobuffalo/packd v1.0.1 // indirect github.com/gorilla/websocket v1.4.2 // indirect + github.com/josharian/impl v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/karrick/godirwalk v1.16.1 // indirect github.com/klauspost/compress v1.10.3 // indirect @@ -46,6 +47,9 @@ require ( github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect + golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/tools v0.1.12 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect ) diff --git a/go.sum b/go.sum index 5d68e8c14d9fe316a108ff6e11af45c049726ce9..2675d15e0875bad834213fe133d72c2df3ea76ae 100644 --- a/go.sum +++ b/go.sum @@ -220,6 +220,8 @@ github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/josharian/impl v1.1.0 h1:gafhg1OFVMq46ifdkBa8wp4hlGogjktjjA5h/2j4+2k= +github.com/josharian/impl v1.1.0/go.mod h1:SQ6aJMP6xsJpGSD/36IIqrUdigLCYe9bz/9o5AKm6Aw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -390,6 +392,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -451,6 +455,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -502,6 +507,8 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -554,6 +561,7 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -568,11 +576,15 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= diff --git a/mux.go b/mux.go index bbb0db7c20bdc7359c5c8bcef73a1040ea57ea4d..cf1028a38a80fb2f9d38367123f7cf359887953f 100644 --- a/mux.go +++ b/mux.go @@ -73,6 +73,22 @@ func (m *Mux) RegisterStruct(name string, rcvr any) error { }) return nil } +func (m *Mux) RegisterFunc(name string, rcvr any) error { + rcvrVal := reflect.ValueOf(rcvr) + if name == "" { + return fmt.Errorf("no service name for type %s", rcvrVal.Type().String()) + } + callbacks := suitableCallbacks(rcvrVal) + if len(callbacks) == 0 { + return fmt.Errorf("service %T doesn't have any suitable methods/subscriptions to expose", rcvr) + } + m.Route(name, func(r Router) { + for nm, cb := range callbacks { + r.Handle(nm, cb) + } + }) + return nil +} // ServeRPC is the single method of the Handler interface that makes // Mux interoperable with the standard library. It uses a sync.Pool to get and diff --git a/openrpc/generate/generate.go b/openrpc/generate/generate.go index 9d773087d05e4d4fe86b134d060154c0d0adb6c4..979022e4591846ed3b777d3d81353c1c0a7d91be 100644 --- a/openrpc/generate/generate.go +++ b/openrpc/generate/generate.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "go/format" + "log" "os" "path" "path/filepath" @@ -65,18 +66,19 @@ func Generate(rpc *types.OpenRPC, ts string, output string) error { if err != nil { return err } + log.Println(wr.String()) var fmtd []byte fmtd, err = format.Source(wr.Bytes()) if err != nil { return err } - wr.Reset() err = os.WriteFile(output, fmtd, 0777) if err != nil { return err } + wr.Reset() return nil } diff --git a/openrpc/out/example/main.go b/openrpc/out/example/main.go new file mode 100644 index 0000000000000000000000000000000000000000..3720eff1d203e453d2a90dcc21e6856f0a116212 --- /dev/null +++ b/openrpc/out/example/main.go @@ -0,0 +1,8 @@ +package main + +import ( + _ "gfx.cafe/open/jrpc/openrpc/out" +) + +type RpcHandler struct { +} diff --git a/openrpc/out/generated_api.go b/openrpc/out/generated_api.go index 5e6fdb4d3f173c25bfa9762193af30a55514ca0e..3eae1e4838341627b51b4fd0c6265fb396150960 100755 --- a/openrpc/out/generated_api.go +++ b/openrpc/out/generated_api.go @@ -2,259 +2,743 @@ package out -import "context" +import ( + "context" + "gfx.cafe/open/jrpc" +) + +type GoOpenRPCHandler struct { + Srv GoOpenRPCService +} + +func (h *GoOpenRPCHandler) RouteRPC(r jrpc.Router) { + // Returns an RLP-encoded header. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawHeader", h.Srv.DebugGetRawHeader) + }) + + // Returns an RLP-encoded block. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawBlock", h.Srv.DebugGetRawBlock) + }) + + // Returns an array of EIP-2718 binary-encoded transactions. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawTransaction", h.Srv.DebugGetRawTransaction) + }) + + // Returns an array of EIP-2718 binary-encoded receipts. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawReceipts", h.Srv.DebugGetRawReceipts) + }) + + // Returns an array of recent bad blocks that the client has seen on the network. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getBadBlocks", h.Srv.DebugGetBadBlocks) + }) + + // Returns information about a block by hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockByHash", h.Srv.EthGetBlockByHash) + }) + + // Returns information about a block by number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockByNumber", h.Srv.EthGetBlockByNumber) + }) + + // Returns the number of transactions in a block from a block matching the given block hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockTransactionCountByHash", h.Srv.EthGetBlockTransactionCountByHash) + }) + + // Returns the number of transactions in a block matching the given block number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockTransactionCountByNumber", h.Srv.EthGetBlockTransactionCountByNumber) + }) + + // Returns the number of uncles in a block from a block matching the given block hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getUncleCountByBlockHash", h.Srv.EthGetUncleCountByBlockHash) + }) + + // Returns the number of transactions in a block matching the given block number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getUncleCountByBlockNumber", h.Srv.EthGetUncleCountByBlockNumber) + }) + + // Returns the chain ID of the current network. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("chainId", h.Srv.EthChainId) + }) + + // Returns an object with data about the sync status or false. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("syncing", h.Srv.EthSyncing) + }) + + // Returns the client coinbase address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("coinbase", h.Srv.EthCoinbase) + }) + + // Returns a list of addresses owned by client. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("accounts", h.Srv.EthAccounts) + }) + + // Returns the number of most recent block. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("blockNumber", h.Srv.EthBlockNumber) + }) + + // Executes a new message call immediately without creating a transaction on the block chain. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("call", h.Srv.EthCall) + }) + + // Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("estimateGas", h.Srv.EthEstimateGas) + }) + + // Generates an access list for a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("createAccessList", h.Srv.EthCreateAccessList) + }) + + // Returns the current price per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("gasPrice", h.Srv.EthGasPrice) + }) + + // Returns the current maxPriorityFeePerGas per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("maxPriorityFeePerGas", h.Srv.EthMaxPriorityFeePerGas) + }) + + // Transaction fee history + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("feeHistory", h.Srv.EthFeeHistory) + }) + + // Creates a filter object, based on filter options, to notify when the state changes (logs). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newFilter", h.Srv.EthNewFilter) + }) + + // Creates a filter in the node, to notify when a new block arrives. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newBlockFilter", h.Srv.EthNewBlockFilter) + }) + + // Creates a filter in the node, to notify when new pending transactions arrive. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newPendingTransactionFilter", h.Srv.EthNewPendingTransactionFilter) + }) + + // Uninstalls a filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("uninstallFilter", h.Srv.EthUninstallFilter) + }) + + // Polling method for a filter, which returns an array of logs which occurred since last poll. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterChanges", h.Srv.EthGetFilterChanges) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterLogs", h.Srv.EthGetFilterLogs) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getLogs", h.Srv.EthGetLogs) + }) + + // Returns whether the client is actively mining new blocks. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("mining", h.Srv.EthMining) + }) + + // Returns the number of hashes per second that the node is mining with. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("hashrate", h.Srv.EthHashrate) + }) + + // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getWork", h.Srv.EthGetWork) + }) + + // Used for submitting a proof-of-work solution. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitWork", h.Srv.EthSubmitWork) + }) + + // Used for submitting mining hashrate. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitHashrate", h.Srv.EthSubmitHashrate) + }) + + // Returns an EIP-191 signature over the provided data. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sign", h.Srv.EthSign) + }) + + // Returns an RLP encoded transaction signed by the specified account. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("signTransaction", h.Srv.EthSignTransaction) + }) + + // Returns the balance of the account of given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBalance", h.Srv.EthGetBalance) + }) + + // Returns the value from a storage position at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getStorageAt", h.Srv.EthGetStorageAt) + }) + + // Returns the number of transactions sent from an address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionCount", h.Srv.EthGetTransactionCount) + }) + + // Returns code at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getCode", h.Srv.EthGetCode) + }) + + // Returns the merkle proof for a given account and optionally some storage keys. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getProof", h.Srv.EthGetProof) + }) + + // Signs and submits a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendTransaction", h.Srv.EthSendTransaction) + }) + + // Submits a raw transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendRawTransaction", h.Srv.EthSendRawTransaction) + }) + + // Returns the information about a transaction requested by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByHash", h.Srv.EthGetTransactionByHash) + }) + + // Returns information about a transaction by block hash and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockHashAndIndex", h.Srv.EthGetTransactionByBlockHashAndIndex) + }) + + // Returns information about a transaction by block number and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockNumberAndIndex", h.Srv.EthGetTransactionByBlockNumberAndIndex) + }) + + // Returns the receipt of a transaction by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionReceipt", h.Srv.EthGetTransactionReceipt) + }) + +} + +type RpcHandler struct { +} + +// Returns an RLP-encoded header. +func (h *RpcHandler) DebugGetRawHeader(ctx context.Context, + Block BlockNumberOrTag) (HeaderRLP Bytes, err error) { + panic("implement me") +} + +// Returns an RLP-encoded block. +func (h *RpcHandler) DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag) (BlockRLP Bytes, err error) { + panic("implement me") +} + +// Returns an array of EIP-2718 binary-encoded transactions. +func (h *RpcHandler) DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32) (EIP2718BinaryEncodedTransaction Bytes, err error) { + panic("implement me") +} + +// Returns an array of EIP-2718 binary-encoded receipts. +func (h *RpcHandler) DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag) (Receipts []Bytes, err error) { + panic("implement me") +} + +// Returns an array of recent bad blocks that the client has seen on the network. +func (h *RpcHandler) DebugGetBadBlocks(ctx context.Context, +) (Blocks []BadBlock, err error) { + panic("implement me") +} + +// Returns information about a block by hash. +func (h *RpcHandler) EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, HydratedTransactions bool) (BlockInformation Block, err error) { + panic("implement me") +} + +// Returns information about a block by number. +func (h *RpcHandler) EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, HydratedTransactions bool) (BlockInformation Block, err error) { + panic("implement me") +} + +// Returns the number of transactions in a block from a block matching the given block hash. +func (h *RpcHandler) EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32) (TransactionCount Uint, err error) { + panic("implement me") +} + +// Returns the number of transactions in a block matching the given block number. +func (h *RpcHandler) EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag) (TransactionCount Uint, err error) { + panic("implement me") +} + +// Returns the number of uncles in a block from a block matching the given block hash. +func (h *RpcHandler) EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32) (UncleCount Uint, err error) { + panic("implement me") +} + +// Returns the number of transactions in a block matching the given block number. +func (h *RpcHandler) EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag) (UncleCount Uint, err error) { + panic("implement me") +} + +// Returns the chain ID of the current network. +func (h *RpcHandler) EthChainId(ctx context.Context, +) (ChainID Uint, err error) { + panic("implement me") +} + +// Returns an object with data about the sync status or false. +func (h *RpcHandler) EthSyncing(ctx context.Context, +) (SyncingStatus SyncingStatus, err error) { + panic("implement me") +} + +// Returns the client coinbase address. +func (h *RpcHandler) EthCoinbase(ctx context.Context, +) (CoinbaseAddress Address, err error) { + panic("implement me") +} + +// Returns a list of addresses owned by client. +func (h *RpcHandler) EthAccounts(ctx context.Context, +) (Accounts []Address, err error) { + panic("implement me") +} + +// Returns the number of most recent block. +func (h *RpcHandler) EthBlockNumber(ctx context.Context, +) (BlockNumber Uint, err error) { + panic("implement me") +} + +// Executes a new message call immediately without creating a transaction on the block chain. +func (h *RpcHandler) EthCall(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (ReturnData Bytes, err error) { + panic("implement me") +} + +// Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. +func (h *RpcHandler) EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (GasUsed Uint, err error) { + panic("implement me") +} + +// Generates an access list for a transaction. +func (h *RpcHandler) EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` +}, err error) { + panic("implement me") +} + +// Returns the current price per gas in wei. +func (h *RpcHandler) EthGasPrice(ctx context.Context, +) (GasPrice Uint, err error) { + panic("implement me") +} + +// Returns the current maxPriorityFeePerGas per gas in wei. +func (h *RpcHandler) EthMaxPriorityFeePerGas(ctx context.Context, +) (MaxPriorityFeePerGas Uint, err error) { + panic("implement me") +} + +// Transaction fee history +func (h *RpcHandler) EthFeeHistory(ctx context.Context, + BlockCount Uint, NewestBlock BlockNumberOrTag, RewardPercentiles []float64) (FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` +}, err error) { + panic("implement me") +} + +// Creates a filter object, based on filter options, to notify when the state changes (logs). +func (h *RpcHandler) EthNewFilter(ctx context.Context, + Filter *Filter) (FilterIdentifier Uint, err error) { + panic("implement me") +} + +// Creates a filter in the node, to notify when a new block arrives. +func (h *RpcHandler) EthNewBlockFilter(ctx context.Context, +) (FilterIdentifier Uint, err error) { + panic("implement me") +} + +// Creates a filter in the node, to notify when new pending transactions arrive. +func (h *RpcHandler) EthNewPendingTransactionFilter(ctx context.Context, +) (FilterIdentifier Uint, err error) { + panic("implement me") +} + +// Uninstalls a filter with given id. +func (h *RpcHandler) EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint) (Success bool, err error) { + panic("implement me") +} + +// Polling method for a filter, which returns an array of logs which occurred since last poll. +func (h *RpcHandler) EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint) (LogObjects FilterResults, err error) { + panic("implement me") +} + +// Returns an array of all logs matching filter with given id. +func (h *RpcHandler) EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint) (LogObjects FilterResults, err error) { + panic("implement me") +} + +// Returns an array of all logs matching filter with given id. +func (h *RpcHandler) EthGetLogs(ctx context.Context, + Filter *Filter) (LogObjects FilterResults, err error) { + panic("implement me") +} + +// Returns whether the client is actively mining new blocks. +func (h *RpcHandler) EthMining(ctx context.Context, +) (MiningStatus bool, err error) { + panic("implement me") +} + +// Returns the number of hashes per second that the node is mining with. +func (h *RpcHandler) EthHashrate(ctx context.Context, +) (MiningStatus Uint, err error) { + panic("implement me") +} + +// Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). +func (h *RpcHandler) EthGetWork(ctx context.Context, +) (CurrentWork []Bytes32, err error) { + panic("implement me") +} + +// Used for submitting a proof-of-work solution. +func (h *RpcHandler) EthSubmitWork(ctx context.Context, + Nonce Bytes8, Hash Bytes32, Digest Bytes32) (Success bool, err error) { + panic("implement me") +} + +// Used for submitting mining hashrate. +func (h *RpcHandler) EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, Id Bytes32) (Success bool, err error) { + panic("implement me") +} + +// Returns an EIP-191 signature over the provided data. +func (h *RpcHandler) EthSign(ctx context.Context, + Address Address, Message Bytes) (Signature Bytes65, err error) { + panic("implement me") +} + +// Returns an RLP encoded transaction signed by the specified account. +func (h *RpcHandler) EthSignTransaction(ctx context.Context, + Transaction GenericTransaction) (EncodedTransaction Bytes, err error) { + panic("implement me") +} + +// Returns the balance of the account of given address. +func (h *RpcHandler) EthGetBalance(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (Balance Uint, err error) { + panic("implement me") +} + +// Returns the value from a storage position at a given address. +func (h *RpcHandler) EthGetStorageAt(ctx context.Context, + Address Address, StorageSlot Uint256, Block *BlockNumberOrTag) (Value Bytes, err error) { + panic("implement me") +} + +// Returns the number of transactions sent from an address. +func (h *RpcHandler) EthGetTransactionCount(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (TransactionCount Uint, err error) { + panic("implement me") +} + +// Returns code at a given address. +func (h *RpcHandler) EthGetCode(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (Bytecode Bytes, err error) { + panic("implement me") +} + +// Returns the merkle proof for a given account and optionally some storage keys. +func (h *RpcHandler) EthGetProof(ctx context.Context, + Address Address, StorageKeys []Hash32, Block BlockNumberOrTag) (Account AccountProof, err error) { + panic("implement me") +} + +// Signs and submits a transaction. +func (h *RpcHandler) EthSendTransaction(ctx context.Context, + Transaction GenericTransaction) (TransactionHash Hash32, err error) { + panic("implement me") +} + +// Submits a raw transaction. +func (h *RpcHandler) EthSendRawTransaction(ctx context.Context, + Transaction Bytes) (TransactionHash Hash32, err error) { + panic("implement me") +} + +// Returns the information about a transaction requested by transaction hash. +func (h *RpcHandler) EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32) (TransactionInformation TransactionInfo, err error) { + panic("implement me") +} + +// Returns information about a transaction by block hash and transaction index position. +func (h *RpcHandler) EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, TransactionIndex Uint) (TransactionInformation TransactionInfo, err error) { + panic("implement me") +} + +// Returns information about a transaction by block number and transaction index position. +func (h *RpcHandler) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, TransactionIndex Uint) (TransactionInformation TransactionInfo, err error) { + panic("implement me") +} + +// Returns the receipt of a transaction by transaction hash. +func (h *RpcHandler) EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32) (ReceiptInformation ReceiptInfo, err error) { + panic("implement me") +} type GoOpenRPCService interface { // Returns an RLP-encoded header. - DebugGetRawHeader( - ctx context.Context, - Block BlockNumberOrTag, - ) (HeaderRLP Bytes, err error) + DebugGetRawHeader(ctx context.Context, + Block BlockNumberOrTag) (HeaderRLP Bytes, err error) // Returns an RLP-encoded block. - DebugGetRawBlock( - ctx context.Context, - Block BlockNumberOrTag, - ) (BlockRLP Bytes, err error) + DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag) (BlockRLP Bytes, err error) // Returns an array of EIP-2718 binary-encoded transactions. - DebugGetRawTransaction( - ctx context.Context, - TransactionHash Hash32, - ) (EIP2718BinaryEncodedTransaction Bytes, err error) + DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32) (EIP2718BinaryEncodedTransaction Bytes, err error) // Returns an array of EIP-2718 binary-encoded receipts. - DebugGetRawReceipts( - ctx context.Context, - Block BlockNumberOrTag, - ) (Receipts []Bytes, err error) + DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag) (Receipts []Bytes, err error) // Returns an array of recent bad blocks that the client has seen on the network. - DebugGetBadBlocks( - ctx context.Context, + DebugGetBadBlocks(ctx context.Context, ) (Blocks []BadBlock, err error) // Returns information about a block by hash. - EthGetBlockByHash( - ctx context.Context, - BlockHash Hash32, - HydratedTransactions bool, - ) (BlockInformation Block, err error) + EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, HydratedTransactions bool) (BlockInformation Block, err error) // Returns information about a block by number. - EthGetBlockByNumber( - ctx context.Context, - Block BlockNumberOrTag, - HydratedTransactions bool, - ) (BlockInformation Block, err error) + EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, HydratedTransactions bool) (BlockInformation Block, err error) // Returns the number of transactions in a block from a block matching the given block hash. - EthGetBlockTransactionCountByHash( - ctx context.Context, - BlockHash *Hash32, - ) (TransactionCount Uint, err error) + EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32) (TransactionCount Uint, err error) // Returns the number of transactions in a block matching the given block number. - EthGetBlockTransactionCountByNumber( - ctx context.Context, - Block *BlockNumberOrTag, - ) (TransactionCount Uint, err error) + EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag) (TransactionCount Uint, err error) // Returns the number of uncles in a block from a block matching the given block hash. - EthGetUncleCountByBlockHash( - ctx context.Context, - BlockHash *Hash32, - ) (UncleCount Uint, err error) + EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32) (UncleCount Uint, err error) // Returns the number of transactions in a block matching the given block number. - EthGetUncleCountByBlockNumber( - ctx context.Context, - Block *BlockNumberOrTag, - ) (UncleCount Uint, err error) + EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag) (UncleCount Uint, err error) // Returns the chain ID of the current network. - EthChainId( - ctx context.Context, + EthChainId(ctx context.Context, ) (ChainID Uint, err error) // Returns an object with data about the sync status or false. - EthSyncing( - ctx context.Context, + EthSyncing(ctx context.Context, ) (SyncingStatus SyncingStatus, err error) // Returns the client coinbase address. - EthCoinbase( - ctx context.Context, + EthCoinbase(ctx context.Context, ) (CoinbaseAddress Address, err error) // Returns a list of addresses owned by client. - EthAccounts( - ctx context.Context, + EthAccounts(ctx context.Context, ) (Accounts []Address, err error) // Returns the number of most recent block. - EthBlockNumber( - ctx context.Context, + EthBlockNumber(ctx context.Context, ) (BlockNumber Uint, err error) // Executes a new message call immediately without creating a transaction on the block chain. - EthCall( - ctx context.Context, - Transaction GenericTransaction, - Block *BlockNumberOrTag, - ) (ReturnData Bytes, err error) + EthCall(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (ReturnData Bytes, err error) // Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. - EthEstimateGas( - ctx context.Context, - Transaction GenericTransaction, - Block *BlockNumberOrTag, - ) (GasUsed Uint, err error) + EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (GasUsed Uint, err error) // Generates an access list for a transaction. - EthCreateAccessList( - ctx context.Context, - Transaction GenericTransaction, - Block *BlockNumberOrTag, - ) (GasUsed struct { + EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, Block *BlockNumberOrTag) (GasUsed struct { AccessList AccessList `json:"accessList"` Error string `json:"error"` GasUsed Uint `json:"gasUsed"` }, err error) // Returns the current price per gas in wei. - EthGasPrice( - ctx context.Context, + EthGasPrice(ctx context.Context, ) (GasPrice Uint, err error) // Returns the current maxPriorityFeePerGas per gas in wei. - EthMaxPriorityFeePerGas( - ctx context.Context, + EthMaxPriorityFeePerGas(ctx context.Context, ) (MaxPriorityFeePerGas Uint, err error) // Transaction fee history - EthFeeHistory( - ctx context.Context, - BlockCount Uint, - NewestBlock BlockNumberOrTag, - RewardPercentiles []float64, - ) (FeeHistoryResult struct { + EthFeeHistory(ctx context.Context, + BlockCount Uint, NewestBlock BlockNumberOrTag, RewardPercentiles []float64) (FeeHistoryResult struct { BaseFeePerGas []Uint `json:"baseFeePerGas"` OldestBlock Uint `json:"oldestBlock"` Reward [][]Uint `json:"reward"` }, err error) // Creates a filter object, based on filter options, to notify when the state changes (logs). - EthNewFilter( - ctx context.Context, - Filter *Filter, - ) (FilterIdentifier Uint, err error) + EthNewFilter(ctx context.Context, + Filter *Filter) (FilterIdentifier Uint, err error) // Creates a filter in the node, to notify when a new block arrives. - EthNewBlockFilter( - ctx context.Context, + EthNewBlockFilter(ctx context.Context, ) (FilterIdentifier Uint, err error) // Creates a filter in the node, to notify when new pending transactions arrive. - EthNewPendingTransactionFilter( - ctx context.Context, + EthNewPendingTransactionFilter(ctx context.Context, ) (FilterIdentifier Uint, err error) // Uninstalls a filter with given id. - EthUninstallFilter( - ctx context.Context, - FilterIdentifier *Uint, - ) (Success bool, err error) + EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint) (Success bool, err error) // Polling method for a filter, which returns an array of logs which occurred since last poll. - EthGetFilterChanges( - ctx context.Context, - FilterIdentifier *Uint, - ) (LogObjects FilterResults, err error) + EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint) (LogObjects FilterResults, err error) // Returns an array of all logs matching filter with given id. - EthGetFilterLogs( - ctx context.Context, - FilterIdentifier *Uint, - ) (LogObjects FilterResults, err error) + EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint) (LogObjects FilterResults, err error) // Returns an array of all logs matching filter with given id. - EthGetLogs( - ctx context.Context, - Filter *Filter, - ) (LogObjects FilterResults, err error) + EthGetLogs(ctx context.Context, + Filter *Filter) (LogObjects FilterResults, err error) // Returns whether the client is actively mining new blocks. - EthMining( - ctx context.Context, + EthMining(ctx context.Context, ) (MiningStatus bool, err error) // Returns the number of hashes per second that the node is mining with. - EthHashrate( - ctx context.Context, + EthHashrate(ctx context.Context, ) (MiningStatus Uint, err error) // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). - EthGetWork( - ctx context.Context, + EthGetWork(ctx context.Context, ) (CurrentWork []Bytes32, err error) // Used for submitting a proof-of-work solution. - EthSubmitWork( - ctx context.Context, - Nonce Bytes8, - Hash Bytes32, - Digest Bytes32, - ) (Success bool, err error) + EthSubmitWork(ctx context.Context, + Nonce Bytes8, Hash Bytes32, Digest Bytes32) (Success bool, err error) // Used for submitting mining hashrate. - EthSubmitHashrate( - ctx context.Context, - Hashrate Bytes32, - Id Bytes32, - ) (Success bool, err error) + EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, Id Bytes32) (Success bool, err error) // Returns an EIP-191 signature over the provided data. - EthSign( - ctx context.Context, - Address Address, - Message Bytes, - ) (Signature Bytes65, err error) + EthSign(ctx context.Context, + Address Address, Message Bytes) (Signature Bytes65, err error) // Returns an RLP encoded transaction signed by the specified account. - EthSignTransaction( - ctx context.Context, - Transaction GenericTransaction, - ) (EncodedTransaction Bytes, err error) + EthSignTransaction(ctx context.Context, + Transaction GenericTransaction) (EncodedTransaction Bytes, err error) // Returns the balance of the account of given address. - EthGetBalance( - ctx context.Context, - Address Address, - Block *BlockNumberOrTag, - ) (Balance Uint, err error) + EthGetBalance(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (Balance Uint, err error) // Returns the value from a storage position at a given address. - EthGetStorageAt( - ctx context.Context, - Address Address, - StorageSlot Uint256, - Block *BlockNumberOrTag, - ) (Value Bytes, err error) + EthGetStorageAt(ctx context.Context, + Address Address, StorageSlot Uint256, Block *BlockNumberOrTag) (Value Bytes, err error) // Returns the number of transactions sent from an address. - EthGetTransactionCount( - ctx context.Context, - Address Address, - Block *BlockNumberOrTag, - ) (TransactionCount Uint, err error) + EthGetTransactionCount(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (TransactionCount Uint, err error) // Returns code at a given address. - EthGetCode( - ctx context.Context, - Address Address, - Block *BlockNumberOrTag, - ) (Bytecode Bytes, err error) + EthGetCode(ctx context.Context, + Address Address, Block *BlockNumberOrTag) (Bytecode Bytes, err error) // Returns the merkle proof for a given account and optionally some storage keys. - EthGetProof( - ctx context.Context, - Address Address, - StorageKeys []Hash32, - Block BlockNumberOrTag, - ) (Account AccountProof, err error) + EthGetProof(ctx context.Context, + Address Address, StorageKeys []Hash32, Block BlockNumberOrTag) (Account AccountProof, err error) // Signs and submits a transaction. - EthSendTransaction( - ctx context.Context, - Transaction GenericTransaction, - ) (TransactionHash Hash32, err error) + EthSendTransaction(ctx context.Context, + Transaction GenericTransaction) (TransactionHash Hash32, err error) // Submits a raw transaction. - EthSendRawTransaction( - ctx context.Context, - Transaction Bytes, - ) (TransactionHash Hash32, err error) + EthSendRawTransaction(ctx context.Context, + Transaction Bytes) (TransactionHash Hash32, err error) // Returns the information about a transaction requested by transaction hash. - EthGetTransactionByHash( - ctx context.Context, - TransactionHash Hash32, - ) (TransactionInformation TransactionInfo, err error) + EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32) (TransactionInformation TransactionInfo, err error) // Returns information about a transaction by block hash and transaction index position. - EthGetTransactionByBlockHashAndIndex( - ctx context.Context, - BlockHash Hash32, - TransactionIndex Uint, - ) (TransactionInformation TransactionInfo, err error) + EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, TransactionIndex Uint) (TransactionInformation TransactionInfo, err error) // Returns information about a transaction by block number and transaction index position. - EthGetTransactionByBlockNumberAndIndex( - ctx context.Context, - Block BlockNumberOrTag, - TransactionIndex Uint, - ) (TransactionInformation TransactionInfo, err error) + EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, TransactionIndex Uint) (TransactionInformation TransactionInfo, err error) // Returns the receipt of a transaction by transaction hash. - EthGetTransactionReceipt( - ctx context.Context, - TransactionHash *Hash32, - ) (ReceiptInformation ReceiptInfo, err error) + EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32) (ReceiptInformation ReceiptInfo, err error) } type AccessList []AccessListEntry type AccessListEntry struct { diff --git a/openrpc/out/wow.go b/openrpc/out/wow.go new file mode 100644 index 0000000000000000000000000000000000000000..88f2e67907a815c7888056a4d67fed2347144e14 --- /dev/null +++ b/openrpc/out/wow.go @@ -0,0 +1,2726 @@ +package out + +import ( + "context" + "gfx.cafe/open/jrpc" + ) + + +type GoOpenRPCHandler struct { + Srv GoOpenRPCService +} + + +func (h *GoOpenRPCHandler) RouteRPC(r jrpc.Router) { + // Returns an RLP-encoded header. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawHeader", h.Srv.DebugGetRawHeader) + }) + + // Returns an RLP-encoded block. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawBlock", h.Srv.DebugGetRawBlock) + }) + + // Returns an array of EIP-2718 binary-encoded transactions. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawTransaction", h.Srv.DebugGetRawTransaction) + }) + + // Returns an array of EIP-2718 binary-encoded receipts. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getRawReceipts", h.Srv.DebugGetRawReceipts) + }) + + // Returns an array of recent bad blocks that the client has seen on the network. + + r.Route("debug", func(r2 jrpc.Router) { + r.RegisterFunc("getBadBlocks", h.Srv.DebugGetBadBlocks) + }) + + // Returns information about a block by hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockByHash", h.Srv.EthGetBlockByHash) + }) + + // Returns information about a block by number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockByNumber", h.Srv.EthGetBlockByNumber) + }) + + // Returns the number of transactions in a block from a block matching the given block hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockTransactionCountByHash", h.Srv.EthGetBlockTransactionCountByHash) + }) + + // Returns the number of transactions in a block matching the given block number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBlockTransactionCountByNumber", h.Srv.EthGetBlockTransactionCountByNumber) + }) + + // Returns the number of uncles in a block from a block matching the given block hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getUncleCountByBlockHash", h.Srv.EthGetUncleCountByBlockHash) + }) + + // Returns the number of transactions in a block matching the given block number. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getUncleCountByBlockNumber", h.Srv.EthGetUncleCountByBlockNumber) + }) + + // Returns the chain ID of the current network. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("chainId", h.Srv.EthChainId) + }) + + // Returns an object with data about the sync status or false. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("syncing", h.Srv.EthSyncing) + }) + + // Returns the client coinbase address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("coinbase", h.Srv.EthCoinbase) + }) + + // Returns a list of addresses owned by client. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("accounts", h.Srv.EthAccounts) + }) + + // Returns the number of most recent block. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("blockNumber", h.Srv.EthBlockNumber) + }) + + // Executes a new message call immediately without creating a transaction on the block chain. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("call", h.Srv.EthCall) + }) + + // Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("estimateGas", h.Srv.EthEstimateGas) + }) + + // Generates an access list for a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("createAccessList", h.Srv.EthCreateAccessList) + }) + + // Returns the current price per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("gasPrice", h.Srv.EthGasPrice) + }) + + // Returns the current maxPriorityFeePerGas per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("maxPriorityFeePerGas", h.Srv.EthMaxPriorityFeePerGas) + }) + + // Transaction fee history + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("feeHistory", h.Srv.EthFeeHistory) + }) + + // Creates a filter object, based on filter options, to notify when the state changes (logs). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newFilter", h.Srv.EthNewFilter) + }) + + // Creates a filter in the node, to notify when a new block arrives. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newBlockFilter", h.Srv.EthNewBlockFilter) + }) + + // Creates a filter in the node, to notify when new pending transactions arrive. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newPendingTransactionFilter", h.Srv.EthNewPendingTransactionFilter) + }) + + // Uninstalls a filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("uninstallFilter", h.Srv.EthUninstallFilter) + }) + + // Polling method for a filter, which returns an array of logs which occurred since last poll. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterChanges", h.Srv.EthGetFilterChanges) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterLogs", h.Srv.EthGetFilterLogs) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getLogs", h.Srv.EthGetLogs) + }) + + // Returns whether the client is actively mining new blocks. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("mining", h.Srv.EthMining) + }) + + // Returns the number of hashes per second that the node is mining with. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("hashrate", h.Srv.EthHashrate) + }) + + // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getWork", h.Srv.EthGetWork) + }) + + // Used for submitting a proof-of-work solution. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitWork", h.Srv.EthSubmitWork) + }) + + // Used for submitting mining hashrate. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitHashrate", h.Srv.EthSubmitHashrate) + }) + + // Returns an EIP-191 signature over the provided data. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sign", h.Srv.EthSign) + }) + + // Returns an RLP encoded transaction signed by the specified account. + + r.Ro Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("estimateGas", h.Srv.EthEstimateGas) + }) + + // Generates an access list for a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("createAccessList", h.Srv.EthCreateAccessList) + }) + + // Returns the current price per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("gasPrice", h.Srv.EthGasPrice) + }) + + // Returns the current maxPriorityFeePerGas per gas in wei. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("maxPriorityFeePerGas", h.Srv.EthMaxPriorityFeePerGas) + }) + + // Transaction fee history + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("feeHistory", h.Srv.EthFeeHistory) + }) + + // Creates a filter object, based on filter options, to notify when the state changes (logs). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newFilter", h.Srv.EthNewFilter) + }) + + // Creates a filter in the node, to notify when a new block arrives. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newBlockFilter", h.Srv.EthNewBlockFilter) + }) + + // Creates a filter in the node, to notify when new pending transactions arrive. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("newPendingTransactionFilter", h.Srv.EthNewPendingTransactionFilter) + }) + + // Uninstalls a filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("uninstallFilter", h.Srv.EthUninstallFilter) + }) + + // Polling method for a filter, which returns an array of logs which occurred since last poll. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterChanges", h.Srv.EthGetFilterChanges) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getFilterLogs", h.Srv.EthGetFilterLogs) + }) + + // Returns an array of all logs matching filter with given id. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getLogs", h.Srv.EthGetLogs) + }) + + // Returns whether the client is actively mining new blocks. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("mining", h.Srv.EthMining) + }) + + // Returns the number of hashes per second that the node is mining with. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("hashrate", h.Srv.EthHashrate) + }) + + // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getWork", h.Srv.EthGetWork) + }) + + // Used for submitting a proof-of-work solution. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitWork", h.Srv.EthSubmitWork) + }) + + // Used for submitting mining hashrate. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("submitHashrate", h.Srv.EthSubmitHashrate) + }) + + // Returns an EIP-191 signature over the provided data. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sign", h.Srv.EthSign) + }) + + // Returns an RLP encoded transaction signed by the specified account. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("signTransaction", h.Srv.EthSignTransaction) + }) + + // Returns the balance of the account of given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBalance", h.Srv.EthGetBalance) + }) + + // Returns the value from a storage position at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getStorageAt", h.Srv.EthGetStorageAt) + }) + + // Returns the number of transactions sent from an address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionCount", h.Srv.EthGetTransactionCount) + }) + + // Returns code at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getCode", h.Srv.EthGetCode) + }) + + // Returns the merkle proof for a given account and optionally some storage keys. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getProof", h.Srv.EthGetProof) + }) + + // Signs and submits a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendTransaction", h.Srv.EthSendTransaction) + }) + + // Submits a raw transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendRawTransaction", h.Srv.EthSendRawTransaction) + }) + + // Returns the information about a transaction requested by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByHash", h.Srv.EthGetTransactionByHash) + }) + + // Returns information about a transaction by block hash and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockHashAndIndex", h.Srv.EthGetTransactionByBlockHashAndIndex) + }) + + // Returns information about a transaction by block number and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockNumberAndIndex", h.Srv.EthGetTransactionByBlockNumberAndIndex) + }) + + // Returns the receipt of a transaction by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionReceipt", h.Srv.EthGetTransactionReceipt) + }) + + } + +type RpcHandler struct { +// Returns an RLP-encoded header. + FnDebugGetRawHeader func(ctx context.Context, + Block BlockNumberOrTag, + )(HeaderRLP Bytes, err error) + +// Returns an RLP-encoded block. + FnDebugGetRawBlock func(ctx context.Context, + Block BlockNumberOrTag, + )(BlockRLP Bytes, err error) + +// Returns an array of EIP-2718 binary-encoded transactions. + FnDebugGetRawTransaction func(ctx context.Context, + TransactionHash Hash32, + )(EIP2718BinaryEncodedTransaction Bytes, err error) + +// Returns an array of EIP-2718 binary-encoded receipts. + FnDebugGetRawReceipts func(ctx context.Context, + Block BlockNumberOrTag, + )(Receipts []Bytes, err error) + +// Returns an array of recent bad blocks that the client has seen on the network. + FnDebugGetBadBlocks func(ctx context.Context, + )(Blocks []BadBlock, err error) + +// Returns information about a block by hash. + FnEthGetBlockByHash func(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + )(BlockInformation Block, err error) + +// Returns information about a block by number. + FnEthGetBlockByNumber func(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + )(BlockInformation Block, err error) + +// Returns the number of transactions in a block from a block matching the given block hash. + FnEthGetBlockTraute("eth", func(r2 jrpc.Router) { + r.RegisterFunc("signTransaction", h.Srv.EthSignTransaction) + }) + + // Returns the balance of the account of given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getBalance", h.Srv.EthGetBalance) + }) + + // Returns the value from a storage position at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getStorageAt", h.Srv.EthGetStorageAt) + }) + + // Returns the number of transactions sent from an address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionCount", h.Srv.EthGetTransactionCount) + }) + + // Returns code at a given address. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getCode", h.Srv.EthGetCode) + }) + + // Returns the merkle proof for a given account and optionally some storage keys. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getProof", h.Srv.EthGetProof) + }) + + // Signs and submits a transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendTransaction", h.Srv.EthSendTransaction) + }) + + // Submits a raw transaction. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("sendRawTransaction", h.Srv.EthSendRawTransaction) + }) + + // Returns the information about a transaction requested by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByHash", h.Srv.EthGetTransactionByHash) + }) + + // Returns information about a transaction by block hash and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockHashAndIndex", h.Srv.EthGetTransactionByBlockHashAndIndex) + }) + + // Returns information about a transaction by block number and transaction index position. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionByBlockNumberAndIndex", h.Srv.EthGetTransactionByBlockNumberAndIndex) + }) + + // Returns the receipt of a transaction by transaction hash. + + r.Route("eth", func(r2 jrpc.Router) { + r.RegisterFunc("getTransactionReceipt", h.Srv.EthGetTransactionReceipt) + }) + + } + +type RpcHandler struct { +// Returns an RLP-encoded header. + FnDebugGetRawHeader func(ctx context.Context, + Block BlockNumberOrTag, + )(HeaderRLP Bytes, err error) + +// Returns an RLP-encoded block. + FnDebugGetRawBlock func(ctx context.Context, + Block BlockNumberOrTag, + )(BlockRLP Bytes, err error) + +// Returns an array of EIP-2718 binary-encoded transactions. + FnDebugGetRawTransaction func(ctx context.Context, + TransactionHash Hash32, + )(EIP2718BinaryEncodedTransaction Bytes, err error) + +// Returns an array of EIP-2718 binary-encoded receipts. + FnDebugGetRawReceipts func(ctx context.Context, + Block BlockNumberOrTag, + )(Receipts []Bytes, err error) + +// Returns an array of recent bad blocks that the client has seen on the network. + FnDebugGetBadBlocks func(ctx context.Context, + )(Blocks []BadBlock, err error) + +// Returns information about a block by hash. + FnEthGetBlockByHash func(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + )(BlockInformation Block, err error) + +// Returns information about a block by number. + FnEthGetBlockByNumber func(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + )(BlockInformation Block, err error) + +// Returns the number of transactions in a block from a block matching the given block hash. + FnEthGetBlockTransactionCountByHash func(ctx context.Context, + BlockHash *Hash32, + )(TransactionCount Uint, err error) + +// Returns the number of transactions in a block matching the given block number. + FnEthGetBlockTransactionCountByNumber func(ctx context.Context, + Block *BlockNumberOrTag, + )(TransactionCount Uint, err error) + +// Returns the number of uncles in a block from a block matching the given block hash. + FnEthGetUncleCountByBlockHash func(ctx context.Context, + BlockHash *Hash32, + )(UncleCount Uint, err error) + +// Returns the number of transactions in a block matching the given block number. + FnEthGetUncleCountByBlockNumber func(ctx context.Context, + Block *BlockNumberOrTag, + )(UncleCount Uint, err error) + +// Returns the chain ID of the current network. + FnEthChainId func(ctx context.Context, + )(ChainID Uint, err error) + +// Returns an object with data about the sync status or false. + FnEthSyncing func(ctx context.Context, + )(SyncingStatus SyncingStatus, err error) + +// Returns the client coinbase address. + FnEthCoinbase func(ctx context.Context, + )(CoinbaseAddress Address, err error) + +// Returns a list of addresses owned by client. + FnEthAccounts func(ctx context.Context, + )(Accounts []Address, err error) + +// Returns the number of most recent block. + FnEthBlockNumber func(ctx context.Context, + )(BlockNumber Uint, err error) + +// Executes a new message call immediately without creating a transaction on the block chain. + FnEthCall func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(ReturnData Bytes, err error) + +// Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + FnEthEstimateGas func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(GasUsed Uint, err error) + +// Generates an access list for a transaction. + FnEthCreateAccessList func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) + +// Returns the current price per gas in wei. + FnEthGasPrice func(ctx context.Context, + )(GasPrice Uint, err error) + +// Returns the current maxPriorityFeePerGas per gas in wei. + FnEthMaxPriorityFeePerGas func(ctx context.Context, + )(MaxPriorityFeePerGas Uint, err error) + +// Transaction fee history + FnEthFeeHistory func(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + )(FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) + +// Creates a filter object, based on filter options, to notify when the state changes (logs). + FnEthNewFilter func(ctx context.Context, + Filter *Filter, + )(FilterIdentifier Uint, err error) + +// Creates a filter in the node, to notify when a new block arrives. + FnEthNewBlockFilter func(ctx context.Context, + )(FilterIdentifier Uint, err error) + +// Creates a filter in the node, to notify when new pending transactions arrive. + FnEthNewPendingTransactionFilter func(ctx context.Context, + )(FilterIdentifier Uint, err error) + +// Uninstalls a filter with given id. + FnEthUninstallFilter func(ctx context.Context, + FilterIdentifier *Uint, + )(Success bool, err error) + +// Polling method for a filter, which returns an array of logs which occurred since last poll. + FnEthGetFilterChanges func(ctx context.Context, + FilterIdentifier *Uint, + )(LogObjects FilterResults, err error) + +// Returns an array of all logs matching filter with given id. + FnEthGetFilterLogs func(ctx context.Context, + FilterIdentifier *Uint, + )(LogObjects FilterResults, err ernsactionCountByHash func(ctx context.Context, + BlockHash *Hash32, + )(TransactionCount Uint, err error) + +// Returns the number of transactions in a block matching the given block number. + FnEthGetBlockTransactionCountByNumber func(ctx context.Context, + Block *BlockNumberOrTag, + )(TransactionCount Uint, err error) + +// Returns the number of uncles in a block from a block matching the given block hash. + FnEthGetUncleCountByBlockHash func(ctx context.Context, + BlockHash *Hash32, + )(UncleCount Uint, err error) + +// Returns the number of transactions in a block matching the given block number. + FnEthGetUncleCountByBlockNumber func(ctx context.Context, + Block *BlockNumberOrTag, + )(UncleCount Uint, err error) + +// Returns the chain ID of the current network. + FnEthChainId func(ctx context.Context, + )(ChainID Uint, err error) + +// Returns an object with data about the sync status or false. + FnEthSyncing func(ctx context.Context, + )(SyncingStatus SyncingStatus, err error) + +// Returns the client coinbase address. + FnEthCoinbase func(ctx context.Context, + )(CoinbaseAddress Address, err error) + +// Returns a list of addresses owned by client. + FnEthAccounts func(ctx context.Context, + )(Accounts []Address, err error) + +// Returns the number of most recent block. + FnEthBlockNumber func(ctx context.Context, + )(BlockNumber Uint, err error) + +// Executes a new message call immediately without creating a transaction on the block chain. + FnEthCall func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(ReturnData Bytes, err error) + +// Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + FnEthEstimateGas func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(GasUsed Uint, err error) + +// Generates an access list for a transaction. + FnEthCreateAccessList func(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + )(GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) + +// Returns the current price per gas in wei. + FnEthGasPrice func(ctx context.Context, + )(GasPrice Uint, err error) + +// Returns the current maxPriorityFeePerGas per gas in wei. + FnEthMaxPriorityFeePerGas func(ctx context.Context, + )(MaxPriorityFeePerGas Uint, err error) + +// Transaction fee history + FnEthFeeHistory func(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + )(FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) + +// Creates a filter object, based on filter options, to notify when the state changes (logs). + FnEthNewFilter func(ctx context.Context, + Filter *Filter, + )(FilterIdentifier Uint, err error) + +// Creates a filter in the node, to notify when a new block arrives. + FnEthNewBlockFilter func(ctx context.Context, + )(FilterIdentifier Uint, err error) + +// Creates a filter in the node, to notify when new pending transactions arrive. + FnEthNewPendingTransactionFilter func(ctx context.Context, + )(FilterIdentifier Uint, err error) + +// Uninstalls a filter with given id. + FnEthUninstallFilter func(ctx context.Context, + FilterIdentifier *Uint, + )(Success bool, err error) + +// Polling method for a filter, which returns an array of logs which occurred since last poll. + FnEthGetFilterChanges func(ctx context.Context, + FilterIdentifier *Uint, + )(LogObjects FilterResults, err error) + +// Returns an array of all logs matching filter with given id. + FnEthGetFilterLogs func(ctx context.Context, + FilterIdentifier *Uint, + )(LogObjects FilterResults, err error) + +// Returns an array of all logs matching filter with given id. + FnEthGetLogs func(ctx context.Context, + Filter *Filter, + )(LogObjects FilterResults, err error) + +// Returns whether the client is actively mining new blocks. + FnEthMining func(ctx context.Context, + )(MiningStatus bool, err error) + +// Returns the number of hashes per second that the node is mining with. + FnEthHashrate func(ctx context.Context, + )(MiningStatus Uint, err error) + +// Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + FnEthGetWork func(ctx context.Context, + )(CurrentWork []Bytes32, err error) + +// Used for submitting a proof-of-work solution. + FnEthSubmitWork func(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + )(Success bool, err error) + +// Used for submitting mining hashrate. + FnEthSubmitHashrate func(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + )(Success bool, err error) + +// Returns an EIP-191 signature over the provided data. + FnEthSign func(ctx context.Context, + Address Address, + Message Bytes, + )(Signature Bytes65, err error) + +// Returns an RLP encoded transaction signed by the specified account. + FnEthSignTransaction func(ctx context.Context, + Transaction GenericTransaction, + )(EncodedTransaction Bytes, err error) + +// Returns the balance of the account of given address. + FnEthGetBalance func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(Balance Uint, err error) + +// Returns the value from a storage position at a given address. + FnEthGetStorageAt func(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + )(Value Bytes, err error) + +// Returns the number of transactions sent from an address. + FnEthGetTransactionCount func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(TransactionCount Uint, err error) + +// Returns code at a given address. + FnEthGetCode func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(Bytecode Bytes, err error) + +// Returns the merkle proof for a given account and optionally some storage keys. + FnEthGetProof func(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + )(Account AccountProof, err error) + +// Signs and submits a transaction. + FnEthSendTransaction func(ctx context.Context, + Transaction GenericTransaction, + )(TransactionHash Hash32, err error) + +// Submits a raw transaction. + FnEthSendRawTransaction func(ctx context.Context, + Transaction Bytes, + )(TransactionHash Hash32, err error) + +// Returns the information about a transaction requested by transaction hash. + FnEthGetTransactionByHash func(ctx context.Context, + TransactionHash Hash32, + )(TransactionInformation TransactionInfo, err error) + +// Returns information about a transaction by block hash and transaction index position. + FnEthGetTransactionByBlockHashAndIndex func(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + )(TransactionInformation TransactionInfo, err error) + +// Returns information about a transaction by block number and transaction index position. + FnEthGetTransactionByBlockNumberAndIndex func(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + )(TransactionInformation TransactionInfo, err error) + +// Returns the receipt of a transaction by transaction hash. + FnEthGetTransactionReceipt func(ctx context.Context, + TransactionHash *Hash32, + )(ReceiptInformation ReceiptInfo, err error) + +} + +// Returns an RLP-encoded header. + func(h *RpcHandler) DebugGetRawHeader(ctx context.Context, + Block BlockNumberOrTag, + ) (HeaderRLP Bytes, err error) { + handler := h.FnDebugGetRawHeader + return handler(ctx context.Context, + Block Bror) + +// Returns an array of all logs matching filter with given id. + FnEthGetLogs func(ctx context.Context, + Filter *Filter, + )(LogObjects FilterResults, err error) + +// Returns whether the client is actively mining new blocks. + FnEthMining func(ctx context.Context, + )(MiningStatus bool, err error) + +// Returns the number of hashes per second that the node is mining with. + FnEthHashrate func(ctx context.Context, + )(MiningStatus Uint, err error) + +// Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + FnEthGetWork func(ctx context.Context, + )(CurrentWork []Bytes32, err error) + +// Used for submitting a proof-of-work solution. + FnEthSubmitWork func(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + )(Success bool, err error) + +// Used for submitting mining hashrate. + FnEthSubmitHashrate func(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + )(Success bool, err error) + +// Returns an EIP-191 signature over the provided data. + FnEthSign func(ctx context.Context, + Address Address, + Message Bytes, + )(Signature Bytes65, err error) + +// Returns an RLP encoded transaction signed by the specified account. + FnEthSignTransaction func(ctx context.Context, + Transaction GenericTransaction, + )(EncodedTransaction Bytes, err error) + +// Returns the balance of the account of given address. + FnEthGetBalance func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(Balance Uint, err error) + +// Returns the value from a storage position at a given address. + FnEthGetStorageAt func(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + )(Value Bytes, err error) + +// Returns the number of transactions sent from an address. + FnEthGetTransactionCount func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(TransactionCount Uint, err error) + +// Returns code at a given address. + FnEthGetCode func(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + )(Bytecode Bytes, err error) + +// Returns the merkle proof for a given account and optionally some storage keys. + FnEthGetProof func(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + )(Account AccountProof, err error) + +// Signs and submits a transaction. + FnEthSendTransaction func(ctx context.Context, + Transaction GenericTransaction, + )(TransactionHash Hash32, err error) + +// Submits a raw transaction. + FnEthSendRawTransaction func(ctx context.Context, + Transaction Bytes, + )(TransactionHash Hash32, err error) + +// Returns the information about a transaction requested by transaction hash. + FnEthGetTransactionByHash func(ctx context.Context, + TransactionHash Hash32, + )(TransactionInformation TransactionInfo, err error) + +// Returns information about a transaction by block hash and transaction index position. + FnEthGetTransactionByBlockHashAndIndex func(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + )(TransactionInformation TransactionInfo, err error) + +// Returns information about a transaction by block number and transaction index position. + FnEthGetTransactionByBlockNumberAndIndex func(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + )(TransactionInformation TransactionInfo, err error) + +// Returns the receipt of a transaction by transaction hash. + FnEthGetTransactionReceipt func(ctx context.Context, + TransactionHash *Hash32, + )(ReceiptInformation ReceiptInfo, err error) + +} + +// Returns an RLP-encoded header. + func(h *RpcHandler) DebugGetRawHeader(ctx context.Context, + Block BlockNumberOrTag, + ) (HeaderRLP Bytes, err error) { + handler := h.FnDebugGetRawHeader + return handler(ctx context.Context, + Block BlockNumberOrTag, + ) + } +// Returns an RLP-encoded block. + func(h *RpcHandler) DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag, + ) (BlockRLP Bytes, err error) { + handler := h.FnDebugGetRawBlock + return handler(ctx context.Context, + Block BlockNumberOrTag, + ) + } +// Returns an array of EIP-2718 binary-encoded transactions. + func(h *RpcHandler) DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32, + ) (EIP2718BinaryEncodedTransaction Bytes, err error) { + handler := h.FnDebugGetRawTransaction + return handler(ctx context.Context, + TransactionHash Hash32, + ) + } +// Returns an array of EIP-2718 binary-encoded receipts. + func(h *RpcHandler) DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag, + ) (Receipts []Bytes, err error) { + handler := h.FnDebugGetRawReceipts + return handler(ctx context.Context, + Block BlockNumberOrTag, + ) + } +// Returns an array of recent bad blocks that the client has seen on the network. + func(h *RpcHandler) DebugGetBadBlocks(ctx context.Context, + ) (Blocks []BadBlock, err error) { + handler := h.FnDebugGetBadBlocks + return handler(ctx context.Context, + ) + } +// Returns information about a block by hash. + func(h *RpcHandler) EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) (BlockInformation Block, err error) { + handler := h.FnEthGetBlockByHash + return handler(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) + } +// Returns information about a block by number. + func(h *RpcHandler) EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) (BlockInformation Block, err error) { + handler := h.FnEthGetBlockByNumber + return handler(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) + } +// Returns the number of transactions in a block from a block matching the given block hash. + func(h *RpcHandler) EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetBlockTransactionCountByHash + return handler(ctx context.Context, + BlockHash *Hash32, + ) + } +// Returns the number of transactions in a block matching the given block number. + func(h *RpcHandler) EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetBlockTransactionCountByNumber + return handler(ctx context.Context, + Block *BlockNumberOrTag, + ) + } +// Returns the number of uncles in a block from a block matching the given block hash. + func(h *RpcHandler) EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32, + ) (UncleCount Uint, err error) { + handler := h.FnEthGetUncleCountByBlockHash + return handler(ctx context.Context, + BlockHash *Hash32, + ) + } +// Returns the number of transactions in a block matching the given block number. + func(h *RpcHandler) EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (UncleCount Uint, err error) { + handler := h.FnEthGetUncleCountByBlockNumber + return handler(ctx context.Context, + Block *BlockNumberOrTag, + ) + } +// Returns the chain ID of the current network. + func(h *RpcHandler) EthChainId(ctx context.Context, + ) (ChainID Uint, err error) { + handler := h.FnEthChainId + return handler(ctx context.Context, + ) + } +// Returns an object with data about the sync status or false. + func(h *RpcHandler) EthSyncing(ctx context.Context, + ) (SyncingStatus SyncingStatus, err error) { + handler := h.FnEthSyncing + return handler(ctx conlockNumberOrTag, + ) + } +// Returns an RLP-encoded block. + func(h *RpcHandler) DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag, + ) (BlockRLP Bytes, err error) { + handler := h.FnDebugGetRawBlock + return handler(ctx context.Context, + Block BlockNumberOrTag, + ) + } +// Returns an array of EIP-2718 binary-encoded transactions. + func(h *RpcHandler) DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32, + ) (EIP2718BinaryEncodedTransaction Bytes, err error) { + handler := h.FnDebugGetRawTransaction + return handler(ctx context.Context, + TransactionHash Hash32, + ) + } +// Returns an array of EIP-2718 binary-encoded receipts. + func(h *RpcHandler) DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag, + ) (Receipts []Bytes, err error) { + handler := h.FnDebugGetRawReceipts + return handler(ctx context.Context, + Block BlockNumberOrTag, + ) + } +// Returns an array of recent bad blocks that the client has seen on the network. + func(h *RpcHandler) DebugGetBadBlocks(ctx context.Context, + ) (Blocks []BadBlock, err error) { + handler := h.FnDebugGetBadBlocks + return handler(ctx context.Context, + ) + } +// Returns information about a block by hash. + func(h *RpcHandler) EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) (BlockInformation Block, err error) { + handler := h.FnEthGetBlockByHash + return handler(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) + } +// Returns information about a block by number. + func(h *RpcHandler) EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) (BlockInformation Block, err error) { + handler := h.FnEthGetBlockByNumber + return handler(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) + } +// Returns the number of transactions in a block from a block matching the given block hash. + func(h *RpcHandler) EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetBlockTransactionCountByHash + return handler(ctx context.Context, + BlockHash *Hash32, + ) + } +// Returns the number of transactions in a block matching the given block number. + func(h *RpcHandler) EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetBlockTransactionCountByNumber + return handler(ctx context.Context, + Block *BlockNumberOrTag, + ) + } +// Returns the number of uncles in a block from a block matching the given block hash. + func(h *RpcHandler) EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32, + ) (UncleCount Uint, err error) { + handler := h.FnEthGetUncleCountByBlockHash + return handler(ctx context.Context, + BlockHash *Hash32, + ) + } +// Returns the number of transactions in a block matching the given block number. + func(h *RpcHandler) EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (UncleCount Uint, err error) { + handler := h.FnEthGetUncleCountByBlockNumber + return handler(ctx context.Context, + Block *BlockNumberOrTag, + ) + } +// Returns the chain ID of the current network. + func(h *RpcHandler) EthChainId(ctx context.Context, + ) (ChainID Uint, err error) { + handler := h.FnEthChainId + return handler(ctx context.Context, + ) + } +// Returns an object with data about the sync status or false. + func(h *RpcHandler) EthSyncing(ctx context.Context, + ) (SyncingStatus SyncingStatus, err error) { + handler := h.FnEthSyncing + return handler(ctx context.Context, + ) + } +// Returns the client coinbase address. + func(h *RpcHandler) EthCoinbase(ctx context.Context, + ) (CoinbaseAddress Address, err error) { + handler := h.FnEthCoinbase + return handler(ctx context.Context, + ) + } +// Returns a list of addresses owned by client. + func(h *RpcHandler) EthAccounts(ctx context.Context, + ) (Accounts []Address, err error) { + handler := h.FnEthAccounts + return handler(ctx context.Context, + ) + } +// Returns the number of most recent block. + func(h *RpcHandler) EthBlockNumber(ctx context.Context, + ) (BlockNumber Uint, err error) { + handler := h.FnEthBlockNumber + return handler(ctx context.Context, + ) + } +// Executes a new message call immediately without creating a transaction on the block chain. + func(h *RpcHandler) EthCall(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (ReturnData Bytes, err error) { + handler := h.FnEthCall + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + func(h *RpcHandler) EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed Uint, err error) { + handler := h.FnEthEstimateGas + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Generates an access list for a transaction. + func(h *RpcHandler) EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) { + handler := h.FnEthCreateAccessList + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Returns the current price per gas in wei. + func(h *RpcHandler) EthGasPrice(ctx context.Context, + ) (GasPrice Uint, err error) { + handler := h.FnEthGasPrice + return handler(ctx context.Context, + ) + } +// Returns the current maxPriorityFeePerGas per gas in wei. + func(h *RpcHandler) EthMaxPriorityFeePerGas(ctx context.Context, + ) (MaxPriorityFeePerGas Uint, err error) { + handler := h.FnEthMaxPriorityFeePerGas + return handler(ctx context.Context, + ) + } +// Transaction fee history + func(h *RpcHandler) EthFeeHistory(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) (FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) { + handler := h.FnEthFeeHistory + return handler(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) + } +// Creates a filter object, based on filter options, to notify when the state changes (logs). + func(h *RpcHandler) EthNewFilter(ctx context.Context, + Filter *Filter, + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewFilter + return handler(ctx context.Context, + Filter *Filter, + ) + } +// Creates a filter in the node, to notify when a new block arrives. + func(h *RpcHandler) EthNewBlockFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewBlockFilter + return handler(ctx context.Context, + ) + } +// Creates a filter in the node, to notify when new pending transactions arrive. + func(h *RpcHandler) EthNewPendingTransactionFilter(ctx context.Context, + text.Context, + ) + } +// Returns the client coinbase address. + func(h *RpcHandler) EthCoinbase(ctx context.Context, + ) (CoinbaseAddress Address, err error) { + handler := h.FnEthCoinbase + return handler(ctx context.Context, + ) + } +// Returns a list of addresses owned by client. + func(h *RpcHandler) EthAccounts(ctx context.Context, + ) (Accounts []Address, err error) { + handler := h.FnEthAccounts + return handler(ctx context.Context, + ) + } +// Returns the number of most recent block. + func(h *RpcHandler) EthBlockNumber(ctx context.Context, + ) (BlockNumber Uint, err error) { + handler := h.FnEthBlockNumber + return handler(ctx context.Context, + ) + } +// Executes a new message call immediately without creating a transaction on the block chain. + func(h *RpcHandler) EthCall(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (ReturnData Bytes, err error) { + handler := h.FnEthCall + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + func(h *RpcHandler) EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed Uint, err error) { + handler := h.FnEthEstimateGas + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Generates an access list for a transaction. + func(h *RpcHandler) EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) { + handler := h.FnEthCreateAccessList + return handler(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) + } +// Returns the current price per gas in wei. + func(h *RpcHandler) EthGasPrice(ctx context.Context, + ) (GasPrice Uint, err error) { + handler := h.FnEthGasPrice + return handler(ctx context.Context, + ) + } +// Returns the current maxPriorityFeePerGas per gas in wei. + func(h *RpcHandler) EthMaxPriorityFeePerGas(ctx context.Context, + ) (MaxPriorityFeePerGas Uint, err error) { + handler := h.FnEthMaxPriorityFeePerGas + return handler(ctx context.Context, + ) + } +// Transaction fee history + func(h *RpcHandler) EthFeeHistory(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) (FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) { + handler := h.FnEthFeeHistory + return handler(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) + } +// Creates a filter object, based on filter options, to notify when the state changes (logs). + func(h *RpcHandler) EthNewFilter(ctx context.Context, + Filter *Filter, + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewFilter + return handler(ctx context.Context, + Filter *Filter, + ) + } +// Creates a filter in the node, to notify when a new block arrives. + func(h *RpcHandler) EthNewBlockFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewBlockFilter + return handler(ctx context.Context, + ) + } +// Creates a filter in the node, to notify when new pending transactions arrive. + func(h *RpcHandler) EthNewPendingTransactionFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewPendingTransactionFilter + return handler(ctx context.Context, + ) + } +// Uninstalls a filter with given id. + func(h *RpcHandler) EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint, + ) (Success bool, err error) { + handler := h.FnEthUninstallFilter + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Polling method for a filter, which returns an array of logs which occurred since last poll. + func(h *RpcHandler) EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetFilterChanges + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Returns an array of all logs matching filter with given id. + func(h *RpcHandler) EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetFilterLogs + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Returns an array of all logs matching filter with given id. + func(h *RpcHandler) EthGetLogs(ctx context.Context, + Filter *Filter, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetLogs + return handler(ctx context.Context, + Filter *Filter, + ) + } +// Returns whether the client is actively mining new blocks. + func(h *RpcHandler) EthMining(ctx context.Context, + ) (MiningStatus bool, err error) { + handler := h.FnEthMining + return handler(ctx context.Context, + ) + } +// Returns the number of hashes per second that the node is mining with. + func(h *RpcHandler) EthHashrate(ctx context.Context, + ) (MiningStatus Uint, err error) { + handler := h.FnEthHashrate + return handler(ctx context.Context, + ) + } +// Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + func(h *RpcHandler) EthGetWork(ctx context.Context, + ) (CurrentWork []Bytes32, err error) { + handler := h.FnEthGetWork + return handler(ctx context.Context, + ) + } +// Used for submitting a proof-of-work solution. + func(h *RpcHandler) EthSubmitWork(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) (Success bool, err error) { + handler := h.FnEthSubmitWork + return handler(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) + } +// Used for submitting mining hashrate. + func(h *RpcHandler) EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) (Success bool, err error) { + handler := h.FnEthSubmitHashrate + return handler(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) + } +// Returns an EIP-191 signature over the provided data. + func(h *RpcHandler) EthSign(ctx context.Context, + Address Address, + Message Bytes, + ) (Signature Bytes65, err error) { + handler := h.FnEthSign + return handler(ctx context.Context, + Address Address, + Message Bytes, + ) + } +// Returns an RLP encoded transaction signed by the specified account. + func(h *RpcHandler) EthSignTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (EncodedTransaction Bytes, err error) { + handler := h.FnEthSignTransaction + return handler(ctx context.Context, + Transaction GenericTransaction, + ) + } +// Returns the balance of the account of given address. + func(h *RpcHandler) EthGetBalance(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Balance Uint, err error) { + handler := h.FnEthGetBalance + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + ) (FilterIdentifier Uint, err error) { + handler := h.FnEthNewPendingTransactionFilter + return handler(ctx context.Context, + ) + } +// Uninstalls a filter with given id. + func(h *RpcHandler) EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint, + ) (Success bool, err error) { + handler := h.FnEthUninstallFilter + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Polling method for a filter, which returns an array of logs which occurred since last poll. + func(h *RpcHandler) EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetFilterChanges + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Returns an array of all logs matching filter with given id. + func(h *RpcHandler) EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetFilterLogs + return handler(ctx context.Context, + FilterIdentifier *Uint, + ) + } +// Returns an array of all logs matching filter with given id. + func(h *RpcHandler) EthGetLogs(ctx context.Context, + Filter *Filter, + ) (LogObjects FilterResults, err error) { + handler := h.FnEthGetLogs + return handler(ctx context.Context, + Filter *Filter, + ) + } +// Returns whether the client is actively mining new blocks. + func(h *RpcHandler) EthMining(ctx context.Context, + ) (MiningStatus bool, err error) { + handler := h.FnEthMining + return handler(ctx context.Context, + ) + } +// Returns the number of hashes per second that the node is mining with. + func(h *RpcHandler) EthHashrate(ctx context.Context, + ) (MiningStatus Uint, err error) { + handler := h.FnEthHashrate + return handler(ctx context.Context, + ) + } +// Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + func(h *RpcHandler) EthGetWork(ctx context.Context, + ) (CurrentWork []Bytes32, err error) { + handler := h.FnEthGetWork + return handler(ctx context.Context, + ) + } +// Used for submitting a proof-of-work solution. + func(h *RpcHandler) EthSubmitWork(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) (Success bool, err error) { + handler := h.FnEthSubmitWork + return handler(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) + } +// Used for submitting mining hashrate. + func(h *RpcHandler) EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) (Success bool, err error) { + handler := h.FnEthSubmitHashrate + return handler(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) + } +// Returns an EIP-191 signature over the provided data. + func(h *RpcHandler) EthSign(ctx context.Context, + Address Address, + Message Bytes, + ) (Signature Bytes65, err error) { + handler := h.FnEthSign + return handler(ctx context.Context, + Address Address, + Message Bytes, + ) + } +// Returns an RLP encoded transaction signed by the specified account. + func(h *RpcHandler) EthSignTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (EncodedTransaction Bytes, err error) { + handler := h.FnEthSignTransaction + return handler(ctx context.Context, + Transaction GenericTransaction, + ) + } +// Returns the balance of the account of given address. + func(h *RpcHandler) EthGetBalance(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Balance Uint, err error) { + handler := h.FnEthGetBalance + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + } +// Returns the value from a storage position at a given address. + func(h *RpcHandler) EthGetStorageAt(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) (Value Bytes, err error) { + handler := h.FnEthGetStorageAt + return handler(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) + } +// Returns the number of transactions sent from an address. + func(h *RpcHandler) EthGetTransactionCount(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetTransactionCount + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + } +// Returns code at a given address. + func(h *RpcHandler) EthGetCode(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Bytecode Bytes, err error) { + handler := h.FnEthGetCode + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + } +// Returns the merkle proof for a given account and optionally some storage keys. + func(h *RpcHandler) EthGetProof(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) (Account AccountProof, err error) { + handler := h.FnEthGetProof + return handler(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) + } +// Signs and submits a transaction. + func(h *RpcHandler) EthSendTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (TransactionHash Hash32, err error) { + handler := h.FnEthSendTransaction + return handler(ctx context.Context, + Transaction GenericTransaction, + ) + } +// Submits a raw transaction. + func(h *RpcHandler) EthSendRawTransaction(ctx context.Context, + Transaction Bytes, + ) (TransactionHash Hash32, err error) { + handler := h.FnEthSendRawTransaction + return handler(ctx context.Context, + Transaction Bytes, + ) + } +// Returns the information about a transaction requested by transaction hash. + func(h *RpcHandler) EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByHash + return handler(ctx context.Context, + TransactionHash Hash32, + ) + } +// Returns information about a transaction by block hash and transaction index position. + func(h *RpcHandler) EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByBlockHashAndIndex + return handler(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) + } +// Returns information about a transaction by block number and transaction index position. + func(h *RpcHandler) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByBlockNumberAndIndex + return handler(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) + } +// Returns the receipt of a transaction by transaction hash. + func(h *RpcHandler) EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32, + ) (ReceiptInformation ReceiptInfo, err error) { + handler := h.FnEthGetTransactionReceipt + return handler(ctx context.Context, + TransactionHash *Hash32, + ) + } +type GoOpenRPCService interface { + // Returns an RLP-encoded header. + DebugGetRawHeader(ctx context.Context, + } +// Returns the value from a storage position at a given address. + func(h *RpcHandler) EthGetStorageAt(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) (Value Bytes, err error) { + handler := h.FnEthGetStorageAt + return handler(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) + } +// Returns the number of transactions sent from an address. + func(h *RpcHandler) EthGetTransactionCount(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) { + handler := h.FnEthGetTransactionCount + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + } +// Returns code at a given address. + func(h *RpcHandler) EthGetCode(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Bytecode Bytes, err error) { + handler := h.FnEthGetCode + return handler(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) + } +// Returns the merkle proof for a given account and optionally some storage keys. + func(h *RpcHandler) EthGetProof(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) (Account AccountProof, err error) { + handler := h.FnEthGetProof + return handler(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) + } +// Signs and submits a transaction. + func(h *RpcHandler) EthSendTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (TransactionHash Hash32, err error) { + handler := h.FnEthSendTransaction + return handler(ctx context.Context, + Transaction GenericTransaction, + ) + } +// Submits a raw transaction. + func(h *RpcHandler) EthSendRawTransaction(ctx context.Context, + Transaction Bytes, + ) (TransactionHash Hash32, err error) { + handler := h.FnEthSendRawTransaction + return handler(ctx context.Context, + Transaction Bytes, + ) + } +// Returns the information about a transaction requested by transaction hash. + func(h *RpcHandler) EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByHash + return handler(ctx context.Context, + TransactionHash Hash32, + ) + } +// Returns information about a transaction by block hash and transaction index position. + func(h *RpcHandler) EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByBlockHashAndIndex + return handler(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) + } +// Returns information about a transaction by block number and transaction index position. + func(h *RpcHandler) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) { + handler := h.FnEthGetTransactionByBlockNumberAndIndex + return handler(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) + } +// Returns the receipt of a transaction by transaction hash. + func(h *RpcHandler) EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32, + ) (ReceiptInformation ReceiptInfo, err error) { + handler := h.FnEthGetTransactionReceipt + return handler(ctx context.Context, + TransactionHash *Hash32, + ) + } +type GoOpenRPCService interface { + // Returns an RLP-encoded header. + DebugGetRawHeader(ctx context.Context, + Block BlockNumberOrTag, + ) (HeaderRLP Bytes, err error) + // Returns an RLP-encoded block. + DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag, + ) (BlockRLP Bytes, err error) + // Returns an array of EIP-2718 binary-encoded transactions. + DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32, + ) (EIP2718BinaryEncodedTransaction Bytes, err error) + // Returns an array of EIP-2718 binary-encoded receipts. + DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag, + ) (Receipts []Bytes, err error) + // Returns an array of recent bad blocks that the client has seen on the network. + DebugGetBadBlocks(ctx context.Context, + ) (Blocks []BadBlock, err error) + // Returns information about a block by hash. + EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) (BlockInformation Block, err error) + // Returns information about a block by number. + EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) (BlockInformation Block, err error) + // Returns the number of transactions in a block from a block matching the given block hash. + EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32, + ) (TransactionCount Uint, err error) + // Returns the number of transactions in a block matching the given block number. + EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) + // Returns the number of uncles in a block from a block matching the given block hash. + EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32, + ) (UncleCount Uint, err error) + // Returns the number of transactions in a block matching the given block number. + EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (UncleCount Uint, err error) + // Returns the chain ID of the current network. + EthChainId(ctx context.Context, + ) (ChainID Uint, err error) + // Returns an object with data about the sync status or false. + EthSyncing(ctx context.Context, + ) (SyncingStatus SyncingStatus, err error) + // Returns the client coinbase address. + EthCoinbase(ctx context.Context, + ) (CoinbaseAddress Address, err error) + // Returns a list of addresses owned by client. + EthAccounts(ctx context.Context, + ) (Accounts []Address, err error) + // Returns the number of most recent block. + EthBlockNumber(ctx context.Context, + ) (BlockNumber Uint, err error) + // Executes a new message call immediately without creating a transaction on the block chain. + EthCall(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (ReturnData Bytes, err error) + // Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed Uint, err error) + // Generates an access list for a transaction. + EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) + // Returns the current price per gas in wei. + EthGasPrice(ctx context.Context, + ) (GasPrice Uint, err error) + // Returns the current maxPriorityFeePerGas per gas in wei. + EthMaxPriorityFeePerGas(ctx context.Context, + ) (MaxPriorityFeePerGas Uint, er Block BlockNumberOrTag, + ) (HeaderRLP Bytes, err error) + // Returns an RLP-encoded block. + DebugGetRawBlock(ctx context.Context, + Block BlockNumberOrTag, + ) (BlockRLP Bytes, err error) + // Returns an array of EIP-2718 binary-encoded transactions. + DebugGetRawTransaction(ctx context.Context, + TransactionHash Hash32, + ) (EIP2718BinaryEncodedTransaction Bytes, err error) + // Returns an array of EIP-2718 binary-encoded receipts. + DebugGetRawReceipts(ctx context.Context, + Block BlockNumberOrTag, + ) (Receipts []Bytes, err error) + // Returns an array of recent bad blocks that the client has seen on the network. + DebugGetBadBlocks(ctx context.Context, + ) (Blocks []BadBlock, err error) + // Returns information about a block by hash. + EthGetBlockByHash(ctx context.Context, + BlockHash Hash32, + HydratedTransactions bool, + ) (BlockInformation Block, err error) + // Returns information about a block by number. + EthGetBlockByNumber(ctx context.Context, + Block BlockNumberOrTag, + HydratedTransactions bool, + ) (BlockInformation Block, err error) + // Returns the number of transactions in a block from a block matching the given block hash. + EthGetBlockTransactionCountByHash(ctx context.Context, + BlockHash *Hash32, + ) (TransactionCount Uint, err error) + // Returns the number of transactions in a block matching the given block number. + EthGetBlockTransactionCountByNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) + // Returns the number of uncles in a block from a block matching the given block hash. + EthGetUncleCountByBlockHash(ctx context.Context, + BlockHash *Hash32, + ) (UncleCount Uint, err error) + // Returns the number of transactions in a block matching the given block number. + EthGetUncleCountByBlockNumber(ctx context.Context, + Block *BlockNumberOrTag, + ) (UncleCount Uint, err error) + // Returns the chain ID of the current network. + EthChainId(ctx context.Context, + ) (ChainID Uint, err error) + // Returns an object with data about the sync status or false. + EthSyncing(ctx context.Context, + ) (SyncingStatus SyncingStatus, err error) + // Returns the client coinbase address. + EthCoinbase(ctx context.Context, + ) (CoinbaseAddress Address, err error) + // Returns a list of addresses owned by client. + EthAccounts(ctx context.Context, + ) (Accounts []Address, err error) + // Returns the number of most recent block. + EthBlockNumber(ctx context.Context, + ) (BlockNumber Uint, err error) + // Executes a new message call immediately without creating a transaction on the block chain. + EthCall(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (ReturnData Bytes, err error) + // Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + EthEstimateGas(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed Uint, err error) + // Generates an access list for a transaction. + EthCreateAccessList(ctx context.Context, + Transaction GenericTransaction, + Block *BlockNumberOrTag, + ) (GasUsed struct { + AccessList AccessList `json:"accessList"` + Error string `json:"error"` + GasUsed Uint `json:"gasUsed"` + }, err error) + // Returns the current price per gas in wei. + EthGasPrice(ctx context.Context, + ) (GasPrice Uint, err error) + // Returns the current maxPriorityFeePerGas per gas in wei. + EthMaxPriorityFeePerGas(ctx context.Context, + ) (MaxPriorityFeePerGas Uint, err error) + // Transaction fee history + EthFeeHistory(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) (FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) + // Creates a filter object, based on filter options, to notify when the state changes (logs). + EthNewFilter(ctx context.Context, + Filter *Filter, + ) (FilterIdentifier Uint, err error) + // Creates a filter in the node, to notify when a new block arrives. + EthNewBlockFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) + // Creates a filter in the node, to notify when new pending transactions arrive. + EthNewPendingTransactionFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) + // Uninstalls a filter with given id. + EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint, + ) (Success bool, err error) + // Polling method for a filter, which returns an array of logs which occurred since last poll. + EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) + // Returns an array of all logs matching filter with given id. + EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) + // Returns an array of all logs matching filter with given id. + EthGetLogs(ctx context.Context, + Filter *Filter, + ) (LogObjects FilterResults, err error) + // Returns whether the client is actively mining new blocks. + EthMining(ctx context.Context, + ) (MiningStatus bool, err error) + // Returns the number of hashes per second that the node is mining with. + EthHashrate(ctx context.Context, + ) (MiningStatus Uint, err error) + // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + EthGetWork(ctx context.Context, + ) (CurrentWork []Bytes32, err error) + // Used for submitting a proof-of-work solution. + EthSubmitWork(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) (Success bool, err error) + // Used for submitting mining hashrate. + EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) (Success bool, err error) + // Returns an EIP-191 signature over the provided data. + EthSign(ctx context.Context, + Address Address, + Message Bytes, + ) (Signature Bytes65, err error) + // Returns an RLP encoded transaction signed by the specified account. + EthSignTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (EncodedTransaction Bytes, err error) + // Returns the balance of the account of given address. + EthGetBalance(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Balance Uint, err error) + // Returns the value from a storage position at a given address. + EthGetStorageAt(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) (Value Bytes, err error) + // Returns the number of transactions sent from an address. + EthGetTransactionCount(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) + // Returns code at a given address. + EthGetCode(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Bytecode Bytes, err error) + // Returns the merkle proof for a given account and optionally some storage keys. + EthGr error) + // Transaction fee history + EthFeeHistory(ctx context.Context, + BlockCount Uint, + NewestBlock BlockNumberOrTag, + RewardPercentiles []float64, + ) (FeeHistoryResult struct { + BaseFeePerGas []Uint `json:"baseFeePerGas"` + OldestBlock Uint `json:"oldestBlock"` + Reward [][]Uint `json:"reward"` + }, err error) + // Creates a filter object, based on filter options, to notify when the state changes (logs). + EthNewFilter(ctx context.Context, + Filter *Filter, + ) (FilterIdentifier Uint, err error) + // Creates a filter in the node, to notify when a new block arrives. + EthNewBlockFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) + // Creates a filter in the node, to notify when new pending transactions arrive. + EthNewPendingTransactionFilter(ctx context.Context, + ) (FilterIdentifier Uint, err error) + // Uninstalls a filter with given id. + EthUninstallFilter(ctx context.Context, + FilterIdentifier *Uint, + ) (Success bool, err error) + // Polling method for a filter, which returns an array of logs which occurred since last poll. + EthGetFilterChanges(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) + // Returns an array of all logs matching filter with given id. + EthGetFilterLogs(ctx context.Context, + FilterIdentifier *Uint, + ) (LogObjects FilterResults, err error) + // Returns an array of all logs matching filter with given id. + EthGetLogs(ctx context.Context, + Filter *Filter, + ) (LogObjects FilterResults, err error) + // Returns whether the client is actively mining new blocks. + EthMining(ctx context.Context, + ) (MiningStatus bool, err error) + // Returns the number of hashes per second that the node is mining with. + EthHashrate(ctx context.Context, + ) (MiningStatus Uint, err error) + // Returns the hash of the current block, the seedHash, and the boundary condition to be met (“targetâ€). + EthGetWork(ctx context.Context, + ) (CurrentWork []Bytes32, err error) + // Used for submitting a proof-of-work solution. + EthSubmitWork(ctx context.Context, + Nonce Bytes8, + Hash Bytes32, + Digest Bytes32, + ) (Success bool, err error) + // Used for submitting mining hashrate. + EthSubmitHashrate(ctx context.Context, + Hashrate Bytes32, + Id Bytes32, + ) (Success bool, err error) + // Returns an EIP-191 signature over the provided data. + EthSign(ctx context.Context, + Address Address, + Message Bytes, + ) (Signature Bytes65, err error) + // Returns an RLP encoded transaction signed by the specified account. + EthSignTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (EncodedTransaction Bytes, err error) + // Returns the balance of the account of given address. + EthGetBalance(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Balance Uint, err error) + // Returns the value from a storage position at a given address. + EthGetStorageAt(ctx context.Context, + Address Address, + StorageSlot Uint256, + Block *BlockNumberOrTag, + ) (Value Bytes, err error) + // Returns the number of transactions sent from an address. + EthGetTransactionCount(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (TransactionCount Uint, err error) + // Returns code at a given address. + EthGetCode(ctx context.Context, + Address Address, + Block *BlockNumberOrTag, + ) (Bytecode Bytes, err error) + // Returns the merkle proof for a given account and optionally some storage keys. + EthGetProof(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) (Account AccountProof, err error) + // Signs and submits a transaction. + EthSendTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (TransactionHash Hash32, err error) + // Submits a raw transaction. + EthSendRawTransaction(ctx context.Context, + Transaction Bytes, + ) (TransactionHash Hash32, err error) + // Returns the information about a transaction requested by transaction hash. + EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32, + ) (TransactionInformation TransactionInfo, err error) + // Returns information about a transaction by block hash and transaction index position. + EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) + // Returns information about a transaction by block number and transaction index position. + EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) + // Returns the receipt of a transaction by transaction hash. + EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32, + ) (ReceiptInformation ReceiptInfo, err error) + } + type AccessList []AccessListEntry + type AccessListEntry struct { + Address Address `json:"address"` + StorageKeys []Hash32 `json:"storageKeys"` + } + type AccountProof struct { + AccountProof []Bytes `json:"accountProof"` + Address Address `json:"address"` + Balance Uint256 `json:"balance"` + CodeHash Hash32 `json:"codeHash"` + Nonce Uint64 `json:"nonce"` + StorageHash Hash32 `json:"storageHash"` + StorageProof []StorageProof `json:"storageProof"` + } + type BadBlock struct { + Block Bytes `json:"block"` + Hash Hash32 `json:"hash"` + Rlp Bytes `json:"rlp"` + } + type Block struct { + BaseFeePerGas Uint `json:"baseFeePerGas"` + Difficulty Bytes `json:"difficulty"` + ExtraData Bytes `json:"extraData"` + GasLimit Uint `json:"gasLimit"` + GasUsed Uint `json:"gasUsed"` + LogsBloom Bytes256 `json:"logsBloom"` + Miner Address `json:"miner"` + MixHash Hash32 `json:"mixHash"` + Nonce Bytes8 `json:"nonce"` + Number Uint `json:"number"` + ParentHash Hash32 `json:"parentHash"` + ReceiptsRoot Hash32 `json:"receiptsRoot"` + Sha3Uncles Hash32 `json:"sha3Uncles"` + Size Uint `json:"size"` + StateRoot Hash32 `json:"stateRoot"` + Timestamp Uint `json:"timestamp"` + TotalDifficulty Uint `json:"totalDifficulty"` + Transactions struct { + Option0 []Hash32 + Option1 []TransactionSigned + } `json:"transactions"` + TransactionsRoot Hash32 `json:"transactionsRoot"` + Uncles []Hash32 `json:"uncles"` + } + type BlockNumberOrTag struct { + Option0 Uint + Option1 BlockTag + } + type BlockTag string + type Filter struct { + Address struct { + Option0 Address + Option1 Addresses + } `json:"address"` + FromBlock Uint `json:"fromBlock"` + ToBlock Uint `json:"toBlock"` + Topics FilterTopics `json:"topics"` + } + type FilterResults struct { + Option0 []Hash32 + Option1 []Hash32 + Option2 []Log + } + type FilterTopic struct { + Option0 struct{} + Option1 Bytes32 + Option2 []Bytes32 + } + type FilterTopics []FilterTopicetProof(ctx context.Context, + Address Address, + StorageKeys []Hash32, + Block BlockNumberOrTag, + ) (Account AccountProof, err error) + // Signs and submits a transaction. + EthSendTransaction(ctx context.Context, + Transaction GenericTransaction, + ) (TransactionHash Hash32, err error) + // Submits a raw transaction. + EthSendRawTransaction(ctx context.Context, + Transaction Bytes, + ) (TransactionHash Hash32, err error) + // Returns the information about a transaction requested by transaction hash. + EthGetTransactionByHash(ctx context.Context, + TransactionHash Hash32, + ) (TransactionInformation TransactionInfo, err error) + // Returns information about a transaction by block hash and transaction index position. + EthGetTransactionByBlockHashAndIndex(ctx context.Context, + BlockHash Hash32, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) + // Returns information about a transaction by block number and transaction index position. + EthGetTransactionByBlockNumberAndIndex(ctx context.Context, + Block BlockNumberOrTag, + TransactionIndex Uint, + ) (TransactionInformation TransactionInfo, err error) + // Returns the receipt of a transaction by transaction hash. + EthGetTransactionReceipt(ctx context.Context, + TransactionHash *Hash32, + ) (ReceiptInformation ReceiptInfo, err error) + } + type AccessList []AccessListEntry + type AccessListEntry struct { + Address Address `json:"address"` + StorageKeys []Hash32 `json:"storageKeys"` + } + type AccountProof struct { + AccountProof []Bytes `json:"accountProof"` + Address Address `json:"address"` + Balance Uint256 `json:"balance"` + CodeHash Hash32 `json:"codeHash"` + Nonce Uint64 `json:"nonce"` + StorageHash Hash32 `json:"storageHash"` + StorageProof []StorageProof `json:"storageProof"` + } + type BadBlock struct { + Block Bytes `json:"block"` + Hash Hash32 `json:"hash"` + Rlp Bytes `json:"rlp"` + } + type Block struct { + BaseFeePerGas Uint `json:"baseFeePerGas"` + Difficulty Bytes `json:"difficulty"` + ExtraData Bytes `json:"extraData"` + GasLimit Uint `json:"gasLimit"` + GasUsed Uint `json:"gasUsed"` + LogsBloom Bytes256 `json:"logsBloom"` + Miner Address `json:"miner"` + MixHash Hash32 `json:"mixHash"` + Nonce Bytes8 `json:"nonce"` + Number Uint `json:"number"` + ParentHash Hash32 `json:"parentHash"` + ReceiptsRoot Hash32 `json:"receiptsRoot"` + Sha3Uncles Hash32 `json:"sha3Uncles"` + Size Uint `json:"size"` + StateRoot Hash32 `json:"stateRoot"` + Timestamp Uint `json:"timestamp"` + TotalDifficulty Uint `json:"totalDifficulty"` + Transactions struct { + Option0 []Hash32 + Option1 []TransactionSigned + } `json:"transactions"` + TransactionsRoot Hash32 `json:"transactionsRoot"` + Uncles []Hash32 `json:"uncles"` + } + type BlockNumberOrTag struct { + Option0 Uint + Option1 BlockTag + } + type BlockTag string + type Filter struct { + Address struct { + Option0 Address + Option1 Addresses + } `json:"address"` + FromBlock Uint `json:"fromBlock"` + ToBlock Uint `json:"toBlock"` + Topics FilterTopics `json:"topics"` + } + type FilterResults struct { + Option0 []Hash32 + Option1 []Hash32 + Option2 []Log + } + type FilterTopic struct { + Option0 struct{} + Option1 Bytes32 + Option2 []Bytes32 + } + type FilterTopics []FilterTopic + type GenericTransaction struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + From Address `json:"from"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + MaxFeePerGas Uint `json:"maxFeePerGas"` + MaxPriorityFeePerGas Uint `json:"maxPriorityFeePerGas"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type Log struct { + Address Address `json:"address"` + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + Data Bytes `json:"data"` + LogIndex Uint `json:"logIndex"` + Removed bool `json:"removed"` + Topics []Bytes32 `json:"topics"` + TransactionHash Hash32 `json:"transactionHash"` + TransactionIndex Uint `json:"transactionIndex"` + } + type ReceiptInfo struct { + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + ContractAddress struct { + Option0 Address + Option1 struct{} + } `json:"contractAddress"` + CumulativeGasUsed Uint `json:"cumulativeGasUsed"` + EffectiveGasPrice Uint `json:"effectiveGasPrice"` + From Address `json:"from"` + GasUsed Uint `json:"gasUsed"` + Logs []Log `json:"logs"` + LogsBloom Bytes256 `json:"logsBloom"` + Root Bytes32 `json:"root"` + Status Uint `json:"status"` + To Address `json:"to"` + TransactionHash Hash32 `json:"transactionHash"` + TransactionIndex Uint `json:"transactionIndex"` + } + type StorageProof struct { + Key Hash32 `json:"key"` + Proof []Bytes `json:"proof"` + Value Uint256 `json:"value"` + } + type SyncingStatus struct { + Option0 struct { + CurrentBlock Uint `json:"currentBlock"` + HighestBlock Uint `json:"highestBlock"` + StartingBlock Uint `json:"startingBlock"` + } + Option1 bool + } + type Transaction1559Signed struct { + Field0 Transaction1559Unsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + YParity Uint `json:"yParity"` + } + } + type Transaction1559Unsigned struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + Input Bytes `json:"input"` + MaxFeePerGas Uint `json:"maxFeePerGas"` + MaxPriorityFeePerGas Uint `json:"maxPriorityFeePerGas"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type Transaction2930Signed struct { + Field0 Transaction2930Unsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + YParity Uint `json:"yParity"` + } + } + type Transaction2930Unsigned struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type TransactionInfo struct { + Field0 struct { + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + From Address `json:"from"` + Hash Hash32 `json:"hash"` + TransactionIndex Uint `json:"transactionIndex"` + } + Field1 TransactionSigned + } + type TransactionLegacySigned struct { + Field0 Trans + type GenericTransaction struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + From Address `json:"from"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + MaxFeePerGas Uint `json:"maxFeePerGas"` + MaxPriorityFeePerGas Uint `json:"maxPriorityFeePerGas"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type Log struct { + Address Address `json:"address"` + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + Data Bytes `json:"data"` + LogIndex Uint `json:"logIndex"` + Removed bool `json:"removed"` + Topics []Bytes32 `json:"topics"` + TransactionHash Hash32 `json:"transactionHash"` + TransactionIndex Uint `json:"transactionIndex"` + } + type ReceiptInfo struct { + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + ContractAddress struct { + Option0 Address + Option1 struct{} + } `json:"contractAddress"` + CumulativeGasUsed Uint `json:"cumulativeGasUsed"` + EffectiveGasPrice Uint `json:"effectiveGasPrice"` + From Address `json:"from"` + GasUsed Uint `json:"gasUsed"` + Logs []Log `json:"logs"` + LogsBloom Bytes256 `json:"logsBloom"` + Root Bytes32 `json:"root"` + Status Uint `json:"status"` + To Address `json:"to"` + TransactionHash Hash32 `json:"transactionHash"` + TransactionIndex Uint `json:"transactionIndex"` + } + type StorageProof struct { + Key Hash32 `json:"key"` + Proof []Bytes `json:"proof"` + Value Uint256 `json:"value"` + } + type SyncingStatus struct { + Option0 struct { + CurrentBlock Uint `json:"currentBlock"` + HighestBlock Uint `json:"highestBlock"` + StartingBlock Uint `json:"startingBlock"` + } + Option1 bool + } + type Transaction1559Signed struct { + Field0 Transaction1559Unsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + YParity Uint `json:"yParity"` + } + } + type Transaction1559Unsigned struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + Input Bytes `json:"input"` + MaxFeePerGas Uint `json:"maxFeePerGas"` + MaxPriorityFeePerGas Uint `json:"maxPriorityFeePerGas"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type Transaction2930Signed struct { + Field0 Transaction2930Unsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + YParity Uint `json:"yParity"` + } + } + type Transaction2930Unsigned struct { + AccessList AccessList `json:"accessList"` + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type TransactionInfo struct { + Field0 struct { + BlockHash Hash32 `json:"blockHash"` + BlockNumber Uint `json:"blockNumber"` + From Address `json:"from"` + Hash Hash32 `json:"hash"` + TransactionIndex Uint `json:"transactionIndex"` + } + Field1 TransactionSigned + } + type TransactionLegacySigned struct { + Field0 TransactionLegacyUnsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + V Uint `json:"v"` + } + } + type TransactionLegacyUnsigned struct { + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type TransactionSigned struct { + Option0 Transaction1559Signed + Option1 Transaction2930Signed + Option2 TransactionLegacySigned + } + type TransactionUnsigned struct { + Option0 Transaction1559Unsigned + Option1 Transaction2930Unsigned + Option2 TransactionLegacyUnsigned + } + type Address string + type Addresses []Address + type Byte string + type Bytes string + type Bytes256 string + type Bytes32 string + type Bytes65 string + type Bytes8 string + type Hash32 string + type Uint string + type Uint256 string + type Uint64 string + + +actionLegacyUnsigned + Field1 struct { + R Uint `json:"r"` + S Uint `json:"s"` + V Uint `json:"v"` + } + } + type TransactionLegacyUnsigned struct { + ChainId Uint `json:"chainId"` + Gas Uint `json:"gas"` + GasPrice Uint `json:"gasPrice"` + Input Bytes `json:"input"` + Nonce Uint `json:"nonce"` + To Address `json:"to"` + Type Byte `json:"type"` + Value Uint `json:"value"` + } + type TransactionSigned struct { + Option0 Transaction1559Signed + Option1 Transaction2930Signed + Option2 TransactionLegacySigned + } + type TransactionUnsigned struct { + Option0 Transaction1559Unsigned + Option1 Transaction2930Unsigned + Option2 TransactionLegacyUnsigned + } + type Address string + type Addresses []Address + type Byte string + type Bytes string + type Bytes256 string + type Bytes32 string + type Bytes65 string + type Bytes8 string + type Hash32 string + type Uint string + type Uint256 string + type Uint64 string + + +error: 559:28: missing ',' in argument list (and 10 more errors) +error: 559:28: missing ',' in argument list (and 10 more errors) +exit status 1 +exit status 1 +gogenerate.go:4: running "go": exit status 1 +gogenerate.go:4: running "go": exit status 1 diff --git a/openrpc/templates/types.gotmpl b/openrpc/templates/types.gotmpl index a459595db2aba0b86e2c761ebcc52b7249483bf7..9f6bfd8ff458ad05aa9fb550b41caad397a1b756 100644 --- a/openrpc/templates/types.gotmpl +++ b/openrpc/templates/types.gotmpl @@ -2,7 +2,11 @@ package {{ .Package }} -import "context" +import ( + "context" + "gfx.cafe/open/jrpc" + ) + {{define "schemaType" -}} {{if not (eq .Ref "") -}} @@ -36,15 +40,54 @@ import "context" {{- end}} {{- end -}} +type GoOpenRPCHandler struct { + Srv GoOpenRPCService +} + + +func (h *GoOpenRPCHandler) RouteRPC(r jrpc.Router) { + {{range .Methods -}} + // {{.Summary}} + {{if .Namespace}} + r.Route("{{.Namespace}}", func(r2 jrpc.Router) { + r.RegisterFunc("{{.MethodName}}", h.Srv.{{camelCase .Name}}) + }) + {{else}} + r.RegisterFunc("{{.MethodName}}", h.Srv.{{camelCase .Name}}) + {{end}} + {{end -}} +} + +type RpcHandler struct { +{{range .Methods -}} + // {{.Summary}} + Fn{{camelCase .Name}} func(ctx context.Context, + {{range .Params -}}{{camelCase .Name}} {{if not .Required}}*{{end}}{{template "schemaType" .Schema}}, + {{end -}})({{camelCase .Result.Name}} {{template "schemaType" .Result.Schema}}, err error) + +{{end -}} +} + +{{range .Methods -}} + // {{.Summary}} + func(h *RpcHandler) {{camelCase .Name}}(ctx context.Context, + {{range .Params -}}{{camelCase .Name}} {{if not .Required}}*{{end}}{{template "schemaType" .Schema}}, + {{end -}}) ({{camelCase .Result.Name}} {{template "schemaType" .Result.Schema}}, err error) { + handler := h.Fn{{camelCase .Name}} + return handler(ctx context.Context, + {{range .Params -}}{{camelCase .Name}} {{if not .Required}}*{{end}}{{template "schemaType" .Schema}}, + {{end -}}) + } +{{end -}} + + type GoOpenRPCService interface { {{range .Methods -}} // {{.Summary}} - {{camelCase .Name}}( - ctx context.Context, - {{range .Params -}} - {{camelCase .Name}} {{if not .Required}}*{{end}}{{template "schemaType" .Schema}}, + {{camelCase .Name}}(ctx context.Context, + {{range .Params -}}{{camelCase .Name}} {{if not .Required}}*{{end}}{{template "schemaType" .Schema}}, {{end -}} - ) ({{camelCase .Result.Name}} {{template "schemaType" .Result.Schema}}, err error) + ) ({{camelCase .Result.Name}} {{template "schemaType" .Result.Schema}}, err error) {{end -}} } diff --git a/openrpc/types/types.go b/openrpc/types/types.go index 59502185b363e51a6c8bc183726f1a29644db7b6..b3228a631574981f67dbbd62fc30822394efbb4a 100644 --- a/openrpc/types/types.go +++ b/openrpc/types/types.go @@ -6,6 +6,7 @@ import ( "os" "path" "path/filepath" + "strings" "sigs.k8s.io/yaml" ) @@ -79,6 +80,22 @@ type Method struct { Result Result `json:"result"` } +func (m *Method) Namespace() string { + splt := strings.Split(m.Name, "_") + if len(splt) > 1 { + return splt[0] + } + return "" +} + +func (m *Method) MethodName() string { + splt := strings.Split(m.Name, "_") + if len(splt) > 1 { + return splt[1] + } + return splt[0] +} + type OpenRPC struct { Package string `json:"package"` Version string `json:"openrpc"` diff --git a/router.go b/router.go index f3b302dacaf2c36c4fcd1074ae2dfe9ba491cf23..d25013664183310f39fe11ce2b02dde68038cbb9 100644 --- a/router.go +++ b/router.go @@ -9,6 +9,9 @@ type StructReflector interface { // mimics the behavior of the handlers in the go-ethereum rpc package // if you don't know how to use this, just use the chi-like interface instead. RegisterStruct(pattern string, rcvr any) error + // mimics the behavior of the handlers in the go-ethereum rpc package + // if you don't know how to use this, just use the chi-like interface instead. + RegisterFunc(pattern string, rcvr any) error } // Router consisting of the core routing methods used by chi's Mux,