func (r *RPCCore) Submit(operation *runtime.ClientOperation) (interface{}, error) {
	method := strings.TrimPrefix(operation.PathPattern, "/")
	req := NewRPCRequest(method)
	if err := operation.Params.WriteToRequest(req, strfmt.Default); err != nil {
		return nil, err
	}
	req.AddAuth(r.auth)
	res, err := r.rpcRequest(req)
	if err != nil {
		return nil, err
	}
	return operation.Reader.ReadResponse(res, runtime.JSONConsumer())
}
Submit satisfies the runtime.ClientTransport interface
package deribit
import (
	"fmt"
	"strings"
	"sync"
	"time"
	"github.com/adampointer/go-deribit/v3/models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
	"github.com/gorilla/websocket"
)
type callManager struct {
	reqMutex      sync.Mutex
	pending       map[uint64]*RPCCall
	subMutex      sync.Mutex
	subscriptions map[string]*RPCSubscription
	countMutex    sync.Mutex
	counter       uint64
}
func (c *callManager) nextID() uint64 {
	c.countMutex.Lock()
	defer c.countMutex.Unlock()
	id := c.counter
	c.counter++
	return id
}
func (c *callManager) addCall(call *RPCCall) {
	c.reqMutex.Lock()
	call.Req.ID = c.nextID()
	c.pending[call.Req.ID] = call
	c.reqMutex.Unlock()
}
func (c *callManager) deleteCall(call *RPCCall) {
	c.reqMutex.Lock()
	delete(c.pending, call.Req.ID)
	c.reqMutex.Unlock()
}
func (c *callManager) getCall(id uint64) *RPCCall {
	c.reqMutex.Lock()
	defer c.reqMutex.Unlock()
	return c.pending[id]
}
func (c *callManager) closeAllWithError(err error) {
	c.reqMutex.Lock()
	for _, call := range c.pending {
		call.Error = err
		call.Done <- true
	}
	c.reqMutex.Unlock()
}
func (c *callManager) addSubscription(sub *RPCSubscription) {
	c.subMutex.Lock()
	c.subscriptions[sub.Channel] = sub
	c.subMutex.Unlock()
}
func (c *callManager) deleteSubscription(channel string) {
	c.subMutex.Lock()
	delete(c.subscriptions, channel)
	c.subMutex.Unlock()
}
func (c *callManager) getSubscription(channel string) *RPCSubscription {
	c.subMutex.Lock()
	defer c.subMutex.Unlock()
	return c.subscriptions[channel]
}
func (c *callManager) getSubscriptions() map[string]*RPCSubscription {
	c.subMutex.Lock()
	defer c.subMutex.Unlock()
	return c.subscriptions
}
type connManager struct {
	stopPinging func()
	closedMutex sync.Mutex
	isClosed    bool
	writeMutex  sync.Mutex
	conn        *websocket.Conn
}
func (c *connManager) closed() bool {
	c.closedMutex.Lock()
	defer c.closedMutex.Unlock()
	return c.isClosed
}
func (c *connManager) close() error {
	c.closedMutex.Lock()
	c.isClosed = true
	c.closedMutex.Unlock()
	if err := c.writeMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")); err != nil {
		return err
	}
	return c.conn.Close()
}
func (c *connManager) writeJSON(msg interface{}) error {
	c.writeMutex.Lock()
	defer c.writeMutex.Unlock()
	return c.conn.WriteJSON(msg)
}
func (c *connManager) writeMessage(msgType int, msg []byte) error {
	c.writeMutex.Lock()
	defer c.writeMutex.Unlock()
	return c.conn.WriteMessage(msgType, msg)
}
func (c *connManager) readJSON(msg interface{}) error {
	return c.conn.ReadJSON(msg)
}
type RPCCore struct {
	OnConnect func()
	calls        *callManager
	connMgr      *connManager
	onDisconnect func(*RPCCore)
	errors       chan error
	stop         chan bool
	auth         *models.PublicAuthResponse
}