server

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParseCurrencyAmount is returned when the input is unable to be parsed
	// into a currency unit due to a malformed amount.
	ErrParseCurrencyAmount = errors.New("malformed amount")
	// ErrParseCurrencyInteger is returned when the input is unable to be parsed
	// into a currency unit due to a non-integer value.
	ErrParseCurrencyInteger = errors.New("non-integer number of hastings")
	// ErrParseCurrencyUnits is returned when the input is unable to be parsed
	// into a currency unit due to missing units.
	ErrParseCurrencyUnits = errors.New("amount is missing currency units. Currency units are case sensitive")
	// ErrNegativeCurrency is the error that is returned if performing an
	// operation results in a negative currency.
	ErrNegativeCurrency = errors.New("negative currency not allowed")
	// ErrUint64Overflow is the error that is returned if converting to a
	// unit64 would cause an overflow.
	ErrUint64Overflow = errors.New("cannot return the uint64 of this currency - result is an overflow")
	// ZeroCurrency defines a currency of value zero.
	ZeroCurrency = types.NewCurrency64(0)
)

Functions

func AttachNode

func AttachNode(node *node.Node)

AttachNode attaches the node to the HTTP server.

func CloseAllWallets added in v0.1.4

func CloseAllWallets() (err error)

CloseAllWallets closes all wallets and detaches them from the node.

func IsRunning added in v0.1.4

func IsRunning() bool

IsRunning returns true when the server is running

func NewCurrencyStr

func NewCurrencyStr(amount string) (types.Currency, error)

NewCurrencyStr creates a Currency value from a supplied string with unit suffix. Valid unit suffixes are: H, pS, nS, uS, mS, SCP, KS, MS, GS, TS, SPF Unit Suffixes are case sensitive.

func StartHTTPServer

func StartHTTPServer(webWalletConfig *wwConfig.WebWalletConfig)

StartHTTPServer starts the HTTP server to serve the GUI.

func Wait

func Wait() chan struct{}

Wait returns the servers wait channel

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is a struct that tracks session settings

type SummarizedTransaction

type SummarizedTransaction struct {
	TxnID     string `json:"txn_id"`
	Type      string `json:"type"`
	Time      string `json:"time"`
	Confirmed string `json:"confirmed"`
	Scp       string `json:"scp"`
	Spf       string `json:"spf"`
}

SummarizedTransaction is a transaction that has been formatted for· humans to read.

func ComputeSummarizedTransactions

func ComputeSummarizedTransactions(pts []modules.ProcessedTransaction, blockHeight types.BlockHeight) ([]SummarizedTransaction, error)

ComputeSummarizedTransactions creates a set of SummarizedTransactions from a set of ProcessedTransactions.

type TransactionHistoryLine added in v0.2.0

type TransactionHistoryLine struct {
	TransactionID      string `json:"transaction_id"`
	ShortTransactionID string `json:"short_transaction_id"`
	Type               string `json:"type"`
	Time               string `json:"time"`
	Amount             string `json:"amount"`
	Confirmed          string `json:"confirmed"`
}

type TransactionHistoryPage added in v0.2.0

type TransactionHistoryPage struct {
	TransactionHistoryLines []TransactionHistoryLine `json:"lines"`
	Current                 int                      `json:"current"`
	Total                   int                      `json:"total"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL