Documentation ¶
Index ¶
- Constants
- Variables
- type APIServer
- type Client
- type Params
- type ParamsGetBank
- type ParamsGetGlobalRichList
- type ParamsGetMiningDominance
- 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 ¶
const (
PegnetdDefault = "http://localhost:8070"
)
Defaults for the factomd and factom-walletd endpoints.
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") )
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 ParamsGetBank ¶ added in v0.5.0
type ParamsGetBank struct {
Height int32 `json:"height,omitempty"`
}
func (ParamsGetBank) HasIncludePending ¶ added in v0.5.0
func (p ParamsGetBank) HasIncludePending() bool
func (ParamsGetBank) IsValid ¶ added in v0.5.0
func (p ParamsGetBank) IsValid() error
func (ParamsGetBank) ValidChainID ¶ added in v0.5.0
func (p ParamsGetBank) ValidChainID() *factom.Bytes32
type ParamsGetGlobalRichList ¶ added in v0.4.0
type ParamsGetGlobalRichList struct {
Count int `json:"count,omitempty"`
}
func (ParamsGetGlobalRichList) HasIncludePending ¶ added in v0.4.0
func (p ParamsGetGlobalRichList) HasIncludePending() bool
func (ParamsGetGlobalRichList) IsValid ¶ added in v0.4.0
func (p ParamsGetGlobalRichList) IsValid() error
func (ParamsGetGlobalRichList) ValidChainID ¶ added in v0.4.0
func (p ParamsGetGlobalRichList) ValidChainID() *factom.Bytes32
type ParamsGetMiningDominance ¶ added in v0.5.0
type ParamsGetMiningDominance struct { Start int `json:"start,omitempty"` Stop int `json:"stop,omitempty"` }
func (ParamsGetMiningDominance) HasIncludePending ¶ added in v0.5.0
func (p ParamsGetMiningDominance) HasIncludePending() bool
func (ParamsGetMiningDominance) IsValid ¶ added in v0.5.0
func (p ParamsGetMiningDominance) IsValid() error
func (ParamsGetMiningDominance) ValidChainID ¶ added in v0.5.0
func (p ParamsGetMiningDominance) ValidChainID() *factom.Bytes32
type ParamsGetPegnetBalances ¶
type ParamsGetPegnetBalances struct {
Address string `json:"address,omitempty"`
}
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 ¶ added in v0.2.1
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 ¶ added in v0.2.1
func (p ParamsGetPegnetTransaction) HasIncludePending() bool
func (ParamsGetPegnetTransaction) IsValid ¶ added in v0.2.1
func (p ParamsGetPegnetTransaction) IsValid() error
func (ParamsGetPegnetTransaction) ValidChainID ¶ added in v0.2.1
func (p ParamsGetPegnetTransaction) ValidChainID() *factom.Bytes32
type ParamsGetPegnetTransactionStatus ¶ added in v0.2.1
func (ParamsGetPegnetTransactionStatus) HasIncludePending ¶ added in v0.2.1
func (p ParamsGetPegnetTransactionStatus) HasIncludePending() bool
func (ParamsGetPegnetTransactionStatus) IsValid ¶ added in v0.2.1
func (p ParamsGetPegnetTransactionStatus) IsValid() error
func (ParamsGetPegnetTransactionStatus) ValidChainID ¶ added in v0.2.1
func (p ParamsGetPegnetTransactionStatus) ValidChainID() *factom.Bytes32
type ParamsGetRichList ¶ added in v0.4.0
type ParamsGetRichList struct { Asset string `json:"asset,omitempty"` Count int `json:"count,omitempty"` }
func (ParamsGetRichList) HasIncludePending ¶ added in v0.4.0
func (p ParamsGetRichList) HasIncludePending() bool
func (ParamsGetRichList) IsValid ¶ added in v0.4.0
func (p ParamsGetRichList) IsValid() error
func (ParamsGetRichList) ValidChainID ¶ added in v0.4.0
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 ¶ added in v0.5.0
type ResultGetIssuance ¶ added in v0.1.1
type ResultGetIssuance struct { SyncStatus ResultGetSyncStatus `json:"syncstatus"` Issuance ResultPegnetTickerMap `json:"issuance"` }
type ResultGetRichList ¶ added in v0.4.0
type ResultGetSyncStatus ¶
type ResultGetTransactionStatus ¶ added in v0.2.1
type ResultGetTransactions ¶ added in v0.2.1
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 ¶ added in v0.4.0
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