desktop

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityItem added in v0.1.32

type ActivityItem struct {
	TxID              string `json:"txid"`
	Kind              string `json:"kind"`
	Status            string `json:"status"`
	NetUnits          int64  `json:"net_units"`
	BlockHeight       int64  `json:"block_height"`
	Confirmations     int64  `json:"confirmations"`
	BlocksUntilMature int64  `json:"blocks_until_mature"`
}

type ActivityResult added in v0.1.32

type ActivityResult struct {
	Height int64          `json:"height"`
	Items  []ActivityItem `json:"items"`
}

type AddressResult

type AddressResult struct {
	Address string `json:"address"`
}

type BackupResult

type BackupResult struct {
	Destination string `json:"destination"`
}

type CleanupPreview added in v0.1.32

type CleanupPreview struct {
	PendingID        string `json:"pending_id"`
	Address          string `json:"address"`
	AmountUnits      int64  `json:"amount_units"`
	FeeUnits         int64  `json:"fee_units"`
	InputCount       int    `json:"input_count"`
	MoreAvailable    bool   `json:"more_available"`
	TxID             string `json:"txid"`
	ChainHeight      int64  `json:"chain_height"`
	ExpiresAtUnix    int64  `json:"expires_at_unix"`
	ConfirmationCode string `json:"confirmation_code"`
}

type CleanupRequest added in v0.1.32

type CleanupRequest struct {
	Fee string `json:"fee"`
}

type Config

type Config struct {
	LaunchToken string
	Origin      string
	Version     string
	Service     Service
}

type MaxSendRequest added in v0.1.32

type MaxSendRequest struct {
	Destination string `json:"destination"`
	Fee         string `json:"fee"`
}

type MinerService added in v0.1.25

type MinerService interface {
	MinerStatus(context.Context) (MinerStatus, error)
	StartMiner(context.Context, MinerStartRequest) (MinerStatus, error)
	StopMiner(context.Context) (MinerStatus, error)
}

MinerService is optional. Wallet-only services do not need to implement it.

type MinerStartRequest added in v0.1.25

type MinerStartRequest struct {
	Workers int    `json:"workers"`
	Worker  string `json:"worker"`
}

type MinerStatus added in v0.1.25

type MinerStatus struct {
	Available         bool    `json:"available"`
	WalletReady       bool    `json:"wallet_ready"`
	State             string  `json:"state"`
	Address           string  `json:"address"`
	Worker            string  `json:"worker"`
	Workers           int     `json:"workers"`
	LogicalCPUs       int     `json:"logical_cpus"`
	CurrentHashrate   float64 `json:"current_hashrate"`
	AverageHashrate   float64 `json:"average_hashrate"`
	TotalHashes       uint64  `json:"total_hashes"`
	ElapsedSeconds    int64   `json:"elapsed_seconds"`
	Jobs              uint64  `json:"jobs"`
	Reconnects        uint64  `json:"reconnects"`
	MiningMode        string  `json:"mining_mode"`
	PoolFeeBPS        int     `json:"pool_fee_bps"`
	SharesAccepted    uint64  `json:"shares_accepted"`
	BlocksAccepted    uint64  `json:"blocks_accepted"`
	Height            int64   `json:"height"`
	LastBlockID       string  `json:"last_block_id"`
	LastShareSequence uint64  `json:"last_share_sequence"`
	LastError         string  `json:"last_error"`
	RetryInSeconds    int64   `json:"retry_in_seconds"`
}

type PreviewCancelService added in v0.1.32

type PreviewCancelService interface {
	CancelPreview(context.Context, string) error
}

PreviewCancelService releases the inputs held by a payment or cleanup review when the user goes back without broadcasting it.

type PublicError

type PublicError struct {
	HTTPStatus int
	Code       string
	Message    string
	Cause      error
}

func (*PublicError) Error

func (e *PublicError) Error() string

func (*PublicError) Unwrap

func (e *PublicError) Unwrap() error

type RecoveryPhraseResult added in v0.1.27

type RecoveryPhraseResult struct {
	RecoveryPhrase string `json:"recovery_phrase"`
}

type RecoveryWalletCreateRequest added in v0.1.27

