service

package
v0.0.0-...-bf1eb11 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDelayBill

func AddDelayBill(store store.Store, userId int64, currency string, available, hold decimal.Decimal, billType entities.BillType, notes string) (*entities.Bill, error)

func AddFills

func AddFills(fills []*entities.Fill) error

func AddTicks

func AddTicks(ticks []*entities.Tick) error

func AddTrades

func AddTrades(trades []*entities.Trade) error

func ChangePassword

func ChangePassword(email, newPassword string) error

func CheckToken

func CheckToken(tokenStr string) (*entities.User, error)

func CreateUser

func CreateUser(email, password string) (*entities.User, error)

func ExecuteBill

func ExecuteBill(userId int64, currency string) error

func ExecuteFill

func ExecuteFill(orderId int64) error

func GetAccount

func GetAccount(userId int64, currency string) (*entities.Account, error)

func GetAccountsByUserId

func GetAccountsByUserId(userId int64) ([]*entities.Account, error)

func GetConfigs

func GetConfigs() ([]*entities.Config, error)

func GetLastTickByProductId

func GetLastTickByProductId(productId string, granularity int64) (*entities.Tick, error)

func GetOrderByClientUid

func GetOrderByClientUid(userId int64, clientUuid string) (*entities.Order, error)

func GetOrderById

func GetOrderById(orderId int64) (*entities.Order, error)

func GetOrdersByUserId

func GetOrdersByUserId(userId int64, statuses []entities.OrderStatus, side *entities.Side, productId string,
	beforeId, afterId int64, limit int) ([]*entities.Order, error)

func GetProductById

func GetProductById(id string) (*entities.Product, error)

func GetProducts

func GetProducts() ([]*entities.Product, error)

func GetTicksByProductId

func GetTicksByProductId(productId string, granularity int64, limit int) ([]*entities.Tick, error)

func GetTradesByProductId

func GetTradesByProductId(productId string, count int) ([]*entities.Trade, error)

func GetUnsettledBills

func GetUnsettledBills() ([]*entities.Bill, error)

func GetUnsettledFills

func GetUnsettledFills(count int) ([]*entities.Fill, error)

func GetUserByEmail

func GetUserByEmail(email string) (*entities.User, error)

func GetUserByPassword

func GetUserByPassword(email, password string) (*entities.User, error)

func HasEnoughBalance

func HasEnoughBalance(userId int64, currency string, size decimal.Decimal) (bool, error)

func HoldBalance

func HoldBalance(db store.Store, userId int64, currency string, size decimal.Decimal, billType entities.BillType) error

func PlaceOrder

func PlaceOrder(userId int64, clientUid string, productId string, orderType entities.OrderType,
	side entities.Side, size, price, funds decimal.Decimal) (*entities.Order, error)

func RefreshAccessToken

func RefreshAccessToken(email, password string) (string, error)

func UpdateOrderStatus

func UpdateOrderStatus(orderId int64, oldStatus, newStatus entities.OrderStatus) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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