You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
537 B

package rpctypes
type RPCRequest struct {
JSONRPC string `json:"jsonrpc"`
Id string `json:"id"`
Method string `json:"method"`
Params []interface{} `json:"params"`
}
type RPCResponse struct {
JSONRPC string `json:"jsonrpc"`
Id string `json:"id"`
Result interface{} `json:"result"`
Error string `json:"error"`
}
func NewRPCResponse(id string, res interface{}, err string) RPCResponse {
return RPCResponse{
JSONRPC: "2.0",
Id: id,
Result: res,
Error: err,
}
}