Versions in this module Expand all Collapse all v0 v0.1.1 May 12, 2023 Changes in this version + const ClientVersion + const ProtocolVersion + var DebugMode bool + var ErrCheckpointHeight = errors.New("checkpoint height must be greater than or equal to block height") + var ErrDeprecated = errors.New("RPC call has been deprecated") + var ErrNotImplemented = errors.New("RPC call is not implemented") + var ErrServerConnected = errors.New("server is already connected") + var ErrServerShutdown = errors.New("server has shutdown") + var ErrTimeout = errors.New("request timeout") + type GetBalanceResp struct + Result GetBalanceResult + type GetBalanceResult struct + Confirmed float64 + Unconfirmed float64 + type GetBlockHeaderResp struct + Result *GetBlockHeaderResult + type GetBlockHeaderResult struct + Branch []string + Header string + Root string + type GetBlockHeadersResp struct + Result *GetBlockHeadersResult + type GetBlockHeadersResult struct + Branch []string + Count uint32 + Headers string + Max uint32 + Root string + type GetFeeResp struct + Result float32 + type GetMempoolResp struct + Result []*GetMempoolResult + type GetMempoolResult struct + Fee uint32 + Hash string + Height int32 + type GetMerkleProofFromPosResp struct + Result *GetMerkleProofFromPosResult + type GetMerkleProofFromPosResult struct + Hash string + Merkle []string + type GetMerkleProofResp struct + Result *GetMerkleProofResult + type GetMerkleProofResult struct + Height uint32 + Merkle []string + Position uint32 + type GetTransactionResp struct + Result *GetTransactionResult + type GetTransactionResult struct + Blockhash string + Blocktime uint64 + Confirmations int32 + Hash string + Hex string + Locktime uint32 + Merkle GetMerkleProofResult + Size uint32 + Time uint64 + Version uint32 + Vin []Vin + Vout []Vout + type ListUnspentResp struct + Result []*ListUnspentResult + type ListUnspentResult struct + Hash string + Height uint32 + Position uint32 + Value uint64 + type ScriptPubkey struct + AddressSlice []string + Addresses string + Asm string + Hex string + ReqSigs uint32 + Type string + type ScriptSig struct + Asm string + Hex string + type ScripthashSubscription struct + func (sub *ScripthashSubscription) Add(scripthash string, address ...string) error + func (sub *ScripthashSubscription) GetAddress(scripthash string) (string, error) + func (sub *ScripthashSubscription) GetChannel() <-chan *SubscribeNotif + func (sub *ScripthashSubscription) GetScripthash(address string) (string, error) + func (sub *ScripthashSubscription) Remove(scripthash string) error + func (sub *ScripthashSubscription) RemoveAddress(address string) error + func (sub *ScripthashSubscription) Resubscribe() error + type Server struct + Error chan error + func NewServer(opts *ServerOptions) *Server + func (s *Server) BroadcastTransaction(rawTx string) (string, error) + func (s *Server) ConnectSSL(addr string, config *tls.Config) error + func (s *Server) ConnectTCP(addr string) error + func (s *Server) GetBalance(scripthash string) (GetBalanceResult, error) + func (s *Server) GetBlockHeader(height uint32, checkpointHeight ...uint32) (*GetBlockHeaderResult, error) + func (s *Server) GetBlockHeaders(startHeight, count uint32, checkpointHeight ...uint32) (*GetBlockHeadersResult, error) + func (s *Server) GetFee(target uint32) (float32, error) + func (s *Server) GetFeeHistogram() (map[uint32]uint64, error) + func (s *Server) GetHashFromPosition(height, position uint32) (string, error) + func (s *Server) GetHistory(scripthash string) ([]*GetMempoolResult, error) + func (s *Server) GetMempool(scripthash string) ([]*GetMempoolResult, error) + func (s *Server) GetMerkleProof(txHash string, height uint32) (*GetMerkleProofResult, error) + func (s *Server) GetMerkleProofFromPosition(height, position uint32) (*GetMerkleProofFromPosResult, error) + func (s *Server) GetRawTransaction(txHash string) (string, error) + func (s *Server) GetRelayFee() (float32, error) + func (s *Server) GetTransaction(txHash string) (*GetTransactionResult, error) + func (s *Server) IsShutdown() bool + func (s *Server) ListUnspent(scripthash string) ([]*ListUnspentResult, error) + func (s *Server) Ping() error + func (s *Server) ServerAddPeer(features *ServerFeaturesResult) error + func (s *Server) ServerBanner() (string, error) + func (s *Server) ServerDonation() (string, error) + func (s *Server) ServerFeatures() (*ServerFeaturesResult, error) + func (s *Server) ServerPeers() (interface{}, error) + func (s *Server) ServerVersion() (serverVer, protocolVer string, err error) + func (s *Server) Shutdown() + func (s *Server) SubscribeHeaders() (<-chan *SubscribeHeadersResult, error) + func (s *Server) SubscribeMasternode(collateral string) (<-chan string, error) + func (s *Server) SubscribeScripthash() (*ScripthashSubscription, <-chan *SubscribeNotif) + type ServerFeaturesResp struct + Result *ServerFeaturesResult + type ServerFeaturesResult struct + GenesisHash string + HashFunction string + Hosts map[string]host + ProtocolMax string + ProtocolMin string + Pruning bool + ServerVersion string + type ServerOptions struct + ConnTimeout time.Duration + ReqTimeout time.Duration + type ServerVersionResp struct + Result [2]string + type SubscribeHeadersNotif struct + Params []*SubscribeHeadersResult + type SubscribeHeadersResp struct + Result *SubscribeHeadersResult + type SubscribeHeadersResult struct + Height int32 + Hex string + type SubscribeNotif struct + Params [2]string + type TCPTransport struct + func NewSSLTransport(addr string, config *tls.Config, timeout time.Duration) (*TCPTransport, error) + func NewTCPTransport(addr string, timeout time.Duration) (*TCPTransport, error) + func (t *TCPTransport) Close() error + func (t *TCPTransport) Errors() <-chan error + func (t *TCPTransport) Responses() <-chan []byte + func (t *TCPTransport) SendMessage(body []byte) error + type Transport interface + Close func() error + Errors func() <-chan error + Responses func() <-chan []byte + SendMessage func([]byte) error + type Vin struct + Coinbase string + ScriptSig *ScriptSig + Sequence uint32 + TxID string + Vout uint32 + type Vout struct + N uint32 + ScriptPubkey ScriptPubkey + Value float64