Documentation
¶
Index ¶
- type ActivityItem
- type ActivityResult
- type AddressResult
- type BackupResult
- type CleanupPreview
- type CleanupRequest
- type Config
- type MaxSendRequest
- type MinerService
- type MinerStartRequest
- type MinerStatus
- type PreviewCancelService
- type PublicError
- type RecoveryPhraseResult
- type RecoveryWalletCreateRequest
- type RecoveryWalletCreateResult
- type RecoveryWalletLockService
- type RecoveryWalletRestoreRequest
- type RecoveryWalletService
- type RecoveryWalletUnlockRequest
- type SendPreview
- type SendRequest
- type SendResult
- type Server
- type Service
- type Status
- type WalletFeaturesService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityItem ¶ added in v0.1.32
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 MaxSendRequest ¶ added in v0.1.32
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 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"`
BlocksAccepted uint64 `json:"blocks_accepted"`
Height int64 `json:"height"`
LastBlockID string `json:"last_block_id"`
LastError string `json:"last_error"`
RetryInSeconds int64 `json:"retry_in_seconds"`
}
type PreviewCancelService ¶ added in v0.1.32
PreviewCancelService releases the inputs held by a payment or cleanup review when the user goes back without broadcasting it.
type PublicError ¶
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 RecoveryWalletLockService ¶ added in v0.1.34
RecoveryWalletLockService lets a native shell explicitly wipe the cached unlock secret without closing the whole application.
type RecoveryWalletRestoreRequest ¶ added in v0.1.27
type RecoveryWalletService ¶ added in v0.1.27
type RecoveryWalletService interface {
CreateRecoveryWallet(context.Context, RecoveryWalletCreateRequest) (RecoveryWalletCreateResult, error)
RestoreRecoveryWallet(context.Context, RecoveryWalletRestoreRequest) (Status, error)
UnlockRecoveryWallet(context.Context, RecoveryWalletUnlockRequest) (Status, error)
RecoveryPhrase(context.Context, RecoveryWalletUnlockRequest) (RecoveryPhraseResult, error)
}
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 SendResult ¶
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.