Documentation ¶
Index ¶
- Variables
- func GetBlockByFile(c rpctypes.Connection, filekey Wallet.PublicKey, pubkey Wallet.PublicKey) (resp nanofytypes.Response, err error)
- func GetBlockByHash(c rpctypes.Connection, hash []byte) (Block.UniversalBlock, error)
- func GetBlockByStringHash(c rpctypes.Connection, hash string) (Block.UniversalBlock, error)
- func NewBlockByStringHash(hash string) (req internal.RetrieveBlockRequest)
- func StartWebsocket() error
- type AccountBalance
- type AccountBalances
- type AccountHistory
- type AccountHistoryRequest
- type AccountInformation
- type AccountInformationRequest
- type AccountPending
- type AccountsBalancesRequest
- type AccountsPendingOriginal
- type AccountsPendingRequest
- type DefaultRequest
- type DefaultResponse
- type MultiplesAccountsBalance
- type MultiplesAccountsPending
- type ProcessBlock
- type RetrieveBlock
- type SingleHistory
- type SinglePending
Constants ¶
This section is empty.
Variables ¶
var ErrBadAddress = errors.New("Bad account number")
var ErrEmpty = errors.New("empty")
var ErrNotOpenedAccount = errors.New("Account not found")
Functions ¶
func GetBlockByFile ¶
func GetBlockByFile(c rpctypes.Connection, filekey Wallet.PublicKey, pubkey Wallet.PublicKey) (resp nanofytypes.Response, err error)
func GetBlockByHash ¶
func GetBlockByHash(c rpctypes.Connection, hash []byte) (Block.UniversalBlock, error)
func GetBlockByStringHash ¶
func GetBlockByStringHash(c rpctypes.Connection, hash string) (Block.UniversalBlock, error)
func NewBlockByStringHash ¶
func NewBlockByStringHash(hash string) (req internal.RetrieveBlockRequest)
func StartWebsocket ¶
func StartWebsocket() error
Types ¶
type AccountBalance ¶
func GetAccountBalance ¶
func GetAccountBalance(c rpctypes.Connection, addr Wallet.Address) (AccountBalance, error)
GetAccountBalance will retrieve the amount and pending from given account address. It will return an non-nil error if can't reach the server or the address is invalid.
type AccountBalances ¶
type AccountBalances struct { Balances map[Wallet.Address]AccountBalance DefaultResponse }
type AccountHistory ¶
type AccountHistory []SingleHistory
func GetAccountHistory ¶
func GetAccountHistory(c rpctypes.Connection, limit int, addr Wallet.Address) (resp AccountHistory, err error)
GetAccountHistory will retrieve all the history (Send/Receive) from given account address. It will return an non-nil error if can't reach the server or the address is not opened, not having an "OpenBlock".
func (*AccountHistory) UnmarshalJSON ¶
func (d *AccountHistory) UnmarshalJSON(data []byte) (err error)
type AccountHistoryRequest ¶
type AccountHistoryRequest struct { Account Wallet.Address `json:"account"` Count int `json:"count"` DefaultRequest }
func NewAccountHistory ¶
func NewAccountHistory(limit int, addr Wallet.Address) AccountHistoryRequest
type AccountInformation ¶
type AccountInformation struct { Frontier Block.BlockHash `json:"frontier"` OpenBlock Block.BlockHash `json:"open_block"` RepresentativeBlock Block.BlockHash `json:"representative_block"` Balance *Numbers.RawAmount `json:"balance"` BlockCount uint64 `json:"block_count,string"` Pending *Numbers.RawAmount `json:"pending,omitempty"` DefaultResponse }
func GetAccountInformation ¶
func GetAccountInformation(c rpctypes.Connection, addr Wallet.Address) (AccountInformation, error)
type AccountInformationRequest ¶
type AccountInformationRequest struct { Account Wallet.Address `json:"account"` Weight bool `json:"weight,omitempty"` Pending bool `json:"pending,omitempty"` DefaultRequest }
func NewAccountInformation ¶
func NewAccountInformation(addr Wallet.Address) AccountInformationRequest
type AccountPending ¶
type AccountPending []SinglePending
func GetAccountPending ¶
func GetAccountPending(c rpctypes.Connection, limit int, minimum *Numbers.RawAmount, addr Wallet.Address) (AccountPending, error)
type AccountsBalancesRequest ¶
type AccountsBalancesRequest struct { Accounts []Wallet.Address `json:"accounts"` DefaultRequest }
func NewAccountBalance ¶
func NewAccountBalance(addr Wallet.Address) AccountsBalancesRequest
@TODO Use custom UnmarshalJSON/MarshalJSON and rewrite the entire code.
func NewMultiAccountsBalance ¶
func NewMultiAccountsBalance(addr ...Wallet.Address) AccountsBalancesRequest
type AccountsPendingOriginal ¶
type AccountsPendingOriginal map[string]SinglePending
func (*AccountsPendingOriginal) UnmarshalJSON ¶
func (d *AccountsPendingOriginal) UnmarshalJSON(data []byte) (err error)
type AccountsPendingRequest ¶
type AccountsPendingRequest struct { Accounts []Wallet.Address `json:"accounts"` Count int `json:"count"` Threshold *Numbers.RawAmount `json:"threshold"` Source bool `json:"source"` DefaultRequest }
func NewAccountPending ¶
func NewMultiAccountsPending ¶
type DefaultRequest ¶
type DefaultResponse ¶
type DefaultResponse struct {
Error string `json:"error,omitempty"`
}
type MultiplesAccountsBalance ¶
type MultiplesAccountsBalance map[Wallet.Address]AccountBalance
func GetMultiAccountsBalance ¶
func GetMultiAccountsBalance(c rpctypes.Connection, addr ...Wallet.Address) (MultiplesAccountsBalance, error)
GetMultiAccountsBalance will do the same from GetAccountBalance but will return an map, the index of the map will the address. Each value from the map is the respective balance/amount.
type MultiplesAccountsPending ¶
type MultiplesAccountsPending map[Wallet.Address]AccountPending
func GetMultiAccountsPending ¶
func GetMultiAccountsPending(c rpctypes.Connection, limit int, minimum *Numbers.RawAmount, addr ...Wallet.Address) (MultiplesAccountsPending, error)
type ProcessBlock ¶
func BroadcastBlock ¶
func BroadcastBlock(c rpctypes.Connection, block Block.BlockTransaction) (resp ProcessBlock, err error)
BroadcastBlock will perform the PoW and broadcast the block to the network
type RetrieveBlock ¶
type RetrieveBlock struct {
Block Block.BlockTransaction
}