Documentation ¶
Index ¶
- func PrettyPrint(response interface{})
- type TurtleCoind
- func (daemon *TurtleCoind) Fee() (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlock(hash string) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlockCount() (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlockHash(height int) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlockHeaderByHash(hash string) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlockHeaderByHeight(height int) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlockTemplate(reserveSize int, walletAddress string) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetBlocks(height int) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetCurrencyID() (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetLastBlockHeader() (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetTransaction(hash string) (map[string]interface{}, error)
- func (daemon *TurtleCoind) GetTransactionPool() (map[string]interface{}, error)
- func (daemon *TurtleCoind) Height() (map[string]interface{}, error)
- func (daemon *TurtleCoind) Info() (map[string]interface{}, error)
- func (daemon *TurtleCoind) Peers() (map[string]interface{}, error)
- func (daemon *TurtleCoind) SubmitBlock(blockBlob string) (map[string]interface{}, error)
- type WalletAPI
- func (wallet *WalletAPI) Addresses() (map[string]interface{}, error)
- func (wallet *WalletAPI) Balance(address string) (map[string]interface{}, error)
- func (wallet *WalletAPI) Balances() ([]map[string]interface{}, error)
- func (wallet *WalletAPI) CloseWallet() error
- func (wallet *WalletAPI) CreateAddress() (map[string]interface{}, error)
- func (wallet *WalletAPI) CreateIntegratedAddress(address string, paymentID string) (map[string]interface{}, error)
- func (wallet *WalletAPI) CreateWallet(filename string, password string) error
- func (wallet *WalletAPI) DeleteAddress(address string) error
- func (wallet *WalletAPI) GetNodeDetails() (map[string]interface{}, error)
- func (wallet *WalletAPI) GetTransactionDetails(hash string) (map[string]interface{}, error)
- func (wallet *WalletAPI) ImportAddress(scanHeight int, spendKey string) (map[string]interface{}, error)
- func (wallet *WalletAPI) ImportKey(filename string, password string, scanHeight int, spendKey string, ...) error
- func (wallet *WalletAPI) ImportSeed(filename string, password string, scanHeight int, mnemonicSeed string) error
- func (wallet *WalletAPI) ImportViewAddress(scanHeight int, spendKey string) (map[string]interface{}, error)
- func (wallet *WalletAPI) ImportViewOnly(filename string, password string, scanHeight int, viewkey string, ...) error
- func (wallet *WalletAPI) Keys(address string) (map[string]interface{}, error)
- func (wallet *WalletAPI) MnemonicSeed(address string) (map[string]interface{}, error)
- func (wallet *WalletAPI) OpenWallet(filename string, password string) error
- func (wallet *WalletAPI) Primary() (map[string]interface{}, error)
- func (wallet *WalletAPI) PrivateViewKey() (map[string]interface{}, error)
- func (wallet *WalletAPI) Reset(scanHeight int) error
- func (wallet *WalletAPI) Save() error
- func (wallet *WalletAPI) SendAdvancedFusion(mixin int, sourceAddress []string, destinationAddress string) (map[string]interface{}, error)
- func (wallet *WalletAPI) SendAdvancedTransaction(destinations []map[string]interface{}, mixin int, fee int, ...) (map[string]interface{}, error)
- func (wallet *WalletAPI) SendBasicFusion() (map[string]interface{}, error)
- func (wallet *WalletAPI) SendBasicTransaction(destinationAddress string, amount int, paymentID string) (map[string]interface{}, error)
- func (wallet *WalletAPI) SetNode(daemonHost string, daemonPort int, daemonSSL bool) error
- func (wallet *WalletAPI) Status() (map[string]interface{}, error)
- func (wallet *WalletAPI) TotalBalance() (map[string]interface{}, error)
- func (wallet *WalletAPI) TransactionPrivateKey(hash string) (map[string]interface{}, error)
- func (wallet *WalletAPI) Transactions(startHeight int, endHeight int) (map[string]interface{}, error)
- func (wallet *WalletAPI) TransactionsByAddress(address string, startHeight int, endHeight int) (map[string]interface{}, error)
- func (wallet *WalletAPI) UnconfirmedTransactions(address string) (map[string]interface{}, error)
- func (wallet *WalletAPI) ValidateAddress(address string) (map[string]interface{}, error)
- type Walletd
- func (wallet *Walletd) CreateAddress(spendSecretKey string, spendPublicKey string, scanHeight int, newAddress bool) (map[string]interface{}, error)
- func (wallet *Walletd) CreateDelayedTransaction(addresses []string, transfers []map[string]interface{}, fee int, ...) (map[string]interface{}, error)
- func (wallet *Walletd) CreateIntegratedAddress(address string, paymentID string) (map[string]interface{}, error)
- func (wallet *Walletd) DeleteAddress(address string) (map[string]interface{}, error)
- func (wallet *Walletd) DeleteDelayedTransaction(transactionHash string) (map[string]interface{}, error)
- func (wallet *Walletd) EstimateFusion(threshold int, addresses []string) (map[string]interface{}, error)
- func (wallet *Walletd) GetAddresses() (map[string]interface{}, error)
- func (wallet *Walletd) GetBalance(address string) (map[string]interface{}, error)
- func (wallet *Walletd) GetBlockHashes(firstBlockIndex int, blockCount int) (map[string]interface{}, error)
- func (wallet *Walletd) GetDelayedTransactionHashes() (map[string]interface{}, error)
- func (wallet *Walletd) GetFeeInfo() (map[string]interface{}, error)
- func (wallet *Walletd) GetMnemonicSeed(address string) (map[string]interface{}, error)
- func (wallet *Walletd) GetSpendKeys(address string) (map[string]interface{}, error)
- func (wallet *Walletd) GetStatus() (map[string]interface{}, error)
- func (wallet *Walletd) GetTransaction(transactionHash string) (map[string]interface{}, error)
- func (wallet *Walletd) GetTransactionHashes(addresses []string, blockHash string, firstBlockIndex int, blockCount int, ...) (map[string]interface{}, error)
- func (wallet *Walletd) GetTransactions(addresses []string, blockHash string, firstBlockIndex int, blockCount int, ...) (map[string]interface{}, error)
- func (wallet *Walletd) GetUnconfirmedTransactionHashes(addresses []string) (map[string]interface{}, error)
- func (wallet *Walletd) GetViewKey() (map[string]interface{}, error)
- func (wallet *Walletd) Reset(scanHeight int) (map[string]interface{}, error)
- func (wallet *Walletd) Save() (map[string]interface{}, error)
- func (wallet *Walletd) SendDelayedTransaction(transactionHash string) (map[string]interface{}, error)
- func (wallet *Walletd) SendFusionTransaction(threshold int, addresses []string, destinationAddress string) (map[string]interface{}, error)
- func (wallet *Walletd) SendTransaction(addresses []string, transfers []map[string]interface{}, fee int, ...) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyPrint ¶
func PrettyPrint(response interface{})
PrettyPrint prints the given map as a JSON object
Types ¶
type TurtleCoind ¶
TurtleCoind structure contains the URL and Port info of node for RPC calls
func (*TurtleCoind) Fee ¶
func (daemon *TurtleCoind) Fee() (map[string]interface{}, error)
Fee method returns the fee set by the node
func (*TurtleCoind) GetBlock ¶
func (daemon *TurtleCoind) GetBlock(hash string) (map[string]interface{}, error)
GetBlock method returns the information of block corresponding to given input hash
func (*TurtleCoind) GetBlockCount ¶
func (daemon *TurtleCoind) GetBlockCount() (map[string]interface{}, error)
GetBlockCount method returns the height of the top block
func (*TurtleCoind) GetBlockHash ¶
func (daemon *TurtleCoind) GetBlockHash(height int) (map[string]interface{}, error)
GetBlockHash method returns the block hash by height
func (*TurtleCoind) GetBlockHeaderByHash ¶
func (daemon *TurtleCoind) GetBlockHeaderByHash(hash string) (map[string]interface{}, error)
GetBlockHeaderByHash method returns the block header corresponding to the input block hash
func (*TurtleCoind) GetBlockHeaderByHeight ¶
func (daemon *TurtleCoind) GetBlockHeaderByHeight(height int) (map[string]interface{}, error)
GetBlockHeaderByHeight method returns the block header corresponding to the input block height
func (*TurtleCoind) GetBlockTemplate ¶
func (daemon *TurtleCoind) GetBlockTemplate(reserveSize int, walletAddress string) (map[string]interface{}, error)
GetBlockTemplate method returns the block template blob of the last block
func (*TurtleCoind) GetBlocks ¶
func (daemon *TurtleCoind) GetBlocks(height int) (map[string]interface{}, error)
GetBlocks method returns information on 30 blocks from specified height (inclusive)
func (*TurtleCoind) GetCurrencyID ¶
func (daemon *TurtleCoind) GetCurrencyID() (map[string]interface{}, error)
GetCurrencyID method returns the currency id of the network
func (*TurtleCoind) GetLastBlockHeader ¶
func (daemon *TurtleCoind) GetLastBlockHeader() (map[string]interface{}, error)
GetLastBlockHeader method returns the block header of the last block
func (*TurtleCoind) GetTransaction ¶
func (daemon *TurtleCoind) GetTransaction(hash string) (map[string]interface{}, error)
GetTransaction method returns information of transaction corresponding to given input hash
func (*TurtleCoind) GetTransactionPool ¶
func (daemon *TurtleCoind) GetTransactionPool() (map[string]interface{}, error)
GetTransactionPool method returns the list of unconfirmed transactions present in mem pool
func (*TurtleCoind) Height ¶
func (daemon *TurtleCoind) Height() (map[string]interface{}, error)
Height method returns the height of the blockchain
func (*TurtleCoind) Info ¶
func (daemon *TurtleCoind) Info() (map[string]interface{}, error)
Info method returns information related to network and connection
func (*TurtleCoind) Peers ¶
func (daemon *TurtleCoind) Peers() (map[string]interface{}, error)
Peers method returns array of peers connected to daemon
func (*TurtleCoind) SubmitBlock ¶
func (daemon *TurtleCoind) SubmitBlock(blockBlob string) (map[string]interface{}, error)
SubmitBlock method submits a block to the network corresponding to the input block blob
type WalletAPI ¶
type WalletAPI struct { URL string Port int DaemonURL string DaemonPort int DaemonSSL bool RPCPassword string }
WalletAPI structure contains the info of wallet URL and Port, Daemon URL and Port, and RPCPassword
func (*WalletAPI) CloseWallet ¶
CloseWallet saves and closes the opened wallet
func (*WalletAPI) CreateAddress ¶
CreateAddress creates a new random address in the wallet container.
func (*WalletAPI) CreateIntegratedAddress ¶
func (wallet *WalletAPI) CreateIntegratedAddress( address string, paymentID string) (map[string]interface{}, error)
CreateIntegratedAddress creates an integrated address from the specified address and payment id
func (*WalletAPI) CreateWallet ¶
CreateWallet creates a wallet with the specified filename and password.
func (*WalletAPI) DeleteAddress ¶
DeleteAddress deletes the subwallet address from the container. Note that you cannot delete the primary address (first address in the container)
func (*WalletAPI) GetNodeDetails ¶
GetNodeDetails gets the node address, port fee and fee address.
func (*WalletAPI) GetTransactionDetails ¶
GetTransactionDetails returns the details of the given transaction hash if it is present in the wallet, else error occurs
func (*WalletAPI) ImportAddress ¶
func (wallet *WalletAPI) ImportAddress( scanHeight int, spendKey string) (map[string]interface{}, error)
ImportAddress imports a subwallet with given private spend key
func (*WalletAPI) ImportKey ¶
func (wallet *WalletAPI) ImportKey( filename string, password string, scanHeight int, spendKey string, viewKey string) error
ImportKey imports a wallet with a private spend and view key
func (*WalletAPI) ImportSeed ¶
func (wallet *WalletAPI) ImportSeed( filename string, password string, scanHeight int, mnemonicSeed string) error
ImportSeed imports a wallet using a mnemonic seed
func (*WalletAPI) ImportViewAddress ¶
func (wallet *WalletAPI) ImportViewAddress( scanHeight int, spendKey string) (map[string]interface{}, error)
ImportViewAddress imports a view only subwallet with the given public spend key
func (*WalletAPI) ImportViewOnly ¶
func (wallet *WalletAPI) ImportViewOnly( filename string, password string, scanHeight int, viewkey string, address string) error
ImportViewOnly imports a wallet using a mnemonic seed
func (*WalletAPI) MnemonicSeed ¶
MnemonicSeed return the mnemonic seed for the given address if possible
func (*WalletAPI) OpenWallet ¶
OpenWallet opens an already existing wallet
func (*WalletAPI) Primary ¶
Primary returns the primary address. It is the first address created and is used as change address if not specified.
func (*WalletAPI) PrivateViewKey ¶
PrivateViewKey returns the shared private view key of the wallet container
func (*WalletAPI) Reset ¶
Reset method resets and saves the wallet, beginning scanning from the height given.
func (*WalletAPI) SendAdvancedFusion ¶
func (wallet *WalletAPI) SendAdvancedFusion( mixin int, sourceAddress []string, destinationAddress string) (map[string]interface{}, error)
SendAdvancedFusion sends a single fusion transaction if it can and returns the transaction hash
func (*WalletAPI) SendAdvancedTransaction ¶
func (wallet *WalletAPI) SendAdvancedTransaction( destinations []map[string]interface{}, mixin int, fee int, sourceAddresses []string, paymentID string, changeAddress string, unlockTime int) (map[string]interface{}, error)
SendAdvancedTransaction sends the specified amount to the specified address with the specified paymentID.
func (*WalletAPI) SendBasicFusion ¶
SendBasicFusion sends a single fusion transaction if it can and returns the transaction hash
func (*WalletAPI) SendBasicTransaction ¶
func (wallet *WalletAPI) SendBasicTransaction( destinationAddress string, amount int, paymentID string) (map[string]interface{}, error)
SendBasicTransaction sends the specified amount to the specified address with the specified paymentID.
func (*WalletAPI) TotalBalance ¶
TotalBalance returns the total balance of the wallet container
func (*WalletAPI) TransactionPrivateKey ¶
TransactionPrivateKey returns the private key of the transaction for auditing purposes.
func (*WalletAPI) Transactions ¶
func (wallet *WalletAPI) Transactions(startHeight int, endHeight int) (map[string]interface{}, error)
Transactions return a list of transactions within the range of startHeight and endHeight. If endHeight is less than startHeight then it returns all transactions from the startHeight for 1000 blocks.
func (*WalletAPI) TransactionsByAddress ¶
func (wallet *WalletAPI) TransactionsByAddress( address string, startHeight int, endHeight int) (map[string]interface{}, error)
TransactionsByAddress returns list of transactions corresponding to that address. If endHeight is less than startHeight then it returns all transactions from startHeight for 1000 blocks.
func (*WalletAPI) UnconfirmedTransactions ¶
UnconfirmedTransactions returns the list of unconfirmed transactions for the specified address. If the address is empty then it returns all the unconfirmed transactions in the wallet container.
type Walletd ¶
Walletd structure contains the URL and Port info of the wallet service and RPC Password for RPC calls
func (*Walletd) CreateAddress ¶
func (wallet *Walletd) CreateAddress( spendSecretKey string, spendPublicKey string, scanHeight int, newAddress bool) (map[string]interface{}, error)
CreateAddress method creates a new address inside the container along with old addresses
func (*Walletd) CreateDelayedTransaction ¶
func (wallet *Walletd) CreateDelayedTransaction( addresses []string, transfers []map[string]interface{}, fee int, unlockTime int, extra string, paymentID string, changeAddress string) (map[string]interface{}, error)
CreateDelayedTransaction method allows you to create a delayed transaction Such transactions are not sent into the network automatically and should be pushed using SendDelayedTransaction method
func (*Walletd) CreateIntegratedAddress ¶
func (wallet *Walletd) CreateIntegratedAddress(address string, paymentID string) (map[string]interface{}, error)
CreateIntegratedAddress method creates a unique 236 char long address which corresponds to the specified address with paymentID
func (*Walletd) DeleteAddress ¶
DeleteAddress method deletes the specified address from the container
func (*Walletd) DeleteDelayedTransaction ¶
func (wallet *Walletd) DeleteDelayedTransaction(transactionHash string) (map[string]interface{}, error)
DeleteDelayedTransaction method deletes the specified delayedTransactionHash
func (*Walletd) EstimateFusion ¶
func (wallet *Walletd) EstimateFusion(threshold int, addresses []string) (map[string]interface{}, error)
EstimateFusion method returns the number of outputs that can be optimized This is helpful for sending fusion transactions
func (*Walletd) GetAddresses ¶
GetAddresses method returns an array of addresses present in the container
func (*Walletd) GetBalance ¶
GetBalance method returns the balance present in the specified address If the address is empty then returns the balance present in the container
func (*Walletd) GetBlockHashes ¶
func (wallet *Walletd) GetBlockHashes(firstBlockIndex int, blockCount int) (map[string]interface{}, error)
GetBlockHashes method returns array of hashes starting from specified blockIndex upto blockCount
func (*Walletd) GetDelayedTransactionHashes ¶
GetDelayedTransactionHashes method returns array of delayedTransactionHashes
func (*Walletd) GetFeeInfo ¶
GetFeeInfo method returns the fee information that the service picks up from the connected daemon
func (*Walletd) GetMnemonicSeed ¶
GetMnemonicSeed method returns the 25 word random seed corresponding to the given input wallet address
func (*Walletd) GetSpendKeys ¶
GetSpendKeys method returns the spendPublicKey and spendSecretKey corresponding the given input wallet address
func (*Walletd) GetStatus ¶
GetStatus method returns the sync state of the wallet and known top block height
func (*Walletd) GetTransaction ¶
GetTransaction method returns the transaction details of a particular specified transaction hash
func (*Walletd) GetTransactionHashes ¶
func (wallet *Walletd) GetTransactionHashes( addresses []string, blockHash string, firstBlockIndex int, blockCount int, paymentID string) (map[string]interface{}, error)
GetTransactionHashes method returns array of objects containing block and transaction hashes of the specified address
func (*Walletd) GetTransactions ¶
func (wallet *Walletd) GetTransactions( addresses []string, blockHash string, firstBlockIndex int, blockCount int, paymentID string) (map[string]interface{}, error)
GetTransactions method returns array of objects containing block and transaction details of the specified address
func (*Walletd) GetUnconfirmedTransactionHashes ¶
func (wallet *Walletd) GetUnconfirmedTransactionHashes(addresses []string) (map[string]interface{}, error)
GetUnconfirmedTransactionHashes method returns array of hashes of unconfirmed transactions of the specified address
func (*Walletd) GetViewKey ¶
GetViewKey method returns the viewSecretKey of the wallet
func (*Walletd) Reset ¶
Reset method resyncs the wallet if no viewSecretKey is given. If viewSecretKey is given then it replaces the existing wallet with a new one corresponding to the viewSecretKey
func (*Walletd) SendDelayedTransaction ¶
func (wallet *Walletd) SendDelayedTransaction(transactionHash string) (map[string]interface{}, error)
SendDelayedTransaction method sends the delayedTransaction created using CreateDelayedTransaction method into the network
func (*Walletd) SendFusionTransaction ¶
func (wallet *Walletd) SendFusionTransaction( threshold int, addresses []string, destinationAddress string) (map[string]interface{}, error)
SendFusionTransaction method allows you to send a fusion transaction from selected address to destination address. If there aren't any outputs that can be optimized it returns an error.