Documentation ¶
Overview ¶
Package Navcoind is client library for navcoind JSON RPC API
Index ¶
- Constants
- type AddressBalance
- type AddressHistory
- type AddressHistoryRequest
- type AddressTxids
- type AddressTxidsRequest
- type Answer
- type Bip9SoftFork
- type Block
- type BlockHeader
- type BlockchainInfo
- type CFundStats
- type ChainTip
- type Consensus
- type ConsensusParameter
- type Consultation
- type Cycle
- type DaoVote
- type Info
- type ListAddressResult
- type MiningInfo
- type Navcoind
- func (b *Navcoind) BackupWallet(destination string) error
- func (b *Navcoind) CfundStats() (cfundStats CFundStats, err error)
- func (b *Navcoind) DumpPrivKey(address string) (privKey string, err error)
- func (b *Navcoind) EncryptWallet(passphrase string) error
- func (b *Navcoind) GetAccount(address string) (account string, err error)
- func (b *Navcoind) GetAccountAddress(account string) (address string, err error)
- func (b *Navcoind) GetAddressBalance(address string) (addresses *AddressBalance, err error)
- func (b *Navcoind) GetAddressHistory(start, end *uint64, addresses ...string) (history []*AddressHistory, err error)
- func (b *Navcoind) GetAddressTxids(start, end *uint64, addresses ...string) (txids AddressTxids, err error)
- func (b *Navcoind) GetAddressesByAccount(account string) (addresses []string, err error)
- func (b *Navcoind) GetBalance(account string, minconf uint64) (balance float64, err error)
- func (b *Navcoind) GetBestBlockhash() (bestBlockHash string, err error)
- func (b *Navcoind) GetBlock(blockHash string) (block Block, err error)
- func (b *Navcoind) GetBlockCount() (count uint64, err error)
- func (b *Navcoind) GetBlockHash(index uint64) (hash string, err error)
- func (b *Navcoind) GetBlockTemplate(capabilities []string, mode string) (template string, err error)
- func (b *Navcoind) GetBlockchainInfo() (i BlockchainInfo, err error)
- func (b *Navcoind) GetBlockheader(blockHash string) (*BlockHeader, error)
- func (b *Navcoind) GetChainTips() (tips []ChainTip, err error)
- func (b *Navcoind) GetConnectionCount() (count uint64, err error)
- func (b *Navcoind) GetConsensusParameters(extended bool) (consensusParameters []ConsensusParameter, err error)
- func (b *Navcoind) GetConsultation(hash string) (Consultation, error)
- func (b *Navcoind) GetDifficulty() (difficulty float64, err error)
- func (b *Navcoind) GetGenerate() (generate bool, err error)
- func (b *Navcoind) GetHashesPerSec() (hashpersec float64, err error)
- func (b *Navcoind) GetInfo() (i Info, err error)
- func (b *Navcoind) GetMiningInfo() (miningInfo MiningInfo, err error)
- func (b *Navcoind) GetNewAddress(account ...string) (addr string, err error)
- func (b *Navcoind) GetPaymentRequest(hash string) (paymentRequest PaymentRequest, err error)
- func (b *Navcoind) GetPeerInfo() (peerInfo []Peer, err error)
- func (b *Navcoind) GetProposal(hash string) (proposal Proposal, err error)
- func (b *Navcoind) GetRawBlock(blockHash string) (str string, err error)
- func (b *Navcoind) GetRawChangeAddress(account ...string) (rawAddress string, err error)
- func (b *Navcoind) GetRawMempool() (txId []string, err error)
- func (b *Navcoind) GetRawMempoolVerbose() (txs map[string]VerboseTx, err error)
- func (b *Navcoind) GetRawTransaction(txId string, verbose bool) (rawTx interface{}, err error)
- func (b *Navcoind) GetReceivedByAccount(account string, minconf uint32) (amount float64, err error)
- func (b *Navcoind) GetReceivedByAddress(address string, minconf uint32) (amount float64, err error)
- func (b *Navcoind) GetTransaction(txid string) (transaction Transaction, err error)
- func (b *Navcoind) GetTxOut(txid string, n uint32, includeMempool bool) (transactionOut UTransactionOut, err error)
- func (b *Navcoind) GetTxOutsetInfo() (txOutSet TransactionOutSet, err error)
- func (b *Navcoind) GetWork(data ...string) (response interface{}, err error)
- func (b *Navcoind) ImportPrivKey(privKey, label string, rescan bool) error
- func (b *Navcoind) KeyPoolRefill() error
- func (b *Navcoind) ListAccounts(minconf int32) (accounts map[string]float64, err error)
- func (b *Navcoind) ListAddressGroupings() (list []ListAddressResult, err error)
- func (b *Navcoind) ListLockUnspent() (unspendableOutputs []UnspendableOutput, err error)
- func (b *Navcoind) ListReceivedByAccount(minConf uint32, includeEmpty bool) (list []ReceivedByAccount, err error)
- func (b *Navcoind) ListReceivedByAddress(minConf uint32, includeEmpty bool) (list []ReceivedByAddress, err error)
- func (b *Navcoind) ListSinceBlock(blockHash string, targetConfirmations uint32) (transaction []Transaction, err error)
- func (b *Navcoind) ListTransactions(account string, count, from uint32) (transaction []Transaction, err error)
- func (b *Navcoind) ListUnspent(minconf, maxconf uint32) (transactions []Transaction, err error)
- func (b *Navcoind) LockUnspent(lock bool, outputs []UnspendableOutput) (success bool, err error)
- func (b *Navcoind) Move(formAccount, toAccount string, amount float64, minconf uint32, comment string) (success bool, err error)
- func (b *Navcoind) SendFrom(fromAccount, toAddress string, amount float64, minconf uint32, ...) (txID string, err error)
- func (b *Navcoind) SendMany(fromAccount string, amounts map[string]float64, minconf uint32, comment string) (txID string, err error)
- func (b *Navcoind) SendToAddress(toAddress string, amount float64, comment, commentTo string) (txID string, err error)
- func (b *Navcoind) SetAccount(address, account string) error
- func (b *Navcoind) SetGenerate(generate bool, genProcLimit int32) error
- func (b *Navcoind) SetTxFee(amount float64) error
- func (b *Navcoind) SignMessage(address, message string) (sig string, err error)
- func (b *Navcoind) Stop() error
- func (b *Navcoind) ValidateAddress(address string) (va ValidateAddressResponse, err error)
- func (b *Navcoind) VerifyMessage(address, sign, message string) (success bool, err error)
- func (b *Navcoind) WalletLock() error
- func (b *Navcoind) WalletPassphrase(passPhrase string, timeout uint64) error
- func (b *Navcoind) WalletPassphraseChange(oldPassphrase, newPassprhase string) error
- type PaymentRequest
- type Peer
- type Proposal
- type RPCError
- type RPCErrorCode
- type RawTransaction
- type ReceivedByAccount
- type ReceivedByAddress
- type ScriptPubKey
- type ScriptSig
- type SoftFork
- type Transaction
- type TransactionDetails
- type TransactionOutSet
- type UTransactionOut
- type UnspendableOutput
- type ValidateAddressResponse
- type VerboseTx
- type Vin
- type Vout
- type Work
Constants ¶
const ( // VERSION represents navcoind package version VERSION = 0.1 // DEFAULT_RPCCLIENT_TIMEOUT represent http timeout for rcp client RPCCLIENT_TIMEOUT = 30 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressBalance ¶
type AddressHistory ¶
type AddressHistory struct { Block uint64 `json:"block"` TxIndex uint `json:"txindex"` Time int64 `json:"time"` TxId string `json:"txid"` Address string `json:"address"` Changes struct { Balance int64 `json:"balance"` Stakable int64 `json:"stakable"` VotingWeight int64 `json:"voting_weight"` Flags uint `json:"flags"` } Result struct { Balance int64 `json:"balance"` Stakable int64 `json:"stakable"` VotingWeight int64 `json:"voting_weight"` } }
type AddressHistoryRequest ¶
type AddressTxids ¶
type AddressTxids []string
type AddressTxidsRequest ¶
type Answer ¶
type Answer struct { Version uint32 `json:"version"` Answer interface{} `json:"answer"` Support int `json:"support"` Votes int `json:"votes"` Status string `json:"status"` State int `json:"state"` StateChangedOnBlock string `json:"stateChangedOnBlock"` TxBlockHash string `json:"txblockhash"` Parent string `json:"parent"` Hash string `json:"hash"` MapState map[int]string `json:"mapState"` }
type Bip9SoftFork ¶
type Block ¶
type Block struct { Hash string `json:"hash"` Confirmations uint64 `json:"confirmations"` StrippedSize uint64 `json:"strippedsize"` Size uint64 `json:"size"` Weight uint64 `json:"weight"` Height uint64 `json:"height"` Version uint32 `json:"version"` VersionHex string `json:"versionHex"` MerkleRoot string `json:"merkleroot"` Tx []string `json:"tx"` TxCount uint `json:"tx_count"` ProposalCount uint `json:"proposal_count"` PaymentRequestCount uint `json:"payment_request_count"` ProposalVotesCount uint `json:"proposal_votes_count"` PaymentRequestVotesCount uint `json:"payment_request_votes_count"` PaymentRequestPayoutsCount uint `json:"payment_request_payouts_count"` Time int64 `json:"time"` MedianTime int64 `json:"mediantime"` Nonce uint64 `json:"nonce"` Bits string `json:"bits"` Difficulty float64 `json:"difficulty"` ChainWork string `json:"chainwork,omitempty"` PreviousBlockHash string `json:"previousblockhash"` NextBlockHash string `json:"nextblockhash"` }
type BlockHeader ¶
type BlockHeader struct { Hash string `json:"hash"` Confirmations uint64 `json:"confirmations"` Height uint64 `json:"height"` Version uint32 `json:"version"` VersionHex string `json:"versionHex"` MerkleRoot string `json:"merkleroot"` Time int64 `json:"time"` MedianTime int64 `json:"mediantime"` Mint float64 `json:"mint"` Nonce uint64 `json:"nonce"` Bits string `json:"bits"` Difficulty float64 `json:"difficulty"` ChainWork string `json:"chainwork"` NcfSupply string `json:"ncfsupply"` NcfLocked string `json:"ncflocked"` Flags string `json:"flags"` ProofHash string `json:"proofhash"` EntropyBit int64 `json:"entropybit"` Modifier string `json:"modifier"` CfundVotes []DaoVote `json:"cfund_votes"` CfundRequestVotes []DaoVote `json:"cfund_request_votes"` DaoSupport []string `json:"dao_support"` DaoVotes []DaoVote `json:"dao_votes"` PreviousBlockHash string `json:"previousblockhash"` NextBlockHash string `json:"nextblockhash"` }
type BlockchainInfo ¶
type BlockchainInfo struct { Chain string `json:"chain"` Blocks uint64 `json:"blocks"` Headers uint64 `json:"headers"` BestBlockHash string `json:"bestblockhash"` Difficulty float64 `json:"difficulty"` MedianTime uint64 `json:"mediantime"` VerificationProgress float64 `json:"verificationprocess"` ChainWork string `json:"chainwork"` Pruned bool `json:"pruned"` SoftForks []SoftFork `json:"softforks"` Bip9SoftForks map[string]Bip9SoftFork `json:"bip9_softforks"` }
type CFundStats ¶
type CFundStats struct {
Consensus Consensus `json:"consensus"`
}
type Consensus ¶
type Consensus struct { BlocksPerVotingCycle uint `json:"blocksPerVotingCycle"` MinSumVotesPerVotingCycle uint `json:"minSumVotesPerVotingCycle"` MaxCountVotingCycleProposals uint `json:"maxCountVotingCycleProposals"` MaxCountVotingCyclePaymentRequests uint `json:"maxCountVotingCyclePaymentRequests"` VotesAcceptProposalPercentage uint `json:"votesAcceptProposalPercentage"` VotesRejectProposalPercentage uint `json:"votesRejectProposalPercentage"` VotesAcceptPaymentRequestPercentage uint `json:"votesAcceptPaymentRequestPercentage"` VotesRejectPaymentRequestPercentage uint `json:"votesRejectPaymentRequestPercentage"` ProposalMinimalFee float64 `json:"proposalMinimalFee"` }
type ConsensusParameter ¶
type Consultation ¶
type Consultation struct { Version uint32 `json:"version"` Hash string `json:"hash"` BlockHash string `json:"blockhash"` Question string `json:"question"` Support int `json:"support"` Abstain int `json:"abstain"` RawAnswers json.RawMessage `json:"answers"` Answers []*Answer `json:"-"` RangeAnswers map[string]int `json:"-"` Min int `json:"min"` Max int `json:"max"` VotingCyclesFromCreation int `json:"votingCyclesFromCreation"` VotingCycleForState Cycle `json:"votingCycleForState"` Status string `json:"status"` State int `json:"state"` StateChangedOnBlock string `json:"stateChangedOnBlock"` MapState map[int]string `json:"mapState"` }
type Info ¶
type Info struct { Version uint32 `json:"version"` Protocolversion uint32 `json:"protocolversion"` Walletversion uint32 `json:"walletversion"` Balance float64 `json:"balance"` Blocks uint32 `json:"blocks"` Timeoffset int32 `json:"timeoffset"` Connections uint32 `json:"connections"` Proxy string `json:"proxy,omitempty"` Difficulty float64 `json:"difficulty"` Testnet bool `json:"testnet"` Keypoololdest uint64 `json:"keypoololdest"` KeypoolSize uint32 `json:"keypoolsize,omitempty"` UnlockedUntil int64 `json:"unlocked_until,omitempty"` Paytxfee float64 `json:"paytxfee"` Relayfee float64 `json:"relayfee"` Errors string `json:"errors"` }
type ListAddressResult ¶
ListAddressResult represents a result composing ListAddressGroupings slice reply
type MiningInfo ¶
type MiningInfo struct { // The current block Blocks uint64 `json:"blocks"` // The last block size CurrentBlocksize uint64 `json:"currentblocksize"` // The last block transaction CurrentBlockTx uint64 `json:"currentblocktx"` // The current difficulty Difficulty float64 `json:"difficulty"` // Current errors Errors string `json:"errors"` // The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls) GenProcLimit int32 `json:"genproclimit"` // The size of the mem pool PooledtTx uint64 `json:"pooledtx"` // If using testnet or not Testnet bool `json:"testnet"` // If the generation is on or off (see getgenerate or setgenerate calls) Generate bool `json:"generate"` // The network hashrate NetworkHashps uint64 `json:"networkhashps"` // Node hashrate HashesPersec uint64 `json:"hashespersec"` }
A MiningInfo represents a mininginfo response
type Navcoind ¶
type Navcoind struct {
// contains filtered or unexported fields
}
A Navcoind represents a Navcoind client
func New ¶
func New(host string, port int, user, passwd string, useSSL, debug bool, timeoutParam ...int) (*Navcoind, error)
New return a new navcoind
func (*Navcoind) BackupWallet ¶
BackupWallet Safely copies wallet.dat to destination, which can be a directory or a path with filename on the remote server
func (*Navcoind) CfundStats ¶
func (b *Navcoind) CfundStats() (cfundStats CFundStats, err error)
CfundStats Returns statistics about the community fund.
func (*Navcoind) DumpPrivKey ¶
DumpPrivKey return private key as string associated to public <address>
func (*Navcoind) EncryptWallet ¶
EncryptWallet encrypts the wallet with <passphrase>.
func (*Navcoind) GetAccount ¶
GetAccount returns the account associated with the given address.
func (*Navcoind) GetAccountAddress ¶
GetAccountAddress Returns the current bitcoin address for receiving payments to this account. If account does not exist, it will be created along with an associated new address that will be returned.
func (*Navcoind) GetAddressBalance ¶
func (b *Navcoind) GetAddressBalance(address string) (addresses *AddressBalance, err error)
func (*Navcoind) GetAddressHistory ¶
func (b *Navcoind) GetAddressHistory(start, end *uint64, addresses ...string) (history []*AddressHistory, err error)
func (*Navcoind) GetAddressTxids ¶
func (b *Navcoind) GetAddressTxids(start, end *uint64, addresses ...string) (txids AddressTxids, err error)
func (*Navcoind) GetAddressesByAccount ¶
GetAddressesByAccount return addresses associated with account <account>
func (*Navcoind) GetBalance ¶
GetBalance return the balance of the server or of a specific account If [account] is "", returns the server's total available balance. If [account] is specified, returns the balance in the account
func (*Navcoind) GetBestBlockhash ¶
GetBestBlockhash returns the hash of the best (tip) block in the longest block chain.
func (*Navcoind) GetBlockCount ¶
GetBlockCount returns the number of blocks in the longest block chain.
func (*Navcoind) GetBlockHash ¶
GetBlockHash returns hash of block in best-block-chain at <index>
func (*Navcoind) GetBlockTemplate ¶
func (b *Navcoind) GetBlockTemplate(capabilities []string, mode string) (template string, err error)
TODO a finir GetBlockTemplate Returns data needed to construct a block to work on. See BIP_0022 for more info on params.
func (*Navcoind) GetBlockchainInfo ¶
func (b *Navcoind) GetBlockchainInfo() (i BlockchainInfo, err error)
GetBlockchainInfo return result of "getblockchaininfo" command
func (*Navcoind) GetBlockheader ¶
func (b *Navcoind) GetBlockheader(blockHash string) (*BlockHeader, error)
func (*Navcoind) GetChainTips ¶
func (*Navcoind) GetConnectionCount ¶
GetConnectionCount returns the number of connections to other nodes.
func (*Navcoind) GetConsensusParameters ¶
func (b *Navcoind) GetConsensusParameters(extended bool) (consensusParameters []ConsensusParameter, err error)
GetConsensusParameters returns information about the consensus parameters
func (*Navcoind) GetConsultation ¶
func (b *Navcoind) GetConsultation(hash string) (Consultation, error)
GetConsultation returns information about the consultation with the given hash.
func (*Navcoind) GetDifficulty ¶
GetDifficulty returns the proof-of-work difficulty as a multiple of the minimum difficulty.
func (*Navcoind) GetGenerate ¶
GetGenerate returns true or false whether navcoind is currently generating hashes
func (*Navcoind) GetHashesPerSec ¶
GetHashesPerSec returns a recent hashes per second performance measurement while generating.
func (*Navcoind) GetMiningInfo ¶
func (b *Navcoind) GetMiningInfo() (miningInfo MiningInfo, err error)
GetMiningInfo returns an object containing mining-related information
func (*Navcoind) GetNewAddress ¶
GetNewAddress return a new address for account [account].
func (*Navcoind) GetPaymentRequest ¶
func (b *Navcoind) GetPaymentRequest(hash string) (paymentRequest PaymentRequest, err error)
GetPaymentRequest returns information about the proposal with the given hash.
func (*Navcoind) GetPeerInfo ¶
GetPeerInfo returns data about each connected node
func (*Navcoind) GetProposal ¶
GetProposal returns information about the proposal with the given hash.
func (*Navcoind) GetRawBlock ¶
GetRawBlock returns information about the block with the given hash.
func (*Navcoind) GetRawChangeAddress ¶
GetRawChangeAddress Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.
func (*Navcoind) GetRawMempool ¶
GetRawMempool returns all transaction ids in memory pool
func (*Navcoind) GetRawMempoolVerbose ¶
GetRawMempoolVerbose returns a verbose set of transactions map [TxId] => VerboseTx
func (*Navcoind) GetRawTransaction ¶
GetRawTransaction returns raw transaction representation for given transaction id.
func (*Navcoind) GetReceivedByAccount ¶
GetReceivedByAccount Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] is set to all return will include all transactions to all accounts
func (*Navcoind) GetReceivedByAddress ¶
Returns the amount received by <address> in transactions with at least [minconf] confirmations. It correctly handles the case where someone has sent to the address in multiple transactions. Keep in mind that addresses are only ever used for receiving transactions. Works only for addresses in the local wallet, external addresses will always show 0.
func (*Navcoind) GetTransaction ¶
func (b *Navcoind) GetTransaction(txid string) (transaction Transaction, err error)
GetTransaction returns a Navcoind.Transation struct about the given transaction
func (*Navcoind) GetTxOut ¶
func (b *Navcoind) GetTxOut(txid string, n uint32, includeMempool bool) (transactionOut UTransactionOut, err error)
GetTxOut returns details about an unspent transaction output (UTXO)
func (*Navcoind) GetTxOutsetInfo ¶
func (b *Navcoind) GetTxOutsetInfo() (txOutSet TransactionOutSet, err error)
GetTxOutsetInfo returns statistics about the unspent transaction output (UTXO) set
func (*Navcoind) GetWork ¶
GetWork If [data] is not specified, returns formatted hash data to work on If [data] is specified, tries to solve the block and returns true if it was successful.
func (*Navcoind) ImportPrivKey ¶
ImportPrivKey Adds a private key (as returned by dumpprivkey) to your wallet. This may take a while, as a rescan is done, looking for existing transactions. Optional [rescan] parameter added in 0.8.0. Note: There's no need to import public key, as in ECDSA (unlike RSA) this can be computed from private key.
func (*Navcoind) KeyPoolRefill ¶
KeyPoolRefill fills the keypool, requires wallet passphrase to be set.
func (*Navcoind) ListAccounts ¶
ListAccounts returns Object that has account names as keys, account balances as values.
func (*Navcoind) ListAddressGroupings ¶
func (b *Navcoind) ListAddressGroupings() (list []ListAddressResult, err error)
ListAddressGroupings returns all addresses in the wallet and info used for coincontrol.
func (*Navcoind) ListLockUnspent ¶
func (b *Navcoind) ListLockUnspent() (unspendableOutputs []UnspendableOutput, err error)
ListLockUnspent returns list of temporarily unspendable outputs
func (*Navcoind) ListReceivedByAccount ¶
func (b *Navcoind) ListReceivedByAccount(minConf uint32, includeEmpty bool) (list []ReceivedByAccount, err error)
ListReceivedByAccount Returns an slice of AccountRecieved:
func (*Navcoind) ListReceivedByAddress ¶
func (b *Navcoind) ListReceivedByAddress(minConf uint32, includeEmpty bool) (list []ReceivedByAddress, err error)
ListReceivedByAccount Returns an slice of AccountRecieved:
func (*Navcoind) ListSinceBlock ¶
func (b *Navcoind) ListSinceBlock(blockHash string, targetConfirmations uint32) (transaction []Transaction, err error)
ListSinceBlock
func (*Navcoind) ListTransactions ¶
func (b *Navcoind) ListTransactions(account string, count, from uint32) (transaction []Transaction, err error)
ListTransactions returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided it'll return recent transactions from all accounts.
func (*Navcoind) ListUnspent ¶
func (b *Navcoind) ListUnspent(minconf, maxconf uint32) (transactions []Transaction, err error)
ListUnspent returns array of unspent transaction inputs in the wallet.
func (*Navcoind) LockUnspent ¶
func (b *Navcoind) LockUnspent(lock bool, outputs []UnspendableOutput) (success bool, err error)
LockUnspent updates(lock/unlock) list of temporarily unspendable outputs
func (*Navcoind) Move ¶
func (b *Navcoind) Move(formAccount, toAccount string, amount float64, minconf uint32, comment string) (success bool, err error)
Move from one account in your wallet to another
func (*Navcoind) SendFrom ¶
func (b *Navcoind) SendFrom(fromAccount, toAddress string, amount float64, minconf uint32, comment, commentTo string) (txID string, err error)
SendFrom send amount from fromAccount to toAddress
amount is a real and is rounded to 8 decimal places. Will send the given amount to the given address, ensuring the account has a valid balance using [minconf] confirmations.
func (*Navcoind) SendMany ¶
func (b *Navcoind) SendMany(fromAccount string, amounts map[string]float64, minconf uint32, comment string) (txID string, err error)
SenMany send multiple times
func (*Navcoind) SendToAddress ¶
func (b *Navcoind) SendToAddress(toAddress string, amount float64, comment, commentTo string) (txID string, err error)
SendToAddress send an amount to a given address
func (*Navcoind) SetAccount ¶
SetAccount sets the account associated with the given address
func (*Navcoind) SetGenerate ¶
SetGenerate turns generation on or off. Generation is limited to [genproclimit] processors, -1 is unlimited.
func (*Navcoind) SignMessage ¶
SignMessage sign a message with the private key of an address
func (*Navcoind) ValidateAddress ¶
func (b *Navcoind) ValidateAddress(address string) (va ValidateAddressResponse, err error)
ValidateAddress return information about <bitcoinaddress>.
func (*Navcoind) VerifyMessage ¶
Verifymessage Verify a signed message.
func (*Navcoind) WalletLock ¶
WalletLock Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.
func (*Navcoind) WalletPassphrase ¶
walletPassphrase stores the wallet decryption key in memory for <timeout> seconds.
func (*Navcoind) WalletPassphraseChange ¶
type PaymentRequest ¶
type PaymentRequest struct { Version uint32 `json:"version"` Hash string `json:"hash"` BlockHash string `json:"blockHash"` ProposalHash string `json:"proposalHash,omitempty"` Description string `json:"description"` RequestedAmount string `json:"requestedAmount"` VotesYes uint `json:"votesYes"` VotesAbs uint `json:"votesAbs"` VotesNo uint `json:"votesNo"` VotesExcluded uint `json:"excludedVotes"` VotingCycle uint `json:"votingCycle"` Status string `json:"status"` State uint `json:"state"` StateChangedOnBlock string `json:"stateChangedOnBlock,omitempty"` PaidOnBlock string `json:"paidOnBlock,omitempty"` }
type Peer ¶
type Peer struct { // The ip address and port of the peer Addr string `json:"addr"` // Local address Addrlocal string `json:"addrlocal"` // The services Services string `json:"services"` // The time in seconds since epoch (Jan 1 1970 GMT) of the last send Lastsend uint64 `json:"lastsend"` // The time in seconds since epoch (Jan 1 1970 GMT) of the last receive Lastrecv uint64 `json:"lastrecv"` // The total bytes sent Bytessent uint64 `json:"bytessent"` // The total bytes received Bytesrecv uint64 `json:"bytesrecv"` // The connection time in seconds since epoch (Jan 1 1970 GMT) Conntime uint64 `json:"conntime"` // Ping time Pingtime float64 `json:"pingtime"` // Ping Wait Pingwait float64 `json:"pingwait"` // The peer version, such as 7001 Version uint32 `json:"version"` // The string version Subver string `json:"subver"` // Inbound (true) or Outbound (false) Inbound bool `json:"inbound"` // The starting height (block) of the peer Startingheight int32 `json:"startingheight"` // The ban score (stats.nMisbehavior) Banscore int32 `json:"banscore"` // If sync node Syncnode bool `json:"syncnode"` }
type Proposal ¶
type Proposal struct { Version uint32 `json:"version"` Hash string `json:"hash"` BlockHash string `json:"blockHash"` Description string `json:"description"` RequestedAmount string `json:"requestedAmount"` NotPaidYet string `json:"notPaidYet"` NotRequestedYet string `json:"notRequestedYet"` UserPaidFee string `json:"userPaidFee"` PaymentAddress string `json:"paymentAddress"` ProposalDuration uint64 `json:"proposalDuration"` ExpiresOn uint64 `json:"expiresOn"` VotesYes uint `json:"votesYes"` VotesAbs uint `json:"votesAbs"` VotesNo uint `json:"votesNo"` VotesExcluded uint `json:"excludedVotes"` VotingCycle uint `json:"votingCycle"` Status string `json:"status"` State uint `json:"state"` StateChangedOnBlock string `json:"stateChangedOnBlock,omitempty"` PaymentRequests []PaymentRequest `json:"paymentRequests"` }
type RPCError ¶
type RPCError struct { Code RPCErrorCode `json:"code,omitempty"` Message string `json:"message,omitempty"` }
RPCError represents an error that is used as a part of a JSON-RPC Response object.
type RPCErrorCode ¶
type RPCErrorCode int
RPCErrorCode represents an error code to be used as a part of an RPCError which is in turn used in a JSON-RPC Response object.
A specific type is used to help ensure the wrong errors aren't used.
type RawTransaction ¶
type RawTransaction struct { Hex string `json:"hex"` Txid string `json:"txid"` Hash string `json:"hash"` Size uint64 `json:"size"` VSize uint64 `json:"vsize"` Version uint32 `json:"version"` LockTime uint32 `json:"locktime"` Strdzeel string `json:"strdzeel,omitempty"` VchTxSig string `json:"vchTxSig,omitempty"` VchBalanceSig string `json:"vchBalanceSig,omitempty"` AnonDestination string `json:"anon-destination,omitempty"` Vin []Vin `json:"vin"` Vout []Vout `json:"vout"` BlockHash string `json:"blockhash,omitempty"` Height uint64 `json:"height"` Confirmations uint64 `json:"confirmations,omitempty"` Time int64 `json:"time,omitempty"` BlockTime int64 `json:"blocktime,omitempty"` }
type ReceivedByAccount ¶
type ReceivedByAccount struct { // the account of the receiving addresses Account string // total amount received by addresses with this account Amount float64 // number of confirmations of the most recent transaction included Confirmations uint32 }
ReceivedByAccount represents how much coin a account have recieved
type ReceivedByAddress ¶
type ReceivedByAddress struct { // receiving address Address string // The corresponding account Account string // total amount received by addresses with this account Amount float64 // number of confirmations of the most recent transaction included Confirmations uint32 // Tansactions ID TxIds []string }
ReceivedByAddress represents how much coin a account have recieved
type ScriptPubKey ¶
type SoftFork ¶
type SoftFork struct { Id string `json:"id"` Version int `json:"version"` Enforce struct { Status bool `json:"status"` Found uint `json:"found"` Required uint `json:"required"` Window uint `json:"window"` } Reject struct { Status bool `json:"status"` Found uint `json:"found"` Required uint `json:"required"` Window uint `json:"window"` } }
type Transaction ¶
type Transaction struct { Amount float64 `json:"amount"` Account string `json:"account,omitempty"` Address string `json:"address,omitempty"` Category string `json:"category,omitempty"` Fee float64 `json:"fee,omitempty"` Confirmations int64 `json:"confirmations"` BlockHash string `json:"blockhash"` BlockIndex int64 `json:"blockindex"` BlockTime int64 `json:"blocktime"` TxID string `json:"txid"` WalletConflicts []string `json:"walletconflicts"` Time int64 `json:"time"` TimeReceived int64 `json:"timereceived"` Details []TransactionDetails `json:"details,omitempty"` Hex string `json:"hex,omitempty"` }
type TransactionDetails ¶
type TransactionOutSet ¶
type TransactionOutSet struct { Height uint32 `json:"height"` Bestblock string `json:"bestblock"` Transactions float64 `json:"transactions"` TxOuts float64 `json:"txouts"` BytesSerialized float64 `json:"bytes_serialized"` HashSerialized string `json:"hash_serialized"` TotalAmount float64 `json:"total_amount"` }
type UTransactionOut ¶
type UnspendableOutput ¶
UnspendableOutput represents a unspendable (locked) output
type ValidateAddressResponse ¶
type ValidateAddressResponse struct { IsValid bool `json:"isvalid"` Address string `json:"address"` IsMine bool `json:"ismine"` IsScript bool `json:"isscript"` PubKey string `json:"pubkey"` IsCompressed bool `json:"iscompressed"` Account string `json:"account"` }
ValidateAddressResponse represents a response to "validateaddress" call
type VerboseTx ¶
type VerboseTx struct { // Virtual transaction size as defined in BIP 141 Size uint32 // Transaction fee in BTC Fee float64 // Transaction fee with fee deltas used for mining priority ModifiedFee float64 // Local time when tx entered pool Time uint32 // Block height when tx entered pool Height uint32 // Number of inpool descendents (including this one) DescendantCount uint32 // Virtual transaction size of in-mempool descendants (including this one) DescendantSize uint32 // Modified fees (see above) of in-mempool descendants (including this one) DescendantFees float64 // Number of in-mempool ancestor transactions (including this one) AncestorCount uint32 // Virtual transaction size of in-mempool ancestors (including this one) AncestorSize uint32 // Modified fees (see above) of in-mempool ancestors (including this one) AncestorFees uint32 // Hash of serialized transaction, including witness data WTxId string // Unconfirmed transactions used as inputs for this transaction Depends []string // Used by Bitcoin Unlimited RPC SpentBy []string }
type Vin ¶
type Vin struct { Coinbase string `json:"coinbase,omitempty"` Txid string `json:"txid,omitempty"` TokenId string `json:"tokenId,omitempty"` TokenNftId *int `json:"tokenNftId,omitempty"` Vout int `json:"vout,omitempty"` ScriptSig ScriptSig `json:"scriptSig,omitempty"` Value float64 `json:"value,omitempty"` ValueSat uint64 `json:"valuesat,omitempty"` Address string `json:"address,omitempty"` Sequence uint32 `json:"sequence"` }
type Vout ¶
type Vout struct { Value float64 `json:"value"` ValueSat uint64 `json:"valuesat"` N int `json:"n"` ScriptPubKey ScriptPubKey `json:"scriptPubKey"` SpendingKey string `json:"spendingKey,omitempty"` OutputKey string `json:"outputKey,omitempty"` EphemeralKey string `json:"ephemeralKey,omitempty"` TokenId string `json:"tokenId,omitempty"` TokenNftId *int `json:"tokenNftId,omitempty"` RangeProof bool `json:"rangeProof,omitempty"` SpentTxId string `json:"spentTxId,omitempty"` SpentIndex int `json:"spentIndex,omitempty"` SpentHeight int `json:"spentHeight,omitempty"` }