public

package
v0.0.0-...-ce930bf Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package public maintains the group of handlers for public access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(app *web.App, cfg Config)

Routes binds all the public routes.

Types

type Config

type Config struct {
	Log   *zap.SugaredLogger
	State *state.State
	NS    *nameservice.NameService
	Evts  *events.Events
}

Config contains all the mandatory systems required by handlers.

type Handlers

type Handlers struct {
	Log   *zap.SugaredLogger
	State *state.State
	NS    *nameservice.NameService
	WS    websocket.Upgrader
	Evts  *events.Events
}

Handlers manages the set of bar ledger endpoints.

func (Handlers) Accounts

func (h Handlers) Accounts(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Accounts returns the current balances for all users.

func (Handlers) BlocksByAccount

func (h Handlers) BlocksByAccount(ctx context.Context, w http.ResponseWriter, r *http.Request) error

BlocksByAccount returns all the blocks and their details.

func (Handlers) Events

Events handles a web socket to provide events to a client.

func (Handlers) Genesis

func (h Handlers) Genesis(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Genesis returns the genesis information.

func (Handlers) Mempool

func (h Handlers) Mempool(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Mempool returns the set of uncommitted transactions.

func (Handlers) SubmitWalletTransaction

func (h Handlers) SubmitWalletTransaction(ctx context.Context, w http.ResponseWriter, r *http.Request) error

SubmitWalletTransaction adds new transactions to the mempool.

Jump to

Keyboard shortcuts

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