rpc

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func New

func New(
	assets core.AssetStore,
	vaults core.VaultStore,
	flips core.FlipStore,
	oracles core.OracleStore,
	collaterals core.CollateralStore,
	transactions core.TransactionStore,
	proposalz core.ProposalService,
	proposals core.ProposalStore,
	stats core.StatStore,
	system *core.System,
) *Server

func (*Server) FindAsset

func (s *Server) FindAsset(ctx context.Context, req *api.Req_FindAsset) (*api.Asset, error)

FindAsset godoc @Summary Find Asset By ID @Description @Tags Assets @Accept json @Produce json @param asset_id path string true "mixin asset id" @Success 200 {object} api.Asset @Router /assets/{asset_id} [get]

func (*Server) FindCollateral

func (s *Server) FindCollateral(ctx context.Context, req *api.Req_FindCollateral) (*api.Collateral, error)

FindCollateral godoc @Summary find collateral by id @Description @Tags Collaterals @Accept json @Produce json @param id path string true "collateral id" @Success 200 {object} api.Collateral @Router /cats/{id} [get]

func (*Server) FindFlip

func (s *Server) FindFlip(ctx context.Context, req *api.Req_FindFlip) (*api.Flip, error)

FindFlip godoc @Summary find flip by id @Description @Tags Flips @Accept json @Produce json @param id path string true "flip id" @Success 200 {object} api.Flip @Router /flips/{id} [get]

func (*Server) FindOracle

func (s *Server) FindOracle(ctx context.Context, req *api.Req_FindOracle) (*api.Oracle, error)

FindOracle godoc @Summary find oracle by asset id @Description @Tags Oracles @Accept json @Produce json @param asset_id path string true "mixin asset id" @Success 200 {object} api.Oracle @Router /oracles/{asset_id} [get]

func (*Server) FindProposal added in v1.8.7

func (s *Server) FindProposal(ctx context.Context, req *api.Req_FindProposal) (*api.Proposal, error)

FindProposal godoc @Summary find proposal by id @Description @Tags Proposals @Accept json @Produce json @param id path string true "proposal id" @Success 200 {object} api.Proposal @Router /proposals/{id} [get]

func (*Server) FindTransaction

func (s *Server) FindTransaction(ctx context.Context, req *api.Req_FindTransaction) (*api.Transaction, error)

FindTransaction godoc @Summary find tx by follow id @Description @Tags Transactions @Accept json @Produce json @param Authorization header string true "Example: Bearer foo" @param follow_id path string true "follow id" @Success 200 {object} api.Transaction @Router /transactions/{follow_id} [get]

func (*Server) FindVault

func (s *Server) FindVault(ctx context.Context, req *api.Req_FindVault) (*api.Vault, error)

FindVault godoc @Summary find vault by id @Description @Tags Vaults @Accept json @Produce json @param id path string true "vault id" @Success 200 {object} api.Vault @Router /vats/{id} [get]

func (*Server) GetInfo added in v1.9.4

func (s *Server) GetInfo(ctx context.Context, req *api.Req_GetInfo) (*api.Resp_GetInfo, error)

GetInfo godoc @Summary get system info @Description @Accept json @Produce json @Success 200 {object} api.Resp_GetInfo @Router /info [get]

func (*Server) Handle

func (s *Server) Handle(sessions core.Session) http.Handler

func (*Server) ListAggregatedStats added in v1.9.1

func (s *Server) ListAggregatedStats(ctx context.Context, req *api.Req_ListAggregatedStats) (*api.Resp_ListAggregatedStats, error)

ListAggregatedStats godoc @Summary list aggregated stats @Description @Tags Stats @Accept json @Produce json @param request query api.Req_ListAggregatedStats false "default limit 50" @Success 200 {object} api.Resp_ListAggregatedStats @Router /stats [get]

func (*Server) ListAssets

func (s *Server) ListAssets(ctx context.Context, _ *api.Req_ListAssets) (*api.Resp_ListAssets, error)

ListAssets godoc @Summary list assets @Description @Tags Assets @Accept json @Produce json @Success 200 {object} api.Resp_ListAssets @Router /assets [get]

func (*Server) ListCollaterals

func (s *Server) ListCollaterals(ctx context.Context, _ *api.Req_ListCollaterals) (*api.Resp_ListCollaterals, error)

ListCollaterals godoc @Summary list all collateral @Description @Tags Collaterals @Accept json @Produce json @Success 200 {object} api.Resp_ListCollaterals @Router /cats [get]

func (*Server) ListFlipEvents

