Documentation ¶
Overview ¶
Package walletdrpc handles the the rpc connection between your app and walletd
Index ¶
- func CreateDeposit(sourceAddress string, amount float64, term int, rpcPassword string) (transactionHash string, err error)
- func EstimateFusion(threshold int, addresses []string, rpcPassword string) (fusionReadyCount int, totalOutputCount int, err error)
- func GetDeposit(id string, rpcPassword string) (amount float64, height int, intrest float64, locked bool, term int, ...)
- func GetSpendKeys(address string, rpcPassword string) (spendSecretKey string, spendPublicKey string, err error)
- func GetViewKey(rpcPassword string) (privateViewKey string, err error)
- func RequestAddress(rpcPassword string) (address string, err error)
- func RequestBalance(rpcPassword string) (availableBalance float64, lockedBalance float64, totalBalance float64, ...)
- func RequestStatus(rpcPassword string) (walletBlockCount int, knownBlockCount int, peerCount int, err error)
- func SaveWallet(rpcPassword string) (err error)
- func SendFusionTransaction(threshold int, addresses []string, destinationAddress string, ...) (transactionHash string, err error)
- func SendTransaction(addressRecipient string, amount float64, paymentID string, fee float64, ...) (transactionHash string, err error)
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDeposit ¶
func CreateDeposit(sourceAddress string, amount float64, term int, rpcPassword string) (transactionHash string, err error)
CreateDeposit creates a new deposit using an address, the amount and term expressed in blocks. i.e: term = 21900 means 21900 Blocks which is 1 Month on the Blockchain.
func EstimateFusion ¶
func EstimateFusion(threshold int, addresses []string, rpcPassword string) (fusionReadyCount int, totalOutputCount int, err error)
EstimateFusion counts the number of unspent outputs of the specified addresses and returns how many of those outputs can be optimized. This method is used to understand if a fusion transaction can be created. If fusionReadyCount returns a value = 0, then a fusion transaction cannot be created. threshold is the value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction (threshold is expressed in CCX, not 0.001 CCX). fusionReadyCount is the number of outputs that can be optimized. totalOutputCount is the total number of unspent outputs of the specified addresses.
func GetDeposit ¶
func GetDeposit(id string, rpcPassword string) (amount float64, height int, intrest float64, locked bool, term int, unlockHeight int, err error)
GetDeposit shows the details of a deposit given the depositId.
func GetSpendKeys ¶
func GetSpendKeys(address string, rpcPassword string) (spendSecretKey string, spendPublicKey string, err error)
GetSpendKeys provides the private and public spend keys
func GetViewKey ¶
GetViewKey provides the private view key
func RequestAddress ¶
RequestAddress provides the address of the current wallet
func RequestBalance ¶
func RequestBalance(rpcPassword string) (availableBalance float64, lockedBalance float64, totalBalance float64, err error)
RequestBalance provides the available and locked balances of the current wallet returned balances are expressed in CCX, not in 0.001 CCX
func RequestStatus ¶
func RequestStatus(rpcPassword string) (walletBlockCount int, knownBlockCount int, peerCount int, err error)
RequestStatus requests walletd connection and sync status
func SaveWallet ¶
SaveWallet saves the sync info in the wallet
func SendFusionTransaction ¶
func SendFusionTransaction(threshold int, addresses []string, destinationAddress string, rpcPassword string) (transactionHash string, err error)
SendFusionTransaction allows you to send a fusion transaction, by taking funds from selected addresses and transferring them to the destination address. threshold is the value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction (threshold is expressed in CCX, not 0.001 CCX). parameters amount and fee are expressed in CCX, not 0.001 CCX