Documentation ¶
Index ¶
- Variables
- type APIServer
- type Client
- type Params
- type ParamsGetGlobalRichList
- type ParamsGetPegnetBalances
- type ParamsGetPegnetRates
- type ParamsGetPegnetTransaction
- type ParamsGetPegnetTransactionStatus
- type ParamsGetRichList
- type ParamsGetTransaction
- type ParamsSendTransaction
- type ParamsToken
- type PegnetdProperties
- type ResultGetIssuance
- type ResultGetRichList
- type ResultGetSyncStatus
- type ResultGetTransactionStatus
- type ResultGetTransactions
- type ResultGlobalRichList
- type ResultPegnetTickerMap
Constants ¶
This section is empty.
Variables ¶
var ( ErrorTokenNotFound = jrpc.NewError(-32800, "Token Not Found", "token may be invalid, or not yet issued or tracked") ErrorTransactionNotFound = jrpc.NewError(-32803, "Transaction Not Found", "no matching tx-id was found") ErrorInvalidTransaction = jrpc.NewError(-32804, "Invalid Transaction", nil) ErrorTokenSyncing = jrpc.NewError(-32805, "Token Syncing", "token is in the process of syncing") ErrorNoEC = jrpc.NewError(-32806, "No Entry Credits", "not configured with entry credits") ErrorPendingDisabled = jrpc.NewError(-32807, "Pending Transactions Disabled", "fatd is not tracking pending transactions") ErrorAddressNotFound = jrpc.NewError(-32808, "Address Not Found", "address may be invalid, or not yet tracked") ErrorNotFound = jrpc.NewError(-32809, "Not Found", "could not find what you were looking for") )
var (
PegnetdDefault = "http://localhost:8070"
)
Defaults for the factomd and factom-walletd endpoints.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
APIServer is to avoid the need of keeping state objects in a global space. It can hold the full pegnet node, since that will give us complete access to not only the node related database, but also the FactomClient for factomd interaction.
func (*APIServer) Start ¶
func (s *APIServer) Start(stop <-chan struct{}) (done <-chan struct{})
Start the server in its own goroutine. If stop is closed, the server is closed and any goroutines will exit. The done channel is closed when the server exits for any reason. If the done channel is closed before the stop channel is closed, an error occurred. Errors are logged.
type Client ¶
Client makes RPC requests to pegnetd's APIs. Client embeds a jsonrpc2.Client, and thus also the http.Client. Use jsonrpc2.Client's BasicAuth settings to set up BasicAuth and http.Client's transport settings to configure TLS.
type ParamsGetGlobalRichList ¶
type ParamsGetGlobalRichList struct {
Count int `json:"count,omitempty"`
}
func (ParamsGetGlobalRichList) HasIncludePending ¶
func (p ParamsGetGlobalRichList) HasIncludePending() bool
func (ParamsGetGlobalRichList) IsValid ¶
func (p ParamsGetGlobalRichList) IsValid() error
func (ParamsGetGlobalRichList) ValidChainID ¶
func (p ParamsGetGlobalRichList) ValidChainID() *factom.Bytes32
type ParamsGetPegnetBalances ¶
func (ParamsGetPegnetBalances) HasIncludePending ¶
func (p ParamsGetPegnetBalances) HasIncludePending() bool
func (ParamsGetPegnetBalances) IsValid ¶
func (p ParamsGetPegnetBalances) IsValid() error
func (ParamsGetPegnetBalances) ValidChainID ¶
func (p ParamsGetPegnetBalances) ValidChainID() *factom.Bytes32
type ParamsGetPegnetRates ¶
type ParamsGetPegnetRates struct {
Height *uint32 `json:"height,omitempty"`
}
func (ParamsGetPegnetRates) HasIncludePending ¶
func (ParamsGetPegnetRates) HasIncludePending() bool
func (ParamsGetPegnetRates) IsValid ¶
func (p ParamsGetPegnetRates) IsValid() error
func (ParamsGetPegnetRates) ValidChainID ¶
func (ParamsGetPegnetRates) ValidChainID() *factom.Bytes32
type ParamsGetPegnetTransaction ¶
type ParamsGetPegnetTransaction struct { Hash string `json:"entryhash,omitempty"` Address string `json:"address,omitempty"` Height int `json:"height,omitempty"` Offset int `json:"offset,omitempty"` Desc bool `json:"desc,omitempty"` Transfer bool `json:"transfer,omitempty"` Conversion bool `json:"conversion,omitempty"` Coinbase bool `json:"coinbase,omitempty"` Burn bool `json:"burn,omitempty"` Asset string `json:"asset,omitempty"` // TxID is in the format #-[Entryhash], where '#' == tx index TxID string `json:"txid,omitempty"` // contains filtered or unexported fields }
ParamsGetPegnetTransaction are the parameters for retrieving transactions from the history system. You need to specify exactly one of either `hash`, `address`, or `height`. `offset` is the value from a previous query's `nextoffset`. `desc` returns transactions in newest->oldest order
func (ParamsGetPegnetTransaction) HasIncludePending ¶
func (p ParamsGetPegnetTransaction) HasIncludePending() bool
func (ParamsGetPegnetTransaction) IsValid ¶
func (p ParamsGetPegnetTransaction) IsValid() error
func (ParamsGetPegnetTransaction) ValidChainID ¶
func (p ParamsGetPegnetTransaction) ValidChainID() *factom.Bytes32
type ParamsGetPegnetTransactionStatus ¶
func (ParamsGetPegnetTransactionStatus) HasIncludePending ¶
func (p ParamsGetPegnetTransactionStatus) HasIncludePending() bool
func (ParamsGetPegnetTransactionStatus) IsValid ¶
func (p ParamsGetPegnetTransactionStatus) IsValid() error
func (ParamsGetPegnetTransactionStatus) ValidChainID ¶
func (p ParamsGetPegnetTransactionStatus) ValidChainID() *factom.Bytes32
type ParamsGetRichList ¶
type ParamsGetRichList struct { Asset string `json:"asset,omitempty"` Count int `json:"count,omitempty"` }
func (ParamsGetRichList) HasIncludePending ¶
func (p ParamsGetRichList) HasIncludePending() bool
func (ParamsGetRichList) IsValid ¶
func (p ParamsGetRichList) IsValid() error
func (ParamsGetRichList) ValidChainID ¶
func (p ParamsGetRichList) ValidChainID() *factom.Bytes32
type ParamsGetTransaction ¶
type ParamsGetTransaction struct { ParamsToken Hash *factom.Bytes32 `json:"entryhash"` TxIndex uint64 `json:"txindex,omitempty"` }
ParamsGetTransaction is used to query for a single particular transaction with the given Entry Hash.
func (ParamsGetTransaction) IsValid ¶
func (p ParamsGetTransaction) IsValid() error
type ParamsSendTransaction ¶
type ParamsSendTransaction struct { ParamsToken ExtIDs []factom.Bytes `json:"extids,omitempty"` Content factom.Bytes `json:"content,omitempty"` Raw factom.Bytes `json:"raw,omitempty"` DryRun bool `json:"dryrun,omitempty"` // contains filtered or unexported fields }
func (ParamsSendTransaction) Entry ¶
func (p ParamsSendTransaction) Entry() factom.Entry
func (*ParamsSendTransaction) IsValid ¶
func (p *ParamsSendTransaction) IsValid() error
type ParamsToken ¶
ParamsToken scopes a request down to a single FAT token using either the ChainID or both the TokenID and the IssuerChainID.
func (ParamsToken) HasIncludePending ¶
func (p ParamsToken) HasIncludePending() bool
func (ParamsToken) IsValid ¶
func (p ParamsToken) IsValid() error
func (ParamsToken) ValidChainID ¶
func (p ParamsToken) ValidChainID() *factom.Bytes32
type PegnetdProperties ¶
type ResultGetIssuance ¶
type ResultGetIssuance struct { SyncStatus ResultGetSyncStatus `json:"syncstatus"` Issuance ResultPegnetTickerMap `json:"issuance"` }
type ResultGetRichList ¶
type ResultGetSyncStatus ¶
type ResultGetTransactions ¶
type ResultGetTransactions struct { Actions interface{} `json:"actions"` Count int `json:"count"` NextOffset int `json:"nextoffset"` }
ResultGetTransactions returns history entries. `Actions` contains []pegnet.HistoryTransaction. `Count` is the total number of possible transactions `NextOffset` returns the offset to use to get the next set of records.
0 means no more records available
type ResultGlobalRichList ¶
type ResultPegnetTickerMap ¶
TODO: This is incompatible with FAT.
func (ResultPegnetTickerMap) MarshalJSON ¶
func (r ResultPegnetTickerMap) MarshalJSON() ([]byte, error)
func (*ResultPegnetTickerMap) UnmarshalJSON ¶
func (r *ResultPegnetTickerMap) UnmarshalJSON(data []byte) error