walletdmanager

package
v0.0.0-...-62d5d67 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package walletdmanager handles the management of the wallet and the communication with the core wallet software

Index

Constants

View Source
const (
	// DefaultTransferFee is the default fee. It is expressed in CCX
	DefaultTransferFee float64 = 0.001
)

Variables

View Source
var (
	// WalletAvailableBalance is the available balance
	WalletAvailableBalance float64

	// WalletAddress is the wallet address
	WalletAddress string

	// WalletFilename is the filename of the opened wallet
	WalletFilename = ""

	// WalletdOpenAndRunning is true when walletd is running with a wallet open
	WalletdOpenAndRunning = false

	// WalletdSynced is true when wallet is synced and transfer is allowed
	WalletdSynced = false

	// fee to be paid to node per transaction
	NodeFee float64
)

Functions

func CreateWallet

func CreateWallet(walletFilename string, walletPassword string, walletPasswordConfirmation string, privateViewKey string, privateSpendKey string, scanHeight string) (err error)

CreateWallet calls walletd to create a new wallet. If privateViewKey, privateSpendKey and mnemonicSeed are empty strings, a new wallet will be generated. If they are not empty, a wallet will be generated from those keys or from the seed (import) walletFilename is the filename chosen by the user. The created wallet file will be located in the same folder as walletd. walletPassword is the password of the new wallet. walletPasswordConfirmation is the repeat of the password for confirmation that the password was correctly entered. privateViewKey is the private view key of the wallet. privateSpendKey is the private spend key of the wallet. mnemonicSeed is the mnemonic seed for generating the wallet

func GetPrivateKeys

func GetPrivateKeys() (privateViewKey string, privateSpendKey string, err error)

GetPrivateKeys provides the private view and spend keys of the current wallet, and the mnemonic seed if the wallet is deterministic

func GracefullyQuitConceald

func GracefullyQuitConceald()

GracefullyQuitConceald stops the conceald daemon

func GracefullyQuitWalletd

func GracefullyQuitWalletd()

GracefullyQuitWalletd stops the walletd daemon

func OptimizeWalletWithFusion

func OptimizeWalletWithFusion() (transactionHash string, err error)

OptimizeWalletWithFusion sends a fusion transaction to optimize the wallet

func RequestAddress

func RequestAddress() (address string, err error)

RequestAddress provides the address of the current wallet

func RequestAvailableBalanceToBeSpent

func RequestAvailableBalanceToBeSpent(transferFeeString string) (availableBalance float64, err error)

RequestAvailableBalanceToBeSpent returns the available balance minus the fee

func RequestBalance

func RequestBalance() (availableBalance float64, lockedBalance float64, totalBalance float64, err error)

RequestBalance provides the available and locked balances of the current wallet

func RequestConnectionInfo

func RequestConnectionInfo() (syncing string, walletBlockCount int, knownBlockCount int, peerCount int, err error)

RequestConnectionInfo provides the blockchain sync status and the number of connected peers

func RequestListTransactions

func RequestListTransactions() (transfers []walletdrpc.Transfer, err error)

RequestListTransactions provides the list of transactions of current wallet

func SaveWallet

func SaveWallet() (err error)

SaveWallet saves the sync status of the wallet. To be done regularly so when walletd crashes, sync is not lost

func SendTransaction

func SendTransaction(transferAddress string, transferAmountString string, transferPaymentID string, transferFeeString string) (transactionHash string, err error)

SendTransaction makes a transfer with the provided information

func Setup

func Setup(platform string)

Setup sets up some settings. It must be called at least once at the beginning of your program. platform should be set based on your platform. The choices are "linux", "darwin", "windows"

func StartWalletd

func StartWalletd(walletPath string, walletPassword string, useRemoteNode bool, useCheckpoints bool, daemonAddress string, daemonPort string) (err error)

StartWalletd starts the walletd daemon with the set wallet info walletPath is the full path to the wallet walletPassword is the wallet password useRemoteNode is true if remote node, false if local useCheckpoints is true if Conceald should be run with "--load-checkpoints"

Types

This section is empty.

Jump to

Keyboard shortcuts

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