Versions in this module Expand all Collapse all v0 v0.1.0 Sep 25, 2023 Changes in this version + const BillTypeTrade + const DoneReasonCancelled + const DoneReasonFilled + const FillOrKill + const GoodTillCanceled + const GoodTillCrossing + const ImmediateOrCancel + const OrderStatusCancelled + const OrderStatusCancelling + const OrderStatusFilled + const OrderStatusNew + const OrderStatusOpen + const OrderStatusPartial + const OrderTypeLimit + const OrderTypeMarket + const SideBuy + const SideSell + const TopicAccount + const TopicBill + const TopicFill + const TopicOrder + const TopicTrade + const TransactionStatusCompleted + const TransactionStatusPending + func IntegerInterfaceToInt64(i interface{}) int64 + func IntegerInterfaceToUint64(i interface{}) uint64 + type Account struct + Available decimal.Decimal + CreatedAt time.Time + Currency string + Hold decimal.Decimal + Id int64 + UpdatedAt time.Time + UserId int64 + type Bill struct + Available decimal.Decimal + CreatedAt time.Time + Currency string + Hold decimal.Decimal + Id int64 + Notes string + Settled bool + Type BillType + UpdatedAt time.Time + UserId int64 + type BillType string + type BinLogStream struct + func NewBinLogStream() *BinLogStream + func (s *BinLogStream) OnRow(e *canal.RowsEvent) error + func (s *BinLogStream) Start() + type Config struct + CreatedAt time.Time + Id int64 + Key string + UpdatedAt time.Time + Value string + type DoneReason string + type FeeRate struct + CreatedAt time.Time + Id int64 + MakerFeeRatio decimal.Decimal + TakerFeeRatio decimal.Decimal + UpdatedAt time.Time + UserLevel string + type Fill struct + CreatedAt time.Time + Done bool + DoneReason DoneReason + Fee decimal.Decimal + Funds decimal.Decimal + Id int64 + Liquidity string + LogOffset int64 + LogSeq int64 + MessageSeq int64 + OrderId int64 + Price decimal.Decimal + ProductId string + Settled bool + Side Side + Size decimal.Decimal + TradeSeq int64 + UpdatedAt time.Time + type Order struct + ClientOid string + CreatedAt time.Time + ExecutedValue decimal.Decimal + FillFees decimal.Decimal + FilledSize decimal.Decimal + Funds decimal.Decimal + Id int64 + MakerFeeRatio decimal.Decimal + Price decimal.Decimal + ProductId string + Settled bool + Side Side + Size decimal.Decimal + Status OrderStatus + TakerFeeRatio decimal.Decimal + TimeInForce TimeInForceType + Type OrderType + UpdatedAt time.Time + UserId int64 + type OrderStatus string + func NewOrderStatusFromString(s string) (*OrderStatus, error) + func (t OrderStatus) String() string + type OrderType string + func (t OrderType) String() string + type Product struct + BaseCurrency string + BaseMaxSize decimal.Decimal + BaseMinSize decimal.Decimal + BaseScale int32 + CreatedAt time.Time + Id string + QuoteCurrency string + QuoteIncrement float64 + QuoteMaxSize decimal.Decimal + QuoteMinSize decimal.Decimal + QuoteScale int32 + UpdatedAt time.Time + type Side string + func NewSideFromString(s string) (*Side, error) + func (s Side) Opposite() Side + func (s Side) String() string + type Store interface + AddAccount func(account *Account) error + AddBills func(bills []*Bill) error + AddFills func(fills []*Fill) error + AddOrder func(order *Order) error + AddTicks func(ticks []*Tick) error + AddTrades func(trades []*Trade) error + AddUser func(user *User) error + BeginTx func() (Store, error) + CommitTx func() error + GetAccount func(userId int64, currency string) (*Account, error) + GetAccountForUpdate func(userId int64, currency string) (*Account, error) + GetAccountsByUserId func(userId int64) ([]*Account, error) + GetConfigs func() ([]*Config, error) + GetFeeRateByUserLevel func(userLevel string) (*FeeRate, error) + GetLastFillByProductId func(productId string) (*Fill, error) + GetLastTickByProductId func(productId string, granularity int64) (*Tick, error) + GetLastTicksAllByProductId func(productId string) ([]*Tick, error) + GetLastTradeByProductId func(productId string) (*Trade, error) + GetOrderByClientOid func(userId int64, clientOid string) (*Order, error) + GetOrderById func(orderId int64) (*Order, error) + GetOrderByIdForUpdate func(orderId int64) (*Order, error) + GetOrdersByUserId func(userId int64, statuses []OrderStatus, side *Side, productId string, ...) ([]*Order, error) + GetProductById func(id string) (*Product, error) + GetProducts func() ([]*Product, error) + GetTicksByProductId func(productId string, granularity int64, limit int) ([]*Tick, error) + GetTradesByProductId func(productId string, count int) ([]*Trade, error) + GetUnsettledBills func() ([]*Bill, error) + GetUnsettledBillsByUserId func(userId int64, currency string) ([]*Bill, error) + GetUnsettledFills func(count int32) ([]*Fill, error) + GetUnsettledFillsByOrderId func(orderId int64) ([]*Fill, error) + GetUserByEmail func(email string) (*User, error) + Rollback func() error + UpdateAccount func(account *Account) error + UpdateBill func(bill *Bill) error + UpdateFill func(fill *Fill) error + UpdateOrder func(order *Order) error + UpdateOrderStatus func(orderId int64, oldStatus, newStatus OrderStatus) (bool, error) + UpdateUser func(user *User) error + type Tick struct + Close decimal.Decimal + CreatedAt time.Time + Granularity int64 + High decimal.Decimal + Id int64 + LogOffset int64 + LogSeq int64 + Low decimal.Decimal + Open decimal.Decimal + ProductId string + Time int64 + UpdatedAt time.Time + Volume decimal.Decimal + type TimeInForceType string + func NewTimeInForceTypeFromString(s string) (*TimeInForceType, error) + func (t TimeInForceType) String() string + type Trade struct + CreatedAt time.Time + Id int64 + LogOffset int64 + LogSeq int64 + MakerOrderId int64 + MakerUserId int64 + Price decimal.Decimal + ProductId string + Side Side + Size decimal.Decimal + TakerOrderId int64 + TakerUserId int64 + Time time.Time + TradeSeq int64 + UpdatedAt time.Time + type Transaction struct + BlockNum int + ConfirmNum int + CreatedAt time.Time + Currency string + FromAddress string + Id int64 + Note string + Status TransactionStatus + ToAddress string + TxId string + UpdatedAt time.Time + UserId int64 + type TransactionStatus string + type User struct + CreatedAt time.Time + Email string + Id int64 + PasswordHash string + UpdatedAt time.Time + UserId string + UserLevel string