Versions in this module Expand all Collapse all v1 v1.1.0 Jan 25, 2020 Changes in this version + const AccountTypeBasic + const AccountTypeHTLC + const AccountTypeVesting + var ErrNotAuthenticated = errors.New("not authenticated") + func NewRequest(method string, params ...interface{}) *jsonrpc.RPCRequest type Block + TransactionHashes []string + TransactionObjects []Transaction + type BlockTemplateBody struct + ExtraData string + Hash string + MerkleHashes []string + MinerAddr string + PrunedAccounts []string + Transactions []string + type BlockTemplateHeader struct + AccountHash string + Height int + InterlinkHash string + NBits int + PrevHash string + Version int type Client + func NewClientWithAuth(address, username, password string) *Client + func (nc *Client) Call(method string, params interface{}) (*jsonrpc.RPCResponse, error) + func (nc *Client) CallBatch(reqs ...*jsonrpc.RPCRequest) (jsonrpc.RPCResponses, error) + func (nc *Client) PeerList() (peers []Peer, err error) + func (nc *Client) PeerState(peerAddress string, update ...string) (peer *Peer, err error) type Luna + func FormatLuna(n NIM) (Luna, error) type NIM + func FormatNIM(l Luna) NIM + type Peer struct + Address string + AddressState int + ConnectionState int + HeadHash string + ID string + Latency int + RX int + TX int + TimeOffset int + Version int v1.0.0 Dec 14, 2019 Changes in this version + var ErrRPCIDMismatch = errors.New("JSON-RPC: The request ID and the response ID didn't match") + var ErrRPCInternal = errors.New("JSON-RPC: Internal JSON-RPC error") + var ErrRPCInvalidParams = errors.New("JSON-RPC: Invalid method parameter(s)") + var ErrRPCInvalidReq = errors.New("JSON-RPC: The JSON sent is not a valid Request object") + var ErrRPCMethodNotFound = errors.New("JSON-RPC: The method does not exist / is not available") + var ErrRPCParse = errors.New(...) + var ErrRPCServer = errors.New("JSON-RPC: Server error") + var ErrRespBodyEmpty = errors.New("The HTTP response body was empty") + var ErrResultUnexpected = errors.New("Unexpected result") + var ErrUnauthorized = errors.New("Unauthorized to do the request") + type Account struct + Address string + Balance Luna + HashCount int + HashRoot string + ID string + Owner string + OwnerAddress string + Recipient string + RecipientAddress string + Sender string + SenderAddress string + Timeout int + TotalAmount int + Type int + VestingStart int + VestingStepAmount int + VestingStepBlocks int + VestingTotalAmount int + type AddressObject struct + Address string + ID string + type Block struct + AccountHash string + BodyHash string + Difficulty string + ExtraData string + Hash string + Miner string + MinerAddress string + Nonce int + Number int + POW string + ParentHash string + Size int + Timestamp int + Transactions json.RawMessage + TransactionsHashes []string + TransactionsObjects []Transaction + type BlockTemplate struct + Body struct{ ... } + Header struct{ ... } + Interlink string + Target int + type Client struct + Address string + Headers http.Header + Transport http.RoundTripper + func NewClient(address string) *Client + func (nc *Client) Accounts() (accounts []Account, err error) + func (nc *Client) BlockNumber() (blockHeight int, err error) + func (nc *Client) Consensus() (consensus string, err error) + func (nc *Client) CreateAccount() (wallet *Wallet, err error) + func (nc *Client) CreateRawTransaction(trn OutgoingTransaction) (transactionHex string, err error) + func (nc *Client) GetAccount(address string) (account *Account, err error) + func (nc *Client) GetBalance(address string) (balance Luna, err error) + func (nc *Client) GetBlockByHash(blockHash string, fullTransactions bool) (block *Block, err error) + func (nc *Client) GetBlockByNumber(blockNumber int, fullTransactions bool) (block *Block, err error) + func (nc *Client) GetBlockTemplate(params ...interface{}) (template *BlockTemplate, err error) + func (nc *Client) GetBlockTransactionCountByHash(blockHash string) (transactionCount int, err error) + func (nc *Client) GetBlockTransactionCountByNumber(blockNumber int) (transactionCount int, err error) + func (nc *Client) GetTransactionByBlockHashAndIndex(blockHash string, index int) (transaction *Transaction, err error) + func (nc *Client) GetTransactionByBlockNumberAndIndex(blockNumber int, index int) (transaction *Transaction, err error) + func (nc *Client) GetTransactionByHash(transactionHash string) (transaction *Transaction, err error) + func (nc *Client) GetTransactionReceipt(transactionHash string) (transactionReceipt *TransactionReceipt, err error) + func (nc *Client) GetTransactionsByAddress(address string, maxEntries int) (transactions []Transaction, err error) + func (nc *Client) GetWork(params ...interface{}) (work *Work, err error) + func (nc *Client) Hashrate() (hashrate float64, err error) + func (nc *Client) Log(tag string, level LogLevel) (succes bool, err error) + func (nc *Client) Mempool() (mempool *Mempool, err error) + func (nc *Client) Mining() (status bool, err error) + func (nc *Client) PeerCount() (peers int, err error) + func (nc *Client) RawCall(req *RPCRequest) (resp *RPCResponse, err error) + func (nc *Client) SendRawTransaction(signedTransaction string) (transactionHash string, err error) + func (nc *Client) SendTransaction(trn OutgoingTransaction) (transactionHash string, err error) + func (nc *Client) SubmitBlock(fullBlock string) (err error) + func (nc *Client) Syncing() (syncing bool, syncStatus *SyncStatus, err error) + type LogLevel string + const LogLevelAssert + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelTrace + const LogLevelVerbose + const LogLevelWarn + type Luna int64 + func (l *Luna) ToNIM() NIM + type Mempool struct + Bucket0 int + Bucket1 int + Bucket10 int + Bucket100 int + Bucket1000 int + Bucket2 int + Bucket20 int + Bucket200 int + Bucket2000 int + Bucket5 int + Bucket50 int + Bucket500 int + Bucket5000 int + Buckets []int + Total int + type NIM float64 + func (n *NIM) ToLuna() Luna + type OutgoingTransaction struct + Data string + Fee int + From string + FromType int + To string + ToType int + Value int + type RPCError struct + Code int + Data string + Message string + func (re *RPCError) Parse() error + type RPCRequest struct + ID int + JSONRPC string + Method string + Params interface{} + func NewRPCRequest(method string, params interface{}) *RPCRequest + type RPCResponse struct + Error RPCError + ID int + JSONRPC string + Result json.RawMessage + type SyncStatus struct + CurrentBlock int + HighestBlock int + StartingBlock int + type Transaction struct + BlockHash string + BlockNumber int + Confirmations int + Data string + Fee int + Flags int + From string + FromAddress string + Hash string + Timestamp int + To string + ToAddress string + TransactionIndex int + Value int + type TransactionReceipt struct + BlockHash string + BlockNumber int + Confirmations int + Timestamp int + TransactionHash string + TransactionIndex int + type Wallet struct + Address string + ID string + PrivateKey string + PublicKey string + type Work struct + Algorithm string + Data string + Suffix string + Target int