admincli

package
v0.0.0-...-4c1ea0a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMinOrderSize      = "0.01"
	DefaultPricePrecision    = 5
	DefaultPriceDecimals     = 5
	DefaultAmountDecimals    = 5
	DefaultMakerFeeRate      = "0.01"
	DefaultTakerFeeRate      = "0.03"
	DefaultGasUsedEstimation = 190000

	DefaultLimit  = "10"
	DefaultOffset = "10"
	DefaultStatus = "pending"

	DefaultAdminAPIURL = "http://localhost:3003"
)

Variables

This section is empty.

Functions

func DefaultIfNil

func DefaultIfNil(ori, dft string) string

func NewDexCli

func NewDexCli() *cli.App

Types

type Admin

type Admin struct {
	AdminApiUrl      string
	MarketUrl        string
	CancelOrderUrl   string
	ListOrderUrl     string
	ListBalanceUrl   string
	ListTradeUrl     string
	RestartEngineUrl string
	StatusUrl        string
	// contains filtered or unexported fields
}

func (*Admin) ApproveMarket

func (a *Admin) ApproveMarket(marketID string) (ret []byte, err error)

func (*Admin) CancelOrder

func (a *Admin) CancelOrder(ID string) (ret []byte, err error)

func (*Admin) ListAccountBalances

func (a *Admin) ListAccountBalances(address, limit, offset string) (ret []byte, err error)

func (*Admin) ListAccountOrders

func (a *Admin) ListAccountOrders(marketID, address, limit, offset, status string) (ret []byte, err error)

func (*Admin) ListAccountTrades

func (a *Admin) ListAccountTrades(marketID, address, limit, offset, status string) (ret []byte, err error)

func (*Admin) ListMarkets

func (a *Admin) ListMarkets() (ret []byte, err error)

func (*Admin) NewMarket

func (a *Admin) NewMarket(marketID, baseTokenAddress, quoteTokenAddress, minOrderSize, pricePrecision, priceDecimals, amountDecimals, makerFeeRate, takerFeeRate, gasUsedEstimation string) (ret []byte, err error)

func (*Admin) PublishMarket

func (a *Admin) PublishMarket(marketID string) (ret []byte, err error)

func (*Admin) RestartEngine

func (a *Admin) RestartEngine() (ret []byte, err error)

func (*Admin) Status

func (a *Admin) Status() (ret []byte, err error)

func (*Admin) UnPublishMarket

func (a *Admin) UnPublishMarket(marketID string) (ret []byte, err error)

func (*Admin) UpdateMarket

func (a *Admin) UpdateMarket(marketID, minOrderSize, pricePrecision, priceDecimals, amountDecimals, makerFeeRate, takerFeeRate, gasUsedEstimation, isPublish string) (ret []byte, err error)

func (*Admin) UpdateMarketFee

func (a *Admin) UpdateMarketFee(marketID, makerFee, takerFee string) (ret []byte, err error)

type IAdminApi

type IAdminApi interface {
	Status() ([]byte, error)

	NewMarket(marketID, baseTokenAddress, quoteTokenAddress, minOrderSize, pricePrecision, priceDecimals, amountDecimals, makerFeeRate, takerFeeRate, gasUsedEstimation string) ([]byte, error)
	ListMarkets() ([]byte, error)
	UpdateMarket(marketID, minOrderSize, pricePrecision, priceDecimals, amountDecimals, makerFeeRate, takerFeeRate, gasUsedEstimation, isPublish string) ([]byte, error)
	PublishMarket(marketID string) ([]byte, error)
	ApproveMarket(marketID string) (ret []byte, err error)
	UnPublishMarket(marketID string) ([]byte, error)
	UpdateMarketFee(marketID, makerFee, takerFee string) ([]byte, error)

	ListAccountOrders(marketID, address, limit, offset, status string) ([]byte, error)
	ListAccountBalances(address, limit, offset string) ([]byte, error)
	ListAccountTrades(marketID, address, limit, offset, status string) ([]byte, error)

	CancelOrder(ID string) ([]byte, error)

	RestartEngine() ([]byte, error)
}

func NewAdmin

func NewAdmin(adminApiUrl string, httpClient utils.IHttpClient, erc20 ethereum.IErc20) IAdminApi

Jump to

Keyboard shortcuts

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