Documentation ¶
Overview ¶
Package walletdmanager handles the management of the wallet and the communication with the core wallet software
Index ¶
- Constants
- Variables
- func CreateWallet(walletFilename string, walletPassword string, ...) (err error)
- func GetPrivateKeys() (isDeterministicWallet bool, mnemonicSeed string, privateViewKey string, ...)
- func GracefullyQuitTurtleCoind()
- func GracefullyQuitWalletd()
- func OptimizeWalletWithFusion() (transactionHash string, err error)
- func RequestAddress() (address string, err error)
- func RequestAvailableBalanceToBeSpent(transferFeeString string) (availableBalance float64, err error)
- func RequestBalance() (availableBalance float64, lockedBalance float64, totalBalance float64, ...)
- func RequestConnectionInfo() (syncing string, walletBlockCount int, knownBlockCount int, ...)
- func RequestFeeinfo() (nodeFee float64, err error)
- func RequestListTransactions() (transfers []turtlecoinwalletdrpcgo.Transfer, err error)
- func SaveWallet() (err error)
- func SendTransaction(transferAddress string, transferAmountString string, transferPaymentID string, ...) (transactionHash string, err error)
- func Setup(platform string)
- func StartWalletd(walletPath string, walletPassword string, useRemoteNode bool, ...) (err error)
Constants ¶
const ( // DefaultTransferFee is the default fee. It is expressed in TRTL DefaultTransferFee float64 = 0.1 )
Variables ¶
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 turtle-service 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, mnemonicSeed string, scanHeight string) (err error)
CreateWallet calls turtle-service 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 turtle-service. 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() (isDeterministicWallet bool, mnemonicSeed string, 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 GracefullyQuitTurtleCoind ¶
func GracefullyQuitTurtleCoind()
GracefullyQuitTurtleCoind stops the TurtleCoind daemon
func GracefullyQuitWalletd ¶
func GracefullyQuitWalletd()
GracefullyQuitWalletd stops the walletd daemon
func OptimizeWalletWithFusion ¶
OptimizeWalletWithFusion sends a fusion transaction to optimize the wallet
func RequestAddress ¶
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, localDaemonBlockCount int, peerCount int, err error)
RequestConnectionInfo provides the blockchain sync status and the number of connected peers
func RequestFeeinfo ¶
RequestFeeinfo provides the additional fee requested by the remote node for each transaction
func RequestListTransactions ¶
func RequestListTransactions() (transfers []turtlecoinwalletdrpcgo.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 turtle-service 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 turtle-service 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 TurtleCoind should be run with "--load-checkpoints"
Types ¶
This section is empty.