Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultBootstrapManifestURLs() []string
- func MigrateLegacyWallet(dataDirectory, backupPath, password string) error
- type BlockSummary
- type Config
- type Dashboard
- type PaymentPreview
- type PeerSummary
- type Service
- func (s *Service) ActualAddress() string
- func (s *Service) AddPeer(raw string) error
- func (s *Service) Address() string
- func (s *Service) Close(ctx context.Context) error
- func (s *Service) CommitPreparedPayment(expectedWallet, to string, amount, fee, maximumFee uint64, ...) error
- func (s *Service) ConfirmWalletRecovery() error
- func (s *Service) CreateWallet() (string, error)
- func (s *Service) Dashboard() (Dashboard, error)
- func (s *Service) DataDirectory() string
- func (s *Service) ExportWalletBackup(path, password string) error
- func (s *Service) FilteredTransactionHistory(limit int, filter string) ([]TransactionSummary, error)
- func (s *Service) HealthEvents(activeOnly bool, limit int) ([]ledger.HealthEvent, error)
- func (s *Service) MineOnce(ctx context.Context) (core.Block, error)
- func (s *Service) PrepareRecommendedPayment(expectedWallet, to string, amount, maximumFee uint64) (core.Transaction, uint64, error)
- func (s *Service) PreviewRecommendedPayment(expectedWallet, to string, amount uint64) (PaymentPreview, error)
- func (s *Service) PruneLedger(retainRecent uint64) (uint64, error)
- func (s *Service) RecoveryPhrase() (string, error)
- func (s *Service) RemovePeer(raw string) error
- func (s *Service) RemoveWallet(address string) error
- func (s *Service) ResolveHealthEvent(id int64) error
- func (s *Service) RestoreWalletBackup(path, password string) (string, error)
- func (s *Service) RestoreWalletMnemonic(phrase string) (string, error)
- func (s *Service) Send(to, amountText, feeText string) (core.Transaction, error)
- func (s *Service) SendRecommended(to, amountText string) (core.Transaction, uint64, error)
- func (s *Service) SendRecommendedFrom(expectedWallet, to string, amount, maximumFee uint64) (core.Transaction, uint64, error)
- func (s *Service) Start(parent context.Context) error
- func (s *Service) StartMining() error
- func (s *Service) StopMining()
- func (s *Service) SwitchWallet(address string) error
- func (s *Service) TransactionHistory(limit int) ([]TransactionSummary, error)
- func (s *Service) WalletProfiles() ([]WalletProfile, error)
- type TransactionInputSummary
- type TransactionOutputSummary
- type TransactionSummary
- type WalletProfile
Constants ¶
View Source
const DefaultListenAddress = "0.0.0.0:47821"
Variables ¶
View Source
var ( ErrPaymentWalletChanged = errors.New("active wallet changed after payment review") ErrPaymentFeeExceeded = errors.New("payment fee exceeds the reviewed ceiling") ErrWalletRecoveryRequired = errors.New("wallet recovery must be secured before Agent Pay") )
View Source
var ErrLegacyWalletMigrationRequired = errors.New("legacy wallet requires encrypted migration")
View Source
var ErrProtectedWalletBackupPath = errors.New("wallet backup destination conflicts with node data")
View Source
var ErrWalletChangedDuringBackup = errors.New("wallet changed while backup was being exported")
Functions ¶
func DefaultBootstrapManifestURLs ¶
func DefaultBootstrapManifestURLs() []string
DefaultBootstrapManifestURLs returns independent delivery paths for the public seed list. Both sources contain the same small, versioned document.
func MigrateLegacyWallet ¶
Types ¶
type BlockSummary ¶
type Config ¶
type Config struct {
DataDirectory string
ListenAddress string
SyncInterval time.Duration
DisableDiscovery bool
SeedMode bool
PruneDepth uint64
PruneDepthSet bool
InitialPruneDepth uint64
FallbackPort bool
BootstrapPeers []string
BootstrapManifestURLs []string
MaxOutboundPeers int
TrustLoopbackProxy bool
}
type Dashboard ¶
type Dashboard struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Protocol string `json:"protocol"`
ConsensusVersion uint32 `json:"consensus_version"`
ConsensusActivation uint64 `json:"consensus_activation"`
Address string `json:"address"`
ConfirmedBalance string `json:"confirmed_balance"`
SpendableBalance string `json:"spendable_balance"`
Height uint64 `json:"height"`
TipHash string `json:"tip_hash"`
Difficulty uint8 `json:"difficulty"`
PendingCount int `json:"pending_count"`
PeerCount int `json:"peer_count"`
ConfiguredPeerCount int `json:"configured_peer_count"`
Peers []PeerSummary `json:"peers"`
Mining bool `json:"mining"`
Syncing bool `json:"syncing"`
BestPeerHeight uint64 `json:"best_peer_height"`
ListenAddress string `json:"listen_address"`
Issued string `json:"issued"`
MaxSupply string `json:"max_supply"`
TargetBlockSeconds int `json:"target_block_seconds"`
EmissionBlocks uint64 `json:"emission_blocks"`
NextSubsidy string `json:"next_subsidy"`
LastError string `json:"last_error"`
DatabasePath string `json:"database_path"`
DatabaseBytes int64 `json:"database_bytes"`
PrunedThrough uint64 `json:"pruned_through"`
PruneDepth uint64 `json:"prune_depth"`
ArchiveMode bool `json:"archive_mode"`
WalletNeedsBackup bool `json:"wallet_needs_backup"`
Wallets []WalletProfile `json:"wallets"`
BootstrapEnabled bool `json:"bootstrap_enabled"`
BootstrapReady bool `json:"bootstrap_ready"`
BootstrapLastUpdate int64 `json:"bootstrap_last_update,omitempty"`
BootstrapError string `json:"bootstrap_error,omitempty"`
RecentBlocks []BlockSummary `json:"recent_blocks"`
}
type PaymentPreview ¶ added in v1.5.2
type PaymentPreview struct {
Wallet string `json:"wallet"`
Recipient string `json:"recipient"`
Amount uint64 `json:"amount"`
EstimatedFee uint64 `json:"estimated_fee"`
MaximumFee uint64 `json:"maximum_fee"`
TotalDebit uint64 `json:"total_debit"`
SpendableBalance uint64 `json:"spendable_balance"`
HasSufficientFunds bool `json:"has_sufficient_funds"`
WalletNeedsBackup bool `json:"wallet_needs_backup"`
}
type PeerSummary ¶
type PeerSummary struct {
URL string `json:"url"`
Online bool `json:"online"`
Height uint64 `json:"height"`
Failures int `json:"failures"`
LastError string `json:"last_error,omitempty"`
Discovered bool `json:"discovered"`
Public bool `json:"public"`
Bootstrap bool `json:"bootstrap"`
ActiveOutbound bool `json:"active_outbound"`
LastSeen int64 `json:"last_seen,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ActualAddress ¶
func (*Service) CommitPreparedPayment ¶ added in v1.5.2
func (*Service) ConfirmWalletRecovery ¶
func (*Service) CreateWallet ¶
func (*Service) DataDirectory ¶ added in v1.5.2
func (*Service) ExportWalletBackup ¶
func (*Service) FilteredTransactionHistory ¶ added in v1.0.10
func (s *Service) FilteredTransactionHistory(limit int, filter string) ([]TransactionSummary, error)
func (*Service) HealthEvents ¶
func (*Service) PrepareRecommendedPayment ¶ added in v1.5.2
func (*Service) PreviewRecommendedPayment ¶ added in v1.5.2
func (s *Service) PreviewRecommendedPayment(expectedWallet, to string, amount uint64) (PaymentPreview, error)
func (*Service) RecoveryPhrase ¶
func (*Service) RemovePeer ¶
func (*Service) RemoveWallet ¶
func (*Service) ResolveHealthEvent ¶
func (*Service) RestoreWalletBackup ¶
func (*Service) RestoreWalletMnemonic ¶
func (*Service) Send ¶
func (s *Service) Send(to, amountText, feeText string) (core.Transaction, error)
func (*Service) SendRecommended ¶
func (*Service) SendRecommendedFrom ¶ added in v1.5.2
func (*Service) StartMining ¶
func (*Service) StopMining ¶
func (s *Service) StopMining()
func (*Service) SwitchWallet ¶
func (*Service) TransactionHistory ¶
func (s *Service) TransactionHistory(limit int) ([]TransactionSummary, error)
func (*Service) WalletProfiles ¶
func (s *Service) WalletProfiles() ([]WalletProfile, error)
type TransactionInputSummary ¶
type TransactionSummary ¶
type TransactionSummary struct {
ID string `json:"id"`
BlockHeight *uint64 `json:"block_height,omitempty"`
BlockHash string `json:"block_hash,omitempty"`
BlockPosition *int `json:"block_position,omitempty"`
Pending bool `json:"pending"`
Coinbase bool `json:"coinbase"`
Pruned bool `json:"pruned"`
Confirmations uint64 `json:"confirmations"`
Timestamp int64 `json:"timestamp"`
Received string `json:"received"`
Sent string `json:"sent"`
Inputs []TransactionInputSummary `json:"inputs"`
Outputs []TransactionOutputSummary `json:"outputs"`
}
type WalletProfile ¶
Click to show internal directories.
Click to hide internal directories.