backend

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 43 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 LEGAL_DISCLAIMER = `` /* 1881-byte string literal not displayed */
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")
	ErrServiceIsNotRunning = errors.New("the service is not running")
)
View Source
var (
	ErrBackendNotStarted   = errors.New("the application backend is not started")
	ErrAppIsNotInitialised = errors.New("the application has not been initialised")
)
View Source
var (
	ErrContextCanceled       = errors.New("context canceled")
	ErrServiceAlreadyRunning = errors.New("the service is already running")
)
View Source
var DefaultNetworks = []DefaultNetwork{}
View Source
var ErrAPIv1Unsupported = errors.New("sending transactions through the API v1 is no longer supported")
View Source
var ErrNoChanResponseForTraceID = errors.New("no response expected for that traceID")

Functions

This section is empty.

Types

type DefaultNetwork added in v0.2.3

type DefaultNetwork struct {
	Name string
	URL  string
}

type GetCurrentServiceInfo added in v0.3.0

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.GetSoftwareVersionResponse         `json:"backend"`
	Compatibility *wversion.CheckSoftwareCompatibilityResponse `json:"networksCompatibility"`
}

type Handler

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

func NewHandler

func NewHandler(icon []byte) *Handler

func (*Handler) APIV2DeleteAPIToken added in v0.8.0

func (h *Handler) APIV2DeleteAPIToken(token string) error

func (*Handler) APIV2DescribeAPIToken added in v0.8.0

func (h *Handler) APIV2DescribeAPIToken(token string) (connections.TokenDescription, error)

func (*Handler) APIV2GenerateAPIToken added in v0.8.0

func (h *Handler) APIV2GenerateAPIToken(params connections.GenerateAPITokenParams) (connections.Token, error)

func (*Handler) APIV2ListAPITokens added in v0.8.0

func (h *Handler) APIV2ListAPITokens() (connections.ListAPITokensResult, error)

func (*Handler) AppMenu added in v0.9.0

func (h *Handler) AppMenu() *menu.Menu

func (*Handler) ChooseFolder added in v0.11.2

func (h *Handler) ChooseFolder() (string, error)

func (*Handler) DOMReady

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

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

func (*Handler) GetAppConfig added in v0.2.0

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

GetAppConfig return the application configuration.

func (*Handler) GetCurrentServiceInfo added in v0.3.0

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

func (*Handler) GetLatestRelease added in v0.3.0

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

func (*Handler) GetServiceConfig added in v0.9.0

func (h *Handler) GetServiceConfig() (service.Config, 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 added in v0.3.0

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

func (*Handler) SearchForExistingConfiguration added in v0.1.1

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) (err error)

func (*Handler) Startup

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

Startup is called during application startup

func (*Handler) StartupBackend added in v0.8.3

func (h *Handler) StartupBackend() (err error)

func (*Handler) StopService

func (h *Handler) StopService()

func (*Handler) SubmitWalletAPIRequest added in v0.3.0

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

func (*Handler) SuggestFairgroundFolder added in v0.11.2

func (h *Handler) SuggestFairgroundFolder() string

func (*Handler) UpdateAppConfig added in v0.2.0

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

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

func (*Handler) UpdateServiceConfig added in v0.9.0

func (h *Handler) UpdateServiceConfig(cfg service.Config) error

type HealthCheckStatus added in v0.3.0

type HealthCheckStatus string
const (
	// UnknownStatus is used when the service health check is not yet known.
	UnknownStatus HealthCheckStatus = "unknown_status"

	// 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 added in v0.2.0

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

type LatestRelease added in v0.3.0

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

type SearchForExistingConfigurationResponse added in v0.1.1

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

type ServiceStarter added in v0.9.0

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

func NewServiceStarter added in v0.9.0

func NewServiceStarter(vegaPaths paths.Paths, log *zap.Logger, svcStore *svcStoreV1.Store, walletStore walletapi.WalletStore, netStore walletapi.NetworkStore, connectionsManager *connections.Manager, apiInteractor walletapi.Interactor, receptionChan <-chan interactor.Interaction) (*ServiceStarter, error)

func (*ServiceStarter) Close added in v0.9.0

func (s *ServiceStarter) Close()

func (*ServiceStarter) Info added in v0.9.0

func (*ServiceStarter) IsServiceRunning added in v0.9.0

func (s *ServiceStarter) IsServiceRunning() bool

func (*ServiceStarter) RespondToInteraction added in v0.12.4

func (s *ServiceStarter) RespondToInteraction(interaction interactor.Interaction) error

func (*ServiceStarter) ServiceHealth added in v0.9.0

func (s *ServiceStarter) ServiceHealth() HealthCheckStatus

func (*ServiceStarter) StartService added in v0.9.0

func (s *ServiceStarter) StartService(ctx context.Context, network string) (err error)

func (*ServiceStarter) StopService added in v0.9.0

func (s *ServiceStarter) StopService()

type StartServiceRequest

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

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