Documentation ¶
Index ¶
- Constants
- Variables
- func NewRouter(api *Api) *mux.Router
- func StartRelay(conf *config.Config, serverReadyChan chan struct{})
- type Api
- func (api *Api) GetBundleHash(w http.ResponseWriter, r *http.Request)
- func (api *Api) GetSolverOperationStatus(w http.ResponseWriter, r *http.Request)
- func (api *Api) GetSolverOperations(w http.ResponseWriter, r *http.Request)
- func (api *Api) Ping(w http.ResponseWriter, r *http.Request)
- func (api *Api) SubmitBundleOperations(w http.ResponseWriter, r *http.Request)
- func (api *Api) SubmitSolverOperation(w http.ResponseWriter, r *http.Request)
- func (api *Api) SubmitUserOperation(w http.ResponseWriter, r *http.Request)
- func (api *Api) WebsocketBundler(w http.ResponseWriter, r *http.Request)
- func (api *Api) WebsocketSignatory(w http.ResponseWriter, r *http.Request)
- func (api *Api) WebsocketSolver(w http.ResponseWriter, r *http.Request)
- type BareRequest
- type Broadcast
- type BroadcastParams
- type BundleRequest
- type BundleResponse
- type Conn
- type Marshaler
- type Relay
- type Request
- type RequestParams
- type Response
- type RetrieveRequest
- type Route
- type Server
- func (s *Server) BroadcastUserOperationPartial(userOperationPartialRaw *operation.UserOperationPartialRaw)
- func (s *Server) ForwardBundle(bundleOps *operation.BundleOperations, setAtlasTxHash setAtlasTxHashFn, ...) *relayerror.Error
- func (s *Server) ListenAndServe(serverReadyChan chan struct{})
- func (s *Server) NewSignatoryRequest(userOpHash common.Hash, userOp *operation.UserOperation, ...)
- func (s *Server) ServeWs(w http.ResponseWriter, r *http.Request, channel string, bundler common.Address, ...) (*Conn, error)
- func (s *Server) ServeWsBundler(w http.ResponseWriter, r *http.Request, bundler common.Address)
- func (s *Server) ServeWsSignatory(w http.ResponseWriter, r *http.Request, signatory common.Address)
- func (s *Server) ServeWsSolver(w http.ResponseWriter, r *http.Request)
- type SignatoryRequest
- type SignatoryResponse
- type SigningRequest
Constants ¶
View Source
const ( BundlerTimeout = 2 * time.Second SignatoryTimeout = 2 * time.Second // Channels ChannelSolver = "solver" ChannelBundler = "bundler" ChannelSignatory = "signatory" // Methods MethodPing = "ping" MethodSubscribe = "subscribe" MethodUnsubscribe = "unsubscribe" MethodSubmitSolverOperation = "submitSolverOperation" MethodSolverOperationStatus = "solverOperationStatus" // Subscriptions topics TopicNewUserOperations = "newUserOperations" // Events EventUpdate = "update" EventNewBundle = "newBundle" EventNewSignatoryRequest = "newSignatoryRequest" // Messages ConnUpgradeFailed = "failed upgrading connection" Pong = "pong" Subscribed = "subscribed" Unsubscribed = "unsubscribed" AlreadySubscribed = "already subscribed" NotSubscribed = "not subscribed" InvalidMessage = "invalid message" InvalidChannel = "invalid channel" InvalidMethod = "invalid method" InvalidTopic = "invalid topic" InvalidSolverOperation = "invalid solver operation" RateLimitExceeded = "rate limit exceeded" )
View Source
const (
BundleSuccessfullySubmitted = "bundle successfully submitted"
)
Variables ¶
View Source
var ( ErrMalformedRequest = relayerror.NewError(3000, "malformed request") ErrMalformedJson = relayerror.NewError(3001, "malformed json") ErrInvalidParameter = relayerror.NewError(3002, "invalid parameter") ErrServerCorruptedData = relayerror.NewError(3003, "server corrupted data") ErrInvalidOpHash = relayerror.NewError(3004, "invalid operation hash") ErrInvalidAddress = relayerror.NewError(3005, "invalid address") ErrInvalidTimestamp = relayerror.NewError(3006, "invalid timestamp") ErrExpiredSignature = relayerror.NewError(3007, "expired signature") ErrBadSignature = relayerror.NewError(3008, "bad signature (decode/recover error)") ErrSignatureMismatch = relayerror.NewError(3009, "signature mismatch") )
View Source
var ( ErrForwardBundle = relayerror.NewError(3100, "failed to forward bundle") ErrCantGetDAppSignatories = relayerror.NewError(3101, "failed to get dapp signatories") ErrCantGetBondedBalance = relayerror.NewError(3102, "failed to get atlEth bonded balance") ErrRelayIsOffline = relayerror.NewError(3103, "relay is offline") )
View Source
var ( Channels = map[string]struct{}{ ChannelSolver: {}, ChannelBundler: {}, ChannelSignatory: {}, } Methods = map[string]map[string]struct{}{ ChannelSolver: {MethodPing: {}, MethodSubscribe: {}, MethodUnsubscribe: {}, MethodSubmitSolverOperation: {}, MethodSolverOperationStatus: {}}, ChannelBundler: {MethodPing: {}}, ChannelSignatory: {MethodPing: {}}, } Topics = map[string]struct{}{ TopicNewUserOperations: {}, } )
View Source
var ( ErrBundlerOffline = relayerror.NewError(3200, "bundler is offline") ErrCloggedConnection = relayerror.NewError(3201, "clogged connection") ErrBundlingFailure = relayerror.NewError(3202, "bundling failure") ErrSignatoryOffline = relayerror.NewError(3203, "signatory is offline") ErrSigningFailure = relayerror.NewError(3204, "auctioneer signing failure") )
Functions ¶
func StartRelay ¶
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) GetBundleHash ¶
func (api *Api) GetBundleHash(w http.ResponseWriter, r *http.Request)
func (*Api) GetSolverOperationStatus ¶ added in v1.0.3
func (api *Api) GetSolverOperationStatus(w http.ResponseWriter, r *http.Request)
func (*Api) GetSolverOperations ¶
func (api *Api) GetSolverOperations(w http.ResponseWriter, r *http.Request)
func (*Api) SubmitBundleOperations ¶
func (api *Api) SubmitBundleOperations(w http.ResponseWriter, r *http.Request)
func (*Api) SubmitSolverOperation ¶
func (api *Api) SubmitSolverOperation(w http.ResponseWriter, r *http.Request)
func (*Api) SubmitUserOperation ¶
func (api *Api) SubmitUserOperation(w http.ResponseWriter, r *http.Request)
func (*Api) WebsocketBundler ¶
func (api *Api) WebsocketBundler(w http.ResponseWriter, r *http.Request)
func (*Api) WebsocketSignatory ¶ added in v1.0.4
func (api *Api) WebsocketSignatory(w http.ResponseWriter, r *http.Request)
func (*Api) WebsocketSolver ¶
func (api *Api) WebsocketSolver(w http.ResponseWriter, r *http.Request)
type BareRequest ¶ added in v1.0.1
type BareRequest struct {
Id string `json:"id" validate:"required"`
}
type Broadcast ¶
type Broadcast struct { Event string `json:"event"` Topic string `json:"topic"` Data *BroadcastParams `json:"data"` }
type BroadcastParams ¶
type BroadcastParams struct {
UserOperationPartial *operation.UserOperationPartialRaw `json:"userOperation,omitempty"`
}
type BundleRequest ¶
type BundleRequest struct { Id string `json:"id"` Event string `json:"event"` Bundle *operation.BundleOperationsRaw `json:"bundle"` }
func (*BundleRequest) Marshal ¶
func (br *BundleRequest) Marshal() []byte
type BundleResponse ¶
type BundleResponse struct { Id string `json:"id" validate:"required"` Result common.Hash `json:"result,omitempty"` Error string `json:"error,omitempty"` }
func (*BundleResponse) Marshal ¶ added in v1.0.1
func (br *BundleResponse) Marshal() []byte
type Request ¶
type Request struct { Id string `json:"id" validate:"required"` Method string `json:"method" validate:"required"` Params *RequestParams `json:"params" validate:"required"` }
type RequestParams ¶
type RequestParams struct { Topic string `json:"topic"` SolverOperation *operation.SolverOperationRaw `json:"solverOperation"` OpHash common.Hash `json:"operationHash"` Bundle *operation.BundleOperationsRaw `json:"bundle"` }
type Response ¶
type RetrieveRequest ¶
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) BroadcastUserOperationPartial ¶
func (s *Server) BroadcastUserOperationPartial(userOperationPartialRaw *operation.UserOperationPartialRaw)
func (*Server) ForwardBundle ¶
func (s *Server) ForwardBundle(bundleOps *operation.BundleOperations, setAtlasTxHash setAtlasTxHashFn, setRelayError setRelayErrorFn, notifyCompletionSubs notifyCompletionSubsFn) *relayerror.Error
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe(serverReadyChan chan struct{})
func (*Server) NewSignatoryRequest ¶ added in v1.0.4
func (s *Server) NewSignatoryRequest(userOpHash common.Hash, userOp *operation.UserOperation, solverOps []*operation.SolverOperation, signatories []common.Address, submitBundleOperations submitBundleOperationsFn, registerBundleError registerBundleErrorFn)
func (*Server) ServeWsBundler ¶
func (*Server) ServeWsSignatory ¶ added in v1.0.4
func (*Server) ServeWsSolver ¶
func (s *Server) ServeWsSolver(w http.ResponseWriter, r *http.Request)
type SignatoryRequest ¶ added in v1.0.4
type SignatoryRequest struct { Id string `json:"id"` Event string `json:"event"` UserOperation *operation.UserOperationRaw `json:"userOperation"` SolverOperations []*operation.SolverOperationRaw `json:"solverOperations"` }
func (*SignatoryRequest) Marshal ¶ added in v1.0.4
func (sr *SignatoryRequest) Marshal() []byte
type SignatoryResponse ¶ added in v1.0.4
type SignatoryResponse struct { Id string `json:"id" validate:"required"` Result *operation.DAppOperationRaw `json:"result,omitempty"` Error string `json:"error,omitempty"` }
func (*SignatoryResponse) Marshal ¶ added in v1.0.4
func (sr *SignatoryResponse) Marshal() []byte
type SigningRequest ¶ added in v1.0.4
type SigningRequest struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.