price

package
v1.2.7-0...-4cd777e Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

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

Hook uses levelDB to store the latest price of standard price reference.

func NewHook

func NewHook(cdc *codec.Codec, oracleKeeper keeper.Keeper, oids []types.OracleScriptID, priceDBDir string) *Hook

NewHook creates a price hook instance that will be added in Band App.

func (*Hook) AfterBeginBlock

func (h *Hook) AfterBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock)

AfterBeginBlock specify actions need to do after begin block period (app.Hook interface).

func (*Hook) AfterDeliverTx

func (h *Hook) AfterDeliverTx(ctx sdk.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx)

AfterDeliverTx specify actions need to do after transaction has been processed (app.Hook interface).

func (*Hook) AfterEndBlock

func (h *Hook) AfterEndBlock(ctx sdk.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock)

AfterEndBlock specify actions need to do after end block period (app.Hook interface).

func (*Hook) AfterInitChain

func (h *Hook) AfterInitChain(ctx sdk.Context, req abci.RequestInitChain, res abci.ResponseInitChain)

AfterInitChain specify actions need to do after chain initialization (app.Hook interface).

func (*Hook) ApplyQuery

func (h *Hook) ApplyQuery(req abci.RequestQuery) (res abci.ResponseQuery, stop bool)

ApplyQuery catch the custom query that matches specific paths (app.Hook interface).

func (*Hook) BeforeCommit

func (h *Hook) BeforeCommit()

BeforeCommit specify actions need to do before commit block (app.Hook interface).

type Input

type Input struct {
	Symbols    []string `json:"symbols"`
	Multiplier uint64   `json:"multiplier"`
}

type Output

type Output struct {
	Pxs []uint64 `json:"pxs"`
}

type Price

type Price struct {
	Symbol      string          `json:"symbol"`
	Multiplier  uint64          `json:"multiplier"`
	Px          uint64          `json:"px"`
	RequestID   types.RequestID `json:"request_id"`
	ResolveTime int64           `json:"resolve_time"`
}

func NewPrice

func NewPrice(symbol string, multiplier uint64, px uint64, reqID types.RequestID, resolveTime int64) Price

Jump to

Keyboard shortcuts

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