diff --git a/chain/client/context.go b/chain/client/context.go index 5393835e..418e1a8c 100644 --- a/chain/client/context.go +++ b/chain/client/context.go @@ -22,7 +22,7 @@ import ( keyscodec "github.com/InjectiveLabs/sdk-go/chain/crypto/codec" evm "github.com/InjectiveLabs/sdk-go/chain/evm/types" - orders "github.com/InjectiveLabs/sdk-go/chain/orders/types" + orders "github.com/InjectiveLabs/sdk-go/chain/exchange/types" peggy "github.com/InjectiveLabs/sdk-go/chain/peggy/types" ctypes "github.com/InjectiveLabs/sdk-go/chain/types" ) diff --git a/chain/client/contract_discover.go b/chain/client/contract_discover.go index 10e0db4b..2b0d3474 100644 --- a/chain/client/contract_discover.go +++ b/chain/client/contract_discover.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" log "github.com/xlab/suplog" - ordertypes "github.com/InjectiveLabs/sdk-go/chain/orders/types" + exchangetypes "github.com/InjectiveLabs/sdk-go/chain/exchange/types" ) type ContractSet struct { @@ -19,7 +19,7 @@ type ContractDiscoverer interface { GetContractSet(ctx context.Context) ContractSet } -func NewContractDiscoverer(ordersQuerier ordertypes.QueryClient) ContractDiscoverer { +func NewContractDiscoverer(ordersQuerier exchangetypes.QueryClient) ContractDiscoverer { return &contractDiscoverer{ queryClient: ordersQuerier, logger: log.WithFields(log.Fields{ @@ -30,7 +30,7 @@ func NewContractDiscoverer(ordersQuerier ordertypes.QueryClient) ContractDiscove } type contractDiscoverer struct { - queryClient ordertypes.QueryClient + queryClient exchangetypes.QueryClient logger log.Logger } @@ -42,7 +42,7 @@ func (c *contractDiscoverer) GetContractSet(ctx context.Context) (set ContractSe case <-ctx.Done(): return default: - resp, err := c.queryClient.QueryDerivativeMarkets(ctx, &ordertypes.QueryDerivativeMarketsRequest{}) + resp, err := c.queryClient.QueryDerivativeMarkets(ctx, &exchangetypes.QueryDerivativeMarketsRequest{}) if err != nil { c.logger.WithError(err).Warningln("failed to query derivative markets, retry in 10s") time.Sleep(defaultRetryDelay) diff --git a/chain/orders/types/codec.go b/chain/exchange/types/codec.go similarity index 91% rename from chain/orders/types/codec.go rename to chain/exchange/types/codec.go index af20327b..9f41640f 100644 --- a/chain/orders/types/codec.go +++ b/chain/exchange/types/codec.go @@ -8,10 +8,10 @@ import ( ) var ( - // ModuleCdc references the global orders module codec. Note, the codec should + // ModuleCdc references the global exchange module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/orders and + // The actual codec used for serialization should be provided to modules/exchange and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) ) diff --git a/chain/orders/types/errors.go b/chain/exchange/types/errors.go similarity index 97% rename from chain/orders/types/errors.go rename to chain/exchange/types/errors.go index cafe67bb..b763a589 100644 --- a/chain/orders/types/errors.go +++ b/chain/exchange/types/errors.go @@ -9,7 +9,7 @@ var ( ErrOrderNotFound = sdkerrors.Register(ModuleName, 2, "no active order found for the hash") ErrPairSuspended = sdkerrors.Register(ModuleName, 3, "trade pair suspended") ErrPairNotFound = sdkerrors.Register(ModuleName, 4, "trade pair not found") - ErrPairExists = sdkerrors.Register(ModuleName, 5, "trade pair exists") + ErrSpotMarketExists = sdkerrors.Register(ModuleName, 5, "trade pair exists") ErrPairMismatch = sdkerrors.Register(ModuleName, 6, "trade pair mismatch") ErrBadField = sdkerrors.Register(ModuleName, 7, "struct field error") ErrMarketNotFound = sdkerrors.Register(ModuleName, 8, "derivative market not found") diff --git a/chain/orders/types/events.go b/chain/exchange/types/events.go similarity index 100% rename from chain/orders/types/events.go rename to chain/exchange/types/events.go diff --git a/chain/orders/types/orders.pb.go b/chain/exchange/types/exchange.pb.go similarity index 60% rename from chain/orders/types/orders.pb.go rename to chain/exchange/types/exchange.pb.go index 9127d175..2d86d4b0 100644 --- a/chain/orders/types/orders.pb.go +++ b/chain/exchange/types/exchange.pb.go @@ -1,11 +1,10 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/orders/v1beta1/orders.proto +// source: injective/exchange/v1beta1/exchange.proto package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -24,6 +23,120 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// order types +type SpotLimitOrder_LimitOrderType int32 + +const ( + SpotLimitOrder_LIMIT SpotLimitOrder_LimitOrderType = 0 + SpotLimitOrder_STOP SpotLimitOrder_LimitOrderType = 1 + SpotLimitOrder_TAKE SpotLimitOrder_LimitOrderType = 2 +) + +var SpotLimitOrder_LimitOrderType_name = map[int32]string{ + 0: "LIMIT", + 1: "STOP", + 2: "TAKE", +} + +var SpotLimitOrder_LimitOrderType_value = map[string]int32{ + "LIMIT": 0, + "STOP": 1, + "TAKE": 2, +} + +func (x SpotLimitOrder_LimitOrderType) String() string { + return proto.EnumName(SpotLimitOrder_LimitOrderType_name, int32(x)) +} + +func (SpotLimitOrder_LimitOrderType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{2, 0} +} + +// order types +type SpotMarketOrder_MarketOrderType int32 + +const ( + SpotMarketOrder_MARKET SpotMarketOrder_MarketOrderType = 0 + SpotMarketOrder_STOP SpotMarketOrder_MarketOrderType = 1 + SpotMarketOrder_TAKE SpotMarketOrder_MarketOrderType = 2 +) + +var SpotMarketOrder_MarketOrderType_name = map[int32]string{ + 0: "MARKET", + 1: "STOP", + 2: "TAKE", +} + +var SpotMarketOrder_MarketOrderType_value = map[string]int32{ + "MARKET": 0, + "STOP": 1, + "TAKE": 2, +} + +func (x SpotMarketOrder_MarketOrderType) String() string { + return proto.EnumName(SpotMarketOrder_MarketOrderType_name, int32(x)) +} + +func (SpotMarketOrder_MarketOrderType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{3, 0} +} + +// order types +type BaseSpotOrder_OrderType int32 + +const ( + BaseSpotOrder_LIMIT_BUY BaseSpotOrder_OrderType = 0 + BaseSpotOrder_LIMIT_SELL BaseSpotOrder_OrderType = 1 + BaseSpotOrder_MARKET_BUY BaseSpotOrder_OrderType = 2 + BaseSpotOrder_MARKET_SELL BaseSpotOrder_OrderType = 3 + BaseSpotOrder_STOP_LIMIT_BUY BaseSpotOrder_OrderType = 4 + BaseSpotOrder_STOP_LIMIT_SELL BaseSpotOrder_OrderType = 5 + BaseSpotOrder_STOP_MARKET_BUY BaseSpotOrder_OrderType = 6 + BaseSpotOrder_STOP_MARKET_SELL BaseSpotOrder_OrderType = 7 + BaseSpotOrder_TAKE_LIMIT_BUY BaseSpotOrder_OrderType = 8 + BaseSpotOrder_TAKE_LIMIT_SELL BaseSpotOrder_OrderType = 9 + BaseSpotOrder_TAKE_MARKET_BUY BaseSpotOrder_OrderType = 10 + BaseSpotOrder_TAKE_MARKET_SELL BaseSpotOrder_OrderType = 11 +) + +var BaseSpotOrder_OrderType_name = map[int32]string{ + 0: "LIMIT_BUY", + 1: "LIMIT_SELL", + 2: "MARKET_BUY", + 3: "MARKET_SELL", + 4: "STOP_LIMIT_BUY", + 5: "STOP_LIMIT_SELL", + 6: "STOP_MARKET_BUY", + 7: "STOP_MARKET_SELL", + 8: "TAKE_LIMIT_BUY", + 9: "TAKE_LIMIT_SELL", + 10: "TAKE_MARKET_BUY", + 11: "TAKE_MARKET_SELL", +} + +var BaseSpotOrder_OrderType_value = map[string]int32{ + "LIMIT_BUY": 0, + "LIMIT_SELL": 1, + "MARKET_BUY": 2, + "MARKET_SELL": 3, + "STOP_LIMIT_BUY": 4, + "STOP_LIMIT_SELL": 5, + "STOP_MARKET_BUY": 6, + "STOP_MARKET_SELL": 7, + "TAKE_LIMIT_BUY": 8, + "TAKE_LIMIT_SELL": 9, + "TAKE_MARKET_BUY": 10, + "TAKE_MARKET_SELL": 11, +} + +func (x BaseSpotOrder_OrderType) String() string { + return proto.EnumName(BaseSpotOrder_OrderType_name, int32(x)) +} + +func (BaseSpotOrder_OrderType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{4, 0} +} + // An object describing a derivative market in the Injective Futures Protocol. type DerivativeMarket struct { // Ticker for the derivative contract. @@ -64,7 +177,7 @@ func (m *DerivativeMarket) Reset() { *m = DerivativeMarket{} } func (m *DerivativeMarket) String() string { return proto.CompactTextString(m) } func (*DerivativeMarket) ProtoMessage() {} func (*DerivativeMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{0} + return fileDescriptor_2116e2804e9c53f9, []int{0} } func (m *DerivativeMarket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,34 +319,37 @@ func (m *DerivativeMarket) GetCumulativeFunding() string { } // An object describing trade pair of two assets. -type TradePair struct { - // A name of the pair in format AAA/BBB, where AAA - maker's asset, BBB - - // taker's asset. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerAsset. - MakerAssetData string `protobuf:"bytes,2,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerAsset. - TakerAssetData string `protobuf:"bytes,3,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` - // Hash of both asset data, to identify the trading pair in store. - Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - // If false, then the pair is suspended and trades cannot be made. - Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` +type SpotMarket struct { + // A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote asset. + Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` + // Address of the base asset. + BaseAsset string `protobuf:"bytes,2,opt,name=base_asset,json=baseAsset,proto3" json:"base_asset,omitempty"` + // Address of the quote asset. + QuoteAsset string `protobuf:"bytes,3,opt,name=quote_asset,json=quoteAsset,proto3" json:"quote_asset,omitempty"` + // MakerTxFeePermyriad + MakerTxFee string `protobuf:"bytes,4,opt,name=maker_tx_fee,json=makerTxFee,proto3" json:"maker_tx_fee,omitempty"` + // TakerTxFeePermyriad + TakerTxFee string `protobuf:"bytes,5,opt,name=taker_tx_fee,json=takerTxFee,proto3" json:"taker_tx_fee,omitempty"` + // Unique market ID. + MarketId string `protobuf:"bytes,6,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // If false, then the market is suspended and trades cannot be made. + Enabled bool `protobuf:"varint,7,opt,name=enabled,proto3" json:"enabled,omitempty"` + // exchange address + ExchangeAddress string `protobuf:"bytes,8,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` } -func (m *TradePair) Reset() { *m = TradePair{} } -func (m *TradePair) String() string { return proto.CompactTextString(m) } -func (*TradePair) ProtoMessage() {} -func (*TradePair) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{1} +func (m *SpotMarket) Reset() { *m = SpotMarket{} } +func (m *SpotMarket) String() string { return proto.CompactTextString(m) } +func (*SpotMarket) ProtoMessage() {} +func (*SpotMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{1} } -func (m *TradePair) XXX_Unmarshal(b []byte) error { +func (m *SpotMarket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TradePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TradePair.Marshal(b, m, deterministic) + return xxx_messageInfo_SpotMarket.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -243,111 +359,107 @@ func (m *TradePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TradePair) XXX_Merge(src proto.Message) { - xxx_messageInfo_TradePair.Merge(m, src) +func (m *SpotMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotMarket.Merge(m, src) } -func (m *TradePair) XXX_Size() int { +func (m *SpotMarket) XXX_Size() int { return m.Size() } -func (m *TradePair) XXX_DiscardUnknown() { - xxx_messageInfo_TradePair.DiscardUnknown(m) +func (m *SpotMarket) XXX_DiscardUnknown() { + xxx_messageInfo_SpotMarket.DiscardUnknown(m) } -var xxx_messageInfo_TradePair proto.InternalMessageInfo +var xxx_messageInfo_SpotMarket proto.InternalMessageInfo -func (m *TradePair) GetName() string { +func (m *SpotMarket) GetTicker() string { if m != nil { - return m.Name + return m.Ticker } return "" } -func (m *TradePair) GetMakerAssetData() string { +func (m *SpotMarket) GetBaseAsset() string { if m != nil { - return m.MakerAssetData + return m.BaseAsset } return "" } -func (m *TradePair) GetTakerAssetData() string { +func (m *SpotMarket) GetQuoteAsset() string { if m != nil { - return m.TakerAssetData + return m.QuoteAsset + } + return "" +} + +func (m *SpotMarket) GetMakerTxFee() string { + if m != nil { + return m.MakerTxFee + } + return "" +} + +func (m *SpotMarket) GetTakerTxFee() string { + if m != nil { + return m.TakerTxFee } return "" } -func (m *TradePair) GetHash() string { +func (m *SpotMarket) GetMarketId() string { if m != nil { - return m.Hash + return m.MarketId } return "" } -func (m *TradePair) GetEnabled() bool { +func (m *SpotMarket) GetEnabled() bool { if m != nil { return m.Enabled } return false } -// A valid signed 0x order based on the schema. -type BaseOrder struct { - // Specify chain ID. - ChainId int64 `protobuf:"zigzag64,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // Exchange v3 contract address. - ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` - // Address that created the order. - MakerAddress string `protobuf:"bytes,3,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` - // Address that is allowed to fill the order. If set to 0, any address is - // allowed to fill the order. - TakerAddress string `protobuf:"bytes,4,opt,name=taker_address,json=takerAddress,proto3" json:"taker_address,omitempty"` - // Address that will receive fees when order is filled. - FeeRecipientAddress string `protobuf:"bytes,5,opt,name=fee_recipient_address,json=feeRecipientAddress,proto3" json:"fee_recipient_address,omitempty"` - // Address that is allowed to call Exchange contract methods that affect this - // order. If set to 0, any address is allowed to call these methods. - SenderAddress string `protobuf:"bytes,6,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` - // Amount of makerAsset being offered by maker. Must be greater than 0. - MakerAssetAmount string `protobuf:"bytes,7,opt,name=maker_asset_amount,json=makerAssetAmount,proto3" json:"maker_asset_amount,omitempty"` - // Amount of takerAsset being bid on by maker. Must be greater than 0. - TakerAssetAmount string `protobuf:"bytes,8,opt,name=taker_asset_amount,json=takerAssetAmount,proto3" json:"taker_asset_amount,omitempty"` - // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to - // 0, no transfer of ZRX from maker to feeRecipient will be attempted. - MakerFee string `protobuf:"bytes,9,opt,name=maker_fee,json=makerFee,proto3" json:"maker_fee,omitempty"` - // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to - // 0, no transfer of ZRX from taker to feeRecipient will be attempted. - TakerFee string `protobuf:"bytes,10,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` - // Timestamp in seconds at which order expires. - ExpirationTimeSeconds string `protobuf:"bytes,11,opt,name=expiration_time_seconds,json=expirationTimeSeconds,proto3" json:"expiration_time_seconds,omitempty"` - // Arbitrary number to facilitate uniqueness of the order's hash. - Salt string `protobuf:"bytes,12,opt,name=salt,proto3" json:"salt,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerAsset. - MakerAssetData string `protobuf:"bytes,13,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerAsset. - TakerAssetData string `protobuf:"bytes,14,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerFee. - MakerFeeAssetData string `protobuf:"bytes,15,opt,name=maker_fee_asset_data,json=makerFeeAssetData,proto3" json:"maker_fee_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerFee. - TakerFeeAssetData string `protobuf:"bytes,16,opt,name=taker_fee_asset_data,json=takerFeeAssetData,proto3" json:"taker_fee_asset_data,omitempty"` - // Order signature. - Signature string `protobuf:"bytes,17,opt,name=signature,proto3" json:"signature,omitempty"` +func (m *SpotMarket) GetExchangeAddress() string { + if m != nil { + return m.ExchangeAddress + } + return "" } -func (m *BaseOrder) Reset() { *m = BaseOrder{} } -func (m *BaseOrder) String() string { return proto.CompactTextString(m) } -func (*BaseOrder) ProtoMessage() {} -func (*BaseOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{2} -} -func (m *BaseOrder) XXX_Unmarshal(b []byte) error { +// A valid signed Spot limit order with Metadata. +type SpotLimitOrder struct { + // Address that created the order (for make orders, 0x0 for take orders) + SubaccountID string `protobuf:"bytes,1,opt,name=subaccountID,proto3" json:"subaccountID,omitempty"` + // Optional address that can cancel order on behalf of maker + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // Address that will receive fees when order is filled. + FeeRecipient string `protobuf:"bytes,3,opt,name=feeRecipient,proto3" json:"feeRecipient,omitempty"` + // timestamp the order expires in unix seconds + Expiry uint64 `protobuf:"varint,4,opt,name=expiry,proto3" json:"expiry,omitempty"` + // The amount of the asset supplied + SupplyAmount string `protobuf:"bytes,5,opt,name=supplyAmount,proto3" json:"supplyAmount,omitempty"` + // The amount of the asset demanded + DemandAmount string `protobuf:"bytes,6,opt,name=demandAmount,proto3" json:"demandAmount,omitempty"` + // the amount of the demand filled + FilledAmount string `protobuf:"bytes,7,opt,name=filledAmount,proto3" json:"filledAmount,omitempty"` + CreationBlockHeight int64 `protobuf:"varint,8,opt,name=creation_block_height,json=creationBlockHeight,proto3" json:"creation_block_height,omitempty"` + OrderType SpotLimitOrder_LimitOrderType `protobuf:"varint,9,opt,name=orderType,proto3,enum=injective.exchange.v1beta1.SpotLimitOrder_LimitOrderType" json:"orderType,omitempty"` + TriggerPrice string `protobuf:"bytes,10,opt,name=triggerPrice,proto3" json:"triggerPrice,omitempty"` +} + +func (m *SpotLimitOrder) Reset() { *m = SpotLimitOrder{} } +func (m *SpotLimitOrder) String() string { return proto.CompactTextString(m) } +func (*SpotLimitOrder) ProtoMessage() {} +func (*SpotLimitOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{2} +} +func (m *SpotLimitOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BaseOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SpotLimitOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BaseOrder.Marshal(b, m, deterministic) + return xxx_messageInfo_SpotLimitOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -357,161 +469,215 @@ func (m *BaseOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *BaseOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseOrder.Merge(m, src) +func (m *SpotLimitOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotLimitOrder.Merge(m, src) } -func (m *BaseOrder) XXX_Size() int { +func (m *SpotLimitOrder) XXX_Size() int { return m.Size() } -func (m *BaseOrder) XXX_DiscardUnknown() { - xxx_messageInfo_BaseOrder.DiscardUnknown(m) +func (m *SpotLimitOrder) XXX_DiscardUnknown() { + xxx_messageInfo_SpotLimitOrder.DiscardUnknown(m) } -var xxx_messageInfo_BaseOrder proto.InternalMessageInfo +var xxx_messageInfo_SpotLimitOrder proto.InternalMessageInfo -func (m *BaseOrder) GetChainId() int64 { +func (m *SpotLimitOrder) GetSubaccountID() string { if m != nil { - return m.ChainId + return m.SubaccountID } - return 0 + return "" } -func (m *BaseOrder) GetExchangeAddress() string { +func (m *SpotLimitOrder) GetSender() string { if m != nil { - return m.ExchangeAddress + return m.Sender } return "" } -func (m *BaseOrder) GetMakerAddress() string { +func (m *SpotLimitOrder) GetFeeRecipient() string { if m != nil { - return m.MakerAddress + return m.FeeRecipient } return "" } -func (m *BaseOrder) GetTakerAddress() string { +func (m *SpotLimitOrder) GetExpiry() uint64 { if m != nil { - return m.TakerAddress + return m.Expiry } - return "" + return 0 } -func (m *BaseOrder) GetFeeRecipientAddress() string { +func (m *SpotLimitOrder) GetSupplyAmount() string { if m != nil { - return m.FeeRecipientAddress + return m.SupplyAmount } return "" } -func (m *BaseOrder) GetSenderAddress() string { +func (m *SpotLimitOrder) GetDemandAmount() string { if m != nil { - return m.SenderAddress + return m.DemandAmount } return "" } -func (m *BaseOrder) GetMakerAssetAmount() string { +func (m *SpotLimitOrder) GetFilledAmount() string { if m != nil { - return m.MakerAssetAmount + return m.FilledAmount } return "" } -func (m *BaseOrder) GetTakerAssetAmount() string { +func (m *SpotLimitOrder) GetCreationBlockHeight() int64 { if m != nil { - return m.TakerAssetAmount + return m.CreationBlockHeight } - return "" + return 0 } -func (m *BaseOrder) GetMakerFee() string { +func (m *SpotLimitOrder) GetOrderType() SpotLimitOrder_LimitOrderType { if m != nil { - return m.MakerFee + return m.OrderType } - return "" + return SpotLimitOrder_LIMIT } -func (m *BaseOrder) GetTakerFee() string { +func (m *SpotLimitOrder) GetTriggerPrice() string { if m != nil { - return m.TakerFee + return m.TriggerPrice } return "" } -func (m *BaseOrder) GetExpirationTimeSeconds() string { - if m != nil { - return m.ExpirationTimeSeconds +// A valid signed Spot market order with Metadata. +type SpotMarketOrder struct { + // Address that created the order (for make orders, 0x0 for take orders) + SubaccountID string `protobuf:"bytes,1,opt,name=subaccountID,proto3" json:"subaccountID,omitempty"` + // Address that will receive fees when order is filled. + FeeRecipient string `protobuf:"bytes,2,opt,name=feeRecipient,proto3" json:"feeRecipient,omitempty"` + // The desired quantity of asset to receive + Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + // The amount of maximum funds supplied for the trade + FundsSupplied string `protobuf:"bytes,4,opt,name=fundsSupplied,proto3" json:"fundsSupplied,omitempty"` + OrderType SpotMarketOrder_MarketOrderType `protobuf:"varint,5,opt,name=orderType,proto3,enum=injective.exchange.v1beta1.SpotMarketOrder_MarketOrderType" json:"orderType,omitempty"` + TriggerPrice string `protobuf:"bytes,6,opt,name=triggerPrice,proto3" json:"triggerPrice,omitempty"` +} + +func (m *SpotMarketOrder) Reset() { *m = SpotMarketOrder{} } +func (m *SpotMarketOrder) String() string { return proto.CompactTextString(m) } +func (*SpotMarketOrder) ProtoMessage() {} +func (*SpotMarketOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{3} +} +func (m *SpotMarketOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpotMarketOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpotMarketOrder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return "" +} +func (m *SpotMarketOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpotMarketOrder.Merge(m, src) +} +func (m *SpotMarketOrder) XXX_Size() int { + return m.Size() +} +func (m *SpotMarketOrder) XXX_DiscardUnknown() { + xxx_messageInfo_SpotMarketOrder.DiscardUnknown(m) } -func (m *BaseOrder) GetSalt() string { +var xxx_messageInfo_SpotMarketOrder proto.InternalMessageInfo + +func (m *SpotMarketOrder) GetSubaccountID() string { if m != nil { - return m.Salt + return m.SubaccountID } return "" } -func (m *BaseOrder) GetMakerAssetData() string { +func (m *SpotMarketOrder) GetFeeRecipient() string { if m != nil { - return m.MakerAssetData + return m.FeeRecipient } return "" } -func (m *BaseOrder) GetTakerAssetData() string { +func (m *SpotMarketOrder) GetQuantity() string { if m != nil { - return m.TakerAssetData + return m.Quantity } return "" } -func (m *BaseOrder) GetMakerFeeAssetData() string { +func (m *SpotMarketOrder) GetFundsSupplied() string { if m != nil { - return m.MakerFeeAssetData + return m.FundsSupplied } return "" } -func (m *BaseOrder) GetTakerFeeAssetData() string { +func (m *SpotMarketOrder) GetOrderType() SpotMarketOrder_MarketOrderType { if m != nil { - return m.TakerFeeAssetData + return m.OrderType } - return "" + return SpotMarketOrder_MARKET } -func (m *BaseOrder) GetSignature() string { +func (m *SpotMarketOrder) GetTriggerPrice() string { if m != nil { - return m.Signature + return m.TriggerPrice } return "" } -// A valid signed 0x order with Metadata. -type Order struct { - Order *BaseOrder `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` - TradePairHash string `protobuf:"bytes,2,opt,name=trade_pair_hash,json=tradePairHash,proto3" json:"trade_pair_hash,omitempty"` - FilledAmount string `protobuf:"bytes,3,opt,name=filled_amount,json=filledAmount,proto3" json:"filled_amount,omitempty"` - Status int64 `protobuf:"zigzag64,4,opt,name=status,proto3" json:"status,omitempty"` - IndexPriceRequirement string `protobuf:"bytes,5,opt,name=index_price_requirement,json=indexPriceRequirement,proto3" json:"index_price_requirement,omitempty"` - SubaccountID string `protobuf:"bytes,6,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` - OrderType uint64 `protobuf:"varint,7,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` - TriggerPrice string `protobuf:"bytes,8,opt,name=trigger_price,json=triggerPrice,proto3" json:"trigger_price,omitempty"` +type BaseSpotOrder struct { + // Specify chain ID. + ChainId int64 `protobuf:"zigzag64,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Address that created the order (for make orders, 0x0 for take orders) + SubaccountID string `protobuf:"bytes,2,opt,name=subaccountID,proto3" json:"subaccountID,omitempty"` + // Optional address that can cancel order on behalf of maker + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + // Address that will receive fees when order is filled. + FeeRecipient string `protobuf:"bytes,4,opt,name=feeRecipient,proto3" json:"feeRecipient,omitempty"` + // timestamp the order expires in unix seconds + Expiry uint64 `protobuf:"varint,5,opt,name=expiry,proto3" json:"expiry,omitempty"` + // unique ID of the market + MarketID string `protobuf:"bytes,6,opt,name=marketID,proto3" json:"marketID,omitempty"` + // The amount of the asset supplied + SupplyAmount string `protobuf:"bytes,7,opt,name=supplyAmount,proto3" json:"supplyAmount,omitempty"` + // The amount of the asset demanded + DemandAmount string `protobuf:"bytes,8,opt,name=demandAmount,proto3" json:"demandAmount,omitempty"` + // Arbitrary number to facilitate uniqueness of the order's hash. + Salt uint64 `protobuf:"varint,9,opt,name=salt,proto3" json:"salt,omitempty"` + OrderType BaseSpotOrder_OrderType `protobuf:"varint,10,opt,name=orderType,proto3,enum=injective.exchange.v1beta1.BaseSpotOrder_OrderType" json:"orderType,omitempty"` + // use this for stop/take orders in the future + TriggerPrice string `protobuf:"bytes,11,opt,name=triggerPrice,proto3" json:"triggerPrice,omitempty"` + // Order signature. + Signature string `protobuf:"bytes,12,opt,name=signature,proto3" json:"signature,omitempty"` } -func (m *Order) Reset() { *m = Order{} } -func (m *Order) String() string { return proto.CompactTextString(m) } -func (*Order) ProtoMessage() {} -func (*Order) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{3} +func (m *BaseSpotOrder) Reset() { *m = BaseSpotOrder{} } +func (m *BaseSpotOrder) String() string { return proto.CompactTextString(m) } +func (*BaseSpotOrder) ProtoMessage() {} +func (*BaseSpotOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{4} } -func (m *Order) XXX_Unmarshal(b []byte) error { +func (m *BaseSpotOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BaseSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Order.Marshal(b, m, deterministic) + return xxx_messageInfo_BaseSpotOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -521,92 +687,160 @@ func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Order) XXX_Merge(src proto.Message) { - xxx_messageInfo_Order.Merge(m, src) +func (m *BaseSpotOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseSpotOrder.Merge(m, src) } -func (m *Order) XXX_Size() int { +func (m *BaseSpotOrder) XXX_Size() int { return m.Size() } -func (m *Order) XXX_DiscardUnknown() { - xxx_messageInfo_Order.DiscardUnknown(m) +func (m *BaseSpotOrder) XXX_DiscardUnknown() { + xxx_messageInfo_BaseSpotOrder.DiscardUnknown(m) } -var xxx_messageInfo_Order proto.InternalMessageInfo +var xxx_messageInfo_BaseSpotOrder proto.InternalMessageInfo -func (m *Order) GetOrder() *BaseOrder { +func (m *BaseSpotOrder) GetChainId() int64 { if m != nil { - return m.Order + return m.ChainId } - return nil + return 0 } -func (m *Order) GetTradePairHash() string { +func (m *BaseSpotOrder) GetSubaccountID() string { if m != nil { - return m.TradePairHash + return m.SubaccountID } return "" } -func (m *Order) GetFilledAmount() string { +func (m *BaseSpotOrder) GetSender() string { if m != nil { - return m.FilledAmount + return m.Sender } return "" } -func (m *Order) GetStatus() int64 { +func (m *BaseSpotOrder) GetFeeRecipient() string { if m != nil { - return m.Status + return m.FeeRecipient + } + return "" +} + +func (m *BaseSpotOrder) GetExpiry() uint64 { + if m != nil { + return m.Expiry } return 0 } -func (m *Order) GetIndexPriceRequirement() string { +func (m *BaseSpotOrder) GetMarketID() string { if m != nil { - return m.IndexPriceRequirement + return m.MarketID } return "" } -func (m *Order) GetSubaccountID() string { +func (m *BaseSpotOrder) GetSupplyAmount() string { if m != nil { - return m.SubaccountID + return m.SupplyAmount } return "" } -func (m *Order) GetOrderType() uint64 { +func (m *BaseSpotOrder) GetDemandAmount() string { if m != nil { - return m.OrderType + return m.DemandAmount + } + return "" +} + +func (m *BaseSpotOrder) GetSalt() uint64 { + if m != nil { + return m.Salt } return 0 } -func (m *Order) GetTriggerPrice() string { +func (m *BaseSpotOrder) GetOrderType() BaseSpotOrder_OrderType { + if m != nil { + return m.OrderType + } + return BaseSpotOrder_LIMIT_BUY +} + +func (m *BaseSpotOrder) GetTriggerPrice() string { if m != nil { return m.TriggerPrice } return "" } -// An subaccount's margin info for a given base currency -type MarginInfo struct { - MarginHold string `protobuf:"bytes,1,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` - TotalDeposits string `protobuf:"bytes,2,opt,name=total_deposits,json=totalDeposits,proto3" json:"total_deposits,omitempty"` +func (m *BaseSpotOrder) GetSignature() string { + if m != nil { + return m.Signature + } + return "" } -func (m *MarginInfo) Reset() { *m = MarginInfo{} } -func (m *MarginInfo) String() string { return proto.CompactTextString(m) } -func (*MarginInfo) ProtoMessage() {} -func (*MarginInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{4} +// A valid signed 0x order based on the schema. +type BaseOrder struct { + // Specify chain ID. + ChainId int64 `protobuf:"zigzag64,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Exchange v3 contract address. + ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` + // Address that created the order. + MakerAddress string `protobuf:"bytes,3,opt,name=maker_address,json=makerAddress,proto3" json:"maker_address,omitempty"` + // Address that is allowed to fill the order. If set to 0, any address is + // allowed to fill the order. + TakerAddress string `protobuf:"bytes,4,opt,name=taker_address,json=takerAddress,proto3" json:"taker_address,omitempty"` + // Address that will receive fees when order is filled. + FeeRecipientAddress string `protobuf:"bytes,5,opt,name=fee_recipient_address,json=feeRecipientAddress,proto3" json:"fee_recipient_address,omitempty"` + // Address that is allowed to call Exchange contract methods that affect this + // order. If set to 0, any address is allowed to call these methods. + SenderAddress string `protobuf:"bytes,6,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` + // Amount of makerAsset being offered by maker. Must be greater than 0. + MakerAssetAmount string `protobuf:"bytes,7,opt,name=maker_asset_amount,json=makerAssetAmount,proto3" json:"maker_asset_amount,omitempty"` + // Amount of takerAsset being bid on by maker. Must be greater than 0. + TakerAssetAmount string `protobuf:"bytes,8,opt,name=taker_asset_amount,json=takerAssetAmount,proto3" json:"taker_asset_amount,omitempty"` + // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to + // 0, no transfer of ZRX from maker to feeRecipient will be attempted. + MakerFee string `protobuf:"bytes,9,opt,name=maker_fee,json=makerFee,proto3" json:"maker_fee,omitempty"` + // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to + // 0, no transfer of ZRX from taker to feeRecipient will be attempted. + TakerFee string `protobuf:"bytes,10,opt,name=taker_fee,json=takerFee,proto3" json:"taker_fee,omitempty"` + // Timestamp in seconds at which order expires. + ExpirationTimeSeconds string `protobuf:"bytes,11,opt,name=expiration_time_seconds,json=expirationTimeSeconds,proto3" json:"expiration_time_seconds,omitempty"` + // Arbitrary number to facilitate uniqueness of the order's hash. + Salt string `protobuf:"bytes,12,opt,name=salt,proto3" json:"salt,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring makerAsset. + MakerAssetData string `protobuf:"bytes,13,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring takerAsset. + TakerAssetData string `protobuf:"bytes,14,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring makerFee. + MakerFeeAssetData string `protobuf:"bytes,15,opt,name=maker_fee_asset_data,json=makerFeeAssetData,proto3" json:"maker_fee_asset_data,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring takerFee. + TakerFeeAssetData string `protobuf:"bytes,16,opt,name=taker_fee_asset_data,json=takerFeeAssetData,proto3" json:"taker_fee_asset_data,omitempty"` + // Order signature. + Signature string `protobuf:"bytes,17,opt,name=signature,proto3" json:"signature,omitempty"` } -func (m *MarginInfo) XXX_Unmarshal(b []byte) error { + +func (m *BaseOrder) Reset() { *m = BaseOrder{} } +func (m *BaseOrder) String() string { return proto.CompactTextString(m) } +func (*BaseOrder) ProtoMessage() {} +func (*BaseOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{5} +} +func (m *BaseOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BaseOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MarginInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_BaseOrder.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -616,112 +850,161 @@ func (m *MarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MarginInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarginInfo.Merge(m, src) +func (m *BaseOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseOrder.Merge(m, src) } -func (m *MarginInfo) XXX_Size() int { +func (m *BaseOrder) XXX_Size() int { return m.Size() } -func (m *MarginInfo) XXX_DiscardUnknown() { - xxx_messageInfo_MarginInfo.DiscardUnknown(m) +func (m *BaseOrder) XXX_DiscardUnknown() { + xxx_messageInfo_BaseOrder.DiscardUnknown(m) } -var xxx_messageInfo_MarginInfo proto.InternalMessageInfo +var xxx_messageInfo_BaseOrder proto.InternalMessageInfo -func (m *MarginInfo) GetMarginHold() string { +func (m *BaseOrder) GetChainId() int64 { if m != nil { - return m.MarginHold + return m.ChainId + } + return 0 +} + +func (m *BaseOrder) GetExchangeAddress() string { + if m != nil { + return m.ExchangeAddress } return "" } -func (m *MarginInfo) GetTotalDeposits() string { +func (m *BaseOrder) GetMakerAddress() string { if m != nil { - return m.TotalDeposits + return m.MakerAddress } return "" } -// An subaccount's margin info for a given base currency -type BaseCurrencyMarginInfo struct { - MarginHold string `protobuf:"bytes,1,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` - TotalDeposits string `protobuf:"bytes,2,opt,name=total_deposits,json=totalDeposits,proto3" json:"total_deposits,omitempty"` - BaseCurrency string `protobuf:"bytes,3,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` +func (m *BaseOrder) GetTakerAddress() string { + if m != nil { + return m.TakerAddress + } + return "" } -func (m *BaseCurrencyMarginInfo) Reset() { *m = BaseCurrencyMarginInfo{} } -func (m *BaseCurrencyMarginInfo) String() string { return proto.CompactTextString(m) } -func (*BaseCurrencyMarginInfo) ProtoMessage() {} -func (*BaseCurrencyMarginInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{5} +func (m *BaseOrder) GetFeeRecipientAddress() string { + if m != nil { + return m.FeeRecipientAddress + } + return "" } -func (m *BaseCurrencyMarginInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (m *BaseOrder) GetSenderAddress() string { + if m != nil { + return m.SenderAddress + } + return "" } -func (m *BaseCurrencyMarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BaseCurrencyMarginInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (m *BaseOrder) GetMakerAssetAmount() string { + if m != nil { + return m.MakerAssetAmount } + return "" } -func (m *BaseCurrencyMarginInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseCurrencyMarginInfo.Merge(m, src) + +func (m *BaseOrder) GetTakerAssetAmount() string { + if m != nil { + return m.TakerAssetAmount + } + return "" } -func (m *BaseCurrencyMarginInfo) XXX_Size() int { - return m.Size() + +func (m *BaseOrder) GetMakerFee() string { + if m != nil { + return m.MakerFee + } + return "" } -func (m *BaseCurrencyMarginInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BaseCurrencyMarginInfo.DiscardUnknown(m) + +func (m *BaseOrder) GetTakerFee() string { + if m != nil { + return m.TakerFee + } + return "" } -var xxx_messageInfo_BaseCurrencyMarginInfo proto.InternalMessageInfo +func (m *BaseOrder) GetExpirationTimeSeconds() string { + if m != nil { + return m.ExpirationTimeSeconds + } + return "" +} -func (m *BaseCurrencyMarginInfo) GetMarginHold() string { +func (m *BaseOrder) GetSalt() string { if m != nil { - return m.MarginHold + return m.Salt } return "" } -func (m *BaseCurrencyMarginInfo) GetTotalDeposits() string { +func (m *BaseOrder) GetMakerAssetData() string { if m != nil { - return m.TotalDeposits + return m.MakerAssetData } return "" } -func (m *BaseCurrencyMarginInfo) GetBaseCurrency() string { +func (m *BaseOrder) GetTakerAssetData() string { if m != nil { - return m.BaseCurrency + return m.TakerAssetData } return "" } -// An subaccount's margin info for a given base currency -type SubaccountInfo struct { - BaseCurrencyMarginInfo []*BaseCurrencyMarginInfo `protobuf:"bytes,1,rep,name=base_currency_margin_info,json=baseCurrencyMarginInfo,proto3" json:"base_currency_margin_info,omitempty"` - Nonce string `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` - SubaccountId string `protobuf:"bytes,3,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` +func (m *BaseOrder) GetMakerFeeAssetData() string { + if m != nil { + return m.MakerFeeAssetData + } + return "" } -func (m *SubaccountInfo) Reset() { *m = SubaccountInfo{} } -func (m *SubaccountInfo) String() string { return proto.CompactTextString(m) } -func (*SubaccountInfo) ProtoMessage() {} -func (*SubaccountInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{6} +func (m *BaseOrder) GetTakerFeeAssetData() string { + if m != nil { + return m.TakerFeeAssetData + } + return "" } -func (m *SubaccountInfo) XXX_Unmarshal(b []byte) error { + +func (m *BaseOrder) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +// A valid signed 0x order with Metadata. +type Order struct { + Order *BaseOrder `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + TradePairHash string `protobuf:"bytes,2,opt,name=trade_pair_hash,json=tradePairHash,proto3" json:"trade_pair_hash,omitempty"` + FilledAmount string `protobuf:"bytes,3,opt,name=filled_amount,json=filledAmount,proto3" json:"filled_amount,omitempty"` + Status int64 `protobuf:"zigzag64,4,opt,name=status,proto3" json:"status,omitempty"` + IndexPriceRequirement string `protobuf:"bytes,5,opt,name=index_price_requirement,json=indexPriceRequirement,proto3" json:"index_price_requirement,omitempty"` + SubaccountID string `protobuf:"bytes,6,opt,name=subaccount_i_d,json=subaccountID,proto3" json:"subaccount_i_d,omitempty"` + OrderType uint64 `protobuf:"varint,7,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` + TriggerPrice string `protobuf:"bytes,8,opt,name=trigger_price,json=triggerPrice,proto3" json:"trigger_price,omitempty"` +} + +func (m *Order) Reset() { *m = Order{} } +func (m *Order) String() string { return proto.CompactTextString(m) } +func (*Order) ProtoMessage() {} +func (*Order) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{6} +} +func (m *Order) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SubaccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SubaccountInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_Order.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -731,50 +1014,260 @@ func (m *SubaccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *SubaccountInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubaccountInfo.Merge(m, src) +func (m *Order) XXX_Merge(src proto.Message) { + xxx_messageInfo_Order.Merge(m, src) } -func (m *SubaccountInfo) XXX_Size() int { +func (m *Order) XXX_Size() int { return m.Size() } -func (m *SubaccountInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SubaccountInfo.DiscardUnknown(m) +func (m *Order) XXX_DiscardUnknown() { + xxx_messageInfo_Order.DiscardUnknown(m) } -var xxx_messageInfo_SubaccountInfo proto.InternalMessageInfo +var xxx_messageInfo_Order proto.InternalMessageInfo -func (m *SubaccountInfo) GetBaseCurrencyMarginInfo() []*BaseCurrencyMarginInfo { +func (m *Order) GetOrder() *BaseOrder { if m != nil { - return m.BaseCurrencyMarginInfo + return m.Order } return nil } -func (m *SubaccountInfo) GetNonce() string { +func (m *Order) GetTradePairHash() string { if m != nil { - return m.Nonce + return m.TradePairHash } return "" } -func (m *SubaccountInfo) GetSubaccountId() string { +func (m *Order) GetFilledAmount() string { if m != nil { - return m.SubaccountId + return m.FilledAmount } return "" } -// An orderquote info for a given market -type OrderQuoteInfo struct { - MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - Quotes []*OrderQuote `protobuf:"bytes,2,rep,name=quotes,proto3" json:"quotes,omitempty"` -} +func (m *Order) GetStatus() int64 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *Order) GetIndexPriceRequirement() string { + if m != nil { + return m.IndexPriceRequirement + } + return "" +} + +func (m *Order) GetSubaccountID() string { + if m != nil { + return m.SubaccountID + } + return "" +} + +func (m *Order) GetOrderType() uint64 { + if m != nil { + return m.OrderType + } + return 0 +} + +func (m *Order) GetTriggerPrice() string { + if m != nil { + return m.TriggerPrice + } + return "" +} + +// An subaccount's margin info for a given base currency +type MarginInfo struct { + MarginHold string `protobuf:"bytes,1,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` + TotalDeposits string `protobuf:"bytes,2,opt,name=total_deposits,json=totalDeposits,proto3" json:"total_deposits,omitempty"` +} + +func (m *MarginInfo) Reset() { *m = MarginInfo{} } +func (m *MarginInfo) String() string { return proto.CompactTextString(m) } +func (*MarginInfo) ProtoMessage() {} +func (*MarginInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{7} +} +func (m *MarginInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarginInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MarginInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarginInfo.Merge(m, src) +} +func (m *MarginInfo) XXX_Size() int { + return m.Size() +} +func (m *MarginInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MarginInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MarginInfo proto.InternalMessageInfo + +func (m *MarginInfo) GetMarginHold() string { + if m != nil { + return m.MarginHold + } + return "" +} + +func (m *MarginInfo) GetTotalDeposits() string { + if m != nil { + return m.TotalDeposits + } + return "" +} + +// An subaccount's margin info for a given base currency +type BaseCurrencyMarginInfo struct { + MarginHold string `protobuf:"bytes,1,opt,name=margin_hold,json=marginHold,proto3" json:"margin_hold,omitempty"` + TotalDeposits string `protobuf:"bytes,2,opt,name=total_deposits,json=totalDeposits,proto3" json:"total_deposits,omitempty"` + BaseCurrency string `protobuf:"bytes,3,opt,name=base_currency,json=baseCurrency,proto3" json:"base_currency,omitempty"` +} + +func (m *BaseCurrencyMarginInfo) Reset() { *m = BaseCurrencyMarginInfo{} } +func (m *BaseCurrencyMarginInfo) String() string { return proto.CompactTextString(m) } +func (*BaseCurrencyMarginInfo) ProtoMessage() {} +func (*BaseCurrencyMarginInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{8} +} +func (m *BaseCurrencyMarginInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseCurrencyMarginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseCurrencyMarginInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BaseCurrencyMarginInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseCurrencyMarginInfo.Merge(m, src) +} +func (m *BaseCurrencyMarginInfo) XXX_Size() int { + return m.Size() +} +func (m *BaseCurrencyMarginInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BaseCurrencyMarginInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseCurrencyMarginInfo proto.InternalMessageInfo + +func (m *BaseCurrencyMarginInfo) GetMarginHold() string { + if m != nil { + return m.MarginHold + } + return "" +} + +func (m *BaseCurrencyMarginInfo) GetTotalDeposits() string { + if m != nil { + return m.TotalDeposits + } + return "" +} + +func (m *BaseCurrencyMarginInfo) GetBaseCurrency() string { + if m != nil { + return m.BaseCurrency + } + return "" +} + +// An subaccount's margin info for a given base currency +type SubaccountInfo struct { + BaseCurrencyMarginInfo []*BaseCurrencyMarginInfo `protobuf:"bytes,1,rep,name=base_currency_margin_info,json=baseCurrencyMarginInfo,proto3" json:"base_currency_margin_info,omitempty"` + Nonce string `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + SubaccountId string `protobuf:"bytes,3,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"` +} + +func (m *SubaccountInfo) Reset() { *m = SubaccountInfo{} } +func (m *SubaccountInfo) String() string { return proto.CompactTextString(m) } +func (*SubaccountInfo) ProtoMessage() {} +func (*SubaccountInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{9} +} +func (m *SubaccountInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SubaccountInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SubaccountInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SubaccountInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubaccountInfo.Merge(m, src) +} +func (m *SubaccountInfo) XXX_Size() int { + return m.Size() +} +func (m *SubaccountInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SubaccountInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SubaccountInfo proto.InternalMessageInfo + +func (m *SubaccountInfo) GetBaseCurrencyMarginInfo() []*BaseCurrencyMarginInfo { + if m != nil { + return m.BaseCurrencyMarginInfo + } + return nil +} + +func (m *SubaccountInfo) GetNonce() string { + if m != nil { + return m.Nonce + } + return "" +} + +func (m *SubaccountInfo) GetSubaccountId() string { + if m != nil { + return m.SubaccountId + } + return "" +} + +// An orderquote info for a given market +type OrderQuoteInfo struct { + MarketId string `protobuf:"bytes,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + Quotes []*OrderQuote `protobuf:"bytes,2,rep,name=quotes,proto3" json:"quotes,omitempty"` +} func (m *OrderQuoteInfo) Reset() { *m = OrderQuoteInfo{} } func (m *OrderQuoteInfo) String() string { return proto.CompactTextString(m) } func (*OrderQuoteInfo) ProtoMessage() {} func (*OrderQuoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{7} + return fileDescriptor_2116e2804e9c53f9, []int{10} } func (m *OrderQuoteInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -831,7 +1324,7 @@ func (m *PositionInfo) Reset() { *m = PositionInfo{} } func (m *PositionInfo) String() string { return proto.CompactTextString(m) } func (*PositionInfo) ProtoMessage() {} func (*PositionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{8} + return fileDescriptor_2116e2804e9c53f9, []int{11} } func (m *PositionInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -919,7 +1412,7 @@ func (m *OrderQuote) Reset() { *m = OrderQuote{} } func (m *OrderQuote) String() string { return proto.CompactTextString(m) } func (*OrderQuote) ProtoMessage() {} func (*OrderQuote) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{9} + return fileDescriptor_2116e2804e9c53f9, []int{12} } func (m *OrderQuote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -974,7 +1467,7 @@ func (m *PriceLevel) Reset() { *m = PriceLevel{} } func (m *PriceLevel) String() string { return proto.CompactTextString(m) } func (*PriceLevel) ProtoMessage() {} func (*PriceLevel) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{10} + return fileDescriptor_2116e2804e9c53f9, []int{13} } func (m *PriceLevel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1017,24 +1510,26 @@ func (m *PriceLevel) GetQ() string { return "" } -// MsgInitExchange describes a message to init the Injective Exchange contract inside the exchange keeper -type MsgInitExchange struct { - Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty" yaml:"sender"` - ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty" yaml:"exchange_address"` +// A 0x Transaction Exchange Domain +type ExchangeDomain struct { + // Address of the Injective Coordinator Contract. + VerifyingContract string `protobuf:"bytes,1,opt,name=verifying_contract,json=verifyingContract,proto3" json:"verifying_contract,omitempty"` + // Ethereum Chain ID of the transaction + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (m *MsgInitExchange) Reset() { *m = MsgInitExchange{} } -func (m *MsgInitExchange) String() string { return proto.CompactTextString(m) } -func (*MsgInitExchange) ProtoMessage() {} -func (*MsgInitExchange) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{11} +func (m *ExchangeDomain) Reset() { *m = ExchangeDomain{} } +func (m *ExchangeDomain) String() string { return proto.CompactTextString(m) } +func (*ExchangeDomain) ProtoMessage() {} +func (*ExchangeDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{14} } -func (m *MsgInitExchange) XXX_Unmarshal(b []byte) error { +func (m *ExchangeDomain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgInitExchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ExchangeDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgInitExchange.Marshal(b, m, deterministic) + return xxx_messageInfo_ExchangeDomain.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1044,75 +1539,63 @@ func (m *MsgInitExchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgInitExchange) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInitExchange.Merge(m, src) +func (m *ExchangeDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExchangeDomain.Merge(m, src) } -func (m *MsgInitExchange) XXX_Size() int { +func (m *ExchangeDomain) XXX_Size() int { return m.Size() } -func (m *MsgInitExchange) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInitExchange.DiscardUnknown(m) +func (m *ExchangeDomain) XXX_DiscardUnknown() { + xxx_messageInfo_ExchangeDomain.DiscardUnknown(m) } -var xxx_messageInfo_MsgInitExchange proto.InternalMessageInfo +var xxx_messageInfo_ExchangeDomain proto.InternalMessageInfo -// A 0x Transaction Exchange Domain -type MsgCreateSpotOrder struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +func (m *ExchangeDomain) GetVerifyingContract() string { + if m != nil { + return m.VerifyingContract + } + return "" } -func (m *MsgCreateSpotOrder) Reset() { *m = MsgCreateSpotOrder{} } -func (m *MsgCreateSpotOrder) String() string { return proto.CompactTextString(m) } -func (*MsgCreateSpotOrder) ProtoMessage() {} -func (*MsgCreateSpotOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{12} -} -func (m *MsgCreateSpotOrder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateSpotOrder.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *ExchangeDomain) GetChainId() string { + if m != nil { + return m.ChainId } -} -func (m *MsgCreateSpotOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateSpotOrder.Merge(m, src) -} -func (m *MsgCreateSpotOrder) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateSpotOrder) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateSpotOrder.DiscardUnknown(m) + return "" } -var xxx_messageInfo_MsgCreateSpotOrder proto.InternalMessageInfo - -// A Cosmos-SDK MsgCreateDerivativeOrder -type MsgCreateDerivativeOrder struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +// A valid signed 0x Signed Transaction +type SignedTransaction struct { + // Arbitrary number to facilitate uniqueness of the transactions's hash. + Salt string `protobuf:"bytes,1,opt,name=salt,proto3" json:"salt,omitempty"` + // Address of transaction signer + SignerAddress string `protobuf:"bytes,2,opt,name=signer_address,json=signerAddress,proto3" json:"signer_address,omitempty"` + // The calldata that is to be executed. This must call an Exchange contract + // method. + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + // Timestamp in seconds at which transaction expires. + ExpirationTimeSeconds string `protobuf:"bytes,4,opt,name=expiration_time_seconds,json=expirationTimeSeconds,proto3" json:"expiration_time_seconds,omitempty"` + // gasPrice that transaction is required to be executed with. + GasPrice string `protobuf:"bytes,5,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` + // Exchange Domain specific values. + Domain *ExchangeDomain `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` + // Signature of the 0x Transaction + Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` } -func (m *MsgCreateDerivativeOrder) Reset() { *m = MsgCreateDerivativeOrder{} } -func (m *MsgCreateDerivativeOrder) String() string { return proto.CompactTextString(m) } -func (*MsgCreateDerivativeOrder) ProtoMessage() {} -func (*MsgCreateDerivativeOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{13} +func (m *SignedTransaction) Reset() { *m = SignedTransaction{} } +func (m *SignedTransaction) String() string { return proto.CompactTextString(m) } +func (*SignedTransaction) ProtoMessage() {} +func (*SignedTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_2116e2804e9c53f9, []int{15} } -func (m *MsgCreateDerivativeOrder) XXX_Unmarshal(b []byte) error { +func (m *SignedTransaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SignedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateDerivativeOrder.Marshal(b, m, deterministic) + return xxx_messageInfo_SignedTransaction.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1122,694 +1605,223 @@ func (m *MsgCreateDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MsgCreateDerivativeOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateDerivativeOrder.Merge(m, src) +func (m *SignedTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedTransaction.Merge(m, src) } -func (m *MsgCreateDerivativeOrder) XXX_Size() int { +func (m *SignedTransaction) XXX_Size() int { return m.Size() } -func (m *MsgCreateDerivativeOrder) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateDerivativeOrder.DiscardUnknown(m) +func (m *SignedTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_SignedTransaction.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateDerivativeOrder proto.InternalMessageInfo - -// A Cosmos-SDK MsgCreateDerivativeOrder -type MsgSoftCancelDerivativeOrder struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` -} +var xxx_messageInfo_SignedTransaction proto.InternalMessageInfo -func (m *MsgSoftCancelDerivativeOrder) Reset() { *m = MsgSoftCancelDerivativeOrder{} } -func (m *MsgSoftCancelDerivativeOrder) String() string { return proto.CompactTextString(m) } -func (*MsgSoftCancelDerivativeOrder) ProtoMessage() {} -func (*MsgSoftCancelDerivativeOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{14} -} -func (m *MsgSoftCancelDerivativeOrder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSoftCancelDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSoftCancelDerivativeOrder.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetSalt() string { + if m != nil { + return m.Salt } -} -func (m *MsgSoftCancelDerivativeOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSoftCancelDerivativeOrder.Merge(m, src) -} -func (m *MsgSoftCancelDerivativeOrder) XXX_Size() int { - return m.Size() -} -func (m *MsgSoftCancelDerivativeOrder) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSoftCancelDerivativeOrder.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSoftCancelDerivativeOrder proto.InternalMessageInfo - -// A Cosmos-SDK MsgRegisterSpotMarket -type MsgRegisterSpotMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - MakerAssetData string `protobuf:"bytes,3,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - TakerAssetData string `protobuf:"bytes,4,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` - Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` + return "" } -func (m *MsgRegisterSpotMarket) Reset() { *m = MsgRegisterSpotMarket{} } -func (m *MsgRegisterSpotMarket) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterSpotMarket) ProtoMessage() {} -func (*MsgRegisterSpotMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{15} -} -func (m *MsgRegisterSpotMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterSpotMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetSignerAddress() string { + if m != nil { + return m.SignerAddress } -} -func (m *MsgRegisterSpotMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterSpotMarket.Merge(m, src) -} -func (m *MsgRegisterSpotMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterSpotMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterSpotMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterSpotMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgSuspendSpotMarket -type MsgSuspendSpotMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - MakerAssetData string `protobuf:"bytes,3,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - TakerAssetData string `protobuf:"bytes,4,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` + return "" } -func (m *MsgSuspendSpotMarket) Reset() { *m = MsgSuspendSpotMarket{} } -func (m *MsgSuspendSpotMarket) String() string { return proto.CompactTextString(m) } -func (*MsgSuspendSpotMarket) ProtoMessage() {} -func (*MsgSuspendSpotMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{16} -} -func (m *MsgSuspendSpotMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSuspendSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSuspendSpotMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetData() string { + if m != nil { + return m.Data } -} -func (m *MsgSuspendSpotMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSuspendSpotMarket.Merge(m, src) -} -func (m *MsgSuspendSpotMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgSuspendSpotMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSuspendSpotMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSuspendSpotMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgResumeSpotMarket -type MsgResumeSpotMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - MakerAssetData string `protobuf:"bytes,3,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - TakerAssetData string `protobuf:"bytes,4,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` + return "" } -func (m *MsgResumeSpotMarket) Reset() { *m = MsgResumeSpotMarket{} } -func (m *MsgResumeSpotMarket) String() string { return proto.CompactTextString(m) } -func (*MsgResumeSpotMarket) ProtoMessage() {} -func (*MsgResumeSpotMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{17} -} -func (m *MsgResumeSpotMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgResumeSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgResumeSpotMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetExpirationTimeSeconds() string { + if m != nil { + return m.ExpirationTimeSeconds } -} -func (m *MsgResumeSpotMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgResumeSpotMarket.Merge(m, src) -} -func (m *MsgResumeSpotMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgResumeSpotMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgResumeSpotMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgResumeSpotMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgRegisterDerivativeMarket -type MsgRegisterDerivativeMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Market *DerivativeMarket `protobuf:"bytes,2,opt,name=market,proto3" json:"market,omitempty"` + return "" } -func (m *MsgRegisterDerivativeMarket) Reset() { *m = MsgRegisterDerivativeMarket{} } -func (m *MsgRegisterDerivativeMarket) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterDerivativeMarket) ProtoMessage() {} -func (*MsgRegisterDerivativeMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{18} -} -func (m *MsgRegisterDerivativeMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterDerivativeMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetGasPrice() string { + if m != nil { + return m.GasPrice } -} -func (m *MsgRegisterDerivativeMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterDerivativeMarket.Merge(m, src) -} -func (m *MsgRegisterDerivativeMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterDerivativeMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterDerivativeMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterDerivativeMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgSuspendDerivativeMarket -type MsgSuspendDerivativeMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Unique market ID. - MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - // exchange address - ExchangeAddress string `protobuf:"bytes,3,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` + return "" } -func (m *MsgSuspendDerivativeMarket) Reset() { *m = MsgSuspendDerivativeMarket{} } -func (m *MsgSuspendDerivativeMarket) String() string { return proto.CompactTextString(m) } -func (*MsgSuspendDerivativeMarket) ProtoMessage() {} -func (*MsgSuspendDerivativeMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{19} -} -func (m *MsgSuspendDerivativeMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSuspendDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSuspendDerivativeMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetDomain() *ExchangeDomain { + if m != nil { + return m.Domain } -} -func (m *MsgSuspendDerivativeMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSuspendDerivativeMarket.Merge(m, src) -} -func (m *MsgSuspendDerivativeMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgSuspendDerivativeMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSuspendDerivativeMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSuspendDerivativeMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgResumeDerivativeMarket -type MsgResumeDerivativeMarket struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // Unique market ID. - MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` - // exchange address - ExchangeAddress string `protobuf:"bytes,3,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` + return nil } -func (m *MsgResumeDerivativeMarket) Reset() { *m = MsgResumeDerivativeMarket{} } -func (m *MsgResumeDerivativeMarket) String() string { return proto.CompactTextString(m) } -func (*MsgResumeDerivativeMarket) ProtoMessage() {} -func (*MsgResumeDerivativeMarket) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{20} -} -func (m *MsgResumeDerivativeMarket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgResumeDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgResumeDerivativeMarket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *SignedTransaction) GetSignature() string { + if m != nil { + return m.Signature } -} -func (m *MsgResumeDerivativeMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgResumeDerivativeMarket.Merge(m, src) -} -func (m *MsgResumeDerivativeMarket) XXX_Size() int { - return m.Size() -} -func (m *MsgResumeDerivativeMarket) XXX_DiscardUnknown() { - xxx_messageInfo_MsgResumeDerivativeMarket.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgResumeDerivativeMarket proto.InternalMessageInfo - -// A Cosmos-SDK MsgExecuteDerivativeTakeOrder -type MsgExecuteDerivativeTakeOrder struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` + return "" } -func (m *MsgExecuteDerivativeTakeOrder) Reset() { *m = MsgExecuteDerivativeTakeOrder{} } -func (m *MsgExecuteDerivativeTakeOrder) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteDerivativeTakeOrder) ProtoMessage() {} -func (*MsgExecuteDerivativeTakeOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{21} -} -func (m *MsgExecuteDerivativeTakeOrder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteDerivativeTakeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteDerivativeTakeOrder.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgExecuteDerivativeTakeOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteDerivativeTakeOrder.Merge(m, src) -} -func (m *MsgExecuteDerivativeTakeOrder) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteDerivativeTakeOrder) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteDerivativeTakeOrder.DiscardUnknown(m) +func init() { + proto.RegisterEnum("injective.exchange.v1beta1.SpotLimitOrder_LimitOrderType", SpotLimitOrder_LimitOrderType_name, SpotLimitOrder_LimitOrderType_value) + proto.RegisterEnum("injective.exchange.v1beta1.SpotMarketOrder_MarketOrderType", SpotMarketOrder_MarketOrderType_name, SpotMarketOrder_MarketOrderType_value) + proto.RegisterEnum("injective.exchange.v1beta1.BaseSpotOrder_OrderType", BaseSpotOrder_OrderType_name, BaseSpotOrder_OrderType_value) + proto.RegisterType((*DerivativeMarket)(nil), "injective.exchange.v1beta1.DerivativeMarket") + proto.RegisterType((*SpotMarket)(nil), "injective.exchange.v1beta1.SpotMarket") + proto.RegisterType((*SpotLimitOrder)(nil), "injective.exchange.v1beta1.SpotLimitOrder") + proto.RegisterType((*SpotMarketOrder)(nil), "injective.exchange.v1beta1.SpotMarketOrder") + proto.RegisterType((*BaseSpotOrder)(nil), "injective.exchange.v1beta1.BaseSpotOrder") + proto.RegisterType((*BaseOrder)(nil), "injective.exchange.v1beta1.BaseOrder") + proto.RegisterType((*Order)(nil), "injective.exchange.v1beta1.Order") + proto.RegisterType((*MarginInfo)(nil), "injective.exchange.v1beta1.MarginInfo") + proto.RegisterType((*BaseCurrencyMarginInfo)(nil), "injective.exchange.v1beta1.BaseCurrencyMarginInfo") + proto.RegisterType((*SubaccountInfo)(nil), "injective.exchange.v1beta1.SubaccountInfo") + proto.RegisterType((*OrderQuoteInfo)(nil), "injective.exchange.v1beta1.OrderQuoteInfo") + proto.RegisterType((*PositionInfo)(nil), "injective.exchange.v1beta1.PositionInfo") + proto.RegisterType((*OrderQuote)(nil), "injective.exchange.v1beta1.OrderQuote") + proto.RegisterType((*PriceLevel)(nil), "injective.exchange.v1beta1.PriceLevel") + proto.RegisterType((*ExchangeDomain)(nil), "injective.exchange.v1beta1.ExchangeDomain") + proto.RegisterType((*SignedTransaction)(nil), "injective.exchange.v1beta1.SignedTransaction") } -var xxx_messageInfo_MsgExecuteDerivativeTakeOrder proto.InternalMessageInfo - -// A Cosmos-SDK MsgExecuteTECTransaction -type MsgExecuteTECTransaction struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - TecTransaction *SignedTransaction `protobuf:"bytes,2,opt,name=tecTransaction,proto3" json:"tecTransaction,omitempty"` +func init() { + proto.RegisterFile("injective/exchange/v1beta1/exchange.proto", fileDescriptor_2116e2804e9c53f9) +} + +var fileDescriptor_2116e2804e9c53f9 = []byte{ + // 1798 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xdd, 0x6e, 0x1b, 0xc7, + 0x15, 0xd6, 0x52, 0xfc, 0x3d, 0x14, 0x29, 0x6a, 0x2c, 0xab, 0x1b, 0xa7, 0x51, 0xdd, 0x75, 0x92, + 0x2a, 0x45, 0x22, 0xd5, 0x4a, 0x11, 0xb4, 0x08, 0x50, 0x40, 0x8a, 0x64, 0x58, 0x88, 0xdc, 0xd8, + 0x2b, 0x15, 0x45, 0x72, 0xb3, 0x18, 0xee, 0x8e, 0xc8, 0xa9, 0xc8, 0x59, 0x6a, 0x76, 0x28, 0x48, + 0x0f, 0xd0, 0x9b, 0x5e, 0xb5, 0x97, 0x7d, 0x80, 0xde, 0xf5, 0x09, 0xfa, 0x04, 0x05, 0x8a, 0x02, + 0xbe, 0x2a, 0x7a, 0x59, 0xd8, 0x8f, 0xd0, 0x17, 0x28, 0xce, 0xcc, 0xec, 0x1f, 0x45, 0x93, 0x02, + 0x9a, 0x3b, 0xce, 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, 0x5c, 0xd0, 0x50, 0xc5, 0xd2, 0x6d, + 0x6a, 0x5a, 0x5b, 0x63, 0xcf, 0x34, 0x44, 0x7e, 0x04, 0x6d, 0x2e, 0x22, 0x76, 0x13, 0x68, 0xd0, + 0x6d, 0x69, 0x06, 0x68, 0xe8, 0x25, 0x22, 0xe4, 0x67, 0xb0, 0xc9, 0x05, 0x57, 0x9c, 0x8e, 0x82, + 0x31, 0x95, 0x03, 0x2e, 0x02, 0x49, 0x15, 0x8f, 0x5d, 0xd0, 0x4c, 0x62, 0x65, 0x2f, 0xb4, 0xc8, + 0x47, 0x09, 0xf9, 0x05, 0xb8, 0x63, 0xca, 0x85, 0x62, 0x82, 0x8a, 0x90, 0x95, 0xb5, 0xda, 0x5a, + 0x6b, 0xab, 0x20, 0x2f, 0x6a, 0x3e, 0x86, 0xb5, 0x31, 0xbd, 0x64, 0x32, 0x50, 0x37, 0xc1, 0x05, + 0x63, 0xee, 0x9a, 0xf9, 0x1a, 0x8d, 0x9d, 0xdf, 0x3c, 0x63, 0x0c, 0x19, 0xaa, 0xc8, 0xe8, 0x18, + 0x86, 0xca, 0x19, 0x3f, 0x87, 0x2d, 0xc1, 0x6e, 0x54, 0x70, 0x31, 0x15, 0x11, 0x17, 0x83, 0x40, + 0xf1, 0x31, 0x4b, 0x14, 0x1d, 0x4f, 0xdc, 0xae, 0xe6, 0x6e, 0xa2, 0xf4, 0x99, 0x11, 0x9e, 0xa7, + 0x32, 0x34, 0x6a, 0xaa, 0x80, 0x5f, 0x26, 0xaf, 0xe9, 0xc8, 0x5d, 0x37, 0x46, 0xb5, 0xf8, 0x89, + 0x85, 0xc9, 0x67, 0x40, 0xc2, 0xe9, 0x78, 0x3a, 0xd2, 0x51, 0x93, 0x1e, 0xe3, 0xf6, 0x34, 0x79, + 0x23, 0x97, 0xd8, 0x23, 0xbc, 0x3f, 0x54, 0x00, 0xce, 0x26, 0xb1, 0x5a, 0x12, 0x5f, 0x1f, 0x00, + 0xe8, 0x38, 0xa2, 0x49, 0xc2, 0x94, 0x8d, 0xb1, 0x16, 0x22, 0x07, 0x08, 0xa0, 0x9b, 0xae, 0xa6, + 0xb1, 0x4a, 0xe5, 0x26, 0xc8, 0x40, 0x43, 0x86, 0x30, 0x6b, 0xba, 0xea, 0x52, 0xd3, 0xd5, 0xee, + 0x98, 0xae, 0x14, 0x90, 0xf5, 0x77, 0x07, 0x64, 0x63, 0x79, 0x40, 0x36, 0xe7, 0x06, 0xa4, 0xf7, + 0xaf, 0x55, 0xe8, 0xa2, 0x31, 0x4e, 0xf9, 0x98, 0xab, 0x6f, 0x64, 0xc4, 0x24, 0xf1, 0x60, 0x2d, + 0x99, 0xf6, 0x69, 0x18, 0xc6, 0x53, 0xa1, 0x4e, 0x8e, 0xac, 0x59, 0x4a, 0x18, 0x1a, 0x2d, 0x61, + 0x22, 0x62, 0x32, 0x4d, 0x3e, 0xb3, 0x42, 0xdd, 0x0b, 0xc6, 0x7c, 0x16, 0xf2, 0x09, 0x67, 0x22, + 0x35, 0x4b, 0x09, 0x43, 0x5d, 0x76, 0x33, 0xe1, 0xf2, 0x56, 0x9b, 0xa4, 0xea, 0xdb, 0x95, 0x39, + 0x77, 0x32, 0x19, 0xdd, 0x1e, 0x8c, 0xf1, 0x14, 0x6b, 0x8e, 0x12, 0x86, 0x9c, 0x88, 0x8d, 0xa9, + 0x88, 0x2c, 0xc7, 0xd8, 0xa4, 0x84, 0xe9, 0x6f, 0xe0, 0xa3, 0x11, 0x4b, 0x39, 0x0d, 0xfb, 0x0d, + 0x05, 0x8c, 0xec, 0xc3, 0xc3, 0x50, 0x32, 0x0c, 0x71, 0x11, 0xf4, 0x47, 0x71, 0x78, 0x19, 0x0c, + 0x19, 0x1f, 0x0c, 0x95, 0x36, 0xd3, 0xaa, 0xff, 0x20, 0x15, 0x1e, 0xa2, 0xec, 0xb9, 0x16, 0x91, + 0xdf, 0x42, 0x2b, 0x46, 0x03, 0x9d, 0xdf, 0x4e, 0x4c, 0x5a, 0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0x70, 0x35, 0x9c, 0xf6, + 0x77, 0xc3, 0x78, 0xbc, 0x77, 0x92, 0x9e, 0x7a, 0x4a, 0xfb, 0xc9, 0x5e, 0xf6, 0x0d, 0x9f, 0x85, + 0xb1, 0x64, 0xc5, 0x25, 0x1a, 0x7c, 0x6f, 0x1c, 0x47, 0xd3, 0x11, 0x4b, 0xf2, 0x7f, 0xc8, 0xb0, + 0xa4, 0x27, 0xfd, 0xba, 0xfe, 0x97, 0xeb, 0xf3, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x24, 0x26, + 0x04, 0xa5, 0x44, 0x13, 0x00, 0x00, } -func (m *MsgExecuteTECTransaction) Reset() { *m = MsgExecuteTECTransaction{} } -func (m *MsgExecuteTECTransaction) String() string { return proto.CompactTextString(m) } -func (*MsgExecuteTECTransaction) ProtoMessage() {} -func (*MsgExecuteTECTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{22} -} -func (m *MsgExecuteTECTransaction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecuteTECTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecuteTECTransaction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *DerivativeMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } -} -func (m *MsgExecuteTECTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecuteTECTransaction.Merge(m, src) -} -func (m *MsgExecuteTECTransaction) XXX_Size() int { - return m.Size() -} -func (m *MsgExecuteTECTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecuteTECTransaction.DiscardUnknown(m) + return dAtA[:n], nil } -var xxx_messageInfo_MsgExecuteTECTransaction proto.InternalMessageInfo - -// A 0x Transaction Exchange Domain -type ExchangeDomain struct { - // Address of the Injective Coordinator Contract. - VerifyingContract string `protobuf:"bytes,1,opt,name=verifying_contract,json=verifyingContract,proto3" json:"verifying_contract,omitempty"` - // Ethereum Chain ID of the transaction - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *ExchangeDomain) Reset() { *m = ExchangeDomain{} } -func (m *ExchangeDomain) String() string { return proto.CompactTextString(m) } -func (*ExchangeDomain) ProtoMessage() {} -func (*ExchangeDomain) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{23} -} -func (m *ExchangeDomain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExchangeDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExchangeDomain.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExchangeDomain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExchangeDomain.Merge(m, src) -} -func (m *ExchangeDomain) XXX_Size() int { - return m.Size() -} -func (m *ExchangeDomain) XXX_DiscardUnknown() { - xxx_messageInfo_ExchangeDomain.DiscardUnknown(m) -} - -var xxx_messageInfo_ExchangeDomain proto.InternalMessageInfo - -func (m *ExchangeDomain) GetVerifyingContract() string { - if m != nil { - return m.VerifyingContract - } - return "" -} - -func (m *ExchangeDomain) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// A valid signed 0x Signed Transaction -type SignedTransaction struct { - // Arbitrary number to facilitate uniqueness of the transactions's hash. - Salt string `protobuf:"bytes,1,opt,name=salt,proto3" json:"salt,omitempty"` - // Address of transaction signer - SignerAddress string `protobuf:"bytes,2,opt,name=signer_address,json=signerAddress,proto3" json:"signer_address,omitempty"` - // The calldata that is to be executed. This must call an Exchange contract - // method. - Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - // Timestamp in seconds at which transaction expires. - ExpirationTimeSeconds string `protobuf:"bytes,4,opt,name=expiration_time_seconds,json=expirationTimeSeconds,proto3" json:"expiration_time_seconds,omitempty"` - // gasPrice that transaction is required to be executed with. - GasPrice string `protobuf:"bytes,5,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - // Exchange Domain specific values. - Domain *ExchangeDomain `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` - // Signature of the 0x Transaction - Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *SignedTransaction) Reset() { *m = SignedTransaction{} } -func (m *SignedTransaction) String() string { return proto.CompactTextString(m) } -func (*SignedTransaction) ProtoMessage() {} -func (*SignedTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_cf94b0bf3cc7fbf1, []int{24} -} -func (m *SignedTransaction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedTransaction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SignedTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedTransaction.Merge(m, src) -} -func (m *SignedTransaction) XXX_Size() int { - return m.Size() -} -func (m *SignedTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_SignedTransaction.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedTransaction proto.InternalMessageInfo - -func (m *SignedTransaction) GetSalt() string { - if m != nil { - return m.Salt - } - return "" -} - -func (m *SignedTransaction) GetSignerAddress() string { - if m != nil { - return m.SignerAddress - } - return "" -} - -func (m *SignedTransaction) GetData() string { - if m != nil { - return m.Data - } - return "" -} - -func (m *SignedTransaction) GetExpirationTimeSeconds() string { - if m != nil { - return m.ExpirationTimeSeconds - } - return "" -} - -func (m *SignedTransaction) GetGasPrice() string { - if m != nil { - return m.GasPrice - } - return "" -} - -func (m *SignedTransaction) GetDomain() *ExchangeDomain { - if m != nil { - return m.Domain - } - return nil -} - -func (m *SignedTransaction) GetSignature() string { - if m != nil { - return m.Signature - } - return "" -} - -func init() { - proto.RegisterType((*DerivativeMarket)(nil), "injective.orders.v1beta1.DerivativeMarket") - proto.RegisterType((*TradePair)(nil), "injective.orders.v1beta1.TradePair") - proto.RegisterType((*BaseOrder)(nil), "injective.orders.v1beta1.BaseOrder") - proto.RegisterType((*Order)(nil), "injective.orders.v1beta1.Order") - proto.RegisterType((*MarginInfo)(nil), "injective.orders.v1beta1.MarginInfo") - proto.RegisterType((*BaseCurrencyMarginInfo)(nil), "injective.orders.v1beta1.BaseCurrencyMarginInfo") - proto.RegisterType((*SubaccountInfo)(nil), "injective.orders.v1beta1.SubaccountInfo") - proto.RegisterType((*OrderQuoteInfo)(nil), "injective.orders.v1beta1.OrderQuoteInfo") - proto.RegisterType((*PositionInfo)(nil), "injective.orders.v1beta1.PositionInfo") - proto.RegisterType((*OrderQuote)(nil), "injective.orders.v1beta1.OrderQuote") - proto.RegisterType((*PriceLevel)(nil), "injective.orders.v1beta1.PriceLevel") - proto.RegisterType((*MsgInitExchange)(nil), "injective.orders.v1beta1.MsgInitExchange") - proto.RegisterType((*MsgCreateSpotOrder)(nil), "injective.orders.v1beta1.MsgCreateSpotOrder") - proto.RegisterType((*MsgCreateDerivativeOrder)(nil), "injective.orders.v1beta1.MsgCreateDerivativeOrder") - proto.RegisterType((*MsgSoftCancelDerivativeOrder)(nil), "injective.orders.v1beta1.MsgSoftCancelDerivativeOrder") - proto.RegisterType((*MsgRegisterSpotMarket)(nil), "injective.orders.v1beta1.MsgRegisterSpotMarket") - proto.RegisterType((*MsgSuspendSpotMarket)(nil), "injective.orders.v1beta1.MsgSuspendSpotMarket") - proto.RegisterType((*MsgResumeSpotMarket)(nil), "injective.orders.v1beta1.MsgResumeSpotMarket") - proto.RegisterType((*MsgRegisterDerivativeMarket)(nil), "injective.orders.v1beta1.MsgRegisterDerivativeMarket") - proto.RegisterType((*MsgSuspendDerivativeMarket)(nil), "injective.orders.v1beta1.MsgSuspendDerivativeMarket") - proto.RegisterType((*MsgResumeDerivativeMarket)(nil), "injective.orders.v1beta1.MsgResumeDerivativeMarket") - proto.RegisterType((*MsgExecuteDerivativeTakeOrder)(nil), "injective.orders.v1beta1.MsgExecuteDerivativeTakeOrder") - proto.RegisterType((*MsgExecuteTECTransaction)(nil), "injective.orders.v1beta1.MsgExecuteTECTransaction") - proto.RegisterType((*ExchangeDomain)(nil), "injective.orders.v1beta1.ExchangeDomain") - proto.RegisterType((*SignedTransaction)(nil), "injective.orders.v1beta1.SignedTransaction") -} - -func init() { - proto.RegisterFile("injective/orders/v1beta1/orders.proto", fileDescriptor_cf94b0bf3cc7fbf1) -} - -var fileDescriptor_cf94b0bf3cc7fbf1 = []byte{ - // 1708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0x9f, 0xf6, 0x38, 0x9e, 0xf8, 0x25, 0x76, 0x92, 0xda, 0x8c, 0xb7, 0x67, 0xb2, 0x9b, 0x0c, - 0x9d, 0x5d, 0x08, 0x1f, 0x93, 0xec, 0x06, 0xb4, 0x82, 0x15, 0x07, 0x26, 0xc9, 0x8c, 0x36, 0xd2, - 0x44, 0xcc, 0x76, 0x72, 0x9a, 0x4b, 0xab, 0xdc, 0xfd, 0xdc, 0x29, 0x6c, 0x57, 0x3b, 0x55, 0xd5, - 0xc1, 0x39, 0x21, 0x90, 0x90, 0xb8, 0x20, 0xc1, 0x89, 0x03, 0x1c, 0xe0, 0xce, 0x1d, 0x24, 0xfe, - 0x01, 0xb8, 0xed, 0x91, 0xd3, 0x08, 0xcd, 0xfc, 0x07,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xef, 0xa5, 0x98, 0x44, 0x83, 0xdf, 0x54, - 0x60, 0xed, 0x9a, 0x1d, 0xa3, 0x09, 0xc8, 0x2b, 0x4d, 0x40, 0x7a, 0x14, 0xd4, 0x40, 0x31, 0x35, - 0xb1, 0x36, 0x2c, 0xb5, 0x18, 0x05, 0x09, 0x54, 0x4b, 0xe9, 0x68, 0xbe, 0x5f, 0x37, 0x88, 0x55, - 0x5f, 0x37, 0x88, 0x6d, 0x40, 0x3d, 0xa5, 0xd2, 0x3d, 0x8f, 0xdc, 0x3f, 0x3b, 0x29, 0x95, 0xf6, - 0x5d, 0xf4, 0x03, 0xa8, 0x25, 0xc6, 0x1b, 0xe6, 0x3d, 0xb2, 0xb4, 0xbf, 0x33, 0xdf, 0xd1, 0x93, - 0xde, 0x0b, 0x9d, 0xdc, 0xe4, 0x74, 0x74, 0x67, 0x6a, 0x3a, 0x3a, 0xe8, 0xfc, 0xf5, 0xe5, 0xa6, - 0xf7, 0xd9, 0xcb, 0x4d, 0xef, 0x1f, 0x2f, 0x37, 0xbd, 0x5f, 0xbd, 0xda, 0xbc, 0xf5, 0xd9, 0xab, - 0xcd, 0x5b, 0x7f, 0x7f, 0xb5, 0x79, 0xeb, 0xf9, 0xd3, 0x52, 0xf3, 0x3f, 0x2e, 0x74, 0x3e, 0xa5, - 0x6d, 0xb9, 0x37, 0xb2, 0xe0, 0x61, 0x9c, 0x09, 0x2c, 0x2f, 0xb5, 0xbb, 0xf7, 0xfa, 0x59, 0x92, - 0xf7, 0x50, 0x16, 0xff, 0xbe, 0x99, 0x67, 0x42, 0xbb, 0x66, 0xfe, 0x45, 0xfb, 0xf6, 0xbf, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x6b, 0xbd, 0x2c, 0x99, 0x9e, 0x13, 0x00, 0x00, -} - -func (m *DerivativeMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DerivativeMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *DerivativeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { @@ -1820,7 +1832,7 @@ func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.CumulativeFunding) > 0 { i -= len(m.CumulativeFunding) copy(dAtA[i:], m.CumulativeFunding) - i = encodeVarintOrders(dAtA, i, uint64(len(m.CumulativeFunding))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.CumulativeFunding))) i-- dAtA[i] = 0x1 i-- @@ -1829,63 +1841,63 @@ func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.FundingInterval) > 0 { i -= len(m.FundingInterval) copy(dAtA[i:], m.FundingInterval) - i = encodeVarintOrders(dAtA, i, uint64(len(m.FundingInterval))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FundingInterval))) i-- dAtA[i] = 0x7a } if len(m.NextFundingTimestamp) > 0 { i -= len(m.NextFundingTimestamp) copy(dAtA[i:], m.NextFundingTimestamp) - i = encodeVarintOrders(dAtA, i, uint64(len(m.NextFundingTimestamp))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.NextFundingTimestamp))) i-- dAtA[i] = 0x72 } if len(m.TakerTxFee) > 0 { i -= len(m.TakerTxFee) copy(dAtA[i:], m.TakerTxFee) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerTxFee))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerTxFee))) i-- dAtA[i] = 0x6a } if len(m.MakerTxFee) > 0 { i -= len(m.MakerTxFee) copy(dAtA[i:], m.MakerTxFee) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerTxFee))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerTxFee))) i-- dAtA[i] = 0x62 } if len(m.MaintenanceMarginRatio) > 0 { i -= len(m.MaintenanceMarginRatio) copy(dAtA[i:], m.MaintenanceMarginRatio) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MaintenanceMarginRatio))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MaintenanceMarginRatio))) i-- dAtA[i] = 0x5a } if len(m.InitialMarginRatio) > 0 { i -= len(m.InitialMarginRatio) copy(dAtA[i:], m.InitialMarginRatio) - i = encodeVarintOrders(dAtA, i, uint64(len(m.InitialMarginRatio))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.InitialMarginRatio))) i-- dAtA[i] = 0x52 } if len(m.IndexPrice) > 0 { i -= len(m.IndexPrice) copy(dAtA[i:], m.IndexPrice) - i = encodeVarintOrders(dAtA, i, uint64(len(m.IndexPrice))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.IndexPrice))) i-- dAtA[i] = 0x4a } if len(m.PriceFactor) > 0 { i -= len(m.PriceFactor) copy(dAtA[i:], m.PriceFactor) - i = encodeVarintOrders(dAtA, i, uint64(len(m.PriceFactor))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.PriceFactor))) i-- dAtA[i] = 0x42 } if len(m.ExchangeAddress) > 0 { i -= len(m.ExchangeAddress) copy(dAtA[i:], m.ExchangeAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExchangeAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ExchangeAddress))) i-- dAtA[i] = 0x3a } @@ -1902,42 +1914,42 @@ func (m *DerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.MarketId) > 0 { i -= len(m.MarketId) copy(dAtA[i:], m.MarketId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarketId))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarketId))) i-- dAtA[i] = 0x2a } if len(m.Nonce) > 0 { i -= len(m.Nonce) copy(dAtA[i:], m.Nonce) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Nonce))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Nonce))) i-- dAtA[i] = 0x22 } if len(m.BaseCurrency) > 0 { i -= len(m.BaseCurrency) copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintOrders(dAtA, i, uint64(len(m.BaseCurrency))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseCurrency))) i-- dAtA[i] = 0x1a } if len(m.Oracle) > 0 { i -= len(m.Oracle) copy(dAtA[i:], m.Oracle) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Oracle))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Oracle))) i-- dAtA[i] = 0x12 } if len(m.Ticker) > 0 { i -= len(m.Ticker) copy(dAtA[i:], m.Ticker) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Ticker))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Ticker))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TradePair) Marshal() (dAtA []byte, err error) { +func (m *SpotMarket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1947,16 +1959,23 @@ func (m *TradePair) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TradePair) MarshalTo(dAtA []byte) (int, error) { +func (m *SpotMarket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TradePair) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ExchangeAddress))) + i-- + dAtA[i] = 0x42 + } if m.Enabled { i-- if m.Enabled { @@ -1965,40 +1984,54 @@ func (m *TradePair) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x38 + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x32 + } + if len(m.TakerTxFee) > 0 { + i -= len(m.TakerTxFee) + copy(dAtA[i:], m.TakerTxFee) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerTxFee))) + i-- + dAtA[i] = 0x2a } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Hash))) + if len(m.MakerTxFee) > 0 { + i -= len(m.MakerTxFee) + copy(dAtA[i:], m.MakerTxFee) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerTxFee))) i-- dAtA[i] = 0x22 } - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetData))) + if len(m.QuoteAsset) > 0 { + i -= len(m.QuoteAsset) + copy(dAtA[i:], m.QuoteAsset) + i = encodeVarintExchange(dAtA, i, uint64(len(m.QuoteAsset))) i-- dAtA[i] = 0x1a } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetData))) + if len(m.BaseAsset) > 0 { + i -= len(m.BaseAsset) + copy(dAtA[i:], m.BaseAsset) + i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseAsset))) i-- dAtA[i] = 0x12 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Name))) + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Ticker))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BaseOrder) Marshal() (dAtA []byte, err error) { +func (m *SpotLimitOrder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2008,134 +2041,383 @@ func (m *BaseOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BaseOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *SpotLimitOrder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BaseOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpotLimitOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1 + if len(m.TriggerPrice) > 0 { + i -= len(m.TriggerPrice) + copy(dAtA[i:], m.TriggerPrice) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TriggerPrice))) i-- - dAtA[i] = 0x8a + dAtA[i] = 0x52 } - if len(m.TakerFeeAssetData) > 0 { - i -= len(m.TakerFeeAssetData) - copy(dAtA[i:], m.TakerFeeAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerFeeAssetData))) - i-- - dAtA[i] = 0x1 + if m.OrderType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) i-- - dAtA[i] = 0x82 + dAtA[i] = 0x48 } - if len(m.MakerFeeAssetData) > 0 { - i -= len(m.MakerFeeAssetData) - copy(dAtA[i:], m.MakerFeeAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerFeeAssetData))) + if m.CreationBlockHeight != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.CreationBlockHeight)) i-- - dAtA[i] = 0x7a + dAtA[i] = 0x40 } - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetData))) + if len(m.FilledAmount) > 0 { + i -= len(m.FilledAmount) + copy(dAtA[i:], m.FilledAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FilledAmount))) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x3a } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetData))) + if len(m.DemandAmount) > 0 { + i -= len(m.DemandAmount) + copy(dAtA[i:], m.DemandAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.DemandAmount))) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x32 } - if len(m.Salt) > 0 { - i -= len(m.Salt) - copy(dAtA[i:], m.Salt) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Salt))) + if len(m.SupplyAmount) > 0 { + i -= len(m.SupplyAmount) + copy(dAtA[i:], m.SupplyAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SupplyAmount))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x2a } - if len(m.ExpirationTimeSeconds) > 0 { - i -= len(m.ExpirationTimeSeconds) - copy(dAtA[i:], m.ExpirationTimeSeconds) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExpirationTimeSeconds))) + if m.Expiry != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Expiry)) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x20 } - if len(m.TakerFee) > 0 { - i -= len(m.TakerFee) - copy(dAtA[i:], m.TakerFee) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerFee))) + if len(m.FeeRecipient) > 0 { + i -= len(m.FeeRecipient) + copy(dAtA[i:], m.FeeRecipient) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FeeRecipient))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x1a } - if len(m.MakerFee) > 0 { - i -= len(m.MakerFee) - copy(dAtA[i:], m.MakerFee) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerFee))) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Sender))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x12 } - if len(m.TakerAssetAmount) > 0 { - i -= len(m.TakerAssetAmount) - copy(dAtA[i:], m.TakerAssetAmount) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetAmount))) + if len(m.SubaccountID) > 0 { + i -= len(m.SubaccountID) + copy(dAtA[i:], m.SubaccountID) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0xa } - if len(m.MakerAssetAmount) > 0 { - i -= len(m.MakerAssetAmount) - copy(dAtA[i:], m.MakerAssetAmount) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetAmount))) + return len(dAtA) - i, nil +} + +func (m *SpotMarketOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SpotMarketOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpotMarketOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TriggerPrice) > 0 { + i -= len(m.TriggerPrice) + copy(dAtA[i:], m.TriggerPrice) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TriggerPrice))) + i-- + dAtA[i] = 0x32 + } + if m.OrderType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) + i-- + dAtA[i] = 0x28 + } + if len(m.FundsSupplied) > 0 { + i -= len(m.FundsSupplied) + copy(dAtA[i:], m.FundsSupplied) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FundsSupplied))) + i-- + dAtA[i] = 0x22 + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x1a + } + if len(m.FeeRecipient) > 0 { + i -= len(m.FeeRecipient) + copy(dAtA[i:], m.FeeRecipient) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FeeRecipient))) + i-- + dAtA[i] = 0x12 + } + if len(m.SubaccountID) > 0 { + i -= len(m.SubaccountID) + copy(dAtA[i:], m.SubaccountID) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BaseSpotOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BaseSpotOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseSpotOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x62 + } + if len(m.TriggerPrice) > 0 { + i -= len(m.TriggerPrice) + copy(dAtA[i:], m.TriggerPrice) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TriggerPrice))) + i-- + dAtA[i] = 0x5a + } + if m.OrderType != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) + i-- + dAtA[i] = 0x50 + } + if m.Salt != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Salt)) + i-- + dAtA[i] = 0x48 + } + if len(m.DemandAmount) > 0 { + i -= len(m.DemandAmount) + copy(dAtA[i:], m.DemandAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.DemandAmount))) + i-- + dAtA[i] = 0x42 + } + if len(m.SupplyAmount) > 0 { + i -= len(m.SupplyAmount) + copy(dAtA[i:], m.SupplyAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SupplyAmount))) + i-- + dAtA[i] = 0x3a + } + if len(m.MarketID) > 0 { + i -= len(m.MarketID) + copy(dAtA[i:], m.MarketID) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarketID))) + i-- + dAtA[i] = 0x32 + } + if m.Expiry != 0 { + i = encodeVarintExchange(dAtA, i, uint64(m.Expiry)) + i-- + dAtA[i] = 0x28 + } + if len(m.FeeRecipient) > 0 { + i -= len(m.FeeRecipient) + copy(dAtA[i:], m.FeeRecipient) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FeeRecipient))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.SubaccountID) > 0 { + i -= len(m.SubaccountID) + copy(dAtA[i:], m.SubaccountID) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintExchange(dAtA, i, uint64((uint64(m.ChainId)<<1)^uint64((m.ChainId>>63)))) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BaseOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BaseOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.TakerFeeAssetData) > 0 { + i -= len(m.TakerFeeAssetData) + copy(dAtA[i:], m.TakerFeeAssetData) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerFeeAssetData))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.MakerFeeAssetData) > 0 { + i -= len(m.MakerFeeAssetData) + copy(dAtA[i:], m.MakerFeeAssetData) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerFeeAssetData))) + i-- + dAtA[i] = 0x7a + } + if len(m.TakerAssetData) > 0 { + i -= len(m.TakerAssetData) + copy(dAtA[i:], m.TakerAssetData) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerAssetData))) + i-- + dAtA[i] = 0x72 + } + if len(m.MakerAssetData) > 0 { + i -= len(m.MakerAssetData) + copy(dAtA[i:], m.MakerAssetData) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerAssetData))) + i-- + dAtA[i] = 0x6a + } + if len(m.Salt) > 0 { + i -= len(m.Salt) + copy(dAtA[i:], m.Salt) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Salt))) + i-- + dAtA[i] = 0x62 + } + if len(m.ExpirationTimeSeconds) > 0 { + i -= len(m.ExpirationTimeSeconds) + copy(dAtA[i:], m.ExpirationTimeSeconds) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ExpirationTimeSeconds))) + i-- + dAtA[i] = 0x5a + } + if len(m.TakerFee) > 0 { + i -= len(m.TakerFee) + copy(dAtA[i:], m.TakerFee) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerFee))) + i-- + dAtA[i] = 0x52 + } + if len(m.MakerFee) > 0 { + i -= len(m.MakerFee) + copy(dAtA[i:], m.MakerFee) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerFee))) + i-- + dAtA[i] = 0x4a + } + if len(m.TakerAssetAmount) > 0 { + i -= len(m.TakerAssetAmount) + copy(dAtA[i:], m.TakerAssetAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerAssetAmount))) + i-- + dAtA[i] = 0x42 + } + if len(m.MakerAssetAmount) > 0 { + i -= len(m.MakerAssetAmount) + copy(dAtA[i:], m.MakerAssetAmount) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerAssetAmount))) i-- dAtA[i] = 0x3a } if len(m.SenderAddress) > 0 { i -= len(m.SenderAddress) copy(dAtA[i:], m.SenderAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.SenderAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SenderAddress))) i-- dAtA[i] = 0x32 } if len(m.FeeRecipientAddress) > 0 { i -= len(m.FeeRecipientAddress) copy(dAtA[i:], m.FeeRecipientAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.FeeRecipientAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FeeRecipientAddress))) i-- dAtA[i] = 0x2a } if len(m.TakerAddress) > 0 { i -= len(m.TakerAddress) copy(dAtA[i:], m.TakerAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TakerAddress))) i-- dAtA[i] = 0x22 } if len(m.MakerAddress) > 0 { i -= len(m.MakerAddress) copy(dAtA[i:], m.MakerAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MakerAddress))) i-- dAtA[i] = 0x1a } if len(m.ExchangeAddress) > 0 { i -= len(m.ExchangeAddress) copy(dAtA[i:], m.ExchangeAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExchangeAddress))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ExchangeAddress))) i-- dAtA[i] = 0x12 } if m.ChainId != 0 { - i = encodeVarintOrders(dAtA, i, uint64((uint64(m.ChainId)<<1)^uint64((m.ChainId>>63)))) + i = encodeVarintExchange(dAtA, i, uint64((uint64(m.ChainId)<<1)^uint64((m.ChainId>>63)))) i-- dAtA[i] = 0x8 } @@ -2165,45 +2447,45 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.TriggerPrice) > 0 { i -= len(m.TriggerPrice) copy(dAtA[i:], m.TriggerPrice) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TriggerPrice))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TriggerPrice))) i-- dAtA[i] = 0x42 } if m.OrderType != 0 { - i = encodeVarintOrders(dAtA, i, uint64(m.OrderType)) + i = encodeVarintExchange(dAtA, i, uint64(m.OrderType)) i-- dAtA[i] = 0x38 } if len(m.SubaccountID) > 0 { i -= len(m.SubaccountID) copy(dAtA[i:], m.SubaccountID) - i = encodeVarintOrders(dAtA, i, uint64(len(m.SubaccountID))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountID))) i-- dAtA[i] = 0x32 } if len(m.IndexPriceRequirement) > 0 { i -= len(m.IndexPriceRequirement) copy(dAtA[i:], m.IndexPriceRequirement) - i = encodeVarintOrders(dAtA, i, uint64(len(m.IndexPriceRequirement))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.IndexPriceRequirement))) i-- dAtA[i] = 0x2a } if m.Status != 0 { - i = encodeVarintOrders(dAtA, i, uint64((uint64(m.Status)<<1)^uint64((m.Status>>63)))) + i = encodeVarintExchange(dAtA, i, uint64((uint64(m.Status)<<1)^uint64((m.Status>>63)))) i-- dAtA[i] = 0x20 } if len(m.FilledAmount) > 0 { i -= len(m.FilledAmount) copy(dAtA[i:], m.FilledAmount) - i = encodeVarintOrders(dAtA, i, uint64(len(m.FilledAmount))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FilledAmount))) i-- dAtA[i] = 0x1a } if len(m.TradePairHash) > 0 { i -= len(m.TradePairHash) copy(dAtA[i:], m.TradePairHash) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TradePairHash))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TradePairHash))) i-- dAtA[i] = 0x12 } @@ -2214,7 +2496,7 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) + i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -2245,14 +2527,14 @@ func (m *MarginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.TotalDeposits) > 0 { i -= len(m.TotalDeposits) copy(dAtA[i:], m.TotalDeposits) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TotalDeposits))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TotalDeposits))) i-- dAtA[i] = 0x12 } if len(m.MarginHold) > 0 { i -= len(m.MarginHold) copy(dAtA[i:], m.MarginHold) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarginHold))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarginHold))) i-- dAtA[i] = 0xa } @@ -2282,21 +2564,21 @@ func (m *BaseCurrencyMarginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) if len(m.BaseCurrency) > 0 { i -= len(m.BaseCurrency) copy(dAtA[i:], m.BaseCurrency) - i = encodeVarintOrders(dAtA, i, uint64(len(m.BaseCurrency))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.BaseCurrency))) i-- dAtA[i] = 0x1a } if len(m.TotalDeposits) > 0 { i -= len(m.TotalDeposits) copy(dAtA[i:], m.TotalDeposits) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TotalDeposits))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.TotalDeposits))) i-- dAtA[i] = 0x12 } if len(m.MarginHold) > 0 { i -= len(m.MarginHold) copy(dAtA[i:], m.MarginHold) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarginHold))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarginHold))) i-- dAtA[i] = 0xa } @@ -2326,14 +2608,14 @@ func (m *SubaccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.SubaccountId) > 0 { i -= len(m.SubaccountId) copy(dAtA[i:], m.SubaccountId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.SubaccountId))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SubaccountId))) i-- dAtA[i] = 0x1a } if len(m.Nonce) > 0 { i -= len(m.Nonce) copy(dAtA[i:], m.Nonce) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Nonce))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Nonce))) i-- dAtA[i] = 0x12 } @@ -2345,7 +2627,7 @@ func (m *SubaccountInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) + i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -2382,7 +2664,7 @@ func (m *OrderQuoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) + i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -2391,7 +2673,7 @@ func (m *OrderQuoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.MarketId) > 0 { i -= len(m.MarketId) copy(dAtA[i:], m.MarketId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarketId))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.MarketId))) i-- dAtA[i] = 0xa } @@ -2421,42 +2703,42 @@ func (m *PositionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.EntryPrice) > 0 { i -= len(m.EntryPrice) copy(dAtA[i:], m.EntryPrice) - i = encodeVarintOrders(dAtA, i, uint64(len(m.EntryPrice))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.EntryPrice))) i-- dAtA[i] = 0x3a } if len(m.Margin) > 0 { i -= len(m.Margin) copy(dAtA[i:], m.Margin) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Margin))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Margin))) i-- dAtA[i] = 0x32 } if len(m.CumulativeFundingEntry) > 0 { i -= len(m.CumulativeFundingEntry) copy(dAtA[i:], m.CumulativeFundingEntry) - i = encodeVarintOrders(dAtA, i, uint64(len(m.CumulativeFundingEntry))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.CumulativeFundingEntry))) i-- dAtA[i] = 0x2a } if len(m.PositionHoldQuantity) > 0 { i -= len(m.PositionHoldQuantity) copy(dAtA[i:], m.PositionHoldQuantity) - i = encodeVarintOrders(dAtA, i, uint64(len(m.PositionHoldQuantity))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.PositionHoldQuantity))) i-- dAtA[i] = 0x22 } if len(m.Quantity) > 0 { i -= len(m.Quantity) copy(dAtA[i:], m.Quantity) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Quantity))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Quantity))) i-- dAtA[i] = 0x1a } if len(m.BankruptcyPrice) > 0 { i -= len(m.BankruptcyPrice) copy(dAtA[i:], m.BankruptcyPrice) - i = encodeVarintOrders(dAtA, i, uint64(len(m.BankruptcyPrice))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.BankruptcyPrice))) i-- dAtA[i] = 0x12 } @@ -2496,7 +2778,7 @@ func (m *OrderQuote) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.FillableAmount) > 0 { i -= len(m.FillableAmount) copy(dAtA[i:], m.FillableAmount) - i = encodeVarintOrders(dAtA, i, uint64(len(m.FillableAmount))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.FillableAmount))) i-- dAtA[i] = 0x12 } @@ -2507,7 +2789,7 @@ func (m *OrderQuote) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) + i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -2538,21 +2820,21 @@ func (m *PriceLevel) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Q) > 0 { i -= len(m.Q) copy(dAtA[i:], m.Q) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Q))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Q))) i-- dAtA[i] = 0x12 } if len(m.P) > 0 { i -= len(m.P) copy(dAtA[i:], m.P) - i = encodeVarintOrders(dAtA, i, uint64(len(m.P))) + i = encodeVarintExchange(dAtA, i, uint64(len(m.P))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgInitExchange) Marshal() (dAtA []byte, err error) { +func (m *ExchangeDomain) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2562,34 +2844,34 @@ func (m *MsgInitExchange) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgInitExchange) MarshalTo(dAtA []byte) (int, error) { +func (m *ExchangeDomain) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgInitExchange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExchangeDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ExchangeAddress) > 0 { - i -= len(m.ExchangeAddress) - copy(dAtA[i:], m.ExchangeAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExchangeAddress))) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0x12 } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) + if len(m.VerifyingContract) > 0 { + i -= len(m.VerifyingContract) + copy(dAtA[i:], m.VerifyingContract) + i = encodeVarintExchange(dAtA, i, uint64(len(m.VerifyingContract))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgCreateSpotOrder) Marshal() (dAtA []byte, err error) { +func (m *SignedTransaction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2599,796 +2881,399 @@ func (m *MsgCreateSpotOrder) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateSpotOrder) MarshalTo(dAtA []byte) (int, error) { +func (m *SignedTransaction) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateSpotOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SignedTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Order != nil { + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x3a + } + if m.Domain != nil { { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Domain.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) + i = encodeVarintExchange(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x32 } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) + if len(m.GasPrice) > 0 { + i -= len(m.GasPrice) + copy(dAtA[i:], m.GasPrice) + i = encodeVarintExchange(dAtA, i, uint64(len(m.GasPrice))) i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateDerivativeOrder) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + dAtA[i] = 0x2a } - return dAtA[:n], nil -} - -func (m *MsgCreateDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateDerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } + if len(m.ExpirationTimeSeconds) > 0 { + i -= len(m.ExpirationTimeSeconds) + copy(dAtA[i:], m.ExpirationTimeSeconds) + i = encodeVarintExchange(dAtA, i, uint64(len(m.ExpirationTimeSeconds))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Data))) i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSoftCancelDerivativeOrder) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + dAtA[i] = 0x1a } - return dAtA[:n], nil -} - -func (m *MsgSoftCancelDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSoftCancelDerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } + if len(m.SignerAddress) > 0 { + i -= len(m.SignerAddress) + copy(dAtA[i:], m.SignerAddress) + i = encodeVarintExchange(dAtA, i, uint64(len(m.SignerAddress))) i-- dAtA[i] = 0x12 } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) + if len(m.Salt) > 0 { + i -= len(m.Salt) + copy(dAtA[i:], m.Salt) + i = encodeVarintExchange(dAtA, i, uint64(len(m.Salt))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgRegisterSpotMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintExchange(dAtA []byte, offset int, v uint64) int { + offset -= sovExchange(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *MsgRegisterSpotMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *MsgRegisterSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *DerivativeMarket) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.Oracle) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.BaseCurrency) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.Nonce) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 + n += 2 } - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetData))) - i-- - dAtA[i] = 0x22 + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetData))) - i-- - dAtA[i] = 0x1a + l = len(m.PriceFactor) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 + l = len(m.IndexPrice) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.InitialMarginRatio) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgSuspendSpotMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.MaintenanceMarginRatio) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgSuspendSpotMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + l = len(m.MakerTxFee) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.TakerTxFee) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.NextFundingTimestamp) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.FundingInterval) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + l = len(m.CumulativeFunding) + if l > 0 { + n += 2 + l + sovExchange(uint64(l)) + } + return n } -func (m *MsgSuspendSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *SpotMarket) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetData))) - i-- - dAtA[i] = 0x22 + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetData))) - i-- - dAtA[i] = 0x1a + l = len(m.BaseAsset) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 + l = len(m.QuoteAsset) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.MakerTxFee) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgResumeSpotMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.TakerTxFee) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgResumeSpotMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + if m.Enabled { + n += 2 + } + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + return n } -func (m *MsgResumeSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *SpotLimitOrder) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.TakerAssetData))) - i-- - dAtA[i] = 0x22 + l = len(m.SubaccountID) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MakerAssetData))) - i-- - dAtA[i] = 0x1a + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 + l = len(m.FeeRecipient) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + if m.Expiry != 0 { + n += 1 + sovExchange(uint64(m.Expiry)) } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterDerivativeMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.SupplyAmount) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgRegisterDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Market != nil { - { - size, err := m.Market.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + l = len(m.DemandAmount) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.FilledAmount) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgSuspendDerivativeMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.CreationBlockHeight != 0 { + n += 1 + sovExchange(uint64(m.CreationBlockHeight)) } - return dAtA[:n], nil -} - -func (m *MsgSuspendDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if m.OrderType != 0 { + n += 1 + sovExchange(uint64(m.OrderType)) + } + l = len(m.TriggerPrice) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + return n } -func (m *MsgSuspendDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *SpotMarketOrder) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.ExchangeAddress) > 0 { - i -= len(m.ExchangeAddress) - copy(dAtA[i:], m.ExchangeAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x1a + l = len(m.SubaccountID) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.MarketId) > 0 { - i -= len(m.MarketId) - copy(dAtA[i:], m.MarketId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarketId))) - i-- - dAtA[i] = 0x12 + l = len(m.FeeRecipient) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgResumeDerivativeMarket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.FundsSupplied) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgResumeDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if m.OrderType != 0 { + n += 1 + sovExchange(uint64(m.OrderType)) + } + l = len(m.TriggerPrice) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) + } + return n } -func (m *MsgResumeDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *BaseSpotOrder) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.ExchangeAddress) > 0 { - i -= len(m.ExchangeAddress) - copy(dAtA[i:], m.ExchangeAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExchangeAddress))) - i-- - dAtA[i] = 0x1a + if m.ChainId != 0 { + n += 1 + sozExchange(uint64(m.ChainId)) } - if len(m.MarketId) > 0 { - i -= len(m.MarketId) - copy(dAtA[i:], m.MarketId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.MarketId))) - i-- - dAtA[i] = 0x12 + l = len(m.SubaccountID) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgExecuteDerivativeTakeOrder) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.FeeRecipient) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgExecuteDerivativeTakeOrder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecuteDerivativeTakeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != nil { - { - size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if m.Expiry != 0 { + n += 1 + sovExchange(uint64(m.Expiry)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + l = len(m.MarketID) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgExecuteTECTransaction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.SupplyAmount) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgExecuteTECTransaction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecuteTECTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TecTransaction != nil { - { - size, err := m.TecTransaction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + l = len(m.DemandAmount) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa + if m.Salt != 0 { + n += 1 + sovExchange(uint64(m.Salt)) } - return len(dAtA) - i, nil -} - -func (m *ExchangeDomain) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.OrderType != 0 { + n += 1 + sovExchange(uint64(m.OrderType)) } - return dAtA[:n], nil -} - -func (m *ExchangeDomain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExchangeDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 + l = len(m.TriggerPrice) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - if len(m.VerifyingContract) > 0 { - i -= len(m.VerifyingContract) - copy(dAtA[i:], m.VerifyingContract) - i = encodeVarintOrders(dAtA, i, uint64(len(m.VerifyingContract))) - i-- - dAtA[i] = 0xa + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovExchange(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *SignedTransaction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *BaseOrder) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *SignedTransaction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x3a - } - if m.Domain != nil { - { - size, err := m.Domain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintOrders(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.GasPrice) > 0 { - i -= len(m.GasPrice) - copy(dAtA[i:], m.GasPrice) - i = encodeVarintOrders(dAtA, i, uint64(len(m.GasPrice))) - i-- - dAtA[i] = 0x2a - } - if len(m.ExpirationTimeSeconds) > 0 { - i -= len(m.ExpirationTimeSeconds) - copy(dAtA[i:], m.ExpirationTimeSeconds) - i = encodeVarintOrders(dAtA, i, uint64(len(m.ExpirationTimeSeconds))) - i-- - dAtA[i] = 0x22 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if len(m.SignerAddress) > 0 { - i -= len(m.SignerAddress) - copy(dAtA[i:], m.SignerAddress) - i = encodeVarintOrders(dAtA, i, uint64(len(m.SignerAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.Salt) > 0 { - i -= len(m.Salt) - copy(dAtA[i:], m.Salt) - i = encodeVarintOrders(dAtA, i, uint64(len(m.Salt))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintOrders(dAtA []byte, offset int, v uint64) int { - offset -= sovOrders(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DerivativeMarket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Ticker) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Oracle) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.BaseCurrency) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Nonce) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Enabled { - n += 2 - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.PriceFactor) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.IndexPrice) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.InitialMarginRatio) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MaintenanceMarginRatio) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MakerTxFee) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.TakerTxFee) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.NextFundingTimestamp) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.FundingInterval) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.CumulativeFunding) - if l > 0 { - n += 2 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *TradePair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MakerAssetData) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.TakerAssetData) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Enabled { - n += 2 - } - return n -} - -func (m *BaseOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChainId != 0 { - n += 1 + sozOrders(uint64(m.ChainId)) + if m.ChainId != 0 { + n += 1 + sozExchange(uint64(m.ChainId)) } l = len(m.ExchangeAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.MakerAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TakerAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.FeeRecipientAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.SenderAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.MakerAssetAmount) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TakerAssetAmount) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.MakerFee) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TakerFee) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.ExpirationTimeSeconds) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.Salt) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.MakerAssetData) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TakerAssetData) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.MakerFeeAssetData) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TakerFeeAssetData) if l > 0 { - n += 2 + l + sovOrders(uint64(l)) + n += 2 + l + sovExchange(uint64(l)) } l = len(m.Signature) if l > 0 { - n += 2 + l + sovOrders(uint64(l)) + n += 2 + l + sovExchange(uint64(l)) } return n } @@ -3401,33 +3286,33 @@ func (m *Order) Size() (n int) { _ = l if m.Order != nil { l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TradePairHash) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.FilledAmount) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } if m.Status != 0 { - n += 1 + sozOrders(uint64(m.Status)) + n += 1 + sozExchange(uint64(m.Status)) } l = len(m.IndexPriceRequirement) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.SubaccountID) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } if m.OrderType != 0 { - n += 1 + sovOrders(uint64(m.OrderType)) + n += 1 + sovExchange(uint64(m.OrderType)) } l = len(m.TriggerPrice) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3440,11 +3325,11 @@ func (m *MarginInfo) Size() (n int) { _ = l l = len(m.MarginHold) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TotalDeposits) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3457,15 +3342,15 @@ func (m *BaseCurrencyMarginInfo) Size() (n int) { _ = l l = len(m.MarginHold) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.TotalDeposits) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.BaseCurrency) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3479,16 +3364,16 @@ func (m *SubaccountInfo) Size() (n int) { if len(m.BaseCurrencyMarginInfo) > 0 { for _, e := range m.BaseCurrencyMarginInfo { l = e.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } } l = len(m.Nonce) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.SubaccountId) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3501,12 +3386,12 @@ func (m *OrderQuoteInfo) Size() (n int) { _ = l l = len(m.MarketId) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } if len(m.Quotes) > 0 { for _, e := range m.Quotes { l = e.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } } return n @@ -3523,27 +3408,27 @@ func (m *PositionInfo) Size() (n int) { } l = len(m.BankruptcyPrice) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.Quantity) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.PositionHoldQuantity) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.CumulativeFundingEntry) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.Margin) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.EntryPrice) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3556,11 +3441,11 @@ func (m *OrderQuote) Size() (n int) { _ = l if m.Order != nil { l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.FillableAmount) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } @@ -3573,868 +3458,76 @@ func (m *PriceLevel) Size() (n int) { _ = l l = len(m.P) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } l = len(m.Q) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgInitExchange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgCreateSpotOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgCreateDerivativeOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgSoftCancelDerivativeOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *MsgRegisterSpotMarket) Size() (n int) { +func (m *ExchangeDomain) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MakerAssetData) + l = len(m.VerifyingContract) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } - l = len(m.TakerAssetData) + l = len(m.ChainId) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Enabled { - n += 2 + n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *MsgSuspendSpotMarket) Size() (n int) { +func (m *SignedTransaction) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MakerAssetData) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.TakerAssetData) + l = len(m.Salt) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgResumeSpotMarket) Size() (n int) { - if m == nil { - return 0 + n += 1 + l + sovExchange(uint64(l)) } - var l int - _ = l - l = len(m.Sender) + l = len(m.SignerAddress) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } - l = len(m.Name) + l = len(m.Data) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } - l = len(m.MakerAssetData) + l = len(m.ExpirationTimeSeconds) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } - l = len(m.TakerAssetData) + l = len(m.GasPrice) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } - return n -} - -func (m *MsgRegisterDerivativeMarket) Size() (n int) { - if m == nil { - return 0 + if m.Domain != nil { + l = m.Domain.Size() + n += 1 + l + sovExchange(uint64(l)) } - var l int - _ = l - l = len(m.Sender) + l = len(m.Signature) if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Market != nil { - l = m.Market.Size() - n += 1 + l + sovOrders(uint64(l)) + n += 1 + l + sovExchange(uint64(l)) } return n } -func (m *MsgSuspendDerivativeMarket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgResumeDerivativeMarket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.MarketId) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.ExchangeAddress) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgExecuteDerivativeTakeOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Order != nil { - l = m.Order.Size() - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *MsgExecuteTECTransaction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.TecTransaction != nil { - l = m.TecTransaction.Size() - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *ExchangeDomain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.VerifyingContract) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func (m *SignedTransaction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Salt) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.SignerAddress) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.ExpirationTimeSeconds) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.GasPrice) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - if m.Domain != nil { - l = m.Domain.Size() - n += 1 + l + sovOrders(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovOrders(uint64(l)) - } - return n -} - -func sovOrders(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozOrders(x uint64) (n int) { - return sovOrders(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DerivativeMarket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ticker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Oracle = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrency", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BaseCurrency = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Nonce = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MarketId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PriceFactor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IndexPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialMarginRatio", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitialMarginRatio = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaintenanceMarginRatio", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MaintenanceMarginRatio = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerTxFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MakerTxFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerTxFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TakerTxFee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextFundingTimestamp", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextFundingTimestamp = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FundingInterval", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FundingInterval = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFunding", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CumulativeFunding = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func sovExchange(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozExchange(x uint64) (n int) { + return sovExchange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *TradePair) Unmarshal(dAtA []byte) error { +func (m *DerivativeMarket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4442,7 +3535,7 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4457,20 +3550,20 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TradePair: wiretype end group for non-group") + return fmt.Errorf("proto: DerivativeMarket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TradePair: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4484,25 +3577,25 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Ticker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4516,25 +3609,25 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + m.Oracle = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrency", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4548,25 +3641,25 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.BaseCurrency = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4580,119 +3673,77 @@ func (m *TradePair) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = string(dAtA[iNdEx:postIndex]) + m.Nonce = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Enabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BaseOrder) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BaseOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseOrder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } - var v uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.ChainId = int64(v) - case 2: + m.Enabled = bool(v != 0) + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4706,25 +3757,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PriceFactor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4738,25 +3789,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAddress = string(dAtA[iNdEx:postIndex]) + m.PriceFactor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IndexPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4770,25 +3821,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAddress = string(dAtA[iNdEx:postIndex]) + m.IndexPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipientAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4802,25 +3853,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeRecipientAddress = string(dAtA[iNdEx:postIndex]) + m.InitialMarginRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SenderAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaintenanceMarginRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4834,25 +3885,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.SenderAddress = string(dAtA[iNdEx:postIndex]) + m.MaintenanceMarginRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerTxFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4866,25 +3917,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetAmount = string(dAtA[iNdEx:postIndex]) + m.MakerTxFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerTxFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4898,25 +3949,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetAmount = string(dAtA[iNdEx:postIndex]) + m.TakerTxFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NextFundingTimestamp", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4930,25 +3981,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerFee = string(dAtA[iNdEx:postIndex]) + m.NextFundingTimestamp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 15: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FundingInterval", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4962,25 +4013,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerFee = string(dAtA[iNdEx:postIndex]) + m.FundingInterval = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimeSeconds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFunding", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4994,25 +4045,75 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExpirationTimeSeconds = string(dAtA[iNdEx:postIndex]) + m.CumulativeFunding = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 12: + default: + iNdEx = preIndex + skippy, err := skipExchange(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpotMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SpotMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5026,25 +4127,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Salt = string(dAtA[iNdEx:postIndex]) + m.Ticker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseAsset", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5058,25 +4159,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + m.BaseAsset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 14: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field QuoteAsset", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5090,25 +4191,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.QuoteAsset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 15: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerTxFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5122,25 +4223,57 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerFeeAssetData = string(dAtA[iNdEx:postIndex]) + m.MakerTxFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 16: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerTxFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TakerTxFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5154,25 +4287,45 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerFeeAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5186,28 +4339,25 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signature = string(dAtA[iNdEx:postIndex]) + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5221,7 +4371,7 @@ func (m *BaseOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *Order) Unmarshal(dAtA []byte) error { +func (m *SpotLimitOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5229,7 +4379,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5244,56 +4394,52 @@ func (m *Order) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Order: wiretype end group for non-group") + return fmt.Errorf("proto: SpotLimitOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Order: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SpotLimitOrder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SubaccountID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradePairHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5307,25 +4453,25 @@ func (m *Order) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TradePairHash = string(dAtA[iNdEx:postIndex]) + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FilledAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5339,46 +4485,44 @@ func (m *Order) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.FilledAmount = string(dAtA[iNdEx:postIndex]) + m.FeeRecipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) } - var v uint64 + m.Expiry = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + m.Expiry |= uint64(b&0x7F) << shift if b < 0x80 { break } } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.Status = int64(v) case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexPriceRequirement", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplyAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5392,25 +4536,25 @@ func (m *Order) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.IndexPriceRequirement = string(dAtA[iNdEx:postIndex]) + m.SupplyAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DemandAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5424,44 +4568,95 @@ func (m *Order) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountID = string(dAtA[iNdEx:postIndex]) + m.DemandAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilledAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FilledAmount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationBlockHeight", wireType) + } + m.CreationBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationBlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } m.OrderType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.OrderType |= uint64(b&0x7F) << shift + m.OrderType |= SpotLimitOrder_LimitOrderType(b&0x7F) << shift if b < 0x80 { break } } - case 8: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5475,11 +4670,11 @@ func (m *Order) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -5488,15 +4683,12 @@ func (m *Order) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5510,7 +4702,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { } return nil } -func (m *MarginInfo) Unmarshal(dAtA []byte) error { +func (m *SpotMarketOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5518,7 +4710,7 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5533,20 +4725,20 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MarginInfo: wiretype end group for non-group") + return fmt.Errorf("proto: SpotMarketOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SpotMarketOrder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarginHold", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5560,25 +4752,25 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MarginHold = string(dAtA[iNdEx:postIndex]) + m.SubaccountID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5592,78 +4784,25 @@ func (m *MarginInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TotalDeposits = string(dAtA[iNdEx:postIndex]) + m.FeeRecipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BaseCurrencyMarginInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseCurrencyMarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarginHold", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5677,25 +4816,25 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MarginHold = string(dAtA[iNdEx:postIndex]) + m.Quantity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FundsSupplied", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5709,25 +4848,44 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TotalDeposits = string(dAtA[iNdEx:postIndex]) + m.FundsSupplied = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) + } + m.OrderType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OrderType |= SpotMarketOrder_MarketOrderType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrency", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5741,28 +4899,25 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseCurrency = string(dAtA[iNdEx:postIndex]) + m.TriggerPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5776,7 +4931,7 @@ func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { +func (m *BaseSpotOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5784,7 +4939,7 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5799,54 +4954,156 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SubaccountInfo: wiretype end group for non-group") + return fmt.Errorf("proto: BaseSpotOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SubaccountInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BaseSpotOrder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.ChainId = int64(v) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubaccountID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrencyMarginInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipient", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseCurrencyMarginInfo = append(m.BaseCurrencyMarginInfo, &BaseCurrencyMarginInfo{}) - if err := m.BaseCurrencyMarginInfo[len(m.BaseCurrencyMarginInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.FeeRecipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) + } + m.Expiry = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Expiry |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5860,25 +5117,25 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Nonce = string(dAtA[iNdEx:postIndex]) + m.MarketID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubaccountId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplyAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5892,78 +5149,95 @@ func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.SubaccountId = string(dAtA[iNdEx:postIndex]) + m.SupplyAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DemandAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if skippy < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders + m.DemandAmount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.Salt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Salt |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: OrderQuoteInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OrderQuoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.OrderType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OrderType |= BaseSpotOrder_OrderType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5977,62 +5251,57 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MarketId = string(dAtA[iNdEx:postIndex]) + m.TriggerPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quotes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Quotes = append(m.Quotes, &OrderQuote{}) - if err := m.Quotes[len(m.Quotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Signature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6046,7 +5315,7 @@ func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *PositionInfo) Unmarshal(dAtA []byte) error { +func (m *BaseOrder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6054,7 +5323,7 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6069,40 +5338,41 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PositionInfo: wiretype end group for non-group") + return fmt.Errorf("proto: BaseOrder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PositionInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BaseOrder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsLong", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var v int + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + v |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.IsLong = bool(v != 0) + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.ChainId = int64(v) case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BankruptcyPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6116,25 +5386,25 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.BankruptcyPrice = string(dAtA[iNdEx:postIndex]) + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6148,25 +5418,25 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Quantity = string(dAtA[iNdEx:postIndex]) + m.MakerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PositionHoldQuantity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6180,25 +5450,25 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.PositionHoldQuantity = string(dAtA[iNdEx:postIndex]) + m.TakerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFundingEntry", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeRecipientAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6212,25 +5482,25 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.CumulativeFundingEntry = string(dAtA[iNdEx:postIndex]) + m.FeeRecipientAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Margin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SenderAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6244,25 +5514,25 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Margin = string(dAtA[iNdEx:postIndex]) + m.SenderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EntryPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6276,114 +5546,57 @@ func (m *PositionInfo) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.EntryPrice = string(dAtA[iNdEx:postIndex]) + m.MakerAssetAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OrderQuote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: OrderQuote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OrderQuote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetAmount", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TakerAssetAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FillableAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6397,78 +5610,25 @@ func (m *OrderQuote) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.FillableAmount = string(dAtA[iNdEx:postIndex]) + m.MakerFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PriceLevel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PriceLevel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriceLevel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field P", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6482,25 +5642,25 @@ func (m *PriceLevel) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.P = string(dAtA[iNdEx:postIndex]) + m.TakerFee = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Q", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimeSeconds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6514,112 +5674,57 @@ func (m *PriceLevel) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Q = string(dAtA[iNdEx:postIndex]) + m.ExpirationTimeSeconds = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgInitExchange) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgInitExchange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInitExchange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = append(m.Sender[:0], dAtA[iNdEx:postIndex]...) - if m.Sender == nil { - m.Sender = []byte{} - } + m.Salt = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6633,78 +5738,25 @@ func (m *MsgInitExchange) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + m.MakerAssetData = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateSpotOrder) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSpotOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSpotOrder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6718,114 +5770,57 @@ func (m *MsgCreateSpotOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.TakerAssetData = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 15: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MakerFeeAssetData", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.MakerFeeAssetData = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateDerivativeOrder) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateDerivativeOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateDerivativeOrder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TakerFeeAssetData", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6839,64 +5834,57 @@ func (m *MsgCreateDerivativeOrder) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.TakerFeeAssetData = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Signature = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6910,7 +5898,7 @@ func (m *MsgCreateDerivativeOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { +func (m *Order) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6918,7 +5906,7 @@ func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6933,52 +5921,20 @@ func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSoftCancelDerivativeOrder: wiretype end group for non-group") + return fmt.Errorf("proto: Order: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSoftCancelDerivativeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Order: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6991,11 +5947,11 @@ func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -7007,67 +5963,14 @@ func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterSpotMarket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TradePairHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7081,25 +5984,25 @@ func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.TradePairHash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FilledAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7113,25 +6016,46 @@ func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.FilledAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Status = int64(v) + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IndexPriceRequirement", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7145,25 +6069,25 @@ func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + m.IndexPriceRequirement = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7177,48 +6101,76 @@ func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.SubaccountID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OrderType", wireType) } - var v int + m.OrderType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.OrderType |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Enabled = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TriggerPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TriggerPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7232,7 +6184,7 @@ func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { +func (m *MarginInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7240,7 +6192,7 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7255,20 +6207,20 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSuspendSpotMarket: wiretype end group for non-group") + return fmt.Errorf("proto: MarginInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSuspendSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarginHold", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7282,25 +6234,107 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.MarginHold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExchange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TotalDeposits = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExchange(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BaseCurrencyMarginInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BaseCurrencyMarginInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseCurrencyMarginInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarginHold", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7314,25 +6348,25 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.MarginHold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposits", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7346,25 +6380,25 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + m.TotalDeposits = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrency", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7378,28 +6412,25 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.BaseCurrency = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7413,7 +6444,7 @@ func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { +func (m *SubaccountInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7421,7 +6452,7 @@ func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7436,52 +6467,54 @@ func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgResumeSpotMarket: wiretype end group for non-group") + return fmt.Errorf("proto: SubaccountInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgResumeSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SubaccountInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseCurrencyMarginInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders + if msglen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.BaseCurrencyMarginInfo = append(m.BaseCurrencyMarginInfo, &BaseCurrencyMarginInfo{}) + if err := m.BaseCurrencyMarginInfo[len(m.BaseCurrencyMarginInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7495,57 +6528,25 @@ func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Nonce = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthOrders - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SubaccountId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7559,28 +6560,25 @@ func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.SubaccountId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7594,7 +6592,7 @@ func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { +func (m *OrderQuoteInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7602,7 +6600,7 @@ func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7617,20 +6615,20 @@ func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterDerivativeMarket: wiretype end group for non-group") + return fmt.Errorf("proto: OrderQuoteInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OrderQuoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7644,25 +6642,25 @@ func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quotes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7675,33 +6673,28 @@ func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Market == nil { - m.Market = &DerivativeMarket{} - } - if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Quotes = append(m.Quotes, &OrderQuote{}) + if err := m.Quotes[len(m.Quotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7715,7 +6708,7 @@ func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { +func (m *PositionInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7723,7 +6716,7 @@ func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7738,20 +6731,40 @@ func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSuspendDerivativeMarket: wiretype end group for non-group") + return fmt.Errorf("proto: PositionInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSuspendDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PositionInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLong", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExchange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLong = bool(v != 0) + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BankruptcyPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7765,25 +6778,25 @@ func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.BankruptcyPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7797,25 +6810,25 @@ func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MarketId = string(dAtA[iNdEx:postIndex]) + m.Quantity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositionHoldQuantity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7829,78 +6842,25 @@ func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + m.PositionHoldQuantity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrders - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgResumeDerivativeMarket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgResumeDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeFundingEntry", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7914,25 +6874,25 @@ func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.CumulativeFundingEntry = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Margin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7946,25 +6906,25 @@ func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.MarketId = string(dAtA[iNdEx:postIndex]) + m.Margin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EntryPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7978,28 +6938,25 @@ func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + m.EntryPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8013,7 +6970,7 @@ func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecuteDerivativeTakeOrder) Unmarshal(dAtA []byte) error { +func (m *OrderQuote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8021,7 +6978,7 @@ func (m *MsgExecuteDerivativeTakeOrder) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8036,91 +6993,88 @@ func (m *MsgExecuteDerivativeTakeOrder) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteDerivativeTakeOrder: wiretype end group for non-group") + return fmt.Errorf("proto: OrderQuote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteDerivativeTakeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OrderQuote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthOrders + if msglen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + if m.Order == nil { + m.Order = &BaseOrder{} + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FillableAmount", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Order == nil { - m.Order = &BaseOrder{} - } - if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.FillableAmount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8134,7 +7088,7 @@ func (m *MsgExecuteDerivativeTakeOrder) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecuteTECTransaction) Unmarshal(dAtA []byte) error { +func (m *PriceLevel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8142,7 +7096,7 @@ func (m *MsgExecuteTECTransaction) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8157,20 +7111,20 @@ func (m *MsgExecuteTECTransaction) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecuteTECTransaction: wiretype end group for non-group") + return fmt.Errorf("proto: PriceLevel: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecuteTECTransaction: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PriceLevel: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field P", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8184,64 +7138,57 @@ func (m *MsgExecuteTECTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sender = string(dAtA[iNdEx:postIndex]) + m.P = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TecTransaction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Q", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthOrders + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthExchange } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TecTransaction == nil { - m.TecTransaction = &SignedTransaction{} - } - if err := m.TecTransaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Q = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8263,7 +7210,7 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8291,7 +7238,7 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8305,11 +7252,11 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8323,7 +7270,7 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8337,11 +7284,11 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8350,15 +7297,12 @@ func (m *ExchangeDomain) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8380,7 +7324,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8408,7 +7352,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8422,11 +7366,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8440,7 +7384,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8454,11 +7398,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8472,7 +7416,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8486,11 +7430,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8504,7 +7448,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8518,11 +7462,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8536,7 +7480,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8550,11 +7494,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8568,7 +7512,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8581,11 +7525,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8604,7 +7548,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowOrders + return ErrIntOverflowExchange } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8618,11 +7562,11 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthOrders + return ErrInvalidLengthExchange } if postIndex > l { return io.ErrUnexpectedEOF @@ -8631,15 +7575,12 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipOrders(dAtA[iNdEx:]) + skippy, err := skipExchange(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOrders - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthOrders + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExchange } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8653,7 +7594,7 @@ func (m *SignedTransaction) Unmarshal(dAtA []byte) error { } return nil } -func skipOrders(dAtA []byte) (n int, err error) { +func skipExchange(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -8661,7 +7602,7 @@ func skipOrders(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowOrders + return 0, ErrIntOverflowExchange } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -8678,7 +7619,7 @@ func skipOrders(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowOrders + return 0, ErrIntOverflowExchange } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -8694,7 +7635,7 @@ func skipOrders(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowOrders + return 0, ErrIntOverflowExchange } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -8707,14 +7648,14 @@ func skipOrders(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthOrders + return 0, ErrInvalidLengthExchange } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupOrders + return 0, ErrUnexpectedEndOfGroupExchange } depth-- case 5: @@ -8723,7 +7664,7 @@ func skipOrders(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthOrders + return 0, ErrInvalidLengthExchange } if depth == 0 { return iNdEx, nil @@ -8733,7 +7674,7 @@ func skipOrders(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthOrders = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOrders = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupOrders = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthExchange = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowExchange = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupExchange = fmt.Errorf("proto: unexpected end of group") ) diff --git a/chain/orders/types/genesis.go b/chain/exchange/types/genesis.go similarity index 100% rename from chain/orders/types/genesis.go rename to chain/exchange/types/genesis.go diff --git a/chain/orders/types/genesis.pb.go b/chain/exchange/types/genesis.pb.go similarity index 76% rename from chain/orders/types/genesis.pb.go rename to chain/exchange/types/genesis.pb.go index 31f59b75..68bab892 100644 --- a/chain/orders/types/genesis.pb.go +++ b/chain/exchange/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/orders/v1beta1/genesis.proto +// source: injective/exchange/v1beta1/genesis.proto package types @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the evm module's genesis state. type GenesisState struct { // accounts is an array containing the genesis trade pairs - TradePairs []*TradePair `protobuf:"bytes,1,rep,name=trade_pairs,json=tradePairs,proto3" json:"trade_pairs,omitempty"` + SpotMarkets []*SpotMarket `protobuf:"bytes,1,rep,name=spot_markets,json=spotMarkets,proto3" json:"spot_markets,omitempty"` // accounts is an array containing the genesis derivative markets DerivativeMarkets []*DerivativeMarket `protobuf:"bytes,2,rep,name=derivative_markets,json=derivativeMarkets,proto3" json:"derivative_markets,omitempty"` // @@ -37,7 +37,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_86ff9943b540666f, []int{0} + return fileDescriptor_c47ec6b98758ed05, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -66,9 +66,9 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetTradePairs() []*TradePair { +func (m *GenesisState) GetSpotMarkets() []*SpotMarket { if m != nil { - return m.TradePairs + return m.SpotMarkets } return nil } @@ -88,35 +88,34 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "injective.orders.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "injective.exchange.v1beta1.GenesisState") } func init() { - proto.RegisterFile("injective/orders/v1beta1/genesis.proto", fileDescriptor_86ff9943b540666f) + proto.RegisterFile("injective/exchange/v1beta1/genesis.proto", fileDescriptor_c47ec6b98758ed05) } -var fileDescriptor_86ff9943b540666f = []byte{ - // 305 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x4f, 0x4b, 0xc3, 0x30, - 0x18, 0xc6, 0x1b, 0x27, 0x3b, 0x64, 0x5e, 0x2c, 0x1e, 0x8a, 0x87, 0x38, 0x14, 0x65, 0x08, 0x26, - 0x6c, 0xde, 0x3d, 0x8c, 0x81, 0x08, 0x13, 0xc6, 0xf4,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3, 0xdd, 0xcd, - 0xe7, 0x91, 0x33, 0xaf, 0x5a, 0xe3, 0xa7, 0x4d, 0x46, 0xd0, 0x36, 0x23, 0xe8, 0x2b, 0x23, 0xe8, - 0x3d, 0x27, 0xce, 0x36, 0x27, 0xce, 0x47, 0x4e, 0x9c, 0xc7, 0x69, 0x28, 0xcc, 0x6a, 0xed, 0xd3, - 0xa5, 0x8c, 0xd8, 0x4d, 0xed, 0x9c, 0x72, 0x5f, 0xb3, 0xe6, 0x0f, 0x17, 0x4b, 0xa9, 0xe0, 0xf7, - 0xe7, 0x8a, 0x8b, 0x98, 0x45, 0x32, 0x58, 0xbf, 0x82, 0xae, 0xcf, 0x6f, 0xde, 0x12, 0xd0, 0x7e, - 0xd7, 0x1e, 0xf8, 0xf2, 0x27, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xf6, 0x33, 0x8c, 0x08, 0x02, 0x00, - 0x00, +var fileDescriptor_c47ec6b98758ed05 = []byte{ + // 304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x1b, 0x27, 0x3b, 0x74, 0xbb, 0x58, 0x3c, 0x8c, 0x1e, 0xe2, 0xd8, 0x41, 0x2b, 0x68, + 0xc2, 0xe6, 0x17, 0x90, 0x21, 0xc8, 0x40, 0x45, 0xb6, 0x9b, 0x1e, 0x24, 0x6d, 0x1f, 0x6d, 0xd4, + 0x36, 0xa5, 0xc9, 0x8a, 0x7e, 0x0b, 0x3f, 0xd6, 0x8e, 0x3b, 0x7a, 0x12, 0x69, 0xbf, 0x84, 0x47, + 0x59, 0xda, 0x45, 0x11, 0xec, 0xed, 0xe5, 0xf1, 0xfb, 0xff, 0xde, 0x4b, 0x62, 0x7b, 0x3c, 0x7d, + 0x84, 0x40, 0xf1, 0x02, 0x28, 0xbc, 0x04, 0x31, 0x4b, 0x23, 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f, 0x69, 0x22, 0xc2, 0xe5, 0x33, 0xc8, 0x9f, 0x9f, 0x50, 0xaf, 0x19, 0x48, 0xbf, 0xab, + 0xdf, 0xfa, 0xec, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x3c, 0xdb, 0xbe, 0x1d, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -163,10 +162,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.TradePairs) > 0 { - for iNdEx := len(m.TradePairs) - 1; iNdEx >= 0; iNdEx-- { + if len(m.SpotMarkets) > 0 { + for iNdEx := len(m.SpotMarkets) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.TradePairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SpotMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -197,8 +196,8 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.TradePairs) > 0 { - for _, e := range m.TradePairs { + if len(m.SpotMarkets) > 0 { + for _, e := range m.SpotMarkets { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -251,7 +250,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradePairs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SpotMarkets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -278,8 +277,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TradePairs = append(m.TradePairs, &TradePair{}) - if err := m.TradePairs[len(m.TradePairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.SpotMarkets = append(m.SpotMarkets, &SpotMarket{}) + if err := m.SpotMarkets[len(m.SpotMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -356,10 +355,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { diff --git a/chain/exchange/types/key.go b/chain/exchange/types/key.go new file mode 100644 index 00000000..23407107 --- /dev/null +++ b/chain/exchange/types/key.go @@ -0,0 +1,127 @@ +package types + +import ( + "fmt" + "github.com/ethereum/go-ethereum/common" + "github.com/shopspring/decimal" + "math/big" + "strings" +) + +const ( + // module name + ModuleName = "exchange" + + // StoreKey to be used when creating the KVStore + StoreKey = ModuleName +) +const SpotPriceDecimalPlaces = 18 + +var ( + // Keys for store prefixes + MarginInfoKey = []byte{0x01} // prefix for each key to a MarginInfo + UnknownOrderHashKey = []byte{0x02} // prefix for each key to an unknown order hash + TECSeenHashStoreKeyPrefix = []byte{0x03} // prefix for the seen state of a TEC transaction hash + PositionInfoStoreKeyPrefix = []byte{0x04} // prefix for each key to a PositionInfo + + SpotMarketKey = []byte{0x11} // prefix for each key to a spot market by (exchange address, isEnabled, marketID) + SpotLimitOrdersKey = []byte{0x12} // prefix for each key to an active spot order, by (marketID, direction, price level, order hash) + SpotMarketOrdersKey = []byte{0x12} // prefix for each key to an active spot order, by (marketID, direction, price level, order hash) + SpotLimitOrdersBySubaccountIndexKey = []byte{0x13} // prefix for each key to an active spot order index, by (marketID, direction, subaccountID, order hash) + SpotMarketOrderQuantityKey = []byte{0x14} // prefix for each key to a cumulative spot market order quantity key, by marketID and direction + ArchiveOrderHashKey = []byte{0x15} // prefix for each key to an archived spot order, by order hash + + DerivativeMarketKey = []byte{0x21} // prefix for each key to a derivative market by (exchange address, isEnabled, marketID) + ActiveOrdersKey = []byte{0x22} // prefix for each key to an active order, by (marketID, direction, price level, order hash) + ActiveOrdersBySubaccountIndexKey = []byte{0x23} // prefix for each key to an active order index, by (marketID, direction, subaccountID, order hash) + ArchiveOrdersKey = []byte{0x24} // prefix for each key to an archived order, by (marketID, direction, price level, order hash) + ArchiveOrdersBySubaccountIndexKey = []byte{0x25} // prefix for each key to an archived order index, by (marketID, direction, subaccountID, order hash) +) + +func GetSpotMarketKey(exchangeAddress common.Address, isEnabled bool) []byte { + return append(SpotMarketKey, marketByExchangeAddressEnabledPrefix(exchangeAddress, isEnabled)...) +} + +func getPaddedPrice(price *decimal.Decimal) string { + priceString := price.StringFixed(SpotPriceDecimalPlaces) + leftSide := fmt.Sprintf("%032d", price.Floor().String()) + priceComponents := strings.Split(priceString, ".") + return leftSide + "." + priceComponents[2] +} + +// SpotMarketDirectionPriceHashPrefix turns a marketID + direction + price + order hash to prefix used to get a spot order from the store. +func SpotMarketDirectionPriceHashPrefix(marketID common.Hash, isBuy bool, price *decimal.Decimal, orderHash common.Hash) []byte { + return append(append(MarketDirectionPrefix(marketID, isBuy), []byte(getPaddedPrice(price))...), orderHash.Bytes()...) +} + +func GetDerivativeMarketKey(exchangeAddress common.Address, isEnabled bool) []byte { + return append(DerivativeMarketKey, marketByExchangeAddressEnabledPrefix(exchangeAddress, isEnabled)...) +} + +func marketByExchangeAddressEnabledPrefix(exchangeAddress common.Address, isEnabled bool) []byte { + isEnabledByte := byte(0) + if isEnabled { + isEnabledByte = byte(1) + } + return append(exchangeAddress.Bytes(), isEnabledByte) +} + +// OrdersByMarketDirectionPriceOrderHashPrefix turns a marketID + direction + price + order hash to prefix used to get an order from the store. +func OrdersByMarketDirectionPriceOrderHashPrefix(marketID common.Hash, orderHash common.Hash, price *big.Int, isLong bool) []byte { + return append(ordersByMarketDirectionPricePrefix(marketID, price, isLong), orderHash.Bytes()...) +} + +// orderIndexByMarketDirectionSubaccountPrefix allows to obtain prefix of exchange against a particular marketID, direction and price +func ordersByMarketDirectionPricePrefix(marketID common.Hash, price *big.Int, isLong bool) []byte { + return append(MarketDirectionPrefix(marketID, isLong), common.LeftPadBytes(price.Bytes(), 32)...) +} + +// OrderIndexByMarketDirectionSubaccountOrderHashPrefix turns a marketID + direction + subaccountID + order hash to prefix used to get an order from the store. +func OrderIndexByMarketDirectionSubaccountOrderHashPrefix(marketID common.Hash, isLong bool, subaccountID common.Hash, orderHash common.Hash) []byte { + return append(OrderIndexByMarketDirectionSubaccountPrefix(marketID, subaccountID, isLong), orderHash.Bytes()...) +} + +// OrderIndexByMarketDirectionSubaccountPrefix allows to obtain prefix of exchange against a particular marketID, subaccountID and direction +func OrderIndexByMarketDirectionSubaccountPrefix(marketID common.Hash, subaccountID common.Hash, isLong bool) []byte { + return append(MarketDirectionPrefix(marketID, isLong), subaccountID.Bytes()...) +} + +// MarketDirectionHashPrefix allows to obtain prefix against a particular marketID, direction, order hash +func MarketDirectionHashPrefix(marketID common.Hash, isLong bool, hash common.Hash) []byte { + direction := byte(0) + if isLong { + direction = byte(1) + } + return append(append(marketID.Bytes(), direction), hash.Bytes()...) +} + +// MarketDirectionPrefix allows to obtain prefix against a particular marketID, direction +func MarketDirectionPrefix(marketID common.Hash, isLong bool) []byte { + direction := byte(0) + if isLong { + direction = byte(1) + } + return append(marketID.Bytes(), direction) +} + +// MarginInfoByExchangeSubaccountBaseCurrencyPrefix provides the prefix key to obtain a given subaccount's base currency +// margin info in a given exchange +func MarginInfoByExchangeSubaccountBaseCurrencyPrefix(exchangeAddress common.Address, subaccountID common.Hash, baseCurrencyAddress common.Address) []byte { + return append(MarginInfoByExchangeSubaccountPrefix(exchangeAddress, subaccountID), baseCurrencyAddress.Bytes()...) +} + +// MarginInfoByExchangeSubaccountPrefix provides the prefix key to obtain a given subaccount's margin info in a given exchange +func MarginInfoByExchangeSubaccountPrefix(exchangeAddress common.Address, subaccountID common.Hash) []byte { + return append(exchangeAddress.Bytes(), subaccountID.Bytes()...) +} + +// PositionInfoByExchangeSubaccountMarketIDPrefix provides the prefix key to obtain a given subaccount's position info +// in a given market in a given exchange +func PositionInfoByExchangeSubaccountMarketIDPrefix(exchangeAddress common.Address, subaccountID common.Hash, marketID common.Hash) []byte { + return append(exchangeAddress.Bytes(), append(subaccountID.Bytes(), marketID.Bytes()...)...) +} + +// SpotMarketsStoreKey turns a pair hash to key used to get it from the store. +func SpotMarketsStoreKey(hash common.Hash) []byte { + return append(SpotMarketKey, hash.Bytes()...) +} diff --git a/chain/orders/types/msgs.go b/chain/exchange/types/msgs.go similarity index 61% rename from chain/orders/types/msgs.go rename to chain/exchange/types/msgs.go index 21885e36..56ab48f0 100644 --- a/chain/orders/types/msgs.go +++ b/chain/exchange/types/msgs.go @@ -2,17 +2,14 @@ package types import ( "bytes" - "errors" "fmt" "math/big" "strings" - "time" zeroex "github.com/InjectiveLabs/sdk-go" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" ethcrypto "github.com/ethereum/go-ethereum/crypto" ) @@ -119,7 +116,8 @@ func (msg MsgCreateSpotOrder) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - quantity := BigNum(msg.Order.GetTakerAssetAmount()).Int() + sOrder := msg.Order.ToSignedOrder() + if msg.Order == nil { return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no make order specified") } @@ -128,11 +126,11 @@ func (msg MsgCreateSpotOrder) ValidateBasic() error { if err != nil { return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, fmt.Sprintf("hash check failed: %v", err)) } - makerAddress := common.HexToAddress(msg.Order.MakerAddress) + makerAddress, _ := sOrder.GetMakerAddressAndNonce() + + // TODO: also allow for exchange without signatures (just cosmos) if !isValidSignature(msg.Order.Signature, makerAddress, orderHash) { return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "invalid signature") - } else if quantity == nil || quantity.Cmp(big.NewInt(0)) <= 0 { - return sdkerrors.Wrap(ErrInsufficientOrderQuantity, "insufficient quantity") } return nil @@ -274,16 +272,17 @@ func (msg MsgRegisterSpotMarket) ValidateBasic() error { if msg.Sender == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) } - if len(msg.Name) == 0 { + if len(msg.Ticker) == 0 { return sdkerrors.Wrap(ErrBadField, "no trade pair name specified") - } else if parts := strings.Split(msg.Name, "/"); len(parts) != 2 || + } else if parts := strings.Split(msg.Ticker, "/"); len(parts) != 2 || len(strings.TrimSpace(parts[0])) == 0 || len(strings.TrimSpace(parts[1])) == 0 { return sdkerrors.Wrap(ErrBadField, "pair name must be in format AAA/BBB") } - if len(msg.MakerAssetData) == 0 { - return sdkerrors.Wrap(ErrBadField, "no maker asset data specified") - } else if len(msg.TakerAssetData) == 0 { - return sdkerrors.Wrap(ErrBadField, "no taker asset data specified") + + if !common.IsHexAddress(msg.BaseAsset) { + return sdkerrors.Wrap(ErrBadField, "no valid BaseAsset specified") + } else if !common.IsHexAddress(msg.QuoteAsset) { + return sdkerrors.Wrap(ErrBadField, "no valid QuoteAsset specified") } return nil } @@ -595,301 +594,3 @@ func (msg MsgExecuteDerivativeTakeOrder) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{sender} } - -// SafeSignedOrder is a special signed order structure -// for including in Msgs, because it consists of primitive types. -// Avoid using raw *big.Int in Msgs. -type SafeSignedOrder struct { - // ChainID is a network identifier of the order. - ChainID int64 `json:"chainID,omitempty"` - // Exchange v3 contract address. - ExchangeAddress Address `json:"exchangeAddress,omitempty"` - // Address that created the order. - MakerAddress Address `json:"makerAddress,omitempty"` - // Address that is allowed to fill the order. If set to "0x0", any address is - // allowed to fill the order. - TakerAddress Address `json:"takerAddress,omitempty"` - // Address that will receive fees when order is filled. - FeeRecipientAddress Address `json:"feeRecipientAddress,omitempty"` - // Address that is allowed to call Exchange contract methods that affect this - // order. If set to "0x0", any address is allowed to call these methods. - SenderAddress Address `json:"senderAddress,omitempty"` - // Amount of makerAsset being offered by maker. Must be greater than 0. - MakerAssetAmount BigNum `json:"makerAssetAmount,omitempty"` - // Amount of takerAsset being bid on by maker. Must be greater than 0. - TakerAssetAmount BigNum `json:"takerAssetAmount,omitempty"` - // Amount of Fee Asset paid to feeRecipientAddress by maker when order is filled. If set to - // 0, no transfer of Fee Asset from maker to feeRecipientAddress will be attempted. - MakerFee BigNum `json:"makerFee,omitempty"` - // Amount of Fee Asset paid to feeRecipientAddress by taker when order is filled. If set to - // 0, no transfer of Fee Asset from taker to feeRecipientAddress will be attempted. - TakerFee BigNum `json:"takerFee,omitempty"` - // Timestamp in seconds at which order expires. - ExpirationTimeSeconds BigNum `json:"expirationTimeSeconds,omitempty"` - // Arbitrary number to facilitate uniqueness of the order's hash. - Salt BigNum `json:"salt,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerAsset. - MakerAssetData HexBytes `json:"makerAssetData,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerAsset. - TakerAssetData HexBytes `json:"takerAssetData,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerFee. - MakerFeeAssetData HexBytes `json:"makerFeeAssetData,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerFee. - TakerFeeAssetData HexBytes `json:"takerFeeAssetData,omitempty"` - // Order signature. - Signature HexBytes `json:"signature,omitempty"` -} - -// NewSafeSignedOrder constructs a new SafeSignedOrder from given zeroex.SignedOrder. -func NewSafeSignedOrder(o *zeroex.SignedOrder) *SafeSignedOrder { - return zo2so(o) -} - -// ToSignedOrder returns an appropriate zeroex.SignedOrder defined by SafeSignedOrder. -func (m *BaseOrder) ToSignedOrder() *zeroex.SignedOrder { - o, err := so2zo(m) - if err != nil { - panic(err) - } - return o -} - -func (order *Order) IsReduceOnly() bool { - return BigNum(order.GetOrder().GetMakerFee()).Int().Cmp(big.NewInt(0)) == 0 -} - -func (order *Order) DoesValidationPass( - isLong bool, - market *DerivativeMarket, - currBlockTime time.Time, -) error { - err := order.ComputeAndSetOrderType() - if err != nil { - return err - } - - isOrderExpired := order.Order.IsExpired(currBlockTime) - if isOrderExpired { - return sdkerrors.Wrapf(ErrOrderExpired, "order expiration %s <= block time %d", order.GetOrder().GetExpirationTimeSeconds(), currBlockTime.Unix()) - } - if order.OrderType == 0 { - margin := BigNum(order.Order.GetMakerFee()).Int() - contractPriceMarginRequirement := order.ComputeContractPriceMarginRequirement(market) - if margin.Cmp(contractPriceMarginRequirement) < 0 { - return sdkerrors.Wrapf(ErrOverLeveragedOrder, "margin %s < contractPriceMarginRequirement %s", margin.String(), contractPriceMarginRequirement.String()) - } - - indexPriceMarginRequirement := order.ComputeIndexPriceMarginRequirement(isLong, market) - indexPrice := BigNum(market.GetIndexPrice()).Int() - - if isLong && indexPrice.Cmp(indexPriceMarginRequirement) < 0 { - return sdkerrors.Wrapf(ErrOverLeveragedOrder, "indexPrice %s <= indexPriceReq %s", market.GetIndexPrice(), order.IndexPriceRequirement) - } else if !isLong && indexPrice.Cmp(indexPriceMarginRequirement) > 0 { - return sdkerrors.Wrapf(ErrOverLeveragedOrder, "indexPrice %s >= indexPriceReq %s", market.GetIndexPrice(), order.IndexPriceRequirement) - } - } - - return nil -} - -func (order *Order) ComputeAndSetOrderType() error { - orderTypeNumber := new(big.Int).SetBytes(common.FromHex(order.GetOrder().GetMakerFeeAssetData())[:common.HashLength]).Uint64() - if orderTypeNumber == 0 || orderTypeNumber == 5 { - order.OrderType = orderTypeNumber - } else { - return sdkerrors.Wrapf(ErrUnrecognizedOrderType, "Cannot recognize MakerFeeAssetData of %s", order.GetOrder().GetMakerFeeAssetData()) - } - return nil -} - -func (order *Order) ComputeIndexPriceMarginRequirement(isLong bool, market *DerivativeMarket) *big.Int { - price := BigNum(order.Order.GetMakerAssetAmount()).Int() - quantity := BigNum(order.Order.GetTakerAssetAmount()).Int() - margin := BigNum(order.Order.GetMakerFee()).Int() - pq := new(big.Int).Mul(price, quantity) - alphaQuantity := ScalePermyriad(quantity, BigNum(market.InitialMarginRatio).Int()) - num := new(big.Int) - denom := new(big.Int) - - if isLong { - num = num.Sub(margin, pq) - denom = denom.Sub(alphaQuantity, quantity) - } else { - num = num.Add(margin, pq) - denom = denom.Add(alphaQuantity, quantity) - } - - indexPriceReq := new(big.Int).Div(num, denom) - order.IndexPriceRequirement = indexPriceReq.String() - return indexPriceReq -} - -// quantity * initialMarginRatio * price -func (order *Order) ComputeContractPriceMarginRequirement(market *DerivativeMarket) *big.Int { - price := BigNum(order.Order.GetMakerAssetAmount()).Int() - quantity := BigNum(order.Order.GetTakerAssetAmount()).Int() - alphaQuantity := ScalePermyriad(quantity, BigNum(market.InitialMarginRatio).Int()) - return new(big.Int).Mul(alphaQuantity, price) -} - -// orderMarginHold = (1 + txFeePermyriad / 10000) * margin * (remainingQuantity) / order.quantity -func (o *BaseOrder) ComputeOrderMarginHold(remainingQuantity, txFeePermyriad *big.Int) (orderMarginHold *big.Int) { - margin := BigNum(o.GetMakerFee()).Int() - scaledMargin := IncrementByScaledPermyriad(margin, txFeePermyriad) - originalQuantity := BigNum(o.GetTakerAssetAmount()).Int() - - // TODO: filledAmount should always be zero with TEC since there will be no UnknownOrderHash - numerator := new(big.Int).Mul(scaledMargin, remainingQuantity) - - // originalQuantity should never be zero, however - if originalQuantity.Sign() == 0 { - return scaledMargin - } - - orderMarginHold = new(big.Int).Div(numerator, originalQuantity) - return orderMarginHold -} - -func (o *BaseOrder) IsExpired(currBlockTime time.Time) bool { - blockTime := big.NewInt(currBlockTime.Unix()) - orderExpirationTime := BigNum(o.GetExpirationTimeSeconds()).Int() - - if orderExpirationTime.Cmp(blockTime) <= 0 { - return true - } - return false -} - -// return amount * (1 + permyriad/10000) = (amount + amount * permyriad/10000) -func IncrementByScaledPermyriad(amount, permyriad *big.Int) *big.Int { - return new(big.Int).Add(amount, ScalePermyriad(amount, permyriad)) -} - -// return (amount * permyriad) / 10000 -func ScalePermyriad(amount, permyriad *big.Int) *big.Int { - PERMYRIAD_BASE := BigNum("10000").Int() - scaleFactor := new(big.Int).Mul(amount, permyriad) - return new(big.Int).Div(scaleFactor, PERMYRIAD_BASE) -} - -func ComputeSubaccountID(address string, takerFee string) common.Hash { - return common.BytesToHash(append(common.HexToAddress(address).Bytes(), common.LeftPadBytes(BigNum(takerFee).Int().Bytes(), 12)...)) -} - -// GetDirectionMarketAndSubaccountID -func (o *BaseOrder) GetDirectionMarketAndSubaccountID(shouldGetMakerSubaccount bool) (isLong bool, marketID common.Hash, subaccountID common.Hash) { - mData, tData := common.FromHex(o.GetMakerAssetData()), common.FromHex(o.GetTakerAssetData()) - - if len(mData) > common.HashLength { - mData = mData[:common.HashLength] - } - - if len(tData) > common.HashLength { - tData = tData[:common.HashLength] - } - - if bytes.Equal(tData, common.Hash{}.Bytes()) { - isLong = true - marketID = common.BytesToHash(mData) - } else { - isLong = false - marketID = common.BytesToHash(tData) - } - - var address string - - if shouldGetMakerSubaccount { - address = o.GetMakerAddress() - } else { - address = o.GetTakerAddress() - } - - subaccountID = ComputeSubaccountID(address, o.GetTakerFee()) - - return isLong, marketID, subaccountID -} - -// zo2so internal function converts model from *zeroex.SignedOrder to *SafeSignedOrder. -func zo2so(o *zeroex.SignedOrder) *SafeSignedOrder { - if o == nil { - return nil - } - return &SafeSignedOrder{ - ChainID: o.ChainID.Int64(), - ExchangeAddress: Address{o.ExchangeAddress}, - MakerAddress: Address{o.MakerAddress}, - TakerAddress: Address{o.TakerAddress}, - FeeRecipientAddress: Address{o.FeeRecipientAddress}, - SenderAddress: Address{o.SenderAddress}, - MakerAssetAmount: BigNum(o.MakerAssetAmount.String()), - TakerAssetAmount: BigNum(o.TakerAssetAmount.String()), - MakerFee: BigNum(o.MakerFee.String()), - TakerFee: BigNum(o.TakerFee.String()), - ExpirationTimeSeconds: BigNum(o.ExpirationTimeSeconds.String()), - Salt: BigNum(o.Salt.String()), - MakerAssetData: o.MakerAssetData, - TakerAssetData: o.TakerAssetData, - MakerFeeAssetData: o.MakerFeeAssetData, - TakerFeeAssetData: o.TakerFeeAssetData, - Signature: o.Signature, - } -} - -// so2zo internal function converts model from *SafeSignedOrder to *zeroex.SignedOrder. -func so2zo(o *BaseOrder) (*zeroex.SignedOrder, error) { - if o == nil { - return nil, nil - } - order := zeroex.Order{ - ChainID: big.NewInt(o.ChainId), - ExchangeAddress: common.HexToAddress(o.ExchangeAddress), - MakerAddress: common.HexToAddress(o.MakerAddress), - TakerAddress: common.HexToAddress(o.TakerAddress), - SenderAddress: common.HexToAddress(o.SenderAddress), - FeeRecipientAddress: common.HexToAddress(o.FeeRecipientAddress), - MakerAssetData: common.FromHex(o.MakerAssetData), - MakerFeeAssetData: common.FromHex(o.MakerFeeAssetData), - TakerAssetData: common.FromHex(o.TakerAssetData), - TakerFeeAssetData: common.FromHex(o.TakerFeeAssetData), - } - - if v, ok := math.ParseBig256(string(o.MakerAssetAmount)); !ok { - return nil, errors.New("makerAssetAmount parse failed") - } else { - order.MakerAssetAmount = v - } - if v, ok := math.ParseBig256(string(o.MakerFee)); !ok { - return nil, errors.New("makerFee parse failed") - } else { - order.MakerFee = v - } - if v, ok := math.ParseBig256(string(o.TakerAssetAmount)); !ok { - return nil, errors.New("takerAssetAmount parse failed") - } else { - order.TakerAssetAmount = v - } - if v, ok := math.ParseBig256(string(o.TakerFee)); !ok { - return nil, errors.New("takerFee parse failed") - } else { - order.TakerFee = v - } - if v, ok := math.ParseBig256(string(o.ExpirationTimeSeconds)); !ok { - return nil, errors.New("expirationTimeSeconds parse failed") - } else { - order.ExpirationTimeSeconds = v - } - if v, ok := math.ParseBig256(string(o.Salt)); !ok { - return nil, errors.New("salt parse failed") - } else { - order.Salt = v - } - signedOrder := &zeroex.SignedOrder{ - Order: order, - Signature: common.FromHex(o.Signature), - } - return signedOrder, nil -} diff --git a/chain/exchange/types/msgs.pb.go b/chain/exchange/types/msgs.pb.go new file mode 100644 index 00000000..7d6b0d16 --- /dev/null +++ b/chain/exchange/types/msgs.pb.go @@ -0,0 +1,3136 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/exchange/v1beta1/msgs.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgInitExchange describes a message to init the Injective Exchange contract inside the exchange keeper +type MsgInitExchange struct { + Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty" yaml:"sender"` + ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty" yaml:"exchange_address"` +} + +func (m *MsgInitExchange) Reset() { *m = MsgInitExchange{} } +func (m *MsgInitExchange) String() string { return proto.CompactTextString(m) } +func (*MsgInitExchange) ProtoMessage() {} +func (*MsgInitExchange) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{0} +} +func (m *MsgInitExchange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitExchange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitExchange.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgInitExchange) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitExchange.Merge(m, src) +} +func (m *MsgInitExchange) XXX_Size() int { + return m.Size() +} +func (m *MsgInitExchange) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitExchange.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitExchange proto.InternalMessageInfo + +// A 0x Transaction Exchange Domain +type MsgCreateSpotOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order *BaseSpotOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +} + +func (m *MsgCreateSpotOrder) Reset() { *m = MsgCreateSpotOrder{} } +func (m *MsgCreateSpotOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSpotOrder) ProtoMessage() {} +func (*MsgCreateSpotOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{1} +} +func (m *MsgCreateSpotOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSpotOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSpotOrder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSpotOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSpotOrder.Merge(m, src) +} +func (m *MsgCreateSpotOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSpotOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSpotOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSpotOrder proto.InternalMessageInfo + +// A Cosmos-SDK MsgCreateDerivativeOrder +type MsgCreateDerivativeOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +} + +func (m *MsgCreateDerivativeOrder) Reset() { *m = MsgCreateDerivativeOrder{} } +func (m *MsgCreateDerivativeOrder) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDerivativeOrder) ProtoMessage() {} +func (*MsgCreateDerivativeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{2} +} +func (m *MsgCreateDerivativeOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDerivativeOrder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDerivativeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDerivativeOrder.Merge(m, src) +} +func (m *MsgCreateDerivativeOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDerivativeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDerivativeOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDerivativeOrder proto.InternalMessageInfo + +// A Cosmos-SDK MsgCreateDerivativeOrder +type MsgSoftCancelDerivativeOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +} + +func (m *MsgSoftCancelDerivativeOrder) Reset() { *m = MsgSoftCancelDerivativeOrder{} } +func (m *MsgSoftCancelDerivativeOrder) String() string { return proto.CompactTextString(m) } +func (*MsgSoftCancelDerivativeOrder) ProtoMessage() {} +func (*MsgSoftCancelDerivativeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{3} +} +func (m *MsgSoftCancelDerivativeOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSoftCancelDerivativeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSoftCancelDerivativeOrder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSoftCancelDerivativeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSoftCancelDerivativeOrder.Merge(m, src) +} +func (m *MsgSoftCancelDerivativeOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgSoftCancelDerivativeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSoftCancelDerivativeOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSoftCancelDerivativeOrder proto.InternalMessageInfo + +// A Cosmos-SDK MsgRegisterSpotMarket +type MsgRegisterSpotMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // A name of the pair in format AAA/BBB, where AAA is base asset, BBB is quote asset. + Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` + // Address of the base asset. + BaseAsset string `protobuf:"bytes,3,opt,name=base_asset,json=baseAsset,proto3" json:"base_asset,omitempty"` + // Address of the quote asset. + QuoteAsset string `protobuf:"bytes,4,opt,name=quote_asset,json=quoteAsset,proto3" json:"quote_asset,omitempty"` + // exchange address + ExchangeAddress string `protobuf:"bytes,5,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +} + +func (m *MsgRegisterSpotMarket) Reset() { *m = MsgRegisterSpotMarket{} } +func (m *MsgRegisterSpotMarket) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterSpotMarket) ProtoMessage() {} +func (*MsgRegisterSpotMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{4} +} +func (m *MsgRegisterSpotMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterSpotMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterSpotMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterSpotMarket.Merge(m, src) +} +func (m *MsgRegisterSpotMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterSpotMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterSpotMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterSpotMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgSuspendSpotMarket +type MsgSuspendSpotMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + MakerAsset string `protobuf:"bytes,3,opt,name=maker_asset,json=makerAsset,proto3" json:"maker_asset,omitempty"` + TakerAsset string `protobuf:"bytes,4,opt,name=taker_asset,json=takerAsset,proto3" json:"taker_asset,omitempty"` +} + +func (m *MsgSuspendSpotMarket) Reset() { *m = MsgSuspendSpotMarket{} } +func (m *MsgSuspendSpotMarket) String() string { return proto.CompactTextString(m) } +func (*MsgSuspendSpotMarket) ProtoMessage() {} +func (*MsgSuspendSpotMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{5} +} +func (m *MsgSuspendSpotMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSuspendSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSuspendSpotMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSuspendSpotMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSuspendSpotMarket.Merge(m, src) +} +func (m *MsgSuspendSpotMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgSuspendSpotMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSuspendSpotMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSuspendSpotMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgResumeSpotMarket +type MsgResumeSpotMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + MakerAsset string `protobuf:"bytes,3,opt,name=maker_asset,json=makerAsset,proto3" json:"maker_asset,omitempty"` + TakerAsset string `protobuf:"bytes,4,opt,name=taker_asset,json=takerAsset,proto3" json:"taker_asset,omitempty"` +} + +func (m *MsgResumeSpotMarket) Reset() { *m = MsgResumeSpotMarket{} } +func (m *MsgResumeSpotMarket) String() string { return proto.CompactTextString(m) } +func (*MsgResumeSpotMarket) ProtoMessage() {} +func (*MsgResumeSpotMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{6} +} +func (m *MsgResumeSpotMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgResumeSpotMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgResumeSpotMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgResumeSpotMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgResumeSpotMarket.Merge(m, src) +} +func (m *MsgResumeSpotMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgResumeSpotMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgResumeSpotMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgResumeSpotMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgRegisterDerivativeMarket +type MsgRegisterDerivativeMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Market *DerivativeMarket `protobuf:"bytes,2,opt,name=market,proto3" json:"market,omitempty"` +} + +func (m *MsgRegisterDerivativeMarket) Reset() { *m = MsgRegisterDerivativeMarket{} } +func (m *MsgRegisterDerivativeMarket) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDerivativeMarket) ProtoMessage() {} +func (*MsgRegisterDerivativeMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{7} +} +func (m *MsgRegisterDerivativeMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDerivativeMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterDerivativeMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDerivativeMarket.Merge(m, src) +} +func (m *MsgRegisterDerivativeMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDerivativeMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDerivativeMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterDerivativeMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgSuspendDerivativeMarket +type MsgSuspendDerivativeMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // Unique market ID. + MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // exchange address + ExchangeAddress string `protobuf:"bytes,3,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +} + +func (m *MsgSuspendDerivativeMarket) Reset() { *m = MsgSuspendDerivativeMarket{} } +func (m *MsgSuspendDerivativeMarket) String() string { return proto.CompactTextString(m) } +func (*MsgSuspendDerivativeMarket) ProtoMessage() {} +func (*MsgSuspendDerivativeMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{8} +} +func (m *MsgSuspendDerivativeMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSuspendDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSuspendDerivativeMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSuspendDerivativeMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSuspendDerivativeMarket.Merge(m, src) +} +func (m *MsgSuspendDerivativeMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgSuspendDerivativeMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSuspendDerivativeMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSuspendDerivativeMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgResumeDerivativeMarket +type MsgResumeDerivativeMarket struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // Unique market ID. + MarketId string `protobuf:"bytes,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // exchange address + ExchangeAddress string `protobuf:"bytes,3,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` +} + +func (m *MsgResumeDerivativeMarket) Reset() { *m = MsgResumeDerivativeMarket{} } +func (m *MsgResumeDerivativeMarket) String() string { return proto.CompactTextString(m) } +func (*MsgResumeDerivativeMarket) ProtoMessage() {} +func (*MsgResumeDerivativeMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{9} +} +func (m *MsgResumeDerivativeMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgResumeDerivativeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgResumeDerivativeMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgResumeDerivativeMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgResumeDerivativeMarket.Merge(m, src) +} +func (m *MsgResumeDerivativeMarket) XXX_Size() int { + return m.Size() +} +func (m *MsgResumeDerivativeMarket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgResumeDerivativeMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgResumeDerivativeMarket proto.InternalMessageInfo + +// A Cosmos-SDK MsgExecuteDerivativeTakeOrder +type MsgExecuteDerivativeTakeOrder struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Order *BaseOrder `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` +} + +func (m *MsgExecuteDerivativeTakeOrder) Reset() { *m = MsgExecuteDerivativeTakeOrder{} } +func (m *MsgExecuteDerivativeTakeOrder) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteDerivativeTakeOrder) ProtoMessage() {} +func (*MsgExecuteDerivativeTakeOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{10} +} +func (m *MsgExecuteDerivativeTakeOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteDerivativeTakeOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteDerivativeTakeOrder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgExecuteDerivativeTakeOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteDerivativeTakeOrder.Merge(m, src) +} +func (m *MsgExecuteDerivativeTakeOrder) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteDerivativeTakeOrder) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteDerivativeTakeOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteDerivativeTakeOrder proto.InternalMessageInfo + +// A Cosmos-SDK MsgExecuteTECTransaction +type MsgExecuteTECTransaction struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + TecTransaction *SignedTransaction `protobuf:"bytes,2,opt,name=tecTransaction,proto3" json:"tecTransaction,omitempty"` +} + +func (m *MsgExecuteTECTransaction) Reset() { *m = MsgExecuteTECTransaction{} } +func (m *MsgExecuteTECTransaction) String() string { return proto.CompactTextString(m) } +func (*MsgExecuteTECTransaction) ProtoMessage() {} +func (*MsgExecuteTECTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf9e9892f30ab2a, []int{11} +} +func (m *MsgExecuteTECTransaction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecuteTECTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecuteTECTransaction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgExecuteTECTransaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecuteTECTransaction.Merge(m, src) +} +func (m *MsgExecuteTECTransaction) XXX_Size() int { + return m.Size() +} +func (m *MsgExecuteTECTransaction) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecuteTECTransaction.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecuteTECTransaction proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgInitExchange)(nil), "injective.exchange.v1beta1.MsgInitExchange") + proto.RegisterType((*MsgCreateSpotOrder)(nil), "injective.exchange.v1beta1.MsgCreateSpotOrder") + proto.RegisterType((*MsgCreateDerivativeOrder)(nil), "injective.exchange.v1beta1.MsgCreateDerivativeOrder") + proto.RegisterType((*MsgSoftCancelDerivativeOrder)(nil), "injective.exchange.v1beta1.MsgSoftCancelDerivativeOrder") + proto.RegisterType((*MsgRegisterSpotMarket)(nil), "injective.exchange.v1beta1.MsgRegisterSpotMarket") + proto.RegisterType((*MsgSuspendSpotMarket)(nil), "injective.exchange.v1beta1.MsgSuspendSpotMarket") + proto.RegisterType((*MsgResumeSpotMarket)(nil), "injective.exchange.v1beta1.MsgResumeSpotMarket") + proto.RegisterType((*MsgRegisterDerivativeMarket)(nil), "injective.exchange.v1beta1.MsgRegisterDerivativeMarket") + proto.RegisterType((*MsgSuspendDerivativeMarket)(nil), "injective.exchange.v1beta1.MsgSuspendDerivativeMarket") + proto.RegisterType((*MsgResumeDerivativeMarket)(nil), "injective.exchange.v1beta1.MsgResumeDerivativeMarket") + proto.RegisterType((*MsgExecuteDerivativeTakeOrder)(nil), "injective.exchange.v1beta1.MsgExecuteDerivativeTakeOrder") + proto.RegisterType((*MsgExecuteTECTransaction)(nil), "injective.exchange.v1beta1.MsgExecuteTECTransaction") +} + +func init() { + proto.RegisterFile("injective/exchange/v1beta1/msgs.proto", fileDescriptor_aaf9e9892f30ab2a) +} + +var fileDescriptor_aaf9e9892f30ab2a = []byte{ + // 657 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0x41, 0x4f, 0x13, 0x4f, + 0x18, 0xc6, 0x3b, 0x7f, 0xa0, 0xf9, 0xf7, 0x45, 0xc5, 0x54, 0xc4, 0x5a, 0xa4, 0x25, 0x4d, 0x48, + 0x20, 0xb1, 0xbb, 0x41, 0x6f, 0x78, 0x30, 0x14, 0x30, 0x21, 0xb1, 0x9a, 0x2c, 0x78, 0xe1, 0x42, + 0xa6, 0xbb, 0xaf, 0xdb, 0xb5, 0xec, 0x4e, 0xdd, 0x77, 0x96, 0x80, 0x37, 0x3c, 0xa9, 0x17, 0xfd, + 0x08, 0x7e, 0x0c, 0x13, 0xbf, 0x80, 0x47, 0x8e, 0x9e, 0x88, 0x81, 0x6f, 0xc0, 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da, 0xe6, 0x5e, 0x60, 0xfa, 0xc2, 0x89, 0x76, 0x90, 0xfa, 0xd7, 0xa1, 0xba, 0xa0, 0x5a, 0x79, + 0x75, 0x09, 0x3e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x40, 0x15, 0xa1, 0xb1, 0x8a, 0x07, 0x00, + 0x00, +} + +func (m *MsgInitExchange) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgInitExchange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitExchange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.ExchangeAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSpotOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSpotOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSpotOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Order != nil { + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDerivativeOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Order != nil { + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSoftCancelDerivativeOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSoftCancelDerivativeOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSoftCancelDerivativeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Order != nil { + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterSpotMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterSpotMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.ExchangeAddress))) + i-- + dAtA[i] = 0x2a + } + if len(m.QuoteAsset) > 0 { + i -= len(m.QuoteAsset) + copy(dAtA[i:], m.QuoteAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.QuoteAsset))) + i-- + dAtA[i] = 0x22 + } + if len(m.BaseAsset) > 0 { + i -= len(m.BaseAsset) + copy(dAtA[i:], m.BaseAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.BaseAsset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Ticker))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSuspendSpotMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSuspendSpotMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSuspendSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TakerAsset) > 0 { + i -= len(m.TakerAsset) + copy(dAtA[i:], m.TakerAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.TakerAsset))) + i-- + dAtA[i] = 0x22 + } + if len(m.MakerAsset) > 0 { + i -= len(m.MakerAsset) + copy(dAtA[i:], m.MakerAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.MakerAsset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgResumeSpotMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgResumeSpotMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgResumeSpotMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TakerAsset) > 0 { + i -= len(m.TakerAsset) + copy(dAtA[i:], m.TakerAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.TakerAsset))) + i-- + dAtA[i] = 0x22 + } + if len(m.MakerAsset) > 0 { + i -= len(m.MakerAsset) + copy(dAtA[i:], m.MakerAsset) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.MakerAsset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterDerivativeMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Market != nil { + { + size, err := m.Market.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSuspendDerivativeMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSuspendDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSuspendDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.ExchangeAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgResumeDerivativeMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgResumeDerivativeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgResumeDerivativeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.ExchangeAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.MarketId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecuteDerivativeTakeOrder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgExecuteDerivativeTakeOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteDerivativeTakeOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Order != nil { + { + size, err := m.Order.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecuteTECTransaction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgExecuteTECTransaction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecuteTECTransaction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TecTransaction != nil { + { + size, err := m.TecTransaction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgInitExchange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgCreateSpotOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Order != nil { + l = m.Order.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgCreateDerivativeOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Order != nil { + l = m.Order.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgSoftCancelDerivativeOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Order != nil { + l = m.Order.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgRegisterSpotMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Ticker) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.BaseAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.QuoteAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgSuspendSpotMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.MakerAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.TakerAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgResumeSpotMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.MakerAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.TakerAsset) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgRegisterDerivativeMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Market != nil { + l = m.Market.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgSuspendDerivativeMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgResumeDerivativeMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.MarketId) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.ExchangeAddress) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgExecuteDerivativeTakeOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.Order != nil { + l = m.Order.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func (m *MsgExecuteTECTransaction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.TecTransaction != nil { + l = m.TecTransaction.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + return n +} + +func sovMsgs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgs(x uint64) (n int) { + return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgInitExchange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgInitExchange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitExchange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = append(m.Sender[:0], dAtA[iNdEx:postIndex]...) + if m.Sender == nil { + m.Sender = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSpotOrder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSpotOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSpotOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Order == nil { + m.Order = &BaseSpotOrder{} + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDerivativeOrder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDerivativeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDerivativeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Order == nil { + m.Order = &BaseOrder{} + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSoftCancelDerivativeOrder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSoftCancelDerivativeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSoftCancelDerivativeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Order == nil { + m.Order = &BaseOrder{} + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterSpotMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRegisterSpotMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ticker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSuspendSpotMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSuspendSpotMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSuspendSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MakerAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TakerAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgResumeSpotMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgResumeSpotMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgResumeSpotMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MakerAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MakerAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TakerAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterDerivativeMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRegisterDerivativeMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Market == nil { + m.Market = &DerivativeMarket{} + } + if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSuspendDerivativeMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSuspendDerivativeMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSuspendDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgResumeDerivativeMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgResumeDerivativeMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgResumeDerivativeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MarketId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteDerivativeTakeOrder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecuteDerivativeTakeOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteDerivativeTakeOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Order == nil { + m.Order = &BaseOrder{} + } + if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecuteTECTransaction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecuteTECTransaction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecuteTECTransaction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TecTransaction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TecTransaction == nil { + m.TecTransaction = &SignedTransaction{} + } + if err := m.TecTransaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgs(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMsgs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMsgs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMsgs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMsgs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/exchange/types/orders.go b/chain/exchange/types/orders.go new file mode 100644 index 00000000..0a2cf96c --- /dev/null +++ b/chain/exchange/types/orders.go @@ -0,0 +1,320 @@ +package types + +import ( + "bytes" + "errors" + "math/big" + "time" + + chainsdk "github.com/InjectiveLabs/sdk-go" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + log "github.com/xlab/suplog" +) + +// SafeSignedOrder is a special signed order structure +// for including in Msgs, because it consists of primitive types. +// Avoid using raw *big.Int in Msgs. +type SafeSignedOrder struct { + // ChainID is a network identifier of the order. + ChainID int64 `json:"chainID,omitempty"` + // Exchange v3 contract address. + ExchangeAddress Address `json:"exchangeAddress,omitempty"` + // Address that created the order. + MakerAddress Address `json:"makerAddress,omitempty"` + // Address that is allowed to fill the order. If set to "0x0", any address is + // allowed to fill the order. + TakerAddress Address `json:"takerAddress,omitempty"` + // Address that will receive fees when order is filled. + FeeRecipientAddress Address `json:"feeRecipientAddress,omitempty"` + // Address that is allowed to call Exchange contract methods that affect this + // order. If set to "0x0", any address is allowed to call these methods. + SenderAddress Address `json:"senderAddress,omitempty"` + // Amount of makerAsset being offered by maker. Must be greater than 0. + MakerAssetAmount BigNum `json:"makerAssetAmount,omitempty"` + // Amount of takerAsset being bid on by maker. Must be greater than 0. + TakerAssetAmount BigNum `json:"takerAssetAmount,omitempty"` + // Amount of Fee Asset paid to feeRecipientAddress by maker when order is filled. If set to + // 0, no transfer of Fee Asset from maker to feeRecipientAddress will be attempted. + MakerFee BigNum `json:"makerFee,omitempty"` + // Amount of Fee Asset paid to feeRecipientAddress by taker when order is filled. If set to + // 0, no transfer of Fee Asset from taker to feeRecipientAddress will be attempted. + TakerFee BigNum `json:"takerFee,omitempty"` + // Timestamp in seconds at which order expires. + ExpirationTimeSeconds BigNum `json:"expirationTimeSeconds,omitempty"` + // Arbitrary number to facilitate uniqueness of the order's hash. + Salt BigNum `json:"salt,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring makerAsset. + MakerAssetData HexBytes `json:"makerAssetData,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring takerAsset. + TakerAssetData HexBytes `json:"takerAssetData,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring makerFee. + MakerFeeAssetData HexBytes `json:"makerFeeAssetData,omitempty"` + // ABIv2 encoded data that can be decoded by a specified proxy contract when + // transferring takerFee. + TakerFeeAssetData HexBytes `json:"takerFeeAssetData,omitempty"` + // Order signature. + Signature HexBytes `json:"signature,omitempty"` +} + +// PermyriadBase The scaling factor for Permyriads +var PermyriadBase = BigNum("10000").Int() + +// NewSafeSignedOrder constructs a new SafeSignedOrder from given zeroex.SignedOrder. +func NewSafeSignedOrder(o *chainsdk.SignedOrder) *SafeSignedOrder { + return zo2so(o) +} + +// ToSignedOrder returns an appropriate zeroex.SignedOrder defined by SafeSignedOrder. +func (m *BaseOrder) ToSignedOrder() *chainsdk.SignedOrder { + o, err := so2zo(m) + if err != nil { + panic(err) + } + return o +} + +func (order *Order) IsReduceOnly() bool { + return BigNum(order.GetOrder().GetMakerFee()).Int().Cmp(big.NewInt(0)) == 0 +} + +func (order *Order) DoesValidationPass( + isLong bool, + market *DerivativeMarket, + currBlockTime time.Time, +) error { + err := order.ComputeAndSetOrderType() + if err != nil { + log.Infoln("fail") + return err + } + + isOrderExpired := order.Order.IsExpired(currBlockTime) + if isOrderExpired { + return sdkerrors.Wrapf(ErrOrderExpired, "order expiration %s <= block time %d", order.GetOrder().GetExpirationTimeSeconds(), currBlockTime.Unix()) + } + if order.OrderType == 0 { + margin := BigNum(order.Order.GetMakerFee()).Int() + contractPriceMarginRequirement := order.ComputeContractPriceMarginRequirement(market) + if margin.Cmp(contractPriceMarginRequirement) < 0 { + return sdkerrors.Wrapf(ErrOverLeveragedOrder, "margin %s < contractPriceMarginRequirement %s", margin.String(), contractPriceMarginRequirement.String()) + } + + indexPriceMarginRequirement := order.ComputeIndexPriceMarginRequirement(isLong, market) + indexPrice := BigNum(market.GetIndexPrice()).Int() + + if isLong && indexPrice.Cmp(indexPriceMarginRequirement) < 0 { + return sdkerrors.Wrapf(ErrOverLeveragedOrder, "indexPrice %s <= indexPriceReq %s", market.GetIndexPrice(), order.IndexPriceRequirement) + } else if !isLong && indexPrice.Cmp(indexPriceMarginRequirement) > 0 { + return sdkerrors.Wrapf(ErrOverLeveragedOrder, "indexPrice %s >= indexPriceReq %s", market.GetIndexPrice(), order.IndexPriceRequirement) + } + } + + return nil +} + +func (order *Order) ComputeAndSetOrderType() error { + orderTypeNumber := new(big.Int).SetBytes(common.FromHex(order.GetOrder().GetMakerFeeAssetData())[:common.HashLength]).Uint64() + if orderTypeNumber == 0 || orderTypeNumber == 5 { + order.OrderType = orderTypeNumber + } else { + return sdkerrors.Wrapf(ErrUnrecognizedOrderType, "Cannot recognize MakerFeeAssetData of %s", order.GetOrder().GetMakerFeeAssetData()) + } + return nil +} + +func (order *Order) ComputeIndexPriceMarginRequirement(isLong bool, market *DerivativeMarket) *big.Int { + price := BigNum(order.Order.GetMakerAssetAmount()).Int() + quantity := BigNum(order.Order.GetTakerAssetAmount()).Int() + margin := BigNum(order.Order.GetMakerFee()).Int() + pq := new(big.Int).Mul(price, quantity) + alphaQuantity := ScalePermyriad(quantity, BigNum(market.InitialMarginRatio).Int()) + num := new(big.Int) + denom := new(big.Int) + + if isLong { + num = num.Sub(margin, pq) + denom = denom.Sub(alphaQuantity, quantity) + } else { + num = num.Add(margin, pq) + denom = denom.Add(alphaQuantity, quantity) + } + + indexPriceReq := new(big.Int).Div(num, denom) + order.IndexPriceRequirement = indexPriceReq.String() + return indexPriceReq +} + +// quantity * initialMarginRatio * price +func (order *Order) ComputeContractPriceMarginRequirement(market *DerivativeMarket) *big.Int { + price := BigNum(order.Order.GetMakerAssetAmount()).Int() + quantity := BigNum(order.Order.GetTakerAssetAmount()).Int() + alphaQuantity := ScalePermyriad(quantity, BigNum(market.InitialMarginRatio).Int()) + return new(big.Int).Mul(alphaQuantity, price) +} + +// orderMarginHold = (1 + txFeePermyriad / 10000) * assetAmount +func GetAssetAmountWithFeesApplied(assetAmount, txFeePermyriad *big.Int) (orderMarginHold *big.Int) { + return IncrementByScaledPermyriad(assetAmount, txFeePermyriad) +} + +// orderMarginHold = (1 + txFeePermyriad / 10000) * margin * (remainingQuantity) / order.quantity +func (o *BaseOrder) ComputeDerivativeOrderMarginHold(remainingQuantity, txFeePermyriad *big.Int) (orderMarginHold *big.Int) { + margin := BigNum(o.GetMakerFee()).Int() + scaledMargin := IncrementByScaledPermyriad(margin, txFeePermyriad) + originalQuantity := BigNum(o.GetTakerAssetAmount()).Int() + + // TODO: filledAmount should always be zero with TEC since there will be no UnknownOrderHash + numerator := new(big.Int).Mul(scaledMargin, remainingQuantity) + + // originalQuantity should never be zero, however + if originalQuantity.Sign() == 0 { + return scaledMargin + } + + orderMarginHold = new(big.Int).Div(numerator, originalQuantity) + return orderMarginHold +} + +func (o *BaseOrder) IsExpired(currBlockTime time.Time) bool { + blockTime := big.NewInt(currBlockTime.Unix()) + orderExpirationTime := BigNum(o.GetExpirationTimeSeconds()).Int() + + if orderExpirationTime.Cmp(blockTime) <= 0 { + return true + } + return false +} + +// return amount * (1 + permyriad/10000) = (amount + amount * permyriad/10000) +func IncrementByScaledPermyriad(amount, permyriad *big.Int) *big.Int { + return new(big.Int).Add(amount, ScalePermyriad(amount, permyriad)) +} + +// return (amount * permyriad) / 10000 +func ScalePermyriad(amount, permyriad *big.Int) *big.Int { + scaleFactor := new(big.Int).Mul(amount, permyriad) + return new(big.Int).Div(scaleFactor, PermyriadBase) +} + +func ComputeSubaccountID(address string, takerFee string) common.Hash { + return common.BytesToHash(append(common.HexToAddress(address).Bytes(), common.LeftPadBytes(BigNum(takerFee).Int().Bytes(), 12)...)) +} + +// GetDirectionMarketAndSubaccountID +func (o *BaseOrder) GetDirectionMarketAndSubaccountID(shouldGetMakerSubaccount bool) (isLong bool, marketID common.Hash, subaccountID common.Hash) { + mData, tData := common.FromHex(o.GetMakerAssetData()), common.FromHex(o.GetTakerAssetData()) + + if len(mData) > common.HashLength { + mData = mData[:common.HashLength] + } + + if len(tData) > common.HashLength { + tData = tData[:common.HashLength] + } + + if bytes.Equal(tData, common.Hash{}.Bytes()) { + isLong = true + marketID = common.BytesToHash(mData) + } else { + isLong = false + marketID = common.BytesToHash(tData) + } + + var address string + + if shouldGetMakerSubaccount { + address = o.GetMakerAddress() + } else { + address = o.GetTakerAddress() + } + + subaccountID = ComputeSubaccountID(address, o.GetTakerFee()) + + return isLong, marketID, subaccountID +} + +// zo2so internal function converts model from *zeroex.SignedOrder to *SafeSignedOrder. +func zo2so(o *chainsdk.SignedOrder) *SafeSignedOrder { + if o == nil { + return nil + } + return &SafeSignedOrder{ + ChainID: o.ChainID.Int64(), + ExchangeAddress: Address{o.ExchangeAddress}, + MakerAddress: Address{o.MakerAddress}, + TakerAddress: Address{o.TakerAddress}, + FeeRecipientAddress: Address{o.FeeRecipientAddress}, + SenderAddress: Address{o.SenderAddress}, + MakerAssetAmount: BigNum(o.MakerAssetAmount.String()), + TakerAssetAmount: BigNum(o.TakerAssetAmount.String()), + MakerFee: BigNum(o.MakerFee.String()), + TakerFee: BigNum(o.TakerFee.String()), + ExpirationTimeSeconds: BigNum(o.ExpirationTimeSeconds.String()), + Salt: BigNum(o.Salt.String()), + MakerAssetData: o.MakerAssetData, + TakerAssetData: o.TakerAssetData, + MakerFeeAssetData: o.MakerFeeAssetData, + TakerFeeAssetData: o.TakerFeeAssetData, + Signature: o.Signature, + } +} + +// so2zo internal function converts model from *SafeSignedOrder to *zeroex.SignedOrder. +func so2zo(o *BaseOrder) (*chainsdk.SignedOrder, error) { + if o == nil { + return nil, nil + } + order := chainsdk.Order{ + ChainID: big.NewInt(o.ChainId), + ExchangeAddress: common.HexToAddress(o.ExchangeAddress), + MakerAddress: common.HexToAddress(o.MakerAddress), + TakerAddress: common.HexToAddress(o.TakerAddress), + SenderAddress: common.HexToAddress(o.SenderAddress), + FeeRecipientAddress: common.HexToAddress(o.FeeRecipientAddress), + MakerAssetData: common.FromHex(o.MakerAssetData), + MakerFeeAssetData: common.FromHex(o.MakerFeeAssetData), + TakerAssetData: common.FromHex(o.TakerAssetData), + TakerFeeAssetData: common.FromHex(o.TakerFeeAssetData), + } + + if v, ok := math.ParseBig256(string(o.MakerAssetAmount)); !ok { + return nil, errors.New("makerAssetAmount parse failed") + } else { + order.MakerAssetAmount = v + } + if v, ok := math.ParseBig256(string(o.MakerFee)); !ok { + return nil, errors.New("makerFee parse failed") + } else { + order.MakerFee = v + } + if v, ok := math.ParseBig256(string(o.TakerAssetAmount)); !ok { + return nil, errors.New("takerAssetAmount parse failed") + } else { + order.TakerAssetAmount = v + } + if v, ok := math.ParseBig256(string(o.TakerFee)); !ok { + return nil, errors.New("takerFee parse failed") + } else { + order.TakerFee = v + } + if v, ok := math.ParseBig256(string(o.ExpirationTimeSeconds)); !ok { + return nil, errors.New("expirationTimeSeconds parse failed") + } else { + order.ExpirationTimeSeconds = v + } + if v, ok := math.ParseBig256(string(o.Salt)); !ok { + return nil, errors.New("salt parse failed") + } else { + order.Salt = v + } + signedOrder := &chainsdk.SignedOrder{ + Order: order, + Signature: common.FromHex(o.Signature), + } + return signedOrder, nil +} diff --git a/chain/orders/types/params.go b/chain/exchange/types/params.go similarity index 94% rename from chain/orders/types/params.go rename to chain/exchange/types/params.go index 66433618..d33f9760 100644 --- a/chain/orders/types/params.go +++ b/chain/exchange/types/params.go @@ -32,7 +32,7 @@ func (m *Params) ParamSetPairs() paramtypes.ParamSetPairs { } } -// Validate performs basic validation on orders parameters. +// Validate performs basic validation on exchange parameters. func (m Params) Validate() error { return validateExchangeParams(m.ExchangeParams) } diff --git a/chain/orders/types/params.pb.go b/chain/exchange/types/params.pb.go similarity index 82% rename from chain/orders/types/params.pb.go rename to chain/exchange/types/params.pb.go index 6d52efc0..6eb5e90b 100644 --- a/chain/orders/types/params.pb.go +++ b/chain/exchange/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/orders/v1beta1/params.proto +// source: injective/exchange/v1beta1/params.proto package types @@ -31,7 +31,7 @@ func (m *ExchangeParams) Reset() { *m = ExchangeParams{} } func (m *ExchangeParams) String() string { return proto.CompactTextString(m) } func (*ExchangeParams) ProtoMessage() {} func (*ExchangeParams) Descriptor() ([]byte, []int) { - return fileDescriptor_eb3892e0ab7ef43a, []int{0} + return fileDescriptor_5dcb14bddcf3d3c8, []int{0} } func (m *ExchangeParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +75,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_eb3892e0ab7ef43a, []int{1} + return fileDescriptor_5dcb14bddcf3d3c8, []int{1} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,33 +112,33 @@ func (m *Params) GetExchangeParams() ExchangeParams { } func init() { - proto.RegisterType((*ExchangeParams)(nil), "injective.orders.v1beta1.ExchangeParams") - proto.RegisterType((*Params)(nil), "injective.orders.v1beta1.Params") + proto.RegisterType((*ExchangeParams)(nil), "injective.exchange.v1beta1.ExchangeParams") + proto.RegisterType((*Params)(nil), "injective.exchange.v1beta1.Params") } func init() { - proto.RegisterFile("injective/orders/v1beta1/params.proto", fileDescriptor_eb3892e0ab7ef43a) + proto.RegisterFile("injective/exchange/v1beta1/params.proto", fileDescriptor_5dcb14bddcf3d3c8) } -var fileDescriptor_eb3892e0ab7ef43a = []byte{ - // 261 bytes of a gzipped FileDescriptorProto -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, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, - 0x44, 0xf9, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x7b, 0xc2, 0xec, - 0xf0, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0xdb, 0xa8, 0x9b, 0x9c, 0x5f, 0x94, 0x8a, 0xcc, 0xcd, 0x48, - 0xcc, 0xcc, 0xd3, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0x86, 0x85, 0x71, 0x49, 0x65, 0x41, - 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xac, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x71, 0x26, - 0xb3, 0x84, 0x01, 0x00, 0x00, +var fileDescriptor_5dcb14bddcf3d3c8 = []byte{ + // 257 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0xad, 0x48, 0xce, 0x48, 0xcc, 0x4b, 0x4f, 0xd5, 0x2f, + 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x82, 0x2b, 0xd4, 0x83, 0x29, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd3, 0x07, 0xb1, 0x20, 0x3a, 0x94, 0x22, 0xb8, 0xf8, 0x5c, 0xa1, + 0x2a, 0x03, 0xc0, 0x26, 0x09, 0xb9, 0x71, 0x09, 0xc0, 0xf4, 0xc6, 0x27, 0xa6, 0xa4, 0x14, 0xa5, + 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x7f, 0xba, 0x27, 0x2f, 0x5e, 0x99, + 0x98, 0x9b, 0x63, 0xa5, 0x84, 0xae, 0x42, 0x29, 0x88, 0x1f, 0x26, 0xe4, 0x08, 0x15, 0x49, 0xe6, + 0x62, 0x83, 0x9a, 0x18, 0xc9, 0x05, 0x97, 0x8c, 0x87, 0x38, 0x17, 0x6c, 0x20, 0xb7, 0x91, 0x96, + 0x1e, 0x6e, 0xf7, 0xea, 0xa1, 0x3a, 0xcb, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xbe, 0x54, + 0x54, 0xd1, 0x8c, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, + 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xf2, 0x4b, 0xcf, + 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xf7, 0x84, 0xd9, 0xe2, 0x93, 0x98, 0x54, + 0xac, 0x0f, 0xb7, 0x53, 0x37, 0x39, 0xbf, 0x28, 0x15, 0x99, 0x9b, 0x91, 0x98, 0x99, 0xa7, 0x9f, + 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0x5a, 0x8c, 0x08, 0xe9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0x70, 0x78, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x6e, 0xd8, 0xd4, 0x8c, 0x01, 0x00, + 0x00, } func (m *ExchangeParams) Marshal() (dAtA []byte, err error) { @@ -312,10 +312,7 @@ func (m *ExchangeParams) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthParams } if (iNdEx + skippy) > l { @@ -398,10 +395,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthParams } if (iNdEx + skippy) > l { diff --git a/chain/orders/types/paramset.go b/chain/exchange/types/paramset.go similarity index 100% rename from chain/orders/types/paramset.go rename to chain/exchange/types/paramset.go diff --git a/chain/orders/types/proposal.go b/chain/exchange/types/proposal.go similarity index 99% rename from chain/orders/types/proposal.go rename to chain/exchange/types/proposal.go index 12e91aaf..db431779 100644 --- a/chain/orders/types/proposal.go +++ b/chain/exchange/types/proposal.go @@ -2,6 +2,7 @@ package types import ( "fmt" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ethereum/go-ethereum/common" ) diff --git a/chain/orders/types/proposal.pb.go b/chain/exchange/types/proposal.pb.go similarity index 83% rename from chain/orders/types/proposal.pb.go rename to chain/exchange/types/proposal.pb.go index 8cc4ded3..f4b26a0d 100644 --- a/chain/orders/types/proposal.pb.go +++ b/chain/exchange/types/proposal.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/orders/v1beta1/proposal.proto +// source: injective/exchange/v1beta1/proposal.proto package types @@ -34,7 +34,7 @@ func (m *RegisterExchangeProposal) Reset() { *m = RegisterExchangePropos func (m *RegisterExchangeProposal) String() string { return proto.CompactTextString(m) } func (*RegisterExchangeProposal) ProtoMessage() {} func (*RegisterExchangeProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_1d5a86cb9a4fedc5, []int{0} + return fileDescriptor_32e9ec9b6b22477c, []int{0} } func (m *RegisterExchangeProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -85,33 +85,33 @@ func (m *RegisterExchangeProposal) GetExchangeAddress() string { } func init() { - proto.RegisterType((*RegisterExchangeProposal)(nil), "injective.orders.v1beta1.RegisterExchangeProposal") + proto.RegisterType((*RegisterExchangeProposal)(nil), "injective.exchange.v1beta1.RegisterExchangeProposal") } func init() { - proto.RegisterFile("injective/orders/v1beta1/proposal.proto", fileDescriptor_1d5a86cb9a4fedc5) + proto.RegisterFile("injective/exchange/v1beta1/proposal.proto", fileDescriptor_32e9ec9b6b22477c) } -var fileDescriptor_1d5a86cb9a4fedc5 = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0xcc, 0xcb, 0x4a, - 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0xcf, 0x2f, 0x4a, 0x49, 0x2d, 0x2a, 0xd6, 0x2f, 0x33, 0x4c, - 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x80, 0x2b, 0xd4, 0x83, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd2, 0x07, 0xb1, 0x20, 0xea, 0x95, 0x16, 0x30, 0x72, 0x49, 0x04, - 0xa5, 0xa6, 0x67, 0x16, 0x97, 0xa4, 0x16, 0xb9, 0x56, 0x24, 0x67, 0x24, 0xe6, 0xa5, 0xa7, 0x06, - 0x40, 0x8d, 0x14, 0x12, 0xe1, 0x62, 0x2d, 0xc9, 0x2c, 0xc9, 0x49, 0x95, 0x60, 0x54, 0x60, 0xd4, - 0xe0, 0x0c, 0x82, 0x70, 0x84, 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, - 0x32, 0xf3, 0xf3, 0x24, 0x98, 0xc0, 0x72, 0xc8, 0x42, 0x42, 0x6e, 0x5c, 0x02, 0xa9, 0x50, 0xb3, - 0xe2, 0x13, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x25, 0x98, 0x41, 0xca, 0x9c, 0xa4, 0x3f, 0xdd, - 0x93, 0x17, 0xaf, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x42, 0x57, 0xa1, 0x14, 0xc4, 0x0f, 0x13, 0x72, - 0x84, 0x88, 0x58, 0xb1, 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0x94, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, - 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, - 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x3e, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, - 0xfa, 0x9e, 0x30, 0x7f, 0xfb, 0x24, 0x26, 0x15, 0xeb, 0xc3, 0x43, 0x41, 0x37, 0x39, 0xbf, 0x28, - 0x15, 0x99, 0x9b, 0x91, 0x98, 0x99, 0xa7, 0x9f, 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0x5a, 0x0c, 0x0b, - 0xcb, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x88, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x8c, 0x5c, 0xa0, 0x49, 0x6c, 0x01, 0x00, 0x00, +var fileDescriptor_32e9ec9b6b22477c = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcc, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0xad, 0x48, 0xce, 0x48, 0xcc, 0x4b, 0x4f, 0xd5, 0x2f, + 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x82, 0x2b, 0xd5, 0x83, 0x29, 0xd5, 0x83, 0x2a, 0x95, + 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd3, 0x07, 0xb1, 0x20, 0x3a, 0x94, 0x16, 0x30, 0x72, + 0x49, 0x04, 0xa5, 0xa6, 0x67, 0x16, 0x97, 0xa4, 0x16, 0xb9, 0x42, 0xb5, 0x04, 0x40, 0x0d, 0x15, + 0x12, 0xe1, 0x62, 0x2d, 0xc9, 0x2c, 0xc9, 0x49, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, + 0x70, 0x84, 0x14, 0xb8, 0xb8, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, + 0x24, 0x98, 0xc0, 0x72, 0xc8, 0x42, 0x42, 0x6e, 0x5c, 0x02, 0x30, 0xeb, 0xe3, 0x13, 0x53, 0x52, + 0x8a, 0x52, 0x8b, 0x8b, 0x25, 0x98, 0x41, 0xca, 0x9c, 0xa4, 0x3f, 0xdd, 0x93, 0x17, 0xaf, 0x4c, + 0xcc, 0xcd, 0xb1, 0x52, 0x42, 0x57, 0xa1, 0x14, 0xc4, 0x0f, 0x13, 0x72, 0x84, 0x88, 0x58, 0xb1, + 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0x94, 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, + 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, + 0x51, 0x7e, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x9e, 0x30, 0x9f, + 0xfb, 0x24, 0x26, 0x15, 0xeb, 0xc3, 0xc3, 0x41, 0x37, 0x39, 0xbf, 0x28, 0x15, 0x99, 0x9b, 0x91, + 0x98, 0x99, 0xa7, 0x9f, 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0x5a, 0x8c, 0x08, 0xcf, 0x92, 0xca, 0x82, + 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x98, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x5f, 0x99, + 0x63, 0x72, 0x01, 0x00, 0x00, } func (this *RegisterExchangeProposal) Equal(that interface{}) bool { @@ -357,10 +357,7 @@ func (m *RegisterExchangeProposal) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthProposal } if (iNdEx + skippy) > l { diff --git a/chain/orders/types/querier.go b/chain/exchange/types/querier.go similarity index 100% rename from chain/orders/types/querier.go rename to chain/exchange/types/querier.go diff --git a/chain/orders/types/query.pb.go b/chain/exchange/types/query.pb.go similarity index 87% rename from chain/orders/types/query.pb.go rename to chain/exchange/types/query.pb.go index f087de6a..6325568e 100644 --- a/chain/orders/types/query.pb.go +++ b/chain/exchange/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: injective/orders/v1beta1/query.proto +// source: injective/exchange/v1beta1/query.proto package types @@ -37,7 +37,7 @@ func (m *QueryExchangeParamsRequest) Reset() { *m = QueryExchangeParamsR func (m *QueryExchangeParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryExchangeParamsRequest) ProtoMessage() {} func (*QueryExchangeParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{0} + return fileDescriptor_523db28b8af54781, []int{0} } func (m *QueryExchangeParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +75,7 @@ func (m *QueryExchangeParamsResponse) Reset() { *m = QueryExchangeParams func (m *QueryExchangeParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryExchangeParamsResponse) ProtoMessage() {} func (*QueryExchangeParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{1} + return fileDescriptor_523db28b8af54781, []int{1} } func (m *QueryExchangeParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,7 +134,7 @@ func (m *QueryDerivativeOrdersQuoteRequest) Reset() { *m = QueryDerivati func (m *QueryDerivativeOrdersQuoteRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersQuoteRequest) ProtoMessage() {} func (*QueryDerivativeOrdersQuoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{2} + return fileDescriptor_523db28b8af54781, []int{2} } func (m *QueryDerivativeOrdersQuoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,7 +216,7 @@ func (m *QueryDerivativeOrdersQuoteResponse) Reset() { *m = QueryDerivat func (m *QueryDerivativeOrdersQuoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersQuoteResponse) ProtoMessage() {} func (*QueryDerivativeOrdersQuoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{3} + return fileDescriptor_523db28b8af54781, []int{3} } func (m *QueryDerivativeOrdersQuoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -264,7 +264,7 @@ func (m *QueryDerivativeOrdersQuoteBatchRequest) Reset() { func (m *QueryDerivativeOrdersQuoteBatchRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersQuoteBatchRequest) ProtoMessage() {} func (*QueryDerivativeOrdersQuoteBatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{4} + return fileDescriptor_523db28b8af54781, []int{4} } func (m *QueryDerivativeOrdersQuoteBatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +313,7 @@ func (m *QueryDerivativeOrdersQuoteBatchResponse) Reset() { func (m *QueryDerivativeOrdersQuoteBatchResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersQuoteBatchResponse) ProtoMessage() {} func (*QueryDerivativeOrdersQuoteBatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{5} + return fileDescriptor_523db28b8af54781, []int{5} } func (m *QueryDerivativeOrdersQuoteBatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -363,7 +363,7 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) String() str } func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) ProtoMessage() {} func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{6} + return fileDescriptor_523db28b8af54781, []int{6} } func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -414,7 +414,7 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) String() st } func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) ProtoMessage() {} func (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{7} + return fileDescriptor_523db28b8af54781, []int{7} } func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +464,7 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) String() string { } func (*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) ProtoMessage() {} func (*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{8} + return fileDescriptor_523db28b8af54781, []int{8} } func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -515,7 +515,7 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) String() string } func (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) ProtoMessage() {} func (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{9} + return fileDescriptor_523db28b8af54781, []int{9} } func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -568,7 +568,7 @@ func (m *QuerySubaccountMarginHoldRequest) Reset() { *m = QuerySubaccoun func (m *QuerySubaccountMarginHoldRequest) String() string { return proto.CompactTextString(m) } func (*QuerySubaccountMarginHoldRequest) ProtoMessage() {} func (*QuerySubaccountMarginHoldRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{10} + return fileDescriptor_523db28b8af54781, []int{10} } func (m *QuerySubaccountMarginHoldRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -636,7 +636,7 @@ func (m *QuerySubaccountMarginHoldResponse) Reset() { *m = QuerySubaccou func (m *QuerySubaccountMarginHoldResponse) String() string { return proto.CompactTextString(m) } func (*QuerySubaccountMarginHoldResponse) ProtoMessage() {} func (*QuerySubaccountMarginHoldResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{11} + return fileDescriptor_523db28b8af54781, []int{11} } func (m *QuerySubaccountMarginHoldResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -683,7 +683,7 @@ func (m *QueryDerivativeOrderbookRequest) Reset() { *m = QueryDerivative func (m *QueryDerivativeOrderbookRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrderbookRequest) ProtoMessage() {} func (*QueryDerivativeOrderbookRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{12} + return fileDescriptor_523db28b8af54781, []int{12} } func (m *QueryDerivativeOrderbookRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,7 +732,7 @@ func (m *QueryDerivativeOrderbookResponse) Reset() { *m = QueryDerivativ func (m *QueryDerivativeOrderbookResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrderbookResponse) ProtoMessage() {} func (*QueryDerivativeOrderbookResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{13} + return fileDescriptor_523db28b8af54781, []int{13} } func (m *QueryDerivativeOrderbookResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -791,7 +791,7 @@ func (m *QueryMarginInfoRequest) Reset() { *m = QueryMarginInfoRequest{} func (m *QueryMarginInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryMarginInfoRequest) ProtoMessage() {} func (*QueryMarginInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{14} + return fileDescriptor_523db28b8af54781, []int{14} } func (m *QueryMarginInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -865,7 +865,7 @@ func (m *QueryMarginInfoResponse) Reset() { *m = QueryMarginInfoResponse func (m *QueryMarginInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryMarginInfoResponse) ProtoMessage() {} func (*QueryMarginInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{15} + return fileDescriptor_523db28b8af54781, []int{15} } func (m *QueryMarginInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -917,7 +917,7 @@ func (m *QueryPositionInfoRequest) Reset() { *m = QueryPositionInfoReque func (m *QueryPositionInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryPositionInfoRequest) ProtoMessage() {} func (*QueryPositionInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{16} + return fileDescriptor_523db28b8af54781, []int{16} } func (m *QueryPositionInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -991,7 +991,7 @@ func (m *QueryPositionInfoResponse) Reset() { *m = QueryPositionInfoResp func (m *QueryPositionInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryPositionInfoResponse) ProtoMessage() {} func (*QueryPositionInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{17} + return fileDescriptor_523db28b8af54781, []int{17} } func (m *QueryPositionInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1040,7 +1040,7 @@ func (m *QueryTraderSubaccountsInfoRequest) Reset() { *m = QueryTraderSu func (m *QueryTraderSubaccountsInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryTraderSubaccountsInfoRequest) ProtoMessage() {} func (*QueryTraderSubaccountsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{18} + return fileDescriptor_523db28b8af54781, []int{18} } func (m *QueryTraderSubaccountsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1093,7 +1093,7 @@ func (m *QueryTraderSubaccountsInfoResponse) Reset() { *m = QueryTraderS func (m *QueryTraderSubaccountsInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryTraderSubaccountsInfoResponse) ProtoMessage() {} func (*QueryTraderSubaccountsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{19} + return fileDescriptor_523db28b8af54781, []int{19} } func (m *QueryTraderSubaccountsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1139,7 +1139,7 @@ func (m *QueryDerivativeMarketsRequest) Reset() { *m = QueryDerivativeMa func (m *QueryDerivativeMarketsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeMarketsRequest) ProtoMessage() {} func (*QueryDerivativeMarketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{20} + return fileDescriptor_523db28b8af54781, []int{20} } func (m *QueryDerivativeMarketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1186,7 +1186,7 @@ func (m *QueryDerivativeMarketsResponse) Reset() { *m = QueryDerivativeM func (m *QueryDerivativeMarketsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeMarketsResponse) ProtoMessage() {} func (*QueryDerivativeMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{21} + return fileDescriptor_523db28b8af54781, []int{21} } func (m *QueryDerivativeMarketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1233,7 +1233,7 @@ func (m *QueryUnderMarginedAccountsRequest) Reset() { *m = QueryUnderMar func (m *QueryUnderMarginedAccountsRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnderMarginedAccountsRequest) ProtoMessage() {} func (*QueryUnderMarginedAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{22} + return fileDescriptor_523db28b8af54781, []int{22} } func (m *QueryUnderMarginedAccountsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1287,7 +1287,7 @@ func (m *QueryUnderMarginedAccountsResponse) Reset() { *m = QueryUnderMa func (m *QueryUnderMarginedAccountsResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnderMarginedAccountsResponse) ProtoMessage() {} func (*QueryUnderMarginedAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{23} + return fileDescriptor_523db28b8af54781, []int{23} } func (m *QueryUnderMarginedAccountsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1342,7 +1342,7 @@ func (m *UnderMarginedAccount) Reset() { *m = UnderMarginedAccount{} } func (m *UnderMarginedAccount) String() string { return proto.CompactTextString(m) } func (*UnderMarginedAccount) ProtoMessage() {} func (*UnderMarginedAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{24} + return fileDescriptor_523db28b8af54781, []int{24} } func (m *UnderMarginedAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1498,7 +1498,7 @@ func (m *OrderFilters) Reset() { *m = OrderFilters{} } func (m *OrderFilters) String() string { return proto.CompactTextString(m) } func (*OrderFilters) ProtoMessage() {} func (*OrderFilters) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{25} + return fileDescriptor_523db28b8af54781, []int{25} } func (m *OrderFilters) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1718,7 +1718,7 @@ func (m *QueryDerivativeOrdersRequest) Reset() { *m = QueryDerivativeOrd func (m *QueryDerivativeOrdersRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersRequest) ProtoMessage() {} func (*QueryDerivativeOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{26} + return fileDescriptor_523db28b8af54781, []int{26} } func (m *QueryDerivativeOrdersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1792,7 +1792,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersRequest) String() string { } func (*QuerySubaccountMarketDerivativeOrdersRequest) ProtoMessage() {} func (*QuerySubaccountMarketDerivativeOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{27} + return fileDescriptor_523db28b8af54781, []int{27} } func (m *QuerySubaccountMarketDerivativeOrdersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1863,7 +1863,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersResponse) String() string { } func (*QuerySubaccountMarketDerivativeOrdersResponse) ProtoMessage() {} func (*QuerySubaccountMarketDerivativeOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{28} + return fileDescriptor_523db28b8af54781, []int{28} } func (m *QuerySubaccountMarketDerivativeOrdersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1916,7 +1916,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) String() string { } func (*QuerySubaccountMarketDerivativeOrdersBatchRequest) ProtoMessage() {} func (*QuerySubaccountMarketDerivativeOrdersBatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{29} + return fileDescriptor_523db28b8af54781, []int{29} } func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1987,7 +1987,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) String() string { } func (*QuerySubaccountMarketDerivativeOrdersBatchResponse) ProtoMessage() {} func (*QuerySubaccountMarketDerivativeOrdersBatchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{30} + return fileDescriptor_523db28b8af54781, []int{30} } func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2039,7 +2039,7 @@ func (m *QuerySpotOrdersRequest) Reset() { *m = QuerySpotOrdersRequest{} func (m *QuerySpotOrdersRequest) String() string { return proto.CompactTextString(m) } func (*QuerySpotOrdersRequest) ProtoMessage() {} func (*QuerySpotOrdersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{31} + return fileDescriptor_523db28b8af54781, []int{31} } func (m *QuerySpotOrdersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2107,7 +2107,7 @@ func (m *QuerySpotOrdersResponse) Reset() { *m = QuerySpotOrdersResponse func (m *QuerySpotOrdersResponse) String() string { return proto.CompactTextString(m) } func (*QuerySpotOrdersResponse) ProtoMessage() {} func (*QuerySpotOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{32} + return fileDescriptor_523db28b8af54781, []int{32} } func (m *QuerySpotOrdersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2143,33 +2143,28 @@ func (m *QuerySpotOrdersResponse) GetRecords() []*Order { return nil } -// QueryTradePairRequest defines the request type for -// Query/TradePair RPC method. -type QueryTradePairRequest struct { - // Specify name of the trade pair. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Most effective way is to specify hash of the trade pair. - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerAsset. - MakerAssetData string `protobuf:"bytes,3,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerAsset. - TakerAssetData string `protobuf:"bytes,4,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` -} - -func (m *QueryTradePairRequest) Reset() { *m = QueryTradePairRequest{} } -func (m *QueryTradePairRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTradePairRequest) ProtoMessage() {} -func (*QueryTradePairRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{33} -} -func (m *QueryTradePairRequest) XXX_Unmarshal(b []byte) error { +// QuerySpotMarketRequest defines the request type for +// Query/SpotMarket RPC method. +type QuerySpotMarketRequest struct { + Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` + ExchangeAddress string `protobuf:"bytes,2,opt,name=exchange_address,json=exchangeAddress,proto3" json:"exchange_address,omitempty"` + MarketId string `protobuf:"bytes,3,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + BaseAsset string `protobuf:"bytes,4,opt,name=base_asset,json=baseAsset,proto3" json:"base_asset,omitempty"` + QuoteAsset string `protobuf:"bytes,5,opt,name=quote_asset,json=quoteAsset,proto3" json:"quote_asset,omitempty"` +} + +func (m *QuerySpotMarketRequest) Reset() { *m = QuerySpotMarketRequest{} } +func (m *QuerySpotMarketRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpotMarketRequest) ProtoMessage() {} +func (*QuerySpotMarketRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_523db28b8af54781, []int{33} +} +func (m *QuerySpotMarketRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryTradePairRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryTradePairRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2179,76 +2174,71 @@ func (m *QueryTradePairRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *QueryTradePairRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTradePairRequest.Merge(m, src) +func (m *QuerySpotMarketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketRequest.Merge(m, src) } -func (m *QueryTradePairRequest) XXX_Size() int { +func (m *QuerySpotMarketRequest) XXX_Size() int { return m.Size() } -func (m *QueryTradePairRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTradePairRequest.DiscardUnknown(m) +func (m *QuerySpotMarketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryTradePairRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketRequest proto.InternalMessageInfo -func (m *QueryTradePairRequest) GetName() string { +func (m *QuerySpotMarketRequest) GetTicker() string { if m != nil { - return m.Name + return m.Ticker } return "" } -func (m *QueryTradePairRequest) GetHash() string { +func (m *QuerySpotMarketRequest) GetExchangeAddress() string { if m != nil { - return m.Hash + return m.ExchangeAddress } return "" } -func (m *QueryTradePairRequest) GetMakerAssetData() string { +func (m *QuerySpotMarketRequest) GetMarketId() string { if m != nil { - return m.MakerAssetData + return m.MarketId } return "" } -func (m *QueryTradePairRequest) GetTakerAssetData() string { +func (m *QuerySpotMarketRequest) GetBaseAsset() string { if m != nil { - return m.TakerAssetData + return m.BaseAsset } return "" } -// QueryTradePairResponse defines the request type for -// Query/TradePair RPC method. -type QueryTradePairResponse struct { - // A name of the pair in format AAA/BBB, where AAA - maker's asset, BBB - - // taker's asset. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring makerAsset. - MakerAssetData string `protobuf:"bytes,2,opt,name=maker_asset_data,json=makerAssetData,proto3" json:"maker_asset_data,omitempty"` - // ABIv2 encoded data that can be decoded by a specified proxy contract when - // transferring takerAsset. - TakerAssetData string `protobuf:"bytes,3,opt,name=taker_asset_data,json=takerAssetData,proto3" json:"taker_asset_data,omitempty"` - // Hash of both asset data, to identify the trading pair in store. - Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - // If false, then the pair is suspended and trades cannot be made. - Enabled bool `protobuf:"varint,5,opt,name=enabled,proto3" json:"enabled,omitempty"` -} - -func (m *QueryTradePairResponse) Reset() { *m = QueryTradePairResponse{} } -func (m *QueryTradePairResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTradePairResponse) ProtoMessage() {} -func (*QueryTradePairResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{34} -} -func (m *QueryTradePairResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketRequest) GetQuoteAsset() string { + if m != nil { + return m.QuoteAsset + } + return "" +} + +// QuerySpotMarketResponse defines the request type for +// Query/SpotMarket RPC method. +type QuerySpotMarketResponse struct { + Market *SpotMarket `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` +} + +func (m *QuerySpotMarketResponse) Reset() { *m = QuerySpotMarketResponse{} } +func (m *QuerySpotMarketResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpotMarketResponse) ProtoMessage() {} +func (*QuerySpotMarketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_523db28b8af54781, []int{34} +} +func (m *QuerySpotMarketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryTradePairResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryTradePairResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2258,51 +2248,23 @@ func (m *QueryTradePairResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryTradePairResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTradePairResponse.Merge(m, src) +func (m *QuerySpotMarketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketResponse.Merge(m, src) } -func (m *QueryTradePairResponse) XXX_Size() int { +func (m *QuerySpotMarketResponse) XXX_Size() int { return m.Size() } -func (m *QueryTradePairResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTradePairResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTradePairResponse proto.InternalMessageInfo - -func (m *QueryTradePairResponse) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryTradePairResponse) GetMakerAssetData() string { - if m != nil { - return m.MakerAssetData - } - return "" +func (m *QuerySpotMarketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketResponse.DiscardUnknown(m) } -func (m *QueryTradePairResponse) GetTakerAssetData() string { - if m != nil { - return m.TakerAssetData - } - return "" -} +var xxx_messageInfo_QuerySpotMarketResponse proto.InternalMessageInfo -func (m *QueryTradePairResponse) GetHash() string { +func (m *QuerySpotMarketResponse) GetMarket() *SpotMarket { if m != nil { - return m.Hash - } - return "" -} - -func (m *QueryTradePairResponse) GetEnabled() bool { - if m != nil { - return m.Enabled + return m.Market } - return false + return nil } // QueryDerivativeMarketRequest defines the request type for @@ -2316,7 +2278,7 @@ func (m *QueryDerivativeMarketRequest) Reset() { *m = QueryDerivativeMar func (m *QueryDerivativeMarketRequest) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeMarketRequest) ProtoMessage() {} func (*QueryDerivativeMarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{35} + return fileDescriptor_523db28b8af54781, []int{35} } func (m *QueryDerivativeMarketRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2369,7 +2331,7 @@ func (m *QueryDerivativeMarketResponse) Reset() { *m = QueryDerivativeMa func (m *QueryDerivativeMarketResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeMarketResponse) ProtoMessage() {} func (*QueryDerivativeMarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{36} + return fileDescriptor_523db28b8af54781, []int{36} } func (m *QueryDerivativeMarketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2405,23 +2367,23 @@ func (m *QueryDerivativeMarketResponse) GetMarket() *DerivativeMarket { return nil } -// QueryTradePairsRequest defines the request type for -// Query/TradePairs RPC method. -type QueryTradePairsRequest struct { +// QuerySpotMarketsRequest defines the request type for +// Query/SpotMarkets RPC method. +type QuerySpotMarketsRequest struct { } -func (m *QueryTradePairsRequest) Reset() { *m = QueryTradePairsRequest{} } -func (m *QueryTradePairsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTradePairsRequest) ProtoMessage() {} -func (*QueryTradePairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{37} +func (m *QuerySpotMarketsRequest) Reset() { *m = QuerySpotMarketsRequest{} } +func (m *QuerySpotMarketsRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpotMarketsRequest) ProtoMessage() {} +func (*QuerySpotMarketsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_523db28b8af54781, []int{37} } -func (m *QueryTradePairsRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryTradePairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryTradePairsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2431,37 +2393,37 @@ func (m *QueryTradePairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryTradePairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTradePairsRequest.Merge(m, src) +func (m *QuerySpotMarketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketsRequest.Merge(m, src) } -func (m *QueryTradePairsRequest) XXX_Size() int { +func (m *QuerySpotMarketsRequest) XXX_Size() int { return m.Size() } -func (m *QueryTradePairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTradePairsRequest.DiscardUnknown(m) +func (m *QuerySpotMarketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryTradePairsRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketsRequest proto.InternalMessageInfo -// QueryTradePairsResponse defines the response type for -// Query/TradePairs RPC method. -type QueryTradePairsResponse struct { +// QuerySpotMarketsResponse defines the response type for +// Query/SpotMarkets RPC method. +type QuerySpotMarketsResponse struct { // Array of found trade pairs - Records []*TradePair `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` + Records []*SpotMarket `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` } -func (m *QueryTradePairsResponse) Reset() { *m = QueryTradePairsResponse{} } -func (m *QueryTradePairsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTradePairsResponse) ProtoMessage() {} -func (*QueryTradePairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{38} +func (m *QuerySpotMarketsResponse) Reset() { *m = QuerySpotMarketsResponse{} } +func (m *QuerySpotMarketsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpotMarketsResponse) ProtoMessage() {} +func (*QuerySpotMarketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_523db28b8af54781, []int{38} } -func (m *QueryTradePairsResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySpotMarketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryTradePairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpotMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryTradePairsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpotMarketsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2471,19 +2433,19 @@ func (m *QueryTradePairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryTradePairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTradePairsResponse.Merge(m, src) +func (m *QuerySpotMarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpotMarketsResponse.Merge(m, src) } -func (m *QueryTradePairsResponse) XXX_Size() int { +func (m *QuerySpotMarketsResponse) XXX_Size() int { return m.Size() } -func (m *QueryTradePairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTradePairsResponse.DiscardUnknown(m) +func (m *QuerySpotMarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpotMarketsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryTradePairsResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySpotMarketsResponse proto.InternalMessageInfo -func (m *QueryTradePairsResponse) GetRecords() []*TradePair { +func (m *QuerySpotMarketsResponse) GetRecords() []*SpotMarket { if m != nil { return m.Records } @@ -2501,7 +2463,7 @@ func (m *QueryDerivativeOrdersResponse) Reset() { *m = QueryDerivativeOr func (m *QueryDerivativeOrdersResponse) String() string { return proto.CompactTextString(m) } func (*QueryDerivativeOrdersResponse) ProtoMessage() {} func (*QueryDerivativeOrdersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d11505616d5f0a14, []int{39} + return fileDescriptor_523db28b8af54781, []int{39} } func (m *QueryDerivativeOrdersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2538,207 +2500,206 @@ func (m *QueryDerivativeOrdersResponse) GetRecords() []*Order { } func init() { - proto.RegisterType((*QueryExchangeParamsRequest)(nil), "injective.orders.v1beta1.QueryExchangeParamsRequest") - proto.RegisterType((*QueryExchangeParamsResponse)(nil), "injective.orders.v1beta1.QueryExchangeParamsResponse") - proto.RegisterType((*QueryDerivativeOrdersQuoteRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersQuoteRequest") - proto.RegisterType((*QueryDerivativeOrdersQuoteResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersQuoteResponse") - proto.RegisterType((*QueryDerivativeOrdersQuoteBatchRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersQuoteBatchRequest") - proto.RegisterType((*QueryDerivativeOrdersQuoteBatchResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersQuoteBatchResponse") - proto.RegisterType((*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest") - proto.RegisterType((*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse") - proto.RegisterType((*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookDepthAvgWeightedPriceRequest") - proto.RegisterType((*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookDepthAvgWeightedPriceResponse") - proto.RegisterType((*QuerySubaccountMarginHoldRequest)(nil), "injective.orders.v1beta1.QuerySubaccountMarginHoldRequest") - proto.RegisterType((*QuerySubaccountMarginHoldResponse)(nil), "injective.orders.v1beta1.QuerySubaccountMarginHoldResponse") - proto.RegisterType((*QueryDerivativeOrderbookRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookRequest") - proto.RegisterType((*QueryDerivativeOrderbookResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrderbookResponse") - proto.RegisterType((*QueryMarginInfoRequest)(nil), "injective.orders.v1beta1.QueryMarginInfoRequest") - proto.RegisterType((*QueryMarginInfoResponse)(nil), "injective.orders.v1beta1.QueryMarginInfoResponse") - proto.RegisterType((*QueryPositionInfoRequest)(nil), "injective.orders.v1beta1.QueryPositionInfoRequest") - proto.RegisterType((*QueryPositionInfoResponse)(nil), "injective.orders.v1beta1.QueryPositionInfoResponse") - proto.RegisterType((*QueryTraderSubaccountsInfoRequest)(nil), "injective.orders.v1beta1.QueryTraderSubaccountsInfoRequest") - proto.RegisterType((*QueryTraderSubaccountsInfoResponse)(nil), "injective.orders.v1beta1.QueryTraderSubaccountsInfoResponse") - proto.RegisterType((*QueryDerivativeMarketsRequest)(nil), "injective.orders.v1beta1.QueryDerivativeMarketsRequest") - proto.RegisterType((*QueryDerivativeMarketsResponse)(nil), "injective.orders.v1beta1.QueryDerivativeMarketsResponse") - proto.RegisterType((*QueryUnderMarginedAccountsRequest)(nil), "injective.orders.v1beta1.QueryUnderMarginedAccountsRequest") - proto.RegisterType((*QueryUnderMarginedAccountsResponse)(nil), "injective.orders.v1beta1.QueryUnderMarginedAccountsResponse") - proto.RegisterType((*UnderMarginedAccount)(nil), "injective.orders.v1beta1.UnderMarginedAccount") - proto.RegisterType((*OrderFilters)(nil), "injective.orders.v1beta1.OrderFilters") - proto.RegisterType((*QueryDerivativeOrdersRequest)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersRequest") - proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersRequest)(nil), "injective.orders.v1beta1.QuerySubaccountMarketDerivativeOrdersRequest") - proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersResponse)(nil), "injective.orders.v1beta1.QuerySubaccountMarketDerivativeOrdersResponse") - proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersBatchRequest)(nil), "injective.orders.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchRequest") - proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersBatchResponse)(nil), "injective.orders.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchResponse") - proto.RegisterMapType((map[string]*QuerySubaccountMarketDerivativeOrdersResponse)(nil), "injective.orders.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchResponse.MarketRecordsEntry") - proto.RegisterType((*QuerySpotOrdersRequest)(nil), "injective.orders.v1beta1.QuerySpotOrdersRequest") - proto.RegisterType((*QuerySpotOrdersResponse)(nil), "injective.orders.v1beta1.QuerySpotOrdersResponse") - proto.RegisterType((*QueryTradePairRequest)(nil), "injective.orders.v1beta1.QueryTradePairRequest") - proto.RegisterType((*QueryTradePairResponse)(nil), "injective.orders.v1beta1.QueryTradePairResponse") - proto.RegisterType((*QueryDerivativeMarketRequest)(nil), "injective.orders.v1beta1.QueryDerivativeMarketRequest") - proto.RegisterType((*QueryDerivativeMarketResponse)(nil), "injective.orders.v1beta1.QueryDerivativeMarketResponse") - proto.RegisterType((*QueryTradePairsRequest)(nil), "injective.orders.v1beta1.QueryTradePairsRequest") - proto.RegisterType((*QueryTradePairsResponse)(nil), "injective.orders.v1beta1.QueryTradePairsResponse") - proto.RegisterType((*QueryDerivativeOrdersResponse)(nil), "injective.orders.v1beta1.QueryDerivativeOrdersResponse") + proto.RegisterType((*QueryExchangeParamsRequest)(nil), "injective.exchange.v1beta1.QueryExchangeParamsRequest") + proto.RegisterType((*QueryExchangeParamsResponse)(nil), "injective.exchange.v1beta1.QueryExchangeParamsResponse") + proto.RegisterType((*QueryDerivativeOrdersQuoteRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersQuoteRequest") + proto.RegisterType((*QueryDerivativeOrdersQuoteResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersQuoteResponse") + proto.RegisterType((*QueryDerivativeOrdersQuoteBatchRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersQuoteBatchRequest") + proto.RegisterType((*QueryDerivativeOrdersQuoteBatchResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersQuoteBatchResponse") + proto.RegisterType((*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest") + proto.RegisterType((*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse") + proto.RegisterType((*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookDepthAvgWeightedPriceRequest") + proto.RegisterType((*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookDepthAvgWeightedPriceResponse") + proto.RegisterType((*QuerySubaccountMarginHoldRequest)(nil), "injective.exchange.v1beta1.QuerySubaccountMarginHoldRequest") + proto.RegisterType((*QuerySubaccountMarginHoldResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountMarginHoldResponse") + proto.RegisterType((*QueryDerivativeOrderbookRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookRequest") + proto.RegisterType((*QueryDerivativeOrderbookResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrderbookResponse") + proto.RegisterType((*QueryMarginInfoRequest)(nil), "injective.exchange.v1beta1.QueryMarginInfoRequest") + proto.RegisterType((*QueryMarginInfoResponse)(nil), "injective.exchange.v1beta1.QueryMarginInfoResponse") + proto.RegisterType((*QueryPositionInfoRequest)(nil), "injective.exchange.v1beta1.QueryPositionInfoRequest") + proto.RegisterType((*QueryPositionInfoResponse)(nil), "injective.exchange.v1beta1.QueryPositionInfoResponse") + proto.RegisterType((*QueryTraderSubaccountsInfoRequest)(nil), "injective.exchange.v1beta1.QueryTraderSubaccountsInfoRequest") + proto.RegisterType((*QueryTraderSubaccountsInfoResponse)(nil), "injective.exchange.v1beta1.QueryTraderSubaccountsInfoResponse") + proto.RegisterType((*QueryDerivativeMarketsRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketsRequest") + proto.RegisterType((*QueryDerivativeMarketsResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketsResponse") + proto.RegisterType((*QueryUnderMarginedAccountsRequest)(nil), "injective.exchange.v1beta1.QueryUnderMarginedAccountsRequest") + proto.RegisterType((*QueryUnderMarginedAccountsResponse)(nil), "injective.exchange.v1beta1.QueryUnderMarginedAccountsResponse") + proto.RegisterType((*UnderMarginedAccount)(nil), "injective.exchange.v1beta1.UnderMarginedAccount") + proto.RegisterType((*OrderFilters)(nil), "injective.exchange.v1beta1.OrderFilters") + proto.RegisterType((*QueryDerivativeOrdersRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersRequest") + proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersRequest)(nil), "injective.exchange.v1beta1.QuerySubaccountMarketDerivativeOrdersRequest") + proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountMarketDerivativeOrdersResponse") + proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersBatchRequest)(nil), "injective.exchange.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchRequest") + proto.RegisterType((*QuerySubaccountMarketDerivativeOrdersBatchResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchResponse") + proto.RegisterMapType((map[string]*QuerySubaccountMarketDerivativeOrdersResponse)(nil), "injective.exchange.v1beta1.QuerySubaccountMarketDerivativeOrdersBatchResponse.MarketRecordsEntry") + proto.RegisterType((*QuerySpotOrdersRequest)(nil), "injective.exchange.v1beta1.QuerySpotOrdersRequest") + proto.RegisterType((*QuerySpotOrdersResponse)(nil), "injective.exchange.v1beta1.QuerySpotOrdersResponse") + proto.RegisterType((*QuerySpotMarketRequest)(nil), "injective.exchange.v1beta1.QuerySpotMarketRequest") + proto.RegisterType((*QuerySpotMarketResponse)(nil), "injective.exchange.v1beta1.QuerySpotMarketResponse") + proto.RegisterType((*QueryDerivativeMarketRequest)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketRequest") + proto.RegisterType((*QueryDerivativeMarketResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeMarketResponse") + proto.RegisterType((*QuerySpotMarketsRequest)(nil), "injective.exchange.v1beta1.QuerySpotMarketsRequest") + proto.RegisterType((*QuerySpotMarketsResponse)(nil), "injective.exchange.v1beta1.QuerySpotMarketsResponse") + proto.RegisterType((*QueryDerivativeOrdersResponse)(nil), "injective.exchange.v1beta1.QueryDerivativeOrdersResponse") } func init() { - proto.RegisterFile("injective/orders/v1beta1/query.proto", fileDescriptor_d11505616d5f0a14) -} - -var fileDescriptor_d11505616d5f0a14 = []byte{ - // 2418 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0xcf, 0x6f, 0xdb, 0xd8, - 0xf1, 0x0f, 0x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, 0x1f, 0x92, 0x84, 0x5c, 0x76, - 0x90, 0x0d, 0x4b, 0x0f, 0x32, 0xf5, 0x33, 0x38, 0x13, 0xf2, 0x88, 0xe3, 0xbc, 0xd9, 0x8b, 0xb6, - 0x61, 0xee, 0x58, 0x3c, 0x17, 0x07, 0xe0, 0xe5, 0x5b, 0x82, 0xef, 0x09, 0xf7, 0x59, 0xfd, 0x8b, - 0x02, 0x05, 0xaa, 0xe2, 0xa1, 0xe5, 0x18, 0x6e, 0xd7, 0xf1, 0xdf, 0x80, 0x2d, 0xb0, 0xeb, 0x86, - 0xfa, 0xce, 0xeb, 0x14, 0x70, 0x35, 0xe1, 0x2d, 0x89, 0x2f, 0xbd, 0x23, 0x25, 0xd7, 0xe1, 0x74, - 0x3f, 0x64, 0x97, 0x07, 0x6c, 0x31, 0xff, 0x32, 0x93, 0x1d, 0xdf, 0x9b, 0xea, 0xf0, 0x84, 0x7c, - 0x62, 0x6b, 0x3a, 0xb6, 0xbd, 0xb4, 0x74, 0x52, 0xc3, 0x27, 0x73, 0x2f, 0x23, 0x77, 0xef, 0x73, - 0xde, 0x32, 0x44, 0x28, 0xe5, 0x7e, 0x3e, 0x82, 0xe3, 0x7e, 0xc8, 0x99, 0xa7, 0x31, 0xa7, 0xa7, - 0xb7, 0x16, 0x5d, 0xca, 0x17, 0x33, 0xea, 0xed, 0x5d, 0x38, 0xdf, 0x97, 0xf7, 0xf7, 0x68, 0x74, - 0x9c, 0xf4, 0xbd, 0x99, 0xba, 0x03, 0x33, 0x51, 0x6b, 0x71, 0x07, 0x36, 0x60, 0x94, 0x05, 0x5f, - 0x94, 0x90, 0x85, 0x68, 0xc3, 0xfb, 0x57, 0xa9, 0x08, 0xd1, 0x5e, 0x84, 0xbe, 0x6b, 0xea, 0xd8, - 0x66, 0x9b, 0x1f, 0xeb, 0x6b, 0x1c, 0x30, 0x5f, 0x84, 0x82, 0xf9, 0xaa, 0x24, 0xcc, 0xd7, 0x88, - 0x08, 0x75, 0x78, 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0xb6, 0xa5, 0x77, 0x5b, 0xd8, 0x11, 0x8a, 0xc9, 0xf3, 0x0e, 0x76, 0x6a, 0x23, - 0xf4, 0xef, 0x93, 0xef, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x99, 0x31, 0x48, 0x27, 0x02, 0x2a, - 0x00, 0x00, + proto.RegisterFile("injective/exchange/v1beta1/query.proto", fileDescriptor_523db28b8af54781) +} + +var fileDescriptor_523db28b8af54781 = []byte{ + // 2406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0xcd, 0x6f, 0x1c, 0x49, + 0x15, 0x4f, 0x8f, 0xbf, 0x9f, 0x3d, 0xfe, 0x28, 0x3b, 0xc9, 0x64, 0x92, 0xd8, 0xd9, 0xf6, 0xc6, + 0x71, 0x8c, 0x77, 0x26, 0x76, 0xb2, 0xbb, 0x4e, 0x36, 0x6b, 0x61, 0xc7, 0xf1, 0xc6, 0x60, 0x67, + 0x9d, 0x09, 0xbb, 0x08, 0xb4, 0x52, 0xab, 0x67, 0xba, 0x3c, 0xd3, 0xf1, 0x4c, 0xf7, 0xb8, 0xbb, + 0xc6, 0xc4, 0xd7, 0x3d, 0x20, 0x04, 0x12, 0x42, 0x42, 0xe2, 0xc0, 0x09, 0x38, 0x70, 0xe0, 0x00, + 0x12, 0x48, 0x68, 0xb5, 0xe2, 0xb4, 0xa7, 0x15, 0x12, 0x28, 0x02, 0x09, 0x71, 0x42, 0x28, 0xe1, + 0xc4, 0x91, 0xbf, 0x00, 0x75, 0x7d, 0xf4, 0xc7, 0x74, 0x4f, 0x4f, 0xf7, 0xd8, 0x0a, 0xe2, 0x36, + 0xfd, 0xfa, 0xbd, 0xaa, 0xdf, 0xfb, 0xbd, 0x7a, 0x55, 0xaf, 0xfa, 0x0d, 0x2c, 0xe8, 0xc6, 0x33, + 0x5c, 0x21, 0xfa, 0x31, 0x2e, 0xe2, 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, 0x1b, 0x8e, 0xc8, 0xbf, 0x19, 0x18, 0x30, 0x4c, 0xa3, 0x82, 0x73, 0x23, + 0xf4, 0x25, 0x7b, 0x40, 0x57, 0x01, 0x58, 0x35, 0x5a, 0x53, 0xed, 0x5a, 0x0e, 0xe8, 0xab, 0x11, + 0x2a, 0x79, 0xa4, 0xda, 0x35, 0xdf, 0xcd, 0x61, 0x34, 0x70, 0x73, 0x98, 0x03, 0x56, 0x84, 0xf2, + 0x42, 0x64, 0x8c, 0xd1, 0x44, 0x45, 0xac, 0x04, 0xf9, 0xee, 0x30, 0x8c, 0xd1, 0xb3, 0x73, 0x9b, + 0xde, 0x10, 0x6c, 0x74, 0x0b, 0x66, 0x2a, 0xa6, 0x41, 0x2c, 0xb5, 0x42, 0x02, 0x17, 0x09, 0x16, + 0x29, 0x24, 0xde, 0x79, 0x57, 0x89, 0xf8, 0xeb, 0xce, 0x45, 0x18, 0xd2, 0x6d, 0xc5, 0x39, 0x13, + 0x69, 0x8c, 0x02, 0xc8, 0x0c, 0x93, 0x28, 0xf8, 0x79, 0x53, 0xb7, 0xb0, 0xc6, 0x2f, 0x3c, 0x60, + 0x98, 0xe4, 0x21, 0x93, 0xa0, 0x02, 0x4c, 0x73, 0xb2, 0x6c, 0x1b, 0x93, 0xb6, 0xbd, 0x76, 0x8a, + 0x51, 0xe6, 0xbc, 0x11, 0xbc, 0x15, 0x60, 0x9a, 0x44, 0xe8, 0xb3, 0x78, 0x4d, 0x91, 0x90, 0x7e, + 0x54, 0x70, 0x87, 0xa2, 0x83, 0x7b, 0x1d, 0xc6, 0x6d, 0xec, 0xac, 0xe6, 0xb6, 0xc0, 0x65, 0x99, + 0x54, 0xa8, 0x2d, 0xc2, 0xa4, 0x1f, 0xb1, 0xa6, 0x12, 0x95, 0x07, 0x71, 0xdc, 0x83, 0xbb, 0xa5, + 0x12, 0xd5, 0xd1, 0x24, 0xed, 0x9a, 0x2c, 0xa6, 0xe3, 0x24, 0xa8, 0xb9, 0x0c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x7a, 0xf1, 0x72, 0x56, 0xfa, 0xe7, 0xcb, 0x59, 0xe9, 0x47, 0xaf, 0x66, 0xcf, 0xbd, + 0x78, 0x35, 0x7b, 0xee, 0xef, 0xaf, 0x66, 0xcf, 0x7d, 0xfb, 0x71, 0x55, 0x27, 0xb5, 0x56, 0xb9, + 0x50, 0x31, 0x1b, 0xc5, 0x1d, 0x31, 0xde, 0xae, 0x5a, 0xb6, 0xbd, 0xd1, 0xdf, 0xaa, 0x98, 0x16, + 0xf6, 0x3f, 0xd6, 0x54, 0xdd, 0x28, 0x36, 0x4c, 0xad, 0x55, 0xc7, 0xb6, 0x37, 0x35, 0x39, 0x69, + 0x62, 0xbb, 0x3c, 0x48, 0xff, 0xb8, 0x79, 0xfb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xb1, + 0x4d, 0x27, 0x86, 0x2a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2756,9 +2717,9 @@ type QueryClient interface { // Retrieves a list of 0x orders matching the filtering rules. QuerySpotOrders(ctx context.Context, in *QuerySpotOrdersRequest, opts ...grpc.CallOption) (*QuerySpotOrdersResponse, error) // Retrieves a trade pair by name or hash. - QueryTradePair(ctx context.Context, in *QueryTradePairRequest, opts ...grpc.CallOption) (*QueryTradePairResponse, error) + QuerySpotMarket(ctx context.Context, in *QuerySpotMarketRequest, opts ...grpc.CallOption) (*QuerySpotMarketResponse, error) // Retrieves a list of trade pairs. - QueryTradePairs(ctx context.Context, in *QueryTradePairsRequest, opts ...grpc.CallOption) (*QueryTradePairsResponse, error) + QuerySpotMarkets(ctx context.Context, in *QuerySpotMarketsRequest, opts ...grpc.CallOption) (*QuerySpotMarketsResponse, error) // Retrieves a derivative market by its ID or ticker. QueryDerivativeMarket(ctx context.Context, in *QueryDerivativeMarketRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketResponse, error) // Retrieves a list of derivative markets. @@ -2805,25 +2766,25 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) QuerySpotOrders(ctx context.Context, in *QuerySpotOrdersRequest, opts ...grpc.CallOption) (*QuerySpotOrdersResponse, error) { out := new(QuerySpotOrdersResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QuerySpotOrders", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySpotOrders", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) QueryTradePair(ctx context.Context, in *QueryTradePairRequest, opts ...grpc.CallOption) (*QueryTradePairResponse, error) { - out := new(QueryTradePairResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryTradePair", in, out, opts...) +func (c *queryClient) QuerySpotMarket(ctx context.Context, in *QuerySpotMarketRequest, opts ...grpc.CallOption) (*QuerySpotMarketResponse, error) { + out := new(QuerySpotMarketResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySpotMarket", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) QueryTradePairs(ctx context.Context, in *QueryTradePairsRequest, opts ...grpc.CallOption) (*QueryTradePairsResponse, error) { - out := new(QueryTradePairsResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryTradePairs", in, out, opts...) +func (c *queryClient) QuerySpotMarkets(ctx context.Context, in *QuerySpotMarketsRequest, opts ...grpc.CallOption) (*QuerySpotMarketsResponse, error) { + out := new(QuerySpotMarketsResponse) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySpotMarkets", in, out, opts...) if err != nil { return nil, err } @@ -2832,7 +2793,7 @@ func (c *queryClient) QueryTradePairs(ctx context.Context, in *QueryTradePairsRe func (c *queryClient) QueryDerivativeMarket(ctx context.Context, in *QueryDerivativeMarketRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketResponse, error) { out := new(QueryDerivativeMarketResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeMarket", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeMarket", in, out, opts...) if err != nil { return nil, err } @@ -2841,7 +2802,7 @@ func (c *queryClient) QueryDerivativeMarket(ctx context.Context, in *QueryDeriva func (c *queryClient) QueryDerivativeMarkets(ctx context.Context, in *QueryDerivativeMarketsRequest, opts ...grpc.CallOption) (*QueryDerivativeMarketsResponse, error) { out := new(QueryDerivativeMarketsResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeMarkets", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeMarkets", in, out, opts...) if err != nil { return nil, err } @@ -2850,7 +2811,7 @@ func (c *queryClient) QueryDerivativeMarkets(ctx context.Context, in *QueryDeriv func (c *queryClient) QueryDerivativeOrders(ctx context.Context, in *QueryDerivativeOrdersRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersResponse, error) { out := new(QueryDerivativeOrdersResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrders", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrders", in, out, opts...) if err != nil { return nil, err } @@ -2859,7 +2820,7 @@ func (c *queryClient) QueryDerivativeOrders(ctx context.Context, in *QueryDeriva func (c *queryClient) QuerySubaccountMarketDerivativeOrders(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersResponse, error) { out := new(QuerySubaccountMarketDerivativeOrdersResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", in, out, opts...) if err != nil { return nil, err } @@ -2868,7 +2829,7 @@ func (c *queryClient) QuerySubaccountMarketDerivativeOrders(ctx context.Context, func (c *queryClient) QuerySubaccountMarketDerivativeOrdersBatch(ctx context.Context, in *QuerySubaccountMarketDerivativeOrdersBatchRequest, opts ...grpc.CallOption) (*QuerySubaccountMarketDerivativeOrdersBatchResponse, error) { out := new(QuerySubaccountMarketDerivativeOrdersBatchResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", in, out, opts...) if err != nil { return nil, err } @@ -2877,7 +2838,7 @@ func (c *queryClient) QuerySubaccountMarketDerivativeOrdersBatch(ctx context.Con func (c *queryClient) QueryDerivativeOrdersQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteResponse, error) { out := new(QueryDerivativeOrdersQuoteResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrdersQuote", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersQuote", in, out, opts...) if err != nil { return nil, err } @@ -2886,7 +2847,7 @@ func (c *queryClient) QueryDerivativeOrdersQuote(ctx context.Context, in *QueryD func (c *queryClient) QueryDerivativeOrdersBatchQuote(ctx context.Context, in *QueryDerivativeOrdersQuoteBatchRequest, opts ...grpc.CallOption) (*QueryDerivativeOrdersQuoteBatchResponse, error) { out := new(QueryDerivativeOrdersQuoteBatchResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrdersBatchQuote", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersBatchQuote", in, out, opts...) if err != nil { return nil, err } @@ -2895,7 +2856,7 @@ func (c *queryClient) QueryDerivativeOrdersBatchQuote(ctx context.Context, in *Q func (c *queryClient) QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse, error) { out := new(QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", in, out, opts...) if err != nil { return nil, err } @@ -2904,7 +2865,7 @@ func (c *queryClient) QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx con func (c *queryClient) QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx context.Context, in *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookDepthAvgWeightedPriceResponse, error) { out := new(QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", in, out, opts...) if err != nil { return nil, err } @@ -2913,7 +2874,7 @@ func (c *queryClient) QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx context. func (c *queryClient) QuerySubaccountMarginHold(ctx context.Context, in *QuerySubaccountMarginHoldRequest, opts ...grpc.CallOption) (*QuerySubaccountMarginHoldResponse, error) { out := new(QuerySubaccountMarginHoldResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QuerySubaccountMarginHold", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QuerySubaccountMarginHold", in, out, opts...) if err != nil { return nil, err } @@ -2922,7 +2883,7 @@ func (c *queryClient) QuerySubaccountMarginHold(ctx context.Context, in *QuerySu func (c *queryClient) QueryDerivativeOrderbook(ctx context.Context, in *QueryDerivativeOrderbookRequest, opts ...grpc.CallOption) (*QueryDerivativeOrderbookResponse, error) { out := new(QueryDerivativeOrderbookResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryDerivativeOrderbook", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbook", in, out, opts...) if err != nil { return nil, err } @@ -2931,7 +2892,7 @@ func (c *queryClient) QueryDerivativeOrderbook(ctx context.Context, in *QueryDer func (c *queryClient) QueryMarginInfo(ctx context.Context, in *QueryMarginInfoRequest, opts ...grpc.CallOption) (*QueryMarginInfoResponse, error) { out := new(QueryMarginInfoResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryMarginInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryMarginInfo", in, out, opts...) if err != nil { return nil, err } @@ -2940,7 +2901,7 @@ func (c *queryClient) QueryMarginInfo(ctx context.Context, in *QueryMarginInfoRe func (c *queryClient) QueryPositionInfo(ctx context.Context, in *QueryPositionInfoRequest, opts ...grpc.CallOption) (*QueryPositionInfoResponse, error) { out := new(QueryPositionInfoResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryPositionInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryPositionInfo", in, out, opts...) if err != nil { return nil, err } @@ -2949,7 +2910,7 @@ func (c *queryClient) QueryPositionInfo(ctx context.Context, in *QueryPositionIn func (c *queryClient) QueryTraderSubaccountsInfo(ctx context.Context, in *QueryTraderSubaccountsInfoRequest, opts ...grpc.CallOption) (*QueryTraderSubaccountsInfoResponse, error) { out := new(QueryTraderSubaccountsInfoResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryTraderSubaccountsInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryTraderSubaccountsInfo", in, out, opts...) if err != nil { return nil, err } @@ -2958,7 +2919,7 @@ func (c *queryClient) QueryTraderSubaccountsInfo(ctx context.Context, in *QueryT func (c *queryClient) QueryUnderMarginedAccounts(ctx context.Context, in *QueryUnderMarginedAccountsRequest, opts ...grpc.CallOption) (*QueryUnderMarginedAccountsResponse, error) { out := new(QueryUnderMarginedAccountsResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryUnderMarginedAccounts", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryUnderMarginedAccounts", in, out, opts...) if err != nil { return nil, err } @@ -2967,7 +2928,7 @@ func (c *queryClient) QueryUnderMarginedAccounts(ctx context.Context, in *QueryU func (c *queryClient) QueryExchangeParams(ctx context.Context, in *QueryExchangeParamsRequest, opts ...grpc.CallOption) (*QueryExchangeParamsResponse, error) { out := new(QueryExchangeParamsResponse) - err := c.cc.Invoke(ctx, "/injective.orders.v1beta1.Query/QueryExchangeParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/injective.exchange.v1beta1.Query/QueryExchangeParams", in, out, opts...) if err != nil { return nil, err } @@ -2979,9 +2940,9 @@ type QueryServer interface { // Retrieves a list of 0x orders matching the filtering rules. QuerySpotOrders(context.Context, *QuerySpotOrdersRequest) (*QuerySpotOrdersResponse, error) // Retrieves a trade pair by name or hash. - QueryTradePair(context.Context, *QueryTradePairRequest) (*QueryTradePairResponse, error) + QuerySpotMarket(context.Context, *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) // Retrieves a list of trade pairs. - QueryTradePairs(context.Context, *QueryTradePairsRequest) (*QueryTradePairsResponse, error) + QuerySpotMarkets(context.Context, *QuerySpotMarketsRequest) (*QuerySpotMarketsResponse, error) // Retrieves a derivative market by its ID or ticker. QueryDerivativeMarket(context.Context, *QueryDerivativeMarketRequest) (*QueryDerivativeMarketResponse, error) // Retrieves a list of derivative markets. @@ -3025,11 +2986,11 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) QuerySpotOrders(ctx context.Context, req *QuerySpotOrdersRequest) (*QuerySpotOrdersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QuerySpotOrders not implemented") } -func (*UnimplementedQueryServer) QueryTradePair(ctx context.Context, req *QueryTradePairRequest) (*QueryTradePairResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryTradePair not implemented") +func (*UnimplementedQueryServer) QuerySpotMarket(ctx context.Context, req *QuerySpotMarketRequest) (*QuerySpotMarketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySpotMarket not implemented") } -func (*UnimplementedQueryServer) QueryTradePairs(ctx context.Context, req *QueryTradePairsRequest) (*QueryTradePairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryTradePairs not implemented") +func (*UnimplementedQueryServer) QuerySpotMarkets(ctx context.Context, req *QuerySpotMarketsRequest) (*QuerySpotMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySpotMarkets not implemented") } func (*UnimplementedQueryServer) QueryDerivativeMarket(ctx context.Context, req *QueryDerivativeMarketRequest) (*QueryDerivativeMarketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryDerivativeMarket not implemented") @@ -3094,7 +3055,7 @@ func _Query_QuerySpotOrders_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QuerySpotOrders", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotOrders", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QuerySpotOrders(ctx, req.(*QuerySpotOrdersRequest)) @@ -3102,38 +3063,38 @@ func _Query_QuerySpotOrders_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Query_QueryTradePair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTradePairRequest) +func _Query_QuerySpotMarket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpotMarketRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryTradePair(ctx, in) + return srv.(QueryServer).QuerySpotMarket(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryTradePair", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotMarket", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryTradePair(ctx, req.(*QueryTradePairRequest)) + return srv.(QueryServer).QuerySpotMarket(ctx, req.(*QuerySpotMarketRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_QueryTradePairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTradePairsRequest) +func _Query_QuerySpotMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpotMarketsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryTradePairs(ctx, in) + return srv.(QueryServer).QuerySpotMarkets(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryTradePairs", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySpotMarkets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryTradePairs(ctx, req.(*QueryTradePairsRequest)) + return srv.(QueryServer).QuerySpotMarkets(ctx, req.(*QuerySpotMarketsRequest)) } return interceptor(ctx, in, info, handler) } @@ -3148,7 +3109,7 @@ func _Query_QueryDerivativeMarket_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeMarket", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeMarket", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeMarket(ctx, req.(*QueryDerivativeMarketRequest)) @@ -3166,7 +3127,7 @@ func _Query_QueryDerivativeMarkets_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeMarkets", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeMarkets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeMarkets(ctx, req.(*QueryDerivativeMarketsRequest)) @@ -3184,7 +3145,7 @@ func _Query_QueryDerivativeOrders_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrders", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrders", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrders(ctx, req.(*QueryDerivativeOrdersRequest)) @@ -3202,7 +3163,7 @@ func _Query_QuerySubaccountMarketDerivativeOrders_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrders", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QuerySubaccountMarketDerivativeOrders(ctx, req.(*QuerySubaccountMarketDerivativeOrdersRequest)) @@ -3220,7 +3181,7 @@ func _Query_QuerySubaccountMarketDerivativeOrdersBatch_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarketDerivativeOrdersBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QuerySubaccountMarketDerivativeOrdersBatch(ctx, req.(*QuerySubaccountMarketDerivativeOrdersBatchRequest)) @@ -3238,7 +3199,7 @@ func _Query_QueryDerivativeOrdersQuote_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrdersQuote", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersQuote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrdersQuote(ctx, req.(*QueryDerivativeOrdersQuoteRequest)) @@ -3256,7 +3217,7 @@ func _Query_QueryDerivativeOrdersBatchQuote_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrdersBatchQuote", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrdersBatchQuote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrdersBatchQuote(ctx, req.(*QueryDerivativeOrdersQuoteBatchRequest)) @@ -3274,7 +3235,7 @@ func _Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_Handler(srv inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthBatchAvgWeightedPrice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx, req.(*QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest)) @@ -3292,7 +3253,7 @@ func _Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_Handler(srv interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbookDepthAvgWeightedPrice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx, req.(*QueryDerivativeOrderbookDepthAvgWeightedPriceRequest)) @@ -3310,7 +3271,7 @@ func _Query_QuerySubaccountMarginHold_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QuerySubaccountMarginHold", + FullMethod: "/injective.exchange.v1beta1.Query/QuerySubaccountMarginHold", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QuerySubaccountMarginHold(ctx, req.(*QuerySubaccountMarginHoldRequest)) @@ -3328,7 +3289,7 @@ func _Query_QueryDerivativeOrderbook_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryDerivativeOrderbook", + FullMethod: "/injective.exchange.v1beta1.Query/QueryDerivativeOrderbook", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryDerivativeOrderbook(ctx, req.(*QueryDerivativeOrderbookRequest)) @@ -3346,7 +3307,7 @@ func _Query_QueryMarginInfo_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryMarginInfo", + FullMethod: "/injective.exchange.v1beta1.Query/QueryMarginInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryMarginInfo(ctx, req.(*QueryMarginInfoRequest)) @@ -3364,7 +3325,7 @@ func _Query_QueryPositionInfo_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryPositionInfo", + FullMethod: "/injective.exchange.v1beta1.Query/QueryPositionInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryPositionInfo(ctx, req.(*QueryPositionInfoRequest)) @@ -3382,7 +3343,7 @@ func _Query_QueryTraderSubaccountsInfo_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryTraderSubaccountsInfo", + FullMethod: "/injective.exchange.v1beta1.Query/QueryTraderSubaccountsInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryTraderSubaccountsInfo(ctx, req.(*QueryTraderSubaccountsInfoRequest)) @@ -3400,7 +3361,7 @@ func _Query_QueryUnderMarginedAccounts_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryUnderMarginedAccounts", + FullMethod: "/injective.exchange.v1beta1.Query/QueryUnderMarginedAccounts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryUnderMarginedAccounts(ctx, req.(*QueryUnderMarginedAccountsRequest)) @@ -3418,7 +3379,7 @@ func _Query_QueryExchangeParams_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/injective.orders.v1beta1.Query/QueryExchangeParams", + FullMethod: "/injective.exchange.v1beta1.Query/QueryExchangeParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).QueryExchangeParams(ctx, req.(*QueryExchangeParamsRequest)) @@ -3427,7 +3388,7 @@ func _Query_QueryExchangeParams_Handler(srv interface{}, ctx context.Context, de } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "injective.orders.v1beta1.Query", + ServiceName: "injective.exchange.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -3435,12 +3396,12 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_QuerySpotOrders_Handler, }, { - MethodName: "QueryTradePair", - Handler: _Query_QueryTradePair_Handler, + MethodName: "QuerySpotMarket", + Handler: _Query_QuerySpotMarket_Handler, }, { - MethodName: "QueryTradePairs", - Handler: _Query_QueryTradePairs_Handler, + MethodName: "QuerySpotMarkets", + Handler: _Query_QuerySpotMarkets_Handler, }, { MethodName: "QueryDerivativeMarket", @@ -3508,7 +3469,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "injective/orders/v1beta1/query.proto", + Metadata: "injective/exchange/v1beta1/query.proto", } func (m *QueryExchangeParamsRequest) Marshal() (dAtA []byte, err error) { @@ -5116,7 +5077,7 @@ func (m *QuerySpotOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryTradePairRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySpotMarketRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5126,48 +5087,55 @@ func (m *QueryTradePairRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryTradePairRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpotMarketRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTradePairRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpotMarketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerAssetData))) + if len(m.QuoteAsset) > 0 { + i -= len(m.QuoteAsset) + copy(dAtA[i:], m.QuoteAsset) + i = encodeVarintQuery(dAtA, i, uint64(len(m.QuoteAsset))) + i-- + dAtA[i] = 0x2a + } + if len(m.BaseAsset) > 0 { + i -= len(m.BaseAsset) + copy(dAtA[i:], m.BaseAsset) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BaseAsset))) i-- dAtA[i] = 0x22 } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAssetData))) + if len(m.MarketId) > 0 { + i -= len(m.MarketId) + copy(dAtA[i:], m.MarketId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MarketId))) i-- dAtA[i] = 0x1a } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + if len(m.ExchangeAddress) > 0 { + i -= len(m.ExchangeAddress) + copy(dAtA[i:], m.ExchangeAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ExchangeAddress))) i-- dAtA[i] = 0x12 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + if len(m.Ticker) > 0 { + i -= len(m.Ticker) + copy(dAtA[i:], m.Ticker) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Ticker))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryTradePairResponse) Marshal() (dAtA []byte, err error) { +func (m *QuerySpotMarketResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5177,52 +5145,26 @@ func (m *QueryTradePairResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryTradePairResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpotMarketResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTradePairResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpotMarketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Market != nil { + { + size, err := m.Market.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x28 - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if len(m.TakerAssetData) > 0 { - i -= len(m.TakerAssetData) - copy(dAtA[i:], m.TakerAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TakerAssetData))) - i-- - dAtA[i] = 0x1a - } - if len(m.MakerAssetData) > 0 { - i -= len(m.MakerAssetData) - copy(dAtA[i:], m.MakerAssetData) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MakerAssetData))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -5300,7 +5242,7 @@ func (m *QueryDerivativeMarketResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryTradePairsRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySpotMarketsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5310,12 +5252,12 @@ func (m *QueryTradePairsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryTradePairsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpotMarketsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTradePairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpotMarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5323,7 +5265,7 @@ func (m *QueryTradePairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryTradePairsResponse) Marshal() (dAtA []byte, err error) { +func (m *QuerySpotMarketsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5333,12 +5275,12 @@ func (m *QueryTradePairsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryTradePairsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpotMarketsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTradePairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpotMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -6126,56 +6068,45 @@ func (m *QuerySpotOrdersResponse) Size() (n int) { return n } -func (m *QueryTradePairRequest) Size() (n int) { +func (m *QuerySpotMarketRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) + l = len(m.Ticker) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.Hash) + l = len(m.ExchangeAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.MakerAssetData) + l = len(m.MarketId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.TakerAssetData) + l = len(m.BaseAsset) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.QuoteAsset) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryTradePairResponse) Size() (n int) { +func (m *QuerySpotMarketResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MakerAssetData) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TakerAssetData) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Hash) - if l > 0 { + if m.Market != nil { + l = m.Market.Size() n += 1 + l + sovQuery(uint64(l)) } - if m.Enabled { - n += 2 - } return n } @@ -6209,7 +6140,7 @@ func (m *QueryDerivativeMarketResponse) Size() (n int) { return n } -func (m *QueryTradePairsRequest) Size() (n int) { +func (m *QuerySpotMarketsRequest) Size() (n int) { if m == nil { return 0 } @@ -6218,7 +6149,7 @@ func (m *QueryTradePairsRequest) Size() (n int) { return n } -func (m *QueryTradePairsResponse) Size() (n int) { +func (m *QuerySpotMarketsResponse) Size() (n int) { if m == nil { return 0 } @@ -6289,10 +6220,7 @@ func (m *QueryExchangeParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6375,10 +6303,7 @@ func (m *QueryExchangeParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6608,10 +6533,7 @@ func (m *QueryDerivativeOrdersQuoteRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6695,10 +6617,7 @@ func (m *QueryDerivativeOrdersQuoteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6782,10 +6701,7 @@ func (m *QueryDerivativeOrdersQuoteBatchRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6869,10 +6785,7 @@ func (m *QueryDerivativeOrdersQuoteBatchResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6956,10 +6869,7 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest) Unmarshal(dA if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7041,10 +6951,7 @@ func (m *QueryDerivativeOrderbookDepthBatchAvgWeightedPriceResponse) Unmarshal(d if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7130,10 +7037,7 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceRequest) Unmarshal(dAtA [] if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7215,10 +7119,7 @@ func (m *QueryDerivativeOrderbookDepthAvgWeightedPriceResponse) Unmarshal(dAtA [ if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7396,10 +7297,7 @@ func (m *QuerySubaccountMarginHoldRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7481,10 +7379,7 @@ func (m *QuerySubaccountMarginHoldResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7566,10 +7461,7 @@ func (m *QueryDerivativeOrderbookRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7687,10 +7579,7 @@ func (m *QueryDerivativeOrderbookResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7900,10 +7789,7 @@ func (m *QueryMarginInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -7989,10 +7875,7 @@ func (m *QueryMarginInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8202,10 +8085,7 @@ func (m *QueryPositionInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8291,10 +8171,7 @@ func (m *QueryPositionInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8408,10 +8285,7 @@ func (m *QueryTraderSubaccountsInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8495,10 +8369,7 @@ func (m *QueryTraderSubaccountsInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8580,10 +8451,7 @@ func (m *QueryDerivativeMarketsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8667,10 +8535,7 @@ func (m *QueryDerivativeMarketsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8784,10 +8649,7 @@ func (m *QueryUnderMarginedAccountsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -8871,10 +8733,7 @@ func (m *QueryUnderMarginedAccountsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -9296,10 +9155,7 @@ func (m *UnderMarginedAccount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10125,10 +9981,7 @@ func (m *OrderFilters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10310,10 +10163,7 @@ func (m *QueryDerivativeOrdersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10491,10 +10341,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersRequest) Unmarshal(dAtA []byte) er if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10578,10 +10425,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersResponse) Unmarshal(dAtA []byte) e if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10759,10 +10603,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchRequest) Unmarshal(dAtA []byt if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -10924,7 +10765,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Unmarshal(dAtA []by if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > postIndex { @@ -10941,10 +10782,7 @@ func (m *QuerySubaccountMarketDerivativeOrdersBatchResponse) Unmarshal(dAtA []by if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11126,10 +10964,7 @@ func (m *QuerySpotOrdersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11213,10 +11048,7 @@ func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11231,7 +11063,7 @@ func (m *QuerySpotOrdersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11254,15 +11086,15 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTradePairRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTradePairRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpotMarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11290,11 +11122,11 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Ticker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExchangeAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11322,11 +11154,11 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = string(dAtA[iNdEx:postIndex]) + m.ExchangeAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11354,11 +11186,11 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) + m.MarketId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseAsset", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11386,7 +11218,39 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) + m.BaseAsset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuoteAsset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuoteAsset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -11394,10 +11258,7 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11412,7 +11273,7 @@ func (m *QueryTradePairRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTradePairResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11435,81 +11296,17 @@ func (m *QueryTradePairResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTradePairResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTradePairResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpotMarketResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MakerAssetData", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MakerAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakerAssetData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -11519,86 +11316,35 @@ func (m *QueryTradePairResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.TakerAssetData = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery + if m.Market == nil { + m.Market = &SpotMarket{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Hash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11712,10 +11458,7 @@ func (m *QueryDerivativeMarketRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11801,10 +11544,7 @@ func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11819,7 +11559,7 @@ func (m *QueryDerivativeMarketResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTradePairsRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11842,10 +11582,10 @@ func (m *QueryTradePairsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTradePairsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTradePairsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpotMarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -11854,10 +11594,7 @@ func (m *QueryTradePairsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -11872,7 +11609,7 @@ func (m *QueryTradePairsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTradePairsResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpotMarketsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11895,10 +11632,10 @@ func (m *QueryTradePairsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTradePairsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpotMarketsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTradePairsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpotMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -11930,7 +11667,7 @@ func (m *QueryTradePairsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Records = append(m.Records, &TradePair{}) + m.Records = append(m.Records, &SpotMarket{}) if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -11941,10 +11678,7 @@ func (m *QueryTradePairsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -12028,10 +11762,7 @@ func (m *QueryDerivativeOrdersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/chain/exchange/types/query.pb.gw.go b/chain/exchange/types/query.pb.gw.go new file mode 100644 index 00000000..f357e1a1 --- /dev/null +++ b/chain/exchange/types/query.pb.gw.go @@ -0,0 +1,1570 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: injective/exchange/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Query_QuerySpotOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySpotOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpotOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySpotOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySpotOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpotOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySpotOrders(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySpotMarket_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySpotMarket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotMarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpotMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySpotMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySpotMarket_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotMarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySpotMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySpotMarket(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QuerySpotMarkets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotMarketsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QuerySpotMarkets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySpotMarkets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpotMarketsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QuerySpotMarkets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeMarket_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeMarket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeMarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeMarket_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeMarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeMarket(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeMarkets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeMarkets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeMarketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeMarkets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeMarkets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeMarkets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeMarketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeMarkets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeMarkets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrders(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySubaccountMarketDerivativeOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySubaccountMarketDerivativeOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarketDerivativeOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarketDerivativeOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySubaccountMarketDerivativeOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySubaccountMarketDerivativeOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarketDerivativeOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarketDerivativeOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySubaccountMarketDerivativeOrders(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySubaccountMarketDerivativeOrdersBatch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarketDerivativeOrdersBatchRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarketDerivativeOrdersBatch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySubaccountMarketDerivativeOrdersBatch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarketDerivativeOrdersBatchRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarketDerivativeOrdersBatch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySubaccountMarketDerivativeOrdersBatch(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrdersQuote_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrdersQuote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersQuoteRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrdersQuote_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrdersQuote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrdersQuote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersQuoteRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrdersQuote_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrdersQuote(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrdersBatchQuote_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrdersBatchQuote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersQuoteBatchRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrdersBatchQuote_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrdersBatchQuote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrdersBatchQuote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrdersQuoteBatchRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrdersBatchQuote_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrdersBatchQuote(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookDepthBatchAvgWeightedPriceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrderbookDepthBatchAvgWeightedPrice(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookDepthAvgWeightedPriceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookDepthAvgWeightedPriceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrderbookDepthAvgWeightedPrice(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySubaccountMarginHold_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QuerySubaccountMarginHold_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarginHoldRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarginHold_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySubaccountMarginHold(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySubaccountMarginHold_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubaccountMarginHoldRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySubaccountMarginHold_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySubaccountMarginHold(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDerivativeOrderbook_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDerivativeOrderbook_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbook_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDerivativeOrderbook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDerivativeOrderbook_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDerivativeOrderbookRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDerivativeOrderbook_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDerivativeOrderbook(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryMarginInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryMarginInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMarginInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryMarginInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryMarginInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryMarginInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMarginInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryMarginInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryMarginInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryPositionInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryPositionInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPositionInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryPositionInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryPositionInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryPositionInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPositionInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryPositionInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryPositionInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryTraderSubaccountsInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryTraderSubaccountsInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTraderSubaccountsInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryTraderSubaccountsInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryTraderSubaccountsInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryTraderSubaccountsInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTraderSubaccountsInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryTraderSubaccountsInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryTraderSubaccountsInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryUnderMarginedAccounts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryUnderMarginedAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnderMarginedAccountsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUnderMarginedAccounts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUnderMarginedAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUnderMarginedAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnderMarginedAccountsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUnderMarginedAccounts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUnderMarginedAccounts(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryExchangeParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExchangeParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryExchangeParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryExchangeParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExchangeParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryExchangeParams(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_QuerySpotOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySpotOrders_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpotMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySpotMarket_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpotMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySpotMarkets_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeMarket_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeMarkets_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrders_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarketDerivativeOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySubaccountMarketDerivativeOrders_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarketDerivativeOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarketDerivativeOrdersBatch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrdersQuote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrdersQuote_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrdersQuote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrdersBatchQuote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrdersBatchQuote_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrdersBatchQuote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarginHold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySubaccountMarginHold_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarginHold_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDerivativeOrderbook_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryMarginInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryMarginInfo_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryMarginInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryPositionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryPositionInfo_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryPositionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryTraderSubaccountsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryTraderSubaccountsInfo_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryTraderSubaccountsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryUnderMarginedAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryUnderMarginedAccounts_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUnderMarginedAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExchangeParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryExchangeParams_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExchangeParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_QuerySpotOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySpotOrders_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpotMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySpotMarket_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySpotMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySpotMarkets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySpotMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeMarket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeMarket_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeMarket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeMarkets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeMarkets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeMarkets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrders_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarketDerivativeOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySubaccountMarketDerivativeOrders_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarketDerivativeOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarketDerivativeOrdersBatch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarketDerivativeOrdersBatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrdersQuote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrdersQuote_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrdersQuote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrdersBatchQuote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrdersBatchQuote_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrdersBatchQuote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySubaccountMarginHold_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySubaccountMarginHold_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySubaccountMarginHold_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDerivativeOrderbook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDerivativeOrderbook_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDerivativeOrderbook_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryMarginInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryMarginInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryMarginInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryPositionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryPositionInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryPositionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryTraderSubaccountsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryTraderSubaccountsInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryTraderSubaccountsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryUnderMarginedAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryUnderMarginedAccounts_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUnderMarginedAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExchangeParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryExchangeParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExchangeParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_QuerySpotOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "spotOrders"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QuerySpotMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "spotMarket"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QuerySpotMarkets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "spotMarkets"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "market"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeMarkets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "markets"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrders"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QuerySubaccountMarketDerivativeOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "subaccountMarketDerivativeOrders"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QuerySubaccountMarketDerivativeOrdersBatch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "subaccountMarketDerivativeOrdersBatch"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrdersQuote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrdersQuote"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrdersBatchQuote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrdersBatchQuote"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrderbookDepthBatchAvgWeightedPrice"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrderbookDepthAvgWeightedPrice"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QuerySubaccountMarginHold_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "subaccountMarginHold"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDerivativeOrderbook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "derivativeOrderbook"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryMarginInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "marginInfo"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryPositionInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "positionInfo"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryTraderSubaccountsInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "traderSubaccountsInfo"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryUnderMarginedAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "underMarginedAccounts"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryExchangeParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "exchange", "v1beta1", "exchangeParams"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_QuerySpotOrders_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySpotMarket_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySpotMarkets_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeMarket_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeMarkets_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrders_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySubaccountMarketDerivativeOrders_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySubaccountMarketDerivativeOrdersBatch_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrdersQuote_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrdersBatchQuote_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrderbookDepthBatchAvgWeightedPrice_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrderbookDepthAvgWeightedPrice_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySubaccountMarginHold_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDerivativeOrderbook_0 = runtime.ForwardResponseMessage + + forward_Query_QueryMarginInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryPositionInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryTraderSubaccountsInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryUnderMarginedAccounts_0 = runtime.ForwardResponseMessage + + forward_Query_QueryExchangeParams_0 = runtime.ForwardResponseMessage +) diff --git a/chain/exchange/types/spot_orders.go b/chain/exchange/types/spot_orders.go new file mode 100644 index 00000000..03afac07 --- /dev/null +++ b/chain/exchange/types/spot_orders.go @@ -0,0 +1,114 @@ +package types + +import ( + "errors" + chainsdk "github.com/InjectiveLabs/sdk-go" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "math/big" +) + +// ToSignedOrder returns an appropriate SignedSpotOrder +func (b *BaseSpotOrder) ToSignedOrder() *chainsdk.SignedSpotOrder { + o, err := bo2so(b) + if err != nil { + panic(err) + } + return o +} + +// SpotOrderType encodes spot order type +type SpotOrderType uint8 + +const ( + LimitBuy SpotOrderType = 1 + LimitSell SpotOrderType = 2 + MarketBuy SpotOrderType = 3 + MarketSell SpotOrderType = 4 +) + +type SpotMarketQuantity struct { + MarketID common.Hash + IsBuy bool + Quantity *big.Int +} + +// demand amount - filled amount +func (o *SpotLimitOrder) GetFillableDemandAmount() *big.Int { + return new(big.Int).Sub(BigNum(o.DemandAmount).Int(), BigNum(o.FilledAmount).Int()) +} + +func (o *SpotLimitOrder) GetSuppliableQuantity() *big.Int { + // supplyQuantity * GetFillableDemandAmount / receiveQuantity + return new(big.Int).Div(new(big.Int).Mul(BigNum(o.SupplyAmount).Int(), o.GetFillableDemandAmount()), BigNum(o.DemandAmount).Int()) +} + +func (b *BaseSpotOrder) GetSpotSupplyAsset(market *SpotMarket) common.Address { + if b.OrderType == BaseSpotOrder_LIMIT_BUY || b.OrderType == BaseSpotOrder_MARKET_BUY || + b.OrderType == BaseSpotOrder_STOP_LIMIT_BUY || b.OrderType == BaseSpotOrder_TAKE_LIMIT_BUY || + b.OrderType == BaseSpotOrder_STOP_MARKET_BUY || b.OrderType == BaseSpotOrder_TAKE_MARKET_BUY { + return common.HexToAddress(market.QuoteAsset) + } + return common.HexToAddress(market.BaseAsset) +} + +func GetLimitOrderRequiredFunds(spotOrderType BaseSpotOrder_OrderType, sOrder *chainsdk.SignedSpotOrder, market *SpotMarket) *big.Int { + if spotOrderType == BaseSpotOrder_LIMIT_BUY { + return GetAssetAmountWithFeesApplied(sOrder.SupplyAmount, BigNum(market.GetTakerTxFee()).Int()) + } + return sOrder.SupplyAmount +} + +// ParseBig128 parses s as a 128 bit integer in decimal or hexadecimal syntax. +// Leading zeros are accepted. The empty string parses as zero. +func ParseBig128(s string) (*big.Int, error) { + if v, ok := math.ParseBig256(s); !ok { + return nil, errors.New("ParseBig128 failed for " + s) + } else if v.BitLen() > 128 { + return nil, errors.New("ParseBig128 failed for " + s + "due to BitLength error") + } else { + return v, nil + } +} + +// bo2so internal function converts model from *BaseSpotOrder to *chainsdk.SignedSpotOrder. +func bo2so(o *BaseSpotOrder) (*chainsdk.SignedSpotOrder, error) { + if o == nil { + return nil, nil + } + + order := chainsdk.SpotOrder{ + ChainID: o.ChainId, + SubaccountID: common.HexToHash(o.SubaccountID), + Sender: common.HexToAddress(o.Sender), + FeeRecipient: common.HexToAddress(o.FeeRecipient), + Expiry: o.Expiry, + MarketID: common.HexToHash(o.MarketID), + Salt: o.Salt, + OrderType: uint8(o.OrderType), + } + + var err error + order.SupplyAmount, err = ParseBig128(o.SupplyAmount) + if err != nil { + return nil, err + } + order.DemandAmount, err = ParseBig128(o.DemandAmount) + if err != nil { + return nil, err + } + order.TriggerPrice, err = ParseBig128(o.TriggerPrice) + if err != nil { + return nil, err + } + + signedOrder := &chainsdk.SignedSpotOrder{ + SpotOrder: order, + } + + // Orders do not need a signature if the maker address equals the MsgCreateSpotOrder sender address + if len(o.Signature) != 0 { + signedOrder.Signature = common.FromHex(o.Signature) + } + return signedOrder, nil +} diff --git a/chain/orders/types/types.go b/chain/exchange/types/types.go similarity index 84% rename from chain/orders/types/types.go rename to chain/exchange/types/types.go index f7605f15..e6478454 100644 --- a/chain/orders/types/types.go +++ b/chain/exchange/types/types.go @@ -4,7 +4,6 @@ import ( "errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "math/big" - "strings" "time" "github.com/ethereum/go-ethereum/common" @@ -274,56 +273,15 @@ func (m MarginInfo) IsMarginHoldBreached() (availableMargin *big.Int, isBreached return availableMargin, false } -func (p TradePair) ComputeHash() (common.Hash, error) { - if p.Hash != "" { - return common.HexToHash(p.Hash), nil - } - - if len(p.MakerAssetData) == 0 { - return common.Hash{}, errors.New("hash error: no maker asset data specified") - } else if len(p.TakerAssetData) == 0 { - return common.Hash{}, errors.New("hash error: no taker asset data specified") - } - - var hash common.Hash - - if strings.Compare(p.MakerAssetData, p.TakerAssetData) < 0 { - hash = common.BytesToHash(keccak256([]byte(p.MakerAssetData), []byte(p.TakerAssetData))) - } else { - hash = common.BytesToHash(keccak256([]byte(p.TakerAssetData), []byte(p.MakerAssetData))) - } - - return hash, nil -} -func ComputeMarketHash(exchangeAddress common.Address, marketID common.Hash) common.Hash { - hash := common.BytesToHash(keccak256( - marketID.Bytes(), - exchangeAddress.Bytes(), - )) - return hash +func GetMarketIdFromAssetPair(baseAsset common.Address, quoteAsset common.Address, exchangeAddress common.Address) common.Hash { + return common.BytesToHash(keccak256(baseAsset.Bytes(), quoteAsset.Bytes(), exchangeAddress.Bytes())) } -func (p DerivativeMarket) Hash() (common.Hash, error) { - if len(p.GetMarketId()) == 0 { - return common.Hash{}, errors.New("hash error: no MarketId specified") - } else if len(p.GetExchangeAddress()) == 0 { - return common.Hash{}, errors.New("hash error: no ExchangeAddress specified") - } - - var hash common.Hash - - marketIdBytes := common.FromHex(p.MarketId) - if len(marketIdBytes) > common.HashLength { - marketIdBytes = marketIdBytes[:common.HashLength] - } - - hash = common.BytesToHash(keccak256( - marketIdBytes, - common.HexToAddress(p.ExchangeAddress).Bytes(), - )) - - return hash, nil +func (bo *BaseOrder) GetMakerTakerAssets() (makerAsset common.Address, takerAsset common.Address) { + makerAsset = common.BytesToAddress(common.FromHex(bo.GetMakerAssetData())[:common.AddressLength]) + takerAsset = common.BytesToAddress(common.FromHex(bo.GetTakerAssetData())[:common.AddressLength]) + return } func (m *DerivativeMarket) CheckExpiration(currBlockTime time.Time) error { @@ -344,4 +302,4 @@ func keccak256(data ...[]byte) []byte { _, _ = d.Write(b) } return d.Sum(nil) -} +} \ No newline at end of file diff --git a/chain/orders/types/key.go b/chain/orders/types/key.go deleted file mode 100644 index 8b9ef260..00000000 --- a/chain/orders/types/key.go +++ /dev/null @@ -1,109 +0,0 @@ -package types - -import ( - "github.com/ethereum/go-ethereum/common" - "math/big" -) - -const ( - // module name - ModuleName = "orders" - - // StoreKey to be used when creating the KVStore - StoreKey = ModuleName -) - -var ( - // ActiveOrdersIndexStoreKeyPrefix for order-by-hash store of active orders. - ActiveOrdersIndexStoreKeyPrefix = []byte{0x01} - - // ArchiveOrdersIndexStoreKeyPrefix for order-by-hash store of archive orders. - ArchiveOrdersIndexStoreKeyPrefix = []byte{0x02} - - // UnknownOrderHashStoreKeyPrefix for order hash to key used to get the filled amount (or cancelled status) - UnknownOrderHashStoreKeyPrefix = []byte{0x03} - - //// CloseOrdersStoreKeyPrefix - //CloseOrdersStoreKeyPrefix = []byte{0x04} - - // MarginInfo store. - MarginInfoStoreKeyPrefix = []byte{0x05} - - // PositionInfo store. - PositionInfoStoreKeyPrefix = []byte{0x06} - - // TradePairsStoreKeyPrefix for pair-by-hash store of trade pairs with asset data. - TradePairsStoreKeyPrefix = []byte{0x07} - DerivativeMarketStoreKeyPrefix = []byte{0x08} - - // ActiveOrdersStoreKeyPrefix for order-by-hash store of active orders. - ActiveOrdersStoreKeyPrefix = []byte{0x09} - - // ArchiveOrdersStoreKeyPrefix for order-by-hash store of archive orders. - ArchiveOrdersStoreKeyPrefix = []byte{0x0a} - - // TECSeenHashStoreKeyPrefix for bool-by-hash store of boolean seen TEC hashes - TECSeenHashStoreKeyPrefix = []byte{0x0b} - - // ModuleStatePrefix defines a collection of module state-related entries. - ModuleStatePrefix = []byte{0xff} -) - -func DerivativeMarketByExchangeAddressEnabledPrefix(exchangeAddress common.Address, isEnabled bool) []byte { - isEnabledByte := byte(0) - if isEnabled { - isEnabledByte = byte(1) - } - return append(exchangeAddress.Bytes(), isEnabledByte) -} - -// OrdersByMarketDirectionPriceOrderHashPrefix turns a marketID + direction + price + order hash to prefix used to get an order from the store. -func OrdersByMarketDirectionPriceOrderHashPrefix(marketID common.Hash, orderHash common.Hash, price *big.Int, isLong bool) []byte { - return append(OrdersByMarketDirectionPricePrefix(marketID, price, isLong), orderHash.Bytes()...) -} - -// OrderIndexByMarketDirectionSubaccountPrefix allows to obtain prefix of orders against a particular marketID, direction and price -func OrdersByMarketDirectionPricePrefix(marketID common.Hash, price *big.Int, isLong bool) []byte { - return append(MarketDirectionPrefix(marketID, isLong), common.LeftPadBytes(price.Bytes(), 32)...) -} - -// OrderIndexByMarketDirectionSubaccountOrderHashPrefix turns a marketID + direction + subaccountID + order hash to prefix used to get an order from the store. -func OrderIndexByMarketDirectionSubaccountOrderHashPrefix(marketID common.Hash, orderHash common.Hash, subaccountID common.Hash, isLong bool) []byte { - return append(OrderIndexByMarketDirectionSubaccountPrefix(marketID, subaccountID, isLong), orderHash.Bytes()...) -} - -// OrderIndexByMarketDirectionSubaccountPrefix allows to obtain prefix of orders against a particular marketID, subaccountID and direction -func OrderIndexByMarketDirectionSubaccountPrefix(marketID common.Hash, subaccountID common.Hash, isLong bool) []byte { - return append(MarketDirectionPrefix(marketID, isLong), subaccountID.Bytes()...) -} - -// MarketDirectionPrefix allows to obtain prefix against a particular marketID, direction -func MarketDirectionPrefix(marketID common.Hash, isLong bool) []byte { - direction := byte(0) - if isLong { - direction = byte(1) - } - return append(marketID.Bytes(), direction) -} - -// MarginInfoByExchangeSubaccountBaseCurrencyPrefix provides the prefix key to obtain a given subaccount's base currency -// margin info in a given exchange -func MarginInfoByExchangeSubaccountBaseCurrencyPrefix(exchangeAddress common.Address, subaccountID common.Hash, baseCurrencyAddress common.Address) []byte { - return append(MarginInfoByExchangeSubaccountPrefix(exchangeAddress, subaccountID), baseCurrencyAddress.Bytes()...) -} - -// MarginInfoByExchangeSubaccountPrefix provides the prefix key to obtain a given subaccount's margin info in a given exchange -func MarginInfoByExchangeSubaccountPrefix(exchangeAddress common.Address, subaccountID common.Hash) []byte { - return append(exchangeAddress.Bytes(), subaccountID.Bytes()...) -} - -// PositionInfoByExchangeSubaccountMarketIDPrefix provides the prefix key to obtain a given subaccount's position info -// in a given market in a given exchange -func PositionInfoByExchangeSubaccountMarketIDPrefix(exchangeAddress common.Address, subaccountID common.Hash, marketID common.Hash) []byte { - return append(exchangeAddress.Bytes(), append(subaccountID.Bytes(), marketID.Bytes()...)...) -} - -// TradePairsStoreKey turns a pair hash to key used to get it from the store. -func TradePairsStoreKey(hash common.Hash) []byte { - return append(TradePairsStoreKeyPrefix, hash.Bytes()...) -} diff --git a/chain/orders/types/module.go b/chain/orders/types/module.go deleted file mode 100644 index 7193a74c..00000000 --- a/chain/orders/types/module.go +++ /dev/null @@ -1 +0,0 @@ -package types \ No newline at end of file