models

package
v0.0.0-...-a659e06 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE        = 10
	TRADE_MOENY = "trade"
	BIT_SIZE_64 = 64
	USDT        = "usdt"
	SELL_MARKET = "sell-market"
	API_STR     = "api"
	QUERY_TIMES = 5
	OK_STR      = "ok"
)
View Source
const (
	ORDER_INIT   = 0
	ORDER_START  = 1
	ORDER_FILLED = 2
	ORDER_FIELD  = 3
)

Variables

View Source
var (
	Traders map[string]*Trader
)

Functions

func QueryOrderStatus

func QueryOrderStatus(detail *TradeDetail, dbOrm orm.Ormer)

Types

type TradeDetail

type TradeDetail struct {
	Id         string  `orm:"pk" json:"id"`
	Coin       string  `json:"coin"`
	Amount     float64 `orm:"digits(12);decimals(4)" json:"amount"`
	Price      float64 `orm:"digits(18);decimals(10)" json:"price"`
	Sum        float64 `orm:"digits(20);decimals(10)" json:"sum"`
	Ts         int64   `json:"ts"`
	Status     int8    `json:"status"`
	RealPrice  string  `json:"real_price"`
	RealAmount string  `json:"real_amount"`
	RealSum    string  `json:"real_sum"`
	Fee        string  `json:"fee"`
	OrderId    string  `json:"order_id"`
}

func ProcessTrade

func ProcessTrade(trade *Trader) (detail TradeDetail, err constants.ApiError)

type Trader

type Trader struct {
	Coin   string  `json:"coin"`
	Amount float64 `json:"amount"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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