backend

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewConsentRequestEvent = "new_consent_request"
	TransactionSentEvent   = "transaction_sent"
)
View Source
const (
	ReleasesAPI = "https://api.github.com/repos/vegaprotocol/vegawallet-desktop/releases"
	ReleasesURL = "https://github.com/vegaprotocol/vegawallet-desktop/releases"
)

Variables

View Source
var (
	ErrConsentRequestNotFound = errors.New("consent request not found")
	ErrTransactionNotFound    = errors.New("transaction not found")
)
View Source
var (
	ErrServiceAlreadyRunning   = errors.New("the service is already running")
	ErrServiceNotRunning       = errors.New("the service is not running")
	ErrConsoleAlreadyRunning   = errors.New("the console proxy is already running")
	ErrConsoleNotRunning       = errors.New("the console proxy is not running")
	ErrTokenDAppAlreadyRunning = errors.New("the token dApp proxy is already running")
	ErrTokenDAppNotRunning     = errors.New("the token dApp proxy is not running")
)
View Source
var (
	// Hash specifies the git commit used to build the application.
	// See VERSION_HASH in Makefile for details.
	Hash = defaultVersionHash

	// Version specifies the version used to build the application.
	// See VERSION in Makefile for details.
	Version = defaultVersion
)

Functions

func CheckCreateWalletRequest added in v0.1.0

func CheckCreateWalletRequest(req *wallet.CreateWalletRequest) error

func CheckDeleteWalletRequest added in v0.2.0

func CheckDeleteWalletRequest(req *DeleteWalletRequest) error

func CheckImportWalletRequest added in v0.1.0

func CheckImportWalletRequest(req *wallet.ImportWalletRequest) error

func CheckSignMessageRequest added in v0.1.0

func CheckSignMessageRequest(req *wallet.SignMessageRequest) error

Types

type CheckVersionResponse added in v0.1.0

type CheckVersionResponse struct {
	Version    string `json:"version"`
	ReleaseURL string `json:"releaseUrl"`
}

type ClearSentTransactionRequest added in v0.2.0

type ClearSentTransactionRequest struct {
	TxID string `json:"txId"`
}

type ConsentRequest added in v0.2.0

type ConsentRequest struct {
	TxID       string    `json:"txId"`
	Tx         string    `json:"tx"`
	ReceivedAt time.Time `json:"receivedAt"`
}

type ConsentToTransactionRequest added in v0.2.0

type ConsentToTransactionRequest struct {
	TxID     string `json:"txId"`
	Decision bool   `json:"decision"`
}

type DeleteWalletRequest added in v0.2.0

type DeleteWalletRequest struct {
	Wallet string `json:"wallet"`
}

type GetConsentRequestRequest added in v0.2.0

type GetConsentRequestRequest struct {
	TxID string `json:"txId"`
}

type GetServiceStateResponse added in v0.1.0

type GetServiceStateResponse struct {
	URL     string `json:"url"`
	Running bool   `json:"running"`
}

type GetVersionResponse

type GetVersionResponse struct {
	Version string `json:"version"`
	GitHash string `json:"gitHash"`
}

type Handler

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

func NewHandler

func NewHandler() (*Handler, error)

func (*Handler) AnnotateKey added in v0.1.0

func (h *Handler) AnnotateKey(req *wallet.AnnotateKeyRequest) error

func (*Handler) CheckVersion added in v0.1.0

func (h *Handler) CheckVersion() (*CheckVersionResponse, error)

func (*Handler) ClearSentTransaction added in v0.2.0

func (h *Handler) ClearSentTransaction(req *ClearSentTransactionRequest) error

func (*Handler) ConsentToTransaction added in v0.2.0

func (h *Handler) ConsentToTransaction(req *ConsentToTransactionRequest) error

func (*Handler) CreateWallet added in v0.1.0

func (*Handler) DOMReady

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

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

func (*Handler) DeleteWallet added in v0.2.0