func (s *Server) ListFlipEvents(ctx context.Context, req *api.Req_ListFlipEvents) (*api.Resp_ListFlipEvents, error)

ListFlipEvents godoc @Summary list flip events @Description @Tags Flips @Accept json @Produce json @param id path string true "flip id" @Success 200 {object} api.Resp_ListFlipEvents @Router /flips/{id}/events [get]

func (*Server) ListFlips

func (s *Server) ListFlips(ctx context.Context, req *api.Req_ListFlips) (*api.Resp_ListFlips, error)

ListFlips godoc @Summary list flips @Description @Tags Flips @Accept json @Produce json @param request query api.Req_ListFlips false "default limit 50" @Success 200 {object} api.Resp_ListFlips @Router /flips [get]

func (*Server) ListMyVaults

func (s *Server) ListMyVaults(ctx context.Context, req *api.Req_ListMyVaults) (*api.Resp_ListMyVaults, error)

ListMyVaults godoc @Summary list my vaults @Description @Tags Vaults @Accept json @Produce json @param request query api.Req_ListMyVaults false "default limit 50" @param Authorization header string true "Example: Bearer foo" @Success 200 {object} api.Resp_ListVaults @Router /me/vats [get]

func (*Server) ListOracles

func (s *Server) ListOracles(ctx context.Context, _ *api.Req_ListOracles) (*api.Resp_ListOracles, error)

ListOracles godoc @Summary list all oracles @Description @Tags Oracles @Accept json @Produce json @Success 200 {object} api.Resp_ListOracles @Router /oracles [get]

func (*Server) ListProposals added in v1.8.7

func (s *Server) ListProposals(ctx context.Context, req *api.Req_ListProposals) (*api.Resp_ListProposals, error)

ListProposals godoc @Summary list proposals @Description @Tags Proposals @Accept json @Produce json @param request query api.Req_ListProposals false "default limit 50" @Success 200 {object} api.Resp_ListProposals @Router /proposals [get]

func (*Server) ListStats added in v1.9.1

func (s *Server) ListStats(ctx context.Context, req *api.Req_ListStats) (*api.Resp_ListStats, error)

ListStats godoc @Summary list stats @Description @Tags Stats @Accept json @Produce json @param id path string true "collateral id" @Success 200 {object} api.Resp_ListStats false @Router /stats/{id} [get]

func (*Server) ListTransactions

func (s *Server) ListTransactions(ctx context.Context, req *api.Req_ListTransactions) (*api.Resp_ListTransactions, error)

ListTransactions godoc @Summary list transactions @Description @Tags Transactions @Accept json @Produce json @param request query api.Req_ListTransactions false "default limit 50" @Success 200 {object} api.Resp_ListTransactions @Router /transactions [get]

func (*Server) ListVaultEvents

func (s *Server) ListVaultEvents(ctx context.Context, req *api.Req_ListVaultEvents) (*api.Resp_ListVaultEvents, error)

ListVaultEvents godoc @Summary list vault events @Description @Tags Vaults @Accept json @Produce json @param id path string true "vault id" @param request query api.Req_ListVaultEvents false "default limit 50" @Success 200 {object} api.Resp_ListVaultEvents @Router /vats/{id}/events [get]

func (*Server) ListVaults

func (s *Server) ListVaults(ctx context.Context, req *api.Req_ListVaults) (*api.Resp_ListVaults, error)

ListVaults godoc @Summary list vaults @Description @Tags Vaults @Accept json @Produce json @param request query api.Req_ListVaults false "default limit 50" @Success 200 {object} api.Resp_ListVaults @Router /vats [get]

func (*Server) QueryFlips added in v1.8.9

func (s *Server) QueryFlips(ctx context.Context, req *api.Req_QueryFlips) (*api.Resp_QueryFlips, error)

QueryFlips godoc @Summary query flips @Description @Tags Flips @Accept json @Produce json @param request query api.Req_QueryFlips false "default limit 50" @Success 200 {object} api.Resp_QueryFlips @Router /query-flips [get]

func (*Server) QueryVaultEvents added in v1.9.5

func (s *Server) QueryVaultEvents(ctx context.Context, req *api.Req_QueryVaultEvents) (*api.Resp_QueryVaultEvents, error)

QueryVaultEvents godoc @Summary query vault events @Description @Tags Vaults @Accept json @Produce json @param request query api.Req_QueryVaultEvents false "default limit 50" @Success 200 {object} api.Resp_QueryVaultEvents @Router /vats/query-events [get]

func (*Server) TwirpServer

func (s *Server) TwirpServer() api.TwirpServer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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