rpc

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: GPL-3.0 Imports: 13 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,
) *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) 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) Handle

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

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_ListVaults, 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) 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) TwirpServer

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

Directories

Path Synopsis
Package api is a generated twirp stub package.
Package api is a generated twirp stub package.

Jump to

Keyboard shortcuts

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