Documentation
¶
Index ¶
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 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 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 ResultGetIssuance ¶ added in v0.1.1
type ResultGetIssuance struct {
SyncStatus ResultGetSyncStatus `json:"sync-status"`
Issuance ResultPegnetTickerMap `json:"issuance"`
}
type ResultGetSyncStatus ¶
type ResultGetTransaction ¶
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