type RecoveryWalletCreateRequest struct {
	Password string `json:"password"`
}

type RecoveryWalletCreateResult added in v0.1.27

type RecoveryWalletCreateResult struct {
	Status         Status `json:"status"`
	RecoveryPhrase string `json:"recovery_phrase"`
}

type RecoveryWalletLockService added in v0.1.34

type RecoveryWalletLockService interface {
	LockRecoveryWallet(context.Context) (Status, error)
}

RecoveryWalletLockService lets a native shell explicitly wipe the cached unlock secret without closing the whole application.

type RecoveryWalletRestoreRequest added in v0.1.27

type RecoveryWalletRestoreRequest struct {
	Password       string `json:"password"`
	RecoveryPhrase string `json:"recovery_phrase"`
}

type RecoveryWalletService added in v0.1.27

RecoveryWalletService is implemented by desktop services that support the encrypted deterministic Wallet V2 format. Keeping it optional preserves compatibility with minimal wallet-only service implementations.

type RecoveryWalletUnlockRequest added in v0.1.27

type RecoveryWalletUnlockRequest struct {
	Password string `json:"password"`
}

type SendPreview

type SendPreview struct {
	PendingID        string   `json:"pending_id"`
	Destination      string   `json:"destination"`
	AmountUnits      int64    `json:"amount_units"`
	FeeUnits         int64    `json:"fee_units"`
	TotalUnits       int64    `json:"total_units"`
	TxID             string   `json:"txid"`
	SelectedInputs   []string `json:"selected_inputs"`
	ChainHeight      int64    `json:"chain_height"`
	ExpiresAtUnix    int64    `json:"expires_at_unix"`
	ConfirmationCode string   `json:"confirmation_code"`
}

type SendRequest

type SendRequest struct {
	Destination string `json:"destination"`
	Amount      string `json:"amount"`
	Fee         string `json:"fee"`
}

type SendResult

type SendResult struct {
	TxID       string `json:"txid"`
	Status     string `json:"status"`
	PeerWrites int    `json:"peer_writes"`
}

type Server

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

func NewServer

func NewServer(config Config) (*Server, error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Service

type Service interface {
	Status(context.Context) (Status, error)
	CreateWallet(context.Context) (Status, error)
	NewAddress(context.Context) (AddressResult, error)
	Backup(context.Context, string) (BackupResult, error)
	PreviewSend(context.Context, SendRequest) (SendPreview, error)
	ConfirmSend(context.Context, string) (SendResult, error)
}

type Status

type Status struct {
	Version              string   `json:"version"`
	Network              string   `json:"network"`
	Mode                 string   `json:"mode"`
	WalletExists         bool     `json:"wallet_exists"`
	WalletVersion        int      `json:"wallet_version"`
	NeedsUnlock          bool     `json:"needs_unlock"`
	WalletPath           string   `json:"wallet_path"`
	Addresses            []string `json:"addresses"`
	BalanceUnits         int64    `json:"balance_units"`
	ImmatureUnits        int64    `json:"immature_units"`
	SpendableOutputCount int      `json:"spendable_output_count"`
	CleanupAvailable     bool     `json:"cleanup_available"`
	CleanupRecommended   bool     `json:"cleanup_recommended"`
	BalanceAvailable     bool     `json:"balance_available"`
	Height               int64    `json:"height"`
	TipHash              string   `json:"tip_hash"`
	PeerCount            int      `json:"peer_count"`
	SyncState            string   `json:"sync_state"`
	SendAvailable        bool     `json:"send_available"`
	MiningAvailable      bool     `json:"mining_available"`
}

type WalletFeaturesService added in v0.1.32

type WalletFeaturesService interface {
	Activity(context.Context) (ActivityResult, error)
	PreviewMaxSend(context.Context, MaxSendRequest) (SendPreview, error)
	PreviewCleanup(context.Context, CleanupRequest) (CleanupPreview, error)
	ConfirmCleanup(context.Context, string) (SendResult, error)
}

WalletFeaturesService is optional so older embedded service implementations remain source-compatible while the desktop server exposes richer wallet UI.

Jump to

Keyboard shortcuts

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