func (h *Handler) DeleteWallet(req *DeleteWalletRequest) error

func (*Handler) DescribeKey added in v0.1.0

func (*Handler) GenerateKey added in v0.1.0

func (*Handler) GetAppConfig

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

GetAppConfig return the application configuration.

func (*Handler) GetConsentRequest added in v0.2.0

func (h *Handler) GetConsentRequest(req *GetConsentRequestRequest) (*ConsentRequest, error)

func (*Handler) GetConsoleState added in v0.1.0

func (h *Handler) GetConsoleState() GetServiceStateResponse

func (*Handler) GetNetworkConfig added in v0.1.0

func (h *Handler) GetNetworkConfig(name string) (*network.Network, error)

func (*Handler) GetServiceState added in v0.1.0

func (h *Handler) GetServiceState() GetServiceStateResponse

func (*Handler) GetTokenDAppState added in v0.1.0

func (h *Handler) GetTokenDAppState() GetServiceStateResponse

func (*Handler) GetVersion

func (h *Handler) GetVersion() *GetVersionResponse

func (*Handler) ImportNetwork added in v0.1.0

func (*Handler) ImportWallet added in v0.1.0

func (*Handler) InitialiseApp

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

func (*Handler) IsAppInitialised

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

func (*Handler) IsolateKey added in v0.1.0

func (*Handler) ListConsentRequests added in v0.2.0

func (h *Handler) ListConsentRequests() (*ListConsentRequestsResponse, error)

func (*Handler) ListKeys added in v0.1.0

func (*Handler) ListNetworks added in v0.1.0

func (h *Handler) ListNetworks() (*network.ListNetworksResponse, error)

func (*Handler) ListSentTransactions added in v0.2.0

func (h *Handler) ListSentTransactions() (*ListSentTransactionsResponse, error)

func (*Handler) ListWallets added in v0.1.0

func (h *Handler) ListWallets() (*wallet.ListWalletsResponse, error)

func (*Handler) SaveNetworkConfig added in v0.1.0

func (h *Handler) SaveNetworkConfig(cfg *network.Network) (bool, 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 at application termination

func (*Handler) SignMessage added in v0.1.0

func (*Handler) StartConsole added in v0.1.0

func (h *Handler) StartConsole(req *StartServiceRequest) (bool, error)

func (*Handler) StartService

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

func (*Handler) StartTokenDApp added in v0.1.0

func (h *Handler) StartTokenDApp(req *StartServiceRequest) (bool, error)

func (*Handler) Startup

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

Startup is called at application Startup

func (*Handler) StopConsole added in v0.1.0

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

func (*Handler) StopService

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

func (*Handler) StopTokenDApp added in v0.1.0

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

func (*Handler) TaintKey added in v0.1.0

func (h *Handler) TaintKey(req *wallet.TaintKeyRequest) error

func (*Handler) UntaintKey added in v0.1.0

func (h *Handler) UntaintKey(req *wallet.UntaintKeyRequest) error

func (*Handler) UpdateAppConfig

func (h *Handler) UpdateAppConfig(cfg *config.Config) error

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

type ImportWalletResponse added in v0.1.0

type ImportWalletResponse struct {
	WalletPath string
}

type InitialiseAppRequest

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

type ListConsentRequestsResponse added in v0.2.0

type ListConsentRequestsResponse struct {
	Requests []*ConsentRequest `json:"requests"`
}

type ListSentTransactionsResponse added in v0.2.0

type ListSentTransactionsResponse struct {
	Transactions []*SentTransaction `json:"transactions"`
}

type SearchForExistingConfigurationResponse

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

type SentTransaction added in v0.2.0

type SentTransaction struct {
	TxID   string    `json:"txId"`
	TxHash string    `json:"txHash"`
	Tx     string    `json:"tx"`
	SentAt time.Time `json:"sentAt"`
	Error  string    `json:"error"`
}

type StartServiceRequest

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

func (StartServiceRequest) Check

func (r StartServiceRequest) Check() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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