server

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 40 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)
)
View Source
var (
	UI lorca.UI
)

Functions

func AttachNode

func AttachNode(node *node.Node)

AttachNode attaches the node to the HTTP server.

func BuildSolanaAddress added in v1.1.0

func BuildSolanaAddress(encodedString string) (types.SolanaAddress, error)

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.

Types

type AllowanceResponse added in v1.4.0

type AllowanceResponse struct {
	Regular  types.SolanaTransportAllowance            `json:"regular"`
	Premined map[string]types.SolanaTransportAllowance `json:"premined"`
	Airdrop  *types.SolanaTransportAllowance           `json:"airdrop,omitempty"`
	History  []TransportHistoryRecord                  `json:"history"`
	Balance  interface{}                               `json:"balance"`
	CoinType string                                    `json:"coinType"`
}

type BalInfo added in v1.1.0

type BalInfo struct {
	SCP            float64
	SCPUnconfirmed float64
	SPFA           uint64
	SPFB           uint64
	Claim          float64
	Whale          string
}

type JSONMessage added in v1.1.0

type JSONMessage struct {
	Success bool        `json:"success"`
	Message interface{} `json:"message"`
}

func NewErrorMessage added in v1.1.0

func NewErrorMessage(message interface{}) JSONMessage

func NewSuccessMessage added in v1.1.0

func NewSuccessMessage(message interface{}) JSONMessage

type RestWallet added in v1.1.0

type RestWallet struct {
	Name         string
	LastModified time.Time
}

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      types.Timestamp `json:"time"`
	Confirmed string          `json:"confirmed"`
	Scp       float64         `json:"scp"`
	ScpFee    float64         `json:"scp_fee"`
	SpfA      float64         `json:"spfa"`
	SpfB      float64         `json:"spfb"`
}

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

func ComputeSummarizedTransactions

func ComputeSummarizedTransactions(pts []modules.ProcessedTransaction, blockHeight types.BlockHeight, wwallet modules.Wallet) ([]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               types.Timestamp `json:"time"`
	Amount             string          `json:"amount"`
	AmountSCP          float64         `json:"amount_scp"`
	AmountSPFA         float64         `json:"amount_spfa"`
	AmountSPFB         float64         `json:"amount_spfb"`
	Fee                string          `json:"fee"`
	FeeSCP             float64         `json:"fee_scp"`
	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"`
}

type TransportHistoryRecord added in v1.4.0

type TransportHistoryRecord struct {
	BurnID  types.TransactionID         `json:"burn_id"`
	Status  types.SolanaTransportStatus `json:"status"`
	Amount  string                      `json:"currency"`
	Created types.Timestamp             `json:"created"`
}

type TxDetails added in v1.1.0

type TxDetails struct {
	Timestamp types.Timestamp
	TxID      types.TransactionID
	TxType    modules.TXType
	TxBlock   types.BlockHeight
	Inputs    []TxInput
	Outputs   []TxOutput
}

type TxInput added in v1.1.0

type TxInput struct {
	Value    types.Currency
	Address  types.UnlockHash
	FundType string
}

type TxOutput added in v1.1.0

type TxOutput struct {
	Value    types.Currency
	Address  types.UnlockHash
	FundType string
}

type Vote added in v1.3.0

type Vote struct {
	StartDate      time.Time    `json:"start_date"`
	EndDate        time.Time    `json:"end_date"`
	Title          string       `json:"title"`
	Description    string       `json:"description"`
	DescriptionURL string       `json:"description_url"`
	VotedFor       string       `json:"voted_for"`
	VoteOptions    []VoteOption `json:"vote_options"`
}

type VoteOption added in v1.3.0

type VoteOption struct {
	Description string `json:"description"`
	VoteAddress string `json:"vote_address"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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