lp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_NO_ENOUGH_BALANCE = errors.New("err_no_enough_balance")
	ERR_INVALID_AMOUNT    = errors.New("err_invalid_amount")
)
View Source
var LpName = "lp-golang"
View Source
var LpVersion = "v0.5.2"

Functions

func LpToAddMsg

func LpToAddMsg(lp coreSchema.Lp) routerSchema.LpMsgAdd

func LpToRemoveMsg

func LpToRemoveMsg(lp coreSchema.Lp) routerSchema.LpMsgRemove

Types

type Lp

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

func New

func New(chainID int64, apiEnabled bool, rsdk *RSDK) *Lp

func (*Lp) Close

func (l *Lp) Close()

func (*Lp) Run

func (l *Lp) Run(configPath string)

func (*Lp) UpdateLiquidity

func (l *Lp) UpdateLiquidity() error

type RSDK

type RSDK struct {
	AccID string

	EverSDK *sdk.SDK
	// contains filtered or unexported fields
}

RSDK is RouterSDK

func NewRSDK

func NewRSDK(wsURL, httpURL string, everSDK *sdk.SDK) *RSDK

func (*RSDK) AddLiquidity

func (r *RSDK) AddLiquidity(msg schema.LpMsgAdd) error

func (*RSDK) Close

func (r *RSDK) Close()

func (*RSDK) GetBalance

func (r *RSDK) GetBalance(tokenTag string) (amount string, err error)

func (*RSDK) GetInfo

func (r *RSDK) GetInfo() (info schema.InfoRes, err error)

func (*RSDK) GetLps

func (r *RSDK) GetLps() (lps []coreSchema.Lp, err error)

func (*RSDK) RejectOrder

func (r *RSDK) RejectOrder(msg schema.LpMsgOrder) error

func (*RSDK) RemoveLiquidity

func (r *RSDK) RemoveLiquidity(msg schema.LpMsgRemove) error

func (*RSDK) SignOrder

func (r *RSDK) SignOrder(msg schema.LpMsgOrder) error

func (*RSDK) SubscribeLpAddResponseOnce

func (r *RSDK) SubscribeLpAddResponseOnce() <-chan *schema.LpMsgAddResponse

func (*RSDK) SubscribeLpRemoveResponseOnce

func (r *RSDK) SubscribeLpRemoveResponseOnce() <-chan *schema.LpMsgRemoveResponse

func (*RSDK) SubscribeOrder

func (r *RSDK) SubscribeOrder() <-chan *schema.LpMsgOrder

func (*RSDK) SubscribeOrderStatus

func (r *RSDK) SubscribeOrderStatus() <-chan *schema.OrderMsgStatus

func (*RSDK) SubscribeReconnect

func (r *RSDK) SubscribeReconnect() <-chan struct{}

type WDB

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

func NewWDB

func NewWDB(dbDir string) *WDB

func (*WDB) CreateOrder

func (w *WDB) CreateOrder(order *schema.Order, tx *gorm.DB) error

func (*WDB) GetOrders

func (w *WDB) GetOrders(page, count int) (orders []*schema.Order, err error)

func (*WDB) Migrate

func (w *WDB) Migrate()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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