Documentation ¶
Index ¶
- Constants
- Variables
- func InitExecutor(cfg *types.Chain33Config)
- func InitFork(cfg *types.Chain33Config)
- func RegisterExchangeServer(s *grpc.Server, srv ExchangeServer)
- type Asset
- func (*Asset) Descriptor() ([]byte, []int)
- func (m *Asset) GetExecer() string
- func (m *Asset) GetSymbol() string
- func (*Asset) ProtoMessage()
- func (m *Asset) Reset()
- func (m *Asset) String() string
- func (m *Asset) XXX_DiscardUnknown()
- func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Asset) XXX_Merge(src proto.Message)
- func (m *Asset) XXX_Size() int
- func (m *Asset) XXX_Unmarshal(b []byte) error
- type Exchange
- func (*Exchange) Descriptor() ([]byte, []int)
- func (*Exchange) ProtoMessage()
- func (m *Exchange) Reset()
- func (m *Exchange) String() string
- func (m *Exchange) XXX_DiscardUnknown()
- func (m *Exchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Exchange) XXX_Merge(src proto.Message)
- func (m *Exchange) XXX_Size() int
- func (m *Exchange) XXX_Unmarshal(b []byte) error
- type ExchangeAction
- func (*ExchangeAction) Descriptor() ([]byte, []int)
- func (m *ExchangeAction) GetLimitOrder() *LimitOrder
- func (m *ExchangeAction) GetMarketOrder() *MarketOrder
- func (m *ExchangeAction) GetRevokeOrder() *RevokeOrder
- func (m *ExchangeAction) GetTy() int32
- func (m *ExchangeAction) GetValue() isExchangeAction_Value
- func (*ExchangeAction) ProtoMessage()
- func (m *ExchangeAction) Reset()
- func (m *ExchangeAction) String() string
- func (m *ExchangeAction) XXX_DiscardUnknown()
- func (m *ExchangeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExchangeAction) XXX_Merge(src proto.Message)
- func (*ExchangeAction) XXX_OneofWrappers() []interface{}
- func (m *ExchangeAction) XXX_Size() int
- func (m *ExchangeAction) XXX_Unmarshal(b []byte) error
- type ExchangeAction_LimitOrder
- type ExchangeAction_MarketOrder
- type ExchangeAction_RevokeOrder
- type ExchangeClient
- type ExchangeServer
- type ExchangeType
- type LimitOrder
- func (*LimitOrder) Descriptor() ([]byte, []int)
- func (m *LimitOrder) GetAmount() int64
- func (m *LimitOrder) GetLeftAsset() *Asset
- func (m *LimitOrder) GetOp() int32
- func (m *LimitOrder) GetPrice() int64
- func (m *LimitOrder) GetRightAsset() *Asset
- func (*LimitOrder) ProtoMessage()
- func (m *LimitOrder) Reset()
- func (m *LimitOrder) String() string
- func (m *LimitOrder) XXX_DiscardUnknown()
- func (m *LimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LimitOrder) XXX_Merge(src proto.Message)
- func (m *LimitOrder) XXX_Size() int
- func (m *LimitOrder) XXX_Unmarshal(b []byte) error
- type MarketDepth
- func (*MarketDepth) Descriptor() ([]byte, []int)
- func (m *MarketDepth) GetAmount() int64
- func (m *MarketDepth) GetLeftAsset() *Asset
- func (m *MarketDepth) GetOp() int32
- func (m *MarketDepth) GetPrice() int64
- func (m *MarketDepth) GetRightAsset() *Asset
- func (*MarketDepth) ProtoMessage()
- func (m *MarketDepth) Reset()
- func (m *MarketDepth) String() string
- func (m *MarketDepth) XXX_DiscardUnknown()
- func (m *MarketDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MarketDepth) XXX_Merge(src proto.Message)
- func (m *MarketDepth) XXX_Size() int
- func (m *MarketDepth) XXX_Unmarshal(b []byte) error
- type MarketDepthList
- func (*MarketDepthList) Descriptor() ([]byte, []int)
- func (m *MarketDepthList) GetList() []*MarketDepth
- func (m *MarketDepthList) GetPrimaryKey() string
- func (*MarketDepthList) ProtoMessage()
- func (m *MarketDepthList) Reset()
- func (m *MarketDepthList) String() string
- func (m *MarketDepthList) XXX_DiscardUnknown()
- func (m *MarketDepthList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MarketDepthList) XXX_Merge(src proto.Message)
- func (m *MarketDepthList) XXX_Size() int
- func (m *MarketDepthList) XXX_Unmarshal(b []byte) error
- type MarketOrder
- func (*MarketOrder) Descriptor() ([]byte, []int)
- func (m *MarketOrder) GetAmount() int64
- func (m *MarketOrder) GetLeftAsset() *Asset
- func (m *MarketOrder) GetOp() int32
- func (m *MarketOrder) GetRightAsset() *Asset
- func (*MarketOrder) ProtoMessage()
- func (m *MarketOrder) Reset()
- func (m *MarketOrder) String() string
- func (m *MarketOrder) XXX_DiscardUnknown()
- func (m *MarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MarketOrder) XXX_Merge(src proto.Message)
- func (m *MarketOrder) XXX_Size() int
- func (m *MarketOrder) XXX_Unmarshal(b []byte) error
- type Order
- func (*Order) Descriptor() ([]byte, []int)
- func (m *Order) GetAVGPrice() int64
- func (m *Order) GetAddr() string
- func (m *Order) GetBalance() int64
- func (m *Order) GetExecuted() int64
- func (m *Order) GetIndex() int64
- func (m *Order) GetLimitOrder() *LimitOrder
- func (m *Order) GetMarketOrder() *MarketOrder
- func (m *Order) GetOrderID() int64
- func (m *Order) GetStatus() int32
- func (m *Order) GetTy() int32
- func (m *Order) GetUpdateTime() int64
- func (m *Order) GetValue() isOrder_Value
- func (*Order) ProtoMessage()
- func (m *Order) Reset()
- func (m *Order) String() string
- func (m *Order) XXX_DiscardUnknown()
- func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Order) XXX_Merge(src proto.Message)
- func (*Order) XXX_OneofWrappers() []interface{}
- func (m *Order) XXX_Size() int
- func (m *Order) XXX_Unmarshal(b []byte) error
- type OrderList
- func (*OrderList) Descriptor() ([]byte, []int)
- func (m *OrderList) GetList() []*Order
- func (m *OrderList) GetPrimaryKey() string
- func (*OrderList) ProtoMessage()
- func (m *OrderList) Reset()
- func (m *OrderList) String() string
- func (m *OrderList) XXX_DiscardUnknown()
- func (m *OrderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OrderList) XXX_Merge(src proto.Message)
- func (m *OrderList) XXX_Size() int
- func (m *OrderList) XXX_Unmarshal(b []byte) error
- type Order_LimitOrder
- type Order_MarketOrder
- type QueryHistoryOrderList
- func (*QueryHistoryOrderList) Descriptor() ([]byte, []int)
- func (m *QueryHistoryOrderList) GetCount() int32
- func (m *QueryHistoryOrderList) GetDirection() int32
- func (m *QueryHistoryOrderList) GetLeftAsset() *Asset
- func (m *QueryHistoryOrderList) GetPrimaryKey() string
- func (m *QueryHistoryOrderList) GetRightAsset() *Asset
- func (*QueryHistoryOrderList) ProtoMessage()
- func (m *QueryHistoryOrderList) Reset()
- func (m *QueryHistoryOrderList) String() string
- func (m *QueryHistoryOrderList) XXX_DiscardUnknown()
- func (m *QueryHistoryOrderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryHistoryOrderList) XXX_Merge(src proto.Message)
- func (m *QueryHistoryOrderList) XXX_Size() int
- func (m *QueryHistoryOrderList) XXX_Unmarshal(b []byte) error
- type QueryMarketDepth
- func (*QueryMarketDepth) Descriptor() ([]byte, []int)
- func (m *QueryMarketDepth) GetCount() int32
- func (m *QueryMarketDepth) GetLeftAsset() *Asset
- func (m *QueryMarketDepth) GetOp() int32
- func (m *QueryMarketDepth) GetPrimaryKey() string
- func (m *QueryMarketDepth) GetRightAsset() *Asset
- func (*QueryMarketDepth) ProtoMessage()
- func (m *QueryMarketDepth) Reset()
- func (m *QueryMarketDepth) String() string
- func (m *QueryMarketDepth) XXX_DiscardUnknown()
- func (m *QueryMarketDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryMarketDepth) XXX_Merge(src proto.Message)
- func (m *QueryMarketDepth) XXX_Size() int
- func (m *QueryMarketDepth) XXX_Unmarshal(b []byte) error
- type QueryOrder
- func (*QueryOrder) Descriptor() ([]byte, []int)
- func (m *QueryOrder) GetOrderID() int64
- func (*QueryOrder) ProtoMessage()
- func (m *QueryOrder) Reset()
- func (m *QueryOrder) String() string
- func (m *QueryOrder) XXX_DiscardUnknown()
- func (m *QueryOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryOrder) XXX_Merge(src proto.Message)
- func (m *QueryOrder) XXX_Size() int
- func (m *QueryOrder) XXX_Unmarshal(b []byte) error
- type QueryOrderList
- func (*QueryOrderList) Descriptor() ([]byte, []int)
- func (m *QueryOrderList) GetAddress() string
- func (m *QueryOrderList) GetCount() int32
- func (m *QueryOrderList) GetDirection() int32
- func (m *QueryOrderList) GetPrimaryKey() string
- func (m *QueryOrderList) GetStatus() int32
- func (*QueryOrderList) ProtoMessage()
- func (m *QueryOrderList) Reset()
- func (m *QueryOrderList) String() string
- func (m *QueryOrderList) XXX_DiscardUnknown()
- func (m *QueryOrderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryOrderList) XXX_Merge(src proto.Message)
- func (m *QueryOrderList) XXX_Size() int
- func (m *QueryOrderList) XXX_Unmarshal(b []byte) error
- type ReceiptExchange
- func (*ReceiptExchange) Descriptor() ([]byte, []int)
- func (m *ReceiptExchange) GetIndex() int64
- func (m *ReceiptExchange) GetMatchOrders() []*Order
- func (m *ReceiptExchange) GetOrder() *Order
- func (*ReceiptExchange) ProtoMessage()
- func (m *ReceiptExchange) Reset()
- func (m *ReceiptExchange) String() string
- func (m *ReceiptExchange) XXX_DiscardUnknown()
- func (m *ReceiptExchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReceiptExchange) XXX_Merge(src proto.Message)
- func (m *ReceiptExchange) XXX_Size() int
- func (m *ReceiptExchange) XXX_Unmarshal(b []byte) error
- type RevokeOrder
- func (*RevokeOrder) Descriptor() ([]byte, []int)
- func (m *RevokeOrder) GetOrderID() int64
- func (*RevokeOrder) ProtoMessage()
- func (m *RevokeOrder) Reset()
- func (m *RevokeOrder) String() string
- func (m *RevokeOrder) XXX_DiscardUnknown()
- func (m *RevokeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RevokeOrder) XXX_Merge(src proto.Message)
- func (m *RevokeOrder) XXX_Size() int
- func (m *RevokeOrder) XXX_Unmarshal(b []byte) error
- type UnimplementedExchangeServer
Constants ¶
const ( TyUnknowAction = iota + 200 TyLimitOrderAction TyMarketOrderAction TyRevokeOrderAction NameLimitOrderAction = "LimitOrder" NameMarketOrderAction = "MarketOrder" NameRevokeOrderAction = "RevokeOrder" FuncNameQueryMarketDepth = "QueryMarketDepth" FuncNameQueryHistoryOrderList = "QueryHistoryOrderList" FuncNameQueryOrder = "QueryOrder" FuncNameQueryOrderList = "QueryOrderList" )
action类型id和name,这些常量可以自定义修改
const ( TyUnknownLog = iota + 200 TyLimitOrderLog TyMarketOrderLog TyRevokeOrderLog )
log类型id值
const ( OpBuy = iota + 1 OpSell )
OP
const ( Ordered = iota Completed Revoked )
order status
const ( ListDESC = int32(0) ListASC = int32(1) ListSeek = int32(2) )
const
const ( //Count 单次list还回条数 Count = int32(10) //MaxMatchCount 系统最大撮合深度 MaxMatchCount = 100 )
Variables ¶
var ( ErrAssetAmount = fmt.Errorf("%s", "The asset amount is not valid!") ErrAssetPrice = fmt.Errorf("%s", "The asset price is not valid!") ErrAssetOp = fmt.Errorf("%s", "The asset op is not define!") ErrAssetBalance = fmt.Errorf("%s", "Insufficient balance!") ErrOrderSatus = fmt.Errorf("%s", "The order status is reovked or completed!") ErrAddr = fmt.Errorf("%s", "Wrong Addr!") ErrAsset = fmt.Errorf("%s", "The asset's execer or symbol can't be nil,The same assets cannot be exchanged!") ErrCount = fmt.Errorf("%s", "The param count can't large 20") ErrDirection = fmt.Errorf("%s", "The direction only 0 or 1!") ErrStatus = fmt.Errorf("%s", "The status only in 0 , 1, 2!") ErrOrderID = fmt.Errorf("%s", "Wrong OrderID!") )
some errors definition
var (
//ExchangeX 执行器名称定义
ExchangeX = "exchange"
)
Functions ¶
func InitExecutor ¶
func InitExecutor(cfg *types.Chain33Config)
InitExecutor defines register executor
func RegisterExchangeServer ¶
func RegisterExchangeServer(s *grpc.Server, srv ExchangeServer)
Types ¶
type Asset ¶
type Asset struct { Execer string `protobuf:"bytes,1,opt,name=execer,proto3" json:"execer,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
资产类型
func (*Asset) Descriptor ¶
func (*Asset) ProtoMessage ¶
func (*Asset) ProtoMessage()
func (*Asset) XXX_DiscardUnknown ¶
func (m *Asset) XXX_DiscardUnknown()
func (*Asset) XXX_Marshal ¶
func (*Asset) XXX_Unmarshal ¶
type Exchange ¶
type Exchange struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Exchange) Descriptor ¶
func (*Exchange) ProtoMessage ¶
func (*Exchange) ProtoMessage()
func (*Exchange) XXX_DiscardUnknown ¶
func (m *Exchange) XXX_DiscardUnknown()
func (*Exchange) XXX_Marshal ¶
func (*Exchange) XXX_Unmarshal ¶
type ExchangeAction ¶
type ExchangeAction struct { // Types that are valid to be assigned to Value: // *ExchangeAction_LimitOrder // *ExchangeAction_MarketOrder // *ExchangeAction_RevokeOrder Value isExchangeAction_Value `protobuf_oneof:"value"` Ty int32 `protobuf:"varint,6,opt,name=ty,proto3" json:"ty,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ExchangeAction) Descriptor ¶
func (*ExchangeAction) Descriptor() ([]byte, []int)
func (*ExchangeAction) GetLimitOrder ¶
func (m *ExchangeAction) GetLimitOrder() *LimitOrder
func (*ExchangeAction) GetMarketOrder ¶
func (m *ExchangeAction) GetMarketOrder() *MarketOrder
func (*ExchangeAction) GetRevokeOrder ¶
func (m *ExchangeAction) GetRevokeOrder() *RevokeOrder
func (*ExchangeAction) GetTy ¶
func (m *ExchangeAction) GetTy() int32
func (*ExchangeAction) GetValue ¶
func (m *ExchangeAction) GetValue() isExchangeAction_Value
func (*ExchangeAction) ProtoMessage ¶
func (*ExchangeAction) ProtoMessage()
func (*ExchangeAction) Reset ¶
func (m *ExchangeAction) Reset()
func (*ExchangeAction) String ¶
func (m *ExchangeAction) String() string
func (*ExchangeAction) XXX_DiscardUnknown ¶
func (m *ExchangeAction) XXX_DiscardUnknown()
func (*ExchangeAction) XXX_Marshal ¶
func (m *ExchangeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExchangeAction) XXX_Merge ¶
func (m *ExchangeAction) XXX_Merge(src proto.Message)
func (*ExchangeAction) XXX_OneofWrappers ¶
func (*ExchangeAction) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*ExchangeAction) XXX_Size ¶
func (m *ExchangeAction) XXX_Size() int
func (*ExchangeAction) XXX_Unmarshal ¶
func (m *ExchangeAction) XXX_Unmarshal(b []byte) error
type ExchangeAction_LimitOrder ¶
type ExchangeAction_LimitOrder struct {
LimitOrder *LimitOrder `protobuf:"bytes,1,opt,name=limitOrder,proto3,oneof"`
}
type ExchangeAction_MarketOrder ¶
type ExchangeAction_MarketOrder struct {
MarketOrder *MarketOrder `protobuf:"bytes,2,opt,name=marketOrder,proto3,oneof"`
}
type ExchangeAction_RevokeOrder ¶
type ExchangeAction_RevokeOrder struct {
RevokeOrder *RevokeOrder `protobuf:"bytes,3,opt,name=revokeOrder,proto3,oneof"`
}
type ExchangeClient ¶
type ExchangeClient interface { }
ExchangeClient is the client API for Exchange service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewExchangeClient ¶
func NewExchangeClient(cc grpc.ClientConnInterface) ExchangeClient
type ExchangeServer ¶
type ExchangeServer interface { }
ExchangeServer is the server API for Exchange service.
type ExchangeType ¶
type ExchangeType struct {
types.ExecTypeBase
}
ExchangeType ...
func (*ExchangeType) GetLogMap ¶
func (e *ExchangeType) GetLogMap() map[int64]*types.LogInfo
GetLogMap 获取合约log相关信息
func (*ExchangeType) GetPayload ¶
func (e *ExchangeType) GetPayload() types.Message
GetPayload 获取合约action结构
func (*ExchangeType) GetTypeMap ¶
func (e *ExchangeType) GetTypeMap() map[string]int32
GetTypeMap 获取合约action的id和name信息
type LimitOrder ¶
type LimitOrder struct { //交易对 LeftAsset *Asset `protobuf:"bytes,1,opt,name=leftAsset,proto3" json:"leftAsset,omitempty"` //交易对 RightAsset *Asset `protobuf:"bytes,2,opt,name=rightAsset,proto3" json:"rightAsset,omitempty"` //价格 Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` //总量 Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` //操作, 1为买,2为卖 Op int32 `protobuf:"varint,5,opt,name=op,proto3" json:"op,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
限价订单
func (*LimitOrder) Descriptor ¶
func (*LimitOrder) Descriptor() ([]byte, []int)
func (*LimitOrder) GetAmount ¶
func (m *LimitOrder) GetAmount() int64
func (*LimitOrder) GetLeftAsset ¶
func (m *LimitOrder) GetLeftAsset() *Asset
func (*LimitOrder) GetOp ¶
func (m *LimitOrder) GetOp() int32
func (*LimitOrder) GetPrice ¶
func (m *LimitOrder) GetPrice() int64
func (*LimitOrder) GetRightAsset ¶
func (m *LimitOrder) GetRightAsset() *Asset
func (*LimitOrder) ProtoMessage ¶
func (*LimitOrder) ProtoMessage()
func (*LimitOrder) Reset ¶
func (m *LimitOrder) Reset()
func (*LimitOrder) String ¶
func (m *LimitOrder) String() string
func (*LimitOrder) XXX_DiscardUnknown ¶
func (m *LimitOrder) XXX_DiscardUnknown()
func (*LimitOrder) XXX_Marshal ¶
func (m *LimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LimitOrder) XXX_Merge ¶
func (m *LimitOrder) XXX_Merge(src proto.Message)
func (*LimitOrder) XXX_Size ¶
func (m *LimitOrder) XXX_Size() int
func (*LimitOrder) XXX_Unmarshal ¶
func (m *LimitOrder) XXX_Unmarshal(b []byte) error
type MarketDepth ¶
type MarketDepth struct { //资产1 LeftAsset *Asset `protobuf:"bytes,1,opt,name=leftAsset,proto3" json:"leftAsset,omitempty"` //资产2 RightAsset *Asset `protobuf:"bytes,2,opt,name=rightAsset,proto3" json:"rightAsset,omitempty"` //价格 Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` //总量 Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` //操作, 1为买,2为卖 Op int32 `protobuf:"varint,5,opt,name=op,proto3" json:"op,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
市场深度
func (*MarketDepth) Descriptor ¶
func (*MarketDepth) Descriptor() ([]byte, []int)
func (*MarketDepth) GetAmount ¶
func (m *MarketDepth) GetAmount() int64
func (*MarketDepth) GetLeftAsset ¶
func (m *MarketDepth) GetLeftAsset() *Asset
func (*MarketDepth) GetOp ¶
func (m *MarketDepth) GetOp() int32
func (*MarketDepth) GetPrice ¶
func (m *MarketDepth) GetPrice() int64
func (*MarketDepth) GetRightAsset ¶
func (m *MarketDepth) GetRightAsset() *Asset
func (*MarketDepth) ProtoMessage ¶
func (*MarketDepth) ProtoMessage()
func (*MarketDepth) Reset ¶
func (m *MarketDepth) Reset()
func (*MarketDepth) String ¶
func (m *MarketDepth) String() string
func (*MarketDepth) XXX_DiscardUnknown ¶
func (m *MarketDepth) XXX_DiscardUnknown()
func (*MarketDepth) XXX_Marshal ¶
func (m *MarketDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MarketDepth) XXX_Merge ¶
func (m *MarketDepth) XXX_Merge(src proto.Message)
func (*MarketDepth) XXX_Size ¶
func (m *MarketDepth) XXX_Size() int
func (*MarketDepth) XXX_Unmarshal ¶
func (m *MarketDepth) XXX_Unmarshal(b []byte) error
type MarketDepthList ¶
type MarketDepthList struct { List []*MarketDepth `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` PrimaryKey string `protobuf:"bytes,2,opt,name=primaryKey,proto3" json:"primaryKey,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
查询接口返回的市场深度列表
func (*MarketDepthList) Descriptor ¶
func (*MarketDepthList) Descriptor() ([]byte, []int)
func (*MarketDepthList) GetList ¶
func (m *MarketDepthList) GetList() []*MarketDepth
func (*MarketDepthList) GetPrimaryKey ¶
func (m *MarketDepthList) GetPrimaryKey() string
func (*MarketDepthList) ProtoMessage ¶
func (*MarketDepthList) ProtoMessage()
func (*MarketDepthList) Reset ¶
func (m *MarketDepthList) Reset()
func (*MarketDepthList) String ¶
func (m *MarketDepthList) String() string
func (*MarketDepthList) XXX_DiscardUnknown ¶
func (m *MarketDepthList) XXX_DiscardUnknown()
func (*MarketDepthList) XXX_Marshal ¶
func (m *MarketDepthList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MarketDepthList) XXX_Merge ¶
func (m *MarketDepthList) XXX_Merge(src proto.Message)
func (*MarketDepthList) XXX_Size ¶
func (m *MarketDepthList) XXX_Size() int
func (*MarketDepthList) XXX_Unmarshal ¶
func (m *MarketDepthList) XXX_Unmarshal(b []byte) error
type MarketOrder ¶
type MarketOrder struct { //资产1 LeftAsset *Asset `protobuf:"bytes,1,opt,name=leftAsset,proto3" json:"leftAsset,omitempty"` //资产2 RightAsset *Asset `protobuf:"bytes,2,opt,name=rightAsset,proto3" json:"rightAsset,omitempty"` //总量 Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` //操作, 1为买,2为卖 Op int32 `protobuf:"varint,4,opt,name=op,proto3" json:"op,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
市价委托
func (*MarketOrder) Descriptor ¶
func (*MarketOrder) Descriptor() ([]byte, []int)
func (*MarketOrder) GetAmount ¶
func (m *MarketOrder) GetAmount() int64
func (*MarketOrder) GetLeftAsset ¶
func (m *MarketOrder) GetLeftAsset() *Asset
func (*MarketOrder) GetOp ¶
func (m *MarketOrder) GetOp() int32
func (*MarketOrder) GetRightAsset ¶
func (m *MarketOrder) GetRightAsset() *Asset
func (*MarketOrder) ProtoMessage ¶
func (*MarketOrder) ProtoMessage()
func (*MarketOrder) Reset ¶
func (m *MarketOrder) Reset()
func (*MarketOrder) String ¶
func (m *MarketOrder) String() string
func (*MarketOrder) XXX_DiscardUnknown ¶
func (m *MarketOrder) XXX_DiscardUnknown()
func (*MarketOrder) XXX_Marshal ¶
func (m *MarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MarketOrder) XXX_Merge ¶
func (m *MarketOrder) XXX_Merge(src proto.Message)
func (*MarketOrder) XXX_Size ¶
func (m *MarketOrder) XXX_Size() int
func (*MarketOrder) XXX_Unmarshal ¶
func (m *MarketOrder) XXX_Unmarshal(b []byte) error
type Order ¶
type Order struct { OrderID int64 `protobuf:"varint,1,opt,name=orderID,proto3" json:"orderID,omitempty"` // Types that are valid to be assigned to Value: // *Order_LimitOrder // *Order_MarketOrder Value isOrder_Value `protobuf_oneof:"value"` //挂单类型 Ty int32 `protobuf:"varint,4,opt,name=ty,proto3" json:"ty,omitempty"` //已经成交的数量 Executed int64 `protobuf:"varint,5,opt,name=executed,proto3" json:"executed,omitempty"` //成交均价 AVGPrice int64 `protobuf:"varint,6,opt,name=AVG_price,json=AVGPrice,proto3" json:"AVG_price,omitempty"` //余额 Balance int64 `protobuf:"varint,7,opt,name=balance,proto3" json:"balance,omitempty"` //状态,0 挂单中ordered, 1 完成completed, 2撤回 revoked Status int32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` //用户地址 Addr string `protobuf:"bytes,9,opt,name=addr,proto3" json:"addr,omitempty"` //更新时间 UpdateTime int64 `protobuf:"varint,10,opt,name=updateTime,proto3" json:"updateTime,omitempty"` //索引 Index int64 `protobuf:"varint,11,opt,name=index,proto3" json:"index,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
订单信息
func (*Order) Descriptor ¶
func (*Order) GetAVGPrice ¶
func (*Order) GetBalance ¶
func (*Order) GetExecuted ¶
func (*Order) GetLimitOrder ¶
func (m *Order) GetLimitOrder() *LimitOrder
func (*Order) GetMarketOrder ¶
func (m *Order) GetMarketOrder() *MarketOrder
func (*Order) GetOrderID ¶
func (*Order) GetUpdateTime ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) XXX_DiscardUnknown ¶
func (m *Order) XXX_DiscardUnknown()
func (*Order) XXX_Marshal ¶
func (*Order) XXX_OneofWrappers ¶
func (*Order) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Order) XXX_Unmarshal ¶
type OrderList ¶
type OrderList struct { List []*Order `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` PrimaryKey string `protobuf:"bytes,2,opt,name=primaryKey,proto3" json:"primaryKey,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
订单列表
func (*OrderList) Descriptor ¶
func (*OrderList) GetPrimaryKey ¶
func (*OrderList) ProtoMessage ¶
func (*OrderList) ProtoMessage()
func (*OrderList) XXX_DiscardUnknown ¶
func (m *OrderList) XXX_DiscardUnknown()
func (*OrderList) XXX_Marshal ¶
func (*OrderList) XXX_Unmarshal ¶
type Order_LimitOrder ¶
type Order_LimitOrder struct {
LimitOrder *LimitOrder `protobuf:"bytes,2,opt,name=limitOrder,proto3,oneof"`
}
type Order_MarketOrder ¶
type Order_MarketOrder struct {
MarketOrder *MarketOrder `protobuf:"bytes,3,opt,name=marketOrder,proto3,oneof"`
}
type QueryHistoryOrderList ¶
type QueryHistoryOrderList struct { //资产1 LeftAsset *Asset `protobuf:"bytes,1,opt,name=leftAsset,proto3" json:"leftAsset,omitempty"` //资产2 RightAsset *Asset `protobuf:"bytes,2,opt,name=rightAsset,proto3" json:"rightAsset,omitempty"` // 索引值 PrimaryKey string `protobuf:"bytes,3,opt,name=primaryKey,proto3" json:"primaryKey,omitempty"` //单页返回多少条记录,默认返回10条,为了系统安全最多单次只能返回20条 Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` // 0降序,1升序,默认降序 Direction int32 `protobuf:"varint,5,opt,name=direction,proto3" json:"direction,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
查询最新得成交信息,外部接口
func (*QueryHistoryOrderList) Descriptor ¶
func (*QueryHistoryOrderList) Descriptor() ([]byte, []int)
func (*QueryHistoryOrderList) GetCount ¶
func (m *QueryHistoryOrderList) GetCount() int32
func (*QueryHistoryOrderList) GetDirection ¶
func (m *QueryHistoryOrderList) GetDirection() int32
func (*QueryHistoryOrderList) GetLeftAsset ¶
func (m *QueryHistoryOrderList) GetLeftAsset() *Asset
func (*QueryHistoryOrderList) GetPrimaryKey ¶
func (m *QueryHistoryOrderList) GetPrimaryKey() string
func (*QueryHistoryOrderList) GetRightAsset ¶
func (m *QueryHistoryOrderList) GetRightAsset() *Asset
func (*QueryHistoryOrderList) ProtoMessage ¶
func (*QueryHistoryOrderList) ProtoMessage()
func (*QueryHistoryOrderList) Reset ¶
func (m *QueryHistoryOrderList) Reset()
func (*QueryHistoryOrderList) String ¶
func (m *QueryHistoryOrderList) String() string
func (*QueryHistoryOrderList) XXX_DiscardUnknown ¶
func (m *QueryHistoryOrderList) XXX_DiscardUnknown()
func (*QueryHistoryOrderList) XXX_Marshal ¶
func (m *QueryHistoryOrderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryHistoryOrderList) XXX_Merge ¶
func (m *QueryHistoryOrderList) XXX_Merge(src proto.Message)
func (*QueryHistoryOrderList) XXX_Size ¶
func (m *QueryHistoryOrderList) XXX_Size() int
func (*QueryHistoryOrderList) XXX_Unmarshal ¶
func (m *QueryHistoryOrderList) XXX_Unmarshal(b []byte) error
type QueryMarketDepth ¶
type QueryMarketDepth struct { //资产1 LeftAsset *Asset `protobuf:"bytes,1,opt,name=leftAsset,proto3" json:"leftAsset,omitempty"` //资产2 RightAsset *Asset `protobuf:"bytes,2,opt,name=rightAsset,proto3" json:"rightAsset,omitempty"` //操作, 1为买,2为卖 Op int32 `protobuf:"varint,3,opt,name=op,proto3" json:"op,omitempty"` // 这里用价格作为索引值 PrimaryKey string `protobuf:"bytes,4,opt,name=primaryKey,proto3" json:"primaryKey,omitempty"` //单页返回多少条记录,默认返回10条,为了系统安全最多单次只能返回20条 Count int32 `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
查询接口
func (*QueryMarketDepth) Descriptor ¶
func (*QueryMarketDepth) Descriptor() ([]byte, []int)
func (*QueryMarketDepth) GetCount ¶
func (m *QueryMarketDepth) GetCount() int32
func (*QueryMarketDepth) GetLeftAsset ¶
func (m *QueryMarketDepth) GetLeftAsset() *Asset
func (*QueryMarketDepth) GetOp ¶
func (m *QueryMarketDepth) GetOp() int32
func (*QueryMarketDepth) GetPrimaryKey ¶
func (m *QueryMarketDepth) GetPrimaryKey() string
func (*QueryMarketDepth) GetRightAsset ¶
func (m *QueryMarketDepth) GetRightAsset() *Asset
func (*QueryMarketDepth) ProtoMessage ¶
func (*QueryMarketDepth) ProtoMessage()
func (*QueryMarketDepth) Reset ¶
func (m *QueryMarketDepth) Reset()
func (*QueryMarketDepth) String ¶
func (m *QueryMarketDepth) String() string
func (*QueryMarketDepth) XXX_DiscardUnknown ¶
func (m *QueryMarketDepth) XXX_DiscardUnknown()
func (*QueryMarketDepth) XXX_Marshal ¶
func (m *QueryMarketDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryMarketDepth) XXX_Merge ¶
func (m *QueryMarketDepth) XXX_Merge(src proto.Message)
func (*QueryMarketDepth) XXX_Size ¶
func (m *QueryMarketDepth) XXX_Size() int
func (*QueryMarketDepth) XXX_Unmarshal ¶
func (m *QueryMarketDepth) XXX_Unmarshal(b []byte) error
type QueryOrder ¶
type QueryOrder struct { OrderID int64 `protobuf:"varint,1,opt,name=orderID,proto3" json:"orderID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
根据orderID去查询订单信息
func (*QueryOrder) Descriptor ¶
func (*QueryOrder) Descriptor() ([]byte, []int)
func (*QueryOrder) GetOrderID ¶
func (m *QueryOrder) GetOrderID() int64
func (*QueryOrder) ProtoMessage ¶
func (*QueryOrder) ProtoMessage()
func (*QueryOrder) Reset ¶
func (m *QueryOrder) Reset()
func (*QueryOrder) String ¶
func (m *QueryOrder) String() string
func (*QueryOrder) XXX_DiscardUnknown ¶
func (m *QueryOrder) XXX_DiscardUnknown()
func (*QueryOrder) XXX_Marshal ¶
func (m *QueryOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryOrder) XXX_Merge ¶
func (m *QueryOrder) XXX_Merge(src proto.Message)
func (*QueryOrder) XXX_Size ¶
func (m *QueryOrder) XXX_Size() int
func (*QueryOrder) XXX_Unmarshal ¶
func (m *QueryOrder) XXX_Unmarshal(b []byte) error
type QueryOrderList ¶
type QueryOrderList struct { //挂单状态必填(默认是0,只查询ordered挂单中的) Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //用户地址信息,必填 Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // 主键索引 PrimaryKey string `protobuf:"bytes,3,opt,name=primaryKey,proto3" json:"primaryKey,omitempty"` //单页返回多少条记录,默认返回10条,为了系统安全最多单次只能返回20条 Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` // 0降序,1升序,默认降序 Direction int32 `protobuf:"varint,5,opt,name=direction,proto3" json:"direction,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
根据地址,状态查询用户自己的挂单信息
func (*QueryOrderList) Descriptor ¶
func (*QueryOrderList) Descriptor() ([]byte, []int)
func (*QueryOrderList) GetAddress ¶
func (m *QueryOrderList) GetAddress() string
func (*QueryOrderList) GetCount ¶
func (m *QueryOrderList) GetCount() int32
func (*QueryOrderList) GetDirection ¶
func (m *QueryOrderList) GetDirection() int32
func (*QueryOrderList) GetPrimaryKey ¶
func (m *QueryOrderList) GetPrimaryKey() string
func (*QueryOrderList) GetStatus ¶
func (m *QueryOrderList) GetStatus() int32
func (*QueryOrderList) ProtoMessage ¶
func (*QueryOrderList) ProtoMessage()
func (*QueryOrderList) Reset ¶
func (m *QueryOrderList) Reset()
func (*QueryOrderList) String ¶
func (m *QueryOrderList) String() string
func (*QueryOrderList) XXX_DiscardUnknown ¶
func (m *QueryOrderList) XXX_DiscardUnknown()
func (*QueryOrderList) XXX_Marshal ¶
func (m *QueryOrderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryOrderList) XXX_Merge ¶
func (m *QueryOrderList) XXX_Merge(src proto.Message)
func (*QueryOrderList) XXX_Size ¶
func (m *QueryOrderList) XXX_Size() int
func (*QueryOrderList) XXX_Unmarshal ¶
func (m *QueryOrderList) XXX_Unmarshal(b []byte) error
type ReceiptExchange ¶
type ReceiptExchange struct { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` MatchOrders []*Order `protobuf:"bytes,2,rep,name=matchOrders,proto3" json:"matchOrders,omitempty"` Index int64 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
exchange执行票据日志
func (*ReceiptExchange) Descriptor ¶
func (*ReceiptExchange) Descriptor() ([]byte, []int)
func (*ReceiptExchange) GetIndex ¶
func (m *ReceiptExchange) GetIndex() int64
func (*ReceiptExchange) GetMatchOrders ¶
func (m *ReceiptExchange) GetMatchOrders() []*Order
func (*ReceiptExchange) GetOrder ¶
func (m *ReceiptExchange) GetOrder() *Order
func (*ReceiptExchange) ProtoMessage ¶
func (*ReceiptExchange) ProtoMessage()
func (*ReceiptExchange) Reset ¶
func (m *ReceiptExchange) Reset()
func (*ReceiptExchange) String ¶
func (m *ReceiptExchange) String() string
func (*ReceiptExchange) XXX_DiscardUnknown ¶
func (m *ReceiptExchange) XXX_DiscardUnknown()
func (*ReceiptExchange) XXX_Marshal ¶
func (m *ReceiptExchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ReceiptExchange) XXX_Merge ¶
func (m *ReceiptExchange) XXX_Merge(src proto.Message)
func (*ReceiptExchange) XXX_Size ¶
func (m *ReceiptExchange) XXX_Size() int
func (*ReceiptExchange) XXX_Unmarshal ¶
func (m *ReceiptExchange) XXX_Unmarshal(b []byte) error
type RevokeOrder ¶
type RevokeOrder struct { //订单号 OrderID int64 `protobuf:"varint,1,opt,name=orderID,proto3" json:"orderID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
撤回订单
func (*RevokeOrder) Descriptor ¶
func (*RevokeOrder) Descriptor() ([]byte, []int)
func (*RevokeOrder) GetOrderID ¶
func (m *RevokeOrder) GetOrderID() int64
func (*RevokeOrder) ProtoMessage ¶
func (*RevokeOrder) ProtoMessage()
func (*RevokeOrder) Reset ¶
func (m *RevokeOrder) Reset()
func (*RevokeOrder) String ¶
func (m *RevokeOrder) String() string
func (*RevokeOrder) XXX_DiscardUnknown ¶
func (m *RevokeOrder) XXX_DiscardUnknown()
func (*RevokeOrder) XXX_Marshal ¶
func (m *RevokeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RevokeOrder) XXX_Merge ¶
func (m *RevokeOrder) XXX_Merge(src proto.Message)
func (*RevokeOrder) XXX_Size ¶
func (m *RevokeOrder) XXX_Size() int
func (*RevokeOrder) XXX_Unmarshal ¶
func (m *RevokeOrder) XXX_Unmarshal(b []byte) error
type UnimplementedExchangeServer ¶
type UnimplementedExchangeServer struct { }
UnimplementedExchangeServer can be embedded to have forward compatible implementations.