turtlecoinwalletdrpcgo

package
v0.0.0-...-3caa860 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package turtlecoinwalletdrpcgo handles the the rpc connection between your app and turtle-service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 TRTL, not 0.01 TRTL). fusionReadyCount is the number of outputs that can be optimized. totalOutputCount is the total number of unspent outputs of the specified addresses.

func GetFeeInfo

func GetFeeInfo(rpcPassword string) (address string, fee float64, status string, err error)

GetFeeInfo returns info on the fee requested by the remote node for every transactions returned fee is expressed in TRTL, not in 0.01 TRTL

func GetMnemonicSeed

func GetMnemonicSeed(address string, rpcPassword string) (isDeterministicWallet bool, mnemonicSeed string, err error)

GetMnemonicSeed provides the mnemonic seed.

func GetSpendKeys

func GetSpendKeys(address string, rpcPassword string) (spendSecretKey string, spendPublicKey string, err error)

GetSpendKeys provides the private and public spend keys

func GetViewKey

func GetViewKey(rpcPassword string) (privateViewKey string, err error)

GetViewKey provides the private view key

func RequestAddress

func RequestAddress(rpcPassword string) (address string, err error)

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 TRTL, not in 0.01 TRTL

func RequestStatus

func RequestStatus(rpcPassword string) (walletBlockCount int, knownBlockCount int, localDaemonBlockCount int, peerCount int, err error)

RequestStatus requests turtle-service connection and sync status

func SaveWallet

func SaveWallet(rpcPassword string) (err error)

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 TRTL, not 0.01 TRTL). parameters amount and fee are expressed in TRTL, not 0.01 TRTL

func SendTransaction

func SendTransaction(addressRecipient string, amount float64, paymentID string, fee float64, rpcPassword string) (transactionHash string, err error)

SendTransaction makes a transfer with the provided information. parameters amount and fee are expressed in TRTL, not 0.01 TRTL

Types

type Transfer

type Transfer struct {
	PaymentID              string
	TxID                   string
	Timestamp              time.Time
	Amount                 float64
	Fee                    float64
	Block                  int
	Confirmations          int
	IsRecievingTransaction bool
}

Transfer contains all the information about a specific transfer

func RequestListTransactions

func RequestListTransactions(blockCount int, firstBlockIndex int, addresses []string, rpcPassword string) (transfers []Transfer, err error)

RequestListTransactions provides the list of transactions of current wallet

Jump to

Keyboard shortcuts

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