Documentation
¶
Overview ¶
Package user is responsible for user communication. This is an API user should use to connect to the test node. Later we will add wallet API
Index ¶
- type API
- func (tc *API) Balance(publicKey ed25519.PublicKey) (int64, error)
- func (tc *API) TransactionsTotal() uint64
- func (tc *API) Transfer(from *block.KeyPair, to ed25519.PublicKey, token int64, vdf block.VDFValue)
- func (tc *API) TransferTransaction(tran block.Transaction)
- func (tc *API) ValidVDFValue() block.VDFValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API object is for querying and sending transactions to the network.
func NewUserAPI ¶
func NewUserAPI(ra net.Addr, ta net.Addr, rs net.PacketConn, ts net.PacketConn) *API
NewUserAPI creates new API object.
func (*API) Balance ¶
Balance method requests balance of user holding 'publicKey' and blocks until the server sends a response. If the response packet is dropped by the network, this method will hang indefinitely.
func (*API) TransactionsTotal ¶
TransactionsTotal requests the transaction count from server. If the response packet is dropped by the network, this method will hang.
func (*API) TransferTransaction ¶
func (tc *API) TransferTransaction(tran block.Transaction)
TransferTransaction will transfer transaction to the transactionSocket
func (*API) ValidVDFValue ¶
ValidVDFValue method queries producer for the valid vdf saved in the ledger and returns the result. If producer will not respond or the request will be lost this method will hang.