Documentation ¶
Index ¶
- type Block
- type ChainTip
- type Client
- func (c *Client) GetBestBlockHash() (string, error)
- func (c *Client) GetBlockCount() (int64, error)
- func (c *Client) GetBlockHash(height int64) (string, error)
- func (c *Client) GetBlockVerboseTx(hash string) (*GetBlockVerboseResult, error)
- func (c *Client) GetBlockchainInfo() *GetBlockchainInfo
- func (c *Client) GetInfo() *GetInfo
- func (c *Client) GetMempoolEntry(txID string) (*string, error)
- func (c *Client) GetNetworkInfo() (*GetNetworkInfo, error)
- func (c *Client) GetRawMempool() ([]*chainhash.Hash, error)
- func (c *Client) GetRawTransaction(txid string) (string, error)
- func (c *Client) GetRawTransactionVerbose(txid string) (*Transaction, error)
- func (c *Client) ListUnspent() []Unspent
- func (c *Client) ListUnspentMinMaxAddresses(minconf int, maxconf int, addresses []string) ([]Unspent, error)
- func (c *Client) SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (string, error)
- func (c *Client) SendRawTransactionCmd(hexstring string, allowhighfees bool) (string, error)
- type ConnConfig
- type GetBlockVerboseResult
- type GetBlockchainInfo
- type GetChainTips
- type GetDeprecationInfo
- type GetInfo
- type GetMemPoolInfo
- type GetNetworkInfo
- type GetPeerInfo
- type LocalAddress
- type Network
- type PeerInfo
- type RawMemPool
- type ScriptPubKey
- type ScriptPubKeyResult
- type ScriptSig
- type TXOutSetInfo
- type Transaction
- type Unspent
- type VIn
- type VJoinSplitTX
- type VOut
- type ValuePool
- type ZGetTotalBalance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Hash string `json:"hash"` Confirmations int `json:"confirmations"` Size int `json:"size"` Height int `json:"height"` Version int `json:"version"` MerkleRoot string `json:"merkleroot"` FinalSaplingRoot string `json:"finalsaplingroot"` TX []Transaction `json:"tx"` Time int64 `json:"time"` Nonce string `json:"nonce"` Difficulty float64 `json:"difficulty"` PreviousBlockHash string `json:"previousblockhash"` NextBlockHash string `json:"nextblockhash"` ValuePools []ValuePool `json:"valuePools"` }
func (Block) NumberofTransactions ¶
func (Block) TransactionTypes ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *ConnConfig) (*Client, error)
func (*Client) GetBestBlockHash ¶
func (*Client) GetBlockCount ¶
func (*Client) GetBlockVerboseTx ¶
func (c *Client) GetBlockVerboseTx(hash string) (*GetBlockVerboseResult, error)
func (*Client) GetBlockchainInfo ¶
func (c *Client) GetBlockchainInfo() *GetBlockchainInfo
func (*Client) GetNetworkInfo ¶
func (c *Client) GetNetworkInfo() (*GetNetworkInfo, error)
func (*Client) GetRawTransactionVerbose ¶
func (c *Client) GetRawTransactionVerbose(txid string) (*Transaction, error)
func (*Client) ListUnspent ¶
todo , asl Pranav if it's Ok to return upspent as an array
func (*Client) ListUnspentMinMaxAddresses ¶
func (*Client) SendRawTransaction ¶
type ConnConfig ¶
type GetBlockVerboseResult ¶
type GetBlockVerboseResult struct { Hash string `json:"hash"` Confirmations int `json:"confirmations"` Size int `json:"size"` Height int64 `json:"height"` Version int `json:"version"` MerkleRoot string `json:"merkleroot"` FinalSaplingRoot string `json:"finalsaplingroot"` FinalOrchardRoot string `json:"finalorchardroot"` Tx []Transaction `json:"tx"` Time int64 `json:"time"` Nonce uint32 `json:"nonce"` Bits string `json:"bits"` Difficulty float64 `json:"difficulty"` PreviousHash string `json:"previousblockhash"` NextHash string `json:"nextblockhash,omitempty"` }
type GetBlockchainInfo ¶
type GetBlockchainInfo struct { Chain string `json:"chain"` Blocks int `json:"blocks"` Difficulty float64 `json:"difficulty"` VerificationProgress float64 `json:"verificationprogress"` SizeOnDisk float64 `json:"size_on_disk"` }
GetBlockchainInfo return the zcashd rpc `getblockchaininfo` status https://zcash-rpc.github.io/getblockchaininfo.html
type GetChainTips ¶
type GetChainTips []ChainTip
GetChainTips Return information about all known tips in the block tree https://zcash-rpc.github.io/getchaintips.html
type GetDeprecationInfo ¶
type GetDeprecationInfo struct { Version int `json:"version"` Subversion string `json:"subversion"` DeprecationHeight int `json:"deprecationheight"` }
GetDeprecationInfo Returns an object containing current version and deprecation block height. Applicable only on mainnet. https://zcash-rpc.github.io/getdeprecationinfo.html
type GetInfo ¶
type GetInfo struct {
Version int `json:"version"`
}
GetInfo Returns an object containing various state info. https://zcash-rpc.github.io/getinfo.html
type GetMemPoolInfo ¶
type GetMemPoolInfo struct { Size float64 `json:"size"` Bytes float64 `json:"bytes"` Usage float64 `json:"usage"` }
GetMemPoolInfo return the zcashd rpc `getmempoolinfo` https://zcash-rpc.github.io/getmempoolinfo.html
type GetNetworkInfo ¶
type GetNetworkInfo struct { Version uint32 `json:"version"` Subversion string `json:"subversion"` Protocolversion uint32 `json:"protocolversion"` Localservices string `json:"localservices"` Timeoffset int64 `json:"timeoffset"` Connections uint32 `json:"connections"` Networks []Network `json:"networks"` RelayFee float64 `json:"relayfee"` Localaddresses []LocalAddress `json:"localaddresses"` Warnings string `json:"warnings"` }
GetNetworkInfoResult return the zcashd rpc `getnetworkinfo` https://zcash.github.io/rpc/getnetworkinfo.html
type GetPeerInfo ¶
type GetPeerInfo []PeerInfo
GetPeerInfo Returns data about each connected network node https://zcash-rpc.github.io/getpeerinfo.html
type LocalAddress ¶
type LocalAddress struct { Address string `json:"address"` Port int `json:"port"` Score int `json:"score"` }
LocalAddress local address
type Network ¶
type Network struct { Name string `json:"name"` Limited bool `json:"limited"` Reachable bool `json:"reachable"` Proxy string `json:"proxy"` ProxyRandomizeCredentials bool `json:"proxy_randomize_credentials"` }
Network network info
type PeerInfo ¶
type PeerInfo struct { ID int `json:"id"` Addr string `json:"addr"` AddrLocal string `json:"addrlocal"` Services string `json:"services"` LastSend int `json:"lastsend"` LastRecv int `json:"lastrecv"` BytesSent int `json:"bytessent"` BytesRecv int `json:"bytesrecv"` Conntime int `json:"conntime"` Timeoffset int `json:"timeoffset"` PingTime float64 `json:"pingtime"` PingWait float64 `json:"pingwait"` Version int `json:"version"` Subver string `json:"subver"` Inbound bool `json:"inbound"` Startingheight int `json:"startingheight"` Banscore int `json:"banscore"` SyncedHeaders int `json:"synced_headers"` SyncedBlocks int `json:"synced_blocks"` }
type RawMemPool ¶
type RawMemPool struct { }
type ScriptPubKey ¶
type ScriptPubKeyResult ¶
type ScriptPubKeyResult struct { Asm string `json:"asm"` Hex string `json:"hex,omitempty"` ReqSigs int32 `json:"reqSigs,omitempty"` Type string `json:"type"` Addresses []string `json:"addresses,omitempty"` }
ScriptPubKeyResult models the scriptPubKey data of a tx script. It is defined separately since it is used by multiple commands.
type TXOutSetInfo ¶
type Transaction ¶
type Transaction struct { Hex string `json:"hex"` Txid string `json:"txid"` Version int `json:"version"` LockTime int `json:"locktime"` ExpiryHeight int `json:"expirtheight"` VIn []VIn `json:"vin"` VOut []VOut `json:"vout"` VJoinSplit []VJoinSplitTX `json:"vjoinsplit"` ValueBalance float64 `json:"valueBalance"` VShieldedSpend []map[string]interface{} `json:"vShieldedSpend"` VShieldedOutput []map[string]interface{} `json:"vShieldedOutput"` }
Transaction describes a zcash tranaction
func (Transaction) ContainsSapling ¶
func (t Transaction) ContainsSapling() bool
ContainsSapling returns if a transaction contains sapling transaction data Check that there is a valueBalance value (positive or negative) Check that there is data for either VShieldedSpend or VShieldedOutput
func (Transaction) ContainsSprout ¶
func (t Transaction) ContainsSprout() bool
ContainsSprout returns if a transaction contains sprout transaction data
func (Transaction) IsMixed ¶
func (t Transaction) IsMixed() bool
IsMixed returns if the transaction contains transparent addresses and shielded transaction data
func (Transaction) IsShielded ¶
func (t Transaction) IsShielded() bool
IsShielded returns if the transaction contains no transparent addresses
func (Transaction) IsTransparent ¶
func (t Transaction) IsTransparent() bool
IsTransparent returns if the transaction contains no shielded addresses
func (Transaction) TransparentInAndOut ¶
func (t Transaction) TransparentInAndOut() bool
TransparentInAndOut return if there are transparent inputs and outputs
type Unspent ¶
type Unspent struct { TxID string `json:"txid"` VOut uint32 `json:"vout"` Generated bool `json:"generated"` Address string `json:"address"` ScriptPubKey string `json:"scriptPubKey"` Amount float64 `json:"amount"` AmountZat float64 `json:"amountZat"` Confirmations int `json:"confirmations"` RedeemScript string `json:"redeemScript"` Spendable bool `json:"spendable"` }
type VIn ¶
type VIn struct { Coinbase string `json:"coinbase"` TxID string `json:"txid"` VOut int `json:"vout"` ScriptSig ScriptSig Sequence int `json:"sequemce"` }
func (*VIn) IsCoinBase ¶
IsCoinBase returns a bool to show if a Vin is a Coinbase one or not.
type VJoinSplitTX ¶
type VOut ¶
type VOut struct { Value float64 N int ScriptPubKey ScriptPubKey }
type ZGetTotalBalance ¶
type ZGetTotalBalance struct { Transparent string `json:"transparent"` Private string `json:"private"` Total string `json:"total"` }
ZGetTotalBalance return the node's wallet balances https://zcash-rpc.github.io/z_gettotalbalance.html