backend

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReleasesAPI = "https://api.github.com/repos/vegaprotocol/vegawallet-desktop/releases"
	ReleasesURL = "https://github.com/vegaprotocol/vegawallet-desktop/releases"
)
View Source
const NewInteractionEvent = "new_interaction"
View Source
const (
	ReloadingEntireApplicationRequired = "reloading_entire_application_required"
)

Variables

View Source
var (
	ErrTraceIDIsRequired = errors.New("a trace ID is required for an interaction")
	ErrNameIsRequired    = errors.New("a name is required for an interaction")
)
View Source
var (
	ErrContextCanceled       = errors.New("context canceled")
	ErrServiceAlreadyRunning = errors.New("the service is already running")
	ErrServiceNotRunning     = errors.New("the service is not running")
)
View Source
var (
	// Hash specifies the git commit used to build the application.
	// See VERSION_HASH in Makefile for details.
	Hash = "unknown"
	// Version specifies the version used to build the application.
	// See VERSION in Makefile for details.
	Version = "v0.3.0"
)
View Source
var ErrAPIv1Unsupported = errors.New("sending transactions through the API v1 is no longer supported")
View Source
var ErrAppIsNotInitialised = errors.New("the application has not been initialised")

Functions

This section is empty.

Types

type GetCurrentServiceInfo

type GetCurrentServiceInfo struct {
	URL               string `json:"url"`
	LogFilePath       string `json:"logFilePath"`
	IsRunning         bool   `json:"isRunning"`
	LatestHealthState string `json:"latestHealthState"`
}

type GetVersionResponse

type GetVersionResponse struct {
	Version string                       `json:"version"`
	GitHash string                       `json:"gitHash"`
	Backend *wversion.GetVersionResponse `json:"backend"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() (*Handler, error)

func (*Handler) DOMReady

func (h *Handler) DOMReady(_ context.Context)

DOMReady is called after the front-end dom has been loaded

func (*Handler) GetAppConfig

func (h *Handler) GetAppConfig() (app.Config, error)

GetAppConfig return the application configuration.

func (*Handler) GetCurrentServiceInfo

func (h *Handler) GetCurrentServiceInfo() (GetCurrentServiceInfo, error)

func (*Handler) GetLatestRelease

func (h *Handler) GetLatestRelease() (LatestRelease, error)

func (*Handler) GetVersion

func (h *Handler) GetVersion() (*GetVersionResponse, error)

func (*Handler) InitialiseApp

func (h *Handler) InitialiseApp(req *InitialiseAppRequest) error

func (*Handler) IsAppInitialised

func (h *Handler) IsAppInitialised() (bool, error)

func (*Handler) RespondToInteraction

func (h *Handler) RespondToInteraction(interaction interactor.Interaction) error

func (*Handler) SearchForExistingConfiguration

func (h *Handler) SearchForExistingConfiguration() (*SearchForExistingConfigurationResponse, error)

SearchForExistingConfiguration searches for existing wallets and networks. This endpoint should be used to help the user to restore existing wallet setup in the app.

func (*Handler) Shutdown

func (h *Handler) Shutdown(_ context.Context)

Shutdown is called during application termination

func (*Handler) StartService

func (h *Handler) StartService(req *StartServiceRequest) error

func (*Handler) Startup

func (h *Handler) Startup(ctx context.Context)

Startup is called during application startup

func (*Handler) StopService

func (h *Handler) StopService() error

func (*Handler) SubmitWalletAPIRequest

func (h *Handler) SubmitWalletAPIRequest(request *jsonrpc.Request) (*jsonrpc.Response, error)

func (*Handler) UpdateAppConfig

func (h *Handler) UpdateAppConfig(updatedConfig app.Config) error

UpdateAppConfig update the application configuration. This requires a restart to take effect.

type HealthCheckStatus

type HealthCheckStatus string
const (
	// ServiceIsHealthy is sent when the service is healthy.
	// This event can be emitted every 15 seconds.
	ServiceIsHealthy HealthCheckStatus = "service_is_healthy"

	// ServiceIsUnhealthy is sent when the service is unhealthy, meaning we could
	// connect but the endpoint didn't answer what we expected.
	// This event can be emitted every 15 seconds.
	ServiceIsUnhealthy HealthCheckStatus = "service_is_unhealthy"

	// ServiceUnreachable is sent when no service is not running anymore.
	// This event can be emitted every 15 seconds.
	ServiceUnreachable HealthCheckStatus = "service_unreachable"

	// ServiceStopped is sent when the service has been stopped by the user.
	// This event is emitted once per service lifecycle.
	// If emitted, the `ServiceStoppedWithError` is not be emitted.
	ServiceStopped = "service_stopped"

	// ServiceStoppedWithError is sent when the service unexpectedly stopped,
	// like an internal crash, of a fail to bind the port.
	// This event is emitted once per service lifecycle.
	// If emitted, the `ServiceStopped` is not be emitted.
	ServiceStoppedWithError = "service_stopped_with_error"
)

type InitialiseAppRequest

type InitialiseAppRequest struct {
	VegaHome string `json:"vegaHome"`
}

type LatestRelease

type LatestRelease struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

type SearchForExistingConfigurationResponse

type SearchForExistingConfigurationResponse struct {
	Wallets  []string `json:"wallets"`
	Networks []string `json:"networks"`
}

type StartServiceRequest

type StartServiceRequest struct {
	Network string `json:"network"`
}

func (StartServiceRequest) Check

func (r StartServiceRequest) Check() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL